-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Expand file tree
/
Copy pathindex.js
More file actions
3 lines (3 loc) · 777 KB
/
index.js
File metadata and controls
3 lines (3 loc) · 777 KB
1
2
3
/*! For license information please see index.js.LICENSE.txt */
(()=>{var e={8554:(e,t,n)=>{"use strict";n.d(t,{Xb:()=>f,Gd:()=>m,cu:()=>p});var r=n(655),i=n(7199),o=n(2844),a=n(1170),s=n(2343),l=n(1422),u=n(6769),c=n(7482),d=function(){function e(e){this.errors=0,this.sid=(0,o.DM)(),this.duration=0,this.status=i.$.Ok,this.init=!0,this.ignoreDuration=!1;var t=(0,a.ph)();this.timestamp=t,this.started=t,e&&this.update(e)}return e.prototype.update=function(e){if(void 0===e&&(e={}),e.user&&(!this.ipAddress&&e.user.ip_address&&(this.ipAddress=e.user.ip_address),this.did||e.did||(this.did=e.user.id||e.user.email||e.user.username)),this.timestamp=e.timestamp||(0,a.ph)(),e.ignoreDuration&&(this.ignoreDuration=e.ignoreDuration),e.sid&&(this.sid=32===e.sid.length?e.sid:(0,o.DM)()),void 0!==e.init&&(this.init=e.init),!this.did&&e.did&&(this.did=""+e.did),"number"==typeof e.started&&(this.started=e.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof e.duration)this.duration=e.duration;else{var t=this.timestamp-this.started;this.duration=t>=0?t:0}e.release&&(this.release=e.release),e.environment&&(this.environment=e.environment),!this.ipAddress&&e.ipAddress&&(this.ipAddress=e.ipAddress),!this.userAgent&&e.userAgent&&(this.userAgent=e.userAgent),"number"==typeof e.errors&&(this.errors=e.errors),e.status&&(this.status=e.status)},e.prototype.close=function(e){e?this.update({status:e}):this.status===i.$.Ok?this.update({status:i.$.Exited}):this.update()},e.prototype.toJSON=function(){return(0,c.Jr)({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:(0,c.Jr)({release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent})})},e}(),f=function(){function e(e,t,n){void 0===t&&(t=new u.s),void 0===n&&(n=4),this._version=n,this._stack=[{}],this.getStackTop().scope=t,this.bindClient(e)}return e.prototype.isOlderThan=function(e){return this._version<e},e.prototype.bindClient=function(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()},e.prototype.pushScope=function(){var e=u.s.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e},e.prototype.popScope=function(){return!(this.getStack().length<=1)&&!!this.getStack().pop()},e.prototype.withScope=function(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}},e.prototype.getClient=function(){return this.getStackTop().client},e.prototype.getScope=function(){return this.getStackTop().scope},e.prototype.getStack=function(){return this._stack},e.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},e.prototype.captureException=function(e,t){var n=this._lastEventId=(0,o.DM)(),i=t;if(!t){var a=void 0;try{throw new Error("Sentry syntheticException")}catch(e){a=e}i={originalException:e,syntheticException:a}}return this._invokeClient("captureException",e,(0,r.pi)((0,r.pi)({},i),{event_id:n})),n},e.prototype.captureMessage=function(e,t,n){var i=this._lastEventId=(0,o.DM)(),a=n;if(!n){var s=void 0;try{throw new Error(e)}catch(e){s=e}a={originalException:e,syntheticException:s}}return this._invokeClient("captureMessage",e,t,(0,r.pi)((0,r.pi)({},a),{event_id:i})),i},e.prototype.captureEvent=function(e,t){var n=this._lastEventId=(0,o.DM)();return this._invokeClient("captureEvent",e,(0,r.pi)((0,r.pi)({},t),{event_id:n})),n},e.prototype.lastEventId=function(){return this._lastEventId},e.prototype.addBreadcrumb=function(e,t){var n=this.getStackTop(),i=n.scope,s=n.client;if(i&&s){var l=s.getOptions&&s.getOptions()||{},u=l.beforeBreadcrumb,c=void 0===u?null:u,d=l.maxBreadcrumbs,f=void 0===d?100:d;if(!(f<=0)){var p=(0,a.yW)(),h=(0,r.pi)({timestamp:p},e),m=c?(0,o.Cf)((function(){return c(h,t)})):h;null!==m&&i.addBreadcrumb(m,f)}}},e.prototype.setUser=function(e){var t=this.getScope();t&&t.setUser(e)},e.prototype.setTags=function(e){var t=this.getScope();t&&t.setTags(e)},e.prototype.setExtras=function(e){var t=this.getScope();t&&t.setExtras(e)},e.prototype.setTag=function(e,t){var n=this.getScope();n&&n.setTag(e,t)},e.prototype.setExtra=function(e,t){var n=this.getScope();n&&n.setExtra(e,t)},e.prototype.setContext=function(e,t){var n=this.getScope();n&&n.setContext(e,t)},e.prototype.configureScope=function(e){var t=this.getStackTop(),n=t.scope,r=t.client;n&&r&&e(n)},e.prototype.run=function(e){var t=h(this);try{e(this)}finally{h(t)}},e.prototype.getIntegration=function(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return s.k.warn("Cannot retrieve integration "+e.id+" from the current Hub"),null}},e.prototype.startSpan=function(e){return this._callExtensionMethod("startSpan",e)},e.prototype.startTransaction=function(e,t){return this._callExtensionMethod("startTransaction",e,t)},e.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},e.prototype.captureSession=function(e){if(void 0===e&&(e=!1),e)return this.endSession();this._sendSessionUpdate()},e.prototype.endSession=function(){var e,t,n,r,i;null===(n=null===(t=null===(e=this.getStackTop())||void 0===e?void 0:e.scope)||void 0===t?void 0:t.getSession())||void 0===n||n.close(),this._sendSessionUpdate(),null===(i=null===(r=this.getStackTop())||void 0===r?void 0:r.scope)||void 0===i||i.setSession()},e.prototype.startSession=function(e){var t=this.getStackTop(),n=t.scope,a=t.client,s=a&&a.getOptions()||{},l=s.release,u=s.environment,c=((0,o.Rf)().navigator||{}).userAgent,f=new d((0,r.pi)((0,r.pi)((0,r.pi)({release:l,environment:u},n&&{user:n.getUser()}),c&&{userAgent:c}),e));if(n){var p=n.getSession&&n.getSession();p&&p.status===i.$.Ok&&p.update({status:i.$.Exited}),this.endSession(),n.setSession(f)}return f},e.prototype._sendSessionUpdate=function(){var e=this.getStackTop(),t=e.scope,n=e.client;if(t){var r=t.getSession&&t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}},e.prototype._invokeClient=function(e){for(var t,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=this.getStackTop(),a=o.scope,s=o.client;s&&s[e]&&(t=s)[e].apply(t,(0,r.fl)(n,[a]))},e.prototype._callExtensionMethod=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=p(),i=r.__SENTRY__;if(i&&i.extensions&&"function"==typeof i.extensions[e])return i.extensions[e].apply(this,t);s.k.warn("Extension method "+e+" couldn't be found, doing nothing.")},e}();function p(){var e=(0,o.Rf)();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function h(e){var t=p(),n=g(t);return y(t,e),n}function m(){var e=p();return v(e)&&!g(e).isOlderThan(4)||y(e,new f),(0,l.KV)()?function(e){var t,n,r;try{var i=null===(r=null===(n=null===(t=p().__SENTRY__)||void 0===t?void 0:t.extensions)||void 0===n?void 0:n.domain)||void 0===r?void 0:r.active;if(!i)return g(e);if(!v(i)||g(i).isOlderThan(4)){var o=g(e).getStackTop();y(i,new f(o.client,u.s.clone(o.scope)))}return g(i)}catch(t){return g(e)}}(e):g(e)}function v(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function g(e){return e&&e.__SENTRY__&&e.__SENTRY__.hub||(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=new f),e.__SENTRY__.hub}function y(e,t){return!!e&&(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=t,!0)}},6769:(e,t,n)=>{"use strict";n.d(t,{c:()=>c,s:()=>l});var r=n(655),i=n(7597),o=n(1170),a=n(6893),s=n(2844),l=function(){function e(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={}}return e.clone=function(t){var n=new e;return t&&(n._breadcrumbs=(0,r.fl)(t._breadcrumbs),n._tags=(0,r.pi)({},t._tags),n._extra=(0,r.pi)({},t._extra),n._contexts=(0,r.pi)({},t._contexts),n._user=t._user,n._level=t._level,n._span=t._span,n._session=t._session,n._transactionName=t._transactionName,n._fingerprint=t._fingerprint,n._eventProcessors=(0,r.fl)(t._eventProcessors),n._requestSession=t._requestSession),n},e.prototype.addScopeListener=function(e){this._scopeListeners.push(e)},e.prototype.addEventProcessor=function(e){return this._eventProcessors.push(e),this},e.prototype.setUser=function(e){return this._user=e||{},this._session&&this._session.update({user:e}),this._notifyScopeListeners(),this},e.prototype.getUser=function(){return this._user},e.prototype.getRequestSession=function(){return this._requestSession},e.prototype.setRequestSession=function(e){return this._requestSession=e,this},e.prototype.setTags=function(e){return this._tags=(0,r.pi)((0,r.pi)({},this._tags),e),this._notifyScopeListeners(),this},e.prototype.setTag=function(e,t){var n;return this._tags=(0,r.pi)((0,r.pi)({},this._tags),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setExtras=function(e){return this._extra=(0,r.pi)((0,r.pi)({},this._extra),e),this._notifyScopeListeners(),this},e.prototype.setExtra=function(e,t){var n;return this._extra=(0,r.pi)((0,r.pi)({},this._extra),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setFingerprint=function(e){return this._fingerprint=e,this._notifyScopeListeners(),this},e.prototype.setLevel=function(e){return this._level=e,this._notifyScopeListeners(),this},e.prototype.setTransactionName=function(e){return this._transactionName=e,this._notifyScopeListeners(),this},e.prototype.setTransaction=function(e){return this.setTransactionName(e)},e.prototype.setContext=function(e,t){var n;return null===t?delete this._contexts[e]:this._contexts=(0,r.pi)((0,r.pi)({},this._contexts),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setSpan=function(e){return this._span=e,this._notifyScopeListeners(),this},e.prototype.getSpan=function(){return this._span},e.prototype.getTransaction=function(){var e,t,n,r,i=this.getSpan();return(null===(e=i)||void 0===e?void 0:e.transaction)?null===(t=i)||void 0===t?void 0:t.transaction:(null===(r=null===(n=i)||void 0===n?void 0:n.spanRecorder)||void 0===r?void 0:r.spans[0])?i.spanRecorder.spans[0]:void 0},e.prototype.setSession=function(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this},e.prototype.getSession=function(){return this._session},e.prototype.update=function(t){if(!t)return this;if("function"==typeof t){var n=t(this);return n instanceof e?n:this}return t instanceof e?(this._tags=(0,r.pi)((0,r.pi)({},this._tags),t._tags),this._extra=(0,r.pi)((0,r.pi)({},this._extra),t._extra),this._contexts=(0,r.pi)((0,r.pi)({},this._contexts),t._contexts),t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession)):(0,i.PO)(t)&&(t=t,this._tags=(0,r.pi)((0,r.pi)({},this._tags),t.tags),this._extra=(0,r.pi)((0,r.pi)({},this._extra),t.extra),this._contexts=(0,r.pi)((0,r.pi)({},this._contexts),t.contexts),t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession)),this},e.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},e.prototype.addBreadcrumb=function(e,t){var n="number"==typeof t?Math.min(t,100):100;if(n<=0)return this;var i=(0,r.pi)({timestamp:(0,o.yW)()},e);return this._breadcrumbs=(0,r.fl)(this._breadcrumbs,[i]).slice(-n),this._notifyScopeListeners(),this},e.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},e.prototype.applyToEvent=function(e,t){var n;if(this._extra&&Object.keys(this._extra).length&&(e.extra=(0,r.pi)((0,r.pi)({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=(0,r.pi)((0,r.pi)({},this._tags),e.tags)),this._user&&Object.keys(this._user).length&&(e.user=(0,r.pi)((0,r.pi)({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=(0,r.pi)((0,r.pi)({},this._contexts),e.contexts)),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=(0,r.pi)({trace:this._span.getTraceContext()},e.contexts);var i=null===(n=this._span.transaction)||void 0===n?void 0:n.name;i&&(e.tags=(0,r.pi)({transaction:i},e.tags))}return this._applyFingerprint(e),e.breadcrumbs=(0,r.fl)(e.breadcrumbs||[],this._breadcrumbs),e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,this._notifyEventProcessors((0,r.fl)(u(),this._eventProcessors),e,t)},e.prototype._notifyEventProcessors=function(e,t,n,o){var s=this;return void 0===o&&(o=0),new a.c((function(a,l){var u=e[o];if(null===t||"function"!=typeof u)a(t);else{var c=u((0,r.pi)({},t),n);(0,i.J8)(c)?c.then((function(t){return s._notifyEventProcessors(e,t,n,o+1).then(a)})).then(null,l):s._notifyEventProcessors(e,c,n,o+1).then(a).then(null,l)}}))},e.prototype._notifyScopeListeners=function(){var e=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(t){t(e)})),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint},e}();function u(){var e=(0,s.Rf)();return e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.globalEventProcessors=e.__SENTRY__.globalEventProcessors||[],e.__SENTRY__.globalEventProcessors}function c(e){u().push(e)}},6141:(e,t,n)=>{"use strict";n.d(t,{ro:()=>y,lb:()=>g});var r,i=n(655),o=n(8554);!function(e){e.Explicit="explicitly_set",e.Sampler="client_sampler",e.Rate="client_rate",e.Inheritance="inheritance"}(r||(r={}));var a=n(2343),s=n(1422),l=n(9732),u=n(5734),c=n(3233);function d(){var e=(0,c.x1)();e&&(a.k.log("[Tracing] Transaction: "+u.p.InternalError+" -> Global error occured"),e.setStatus(u.p.InternalError))}var f=n(6458),p=n(3391);function h(){var e=this.getScope();if(e){var t=e.getSpan();if(t)return{"sentry-trace":t.toTraceparent()}}return{}}function m(e,t,n){return(0,c.zu)()?void 0!==e.sampled?(e.setMetadata({transactionSampling:{method:r.Explicit}}),e):("function"==typeof t.tracesSampler?(i=t.tracesSampler(n),e.setMetadata({transactionSampling:{method:r.Sampler,rate:Number(i)}})):void 0!==n.parentSampled?(i=n.parentSampled,e.setMetadata({transactionSampling:{method:r.Inheritance}})):(i=t.tracesSampleRate,e.setMetadata({transactionSampling:{method:r.Rate,rate:Number(i)}})),function(e){if(isNaN(e)||"number"!=typeof e&&"boolean"!=typeof e)return a.k.warn("[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got "+JSON.stringify(e)+" of type "+JSON.stringify(typeof e)+"."),!1;if(e<0||e>1)return a.k.warn("[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got "+e+"."),!1;return!0}(i)?i?(e.sampled=Math.random()<i,e.sampled?(a.k.log("[Tracing] starting "+e.op+" transaction - "+e.name),e):(a.k.log("[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = "+Number(i)+")"),e)):(a.k.log("[Tracing] Discarding transaction because "+("function"==typeof t.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0")),e.sampled=!1,e):(a.k.warn("[Tracing] Discarding transaction because of invalid sample rate."),e.sampled=!1,e)):(e.sampled=!1,e);var i}function v(e,t){var n,r,o=(null===(n=this.getClient())||void 0===n?void 0:n.getOptions())||{},a=new p.Y(e,this);return(a=m(a,o,(0,i.pi)({parentSampled:e.parentSampled,transactionContext:e},t))).sampled&&a.initSpanRecorder(null===(r=o._experiments)||void 0===r?void 0:r.maxSpans),a}function g(e,t,n,r,o){var a,s,l=(null===(a=e.getClient())||void 0===a?void 0:a.getOptions())||{},u=new f.io(t,e,n,r);return(u=m(u,l,(0,i.pi)({parentSampled:t.parentSampled,transactionContext:t},o))).sampled&&u.initSpanRecorder(null===(s=l._experiments)||void 0===s?void 0:s.maxSpans),u}function y(){var t;(t=(0,o.cu)()).__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=v),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=h)),(0,s.KV)()&&function(){var t=(0,o.cu)();if(t.__SENTRY__){var n={mongodb:function(){return new((0,s.l$)(e,"./integrations/mongo").Mongo)},mongoose:function(){return new((0,s.l$)(e,"./integrations/mongo").Mongo)({mongoose:!0})},mysql:function(){return new((0,s.l$)(e,"./integrations/mysql").Mysql)},pg:function(){return new((0,s.l$)(e,"./integrations/postgres").Postgres)}},r=Object.keys(n).filter((function(e){return!!(0,s.$y)(e)})).map((function(e){try{return n[e]()}catch(e){return}})).filter((function(e){return e}));r.length>0&&(t.__SENTRY__.integrations=(0,i.fl)(t.__SENTRY__.integrations||[],r))}}(),(0,l.o)({callback:d,type:"error"}),(0,l.o)({callback:d,type:"unhandledrejection"})}e=n.hmd(e)},6458:(e,t,n)=>{"use strict";n.d(t,{io:()=>d,nT:()=>u});var r=n(655),i=n(1170),o=n(2343),a=n(5334),s=n(5734),l=n(3391),u=1e3,c=function(e){function t(t,n,r,i){void 0===r&&(r="");var o=e.call(this,i)||this;return o._pushActivity=t,o._popActivity=n,o.transactionSpanId=r,o}return(0,r.ZT)(t,e),t.prototype.add=function(t){var n=this;t.spanId!==this.transactionSpanId&&(t.finish=function(e){t.endTimestamp="number"==typeof e?e:(0,i._I)(),n._popActivity(t.spanId)},void 0===t.endTimestamp&&this._pushActivity(t.spanId)),e.prototype.add.call(this,t)},t}(a.g),d=function(e){function t(t,n,r,i){void 0===r&&(r=u),void 0===i&&(i=!1);var a=e.call(this,t,n)||this;return a._idleHub=n,a._idleTimeout=r,a._onScope=i,a.activities={},a._heartbeatTimer=0,a._heartbeatCounter=0,a._finished=!1,a._beforeFinishCallbacks=[],n&&i&&(f(n),o.k.log("Setting idle transaction on scope. Span ID: "+a.spanId),n.configureScope((function(e){return e.setSpan(a)}))),a._initTimeout=setTimeout((function(){a._finished||a.finish()}),a._idleTimeout),a}return(0,r.ZT)(t,e),t.prototype.finish=function(t){var n,a,l=this;if(void 0===t&&(t=(0,i._I)()),this._finished=!0,this.activities={},this.spanRecorder){o.k.log("[Tracing] finishing IdleTransaction",new Date(1e3*t).toISOString(),this.op);try{for(var u=(0,r.XA)(this._beforeFinishCallbacks),c=u.next();!c.done;c=u.next()){(0,c.value)(this,t)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(n)throw n.error}}this.spanRecorder.spans=this.spanRecorder.spans.filter((function(e){if(e.spanId===l.spanId)return!0;e.endTimestamp||(e.endTimestamp=t,e.setStatus(s.p.Cancelled),o.k.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(e,void 0,2)));var n=e.startTimestamp<t;return n||o.k.log("[Tracing] discarding Span since it happened after Transaction was finished",JSON.stringify(e,void 0,2)),n})),o.k.log("[Tracing] flushing IdleTransaction")}else o.k.log("[Tracing] No active IdleTransaction");return this._onScope&&f(this._idleHub),e.prototype.finish.call(this,t)},t.prototype.registerBeforeFinishCallback=function(e){this._beforeFinishCallbacks.push(e)},t.prototype.initSpanRecorder=function(e){var t=this;if(!this.spanRecorder){this.spanRecorder=new c((function(e){t._finished||t._pushActivity(e)}),(function(e){t._finished||t._popActivity(e)}),this.spanId,e),o.k.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)},t.prototype._pushActivity=function(e){this._initTimeout&&(clearTimeout(this._initTimeout),this._initTimeout=void 0),o.k.log("[Tracing] pushActivity: "+e),this.activities[e]=!0,o.k.log("[Tracing] new activities count",Object.keys(this.activities).length)},t.prototype._popActivity=function(e){var t=this;if(this.activities[e]&&(o.k.log("[Tracing] popActivity "+e),delete this.activities[e],o.k.log("[Tracing] new activities count",Object.keys(this.activities).length)),0===Object.keys(this.activities).length){var n=this._idleTimeout,r=(0,i._I)()+n/1e3;setTimeout((function(){t._finished||t.finish(r)}),n)}},t.prototype._beat=function(){if(clearTimeout(this._heartbeatTimer),!this._finished){var e=Object.keys(this.activities),t=e.length?e.reduce((function(e,t){return e+t})):"";t===this._prevHeartbeatString?this._heartbeatCounter+=1:this._heartbeatCounter=1,this._prevHeartbeatString=t,this._heartbeatCounter>=3?(o.k.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus(s.p.DeadlineExceeded),this.setTag("heartbeat","failed"),this.finish()):this._pingHeartbeat()}},t.prototype._pingHeartbeat=function(){var e=this;o.k.log("pinging Heartbeat -> current counter: "+this._heartbeatCounter),this._heartbeatTimer=setTimeout((function(){e._beat()}),5e3)},t}(l.Y);function f(e){if(e){var t=e.getScope();if(t)t.getTransaction()&&t.setSpan(void 0)}}},5334:(e,t,n)=>{"use strict";n.d(t,{D:()=>u,g:()=>l});var r=n(655),i=n(2844),o=n(1170),a=n(7482),s=n(5734),l=function(){function e(e){void 0===e&&(e=1e3),this.spans=[],this._maxlen=e}return e.prototype.add=function(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)},e}(),u=function(){function e(e){if(this.traceId=(0,i.DM)(),this.spanId=(0,i.DM)().substring(16),this.startTimestamp=(0,o._I)(),this.tags={},this.data={},!e)return this;e.traceId&&(this.traceId=e.traceId),e.spanId&&(this.spanId=e.spanId),e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.data&&(this.data=e.data),e.tags&&(this.tags=e.tags),e.status&&(this.status=e.status),e.startTimestamp&&(this.startTimestamp=e.startTimestamp),e.endTimestamp&&(this.endTimestamp=e.endTimestamp)}return e.prototype.child=function(e){return this.startChild(e)},e.prototype.startChild=function(t){var n=new e((0,r.pi)((0,r.pi)({},t),{parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId}));return n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n),n.transaction=this.transaction,n},e.prototype.setTag=function(e,t){var n;return this.tags=(0,r.pi)((0,r.pi)({},this.tags),((n={})[e]=t,n)),this},e.prototype.setData=function(e,t){var n;return this.data=(0,r.pi)((0,r.pi)({},this.data),((n={})[e]=t,n)),this},e.prototype.setStatus=function(e){return this.status=e,this},e.prototype.setHttpStatus=function(e){this.setTag("http.status_code",String(e));var t=s.p.fromHttpCode(e);return t!==s.p.UnknownError&&this.setStatus(t),this},e.prototype.isSuccess=function(){return this.status===s.p.Ok},e.prototype.finish=function(e){this.endTimestamp="number"==typeof e?e:(0,o._I)()},e.prototype.toTraceparent=function(){var e="";return void 0!==this.sampled&&(e=this.sampled?"-1":"-0"),this.traceId+"-"+this.spanId+e},e.prototype.toContext=function(){return(0,a.Jr)({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})},e.prototype.updateWithContext=function(e){var t,n,r,i,o;return this.data=null!=(t=e.data)?t:{},this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=null!=(n=e.spanId)?n:this.spanId,this.startTimestamp=null!=(r=e.startTimestamp)?r:this.startTimestamp,this.status=e.status,this.tags=null!=(i=e.tags)?i:{},this.traceId=null!=(o=e.traceId)?o:this.traceId,this},e.prototype.getTraceContext=function(){return(0,a.Jr)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})},e.prototype.toJSON=function(){return(0,a.Jr)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId})},e}()},5734:(e,t,n)=>{"use strict";var r;n.d(t,{p:()=>r}),function(e){e.Ok="ok",e.DeadlineExceeded="deadline_exceeded",e.Unauthenticated="unauthenticated",e.PermissionDenied="permission_denied",e.NotFound="not_found",e.ResourceExhausted="resource_exhausted",e.InvalidArgument="invalid_argument",e.Unimplemented="unimplemented",e.Unavailable="unavailable",e.InternalError="internal_error",e.UnknownError="unknown_error",e.Cancelled="cancelled",e.AlreadyExists="already_exists",e.FailedPrecondition="failed_precondition",e.Aborted="aborted",e.OutOfRange="out_of_range",e.DataLoss="data_loss"}(r||(r={})),function(e){e.fromHttpCode=function(t){if(t<400)return e.Ok;if(t>=400&&t<500)switch(t){case 401:return e.Unauthenticated;case 403:return e.PermissionDenied;case 404:return e.NotFound;case 409:return e.AlreadyExists;case 413:return e.FailedPrecondition;case 429:return e.ResourceExhausted;default:return e.InvalidArgument}if(t>=500&&t<600)switch(t){case 501:return e.Unimplemented;case 503:return e.Unavailable;case 504:return e.DeadlineExceeded;default:return e.InternalError}return e.UnknownError}}(r||(r={}))},3391:(e,t,n)=>{"use strict";n.d(t,{Y:()=>u});var r=n(655),i=n(8554),o=n(7597),a=n(2343),s=n(7482),l=n(5334),u=function(e){function t(t,n){var r=e.call(this,t)||this;return r._measurements={},r._hub=(0,i.Gd)(),(0,o.V9)(n,i.Xb)&&(r._hub=n),r.name=t.name||"",r.metadata=t.metadata||{},r._trimEnd=t.trimEnd,r.transaction=r,r}return(0,r.ZT)(t,e),t.prototype.setName=function(e){this.name=e},t.prototype.initSpanRecorder=function(e){void 0===e&&(e=1e3),this.spanRecorder||(this.spanRecorder=new l.g(e)),this.spanRecorder.add(this)},t.prototype.setMeasurements=function(e){this._measurements=(0,r.pi)({},e)},t.prototype.setMetadata=function(e){this.metadata=(0,r.pi)((0,r.pi)({},this.metadata),e)},t.prototype.finish=function(t){var n=this;if(void 0===this.endTimestamp){if(this.name||(a.k.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),e.prototype.finish.call(this,t),!0===this.sampled){var r=this.spanRecorder?this.spanRecorder.spans.filter((function(e){return e!==n&&e.endTimestamp})):[];this._trimEnd&&r.length>0&&(this.endTimestamp=r.reduce((function(e,t){return e.endTimestamp&&t.endTimestamp?e.endTimestamp>t.endTimestamp?e:t:e})).endTimestamp);var i={contexts:{trace:this.getTraceContext()},spans:r,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",debug_meta:this.metadata};return Object.keys(this._measurements).length>0&&(a.k.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),a.k.log("[Tracing] Finishing "+this.op+" transaction: "+this.name+"."),this._hub.captureEvent(i)}a.k.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled.")}},t.prototype.toContext=function(){var t=e.prototype.toContext.call(this);return(0,s.Jr)((0,r.pi)((0,r.pi)({},t),{name:this.name,trimEnd:this._trimEnd}))},t.prototype.updateWithContext=function(t){var n;return e.prototype.updateWithContext.call(this,t),this.name=null!=(n=t.name)?n:"",this._trimEnd=t.trimEnd,this},t}(l.D)},3233:(e,t,n)=>{"use strict";n.d(t,{WB:()=>u,XL:()=>l,qG:()=>a,x1:()=>s,zu:()=>o});var r=n(8554),i=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function o(e){var t;return void 0===e&&(e=null===(t=(0,r.Gd)().getClient())||void 0===t?void 0:t.getOptions()),!!e&&("tracesSampleRate"in e||"tracesSampler"in e)}function a(e){var t=e.match(i);if(t){var n=void 0;return"1"===t[3]?n=!0:"0"===t[3]&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}}function s(e){var t,n;return void 0===e&&(e=(0,r.Gd)()),null===(n=null===(t=e)||void 0===t?void 0:t.getScope())||void 0===n?void 0:n.getTransaction()}function l(e){return e/1e3}function u(e){return 1e3*e}},7199:(e,t,n)=>{"use strict";var r,i;n.d(t,{$:()=>r}),function(e){e.Ok="ok",e.Exited="exited",e.Crashed="crashed",e.Abnormal="abnormal"}(r||(r={})),function(e){e.Ok="ok",e.Errored="errored",e.Crashed="crashed"}(i||(i={}))},8464:(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var r=n(7597);function i(e,t){try{for(var n=e,r=[],i=0,a=0,s=" > ".length,l=void 0;n&&i++<5&&!("html"===(l=o(n,t))||i>1&&a+r.length*s+l.length>=80);)r.push(l),a+=l.length,n=n.parentNode;return r.reverse().join(" > ")}catch(e){return"<unknown>"}}function o(e,t){var n,i,o,a,s,l,u,c=e,d=[];if(!c||!c.tagName)return"";d.push(c.tagName.toLowerCase());var f=(null===(n=t)||void 0===n?void 0:n.length)?t.filter((function(e){return c.getAttribute(e)})).map((function(e){return[e,c.getAttribute(e)]})):null;if(null===(i=f)||void 0===i?void 0:i.length)f.forEach((function(e){d.push("["+e[0]+'="'+e[1]+'"]')}));else if(c.id&&d.push("#"+c.id),(o=c.className)&&(0,r.HD)(o))for(a=o.split(/\s+/),u=0;u<a.length;u++)d.push("."+a[u]);var p=["type","name","title","alt"];for(u=0;u<p.length;u++)s=p[u],(l=c.getAttribute(s))&&d.push("["+s+'="'+l+'"]');return d.join("")}},9732:(e,t,n)=>{"use strict";n.d(t,{o:()=>m});var r,i=n(655),o=n(7597),a=n(2343),s=n(2844),l=n(7482),u=n(360),c=n(8823),d=(0,s.Rf)(),f={},p={};function h(e){if(!p[e])switch(p[e]=!0,e){case"console":!function(){if(!("console"in d))return;["debug","info","warn","error","log","assert"].forEach((function(e){e in d.console&&(0,l.hl)(d.console,e,(function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];v("console",{args:n,level:e}),t&&Function.prototype.apply.call(t,d.console,n)}}))}))}();break;case"dom":!function(){if(!("document"in d))return;var e=v.bind(null,"dom"),t=x(e,!0);d.document.addEventListener("click",t,!1),d.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((function(t){var n=d[t]&&d[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,l.hl)(n,"addEventListener",(function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{var o=this,a=o.__sentry_instrumentation_handlers__=o.__sentry_instrumentation_handlers__||{},s=a[n]=a[n]||{refCount:0};if(!s.handler){var l=x(e);s.handler=l,t.call(this,n,l,i)}s.refCount+=1}catch(e){}return t.call(this,n,r,i)}})),(0,l.hl)(n,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{var i=this,o=i.__sentry_instrumentation_handlers__||{},a=o[t];a&&(a.refCount-=1,a.refCount<=0&&(e.call(this,t,a.handler,r),a.handler=void 0,delete o[t]),0===Object.keys(o).length&&delete i.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,r)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in d))return;var e=[],t=[],n=XMLHttpRequest.prototype;(0,l.hl)(n,"open",(function(n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=this,s=r[1];a.__sentry_xhr__={method:(0,o.HD)(r[0])?r[0].toUpperCase():r[0],url:r[1]},(0,o.HD)(s)&&"POST"===a.__sentry_xhr__.method&&s.match(/sentry_key/)&&(a.__sentry_own_request__=!0);var u=function(){if(4===a.readyState){try{a.__sentry_xhr__&&(a.__sentry_xhr__.status_code=a.status)}catch(e){}try{var n=e.indexOf(a);if(-1!==n){e.splice(n);var i=t.splice(n)[0];a.__sentry_xhr__&&void 0!==i[0]&&(a.__sentry_xhr__.body=i[0])}}catch(e){}v("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:a})}};return"onreadystatechange"in a&&"function"==typeof a.onreadystatechange?(0,l.hl)(a,"onreadystatechange",(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return u(),e.apply(a,t)}})):a.addEventListener("readystatechange",u),n.apply(a,r)}})),(0,l.hl)(n,"send",(function(n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return e.push(this),t.push(r),v("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),n.apply(this,r)}}))}();break;case"fetch":!function(){if(!(0,c.t$)())return;(0,l.hl)(d,"fetch",(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r={args:t,fetchData:{method:g(t),url:y(t)},startTimestamp:Date.now()};return v("fetch",(0,i.pi)({},r)),e.apply(d,t).then((function(e){return v("fetch",(0,i.pi)((0,i.pi)({},r),{endTimestamp:Date.now(),response:e})),e}),(function(e){throw v("fetch",(0,i.pi)((0,i.pi)({},r),{endTimestamp:Date.now(),error:e})),e}))}}))}();break;case"history":!function(){if(!(0,c.Bf)())return;var e=d.onpopstate;function t(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=t.length>2?t[2]:void 0;if(i){var o=r,a=String(i);r=a,v("history",{from:o,to:a})}return e.apply(this,t)}}d.onpopstate=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=d.location.href,o=r;if(r=i,v("history",{from:o,to:i}),e)try{return e.apply(this,t)}catch(e){}},(0,l.hl)(d.history,"pushState",t),(0,l.hl)(d.history,"replaceState",t)}();break;case"error":k=d.onerror,d.onerror=function(e,t,n,r,i){return v("error",{column:r,error:i,line:n,msg:e,url:t}),!!k&&k.apply(this,arguments)};break;case"unhandledrejection":_=d.onunhandledrejection,d.onunhandledrejection=function(e){return v("unhandledrejection",e),!_||_.apply(this,arguments)};break;default:a.k.warn("unknown instrumentation type:",e)}}function m(e){e&&"string"==typeof e.type&&"function"==typeof e.callback&&(f[e.type]=f[e.type]||[],f[e.type].push(e.callback),h(e.type))}function v(e,t){var n,r;if(e&&f[e])try{for(var o=(0,i.XA)(f[e]||[]),s=o.next();!s.done;s=o.next()){var l=s.value;try{l(t)}catch(t){a.k.error("Error while triggering instrumentation handler.\nType: "+e+"\nName: "+(0,u.$)(l)+"\nError: "+t)}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}function g(e){return void 0===e&&(e=[]),"Request"in d&&(0,o.V9)(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}function y(e){return void 0===e&&(e=[]),"string"==typeof e[0]?e[0]:"Request"in d&&(0,o.V9)(e[0],Request)?e[0].url:String(e[0])}var b,w;function x(e,t){return void 0===t&&(t=!1),function(n){if(n&&w!==n&&!function(e){if("keypress"!==e.type)return!1;try{var t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch(e){}return!0}(n)){var r="keypress"===n.type?"input":n.type;(void 0===b||function(e,t){if(!e)return!0;if(e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(e){}return!1}(w,n))&&(e({event:n,name:r,global:t}),w=n),clearTimeout(b),b=d.setTimeout((function(){b=void 0}),1e3)}}}var k=null;var _=null},7597:(e,t,n)=>{"use strict";function r(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return m(e,Error)}}function i(e){return"[object ErrorEvent]"===Object.prototype.toString.call(e)}function o(e){return"[object DOMError]"===Object.prototype.toString.call(e)}function a(e){return"[object DOMException]"===Object.prototype.toString.call(e)}function s(e){return"[object String]"===Object.prototype.toString.call(e)}function l(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function u(e){return"[object Object]"===Object.prototype.toString.call(e)}function c(e){return"undefined"!=typeof Event&&m(e,Event)}function d(e){return"undefined"!=typeof Element&&m(e,Element)}function f(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function p(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function h(e){return u(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function m(e,t){try{return e instanceof t}catch(e){return!1}}n.d(t,{Cy:()=>h,HD:()=>s,J8:()=>p,Kj:()=>f,PO:()=>u,TX:()=>o,V9:()=>m,VW:()=>i,VZ:()=>r,cO:()=>c,fm:()=>a,kK:()=>d,pt:()=>l})},2343:(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var r=n(2844),i=(0,r.Rf)(),o="Sentry Logger ",a=function(){function e(){this._enabled=!1}return e.prototype.disable=function(){this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&(0,r.Cf)((function(){i.console.log(o+"[Log]: "+e.join(" "))}))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&(0,r.Cf)((function(){i.console.warn(o+"[Warn]: "+e.join(" "))}))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&(0,r.Cf)((function(){i.console.error(o+"[Error]: "+e.join(" "))}))},e}();i.__SENTRY__=i.__SENTRY__||{};var s=i.__SENTRY__.logger||(i.__SENTRY__.logger=new a)},2844:(e,t,n)=>{"use strict";n.d(t,{Cf:()=>u,DM:()=>a,Db:()=>c,EG:()=>d,JY:()=>p,Rf:()=>o,en:()=>s,jH:()=>l,l4:()=>f});var r=n(1422),i={};function o(){return(0,r.KV)()?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:i}function a(){var e=o(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var n=new Uint16Array(8);t.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(e){for(var t=e.toString(16);t.length<4;)t="0"+t;return t};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function s(e){if(!e)return{};var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+n+r}}function l(e){if(e.message)return e.message;if(e.exception&&e.exception.values&&e.exception.values[0]){var t=e.exception.values[0];return t.type&&t.value?t.type+": "+t.value:t.type||t.value||e.event_id||"<unknown>"}return e.event_id||"<unknown>"}function u(e){var t=o();if(!("console"in t))return e();var n=t.console,r={};["debug","info","warn","error","log","assert"].forEach((function(e){e in t.console&&n[e].__sentry_original__&&(r[e]=n[e],n[e]=n[e].__sentry_original__)}));var i=e();return Object.keys(r).forEach((function(e){n[e]=r[e]})),i}function c(e,t,n){e.exception=e.exception||{},e.exception.values=e.exception.values||[],e.exception.values[0]=e.exception.values[0]||{},e.exception.values[0].value=e.exception.values[0].value||t||"",e.exception.values[0].type=e.exception.values[0].type||n||"Error"}function d(e,t){void 0===t&&(t={});try{e.exception.values[0].mechanism=e.exception.values[0].mechanism||{},Object.keys(t).forEach((function(n){e.exception.values[0].mechanism[n]=t[n]}))}catch(e){}}function f(){try{return document.location.href}catch(e){return""}}function p(e,t){if(!t)return 6e4;var n=parseInt(""+t,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+t);return isNaN(r)?6e4:r-e}},1422:(e,t,n)=>{"use strict";function r(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function i(e,t){return e.require(t)}function o(t){var n;try{n=i(e,t)}catch(e){}try{var r=i(e,"process").cwd;n=i(e,r()+"/node_modules/"+t)}catch(e){}return n}n.d(t,{$y:()=>o,KV:()=>r,l$:()=>i}),e=n.hmd(e)},7482:(e,t,n)=>{"use strict";n.d(t,{Jr:()=>y,zf:()=>g,hl:()=>u,Fv:()=>v,Qy:()=>p,_j:()=>c});var r=n(655),i=n(8464),o=n(7597),a=function(){function e(){this._hasWeakSet="function"==typeof WeakSet,this._inner=this._hasWeakSet?new WeakSet:[]}return e.prototype.memoize=function(e){if(this._hasWeakSet)return!!this._inner.has(e)||(this._inner.add(e),!1);for(var t=0;t<this._inner.length;t++){if(this._inner[t]===e)return!0}return this._inner.push(e),!1},e.prototype.unmemoize=function(e){if(this._hasWeakSet)this._inner.delete(e);else for(var t=0;t<this._inner.length;t++)if(this._inner[t]===e){this._inner.splice(t,1);break}},e}(),s=n(360),l=n(7321);function u(e,t,n){if(t in e){var r=e[t],i=n(r);if("function"==typeof i)try{i.prototype=i.prototype||{},Object.defineProperties(i,{__sentry_original__:{enumerable:!1,value:r}})}catch(e){}e[t]=i}}function c(e){return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}function d(e){if((0,o.VZ)(e)){var t=e,n={message:t.message,name:t.name,stack:t.stack};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}if((0,o.cO)(e)){var a=e,s={};s.type=a.type;try{s.target=(0,o.kK)(a.target)?(0,i.R)(a.target):Object.prototype.toString.call(a.target)}catch(e){s.target="<unknown>"}try{s.currentTarget=(0,o.kK)(a.currentTarget)?(0,i.R)(a.currentTarget):Object.prototype.toString.call(a.currentTarget)}catch(e){s.currentTarget="<unknown>"}for(var r in"undefined"!=typeof CustomEvent&&(0,o.V9)(e,CustomEvent)&&(s.detail=a.detail),a)Object.prototype.hasOwnProperty.call(a,r)&&(s[r]=a);return s}return e}function f(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}function p(e,t,n){void 0===t&&(t=3),void 0===n&&(n=102400);var r=v(e,t);return f(r)>n?p(e,t-1,n):r}function h(e,t){return"domain"===t&&e&&"object"==typeof e&&e._events?"[Domain]":"domainEmitter"===t?"[DomainEmitter]":void 0!==n.g&&e===n.g?"[Global]":"undefined"!=typeof window&&e===window?"[Window]":"undefined"!=typeof document&&e===document?"[Document]":(0,o.Cy)(e)?"[SyntheticEvent]":"number"==typeof e&&e!=e?"[NaN]":void 0===e?"[undefined]":"function"==typeof e?"[Function: "+(0,s.$)(e)+"]":"symbol"==typeof e?"["+String(e)+"]":"bigint"==typeof e?"[BigInt: "+String(e)+"]":e}function m(e,t,n,r){if(void 0===n&&(n=1/0),void 0===r&&(r=new a),0===n)return function(e){var t=Object.prototype.toString.call(e);if("string"==typeof e)return e;if("[object Object]"===t)return"[Object]";if("[object Array]"===t)return"[Array]";var n=h(e);return(0,o.pt)(n)?n:t}(t);if(null!=t&&"function"==typeof t.toJSON)return t.toJSON();var i=h(t,e);if((0,o.pt)(i))return i;var s=d(t),l=Array.isArray(t)?[]:{};if(r.memoize(t))return"[Circular ~]";for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(l[u]=m(u,s[u],n-1,r));return r.unmemoize(t),l}function v(e,t){try{return JSON.parse(JSON.stringify(e,(function(e,n){return m(e,n,t)})))}catch(e){return"**non-serializable**"}}function g(e,t){void 0===t&&(t=40);var n=Object.keys(d(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return(0,l.$G)(n[0],t);for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>t))return r===n.length?i:(0,l.$G)(i,t)}return""}function y(e){var t,n;if((0,o.PO)(e)){var i=e,a={};try{for(var s=(0,r.XA)(Object.keys(i)),l=s.next();!l.done;l=s.next()){var u=l.value;void 0!==i[u]&&(a[u]=y(i[u]))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a}return Array.isArray(e)?e.map(y):e}},360:(e,t,n)=>{"use strict";n.d(t,{$:()=>i});var r="<anonymous>";function i(e){try{return e&&"function"==typeof e&&e.name||r}catch(e){return r}}},7321:(e,t,n)=>{"use strict";n.d(t,{$G:()=>i,nK:()=>o,zC:()=>a});var r=n(7597);function i(e,t){return void 0===t&&(t=0),"string"!=typeof e||0===t||e.length<=t?e:e.substr(0,t)+"..."}function o(e,t){if(!Array.isArray(e))return"";for(var n=[],r=0;r<e.length;r++){var i=e[r];try{n.push(String(i))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}function a(e,t){return!!(0,r.HD)(e)&&((0,r.Kj)(t)?t.test(e):"string"==typeof t&&-1!==e.indexOf(t))}},8823:(e,t,n)=>{"use strict";n.d(t,{Ak:()=>o,Bf:()=>u,Du:()=>a,hv:()=>l,t$:()=>s});var r=n(2343),i=n(2844);function o(){if(!("fetch"in(0,i.Rf)()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(e){return!1}}function a(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function s(){if(!o())return!1;var e=(0,i.Rf)();if(a(e.fetch))return!0;var t=!1,n=e.document;if(n&&"function"==typeof n.createElement)try{var s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s),s.contentWindow&&s.contentWindow.fetch&&(t=a(s.contentWindow.fetch)),n.head.removeChild(s)}catch(e){r.k.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}function l(){if(!o())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(e){return!1}}function u(){var e=(0,i.Rf)(),t=e.chrome,n=t&&t.app&&t.app.runtime,r="history"in e&&!!e.history.pushState&&!!e.history.replaceState;return!n&&r}},6893:(e,t,n)=>{"use strict";n.d(t,{c:()=>o});var r,i=n(7597);!function(e){e.PENDING="PENDING",e.RESOLVED="RESOLVED",e.REJECTED="REJECTED"}(r||(r={}));var o=function(){function e(e){var t=this;this._state=r.PENDING,this._handlers=[],this._resolve=function(e){t._setResult(r.RESOLVED,e)},this._reject=function(e){t._setResult(r.REJECTED,e)},this._setResult=function(e,n){t._state===r.PENDING&&((0,i.J8)(n)?n.then(t._resolve,t._reject):(t._state=e,t._value=n,t._executeHandlers()))},this._attachHandler=function(e){t._handlers=t._handlers.concat(e),t._executeHandlers()},this._executeHandlers=function(){if(t._state!==r.PENDING){var e=t._handlers.slice();t._handlers=[],e.forEach((function(e){e.done||(t._state===r.RESOLVED&&e.onfulfilled&&e.onfulfilled(t._value),t._state===r.REJECTED&&e.onrejected&&e.onrejected(t._value),e.done=!0)}))}};try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}return e.resolve=function(t){return new e((function(e){e(t)}))},e.reject=function(t){return new e((function(e,n){n(t)}))},e.all=function(t){return new e((function(n,r){if(Array.isArray(t))if(0!==t.length){var i=t.length,o=[];t.forEach((function(t,a){e.resolve(t).then((function(e){o[a]=e,0===(i-=1)&&n(o)})).then(null,r)}))}else n([]);else r(new TypeError("Promise.all requires an array as input."))}))},e.prototype.then=function(t,n){var r=this;return new e((function(e,i){r._attachHandler({done:!1,onfulfilled:function(n){if(t)try{return void e(t(n))}catch(e){return void i(e)}else e(n)},onrejected:function(t){if(n)try{return void e(n(t))}catch(e){return void i(e)}else i(t)}})}))},e.prototype.catch=function(e){return this.then((function(e){return e}),e)},e.prototype.finally=function(t){var n=this;return new e((function(e,r){var i,o;return n.then((function(e){o=!1,i=e,t&&t()}),(function(e){o=!0,i=e,t&&t()})).then((function(){o?r(i):e(i)}))}))},e.prototype.toString=function(){return"[object SyncPromise]"},e}()},1170:(e,t,n)=>{"use strict";n.d(t,{Z1:()=>d,_I:()=>c,ph:()=>u,yW:()=>l});var r=n(2844),i=n(1422);e=n.hmd(e);var o={nowSeconds:function(){return Date.now()/1e3}};var a=(0,i.KV)()?function(){try{return(0,i.l$)(e,"perf_hooks").performance}catch(e){return}}():function(){var e=(0,r.Rf)().performance;if(e&&e.now)return{now:function(){return e.now()},timeOrigin:Date.now()-e.now()}}(),s=void 0===a?o:{nowSeconds:function(){return(a.timeOrigin+a.now())/1e3}},l=o.nowSeconds.bind(o),u=s.nowSeconds.bind(s),c=u,d=function(){var e=(0,r.Rf)().performance;if(e&&e.now){var t=36e5,n=e.now(),i=Date.now(),o=e.timeOrigin?Math.abs(e.timeOrigin+n-i):t,a=o<t,s=e.timing&&e.timing.navigationStart,l="number"==typeof s?Math.abs(s+n-i):t;return a||l<t?o<=l?("timeOrigin",e.timeOrigin):("navigationStart",s):("dateNow",i)}"none"}()},5792:function(e){e.exports=function(){"use strict";for(var e=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e<t?t:e>n?n:e},t=function(t){t._clipped=!1,t._unclipped=t.slice(0);for(var n=0;n<=3;n++)n<3?((t[n]<0||t[n]>255)&&(t._clipped=!0),t[n]=e(t[n],0,255)):3===n&&(t[n]=e(t[n],0,1));return t},n={},r=0,i=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];r<i.length;r+=1){var o=i[r];n["[object "+o+"]"]=o.toLowerCase()}var a=function(e){return n[Object.prototype.toString.call(e)]||"object"},s=function(e,t){return void 0===t&&(t=null),e.length>=3?Array.prototype.slice.call(e):"object"==a(e[0])&&t?t.split("").filter((function(t){return void 0!==e[0][t]})).map((function(t){return e[0][t]})):e[0]},l=function(e){if(e.length<2)return null;var t=e.length-1;return"string"==a(e[t])?e[t].toLowerCase():null},u=Math.PI,c={clip_rgb:t,limit:e,type:a,unpack:s,last:l,PI:u,TWOPI:2*u,PITHIRD:u/3,DEG2RAD:u/180,RAD2DEG:180/u},d={format:{},autodetect:[]},f=c.last,p=c.clip_rgb,h=c.type,m=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=this;if("object"===h(e[0])&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];var r=f(e),i=!1;if(!r){i=!0,d.sorted||(d.autodetect=d.autodetect.sort((function(e,t){return t.p-e.p})),d.sorted=!0);for(var o=0,a=d.autodetect;o<a.length;o+=1){var s=a[o];if(r=s.test.apply(s,e))break}}if(!d.format[r])throw new Error("unknown format: "+e);var l=d.format[r].apply(null,i?e:e.slice(0,-1));n._rgb=p(l),3===n._rgb.length&&n._rgb.push(1)};m.prototype.toString=function(){return"function"==h(this.hex)?this.hex():"["+this._rgb.join(",")+"]"};var v=m,g=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(g.Color,[null].concat(e)))};g.Color=v,g.version="2.1.1";var y=g,b=c.unpack,w=Math.max,x=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=b(e,"rgb"),r=n[0],i=n[1],o=n[2],a=1-w(r/=255,w(i/=255,o/=255)),s=a<1?1/(1-a):0;return[(1-r-a)*s,(1-i-a)*s,(1-o-a)*s,a]},k=c.unpack,_=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=(e=k(e,"cmyk"))[0],r=e[1],i=e[2],o=e[3],a=e.length>4?e[4]:1;return 1===o?[0,0,0,a]:[n>=1?0:255*(1-n)*(1-o),r>=1?0:255*(1-r)*(1-o),i>=1?0:255*(1-i)*(1-o),a]},S=c.unpack,C=c.type;v.prototype.cmyk=function(){return x(this._rgb)},y.cmyk=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["cmyk"])))},d.format.cmyk=_,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=S(e,"cmyk"),"array"===C(e)&&4===e.length)return"cmyk"}});var E=c.unpack,j=c.last,T=function(e){return Math.round(100*e)/100},O=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=E(e,"hsla"),r=j(e)||"lsa";return n[0]=T(n[0]||0),n[1]=T(100*n[1])+"%",n[2]=T(100*n[2])+"%","hsla"===r||n.length>3&&n[3]<1?(n[3]=n.length>3?n[3]:1,r="hsla"):n.length=3,r+"("+n.join(",")+")"},N=c.unpack,M=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=(e=N(e,"rgba"))[0],r=e[1],i=e[2];n/=255,r/=255,i/=255;var o,a,s=Math.min(n,r,i),l=Math.max(n,r,i),u=(l+s)/2;return l===s?(o=0,a=Number.NaN):o=u<.5?(l-s)/(l+s):(l-s)/(2-l-s),n==l?a=(r-i)/(l-s):r==l?a=2+(i-n)/(l-s):i==l&&(a=4+(n-r)/(l-s)),(a*=60)<0&&(a+=360),e.length>3&&void 0!==e[3]?[a,o,u,e[3]]:[a,o,u]},L=c.unpack,P=c.last,A=Math.round,D=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=L(e,"rgba"),r=P(e)||"rgb";return"hsl"==r.substr(0,3)?O(M(n),r):(n[0]=A(n[0]),n[1]=A(n[1]),n[2]=A(n[2]),("rgba"===r||n.length>3&&n[3]<1)&&(n[3]=n.length>3?n[3]:1,r="rgba"),r+"("+n.slice(0,"rgb"===r?3:4).join(",")+")")},R=c.unpack,I=Math.round,F=function(){for(var e,t=[],n=arguments.length;n--;)t[n]=arguments[n];var r,i,o,a=(t=R(t,"hsl"))[0],s=t[1],l=t[2];if(0===s)r=i=o=255*l;else{var u=[0,0,0],c=[0,0,0],d=l<.5?l*(1+s):l+s-l*s,f=2*l-d,p=a/360;u[0]=p+1/3,u[1]=p,u[2]=p-1/3;for(var h=0;h<3;h++)u[h]<0&&(u[h]+=1),u[h]>1&&(u[h]-=1),6*u[h]<1?c[h]=f+6*(d-f)*u[h]:2*u[h]<1?c[h]=d:3*u[h]<2?c[h]=f+(d-f)*(2/3-u[h])*6:c[h]=f;r=(e=[I(255*c[0]),I(255*c[1]),I(255*c[2])])[0],i=e[1],o=e[2]}return t.length>3?[r,i,o,t[3]]:[r,i,o,1]},z=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,U=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,H=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,W=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,B=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,$=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,V=Math.round,q=function(e){var t;if(e=e.toLowerCase().trim(),d.format.named)try{return d.format.named(e)}catch(e){}if(t=e.match(z)){for(var n=t.slice(1,4),r=0;r<3;r++)n[r]=+n[r];return n[3]=1,n}if(t=e.match(U)){for(var i=t.slice(1,5),o=0;o<4;o++)i[o]=+i[o];return i}if(t=e.match(H)){for(var a=t.slice(1,4),s=0;s<3;s++)a[s]=V(2.55*a[s]);return a[3]=1,a}if(t=e.match(W)){for(var l=t.slice(1,5),u=0;u<3;u++)l[u]=V(2.55*l[u]);return l[3]=+l[3],l}if(t=e.match(B)){var c=t.slice(1,4);c[1]*=.01,c[2]*=.01;var f=F(c);return f[3]=1,f}if(t=e.match($)){var p=t.slice(1,4);p[1]*=.01,p[2]*=.01;var h=F(p);return h[3]=+t[4],h}};q.test=function(e){return z.test(e)||U.test(e)||H.test(e)||W.test(e)||B.test(e)||$.test(e)};var G=q,Y=c.type;v.prototype.css=function(e){return D(this._rgb,e)},y.css=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["css"])))},d.format.css=G,d.autodetect.push({p:5,test:function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];if(!t.length&&"string"===Y(e)&&G.test(e))return"css"}});var X=c.unpack;d.format.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=X(e,"rgba");return n[0]*=255,n[1]*=255,n[2]*=255,n},y.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["gl"])))},v.prototype.gl=function(){var e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]};var K=c.unpack,Q=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r=K(e,"rgb"),i=r[0],o=r[1],a=r[2],s=Math.min(i,o,a),l=Math.max(i,o,a),u=l-s,c=100*u/255,d=s/(255-u)*100;return 0===u?n=Number.NaN:(i===l&&(n=(o-a)/u),o===l&&(n=2+(a-i)/u),a===l&&(n=4+(i-o)/u),(n*=60)<0&&(n+=360)),[n,c,d]},J=c.unpack,Z=Math.floor,ee=function(){for(var e,t,n,r,i,o,a=[],s=arguments.length;s--;)a[s]=arguments[s];var l,u,c,d=(a=J(a,"hcg"))[0],f=a[1],p=a[2];p*=255;var h=255*f;if(0===f)l=u=c=p;else{360===d&&(d=0),d>360&&(d-=360),d<0&&(d+=360);var m=Z(d/=60),v=d-m,g=p*(1-f),y=g+h*(1-v),b=g+h*v,w=g+h;switch(m){case 0:l=(e=[w,b,g])[0],u=e[1],c=e[2];break;case 1:l=(t=[y,w,g])[0],u=t[1],c=t[2];break;case 2:l=(n=[g,w,b])[0],u=n[1],c=n[2];break;case 3:l=(r=[g,y,w])[0],u=r[1],c=r[2];break;case 4:l=(i=[b,g,w])[0],u=i[1],c=i[2];break;case 5:l=(o=[w,g,y])[0],u=o[1],c=o[2]}}return[l,u,c,a.length>3?a[3]:1]},te=c.unpack,ne=c.type;v.prototype.hcg=function(){return Q(this._rgb)},y.hcg=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hcg"])))},d.format.hcg=ee,d.autodetect.push({p:1,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=te(e,"hcg"),"array"===ne(e)&&3===e.length)return"hcg"}});var re=c.unpack,ie=c.last,oe=Math.round,ae=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=re(e,"rgba"),r=n[0],i=n[1],o=n[2],a=n[3],s=ie(e)||"auto";void 0===a&&(a=1),"auto"===s&&(s=a<1?"rgba":"rgb");var l="000000"+((r=oe(r))<<16|(i=oe(i))<<8|(o=oe(o))).toString(16);l=l.substr(l.length-6);var u="0"+oe(255*a).toString(16);switch(u=u.substr(u.length-2),s.toLowerCase()){case"rgba":return"#"+l+u;case"argb":return"#"+u+l;default:return"#"+l}},se=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,le=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,ue=function(e){if(e.match(se)){4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var t=parseInt(e,16);return[t>>16,t>>8&255,255&t,1]}if(e.match(le)){5!==e.length&&9!==e.length||(e=e.substr(1)),4===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);var n=parseInt(e,16);return[n>>24&255,n>>16&255,n>>8&255,Math.round((255&n)/255*100)/100]}throw new Error("unknown hex color: "+e)},ce=c.type;v.prototype.hex=function(e){return ae(this._rgb,e)},y.hex=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hex"])))},d.format.hex=ue,d.autodetect.push({p:4,test:function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];if(!t.length&&"string"===ce(e)&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});var de=c.unpack,fe=c.TWOPI,pe=Math.min,he=Math.sqrt,me=Math.acos,ve=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r=de(e,"rgb"),i=r[0],o=r[1],a=r[2],s=pe(i/=255,o/=255,a/=255),l=(i+o+a)/3,u=l>0?1-s/l:0;return 0===u?n=NaN:(n=(i-o+(i-a))/2,n/=he((i-o)*(i-o)+(i-a)*(o-a)),n=me(n),a>o&&(n=fe-n),n/=fe),[360*n,u,l]},ge=c.unpack,ye=c.limit,be=c.TWOPI,we=c.PITHIRD,xe=Math.cos,ke=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r,i,o=(e=ge(e,"hsi"))[0],a=e[1],s=e[2];return isNaN(o)&&(o=0),isNaN(a)&&(a=0),o>360&&(o-=360),o<0&&(o+=360),(o/=360)<1/3?r=1-((i=(1-a)/3)+(n=(1+a*xe(be*o)/xe(we-be*o))/3)):o<2/3?i=1-((n=(1-a)/3)+(r=(1+a*xe(be*(o-=1/3))/xe(we-be*o))/3)):n=1-((r=(1-a)/3)+(i=(1+a*xe(be*(o-=2/3))/xe(we-be*o))/3)),[255*(n=ye(s*n*3)),255*(r=ye(s*r*3)),255*(i=ye(s*i*3)),e.length>3?e[3]:1]},_e=c.unpack,Se=c.type;v.prototype.hsi=function(){return ve(this._rgb)},y.hsi=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hsi"])))},d.format.hsi=ke,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=_e(e,"hsi"),"array"===Se(e)&&3===e.length)return"hsi"}});var Ce=c.unpack,Ee=c.type;v.prototype.hsl=function(){return M(this._rgb)},y.hsl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hsl"])))},d.format.hsl=F,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Ce(e,"hsl"),"array"===Ee(e)&&3===e.length)return"hsl"}});var je=c.unpack,Te=Math.min,Oe=Math.max,Ne=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r,i,o=(e=je(e,"rgb"))[0],a=e[1],s=e[2],l=Te(o,a,s),u=Oe(o,a,s),c=u-l;return i=u/255,0===u?(n=Number.NaN,r=0):(r=c/u,o===u&&(n=(a-s)/c),a===u&&(n=2+(s-o)/c),s===u&&(n=4+(o-a)/c),(n*=60)<0&&(n+=360)),[n,r,i]},Me=c.unpack,Le=Math.floor,Pe=function(){for(var e,t,n,r,i,o,a=[],s=arguments.length;s--;)a[s]=arguments[s];var l,u,c,d=(a=Me(a,"hsv"))[0],f=a[1],p=a[2];if(p*=255,0===f)l=u=c=p;else{360===d&&(d=0),d>360&&(d-=360),d<0&&(d+=360);var h=Le(d/=60),m=d-h,v=p*(1-f),g=p*(1-f*m),y=p*(1-f*(1-m));switch(h){case 0:l=(e=[p,y,v])[0],u=e[1],c=e[2];break;case 1:l=(t=[g,p,v])[0],u=t[1],c=t[2];break;case 2:l=(n=[v,p,y])[0],u=n[1],c=n[2];break;case 3:l=(r=[v,g,p])[0],u=r[1],c=r[2];break;case 4:l=(i=[y,v,p])[0],u=i[1],c=i[2];break;case 5:l=(o=[p,v,g])[0],u=o[1],c=o[2]}}return[l,u,c,a.length>3?a[3]:1]},Ae=c.unpack,De=c.type;v.prototype.hsv=function(){return Ne(this._rgb)},y.hsv=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hsv"])))},d.format.hsv=Pe,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Ae(e,"hsv"),"array"===De(e)&&3===e.length)return"hsv"}});var Re={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},Ie=c.unpack,Fe=Math.pow,ze=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=Ie(e,"rgb"),r=n[0],i=n[1],o=n[2],a=We(r,i,o),s=a[0],l=a[1],u=116*l-16;return[u<0?0:u,500*(s-l),200*(l-a[2])]},Ue=function(e){return(e/=255)<=.04045?e/12.92:Fe((e+.055)/1.055,2.4)},He=function(e){return e>Re.t3?Fe(e,1/3):e/Re.t2+Re.t0},We=function(e,t,n){return e=Ue(e),t=Ue(t),n=Ue(n),[He((.4124564*e+.3575761*t+.1804375*n)/Re.Xn),He((.2126729*e+.7151522*t+.072175*n)/Re.Yn),He((.0193339*e+.119192*t+.9503041*n)/Re.Zn)]},Be=ze,$e=c.unpack,Ve=Math.pow,qe=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n,r,i,o=(e=$e(e,"lab"))[0],a=e[1],s=e[2];return r=(o+16)/116,n=isNaN(a)?r:r+a/500,i=isNaN(s)?r:r-s/200,r=Re.Yn*Ye(r),n=Re.Xn*Ye(n),i=Re.Zn*Ye(i),[Ge(3.2404542*n-1.5371385*r-.4985314*i),Ge(-.969266*n+1.8760108*r+.041556*i),Ge(.0556434*n-.2040259*r+1.0572252*i),e.length>3?e[3]:1]},Ge=function(e){return 255*(e<=.00304?12.92*e:1.055*Ve(e,1/2.4)-.055)},Ye=function(e){return e>Re.t1?e*e*e:Re.t2*(e-Re.t0)},Xe=qe,Ke=c.unpack,Qe=c.type;v.prototype.lab=function(){return Be(this._rgb)},y.lab=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["lab"])))},d.format.lab=Xe,d.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Ke(e,"lab"),"array"===Qe(e)&&3===e.length)return"lab"}});var Je=c.unpack,Ze=c.RAD2DEG,et=Math.sqrt,tt=Math.atan2,nt=Math.round,rt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=Je(e,"lab"),r=n[0],i=n[1],o=n[2],a=et(i*i+o*o),s=(tt(o,i)*Ze+360)%360;return 0===nt(1e4*a)&&(s=Number.NaN),[r,a,s]},it=c.unpack,ot=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=it(e,"rgb"),r=n[0],i=n[1],o=n[2],a=Be(r,i,o),s=a[0],l=a[1],u=a[2];return rt(s,l,u)},at=c.unpack,st=c.DEG2RAD,lt=Math.sin,ut=Math.cos,ct=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=at(e,"lch"),r=n[0],i=n[1],o=n[2];return isNaN(o)&&(o=0),[r,ut(o*=st)*i,lt(o)*i]},dt=c.unpack,ft=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=(e=dt(e,"lch"))[0],r=e[1],i=e[2],o=ct(n,r,i),a=o[0],s=o[1],l=o[2],u=Xe(a,s,l);return[u[0],u[1],u[2],e.length>3?e[3]:1]},pt=c.unpack,ht=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=pt(e,"hcl").reverse();return ft.apply(void 0,n)},mt=c.unpack,vt=c.type;v.prototype.lch=function(){return ot(this._rgb)},v.prototype.hcl=function(){return ot(this._rgb).reverse()},y.lch=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["lch"])))},y.hcl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["hcl"])))},d.format.lch=ft,d.format.hcl=ht,["lch","hcl"].forEach((function(e){return d.autodetect.push({p:2,test:function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];if(t=mt(t,e),"array"===vt(t)&&3===t.length)return e}})}));var gt={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},yt=c.type;v.prototype.name=function(){for(var e=ae(this._rgb,"rgb"),t=0,n=Object.keys(gt);t<n.length;t+=1){var r=n[t];if(gt[r]===e)return r.toLowerCase()}return e},d.format.named=function(e){if(e=e.toLowerCase(),gt[e])return ue(gt[e]);throw new Error("unknown color name: "+e)},d.autodetect.push({p:5,test:function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];if(!t.length&&"string"===yt(e)&>[e.toLowerCase()])return"named"}});var bt=c.unpack,wt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=bt(e,"rgb");return(n[0]<<16)+(n[1]<<8)+n[2]},xt=c.type,kt=function(e){if("number"==xt(e)&&e>=0&&e<=16777215)return[e>>16,e>>8&255,255&e,1];throw new Error("unknown num color: "+e)},_t=c.type;v.prototype.num=function(){return wt(this._rgb)},y.num=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["num"])))},d.format.num=kt,d.autodetect.push({p:5,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(1===e.length&&"number"===_t(e[0])&&e[0]>=0&&e[0]<=16777215)return"num"}});var St=c.unpack,Ct=c.type,Et=Math.round;v.prototype.rgb=function(e){return void 0===e&&(e=!0),!1===e?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Et)},v.prototype.rgba=function(e){return void 0===e&&(e=!0),this._rgb.slice(0,4).map((function(t,n){return n<3?!1===e?t:Et(t):t}))},y.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["rgb"])))},d.format.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=St(e,"rgba");return void 0===n[3]&&(n[3]=1),n},d.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=St(e,"rgba"),"array"===Ct(e)&&(3===e.length||4===e.length&&"number"==Ct(e[3])&&e[3]>=0&&e[3]<=1))return"rgb"}});var jt=Math.log,Tt=function(e){var t,n,r,i=e/100;return i<66?(t=255,n=-155.25485562709179-.44596950469579133*(n=i-2)+104.49216199393888*jt(n),r=i<20?0:.8274096064007395*(r=i-10)-254.76935184120902+115.67994401066147*jt(r)):(t=351.97690566805693+.114206453784165*(t=i-55)-40.25366309332127*jt(t),n=325.4494125711974+.07943456536662342*(n=i-50)-28.0852963507957*jt(n),r=255),[t,n,r,1]},Ot=c.unpack,Nt=Math.round,Mt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n,r=Ot(e,"rgb"),i=r[0],o=r[2],a=1e3,s=4e4,l=.4;s-a>l;){var u=Tt(n=.5*(s+a));u[2]/u[0]>=o/i?s=n:a=n}return Nt(n)};v.prototype.temp=v.prototype.kelvin=v.prototype.temperature=function(){return Mt(this._rgb)},y.temp=y.kelvin=y.temperature=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v,[null].concat(e,["temp"])))},d.format.temp=d.format.kelvin=d.format.temperature=Tt;var Lt=c.type;v.prototype.alpha=function(e,t){return void 0===t&&(t=!1),void 0!==e&&"number"===Lt(e)?t?(this._rgb[3]=e,this):new v([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]},v.prototype.clipped=function(){return this._rgb._clipped||!1},v.prototype.darken=function(e){void 0===e&&(e=1);var t=this,n=t.lab();return n[0]-=Re.Kn*e,new v(n,"lab").alpha(t.alpha(),!0)},v.prototype.brighten=function(e){return void 0===e&&(e=1),this.darken(-e)},v.prototype.darker=v.prototype.darken,v.prototype.brighter=v.prototype.brighten,v.prototype.get=function(e){var t=e.split("."),n=t[0],r=t[1],i=this[n]();if(r){var o=n.indexOf(r);if(o>-1)return i[o];throw new Error("unknown channel "+r+" in mode "+n)}return i};var Pt=c.type,At=Math.pow,Dt=1e-7,Rt=20;v.prototype.luminance=function(e){if(void 0!==e&&"number"===Pt(e)){if(0===e)return new v([0,0,0,this._rgb[3]],"rgb");if(1===e)return new v([255,255,255,this._rgb[3]],"rgb");var t=this.luminance(),n="rgb",r=Rt,i=function(t,o){var a=t.interpolate(o,.5,n),s=a.luminance();return Math.abs(e-s)<Dt||!r--?a:s>e?i(t,a):i(a,o)},o=(t>e?i(new v([0,0,0]),this):i(this,new v([255,255,255]))).rgb();return new v(o.concat([this._rgb[3]]))}return It.apply(void 0,this._rgb.slice(0,3))};var It=function(e,t,n){return.2126*(e=Ft(e))+.7152*(t=Ft(t))+.0722*(n=Ft(n))},Ft=function(e){return(e/=255)<=.03928?e/12.92:At((e+.055)/1.055,2.4)},zt={},Ut=c.type,Ht=function(e,t,n){void 0===n&&(n=.5);for(var r=[],i=arguments.length-3;i-- >0;)r[i]=arguments[i+3];var o=r[0]||"lrgb";if(zt[o]||r.length||(o=Object.keys(zt)[0]),!zt[o])throw new Error("interpolation mode "+o+" is not defined");return"object"!==Ut(e)&&(e=new v(e)),"object"!==Ut(t)&&(t=new v(t)),zt[o](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))};v.prototype.mix=v.prototype.interpolate=function(e,t){void 0===t&&(t=.5);for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return Ht.apply(void 0,[this,e,t].concat(n))},v.prototype.premultiply=function(e){void 0===e&&(e=!1);var t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new v([t[0]*n,t[1]*n,t[2]*n,n],"rgb")},v.prototype.saturate=function(e){void 0===e&&(e=1);var t=this,n=t.lch();return n[1]+=Re.Kn*e,n[1]<0&&(n[1]=0),new v(n,"lch").alpha(t.alpha(),!0)},v.prototype.desaturate=function(e){return void 0===e&&(e=1),this.saturate(-e)};var Wt=c.type;v.prototype.set=function(e,t,n){void 0===n&&(n=!1);var r=e.split("."),i=r[0],o=r[1],a=this[i]();if(o){var s=i.indexOf(o);if(s>-1){if("string"==Wt(t))switch(t.charAt(0)){case"+":case"-":a[s]+=+t;break;case"*":a[s]*=+t.substr(1);break;case"/":a[s]/=+t.substr(1);break;default:a[s]=+t}else{if("number"!==Wt(t))throw new Error("unsupported value for Color.set");a[s]=t}var l=new v(a,i);return n?(this._rgb=l._rgb,this):l}throw new Error("unknown channel "+o+" in mode "+i)}return a};var Bt=function(e,t,n){var r=e._rgb,i=t._rgb;return new v(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"rgb")};zt.rgb=Bt;var $t=Math.sqrt,Vt=Math.pow,qt=function(e,t,n){var r=e._rgb,i=r[0],o=r[1],a=r[2],s=t._rgb,l=s[0],u=s[1],c=s[2];return new v($t(Vt(i,2)*(1-n)+Vt(l,2)*n),$t(Vt(o,2)*(1-n)+Vt(u,2)*n),$t(Vt(a,2)*(1-n)+Vt(c,2)*n),"rgb")};zt.lrgb=qt;var Gt=function(e,t,n){var r=e.lab(),i=t.lab();return new v(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"lab")};zt.lab=Gt;var Yt=function(e,t,n,r){var i,o,a,s,l,u,c,d,f,p,h,m;return"hsl"===r?(a=e.hsl(),s=t.hsl()):"hsv"===r?(a=e.hsv(),s=t.hsv()):"hcg"===r?(a=e.hcg(),s=t.hcg()):"hsi"===r?(a=e.hsi(),s=t.hsi()):"lch"!==r&&"hcl"!==r||(r="hcl",a=e.hcl(),s=t.hcl()),"h"===r.substr(0,1)&&(l=(i=a)[0],c=i[1],f=i[2],u=(o=s)[0],d=o[1],p=o[2]),isNaN(l)||isNaN(u)?isNaN(l)?isNaN(u)?m=Number.NaN:(m=u,1!=f&&0!=f||"hsv"==r||(h=d)):(m=l,1!=p&&0!=p||"hsv"==r||(h=c)):m=l+n*(u>l&&u-l>180?u-(l+360):u<l&&l-u>180?u+360-l:u-l),void 0===h&&(h=c+n*(d-c)),new v([m,h,f+n*(p-f)],r)},Xt=function(e,t,n){return Yt(e,t,n,"lch")};zt.lch=Xt,zt.hcl=Xt;var Kt=function(e,t,n){var r=e.num(),i=t.num();return new v(r+n*(i-r),"num")};zt.num=Kt;var Qt=function(e,t,n){return Yt(e,t,n,"hcg")};zt.hcg=Qt;var Jt=function(e,t,n){return Yt(e,t,n,"hsi")};zt.hsi=Jt;var Zt=function(e,t,n){return Yt(e,t,n,"hsl")};zt.hsl=Zt;var en=function(e,t,n){return Yt(e,t,n,"hsv")};zt.hsv=en;var tn=c.clip_rgb,nn=Math.pow,rn=Math.sqrt,on=Math.PI,an=Math.cos,sn=Math.sin,ln=Math.atan2,un=function(e,t,n){void 0===t&&(t="lrgb"),void 0===n&&(n=null);var r=e.length;n||(n=Array.from(new Array(r)).map((function(){return 1})));var i=r/n.reduce((function(e,t){return e+t}));if(n.forEach((function(e,t){n[t]*=i})),e=e.map((function(e){return new v(e)})),"lrgb"===t)return cn(e,n);for(var o=e.shift(),a=o.get(t),s=[],l=0,u=0,c=0;c<a.length;c++)if(a[c]=(a[c]||0)*n[0],s.push(isNaN(a[c])?0:n[0]),"h"===t.charAt(c)&&!isNaN(a[c])){var d=a[c]/180*on;l+=an(d)*n[0],u+=sn(d)*n[0]}var f=o.alpha()*n[0];e.forEach((function(e,r){var i=e.get(t);f+=e.alpha()*n[r+1];for(var o=0;o<a.length;o++)if(!isNaN(i[o]))if(s[o]+=n[r+1],"h"===t.charAt(o)){var c=i[o]/180*on;l+=an(c)*n[r+1],u+=sn(c)*n[r+1]}else a[o]+=i[o]*n[r+1]}));for(var p=0;p<a.length;p++)if("h"===t.charAt(p)){for(var h=ln(u/s[p],l/s[p])/on*180;h<0;)h+=360;for(;h>=360;)h-=360;a[p]=h}else a[p]=a[p]/s[p];return f/=r,new v(a,t).alpha(f>.99999?1:f,!0)},cn=function(e,t){for(var n=e.length,r=[0,0,0,0],i=0;i<e.length;i++){var o=e[i],a=t[i]/n,s=o._rgb;r[0]+=nn(s[0],2)*a,r[1]+=nn(s[1],2)*a,r[2]+=nn(s[2],2)*a,r[3]+=s[3]*a}return r[0]=rn(r[0]),r[1]=rn(r[1]),r[2]=rn(r[2]),r[3]>.9999999&&(r[3]=1),new v(tn(r))},dn=c.type,fn=Math.pow,pn=function(e){var t="rgb",n=y("#ccc"),r=0,i=[0,1],o=[],a=[0,0],s=!1,l=[],u=!1,c=0,d=1,f=!1,p={},h=!0,m=1,v=function(e){if((e=e||["#fff","#000"])&&"string"===dn(e)&&y.brewer&&y.brewer[e.toLowerCase()]&&(e=y.brewer[e.toLowerCase()]),"array"===dn(e)){1===e.length&&(e=[e[0],e[0]]),e=e.slice(0);for(var t=0;t<e.length;t++)e[t]=y(e[t]);o.length=0;for(var n=0;n<e.length;n++)o.push(n/(e.length-1))}return k(),l=e},g=function(e){if(null!=s){for(var t=s.length-1,n=0;n<t&&e>=s[n];)n++;return n-1}return 0},b=function(e){return e},w=function(e){return e},x=function(e,r){var i,u;if(null==r&&(r=!1),isNaN(e)||null===e)return n;u=r?e:s&&s.length>2?g(e)/(s.length-2):d!==c?(e-c)/(d-c):1,u=w(u),r||(u=b(u)),1!==m&&(u=fn(u,m)),u=a[0]+u*(1-a[0]-a[1]),u=Math.min(1,Math.max(0,u));var f=Math.floor(1e4*u);if(h&&p[f])i=p[f];else{if("array"===dn(l))for(var v=0;v<o.length;v++){var x=o[v];if(u<=x){i=l[v];break}if(u>=x&&v===o.length-1){i=l[v];break}if(u>x&&u<o[v+1]){u=(u-x)/(o[v+1]-x),i=y.interpolate(l[v],l[v+1],u,t);break}}else"function"===dn(l)&&(i=l(u));h&&(p[f]=i)}return i},k=function(){return p={}};v(e);var _=function(e){var t=y(x(e));return u&&t[u]?t[u]():t};return _.classes=function(e){if(null!=e){if("array"===dn(e))s=e,i=[e[0],e[e.length-1]];else{var t=y.analyze(i);s=0===e?[t.min,t.max]:y.limits(t,"e",e)}return _}return s},_.domain=function(e){if(!arguments.length)return i;c=e[0],d=e[e.length-1],o=[];var t=l.length;if(e.length===t&&c!==d)for(var n=0,r=Array.from(e);n<r.length;n+=1){var a=r[n];o.push((a-c)/(d-c))}else{for(var s=0;s<t;s++)o.push(s/(t-1));if(e.length>2){var u=e.map((function(t,n){return n/(e.length-1)})),f=e.map((function(e){return(e-c)/(d-c)}));f.every((function(e,t){return u[t]===e}))||(w=function(e){if(e<=0||e>=1)return e;for(var t=0;e>=f[t+1];)t++;var n=(e-f[t])/(f[t+1]-f[t]);return u[t]+n*(u[t+1]-u[t])})}}return i=[c,d],_},_.mode=function(e){return arguments.length?(t=e,k(),_):t},_.range=function(e,t){return v(e,t),_},_.out=function(e){return u=e,_},_.spread=function(e){return arguments.length?(r=e,_):r},_.correctLightness=function(e){return null==e&&(e=!0),f=e,k(),b=f?function(e){for(var t=x(0,!0).lab()[0],n=x(1,!0).lab()[0],r=t>n,i=x(e,!0).lab()[0],o=t+(n-t)*e,a=i-o,s=0,l=1,u=20;Math.abs(a)>.01&&u-- >0;)r&&(a*=-1),a<0?(s=e,e+=.5*(l-e)):(l=e,e+=.5*(s-e)),i=x(e,!0).lab()[0],a=i-o;return e}:function(e){return e},_},_.padding=function(e){return null!=e?("number"===dn(e)&&(e=[e,e]),a=e,_):a},_.colors=function(t,n){arguments.length<2&&(n="hex");var r=[];if(0===arguments.length)r=l.slice(0);else if(1===t)r=[_(.5)];else if(t>1){var o=i[0],a=i[1]-o;r=hn(0,t,!1).map((function(e){return _(o+e/(t-1)*a)}))}else{e=[];var u=[];if(s&&s.length>2)for(var c=1,d=s.length,f=1<=d;f?c<d:c>d;f?c++:c--)u.push(.5*(s[c-1]+s[c]));else u=i;r=u.map((function(e){return _(e)}))}return y[n]&&(r=r.map((function(e){return e[n]()}))),r},_.cache=function(e){return null!=e?(h=e,_):h},_.gamma=function(e){return null!=e?(m=e,_):m},_.nodata=function(e){return null!=e?(n=y(e),_):n},_};function hn(e,t,n){for(var r=[],i=e<t,o=n?i?t+1:t-1:t,a=e;i?a<o:a>o;i?a++:a--)r.push(a);return r}var mn=function(e){var t,n,r,i,o,a,s;if(2===(e=e.map((function(e){return new v(e)}))).length)t=e.map((function(e){return e.lab()})),o=t[0],a=t[1],i=function(e){var t=[0,1,2].map((function(t){return o[t]+e*(a[t]-o[t])}));return new v(t,"lab")};else if(3===e.length)n=e.map((function(e){return e.lab()})),o=n[0],a=n[1],s=n[2],i=function(e){var t=[0,1,2].map((function(t){return(1-e)*(1-e)*o[t]+2*(1-e)*e*a[t]+e*e*s[t]}));return new v(t,"lab")};else if(4===e.length){var l;r=e.map((function(e){return e.lab()})),o=r[0],a=r[1],s=r[2],l=r[3],i=function(e){var t=[0,1,2].map((function(t){return(1-e)*(1-e)*(1-e)*o[t]+3*(1-e)*(1-e)*e*a[t]+3*(1-e)*e*e*s[t]+e*e*e*l[t]}));return new v(t,"lab")}}else if(5===e.length){var u=mn(e.slice(0,3)),c=mn(e.slice(2,5));i=function(e){return e<.5?u(2*e):c(2*(e-.5))}}return i},vn=function(e){var t=mn(e);return t.scale=function(){return pn(t)},t},gn=function(e,t,n){if(!gn[n])throw new Error("unknown blend mode "+n);return gn[n](e,t)},yn=function(e){return function(t,n){var r=y(n).rgb(),i=y(t).rgb();return y.rgb(e(r,i))}},bn=function(e){return function(t,n){var r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r}},wn=function(e){return e},xn=function(e,t){return e*t/255},kn=function(e,t){return e>t?t:e},_n=function(e,t){return e>t?e:t},Sn=function(e,t){return 255*(1-(1-e/255)*(1-t/255))},Cn=function(e,t){return t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255))},En=function(e,t){return 255*(1-(1-t/255)/(e/255))},jn=function(e,t){return 255===e||(e=t/255*255/(1-e/255))>255?255:e};gn.normal=yn(bn(wn)),gn.multiply=yn(bn(xn)),gn.screen=yn(bn(Sn)),gn.overlay=yn(bn(Cn)),gn.darken=yn(bn(kn)),gn.lighten=yn(bn(_n)),gn.dodge=yn(bn(jn)),gn.burn=yn(bn(En));for(var Tn=gn,On=c.type,Nn=c.clip_rgb,Mn=c.TWOPI,Ln=Math.pow,Pn=Math.sin,An=Math.cos,Dn=function(e,t,n,r,i){void 0===e&&(e=300),void 0===t&&(t=-1.5),void 0===n&&(n=1),void 0===r&&(r=1),void 0===i&&(i=[0,1]);var o,a=0;"array"===On(i)?o=i[1]-i[0]:(o=0,i=[i,i]);var s=function(s){var l=Mn*((e+120)/360+t*s),u=Ln(i[0]+o*s,r),c=(0!==a?n[0]+s*a:n)*u*(1-u)/2,d=An(l),f=Pn(l);return y(Nn([255*(u+c*(-.14861*d+1.78277*f)),255*(u+c*(-.29227*d-.90649*f)),255*(u+c*(1.97294*d)),1]))};return s.start=function(t){return null==t?e:(e=t,s)},s.rotations=function(e){return null==e?t:(t=e,s)},s.gamma=function(e){return null==e?r:(r=e,s)},s.hue=function(e){return null==e?n:("array"===On(n=e)?0==(a=n[1]-n[0])&&(n=n[1]):a=0,s)},s.lightness=function(e){return null==e?i:("array"===On(e)?(i=e,o=e[1]-e[0]):(i=[e,e],o=0),s)},s.scale=function(){return y.scale(s)},s.hue(n),s},Rn="0123456789abcdef",In=Math.floor,Fn=Math.random,zn=function(){for(var e="#",t=0;t<6;t++)e+=Rn.charAt(In(16*Fn()));return new v(e,"hex")},Un=Math.log,Hn=Math.pow,Wn=Math.floor,Bn=Math.abs,$n=function(e,t){void 0===t&&(t=null);var n={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===a(e)&&(e=Object.values(e)),e.forEach((function(e){t&&"object"===a(e)&&(e=e[t]),null==e||isNaN(e)||(n.values.push(e),n.sum+=e,e<n.min&&(n.min=e),e>n.max&&(n.max=e),n.count+=1)})),n.domain=[n.min,n.max],n.limits=function(e,t){return Vn(n,e,t)},n},Vn=function(e,t,n){void 0===t&&(t="equal"),void 0===n&&(n=7),"array"==a(e)&&(e=$n(e));var r=e.min,i=e.max,o=e.values.sort((function(e,t){return e-t}));if(1===n)return[r,i];var s=[];if("c"===t.substr(0,1)&&(s.push(r),s.push(i)),"e"===t.substr(0,1)){s.push(r);for(var l=1;l<n;l++)s.push(r+l/n*(i-r));s.push(i)}else if("l"===t.substr(0,1)){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");var u=Math.LOG10E*Un(r),c=Math.LOG10E*Un(i);s.push(r);for(var d=1;d<n;d++)s.push(Hn(10,u+d/n*(c-u)));s.push(i)}else if("q"===t.substr(0,1)){s.push(r);for(var f=1;f<n;f++){var p=(o.length-1)*f/n,h=Wn(p);if(h===p)s.push(o[h]);else{var m=p-h;s.push(o[h]*(1-m)+o[h+1]*m)}}s.push(i)}else if("k"===t.substr(0,1)){var v,g=o.length,y=new Array(g),b=new Array(n),w=!0,x=0,k=null;(k=[]).push(r);for(var _=1;_<n;_++)k.push(r+_/n*(i-r));for(k.push(i);w;){for(var S=0;S<n;S++)b[S]=0;for(var C=0;C<g;C++)for(var E=o[C],j=Number.MAX_VALUE,T=void 0,O=0;O<n;O++){var N=Bn(k[O]-E);N<j&&(j=N,T=O),b[T]++,y[C]=T}for(var M=new Array(n),L=0;L<n;L++)M[L]=null;for(var P=0;P<g;P++)null===M[v=y[P]]?M[v]=o[P]:M[v]+=o[P];for(var A=0;A<n;A++)M[A]*=1/b[A];w=!1;for(var D=0;D<n;D++)if(M[D]!==k[D]){w=!0;break}k=M,++x>200&&(w=!1)}for(var R={},I=0;I<n;I++)R[I]=[];for(var F=0;F<g;F++)R[v=y[F]].push(o[F]);for(var z=[],U=0;U<n;U++)z.push(R[U][0]),z.push(R[U][R[U].length-1]);z=z.sort((function(e,t){return e-t})),s.push(z[0]);for(var H=1;H<z.length;H+=2){var W=z[H];isNaN(W)||-1!==s.indexOf(W)||s.push(W)}}return s},qn={analyze:$n,limits:Vn},Gn=function(e,t){e=new v(e),t=new v(t);var n=e.luminance(),r=t.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},Yn=Math.sqrt,Xn=Math.atan2,Kn=Math.abs,Qn=Math.cos,Jn=Math.PI,Zn=function(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=1),e=new v(e),t=new v(t);for(var i=Array.from(e.lab()),o=i[0],a=i[1],s=i[2],l=Array.from(t.lab()),u=l[0],c=l[1],d=l[2],f=Yn(a*a+s*s),p=Yn(c*c+d*d),h=o<16?.511:.040975*o/(1+.01765*o),m=.0638*f/(1+.0131*f)+.638,g=f<1e-6?0:180*Xn(s,a)/Jn;g<0;)g+=360;for(;g>=360;)g-=360;var y=g>=164&&g<=345?.56+Kn(.2*Qn(Jn*(g+168)/180)):.36+Kn(.4*Qn(Jn*(g+35)/180)),b=f*f*f*f,w=Yn(b/(b+1900)),x=m*(w*y+1-w),k=f-p,_=a-c,S=s-d,C=(o-u)/(n*h),E=k/(r*m);return Yn(C*C+E*E+(_*_+S*S-k*k)/(x*x))},er=function(e,t,n){void 0===n&&(n="lab"),e=new v(e),t=new v(t);var r=e.get(n),i=t.get(n),o=0;for(var a in r){var s=(r[a]||0)-(i[a]||0);o+=s*s}return Math.sqrt(o)},tr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];try{return new(Function.prototype.bind.apply(v,[null].concat(e))),!0}catch(e){return!1}},nr={cool:function(){return pn([y.hsl(180,1,.9),y.hsl(250,.7,.4)])},hot:function(){return pn(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")}},rr={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},ir=0,or=Object.keys(rr);ir<or.length;ir+=1){var ar=or[ir];rr[ar.toLowerCase()]=rr[ar]}var sr=rr;return y.average=un,y.bezier=vn,y.blend=Tn,y.cubehelix=Dn,y.mix=y.interpolate=Ht,y.random=zn,y.scale=pn,y.analyze=qn.analyze,y.contrast=Gn,y.deltaE=Zn,y.distance=er,y.limits=qn.limits,y.valid=tr,y.scales=nr,y.colors=gt,y.brewer=sr,y}()},4631:function(e){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(e),u=l&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),d=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),m=f&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),g=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),w=/win/i.test(t),x=d&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(d=!1,l=!0);var k=y&&(u||d&&(null==x||x<12.11)),_=n||a&&s>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var C,E=function(e,t){var n=e.className,r=S(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function j(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function T(e,t){return j(e).appendChild(t)}function O(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function N(e,t,n,r){var i=O(e,t,n,r);return i.setAttribute("role","presentation"),i}function M(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function L(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function P(e,t){var n=e.className;S(t).test(n)||(e.className+=(n?" ":"")+t)}function A(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!S(n[r]).test(t)&&(t+=" "+n[r]);return t}C=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var D=function(e){e.select()};function R(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function I(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function F(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,a=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}m?D=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(D=function(e){try{e.select()}catch(e){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function U(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},z.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var H=50,W={toString:function(){return"CodeMirror.Pass"}},B={scroll:!1},$={origin:"*mouse"},V={origin:"+move"};function q(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var G=[""];function Y(e){for(;G.length<=e;)G.push(X(G)+" ");return G[e]}function X(e){return e[e.length-1]}function K(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Q(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function J(){}function Z(e,t){var n;return Object.create?n=Object.create(e):(J.prototype=e,n=new J),t&&I(t,n),n}var ee=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function te(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function ne(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ie=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function oe(e){return e.charCodeAt(0)>=768&&ie.test(e)}function ae(e,t,n){for(;(n<0?t>0:t<e.length)&&oe(e.charAt(t));)t+=n;return t}function se(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function le(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var ue=null;function ce(e,t,n){var r;ue=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ue=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ue=i)}return null!=r?r:ue}var de=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var u="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var c=e.length,d=[],f=0;f<c;++f)d.push(n(e.charCodeAt(f)));for(var p=0,h=u;p<c;++p){var m=d[p];"m"==m?d[p]=h:h=m}for(var v=0,g=u;v<c;++v){var y=d[v];"1"==y&&"r"==g?d[v]="n":o.test(y)&&(g=y,"r"==y&&(d[v]="R"))}for(var b=1,w=d[0];b<c-1;++b){var x=d[b];"+"==x&&"1"==w&&"1"==d[b+1]?d[b]="1":","!=x||w!=d[b+1]||"1"!=w&&"n"!=w||(d[b]=w),w=x}for(var k=0;k<c;++k){var _=d[k];if(","==_)d[k]="N";else if("%"==_){var S=void 0;for(S=k+1;S<c&&"%"==d[S];++S);for(var C=k&&"!"==d[k-1]||S<c&&"1"==d[S]?"1":"N",E=k;E<S;++E)d[E]=C;k=S-1}}for(var j=0,T=u;j<c;++j){var O=d[j];"L"==T&&"1"==O?d[j]="L":o.test(O)&&(T=O)}for(var N=0;N<c;++N)if(i.test(d[N])){var M=void 0;for(M=N+1;M<c&&i.test(d[M]);++M);for(var L="L"==(N?d[N-1]:u),P=L==("L"==(M<c?d[M]:u))?L?"L":"R":u,A=N;A<M;++A)d[A]=P;N=M-1}for(var D,R=[],I=0;I<c;)if(a.test(d[I])){var F=I;for(++I;I<c&&a.test(d[I]);++I);R.push(new l(0,F,I))}else{var z=I,U=R.length,H="rtl"==t?1:0;for(++I;I<c&&"L"!=d[I];++I);for(var W=z;W<I;)if(s.test(d[W])){z<W&&(R.splice(U,0,new l(1,z,W)),U+=H);var B=W;for(++W;W<I&&s.test(d[W]);++W);R.splice(U,0,new l(2,B,W)),U+=H,z=W}else++W;z<I&&R.splice(U,0,new l(1,z,I))}return"ltr"==t&&(1==R[0].level&&(D=e.match(/^\s+/))&&(R[0].from=D[0].length,R.unshift(new l(0,0,D[0].length))),1==X(R).level&&(D=e.match(/\s+$/))&&(X(R).to-=D[0].length,R.push(new l(0,c-D[0].length,c)))),"rtl"==t?R.reverse():R}}();function fe(e,t){var n=e.order;return null==n&&(n=e.order=de(e.text,t)),n}var pe=[],he=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||pe).concat(n)}};function me(e,t){return e._handlers&&e._handlers[t]||pe}function ve(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=U(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ge(e,t){var n=me(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function ye(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ge(e,n||t.type,e,t),Se(t)||t.codemirrorIgnore}function be(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==U(n,t[r])&&n.push(t[r])}function we(e,t){return me(e,t).length>0}function xe(e){e.prototype.on=function(e,t){he(this,e,t)},e.prototype.off=function(e,t){ve(this,e,t)}}function ke(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function _e(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Se(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ce(e){ke(e),_e(e)}function Ee(e){return e.target||e.srcElement}function je(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Te,Oe,Ne=function(){if(a&&s<9)return!1;var e=O("div");return"draggable"in e||"dragDrop"in e}();function Me(e){if(null==Te){var t=O("span","");T(e,O("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Te=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Te?O("span",""):O("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Le(e){if(null!=Oe)return Oe;var t=T(e,document.createTextNode("AخA")),n=C(t,0,1).getBoundingClientRect(),r=C(t,1,2).getBoundingClientRect();return j(e),!(!n||n.left==n.right)&&(Oe=r.right-n.right<3)}var Pe,Ae=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},De=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Re="oncopy"in(Pe=O("div"))||(Pe.setAttribute("oncopy","return;"),"function"==typeof Pe.oncopy),Ie=null;function Fe(e){if(null!=Ie)return Ie;var t=T(e,O("span","x")),n=t.getBoundingClientRect(),r=C(t,0,1).getBoundingClientRect();return Ie=Math.abs(n.left-r.left)>1}var ze={},Ue={};function He(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ze[e]=t}function We(e,t){Ue[e]=t}function Be(e){if("string"==typeof e&&Ue.hasOwnProperty(e))e=Ue[e];else if(e&&"string"==typeof e.name&&Ue.hasOwnProperty(e.name)){var t=Ue[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Be("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Be("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function $e(e,t){t=Be(t);var n=ze[t.name];if(!n)return $e(e,"text/plain");var r=n(e,t);if(Ve.hasOwnProperty(t.name)){var i=Ve[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var Ve={};function qe(e,t){I(t,Ve.hasOwnProperty(e)?Ve[e]:Ve[e]={})}function Ge(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ye(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Xe(e,t,n){return!e.startState||e.startState(t,n)}var Ke=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Qe(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function Je(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i})),r}function Ze(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function et(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function tt(e){if(null==e.parent)return null;for(var t=e.parent,n=U(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function nt(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a].height;if(t<s)break;t-=s}return n+a}function rt(e,t){return t>=e.first&&t<e.first+e.size}function it(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ot(e,t,n){if(void 0===n&&(n=null),!(this instanceof ot))return new ot(e,t,n);this.line=e,this.ch=t,this.sticky=n}function at(e,t){return e.line-t.line||e.ch-t.ch}function st(e,t){return e.sticky==t.sticky&&0==at(e,t)}function lt(e){return ot(e.line,e.ch)}function ut(e,t){return at(e,t)<0?t:e}function ct(e,t){return at(e,t)<0?e:t}function dt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ft(e,t){if(t.line<e.first)return ot(e.first,0);var n=e.first+e.size-1;return t.line>n?ot(n,Qe(e,n).text.length):pt(t,Qe(e,t.line).text.length)}function pt(e,t){var n=e.ch;return null==n||n>t?ot(e.line,t):n<0?ot(e.line,0):e}function ht(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=ft(e,t[r]);return n}Ke.prototype.eol=function(){return this.pos>=this.string.length},Ke.prototype.sol=function(){return this.pos==this.lineStart},Ke.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ke.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ke.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Ke.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ke.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ke.prototype.skipToEnd=function(){this.pos=this.string.length},Ke.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ke.prototype.backUp=function(e){this.pos-=e},Ke.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Ke.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Ke.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ke.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ke.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ke.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ke.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var mt=function(e,t){this.state=e,this.lookAhead=t},vt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function gt(e,t,n,r){var i=[e.state.modeGen],o={};Et(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],l=1,u=0;n.state=!0,Et(e,t.text,s.mode,n,(function(e,t){for(var n=l;u<e;){var r=i[l];r>e&&i.splice(l,1,e,i[l+1],r),l+=2,u=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function yt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=bt(e,tt(t)),i=t.text.length>e.options.maxHighlightLength&&Ge(e.doc.mode,r.state),o=gt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function bt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new vt(r,!0,t);var o=jt(e,t,n),a=o>r.first&&Qe(r,o-1).stateAfter,s=a?vt.fromSaved(r,a,o):new vt(r,Xe(r.mode),o);return r.iter(o,t,(function(n){wt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()})),n&&(r.modeFrontier=s.line),s}function wt(e,t,n,r){var i=e.doc.mode,o=new Ke(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&xt(i,n.state);!o.eol();)kt(i,o,n.state),o.start=o.pos}function xt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ye(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function kt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Ye(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}vt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},vt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},vt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},vt.fromSaved=function(e,t,n){return t instanceof mt?new vt(e,Ge(e.mode,t.state),n,t.lookAhead):new vt(e,Ge(e.mode,t),n)},vt.prototype.save=function(e){var t=!1!==e?Ge(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new mt(t,this.maxLookAhead):t};var _t=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function St(e,t,n,r){var i,o,a=e.doc,s=a.mode,l=Qe(a,(t=ft(a,t)).line),u=bt(e,t.line,n),c=new Ke(l.text,e.options.tabSize,u);for(r&&(o=[]);(r||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=kt(s,c,u.state),r&&o.push(new _t(c,i,Ge(a.mode,u.state)));return r?o:new _t(c,i,u.state)}function Ct(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Et(e,t,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,u=0,c=null,d=new Ke(t,e.options.tabSize,r),f=e.options.addModeClass&&[null];for(""==t&&Ct(xt(n,r.state),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(s=!1,a&&wt(e,t,r,d.pos),d.pos=t.length,l=null):l=Ct(kt(n,d,r.state,f),o),f){var p=f[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||c!=l){for(;u<d.start;)i(u=Math.min(d.start,u+5e3),c);c=l}d.start=d.pos}for(;u<d.pos;){var h=Math.min(d.pos,u+5e3);i(h,c),u=h}}function jt(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=Qe(o,s-1),u=l.stateAfter;if(u&&(!n||s+(u instanceof mt?u.lookAhead:0)<=o.modeFrontier))return s;var c=F(l.text,null,e.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}function Tt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=Qe(e,r).stateAfter;if(i&&(!(i instanceof mt)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var Ot=!1,Nt=!1;function Mt(){Ot=!0}function Lt(){Nt=!0}function Pt(e,t,n){this.marker=e,this.from=t,this.to=n}function At(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Dt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Rt(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function It(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Pt(a,o.from,s?null:o.to))}}return r}function Ft(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Pt(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}function zt(e,t){if(t.full)return null;var n=rt(e,t.from.line)&&Qe(e,t.from.line).markedSpans,r=rt(e,t.to.line)&&Qe(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==at(t.from,t.to),s=It(n,i,a),l=Ft(r,o,a),u=1==t.text.length,c=X(t.text).length+(u?i:0);if(s)for(var d=0;d<s.length;++d){var f=s[d];if(null==f.to){var p=At(l,f.marker);p?u&&(f.to=null==p.to?null:p.to+c):f.to=i}}if(l)for(var h=0;h<l.length;++h){var m=l[h];null!=m.to&&(m.to+=c),null==m.from?At(s,m.marker)||(m.from=c,u&&(s||(s=[])).push(m)):(m.from+=c,u&&(s||(s=[])).push(m))}s&&(s=Ut(s)),l&&l!=s&&(l=Ut(l));var v=[s];if(!u){var g,y=t.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(g||(g=[])).push(new Pt(s[b].marker,null,null));for(var w=0;w<y;++w)v.push(g);v.push(l)}return v}function Ut(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Ht(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=U(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),l=0;l<i.length;++l){var u=i[l];if(!(at(u.to,s.from)<0||at(u.from,s.to)>0)){var c=[l,1],d=at(u.from,s.from),f=at(u.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&c.push({from:u.from,to:s.from}),(f>0||!a.inclusiveRight&&!f)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}function Wt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Bt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function $t(e){return e.inclusiveLeft?-1:0}function Vt(e){return e.inclusiveRight?1:0}function qt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=at(r.from,i.from)||$t(e)-$t(t);if(o)return-o;var a=at(r.to,i.to)||Vt(e)-Vt(t);return a||t.id-e.id}function Gt(e,t){var n,r=Nt&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||qt(n,i.marker)<0)&&(n=i.marker);return n}function Yt(e){return Gt(e,!0)}function Xt(e){return Gt(e,!1)}function Kt(e,t){var n,r=Nt&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||qt(n,o.marker)<0)&&(n=o.marker)}return n}function Qt(e,t,n,r,i){var o=Qe(e,t),a=Nt&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var u=l.marker.find(0),c=at(u.from,n)||$t(l.marker)-$t(i),d=at(u.to,r)||Vt(l.marker)-Vt(i);if(!(c>=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?at(u.to,n)>=0:at(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?at(u.from,r)<=0:at(u.from,r)<0)))return!0}}}function Jt(e){for(var t;t=Yt(e);)e=t.find(-1,!0).line;return e}function Zt(e){for(var t;t=Xt(e);)e=t.find(1,!0).line;return e}function en(e){for(var t,n;t=Xt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function tn(e,t){var n=Qe(e,t),r=Jt(n);return n==r?t:tt(r)}function nn(e,t){if(t>e.lastLine())return t;var n,r=Qe(e,t);if(!rn(e,r))return t;for(;n=Xt(r);)r=n.find(1,!0).line;return tt(r)+1}function rn(e,t){var n=Nt&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&on(e,t,r))return!0}}function on(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return on(e,r.line,At(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&on(e,t,i))return!0}function an(e){for(var t=0,n=(e=Jt(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;t+=s.height}return t}function sn(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Yt(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=Xt(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}function ln(e){var t=e.display,n=e.doc;t.maxLine=Qe(n,n.first),t.maxLineLength=sn(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=sn(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var un=function(e,t,n){this.text=e,Bt(this,t),this.height=n?n(this):1};function cn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Wt(e),Bt(e,n);var i=r?r(e):1;i!=e.height&&et(e,i)}function dn(e){e.parent=null,Wt(e)}un.prototype.lineNo=function(){return tt(this)},xe(un);var fn={},pn={};function hn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?pn:fn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function mn(e,t){var n=N("span",null,null,l?"padding-right: .1px":null),r={pre:N("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=gn,Le(e.display.measure)&&(a=fe(o,e.doc.direction))&&(r.addToken=bn(r.addToken,a)),r.map=[],xn(o,r,yt(e,o,t!=e.display.externalMeasured&&tt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=A(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=A(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Me(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ge(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=A(r.pre.className,r.textClass||"")),r}function vn(e){var t=O("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function gn(e,t,n,r,i,o,l){if(t){var u,c=e.splitSpaces?yn(t,e.trailingSpace):t,d=e.cm.state.specialChars,f=!1;if(d.test(t)){u=document.createDocumentFragment();for(var p=0;;){d.lastIndex=p;var h=d.exec(t),m=h?h.index-p:t.length-p;if(m){var v=document.createTextNode(c.slice(p,p+m));a&&s<9?u.appendChild(O("span",[v])):u.appendChild(v),e.map.push(e.pos,e.pos+m,v),e.col+=m,e.pos+=m}if(!h)break;p+=m+1;var g=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(g=u.appendChild(O("span",Y(b),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?((g=u.appendChild(O("span","\r"==h[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",h[0]),e.col+=1):((g=e.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),a&&s<9?u.appendChild(O("span",[g])):u.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),a&&s<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||r||i||f||o||l){var w=n||"";r&&(w+=r),i&&(w+=i);var x=O("span",[u],w,o);if(l)for(var k in l)l.hasOwnProperty(k)&&"style"!=k&&"class"!=k&&x.setAttribute(k,l[k]);return e.content.appendChild(x)}e.content.appendChild(u)}}function yn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}function bn(e,t){return function(n,r,i,o,a,s,l){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,c=u+r.length;;){for(var d=void 0,f=0;f<t.length&&!((d=t[f]).to>u&&d.from<=u);f++);if(d.to>=c)return e(n,r,i,o,a,s,l);e(n,r.slice(0,d.to-u),i,o,null,s,l),o=null,r=r.slice(d.to-u),u=d.to}}}function wn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function xn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,u,c,d,f,p=i.length,h=0,m=1,v="",g=0;;){if(g==h){l=u=c=s="",f=null,d=null,g=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var x=r[w],k=x.marker;if("bookmark"==k.type&&x.from==h&&k.widgetNode)y.push(k);else if(x.from<=h&&(null==x.to||x.to>h||k.collapsed&&x.to==h&&x.from==h)){if(null!=x.to&&x.to!=h&&g>x.to&&(g=x.to,u=""),k.className&&(l+=" "+k.className),k.css&&(s=(s?s+";":"")+k.css),k.startStyle&&x.from==h&&(c+=" "+k.startStyle),k.endStyle&&x.to==g&&(b||(b=[])).push(k.endStyle,x.to),k.title&&((f||(f={})).title=k.title),k.attributes)for(var _ in k.attributes)(f||(f={}))[_]=k.attributes[_];k.collapsed&&(!d||qt(d.marker,k)<0)&&(d=x)}else x.from>h&&g>x.from&&(g=x.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==g&&(u+=" "+b[S]);if(!d||d.from==h)for(var C=0;C<y.length;++C)wn(t,0,y[C]);if(d&&(d.from||0)==h){if(wn(t,(null==d.to?p+1:d.to)-h,d.marker,null==d.from),null==d.to)return;d.to==h&&(d=!1)}}if(h>=p)break;for(var E=Math.min(p,g);;){if(v){var j=h+v.length;if(!d){var T=j>E?v.slice(0,E-h):v;t.addToken(t,T,a?a+l:l,c,h+T.length==g?u:"",s,f)}if(j>=E){v=v.slice(E-h),h=E;break}h=j,c=""}v=i.slice(o,o=n[m++]),a=hn(n[m++],t.cm.options)}}else for(var O=1;O<n.length;O+=2)t.addToken(t,i.slice(o,o=n[O]),hn(n[O+1],t.cm.options))}function kn(e,t,n){this.line=t,this.rest=en(t),this.size=this.rest?tt(X(this.rest))-n+1:1,this.node=this.text=null,this.hidden=rn(e,t)}function _n(e,t,n){for(var r,i=[],o=t;o<n;o=r){var a=new kn(e.doc,Qe(e.doc,o),o);r=o+a.size,i.push(a)}return i}var Sn=null;function Cn(e){Sn?Sn.ops.push(e):e.ownsGroup=Sn={ops:[e],delayedCallbacks:[]}}function En(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function jn(e,t){var n=e.ownsGroup;if(n)try{En(n)}finally{Sn=null,t(n)}}var Tn=null;function On(e,t){var n=me(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);Sn?r=Sn.delayedCallbacks:Tn?r=Tn:(r=Tn=[],setTimeout(Nn,0));for(var o=function(e){r.push((function(){return n[e].apply(null,i)}))},a=0;a<n.length;++a)o(a)}}function Nn(){var e=Tn;Tn=null;for(var t=0;t<e.length;++t)e[t]()}function Mn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?Dn(e,t):"gutter"==o?In(e,t,n,r):"class"==o?Rn(e,t):"widget"==o&&Fn(e,t,r)}t.changes=null}function Ln(e){return e.node==e.text&&(e.node=O("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&s<8&&(e.node.style.zIndex=2)),e.node}function Pn(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=Ln(t);t.background=r.insertBefore(O("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function An(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):mn(e,t)}function Dn(e,t){var n=t.text.className,r=An(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Rn(e,t)):n&&(t.text.className=n)}function Rn(e,t){Pn(e,t),t.line.wrapClass?Ln(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function In(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=Ln(t);t.gutterBackground=O("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=Ln(t),s=t.gutter=O("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(O("div",it(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.display.gutterSpecs.length;++l){var u=e.display.gutterSpecs[l].className,c=o.hasOwnProperty(u)&&o[u];c&&s.appendChild(O("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function Fn(e,t,n){t.alignable&&(t.alignable=null);for(var r=S("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Un(e,t,n)}function zn(e,t,n,r){var i=An(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Rn(e,t),In(e,t,n,r),Un(e,t,r),t.node}function Un(e,t,n){if(Hn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Hn(e,t.rest[r],t,n,!1)}function Hn(e,t,n,r,i){if(t.widgets)for(var o=Ln(n),a=0,s=t.widgets;a<s.length;++a){var l=s[a],u=O("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Wn(l,u,n,r),e.display.input.setUneditable(u),i&&l.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),On(l,"redraw")}}function Wn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Bn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!M(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),T(t.display.measure,O("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function $n(e,t){for(var n=Ee(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Vn(e){return e.lineSpace.offsetTop}function qn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Gn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=T(e.measure,O("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Yn(e){return H-e.display.nativeBarWidth}function Xn(e){return e.display.scroller.clientWidth-Yn(e)-e.display.barWidth}function Kn(e){return e.display.scroller.clientHeight-Yn(e)-e.display.barHeight}function Qn(e,t,n){var r=e.options.lineWrapping,i=r&&Xn(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],u=a[s+1];Math.abs(l.bottom-u.bottom)>2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Jn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(tt(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Zn(e,t){var n=tt(t=Jt(t)),r=e.display.externalMeasured=new kn(e.doc,t,n);r.lineN=n;var i=r.built=mn(e,r);return r.text=i.pre,T(e.display.lineMeasure,i.pre),r}function er(e,t,n,r){return rr(e,nr(e,t),n,r)}function tr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Rr(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function nr(e,t){var n=tt(t),r=tr(e,n);r&&!r.text?r=null:r&&r.changes&&(Mn(e,r,n,Mr(e)),e.curOp.forceUpdate=!0),r||(r=Zn(e,t));var i=Jn(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function rr(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Qn(e,t.view,t.rect),t.hasHeights=!0),(o=lr(e,t,n,r)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var ir,or={left:0,right:0,top:0,bottom:0};function ar(e,t,n){for(var r,i,o,a,s,l,u=0;u<e.length;u+=3)if(s=e[u],l=e[u+1],t<s?(i=0,o=1,a="left"):t<l?o=1+(i=t-s):(u==e.length-3||t==l&&e[u+3]>t)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[u+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[2+(u-=3)],a="left";if("right"==n&&i==l-s)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:l}}function sr(e,t){var n=or;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function lr(e,t,n,r){var i,o=ar(t.map,n,r),l=o.node,u=o.start,c=o.end,d=o.collapse;if(3==l.nodeType){for(var f=0;f<4;f++){for(;u&&oe(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c<o.coverEnd&&oe(t.line.text.charAt(o.coverStart+c));)++c;if((i=a&&s<9&&0==u&&c==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():sr(C(l,u,c).getClientRects(),r)).left||i.right||0==u)break;c=u,u-=1,d="right"}a&&s<11&&(i=ur(e.display.measure,i))}else{var p;u>0&&(d=r="right"),i=e.options.lineWrapping&&(p=l.getClientRects()).length>1?p["right"==r?p.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!u&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+Nr(e.display),top:h.top,bottom:h.bottom}:or}for(var m=i.top-t.rect.top,v=i.bottom-t.rect.top,g=(m+v)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(g<y[b]);b++);var w=b?y[b-1]:0,x=y[b],k={left:("right"==d?i.right:i.left)-t.rect.left,right:("left"==d?i.left:i.right)-t.rect.left,top:w,bottom:x};return i.left||i.right||(k.bogus=!0),e.options.singleCursorHeightPerLine||(k.rtop=m,k.rbottom=v),k}function ur(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Fe(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function cr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function dr(e){e.display.externalMeasure=null,j(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)cr(e.display.view[t])}function fr(e){dr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function pr(){return c&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function hr(){return c&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function mr(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Bn(e.widgets[n]));return t}function vr(e,t,n,r,i){if(!i){var o=mr(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=an(t);if("local"==r?a+=Vn(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:hr());var l=s.left+("window"==r?0:pr());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function gr(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=pr(),i-=hr();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function yr(e,t,n,r,i){return r||(r=Qe(e.doc,t.line)),vr(e,r,er(e,r,t.ch,i),n)}function br(e,t,n,r,i,o){function a(t,a){var s=rr(e,i,t,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,vr(e,r,s,n)}r=r||Qe(e.doc,t.line),i||(i=nr(e,r));var s=fe(r,e.doc.direction),l=t.ch,u=t.sticky;if(l>=r.text.length?(l=r.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a("before"==u?l-1:l,"before"==u);function c(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var d=ce(s,l,u),f=ue,p=c(l,d,"before"==u);return null!=f&&(p.other=c(l,f,"before"!=u)),p}function wr(e,t){var n=0;t=ft(e.doc,t),e.options.lineWrapping||(n=Nr(e.display)*t.ch);var r=Qe(e.doc,t.line),i=an(r)+Vn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function xr(e,t,n,r,i){var o=ot(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function kr(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return xr(r.first,0,null,-1,-1);var i=nt(r,n),o=r.first+r.size-1;if(i>o)return xr(r.first+r.size-1,Qe(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=Qe(r,i);;){var s=Er(e,a,i,t,n),l=Kt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==i)return u;a=Qe(r,i=u.line)}}function _r(e,t,n,r){r-=mr(t);var i=t.text.length,o=se((function(t){return rr(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=se((function(t){return rr(e,n,t).top>r}),o,i)}}function Sr(e,t,n,r){return n||(n=nr(e,t)),_r(e,t,n,vr(e,t,rr(e,n,r),"line").top)}function Cr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Er(e,t,n,r,i){i-=an(t);var o=nr(e,t),a=mr(t),s=0,l=t.text.length,u=!0,c=fe(t,e.doc.direction);if(c){var d=(e.options.lineWrapping?Tr:jr)(e,t,n,o,c,r,i);s=(u=1!=d.level)?d.from:d.to-1,l=u?d.to:d.from-1}var f,p,h=null,m=null,v=se((function(t){var n=rr(e,o,t);return n.top+=a,n.bottom+=a,!!Cr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(h=t,m=n),!0)}),s,l),g=!1;if(m){var y=r-m.left<m.right-r,b=y==u;v=h+(b?0:1),p=b?"after":"before",f=y?m.left:m.right}else{u||v!=l&&v!=s||v++,p=0==v?"after":v==t.text.length?"before":rr(e,o,v-(u?1:0)).bottom+a<=i==u?"after":"before";var w=br(e,ot(n,v,p),"line",t,o);f=w.left,g=i<w.top?-1:i>=w.bottom?1:0}return xr(n,v=ae(t.text,v,1),p,g,r-f)}function jr(e,t,n,r,i,o,a){var s=se((function(s){var l=i[s],u=1!=l.level;return Cr(br(e,ot(n,u?l.to:l.from,u?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var u=1!=l.level,c=br(e,ot(n,u?l.from:l.to,u?"after":"before"),"line",t,r);Cr(c,o,a,!0)&&c.top>a&&(l=i[s-1])}return l}function Tr(e,t,n,r,i,o,a){var s=_r(e,t,r,a),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,d=null,f=0;f<i.length;f++){var p=i[f];if(!(p.from>=u||p.to<=l)){var h=rr(e,r,1!=p.level?Math.min(u,p.to)-1:Math.max(l,p.from)).right,m=h<o?o-h+1e9:h-o;(!c||d>m)&&(c=p,d=m)}}return c||(c=i[i.length-1]),c.from<l&&(c={from:l,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function Or(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ir){ir=O("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ir.appendChild(document.createTextNode("x")),ir.appendChild(O("br"));ir.appendChild(document.createTextNode("x"))}T(e.measure,ir);var n=ir.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),j(e.measure),n||1}function Nr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=O("span","xxxxxxxxxx"),n=O("pre",[t],"CodeMirror-line-like");T(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Mr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Lr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Lr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Pr(e){var t=Or(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Nr(e.display)-3);return function(i){if(rn(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function Ar(e){var t=e.doc,n=Pr(e);t.iter((function(e){var t=n(e);t!=e.height&&et(e,t)}))}function Dr(e,t,n,r){var i=e.display;if(!n&&"true"==Ee(t).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(e){return null}var l,u=kr(e,o,a);if(r&&u.xRel>0&&(l=Qe(e.doc,u.line).text).length==u.ch){var c=F(l,l.length,e.options.tabSize)-l.length;u=ot(u.line,Math.max(0,Math.round((o-Gn(e.display).left)/Nr(e.display))-c))}return u}function Rr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function Ir(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Nt&&tn(e.doc,t)<i.viewTo&&zr(e);else if(n<=i.viewFrom)Nt&&nn(e.doc,n+r)>i.viewFrom?zr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)zr(e);else if(t<=i.viewFrom){var o=Ur(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):zr(e)}else if(n>=i.viewTo){var a=Ur(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):zr(e)}else{var s=Ur(e,t,t,-1),l=Ur(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(_n(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):zr(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function Fr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Rr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==U(a,n)&&a.push(n)}}}function zr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ur(e,t,n,r){var i,o=Rr(e,t),a=e.display.view;if(!Nt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l<o;l++)s+=a[l].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;tn(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Hr(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=_n(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=_n(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Rr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(_n(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Rr(e,n)))),r.viewTo=n}function Wr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function Br(e){e.display.input.showSelection(e.display.input.prepareSelection())}function $r(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var l=s.empty();(l||e.options.showCursorWhenSelecting)&&Vr(e,s.head,i),l||Gr(e,s,o)}}return r}function Vr(e,t,n){var r=br(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(O("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(O("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function qr(e,t){return e.top-t.top||e.left-t.left}function Gr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Gn(e.display),s=a.left,l=Math.max(r.sizerWidth,Xn(e)-r.sizer.offsetLeft)-a.right,u="ltr"==i.direction;function c(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(O("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n height: "+(r-t)+"px"))}function d(t,n,r){var o,a,d=Qe(i,t),f=d.text.length;function p(n,r){return yr(e,ot(t,n),"div",d,r)}function h(t,n,r){var i=Sr(e,d,null,t),o="ltr"==n==("after"==r)?"left":"right";return p("after"==r?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1),o)[o]}var m=fe(d,i.direction);return le(m,n||0,null==r?f:r,(function(e,t,i,d){var v="ltr"==i,g=p(e,v?"left":"right"),y=p(t-1,v?"right":"left"),b=null==n&&0==e,w=null==r&&t==f,x=0==d,k=!m||d==m.length-1;if(y.top-g.top<=3){var _=(u?w:b)&&k,S=(u?b:w)&&x?s:(v?g:y).left,C=_?l:(v?y:g).right;c(S,g.top,C-S,g.bottom)}else{var E,j,T,O;v?(E=u&&b&&x?s:g.left,j=u?l:h(e,i,"before"),T=u?s:h(t,i,"after"),O=u&&w&&k?l:y.right):(E=u?h(e,i,"before"):s,j=!u&&b&&x?l:g.right,T=!u&&w&&k?s:y.left,O=u?h(t,i,"after"):l),c(E,g.top,j-E,g.bottom),g.bottom<y.top&&c(s,g.bottom,null,y.top),c(T,y.top,O-T,y.bottom)}(!o||qr(g,o)<0)&&(o=g),qr(y,o)<0&&(o=y),(!a||qr(g,a)<0)&&(a=g),qr(y,a)<0&&(a=y)})),{start:o,end:a}}var f=t.from(),p=t.to();if(f.line==p.line)d(f.line,f.ch,p.ch);else{var h=Qe(i,f.line),m=Qe(i,p.line),v=Jt(h)==Jt(m),g=d(f.line,f.ch,v?h.text.length+1:null).end,y=d(p.line,v?0:null,p.ch).start;v&&(g.top<y.top-2?(c(g.right,g.top,null,g.bottom),c(s,y.top,y.left,y.bottom)):c(g.right,g.top,y.left-g.right,g.bottom)),g.bottom<y.top&&c(s,g.bottom,null,y.top)}n.appendChild(o)}function Yr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||Jr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Xr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Qr(e))}function Kr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Jr(e))}),100)}function Qr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ge(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Yr(e))}function Jr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ge(e,"blur",e,t),e.state.focused=!1,E(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Zr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=e.options.lineWrapping,l=void 0,u=0;if(!i.hidden){if(a&&s<8){var c=i.node.offsetTop+i.node.offsetHeight;l=c-n,n=c}else{var d=i.node.getBoundingClientRect();l=d.bottom-d.top,!o&&i.text.firstChild&&(u=i.text.firstChild.getBoundingClientRect().right-d.left-1)}var f=i.line.height-l;if((f>.005||f<-.005)&&(et(i.line,l),ei(i.line),i.rest))for(var p=0;p<i.rest.length;p++)ei(i.rest[p]);if(u>e.display.sizerWidth){var h=Math.ceil(u/Nr(e.display));h>e.display.maxLineLength&&(e.display.maxLineLength=h,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function ei(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function ti(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Vn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=nt(t,r),a=nt(t,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<o?(o=s,a=nt(t,an(Qe(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(o=nt(t,an(Qe(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ni(e,t){if(!ye(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!h){var o=O("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Vn(e.display))+"px;\n height: "+(t.bottom-t.top+Yn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function ri(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?ot(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ot(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=br(e,t),l=n&&n!=t?br(e,n):s,u=oi(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),c=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=u.scrollTop&&(fi(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(hi(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function ii(e,t){var n=oi(e,t);null!=n.scrollTop&&fi(e,n.scrollTop),null!=n.scrollLeft&&hi(e,n.scrollLeft)}function oi(e,t){var n=e.display,r=Or(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Kn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+qn(n),l=t.top<r,u=t.bottom>s-r;if(t.top<i)a.scrollTop=l?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(a.scrollTop=c)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,p=Xn(e)-n.gutters.offsetWidth,h=t.right-t.left>p;return h&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.left<f?a.scrollLeft=Math.max(0,t.left+d-(h?0:10)):t.right>p+f-3&&(a.scrollLeft=t.right+(h?0:10)-p),a}function ai(e,t){null!=t&&(ci(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function si(e){ci(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function li(e,t,n){null==t&&null==n||ci(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ui(e,t){ci(e),e.curOp.scrollToPos=t}function ci(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,di(e,wr(e,t.from),wr(e,t.to),t.margin))}function di(e,t,n,r){var i=oi(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});li(e,i.scrollLeft,i.scrollTop)}function fi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Bi(e,{top:t}),pi(e,t,!0),n&&Bi(e),Di(e,100))}function pi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function hi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Gi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function mi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+qn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Yn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var vi=function(e,t,n){this.cm=n;var r=this.vert=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),he(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),he(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};vi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},vi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},vi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},vi.prototype.zeroWidthHack=function(){var e=y&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},vi.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},vi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var gi=function(){};function yi(e,t){t||(t=mi(e));var n=e.display.barWidth,r=e.display.barHeight;bi(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Zr(e),bi(e,mi(e)),n=e.display.barWidth,r=e.display.barHeight}function bi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}gi.prototype.update=function(){return{bottom:0,right:0}},gi.prototype.setScrollLeft=function(){},gi.prototype.setScrollTop=function(){},gi.prototype.clear=function(){};var wi={native:vi,null:gi};function xi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new wi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),he(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?hi(e,t):fi(e,t)}),e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}var ki=0;function _i(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++ki},Cn(e.curOp)}function Si(e){var t=e.curOp;t&&jn(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;Ci(e)}))}function Ci(e){for(var t=e.ops,n=0;n<t.length;n++)Ei(t[n]);for(var r=0;r<t.length;r++)ji(t[r]);for(var i=0;i<t.length;i++)Ti(t[i]);for(var o=0;o<t.length;o++)Oi(t[o]);for(var a=0;a<t.length;a++)Ni(t[a])}function Ei(e){var t=e.cm,n=t.display;Fi(t),e.updateMaxLine&&ln(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ii(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ji(e){e.updatedDisplay=e.mustUpdate&&Hi(e.cm,e.update)}function Ti(e){var t=e.cm,n=t.display;e.updatedDisplay&&Zr(t),e.barMeasure=mi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=er(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Yn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Xn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Oi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&hi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==L();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&yi(t,e.barMeasure),e.updatedDisplay&&qi(t,e.barMeasure),e.selectionChanged&&Yr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Xr(e.cm)}function Ni(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&Wi(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&pi(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&hi(t,e.scrollLeft,!0,!0),e.scrollToPos&&ni(t,ri(t,ft(r,e.scrollToPos.from),ft(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||ge(i[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&ge(o[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ge(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Mi(e,t){if(e.curOp)return t();_i(e);try{return t()}finally{Si(e)}}function Li(e,t){return function(){if(e.curOp)return t.apply(e,arguments);_i(e);try{return t.apply(e,arguments)}finally{Si(e)}}}function Pi(e){return function(){if(this.curOp)return e.apply(this,arguments);_i(this);try{return e.apply(this,arguments)}finally{Si(this)}}}function Ai(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);_i(t);try{return e.apply(this,arguments)}finally{Si(t)}}}function Di(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,R(Ri,e))}function Ri(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=bt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Ge(t.mode,r.state):null,l=gt(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!d&&f<a.length;++f)d=a[f]!=o.styles[f];d&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&wt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Di(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Mi(e,(function(){for(var t=0;t<i.length;t++)Fr(e,i[t],"text")}))}}var Ii=function(e,t,n){var r=e.display;this.viewport=t,this.visible=ti(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Xn(e),this.force=n,this.dims=Mr(e),this.events=[]};function Fi(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Yn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Yn(e)+"px",t.scrollbarsClipped=!0)}function zi(e){if(e.hasFocus())return null;var t=L();if(!t||!M(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&M(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Ui(e){if(e&&e.activeElt&&e.activeElt!=L()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&M(document.body,e.anchorNode)&&M(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function Hi(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return zr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Wr(e))return!1;Yi(e)&&(zr(e),t.dims=Mr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Nt&&(o=tn(e.doc,o),a=nn(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Hr(e,o,a),n.viewOffset=an(Qe(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=Wr(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=zi(e);return l>4&&(n.lineDiv.style.display="none"),$i(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Ui(u),j(n.cursorDiv),j(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Di(e,400)),n.updateLineNumbers=null,!0}function Wi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Xn(e))r&&(t.visible=ti(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+qn(e.display)-Kn(e),n.top)}),t.visible=ti(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Hi(e,t))break;Zr(e);var i=mi(e);Br(e),yi(e,i),qi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Bi(e,t){var n=new Ii(e,t);if(Hi(e,n)){Zr(e),Wi(e,n);var r=mi(e);Br(e),yi(e,r),qi(e,r),n.finish()}}function $i(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var u=r.view,c=r.viewFrom,d=0;d<u.length;d++){var f=u[d];if(f.hidden);else if(f.node&&f.node.parentNode==o){for(;a!=f.node;)a=s(a);var p=i&&null!=t&&t<=c&&f.lineNumber;f.changes&&(U(f.changes,"gutter")>-1&&(p=!1),Mn(e,f,c,n)),p&&(j(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(it(e.options,c)))),a=f.node.nextSibling}else{var h=zn(e,f,c,n);o.insertBefore(h,a)}c+=f.size}for(;a;)a=s(a)}function Vi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function qi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Yn(e)+"px"}function Gi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Lr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function Yi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=it(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(O("div",[O("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Vi(e.display),!0}return!1}function Xi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Ki(e){var t=e.gutters,n=e.gutterSpecs;j(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,s=t.appendChild(O("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==o&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Vi(e)}function Qi(e){Ki(e.display),Ir(e),Gi(e)}function Ji(e,t,r,i){var o=this;this.input=r,o.scrollbarFiller=O("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=O("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=N("div",null,"CodeMirror-code"),o.selectionDiv=O("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=O("div",null,"CodeMirror-cursors"),o.measure=O("div",null,"CodeMirror-measure"),o.lineMeasure=O("div",null,"CodeMirror-measure"),o.lineSpace=N("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var u=N("div",[o.lineSpace],"CodeMirror-lines");o.mover=O("div",[u],null,"position: relative"),o.sizer=O("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=O("div",null,null,"position: absolute; height: "+H+"px; width: 1px;"),o.gutters=O("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=O("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=O("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||n&&g||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=Xi(i.gutters,i.lineNumbers),Ki(o),r.init(o)}Ii.prototype.signal=function(e,t){we(e,t)&&this.events.push(arguments)},Ii.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ge.apply(null,this.events[e])};var Zi=0,eo=null;function to(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function no(e){var t=to(e);return t.x*=eo,t.y*=eo,t}function ro(e,t){var r=to(t),i=r.x,o=r.y,a=e.display,s=a.scroller,u=s.scrollWidth>s.clientWidth,c=s.scrollHeight>s.clientHeight;if(i&&u||o&&c){if(o&&y&&l)e:for(var f=t.target,p=a.view;f!=s;f=f.parentNode)for(var h=0;h<p.length;h++)if(p[h].node==f){e.display.currentWheelTarget=f;break e}if(i&&!n&&!d&&null!=eo)return o&&c&&fi(e,Math.max(0,s.scrollTop+o*eo)),hi(e,Math.max(0,s.scrollLeft+i*eo)),(!o||o&&c)&&ke(t),void(a.wheelStartX=null);if(o&&null!=eo){var m=o*eo,v=e.doc.scrollTop,g=v+a.wrapper.clientHeight;m<0?v=Math.max(0,v+m-50):g=Math.min(e.doc.height,g+m+50),Bi(e,{top:v,bottom:g})}Zi<20&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=i,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(eo=(eo*Zi+n)/(Zi+1),++Zi)}}),200)):(a.wheelDX+=i,a.wheelDY+=o))}}a?eo=-.53:n?eo=15:c?eo=-.7:f&&(eo=-1/3);var io=function(e,t){this.ranges=e,this.primIndex=t};io.prototype.primary=function(){return this.ranges[this.primIndex]},io.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!st(n.anchor,r.anchor)||!st(n.head,r.head))return!1}return!0},io.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new oo(lt(this.ranges[t].anchor),lt(this.ranges[t].head));return new io(e,this.primIndex)},io.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},io.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(at(t,r.from())>=0&&at(e,r.to())<=0)return n}return-1};var oo=function(e,t){this.anchor=e,this.head=t};function ao(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return at(e.from(),t.from())})),n=U(t,i);for(var o=1;o<t.length;o++){var a=t[o],s=t[o-1],l=at(s.to(),a.from());if(r&&!a.empty()?l>0:l>=0){var u=ct(s.from(),a.from()),c=ut(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new oo(d?c:u,d?u:c))}}return new io(t,n)}function so(e,t){return new io([new oo(e,t||e)],0)}function lo(e){return e.text?ot(e.from.line+e.text.length-1,X(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function uo(e,t){if(at(e,t.from)<0)return e;if(at(e,t.to)<=0)return lo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=lo(t).ch-t.to.ch),ot(n,r)}function co(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new oo(uo(i.anchor,t),uo(i.head,t)))}return ao(e.cm,n,e.sel.primIndex)}function fo(e,t,n){return e.line==t.line?ot(n.line,e.ch-t.ch+n.ch):ot(n.line+(e.line-t.line),e.ch)}function po(e,t,n){for(var r=[],i=ot(e.first,0),o=i,a=0;a<t.length;a++){var s=t[a],l=fo(s.from,i,o),u=fo(lo(s),i,o);if(i=s.to,o=u,"around"==n){var c=e.sel.ranges[a],d=at(c.head,c.anchor)<0;r[a]=new oo(d?u:l,d?l:u)}else r[a]=new oo(l,l)}return new io(r,e.sel.primIndex)}function ho(e){e.doc.mode=$e(e.options,e.doc.modeOption),mo(e)}function mo(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Di(e,100),e.state.modeGen++,e.curOp&&Ir(e)}function vo(e,t){return 0==t.from.ch&&0==t.to.ch&&""==X(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function go(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){cn(e,n,i,r),On(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new un(u[o],i(o),r));return n}var s=t.from,l=t.to,u=t.text,c=Qe(e,s.line),d=Qe(e,l.line),f=X(u),p=i(u.length-1),h=l.line-s.line;if(t.full)e.insert(0,a(0,u.length)),e.remove(u.length,e.size-u.length);else if(vo(e,t)){var m=a(0,u.length-1);o(d,d.text,p),h&&e.remove(s.line,h),m.length&&e.insert(s.line,m)}else if(c==d)if(1==u.length)o(c,c.text.slice(0,s.ch)+f+c.text.slice(l.ch),p);else{var v=a(1,u.length-1);v.push(new un(f+c.text.slice(l.ch),p,r)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,v)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+d.text.slice(l.ch),i(0)),e.remove(s.line+1,h);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(d,f+d.text.slice(l.ch),p);var g=a(1,u.length-1);h>1&&e.remove(s.line+1,h-1),e.insert(s.line+1,g)}On(e,"change",e,t)}function yo(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var s=e.linked[a];if(s.doc!=i){var l=o&&s.sharedHist;n&&!l||(t(s.doc,l),r(s.doc,e,l))}}}r(e,null,!0)}function bo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ar(e),ho(e),wo(e),e.options.lineWrapping||ln(e),e.options.mode=t.modeOption,Ir(e)}function wo(e){("rtl"==e.doc.direction?P:E)(e.display.lineDiv,"CodeMirror-rtl")}function xo(e){Mi(e,(function(){wo(e),Ir(e)}))}function ko(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function _o(e,t){var n={from:lt(t.from),to:lo(t),text:Je(e,t.from,t.to)};return No(e,n,t.from.line,t.to.line+1),yo(e,(function(e){return No(e,n,t.from.line,t.to.line+1)}),!0),n}function So(e){for(;e.length&&X(e).ranges;)e.pop()}function Co(e,t){return t?(So(e.done),X(e.done)):e.done.length&&!X(e.done).ranges?X(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),X(e.done)):void 0}function Eo(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=Co(i,i.lastOp==r)))a=X(o.changes),0==at(t.from,t.to)&&0==at(t.from,a.to)?a.to=lo(t):o.changes.push(_o(e,t));else{var l=X(i.done);for(l&&l.ranges||Oo(e.sel,i.done),o={changes:[_o(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||ge(e,"historyAdded")}function jo(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function To(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||jo(e,o,X(i.done),t))?i.done[i.done.length-1]=t:Oo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&So(i.undone)}function Oo(e,t){var n=X(t);n&&n.ranges&&n.equals(e)||t.push(e)}function No(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Mo(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Lo(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Mo(n[i]));return r}function Po(e,t){var n=Lo(e,t),r=zt(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue e;o.push(l)}else a&&(n[i]=a)}return n}function Ao(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?io.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];r.push({changes:s});for(var l=0;l<a.length;++l){var u=a[l],c=void 0;if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var d in u)(c=d.match(/^spans_(\d+)$/))&&U(t,Number(c[1]))>-1&&(X(s)[d]=u[d],delete u[d])}}}return r}function Do(e,t,n,r){if(r){var i=e.anchor;if(n){var o=at(t,i)<0;o!=at(n,i)<0?(i=t,t=n):o!=at(t,n)<0&&(t=n)}return new oo(i,t)}return new oo(n||t,t)}function Ro(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Wo(e,new io([Do(e.sel.primary(),t,n,i)],0),r)}function Io(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Do(e.sel.ranges[o],t[o],null,i);Wo(e,ao(e.cm,r,e.sel.primIndex),n)}function Fo(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Wo(e,ao(e.cm,i,e.sel.primIndex),r)}function zo(e,t,n,r){Wo(e,so(t,n),r)}function Uo(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new oo(ft(e,t[n].anchor),ft(e,t[n].head))},origin:n&&n.origin};return ge(e,"beforeSelectionChange",e,r),e.cm&&ge(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?ao(e.cm,r.ranges,r.ranges.length-1):t}function Ho(e,t,n){var r=e.history.done,i=X(r);i&&i.ranges?(r[r.length-1]=t,Bo(e,t,n)):Wo(e,t,n)}function Wo(e,t,n){Bo(e,t,n),To(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Bo(e,t,n){(we(e,"beforeSelectionChange")||e.cm&&we(e.cm,"beforeSelectionChange"))&&(t=Uo(e,t,n));var r=n&&n.bias||(at(t.primary().head,e.sel.primary().head)<0?-1:1);$o(e,qo(e,t,r,!0)),n&&!1===n.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||si(e.cm)}function $o(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,be(e.cm)),On(e,"cursorActivity",e))}function Vo(e){$o(e,qo(e,e.sel,null,!1))}function qo(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=Yo(e,a.anchor,s&&s.anchor,n,r),u=Yo(e,a.head,s&&s.head,n,r);(i||l!=a.anchor||u!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new oo(l,u))}return i?ao(e.cm,i,t.primIndex):t}function Go(e,t,n,r,i){var o=Qe(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker,u="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,c="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(u?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(c?s.to>=t.ch:s.to>t.ch))){if(i&&(ge(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),f=void 0;if((r<0?c:u)&&(d=Xo(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(f=at(d,n))&&(r<0?f<0:f>0))return Go(e,d,t,r,i)}var p=l.find(r<0?-1:1);return(r<0?u:c)&&(p=Xo(e,p,r,p.line==t.line?o:null)),p?Go(e,p,t,r,i):null}}return t}function Yo(e,t,n,r,i){var o=r||1,a=Go(e,t,n,o,i)||!i&&Go(e,t,n,o,!0)||Go(e,t,n,-o,i)||!i&&Go(e,t,n,-o,!0);return a||(e.cantEdit=!0,ot(e.first,0))}function Xo(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ft(e,ot(t.line-1)):null:n>0&&t.ch==(r||Qe(e,t.line)).text.length?t.line<e.first+e.size-1?ot(t.line+1,0):null:new ot(t.line,t.ch+n)}function Ko(e){e.setSelection(ot(e.firstLine(),0),ot(e.lastLine()),B)}function Qo(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=ft(e,t)),n&&(r.to=ft(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),ge(e,"beforeChange",e,r),e.cm&&ge(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Jo(e,t,n){if(e.cm){if(!e.cm.curOp)return Li(e.cm,Jo)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(we(e,"beforeChange")||e.cm&&we(e.cm,"beforeChange"))||(t=Qo(e,t,!0))){var r=Ot&&!n&&Ht(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Zo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Zo(e,t)}}function Zo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=at(t.from,t.to)){var n=co(e,t);Eo(e,t,n,e.cm?e.cm.curOp.id:NaN),na(e,t,n,zt(e,t));var r=[];yo(e,(function(e,n){n||-1!=U(r,e.history)||(sa(e.history,t),r.push(e.history)),na(e,t,null,zt(e,t))}))}}function ea(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,u=0;u<s.length&&(i=s[u],n?!i.ranges||i.equals(e.sel):i.ranges);u++);if(u!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(r)return void s.push(i);break}if(Oo(i,l),n&&!i.equals(e.sel))return void Wo(e,i,{clearRedo:!1});a=i}var c=[];Oo(a,l),l.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var d=we(e,"beforeChange")||e.cm&&we(e.cm,"beforeChange"),f=function(n){var r=i.changes[n];if(r.origin=t,d&&!Qo(e,r,!1))return s.length=0,{};c.push(_o(e,r));var o=n?co(e,r):X(s);na(e,r,o,Po(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:lo(r)});var a=[];yo(e,(function(e,t){t||-1!=U(a,e.history)||(sa(e.history,r),a.push(e.history)),na(e,r,null,Po(e,r))}))},p=i.changes.length-1;p>=0;--p){var h=f(p);if(h)return h.v}}}}function ta(e,t){if(0!=t&&(e.first+=t,e.sel=new io(K(e.sel.ranges,(function(e){return new oo(ot(e.anchor.line+t,e.anchor.ch),ot(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Ir(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Fr(e.cm,r,"gutter")}}function na(e,t,n,r){if(e.cm&&!e.cm.curOp)return Li(e.cm,na)(e,t,n,r);if(t.to.line<e.first)ta(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);ta(e,i),t={from:ot(e.first,0),to:ot(t.to.line+i,t.to.ch),text:[X(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ot(o,Qe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Je(e,t.from,t.to),n||(n=co(e,t)),e.cm?ra(e.cm,t,r):go(e,t,r),Bo(e,n,B),e.cantEdit&&Yo(e,ot(e.firstLine(),0))&&(e.cantEdit=!1)}}function ra(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=tt(Jt(Qe(r,o.line))),r.iter(l,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&be(e),go(r,t,n,Pr(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=sn(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),Tt(r,o.line),Di(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?Ir(e):o.line!=a.line||1!=t.text.length||vo(e.doc,t)?Ir(e,o.line,a.line+1,u):Fr(e,o.line,"text");var c=we(e,"changes"),d=we(e,"change");if(d||c){var f={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&On(e,"change",e,f),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function ia(e,t,n,r,i){var o;r||(r=n),at(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Jo(e,{from:n,to:r,text:t,origin:i})}function oa(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function aa(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)oa(o.ranges[s].anchor,t,n,r),oa(o.ranges[s].head,t,n,r)}else{for(var l=0;l<o.changes.length;++l){var u=o.changes[l];if(n<u.from.line)u.from=ot(u.from.line+r,u.from.ch),u.to=ot(u.to.line+r,u.to.ch);else if(t<=u.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function sa(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;aa(e.done,n,r,i),aa(e.undone,n,r,i)}function la(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Qe(e,dt(e,t)):i=tt(t),null==i?null:(r(o,i)&&e.cm&&Fr(e.cm,i,n),o)}function ua(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function ca(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}oo.prototype.from=function(){return ct(this.anchor,this.head)},oo.prototype.to=function(){return ut(this.anchor,this.head)},oo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ua.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,dn(i),On(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},ca.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ua))){var s=[];this.collapse(s),this.children=[new ua(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,s=a;s<i.lines.length;){var l=new ua(i.lines.slice(s,s+=25));i.height-=l.height,this.children.splice(++r,0,l),l.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new ca(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=U(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new ca(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var da=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function fa(e,t,n){an(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ai(e,n)}function pa(e,t,n,r){var i=new da(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),la(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!rn(e,t)){var r=an(t)<e.scrollTop;et(t,t.height+Bn(i)),r&&ai(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&On(o,"lineWidgetAdded",o,i,"number"==typeof t?t:tt(t)),i}da.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=tt(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Bn(this);et(n,Math.max(0,n.height-o)),e&&(Mi(e,(function(){fa(e,n,-o),Fr(e,r,"widget")})),On(e,"lineWidgetCleared",e,this,r))}},da.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Bn(this)-t;i&&(rn(this.doc,r)||et(r,r.height+i),n&&Mi(n,(function(){n.curOp.forceUpdate=!0,fa(n,r,i),On(n,"lineWidgetChanged",n,e,tt(r))})))},xe(da);var ha=0,ma=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ha};function va(e,t,n,r,i){if(r&&r.shared)return ya(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Li(e.cm,va)(e,t,n,r,i);var o=new ma(e,i),a=at(t,n);if(r&&I(r,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=N("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Qt(e,t.line,t,n,o)||t.line!=n.line&&Qt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Lt()}o.addToHistory&&Eo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,u=e.cm;if(e.iter(l,n.line+1,(function(e){u&&o.collapsed&&!u.options.lineWrapping&&Jt(e)==u.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&et(e,0),Rt(e,new Pt(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){rn(e,t)&&et(t,0)})),o.clearOnEnter&&he(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Mt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ha,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Ir(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)Fr(u,c,"text");o.atomic&&Vo(u.doc),On(u,"markerAdded",u,o)}return o}ma.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&_i(e),we(this,"clear")){var n=this.find();n&&On(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=At(a.markedSpans,this);e&&!this.collapsed?Fr(e,tt(a),"text"):e&&(null!=s.to&&(i=tt(a)),null!=s.from&&(r=tt(a))),a.markedSpans=Dt(a.markedSpans,s),null==s.from&&this.collapsed&&!rn(this.doc,a)&&e&&et(a,Or(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var u=Jt(this.lines[l]),c=sn(u);c>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Ir(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Vo(e.doc)),e&&On(e,"markerCleared",e,this,r,i),t&&Si(e),this.parent&&this.parent.clear()}},ma.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=At(o.markedSpans,this);if(null!=a.from&&(n=ot(t?o:tt(o),a.from),-1==e))return n;if(null!=a.to&&(r=ot(t?o:tt(o),a.to),1==e))return r}return n&&{from:n,to:r}},ma.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Mi(r,(function(){var i=t.line,o=tt(t.line),a=tr(r,o);if(a&&(cr(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!rn(n.doc,i)&&null!=n.height){var s=n.height;n.height=null;var l=Bn(n)-s;l&&et(i,i.height+l)}On(r,"markerChanged",r,e)}))},ma.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=U(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ma.prototype.detachLine=function(e){if(this.lines.splice(U(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},xe(ma);var ga=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function ya(e,t,n,r,i){(r=I(r)).shared=!1;var o=[va(e,t,n,r,i)],a=o[0],s=r.widgetNode;return yo(e,(function(e){s&&(r.widgetNode=s.cloneNode(!0)),o.push(va(e,ft(e,t),ft(e,n),r,i));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=X(o)})),new ga(o,a)}function ba(e){return e.findMarks(ot(e.first,0),e.clipPos(ot(e.lastLine())),(function(e){return e.parent}))}function wa(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(at(o,a)){var s=va(e,o,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}function xa(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];yo(n.primary.doc,(function(e){return r.push(e)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==U(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}ga.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();On(this,"clear")}},ga.prototype.find=function(e,t){return this.primary.find(e,t)},xe(ga);var ka=0,_a=function(e,t,n,r,i){if(!(this instanceof _a))return new _a(e,t,n,r,i);null==n&&(n=0),ca.call(this,[new ua([new un("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=ot(n,0);this.sel=so(o),this.history=new ko(null),this.id=++ka,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),go(this,{from:o,to:o,text:e}),Wo(this,so(o),B)};_a.prototype=Z(ca.prototype,{constructor:_a,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ze(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Ai((function(e){var t=ot(this.first,0),n=this.first+this.size-1;Jo(this,{from:t,to:ot(n,Qe(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&li(this.cm,0,0),Wo(this,so(t),B)})),replaceRange:function(e,t,n,r){ia(this,e,t=ft(this,t),n=n?ft(this,n):t,r)},getRange:function(e,t,n){var r=Je(this,ft(this,e),ft(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(rt(this,e))return Qe(this,e)},getLineNumber:function(e){return tt(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Qe(this,e)),Jt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ft(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ai((function(e,t,n){zo(this,ft(this,"number"==typeof e?ot(e,t||0):e),null,n)})),setSelection:Ai((function(e,t,n){zo(this,ft(this,e),ft(this,t||e),n)})),extendSelection:Ai((function(e,t,n){Ro(this,ft(this,e),t&&ft(this,t),n)})),extendSelections:Ai((function(e,t){Io(this,ht(this,e),t)})),extendSelectionsBy:Ai((function(e,t){Io(this,ht(this,K(this.sel.ranges,e)),t)})),setSelections:Ai((function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new oo(ft(this,e[i].anchor),ft(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Wo(this,ao(this.cm,r,t),n)}})),addSelection:Ai((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new oo(ft(this,e),ft(this,t||e))),Wo(this,ao(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Je(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Je(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Ai((function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var s=t&&"end"!=t&&po(this,r,t),l=r.length-1;l>=0;l--)Jo(this,r[l]);s?Ho(this,s):this.cm&&si(this.cm)})),undo:Ai((function(){ea(this,"undo")})),redo:Ai((function(){ea(this,"redo")})),undoSelection:Ai((function(){ea(this,"undo",!0)})),redoSelection:Ai((function(){ea(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new ko(this.history),yo(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ao(this.history.done),undone:Ao(this.history.undone)}},setHistory:function(e){var t=this.history=new ko(this.history);t.done=Ao(e.done.slice(0),null,!0),t.undone=Ao(e.undone.slice(0),null,!0)},setGutterMarker:Ai((function(e,t,n){return la(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&re(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:Ai((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&la(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,re(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!rt(this,e))return null;if(t=e,!(e=Qe(this,e)))return null}else if(null==(t=tt(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Ai((function(e,t,n){return la(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(S(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:Ai((function(e,t,n){return la(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(S(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:Ai((function(e,t,n){return pa(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return va(this,ft(this,e),ft(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return va(this,e=ft(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Qe(this,(e=ft(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ft(this,e),t=ft(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&i==e.line&&e.ch>=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n})),ft(this,ot(n,t))},indexFromPos:function(e){var t=(e=ft(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new _a(Ze(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new _a(Ze(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],wa(r,ba(this)),r},unlinkDoc:function(e){if(e instanceof Is&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),xa(ba(this));break}if(e.history==this.history){var n=[e.id];yo(e,(function(e){return n.push(e.id)}),!0),e.history=new ko(null),e.history.done=Ao(this.history.done,n),e.history.undone=Ao(this.history.undone,n)}},iterLinkedDocs:function(e){yo(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ae(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Ai((function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&xo(this.cm))}))}),_a.prototype.eachLine=_a.prototype.iter;var Sa=0;function Ca(e){var t=this;if(Ta(t),!ye(t,e)&&!$n(t.display,e)){ke(e),a&&(Sa=+new Date);var n=Dr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),s=0,l=function(){++s==i&&Li(t,(function(){var e={from:n=ft(t.doc,n),to:n,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};Jo(t.doc,e),Ho(t.doc,so(ft(t.doc,n),ft(t.doc,lo(e))))}))()},u=function(e,n){if(t.options.allowDropFileTypes&&-1==U(t.options.allowDropFileTypes,e.type))l();else{var r=new FileReader;r.onerror=function(){return l()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[n]=e),l()},r.readAsText(e)}},c=0;c<r.length;c++)u(r[c],c);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Bo(t.doc,so(n,n)),f)for(var p=0;p<f.length;++p)ia(t.doc,"",f[p].anchor,f[p].head,"drag");t.replaceSelection(d,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Ea(e,t){if(a&&(!e.state.draggingText||+new Date-Sa<100))Ce(t);else if(!ye(e,t)&&!$n(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var n=O("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}function ja(e,t){var n=Dr(e,t);if(n){var r=document.createDocumentFragment();Vr(e,n,r),e.display.dragCursor||(e.display.dragCursor=O("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),T(e.display.dragCursor,r)}}function Ta(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Oa(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Na=!1;function Ma(){Na||(La(),Na=!0)}function La(){var e;he(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Oa(Pa)}),100))})),he(window,"blur",(function(){return Oa(Jr)}))}function Pa(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Aa={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Da=0;Da<10;Da++)Aa[Da+48]=Aa[Da+96]=String(Da);for(var Ra=65;Ra<=90;Ra++)Aa[Ra]=String.fromCharCode(Ra);for(var Ia=1;Ia<=12;Ia++)Aa[Ia+111]=Aa[Ia+63235]="F"+Ia;var Fa={};function za(e){var t,n,r,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Ua(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=K(n.split(" "),za),o=0;o<i.length;o++){var a=void 0,s=void 0;o==i.length-1?(s=i.join(" "),a=r):(s=i.slice(0,o+1).join(" "),a="...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var u in t)e[u]=t[u];return e}function Ha(e,t,n,r){var i=(t=Va(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Ha(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Ha(e,t.fallthrough[o],n,r);if(a)return a}}}function Wa(e){var t="string"==typeof e?e:Aa[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ba(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(k?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(k?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function $a(e,t){if(d&&34==e.keyCode&&e.char)return!1;var n=Aa[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Ba(n,e,t))}function Va(e){return"string"==typeof e?Fa[e]:e}function qa(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&at(o.from,X(r).to)<=0;){var a=r.pop();if(at(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}Mi(e,(function(){for(var t=r.length-1;t>=0;t--)ia(e.doc,"",r[t].from,r[t].to,"+delete");si(e)}))}function Ga(e,t,n){var r=ae(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ya(e,t,n){var r=Ga(e,t.ch,n);return null==r?null:new ot(t.line,r,n<0?"after":"before")}function Xa(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=fe(n,t.doc.direction);if(o){var a,s=i<0?X(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=nr(t,n);a=i<0?n.text.length-1:0;var c=rr(t,u,a).top;a=se((function(e){return rr(t,u,e).top==c}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Ga(n,a,1))}else a=i<0?s.to:s.from;return new ot(r,a,l)}}return new ot(r,i<0?n.text.length:0,i<0?"before":"after")}function Ka(e,t,n,r){var i=fe(t,e.doc.direction);if(!i)return Ya(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ce(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Ya(t,n,r);var s,l=function(e,n){return Ga(t,e instanceof ot?e.ch:e,n)},u=function(n){return e.options.lineWrapping?(s=s||nr(e,t),Sr(e,t,s,n)):{begin:0,end:t.text.length}},c=u("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==r<0,f=l(n,d?1:-1);if(null!=f&&(d?f<=a.to&&f<=c.end:f>=a.from&&f>=c.begin)){var p=d?"before":"after";return new ot(n.line,f,p)}}var h=function(e,t,r){for(var o=function(e,t){return t?new ot(n.line,l(e,1),"before"):new ot(n.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],s=t>0==(1!=a.level),u=s?r.begin:l(r.end,-1);if(a.from<=u&&u<a.to)return o(u,s);if(u=s?a.from:l(a.to,-1),r.begin<=u&&u<r.end)return o(u,s)}},m=h(o+r,r,c);if(m)return m;var v=r>0?c.end:l(c.begin,-1);return null==v||r>0&&v==t.text.length||!(m=h(r>0?0:i.length-1,r,u(v)))?null:m}Fa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Fa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Fa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Fa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Fa.default=y?Fa.macDefault:Fa.pcDefault;var Qa={selectAll:Ko,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),B)},killLine:function(e){return qa(e,(function(t){if(t.empty()){var n=Qe(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:ot(t.head.line+1,0)}:{from:t.head,to:ot(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return qa(e,(function(t){return{from:ot(t.from().line,0),to:ft(e.doc,ot(t.to().line+1,0))}}))},delLineLeft:function(e){return qa(e,(function(e){return{from:ot(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return qa(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return qa(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ot(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ot(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return Ja(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return es(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return Za(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),V)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),V)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?es(e,t.head):r}),V)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=F(e.getLine(o.line),o.ch,r);t.push(Y(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Mi(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=Qe(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new ot(i.line,i.ch-1)),i.ch>0)i=new ot(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ot(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Qe(e.doc,i.line-1).text;a&&(i=new ot(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),ot(i.line-1,a.length-1),i,"+transpose"))}n.push(new oo(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Mi(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);si(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ja(e,t){var n=Qe(e.doc,t),r=Jt(n);return r!=n&&(t=tt(r)),Xa(!0,e,r,t,1)}function Za(e,t){var n=Qe(e.doc,t),r=Zt(n);return r!=n&&(t=tt(r)),Xa(!0,e,n,t,-1)}function es(e,t){var n=Ja(e,t.line),r=Qe(e.doc,n.line),i=fe(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return ot(n.line,a?0:o,n.sticky)}return n}function ts(e,t,n){if("string"==typeof t&&!(t=Qa[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=W}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function ns(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Ha(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Ha(t,e.options.extraKeys,n,e)||Ha(t,e.options.keyMap,n,e)}var rs=new z;function is(e,t,n,r){var i=e.state.keySeq;if(i){if(Wa(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:rs.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),os(e,i+" "+t,n,r))return!0}return os(e,t,n,r)}function os(e,t,n,r){var i=ns(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&On(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(ke(n),Yr(e)),!!i}function as(e,t){var n=$a(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?is(e,"Shift-"+n,t,(function(t){return ts(e,t,!0)}))||is(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ts(e,t)})):is(e,n,t,(function(t){return ts(e,t)})))}function ss(e,t,n){return is(e,"'"+n+"'",t,(function(t){return ts(e,t,!0)}))}var ls=null;function us(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=L(),ye(t,e)))){a&&s<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var i=as(t,e);d&&(ls=i?r:null,i||88!=r||Re||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!y&&!i&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||cs(t)}}function cs(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(E(t,"CodeMirror-crosshair"),ve(document,"keyup",n),ve(document,"mouseover",n))}P(t,"CodeMirror-crosshair"),he(document,"keyup",n),he(document,"mouseover",n)}function ds(e){16==e.keyCode&&(this.doc.sel.shift=!1),ye(this,e)}function fs(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||$n(t.display,e)||ye(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(d&&n==ls)return ls=null,void ke(e);if(!d||e.which&&!(e.which<10)||!as(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(ss(t,e,i)||t.display.input.onKeyPress(e))}}}var ps,hs,ms=400,vs=function(e,t,n){this.time=e,this.pos=t,this.button=n};function gs(e,t){var n=+new Date;return hs&&hs.compare(n,e,t)?(ps=hs=null,"triple"):ps&&ps.compare(n,e,t)?(hs=new vs(n,e,t),ps=null,"double"):(ps=new vs(n,e,t),hs=null,"single")}function ys(e){var t=this,n=t.display;if(!(ye(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,$n(n,e))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!js(t,e)){var r=Dr(t,e),i=je(e),o=r?gs(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&bs(t,i,r,o,e)||(1==i?r?xs(t,r,o,e):Ee(e)==n.scroller&&ke(e):2==i?(r&&Ro(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(_?t.display.input.onContextMenu(e):Kr(t)))}}function bs(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),is(e,Ba(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=Qa[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=W}finally{e.state.suppressEdits=!1}return r}))}function ws(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=b?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=y?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(y?n.altKey:n.ctrlKey)),i}function xs(e,t,n,r){a?setTimeout(R(Xr,e),0):e.curOp.focus=L();var i,o=ws(e,n,r),s=e.doc.sel;e.options.dragDrop&&Ne&&!e.isReadOnly()&&"single"==n&&(i=s.contains(t))>-1&&(at((i=s.ranges[i]).from(),t)<0||t.xRel>0)&&(at(i.to(),t)>0||t.xRel<0)?ks(e,r,t,o):Ss(e,r,t,o)}function ks(e,t,n,r){var i=e.display,o=!1,u=Li(e,(function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Kr(e)),ve(i.wrapper.ownerDocument,"mouseup",u),ve(i.wrapper.ownerDocument,"mousemove",c),ve(i.scroller,"dragstart",d),ve(i.scroller,"drop",u),o||(ke(t),r.addNew||Ro(e.doc,n,null,null,r.extend),l&&!f||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};l&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!r.moveOnDrag,he(i.wrapper.ownerDocument,"mouseup",u),he(i.wrapper.ownerDocument,"mousemove",c),he(i.scroller,"dragstart",d),he(i.scroller,"drop",u),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function _s(e,t,n){if("char"==n)return new oo(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new oo(ot(t.line,0),ft(e.doc,ot(t.line+1,0)));var r=n(e,t);return new oo(r.from,r.to)}function Ss(e,t,n,r){a&&Kr(e);var i=e.display,o=e.doc;ke(t);var s,l,u=o.sel,c=u.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),s=l>-1?c[l]:new oo(n,n)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new oo(n,n)),n=Dr(e,t,!0,!0),l=-1;else{var d=_s(e,n,r.unit);s=r.extend?Do(s,d.anchor,d.head,r.extend):d}r.addNew?-1==l?(l=c.length,Wo(o,ao(e,c.concat([s]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==r.unit&&!r.extend?(Wo(o,ao(e,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):Fo(o,l,s,$):(l=0,Wo(o,new io([s],0),$),u=o.sel);var f=n;function p(t){if(0!=at(f,t))if(f=t,"rectangle"==r.unit){for(var i=[],a=e.options.tabSize,c=F(Qe(o,n.line).text,n.ch,a),d=F(Qe(o,t.line).text,t.ch,a),p=Math.min(c,d),h=Math.max(c,d),m=Math.min(n.line,t.line),v=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=v;m++){var g=Qe(o,m).text,y=q(g,p,a);p==h?i.push(new oo(ot(m,y),ot(m,y))):g.length>y&&i.push(new oo(ot(m,y),ot(m,q(g,h,a))))}i.length||i.push(new oo(n,n)),Wo(o,ao(e,u.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=s,x=_s(e,t,r.unit),k=w.anchor;at(x.anchor,k)>0?(b=x.head,k=ct(w.from(),x.anchor)):(b=x.anchor,k=ut(w.to(),x.head));var _=u.ranges.slice(0);_[l]=Cs(e,new oo(ft(o,k),b)),Wo(o,ao(e,_,l),$)}}var h=i.wrapper.getBoundingClientRect(),m=0;function v(t){var n=++m,a=Dr(e,t,!0,"rectangle"==r.unit);if(a)if(0!=at(a,f)){e.curOp.focus=L(),p(a);var s=ti(i,o);(a.line>=s.to||a.line<s.from)&&setTimeout(Li(e,(function(){m==n&&v(t)})),150)}else{var l=t.clientY<h.top?-20:t.clientY>h.bottom?20:0;l&&setTimeout(Li(e,(function(){m==n&&(i.scroller.scrollTop+=l,v(t))})),50)}}function g(t){e.state.selectingText=!1,m=1/0,t&&(ke(t),i.input.focus()),ve(i.wrapper.ownerDocument,"mousemove",y),ve(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var y=Li(e,(function(e){0!==e.buttons&&je(e)?v(e):g(e)})),b=Li(e,g);e.state.selectingText=b,he(i.wrapper.ownerDocument,"mousemove",y),he(i.wrapper.ownerDocument,"mouseup",b)}function Cs(e,t){var n=t.anchor,r=t.head,i=Qe(e.doc,n.line);if(0==at(n,r)&&n.sticky==r.sticky)return t;var o=fe(i);if(!o)return t;var a=ce(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,u=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=ce(o,r.ch,r.sticky),d=c-a||(r.ch-n.ch)*(1==s.level?-1:1);l=c==u-1||c==u?d<0:d>0}var f=o[u+(l?-1:0)],p=l==(1==f.level),h=p?f.from:f.to,m=p?"after":"before";return n.ch==h&&n.sticky==m?t:new oo(new ot(n.line,h,m),r)}function Es(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ke(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!we(e,n))return Se(t);o-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var u=a.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=i)return ge(e,n,e,nt(e.doc,o),e.display.gutterSpecs[l].className,t),Se(t)}}function js(e,t){return Es(e,t,"gutterClick",!0)}function Ts(e,t){$n(e.display,t)||Os(e,t)||ye(e,t,"contextmenu")||_||e.display.input.onContextMenu(t)}function Os(e,t){return!!we(e,"gutterContextMenu")&&Es(e,t,"gutterContextMenu",!1)}function Ns(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),fr(e)}vs.prototype.compare=function(e,t,n){return this.time+ms>e&&0==at(t,this.pos)&&n==this.button};var Ms={toString:function(){return"CodeMirror.Init"}},Ls={},Ps={};function As(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Ms&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Ms,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,ho(e)}),!0),n("indentUnit",2,ho,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){mo(e),fr(e),Ir(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(ot(r,o))}r++}));for(var i=n.length-1;i>=0;i--)ia(e.doc,t,n[i],ot(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Ms&&e.refresh()})),n("specialCharPlaceholder",vn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",g?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ns(e),Qi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Va(t),i=n!=Ms&&Va(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Rs,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Xi(t,e.options.lineNumbers),Qi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Lr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return yi(e)}),!0),n("scrollbarStyle","native",(function(e){xi(e),yi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Xi(e.options.gutters,t),Qi(e)}),!0),n("firstLineNumber",1,Qi,!0),n("lineNumberFormatter",(function(e){return e}),Qi,!0),n("showCursorWhenSelecting",!1,Br,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Jr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Ds),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Br,!0),n("singleCursorHeightPerLine",!0,Br,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,mo,!0),n("addModeClass",!1,mo,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,mo,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Ds(e,t,n){if(!t!=!(n&&n!=Ms)){var r=e.display.dragFunctions,i=t?he:ve;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Rs(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),ln(e)),Ar(e),Ir(e),fr(e),setTimeout((function(){return yi(e)}),100)}function Is(e,t){var n=this;if(!(this instanceof Is))return new Is(e,t);this.options=t=t?I(t):{},I(Ls,t,!1);var r=t.value;"string"==typeof r?r=new _a(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Is.inputStyles[t.inputStyle](this),o=this.display=new Ji(e,r,i,t);for(var u in o.wrapper.CodeMirror=this,Ns(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),xi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new z,keySeq:null,specialChars:null},t.autofocus&&!g&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Fs(this),Ma(),_i(this),this.curOp.forceUpdate=!0,bo(this,r),t.autofocus&&!g||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Qr(n)}),20):Jr(this),Ps)Ps.hasOwnProperty(u)&&Ps[u](this,t[u],Ms);Yi(this),t.finishInit&&t.finishInit(this);for(var c=0;c<zs.length;++c)zs[c](this);Si(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Fs(e){var t=e.display;he(t.scroller,"mousedown",Li(e,ys)),he(t.scroller,"dblclick",a&&s<11?Li(e,(function(t){if(!ye(e,t)){var n=Dr(e,t);if(n&&!js(e,t)&&!$n(e.display,t)){ke(t);var r=e.findWordAt(n);Ro(e.doc,r.anchor,r.head)}}})):function(t){return ye(e,t)||ke(t)}),he(t.scroller,"contextmenu",(function(t){return Ts(e,t)})),he(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||Ts(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function o(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function l(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}he(t.scroller,"touchstart",(function(i){if(!ye(e,i)&&!o(i)&&!js(e,i)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),he(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),he(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!$n(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!r.prev||l(r,r.prev)?new oo(a,a):!r.prev.prev||l(r,r.prev.prev)?e.findWordAt(a):new oo(ot(a.line,0),ft(e.doc,ot(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),ke(n)}i()})),he(t.scroller,"touchcancel",i),he(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(fi(e,t.scroller.scrollTop),hi(e,t.scroller.scrollLeft,!0),ge(e,"scroll",e))})),he(t.scroller,"mousewheel",(function(t){return ro(e,t)})),he(t.scroller,"DOMMouseScroll",(function(t){return ro(e,t)})),he(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ye(e,t)||Ce(t)},over:function(t){ye(e,t)||(ja(e,t),Ce(t))},start:function(t){return Ea(e,t)},drop:Li(e,Ca),leave:function(t){ye(e,t)||Ta(e)}};var u=t.input.getField();he(u,"keyup",(function(t){return ds.call(e,t)})),he(u,"keydown",Li(e,us)),he(u,"keypress",Li(e,fs)),he(u,"focus",(function(t){return Qr(e,t)})),he(u,"blur",(function(t){return Jr(e,t)}))}Is.defaults=Ls,Is.optionHandlers=Ps;var zs=[];function Us(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=bt(e,t).state:n="prev");var a=e.options.tabSize,s=Qe(o,t),l=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==W||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?F(Qe(o,t-1).text,null,a):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var d="",f=0;if(e.options.indentWithTabs)for(var p=Math.floor(u/a);p;--p)f+=a,d+="\t";if(f<u&&(d+=Y(u-f)),d!=c)return ia(o,d,ot(t,0),ot(t,c.length),"+input"),s.stateAfter=null,!0;for(var h=0;h<o.sel.ranges.length;h++){var m=o.sel.ranges[h];if(m.head.line==t&&m.head.ch<c.length){var v=ot(t,c.length);Fo(o,h,new oo(v,v));break}}}Is.defineInitHook=function(e){return zs.push(e)};var Hs=null;function Ws(e){Hs=e}function Bs(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=+new Date-200,s="paste"==i||e.state.pasteIncoming>a,l=Ae(t),u=null;if(s&&r.ranges.length>1)if(Hs&&Hs.text.join("\n")==t){if(r.ranges.length%Hs.text.length==0){u=[];for(var c=0;c<Hs.text.length;c++)u.push(o.splitLines(Hs.text[c]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=K(l,(function(e){return[e]})));for(var d=e.curOp.updateInput,f=r.ranges.length-1;f>=0;f--){var p=r.ranges[f],h=p.from(),m=p.to();p.empty()&&(n&&n>0?h=ot(h.line,h.ch-n):e.state.overwrite&&!s?m=ot(m.line,Math.min(Qe(o,m.line).text.length,m.ch+X(l).length)):s&&Hs&&Hs.lineWise&&Hs.text.join("\n")==l.join("\n")&&(h=m=ot(h.line,0)));var v={from:h,to:m,text:u?u[f%u.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};Jo(e.doc,v),On(e,"inputRead",e,v)}t&&!s&&Vs(e,t),si(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function $s(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Mi(t,(function(){return Bs(t,n,0,null,"paste")})),!0}function Vs(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){a=Us(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Qe(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Us(e,i.head.line,"smart"));a&&On(e,"electricInput",e,i.head.line)}}}function qs(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:ot(i,0),head:ot(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Gs(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Ys(){var e=O("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=O("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),Gs(e),t}function Xs(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&Li(this,t[e])(this,n,i),ge(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Va(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Pi((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");Q(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,Ir(this)})),removeOverlay:Pi((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void Ir(this)}})),indentLine:Pi((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),rt(this.doc,e)&&Us(this,e,t,n)})),indentSelection:Pi((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Us(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&si(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<n;++l)Us(this,l,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[r].from().ch>0&&Fo(this.doc,r,new oo(o,u[r].to()),B)}}})),getTokenAt:function(e,t){return St(this,e,t)},getLineTokens:function(e,t){return St(this,ot(e),t,!0)},getTokenTypeAt:function(e){e=ft(this.doc,e);var t,n=yt(this,Qe(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&r.push(i[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var s=i[o[t][a]];s&&r.push(s)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var l=0;l<i._global.length;l++){var u=i._global[l];u.pred(o,this)&&-1==U(r,u.val)&&r.push(u.val)}return r},getStateAfter:function(e,t){var n=this.doc;return bt(this,(e=dt(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return br(this,null==e?n.head:"object"==typeof e?ft(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return yr(this,ft(this.doc,e),t||"page")},coordsChar:function(e,t){return kr(this,(e=gr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=gr(this,{top:e,left:0},t||"page").top,nt(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=Qe(this.doc,e)}else r=e;return vr(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-an(r):0)},defaultTextHeight:function(){return Or(this.display)},defaultCharWidth:function(){return Nr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,a=(e=br(this,ft(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&ii(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Pi(us),triggerOnKeyPress:Pi(fs),triggerOnKeyUp:ds,triggerOnMouseDown:Pi(ys),execCommand:function(e){if(Qa.hasOwnProperty(e))return Qa[e].call(null,this)},triggerElectric:Pi((function(e){Vs(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=ft(this.doc,e),a=0;a<t&&!(o=Ks(this.doc,o,i,n,r)).hitSide;++a);return o},moveH:Pi((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Ks(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),V)})),deleteH:Pi((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):qa(this,(function(n){var i=Ks(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var a=ft(this.doc,e),s=0;s<t;++s){var l=br(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Qs(this,l,i,n)).hitSide)break}return a},moveV:Pi((function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(a){if(o)return e<0?a.from():a.to();var s=br(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),i.push(s.left);var l=Qs(n,s,e,t);return"page"==t&&a==r.sel.primary()&&ai(n,yr(n,l,"div").top-s.top),l}),V),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(e){var t=Qe(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var o=t.charAt(n),a=ne(o,i)?function(e){return ne(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ne(e)};n>0&&a(t.charAt(n-1));)--n;for(;r<t.length&&a(t.charAt(r));)++r}return new oo(ot(e.line,n),ot(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?P(this.display.cursorDiv,"CodeMirror-overwrite"):E(this.display.cursorDiv,"CodeMirror-overwrite"),ge(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==L()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Pi((function(e,t){li(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Yn(this)-this.display.barHeight,width:e.scrollWidth-Yn(this)-this.display.barWidth,clientHeight:Kn(this),clientWidth:Xn(this)}},scrollIntoView:Pi((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ot(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?ui(this,e):di(this,e.from,e.to,e.margin)})),setSize:Pi((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&dr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Fr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,ge(this,"refresh",this)})),operation:function(e){return Mi(this,e)},startOperation:function(){return _i(this)},endOperation:function(){return Si(this)},refresh:Pi((function(){var e=this.display.cachedTextHeight;Ir(this),this.curOp.forceUpdate=!0,fr(this),li(this,this.doc.scrollLeft,this.doc.scrollTop),Vi(this.display),(null==e||Math.abs(e-Or(this.display))>.5||this.options.lineWrapping)&&Ar(this),ge(this,"refresh",this)})),swapDoc:Pi((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),bo(this,e),fr(this),this.display.input.reset(),li(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,On(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},xe(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function Ks(e,t,n,r,i){var o=t,a=n,s=Qe(e,t.line),l=i&&"rtl"==e.direction?-n:n;function u(){var n=t.line+l;return!(n<e.first||n>=e.first+e.size)&&(t=new ot(n,t.ch,t.sticky),s=Qe(e,n))}function c(o){var a;if("codepoint"==r){var c=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(c))a=null;else{var d=n>0?c>=55296&&c<56320:c>=56320&&c<57343;a=new ot(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(d?2:1))),-n)}}else a=i?Ka(e.cm,s,t,n):Ya(s,t,n);if(null==a){if(o||!u())return!1;t=Xa(i,e.cm,s,t.line,l)}else t=a;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var d=null,f="group"==r,p=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(n<0)||c(!h);h=!1){var m=s.text.charAt(t.ch)||"\n",v=ne(m,p)?"w":f&&"\n"==m?"n":!f||/\s/.test(m)?null:"p";if(!f||h||v||(v="s"),d&&d!=v){n<0&&(n=1,c(),t.sticky="after");break}if(v&&(d=v),n>0&&!c(!h))break}var g=Yo(e,t,o,a,!0);return st(o,g)&&(g.hitSide=!0),g}function Qs(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*Or(e.display),3);i=(n>0?t.bottom:t.top)+n*u}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=kr(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Js=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Zs(e,t){var n=tr(e,t.line);if(!n||n.hidden)return null;var r=Qe(e.doc,t.line),i=Jn(n,r,t.line),o=fe(r,e.doc.direction),a="left";o&&(a=ce(o,t.ch)%2?"right":"left");var s=ar(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function el(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function tl(e,t){return t&&(e.bad=!0),e}function nl(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function u(e){return function(t){return t.id==e}}function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function d(e){e&&(c(),o+=e)}function f(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void d(n);var o,p=t.getAttribute("cm-marker");if(p){var h=e.findMarks(ot(r,0),ot(i+1,0),u(+p));return void(h.length&&(o=h[0].find(0))&&d(Je(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&c();for(var v=0;v<t.childNodes.length;v++)f(t.childNodes[v]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),m&&(a=!0)}else 3==t.nodeType&&d(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;f(t),t!=n;)t=t.nextSibling,l=!1;return o}function rl(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return tl(e.clipPos(ot(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return il(o,t,n)}}function il(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!M(r,t))return tl(ot(tt(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?X(e.rest):e.line;return tl(ot(tt(o),o.text.length),i)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var l=e.measure,u=l.maps;function c(t,n,r){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?l.map:u[i],a=0;a<o.length;a+=3){var s=o[a+2];if(s==t||s==n){var c=tt(i<0?e.line:e.rest[i]),d=o[a]+r;return(r<0||s!=t)&&(d=o[a+(r?1:0)]),ot(c,d)}}}var d=c(a,s,n);if(d)return tl(d,i);for(var f=s.nextSibling,p=a?a.nodeValue.length-n:0;f;f=f.nextSibling){if(d=c(f,f.firstChild,0))return tl(ot(d.line,d.ch-p),i);p+=f.textContent.length}for(var h=s.previousSibling,m=n;h;h=h.previousSibling){if(d=c(h,h.firstChild,-1))return tl(ot(d.line,d.ch+m),i);m+=h.textContent.length}}Js.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(o(e)&&!ye(r,e)){if(r.somethingSelected())Ws({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=qs(r);Ws({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,B),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=Hs.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var s=Ys(),l=s.firstChild;r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),l.value=Hs.text.join("\n");var u=document.activeElement;D(l),setTimeout((function(){r.display.lineSpace.removeChild(s),u.focus(),u==i&&n.showPrimarySelection()}),50)}}Gs(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),he(i,"paste",(function(e){!o(e)||ye(r,e)||$s(e,r)||s<=11&&setTimeout(Li(r,(function(){return t.updateFromDOM()})),20)})),he(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),he(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),he(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),he(i,"touchstart",(function(){return n.forceCompositionEnd()})),he(i,"input",(function(){t.composing||t.readFromDOMSoon()})),he(i,"copy",a),he(i,"cut",a)},Js.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Js.prototype.prepareSelection=function(){var e=$r(this.cm,!1);return e.focus=document.activeElement==this.div,e},Js.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Js.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Js.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=rl(t,e.anchorNode,e.anchorOffset),s=rl(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=at(ct(a,s),i)||0!=at(ut(a,s),o)){var l=t.display.view,u=i.line>=t.display.viewFrom&&Zs(t,i)||{node:l[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&Zs(t,o);if(!c){var d=l[l.length-1].measure,f=d.maps?d.maps[d.maps.length-1]:d.map;c={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(u&&c){var p,h=e.rangeCount&&e.getRangeAt(0);try{p=C(u.node,u.offset,c.offset,c.node)}catch(e){}p&&(!n&&t.state.focused?(e.collapse(u.node,u.offset),p.collapsed||(e.removeAllRanges(),e.addRange(p))):(e.removeAllRanges(),e.addRange(p)),h&&null==e.anchorNode?e.addRange(h):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Js.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Js.prototype.showMultipleSelections=function(e){T(this.cm.display.cursorDiv,e.cursors),T(this.cm.display.selectionDiv,e.selection)},Js.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Js.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return M(this.div,t)},Js.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Js.prototype.blur=function(){this.div.blur()},Js.prototype.getField=function(){return this.div},Js.prototype.supportsTouch=function(){return!0},Js.prototype.receivedFocus=function(){var e=this;function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.selectionInEditor()?this.pollSelection():Mi(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,t)},Js.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Js.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(v&&c&&this.cm.display.gutterSpecs.length&&el(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=rl(t,e.anchorNode,e.anchorOffset),r=rl(t,e.focusNode,e.focusOffset);n&&r&&Mi(t,(function(){Wo(t.doc,so(n,r),B),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},Js.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>r.firstLine()&&(a=ot(a.line-1,Qe(r.doc,a.line-1).length)),s.ch==Qe(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=ot(s.line+1,0)),a.line<i.viewFrom||s.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(e=Rr(r,a.line))?(t=tt(i.view[0].line),n=i.view[0].node):(t=tt(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,u,c=Rr(r,s.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=tt(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(nl(r,n,u,t,l)),f=Je(r.doc,ot(t,0),ot(l,Qe(r.doc,l).text.length));d.length>1&&f.length>1;)if(X(d)==X(f))d.pop(),f.pop(),l--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var p=0,h=0,m=d[0],v=f[0],g=Math.min(m.length,v.length);p<g&&m.charCodeAt(p)==v.charCodeAt(p);)++p;for(var y=X(d),b=X(f),w=Math.min(y.length-(1==d.length?p:0),b.length-(1==f.length?p:0));h<w&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)++h;if(1==d.length&&1==f.length&&t==a.line)for(;p&&p>a.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)p--,h++;d[d.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(p).replace(/\u200b+$/,"");var x=ot(t,p),k=ot(l,f.length?X(f).length-h:0);return d.length>1||d[0]||at(x,k)?(ia(r.doc,d,x,k,"+input"),!0):void 0},Js.prototype.ensurePolled=function(){this.forceCompositionEnd()},Js.prototype.reset=function(){this.forceCompositionEnd()},Js.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Js.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Js.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Mi(this.cm,(function(){return Ir(e.cm)}))},Js.prototype.setUneditable=function(e){e.contentEditable="false"},Js.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Li(this.cm,Bs)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Js.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Js.prototype.onContextMenu=function(){},Js.prototype.resetPosition=function(){},Js.prototype.needsContentAttribute=!0;var ol=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};function al(e,t){if((t=t?I(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=L();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(he(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(ve(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Is((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function sl(e){e.off=ve,e.on=he,e.wheelEventPixels=no,e.Doc=_a,e.splitLines=Ae,e.countColumn=F,e.findColumn=q,e.isWordChar=te,e.Pass=W,e.signal=ge,e.Line=un,e.changeEnd=lo,e.scrollbarModel=wi,e.Pos=ot,e.cmpPos=at,e.modes=ze,e.mimeModes=Ue,e.resolveMode=Be,e.getMode=$e,e.modeExtensions=Ve,e.extendMode=qe,e.copyState=Ge,e.startState=Xe,e.innerMode=Ye,e.commands=Qa,e.keyMap=Fa,e.keyName=$a,e.isModifierKey=Wa,e.lookupKey=Ha,e.normalizeKeyMap=Ua,e.StringStream=Ke,e.SharedTextMarker=ga,e.TextMarker=ma,e.LineWidget=da,e.e_preventDefault=ke,e.e_stopPropagation=_e,e.e_stop=Ce,e.addClass=P,e.contains=M,e.rmClass=E,e.keyNames=Aa}ol.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ye(r,e)){if(r.somethingSelected())Ws({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=qs(r);Ws({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,B):(n.prevInput="",i.value=t.text.join("\n"),D(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),he(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),he(i,"paste",(function(e){ye(r,e)||$s(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),he(i,"cut",o),he(i,"copy",o),he(e.scroller,"paste",(function(t){if(!$n(e,t)&&!ye(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),he(e.lineSpace,"selectstart",(function(t){$n(e,t)||ke(t)})),he(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),he(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},ol.prototype.createField=function(e){this.wrapper=Ys(),this.textarea=this.wrapper.firstChild},ol.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ol.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=$r(e);if(e.options.moveInputWithCursor){var i=br(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},ol.prototype.showSelection=function(e){var t=this.cm.display;T(t.cursorDiv,e.cursors),T(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ol.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&D(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},ol.prototype.getField=function(){return this.textarea},ol.prototype.supportsTouch=function(){return!1},ol.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!g||L()!=this.textarea))try{this.textarea.focus()}catch(e){}},ol.prototype.blur=function(){this.textarea.blur()},ol.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ol.prototype.receivedFocus=function(){this.slowPoll()},ol.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},ol.prototype.fastPoll=function(){var e=!1,t=this;function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,t.polling.set(20,n)},ol.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||De(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,i.length);l<u&&r.charCodeAt(l)==i.charCodeAt(l);)++l;return Mi(t,(function(){Bs(t,i.slice(l),r.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ol.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ol.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},ol.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Dr(n,e),u=r.scroller.scrollTop;if(o&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Li(n,Wo)(n.doc,so(o),B);var c,f=i.style.cssText,p=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=window.scrollY),r.input.focus(),l&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=g,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&v(),_){Ce(e);var m=function(){ve(window,"mouseup",m),setTimeout(g,20)};he(window,"mouseup",m)}else setTimeout(g,50)}function v(){if(null!=i.selectionStart){var e=n.somethingSelected(),o=""+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,i.style.cssText=f,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart)){(!a||a&&s<9)&&v();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==t.prevInput?Li(n,Ko)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},ol.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},ol.prototype.setUneditable=function(){},ol.prototype.needsContentAttribute=!1,As(Is),Xs(Is);var ll="iter insert remove copy getEditor constructor".split(" ");for(var ul in _a.prototype)_a.prototype.hasOwnProperty(ul)&&U(ll,ul)<0&&(Is.prototype[ul]=function(e){return function(){return e.apply(this.doc,arguments)}}(_a.prototype[ul]));return xe(_a),Is.inputStyles={textarea:ol,contenteditable:Js},Is.defineMode=function(e){Is.defaults.mode||"null"==e||(Is.defaults.mode=e),He.apply(this,arguments)},Is.defineMIME=We,Is.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Is.defineMIME("text/plain","null"),Is.defineExtension=function(e,t){Is.prototype[e]=t},Is.defineDocExtension=function(e,t){_a.prototype[e]=t},Is.fromTextArea=al,sl(Is),Is.version="5.59.4",Is}()},9589:(e,t,n)=>{!function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(r,i){var o,a,s=r.indentUnit,l={},u=i.htmlMode?t:n;for(var c in u)l[c]=u[c];for(var c in i)l[c]=i[c];function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return"<"==r?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(h("atom","]]>")):null:e.match("--")?n(h("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(m(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=h("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"tag bracket"):"&"==r?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function f(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=d,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){t.tokenize=d,t.state=b,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=p(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=f;break}return"string"};return t.isInAttribute=!0,t}function h(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function m(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=m(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=d;break}return n.tokenize=m(e-1),n.tokenize(t,n)}}return"meta"}}function v(e,t,n){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function g(e){e.context&&(e.context=e.context.prev)}function y(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t))return;g(e)}}function b(e,t,n){return"openTag"==e?(n.tagStart=t.column(),w):"closeTag"==e?x:b}function w(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",S):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",S(e,t,n)):(a="error",w)}function x(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&g(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",k):(a="tag error",_)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",k(e,t,n)):(a="error",_)}function k(e,t,n){return"endTag"!=e?(a="error",k):(g(n),b)}function _(e,t,n){return a="error",k(e,t,n)}function S(e,t,n){if("word"==e)return a="attribute",C;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(r)?y(n,r):(y(n,r),n.context=new v(n,r,i==n.indented)),b}return a="error",S}function C(e,t,n){return"equals"==e?E:(l.allowMissing||(a="error"),S(e,t,n))}function E(e,t,n){return"string"==e?j:"word"==e&&l.allowUnquoted?(a="string",S):(a="error",S(e,t,n))}function j(e,t,n){return"string"==e?j:S(e,t,n)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var o=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(o&&o[1])for(;i;){if(i.tagName==o[2]){i=i.prev;break}if(!l.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(o)for(;i;){var a=l.contextGrabbers[i.tagName];if(!a||!a.hasOwnProperty(o[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+s:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==E&&(e.state=S)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(4631))},8679:(e,t,n)=>{"use strict";var r=n(9864),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var i=p(n);i&&i!==h&&e(t,i,r)}var a=c(n);d&&(a=a.concat(d(n)));for(var s=l(t),m=l(n),v=0;v<a.length;++v){var g=a[v];if(!(o[g]||r&&r[g]||m&&m[g]||s&&s[g])){var y=f(n,g);try{u(t,g,y)}catch(e){}}}}return t}},885:e=>{e.exports={CASE_SENSITIVE_TAG_NAMES:["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussainBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]}},8276:(e,t,n)=>{var r="html",i="head",o="body",a=/<([a-zA-Z]+[0-9]?)/,s=/<head.*>/i,l=/<body.*>/i,u=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},c=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")};if("function"==typeof window.DOMParser){var d=new window.DOMParser;u=c=function(e,t){return t&&(e="<"+t+">"+e+"</"+t+">"),d.parseFromString(e,"text/html")}}if(document.implementation){var f=n(1507).isIE,p=document.implementation.createHTMLDocument(f()?"html-dom-parser":void 0);u=function(e,t){return t?(p.documentElement.getElementsByTagName(t)[0].innerHTML=e,p):(p.documentElement.innerHTML=e,p)}}var h,m=document.createElement("template");m.content&&(h=function(e){return m.innerHTML=e,m.content.childNodes}),e.exports=function(e){var t,n,d,f,p=e.match(a);switch(p&&p[1]&&(t=p[1].toLowerCase()),t){case r:return n=c(e),s.test(e)||(d=n.getElementsByTagName(i)[0])&&d.parentNode.removeChild(d),l.test(e)||(d=n.getElementsByTagName(o)[0])&&d.parentNode.removeChild(d),n.getElementsByTagName(r);case i:case o:return f=u(e).getElementsByTagName(t),l.test(e)&&s.test(e)?f[0].parentNode.childNodes:f;default:return h?h(e):u(e,o).getElementsByTagName(o)[0].childNodes}}},4152:(e,t,n)=>{var r=n(8276),i=n(1507).formatDOM,o=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(""===e)return[];var t,n=e.match(o);return n&&n[1]&&(t=n[1]),i(r(e),null,t)}},1507:(e,t,n)=>{for(var r,i=n(885),o=n(1642),a=i.CASE_SENSITIVE_TAG_NAMES,s=o.Comment,l=o.Element,u=o.ProcessingInstruction,c=o.Text,d={},f=0,p=a.length;f<p;f++)r=a[f],d[r.toLowerCase()]=r;function h(e){for(var t,n={},r=0,i=e.length;r<i;r++)n[(t=e[r]).name]=t.value;return n}function m(e){var t=function(e){return d[e]}(e=e.toLowerCase());return t||e}e.exports={formatAttributes:h,formatDOM:function e(t,n,r){n=n||null;for(var i=[],o=0,a=t.length;o<a;o++){var d,f=t[o];switch(f.nodeType){case 1:(d=new l(m(f.nodeName),h(f.attributes))).children=e(f.childNodes,d);break;case 3:d=new c(f.nodeValue);break;case 8:d=new s(f.nodeValue);break;default:continue}var p=i[o-1]||null;p&&(p.next=d),d.parent=n,d.prev=p,d.next=null,i.push(d)}return r&&((d=new u(r.substring(0,r.indexOf(" ")).toLowerCase(),r)).next=i[0]||null,d.parent=n,i.unshift(d),i[1]&&(i[1].prev=i[0])),i},isIE:function(){return/(MSIE |Trident\/|Edge\/)/.test(navigator.userAgent)}}},1642:function(e,t){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.cloneNode=t.Element=t.Document=t.NodeWithChildren=t.ProcessingInstruction=t.Comment=t.Text=t.DataNode=t.Node=void 0;var o=new Map([["tag",1],["script",1],["style",1],["directive",1],["text",3],["cdata",4],["comment",8],["root",9]]),a=function(){function e(e){this.type=e,this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"nodeType",{get:function(){var e;return null!==(e=o.get(this.type))&&void 0!==e?e:1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(e){return void 0===e&&(e=!1),h(this,e)},e}();t.Node=a;var s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.data=n,r}return r(t,e),Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!1,configurable:!0}),t}(a);t.DataNode=s;var l=function(e){function t(t){return e.call(this,"text",t)||this}return r(t,e),t}(s);t.Text=l;var u=function(e){function t(t){return e.call(this,"comment",t)||this}return r(t,e),t}(s);t.Comment=u;var c=function(e){function t(t,n){var r=e.call(this,"directive",n)||this;return r.name=t,r}return r(t,e),t}(s);t.ProcessingInstruction=c;var d=function(e){function t(t,n){var r=e.call(this,t)||this;return r.children=n,r}return r(t,e),Object.defineProperty(t.prototype,"firstChild",{get:function(){var e;return null!==(e=this.children[0])&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(a);t.NodeWithChildren=d;var f=function(e){function t(t){return e.call(this,"root",t)||this}return r(t,e),t}(d);t.Document=f;var p=function(e){function t(t,n,r){void 0===r&&(r=[]);var i=e.call(this,"script"===t?"script":"style"===t?"style":"tag",r)||this;return i.name=t,i.attribs=n,i.attribs=n,i}return r(t,e),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}}))},enumerable:!1,configurable:!0}),t}(d);function h(e,t){var n;switch(void 0===t&&(t=!1),e.type){case"text":n=new l(e.data);break;case"directive":var r=e;n=new c(r.name,r.data),null!=r["x-name"]&&(n["x-name"]=r["x-name"],n["x-publicId"]=r["x-publicId"],n["x-systemId"]=r["x-systemId"]);break;case"comment":n=new u(e.data);break;case"tag":case"script":case"style":var o=e,a=t?m(o.children):[],s=new p(o.name,i({},o.attribs),a);a.forEach((function(e){return e.parent=s})),o["x-attribsNamespace"]&&(s["x-attribsNamespace"]=i({},o["x-attribsNamespace"])),o["x-attribsPrefix"]&&(s["x-attribsPrefix"]=i({},o["x-attribsPrefix"])),n=s;break;case"cdata":a=t?m(e.children):[];var h=new d(e.type,a);a.forEach((function(e){return e.parent=h})),n=h;break;case"root":var v=e,g=(a=t?m(v.children):[],new f(a));a.forEach((function(e){return e.parent=g})),v["x-mode"]&&(g["x-mode"]=v["x-mode"]),n=g;break;case"doctype":throw new Error("Not implemented yet: ElementType.Doctype case")}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,n}function m(e){for(var t=e.map((function(e){return h(e,!0)})),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}t.Element=p,t.cloneNode=h},488:(e,t,n)=>{var r=n(3670),i=n(484),o=n(4152),a={lowerCaseAttributeNames:!1};function s(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return""===e?[]:r(o(e,(t=t||{}).htmlparser2||a),t)}s.domToReact=r,s.htmlToDOM=o,s.attributesToProps=i,e.exports=s,e.exports.default=s},484:(e,t,n)=>{var r=n(2686),i=n(4606),o=i.setStyleProp,a=r.html,s=r.svg,l=r.isCustomAttribute,u=Object.prototype.hasOwnProperty;e.exports=function(e){var t,n,r,c;e=e||{};var d={};for(t in e)r=e[t],l(t)?d[t]=r:(n=t.toLowerCase(),u.call(a,n)?d[(c=a[n]).propertyName]=!!(c.hasBooleanValue||c.hasOverloadedBooleanValue&&!r)||r:u.call(s,t)?d[(c=s[t]).propertyName]=r:i.PRESERVE_CUSTOM_ATTRIBUTES&&(d[t]=r));return o(e.style,d),d}},3670:(e,t,n)=>{var r=n(7294),i=n(484),o=n(4606),a=o.setStyleProp;function s(e){return o.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&o.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,n){for(var o,l,u,c,d=(n=n||{}).library||r,f=d.cloneElement,p=d.createElement,h=d.isValidElement,m=[],v="function"==typeof n.replace,g=n.trim,y=0,b=t.length;y<b;y++)if(o=t[y],v&&h(l=n.replace(o)))b>1&&(l=f(l,{key:l.key||y})),m.push(l);else if("text"!==o.type){switch(u=o.attribs,s(o)?a(u.style,u):u&&(u=i(u)),c=null,o.type){case"script":case"style":o.children[0]&&(u.dangerouslySetInnerHTML={__html:o.children[0].data});break;case"tag":"textarea"===o.name&&o.children[0]?u.defaultValue=o.children[0].data:o.children&&o.children.length&&(c=e(o.children,n));break;default:continue}b>1&&(u.key=y),m.push(p(o.name,u,c))}else g?o.data.trim()&&m.push(o.data):m.push(o.data);return 1===m.length?m[0]:m}},4606:(e,t,n)=>{var r=n(7294),i=n(1476).default;var o={reactCompat:!0};var a=r.version.split(".")[0]>=16;e.exports={PRESERVE_CUSTOM_ATTRIBUTES:a,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var n,r,i="function"==typeof t,o={},a={};for(n in e)r=e[n],i&&(o=t(n,r))&&2===o.length?a[o[0]]=o[1]:"string"==typeof r&&(a[r]=n);return a},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){null!=e&&(t.style=i(e,o))}}},8139:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g,u="";function c(e){return e?e.replace(l,u):u}e.exports=function(e,l){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];l=l||{};var d=1,f=1;function p(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function h(){var e={line:d,column:f};return function(t){return t.position=new m(e),b(),t}}function m(e){this.start=e,this.end={line:d,column:f},this.source=l.source}m.prototype.content=e;var v=[];function g(t){var n=new Error(l.source+":"+d+":"+f+": "+t);if(n.reason=t,n.filename=l.source,n.line=d,n.column=f,n.source=e,!l.silent)throw n;v.push(n)}function y(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function b(){y(r)}function w(e){var t;for(e=e||[];t=x();)!1!==t&&e.push(t);return e}function x(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;u!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,u===e.charAt(n-1))return g("End of comment missing");var r=e.slice(2,n-2);return f+=2,p(r),e=e.slice(n),f+=2,t({type:"comment",comment:r})}}function k(){var e=h(),n=y(i);if(n){if(x(),!y(o))return g("property missing ':'");var r=y(a),l=e({type:"declaration",property:c(n[0].replace(t,u)),value:r?c(r[0].replace(t,u)):u});return y(s),l}}return b(),function(){var e,t=[];for(w(t);e=k();)!1!==e&&(t.push(e),w(t));return t}()}},6486:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",l=16,u=32,c=64,d=128,f=256,p=1/0,h=9007199254740991,m=NaN,v=4294967295,g=[["ary",d],["bind",1],["bindKey",2],["curry",8],["curryRight",l],["flip",512],["partial",u],["partialRight",c],["rearg",f]],y="[object Arguments]",b="[object Array]",w="[object Boolean]",x="[object Date]",k="[object Error]",_="[object Function]",S="[object GeneratorFunction]",C="[object Map]",E="[object Number]",j="[object Object]",T="[object Promise]",O="[object RegExp]",N="[object Set]",M="[object String]",L="[object Symbol]",P="[object WeakMap]",A="[object ArrayBuffer]",D="[object DataView]",R="[object Float32Array]",I="[object Float64Array]",F="[object Int8Array]",z="[object Int16Array]",U="[object Int32Array]",H="[object Uint8Array]",W="[object Uint8ClampedArray]",B="[object Uint16Array]",$="[object Uint32Array]",V=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Y=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,K=RegExp(Y.source),Q=RegExp(X.source),J=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(ie.source),ae=/^\s+/,se=/\s/,le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ue=/\{\n\/\* \[wrapped with (.+)\] \*/,ce=/,? & /,de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fe=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,ve=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,ye=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,we=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ke=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",je="A-Z\\xc0-\\xd6\\xd8-\\xde",Te="\\ufe0e\\ufe0f",Oe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ne="['’]",Me="[\\ud800-\\udfff]",Le="["+Oe+"]",Pe="["+Se+"]",Ae="\\d+",De="[\\u2700-\\u27bf]",Re="["+Ee+"]",Ie="[^\\ud800-\\udfff"+Oe+Ae+Ce+Ee+je+"]",Fe="\\ud83c[\\udffb-\\udfff]",ze="[^\\ud800-\\udfff]",Ue="(?:\\ud83c[\\udde6-\\uddff]){2}",He="[\\ud800-\\udbff][\\udc00-\\udfff]",We="["+je+"]",Be="(?:"+Re+"|"+Ie+")",$e="(?:"+We+"|"+Ie+")",Ve="(?:['’](?:d|ll|m|re|s|t|ve))?",qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Pe+"|"+Fe+")"+"?",Ye="[\\ufe0e\\ufe0f]?",Xe=Ye+Ge+("(?:\\u200d(?:"+[ze,Ue,He].join("|")+")"+Ye+Ge+")*"),Ke="(?:"+[De,Ue,He].join("|")+")"+Xe,Qe="(?:"+[ze+Pe+"?",Pe,Ue,He,Me].join("|")+")",Je=RegExp(Ne,"g"),Ze=RegExp(Pe,"g"),et=RegExp(Fe+"(?="+Fe+")|"+Qe+Xe,"g"),tt=RegExp([We+"?"+Re+"+"+Ve+"(?="+[Le,We,"$"].join("|")+")",$e+"+"+qe+"(?="+[Le,We+Be,"$"].join("|")+")",We+"?"+Be+"+"+Ve,We+"+"+qe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,Ke].join("|"),"g"),nt=RegExp("[\\u200d\\ud800-\\udfff"+Se+Te+"]"),rt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ot=-1,at={};at[R]=at[I]=at[F]=at[z]=at[U]=at[H]=at[W]=at[B]=at[$]=!0,at[y]=at[b]=at[A]=at[w]=at[D]=at[x]=at[k]=at[_]=at[C]=at[E]=at[j]=at[O]=at[N]=at[M]=at[P]=!1;var st={};st[y]=st[b]=st[A]=st[D]=st[w]=st[x]=st[R]=st[I]=st[F]=st[z]=st[U]=st[C]=st[E]=st[j]=st[O]=st[N]=st[M]=st[L]=st[H]=st[W]=st[B]=st[$]=!0,st[k]=st[_]=st[P]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,ct=parseInt,dt="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ft="object"==typeof self&&self&&self.Object===Object&&self,pt=dt||ft||Function("return this")(),ht=t&&!t.nodeType&&t,mt=ht&&e&&!e.nodeType&&e,vt=mt&&mt.exports===ht,gt=vt&&dt.process,yt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||gt&>.binding&>.binding("util")}catch(e){}}(),bt=yt&&yt.isArrayBuffer,wt=yt&&yt.isDate,xt=yt&&yt.isMap,kt=yt&&yt.isRegExp,_t=yt&&yt.isSet,St=yt&&yt.isTypedArray;function Ct(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Et(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function jt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Tt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Ot(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Nt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function Mt(e,t){return!!(null==e?0:e.length)&&Ht(e,t,0)>-1}function Lt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Pt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function At(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Dt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function Rt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function It(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Ft=Vt("length");function zt(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function Ut(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Ht(e,t,n){return t==t?function(e,t,n){var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Ut(e,Bt,n)}function Wt(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Bt(e){return e!=e}function $t(e,t){var n=null==e?0:e.length;return n?Yt(e,t)/n:m}function Vt(e){return function(t){return null==t?i:t[e]}}function qt(e){return function(t){return null==e?i:e[t]}}function Gt(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function Yt(e,t){for(var n,r=-1,o=e.length;++r<o;){var a=t(e[r]);a!==i&&(n=n===i?a:n+a)}return n}function Xt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Kt(e){return e?e.slice(0,mn(e)+1).replace(ae,""):e}function Qt(e){return function(t){return e(t)}}function Jt(e,t){return Pt(t,(function(t){return e[t]}))}function Zt(e,t){return e.has(t)}function en(e,t){for(var n=-1,r=e.length;++n<r&&Ht(t,e[n],0)>-1;);return n}function tn(e,t){for(var n=e.length;n--&&Ht(t,e[n],0)>-1;);return n}function nn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var rn=qt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),on=qt({"&":"&","<":"<",">":">",'"':""","'":"'"});function an(e){return"\\"+lt[e]}function sn(e){return nt.test(e)}function ln(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function un(e,t){return function(n){return e(t(n))}}function cn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&a!==s||(e[n]=s,o[i++]=n)}return o}function dn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function fn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function pn(e){return sn(e)?function(e){var t=et.lastIndex=0;for(;et.test(e);)++t;return t}(e):Ft(e)}function hn(e){return sn(e)?function(e){return e.match(et)||[]}(e):function(e){return e.split("")}(e)}function mn(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}var vn=qt({"&":"&","<":"<",">":">",""":'"',"'":"'"});var gn=function e(t){var n,r=(t=null==t?pt:gn.defaults(pt.Object(),t,gn.pick(pt,it))).Array,se=t.Date,Se=t.Error,Ce=t.Function,Ee=t.Math,je=t.Object,Te=t.RegExp,Oe=t.String,Ne=t.TypeError,Me=r.prototype,Le=Ce.prototype,Pe=je.prototype,Ae=t["__core-js_shared__"],De=Le.toString,Re=Pe.hasOwnProperty,Ie=0,Fe=(n=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",ze=Pe.toString,Ue=De.call(je),He=pt._,We=Te("^"+De.call(Re).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=vt?t.Buffer:i,$e=t.Symbol,Ve=t.Uint8Array,qe=Be?Be.allocUnsafe:i,Ge=un(je.getPrototypeOf,je),Ye=je.create,Xe=Pe.propertyIsEnumerable,Ke=Me.splice,Qe=$e?$e.isConcatSpreadable:i,et=$e?$e.iterator:i,nt=$e?$e.toStringTag:i,lt=function(){try{var e=ho(je,"defineProperty");return e({},"",{}),e}catch(e){}}(),dt=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ft=se&&se.now!==pt.Date.now&&se.now,ht=t.setTimeout!==pt.setTimeout&&t.setTimeout,mt=Ee.ceil,gt=Ee.floor,yt=je.getOwnPropertySymbols,Ft=Be?Be.isBuffer:i,qt=t.isFinite,yn=Me.join,bn=un(je.keys,je),wn=Ee.max,xn=Ee.min,kn=se.now,_n=t.parseInt,Sn=Ee.random,Cn=Me.reverse,En=ho(t,"DataView"),jn=ho(t,"Map"),Tn=ho(t,"Promise"),On=ho(t,"Set"),Nn=ho(t,"WeakMap"),Mn=ho(je,"create"),Ln=Nn&&new Nn,Pn={},An=Ho(En),Dn=Ho(jn),Rn=Ho(Tn),In=Ho(On),Fn=Ho(Nn),zn=$e?$e.prototype:i,Un=zn?zn.valueOf:i,Hn=zn?zn.toString:i;function Wn(e){if(is(e)&&!Ga(e)&&!(e instanceof qn)){if(e instanceof Vn)return e;if(Re.call(e,"__wrapped__"))return Wo(e)}return new Vn(e)}var Bn=function(){function e(){}return function(t){if(!rs(t))return{};if(Ye)return Ye(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function $n(){}function Vn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function qn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,this.__views__=[]}function Gn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Xn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Kn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Xn;++t<n;)this.add(e[t])}function Qn(e){var t=this.__data__=new Yn(e);this.size=t.size}function Jn(e,t){var n=Ga(e),r=!n&&qa(e),i=!n&&!r&&Qa(e),o=!n&&!r&&!i&&fs(e),a=n||r||i||o,s=a?Xt(e.length,Oe):[],l=s.length;for(var u in e)!t&&!Re.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||xo(u,l))||s.push(u);return s}function Zn(e){var t=e.length;return t?e[Kr(0,t-1)]:i}function er(e,t){return Fo(Mi(e),ur(t,0,e.length))}function tr(e){return Fo(Mi(e))}function nr(e,t,n){(n!==i&&!Ba(e[t],n)||n===i&&!(t in e))&&sr(e,t,n)}function rr(e,t,n){var r=e[t];Re.call(e,t)&&Ba(r,n)&&(n!==i||t in e)||sr(e,t,n)}function ir(e,t){for(var n=e.length;n--;)if(Ba(e[n][0],t))return n;return-1}function or(e,t,n,r){return hr(e,(function(e,i,o){t(r,e,n(e),o)})),r}function ar(e,t){return e&&Li(t,As(t),e)}function sr(e,t,n){"__proto__"==t&<?lt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function lr(e,t){for(var n=-1,o=t.length,a=r(o),s=null==e;++n<o;)a[n]=s?i:Os(e,t[n]);return a}function ur(e,t,n){return e==e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function cr(e,t,n,r,o,a){var s,l=1&t,u=2&t,c=4&t;if(n&&(s=o?n(e,r,o,a):n(e)),s!==i)return s;if(!rs(e))return e;var d=Ga(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Re.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Mi(e,s)}else{var f=go(e),p=f==_||f==S;if(Qa(e))return Ci(e,l);if(f==j||f==y||p&&!o){if(s=u||p?{}:bo(e),!l)return u?function(e,t){return Li(e,vo(e),t)}(e,function(e,t){return e&&Li(t,Ds(t),e)}(s,e)):function(e,t){return Li(e,mo(e),t)}(e,ar(s,e))}else{if(!st[f])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case A:return Ei(e);case w:case x:return new r(+e);case D:return function(e,t){var n=t?Ei(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case R:case I:case F:case z:case U:case H:case W:case B:case $:return ji(e,n);case C:return new r;case E:case M:return new r(e);case O:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case N:return new r;case L:return i=e,Un?je(Un.call(i)):{}}var i}(e,f,l)}}a||(a=new Qn);var h=a.get(e);if(h)return h;a.set(e,s),us(e)?e.forEach((function(r){s.add(cr(r,t,n,r,e,a))})):os(e)&&e.forEach((function(r,i){s.set(i,cr(r,t,n,i,e,a))}));var m=d?i:(c?u?ao:oo:u?Ds:As)(e);return jt(m||e,(function(r,i){m&&(r=e[i=r]),rr(s,i,cr(r,t,n,i,e,a))})),s}function dr(e,t,n){var r=n.length;if(null==e)return!r;for(e=je(e);r--;){var o=n[r],a=t[o],s=e[o];if(s===i&&!(o in e)||!a(s))return!1}return!0}function fr(e,t,n){if("function"!=typeof e)throw new Ne(o);return Ao((function(){e.apply(i,n)}),t)}function pr(e,t,n,r){var i=-1,o=Mt,a=!0,s=e.length,l=[],u=t.length;if(!s)return l;n&&(t=Pt(t,Qt(n))),r?(o=Lt,a=!1):t.length>=200&&(o=Zt,a=!1,t=new Kn(t));e:for(;++i<s;){var c=e[i],d=null==n?c:n(c);if(c=r||0!==c?c:0,a&&d==d){for(var f=u;f--;)if(t[f]===d)continue e;l.push(c)}else o(t,d,r)||l.push(c)}return l}Wn.templateSettings={escape:J,evaluate:Z,interpolate:ee,variable:"",imports:{_:Wn}},Wn.prototype=$n.prototype,Wn.prototype.constructor=Wn,Vn.prototype=Bn($n.prototype),Vn.prototype.constructor=Vn,qn.prototype=Bn($n.prototype),qn.prototype.constructor=qn,Gn.prototype.clear=function(){this.__data__=Mn?Mn(null):{},this.size=0},Gn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Gn.prototype.get=function(e){var t=this.__data__;if(Mn){var n=t[e];return n===a?i:n}return Re.call(t,e)?t[e]:i},Gn.prototype.has=function(e){var t=this.__data__;return Mn?t[e]!==i:Re.call(t,e)},Gn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Mn&&t===i?a:t,this},Yn.prototype.clear=function(){this.__data__=[],this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=ir(t,e);return!(n<0)&&(n==t.length-1?t.pop():Ke.call(t,n,1),--this.size,!0)},Yn.prototype.get=function(e){var t=this.__data__,n=ir(t,e);return n<0?i:t[n][1]},Yn.prototype.has=function(e){return ir(this.__data__,e)>-1},Yn.prototype.set=function(e,t){var n=this.__data__,r=ir(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Gn,map:new(jn||Yn),string:new Gn}},Xn.prototype.delete=function(e){var t=fo(this,e).delete(e);return this.size-=t?1:0,t},Xn.prototype.get=function(e){return fo(this,e).get(e)},Xn.prototype.has=function(e){return fo(this,e).has(e)},Xn.prototype.set=function(e,t){var n=fo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Kn.prototype.add=Kn.prototype.push=function(e){return this.__data__.set(e,a),this},Kn.prototype.has=function(e){return this.__data__.has(e)},Qn.prototype.clear=function(){this.__data__=new Yn,this.size=0},Qn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Qn.prototype.get=function(e){return this.__data__.get(e)},Qn.prototype.has=function(e){return this.__data__.has(e)},Qn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!jn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Xn(r)}return n.set(e,t),this.size=n.size,this};var hr=Di(kr),mr=Di(_r,!0);function vr(e,t){var n=!0;return hr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function gr(e,t,n){for(var r=-1,o=e.length;++r<o;){var a=e[r],s=t(a);if(null!=s&&(l===i?s==s&&!ds(s):n(s,l)))var l=s,u=a}return u}function yr(e,t){var n=[];return hr(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function br(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=wo),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?br(s,t-1,n,r,i):At(i,s):r||(i[i.length]=s)}return i}var wr=Ri(),xr=Ri(!0);function kr(e,t){return e&&wr(e,t,As)}function _r(e,t){return e&&xr(e,t,As)}function Sr(e,t){return Nt(t,(function(t){return es(e[t])}))}function Cr(e,t){for(var n=0,r=(t=xi(t,e)).length;null!=e&&n<r;)e=e[Uo(t[n++])];return n&&n==r?e:i}function Er(e,t,n){var r=t(e);return Ga(e)?r:At(r,n(e))}function jr(e){return null==e?e===i?"[object Undefined]":"[object Null]":nt&&nt in je(e)?function(e){var t=Re.call(e,nt),n=e[nt];try{e[nt]=i;var r=!0}catch(e){}var o=ze.call(e);r&&(t?e[nt]=n:delete e[nt]);return o}(e):function(e){return ze.call(e)}(e)}function Tr(e,t){return e>t}function Or(e,t){return null!=e&&Re.call(e,t)}function Nr(e,t){return null!=e&&t in je(e)}function Mr(e,t,n){for(var o=n?Lt:Mt,a=e[0].length,s=e.length,l=s,u=r(s),c=1/0,d=[];l--;){var f=e[l];l&&t&&(f=Pt(f,Qt(t))),c=xn(f.length,c),u[l]=!n&&(t||a>=120&&f.length>=120)?new Kn(l&&f):i}f=e[0];var p=-1,h=u[0];e:for(;++p<a&&d.length<c;){var m=f[p],v=t?t(m):m;if(m=n||0!==m?m:0,!(h?Zt(h,v):o(d,v,n))){for(l=s;--l;){var g=u[l];if(!(g?Zt(g,v):o(e[l],v,n)))continue e}h&&h.push(v),d.push(m)}}return d}function Lr(e,t,n){var r=null==(e=No(e,t=xi(t,e)))?e:e[Uo(Zo(t))];return null==r?i:Ct(r,e,n)}function Pr(e){return is(e)&&jr(e)==y}function Ar(e,t,n,r,o){return e===t||(null==e||null==t||!is(e)&&!is(t)?e!=e&&t!=t:function(e,t,n,r,o,a){var s=Ga(e),l=Ga(t),u=s?b:go(e),c=l?b:go(t),d=(u=u==y?j:u)==j,f=(c=c==y?j:c)==j,p=u==c;if(p&&Qa(e)){if(!Qa(t))return!1;s=!0,d=!1}if(p&&!d)return a||(a=new Qn),s||fs(e)?ro(e,t,n,r,o,a):function(e,t,n,r,i,o,a){switch(n){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!o(new Ve(e),new Ve(t)));case w:case x:case E:return Ba(+e,+t);case k:return e.name==t.name&&e.message==t.message;case O:case M:return e==t+"";case C:var s=ln;case N:var l=1&r;if(s||(s=dn),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var c=ro(s(e),s(t),r,i,o,a);return a.delete(e),c;case L:if(Un)return Un.call(e)==Un.call(t)}return!1}(e,t,u,n,r,o,a);if(!(1&n)){var h=d&&Re.call(e,"__wrapped__"),m=f&&Re.call(t,"__wrapped__");if(h||m){var v=h?e.value():e,g=m?t.value():t;return a||(a=new Qn),o(v,g,n,r,a)}}if(!p)return!1;return a||(a=new Qn),function(e,t,n,r,o,a){var s=1&n,l=oo(e),u=l.length,c=oo(t).length;if(u!=c&&!s)return!1;var d=u;for(;d--;){var f=l[d];if(!(s?f in t:Re.call(t,f)))return!1}var p=a.get(e),h=a.get(t);if(p&&h)return p==t&&h==e;var m=!0;a.set(e,t),a.set(t,e);var v=s;for(;++d<u;){var g=e[f=l[d]],y=t[f];if(r)var b=s?r(y,g,f,t,e,a):r(g,y,f,e,t,a);if(!(b===i?g===y||o(g,y,n,r,a):b)){m=!1;break}v||(v="constructor"==f)}if(m&&!v){var w=e.constructor,x=t.constructor;w==x||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof x&&x instanceof x||(m=!1)}return a.delete(e),a.delete(t),m}(e,t,n,r,o,a)}(e,t,n,r,Ar,o))}function Dr(e,t,n,r){var o=n.length,a=o,s=!r;if(null==e)return!a;for(e=je(e);o--;){var l=n[o];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<a;){var u=(l=n[o])[0],c=e[u],d=l[1];if(s&&l[2]){if(c===i&&!(u in e))return!1}else{var f=new Qn;if(r)var p=r(c,d,u,e,t,f);if(!(p===i?Ar(d,c,3,r,f):p))return!1}}return!0}function Rr(e){return!(!rs(e)||(t=e,Fe&&Fe in t))&&(es(e)?We:ye).test(Ho(e));var t}function Ir(e){return"function"==typeof e?e:null==e?al:"object"==typeof e?Ga(e)?Br(e[0],e[1]):Wr(e):ml(e)}function Fr(e){if(!Eo(e))return bn(e);var t=[];for(var n in je(e))Re.call(e,n)&&"constructor"!=n&&t.push(n);return t}function zr(e){if(!rs(e))return function(e){var t=[];if(null!=e)for(var n in je(e))t.push(n);return t}(e);var t=Eo(e),n=[];for(var r in e)("constructor"!=r||!t&&Re.call(e,r))&&n.push(r);return n}function Ur(e,t){return e<t}function Hr(e,t){var n=-1,i=Xa(e)?r(e.length):[];return hr(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function Wr(e){var t=po(e);return 1==t.length&&t[0][2]?To(t[0][0],t[0][1]):function(n){return n===e||Dr(n,e,t)}}function Br(e,t){return _o(e)&&jo(t)?To(Uo(e),t):function(n){var r=Os(n,e);return r===i&&r===t?Ns(n,e):Ar(t,r,3)}}function $r(e,t,n,r,o){e!==t&&wr(t,(function(a,s){if(o||(o=new Qn),rs(a))!function(e,t,n,r,o,a,s){var l=Lo(e,n),u=Lo(t,n),c=s.get(u);if(c)return void nr(e,n,c);var d=a?a(l,u,n+"",e,t,s):i,f=d===i;if(f){var p=Ga(u),h=!p&&Qa(u),m=!p&&!h&&fs(u);d=u,p||h||m?Ga(l)?d=l:Ka(l)?d=Mi(l):h?(f=!1,d=Ci(u,!0)):m?(f=!1,d=ji(u,!0)):d=[]:ss(u)||qa(u)?(d=l,qa(l)?d=ws(l):rs(l)&&!es(l)||(d=bo(u))):f=!1}f&&(s.set(u,d),o(d,u,r,a,s),s.delete(u));nr(e,n,d)}(e,t,s,n,$r,r,o);else{var l=r?r(Lo(e,s),a,s+"",e,t,o):i;l===i&&(l=a),nr(e,s,l)}}),Ds)}function Vr(e,t){var n=e.length;if(n)return xo(t+=t<0?n:0,n)?e[t]:i}function qr(e,t,n){t=t.length?Pt(t,(function(e){return Ga(e)?function(t){return Cr(t,1===e.length?e[0]:e)}:e})):[al];var r=-1;return t=Pt(t,Qt(co())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(Hr(e,(function(e,n,i){return{criteria:Pt(t,(function(t){return t(e)})),index:++r,value:e}})),(function(e,t){return function(e,t,n){var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;for(;++r<a;){var l=Ti(i[r],o[r]);if(l)return r>=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Gr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=Cr(e,a);n(s,a)&&ti(o,xi(a,e),s)}return o}function Yr(e,t,n,r){var i=r?Wt:Ht,o=-1,a=t.length,s=e;for(e===t&&(t=Mi(t)),n&&(s=Pt(e,Qt(n)));++o<a;)for(var l=0,u=t[o],c=n?n(u):u;(l=i(s,c,l,r))>-1;)s!==e&&Ke.call(s,l,1),Ke.call(e,l,1);return e}function Xr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;xo(i)?Ke.call(e,i,1):pi(e,i)}}return e}function Kr(e,t){return e+gt(Sn()*(t-e+1))}function Qr(e,t){var n="";if(!e||t<1||t>h)return n;do{t%2&&(n+=e),(t=gt(t/2))&&(e+=e)}while(t);return n}function Jr(e,t){return Do(Oo(e,t,al),e+"")}function Zr(e){return Zn(Bs(e))}function ei(e,t){var n=Bs(e);return Fo(n,ur(t,0,n.length))}function ti(e,t,n,r){if(!rs(e))return e;for(var o=-1,a=(t=xi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var u=Uo(t[o]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=s){var d=l[u];(c=r?r(d,u,l):i)===i&&(c=rs(d)?d:xo(t[o+1])?[]:{})}rr(l,u,c),l=l[u]}return e}var ni=Ln?function(e,t){return Ln.set(e,t),e}:al,ri=lt?function(e,t){return lt(e,"toString",{configurable:!0,enumerable:!1,value:rl(t),writable:!0})}:al;function ii(e){return Fo(Bs(e))}function oi(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i<o;)a[i]=e[i+t];return a}function ai(e,t){var n;return hr(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function si(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!ds(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return li(e,t,al,n)}function li(e,t,n,r){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=n(t))!=t,l=null===t,u=ds(t),c=t===i;o<a;){var d=gt((o+a)/2),f=n(e[d]),p=f!==i,h=null===f,m=f==f,v=ds(f);if(s)var g=r||m;else g=c?m&&(r||p):l?m&&p&&(r||!h):u?m&&p&&!h&&(r||!v):!h&&!v&&(r?f<=t:f<t);g?o=d+1:a=d}return xn(a,4294967294)}function ui(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!Ba(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function ci(e){return"number"==typeof e?e:ds(e)?m:+e}function di(e){if("string"==typeof e)return e;if(Ga(e))return Pt(e,di)+"";if(ds(e))return Hn?Hn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function fi(e,t,n){var r=-1,i=Mt,o=e.length,a=!0,s=[],l=s;if(n)a=!1,i=Lt;else if(o>=200){var u=t?null:Qi(e);if(u)return dn(u);a=!1,i=Zt,l=new Kn}else l=t?[]:s;e:for(;++r<o;){var c=e[r],d=t?t(c):c;if(c=n||0!==c?c:0,a&&d==d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),s.push(c)}else i(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s}function pi(e,t){return null==(e=No(e,t=xi(t,e)))||delete e[Uo(Zo(t))]}function hi(e,t,n,r){return ti(e,t,n(Cr(e,t)),r)}function mi(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?oi(e,r?0:o,r?o+1:i):oi(e,r?o+1:0,r?i:o)}function vi(e,t){var n=e;return n instanceof qn&&(n=n.value()),Dt(t,(function(e,t){return t.func.apply(t.thisArg,At([e],t.args))}),n)}function gi(e,t,n){var i=e.length;if(i<2)return i?fi(e[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=e[o],l=-1;++l<i;)l!=o&&(a[o]=pr(a[o]||s,e[l],t,n));return fi(br(a,1),t,n)}function yi(e,t,n){for(var r=-1,o=e.length,a=t.length,s={};++r<o;){var l=r<a?t[r]:i;n(s,e[r],l)}return s}function bi(e){return Ka(e)?e:[]}function wi(e){return"function"==typeof e?e:al}function xi(e,t){return Ga(e)?e:_o(e,t)?[e]:zo(xs(e))}var ki=Jr;function _i(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:oi(e,t,n)}var Si=dt||function(e){return pt.clearTimeout(e)};function Ci(e,t){if(t)return e.slice();var n=e.length,r=qe?qe(n):new e.constructor(n);return e.copy(r),r}function Ei(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function ji(e,t){var n=t?Ei(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ti(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,a=ds(e),s=t!==i,l=null===t,u=t==t,c=ds(t);if(!l&&!c&&!a&&e>t||a&&s&&u&&!l&&!c||r&&s&&u||!n&&u||!o)return 1;if(!r&&!a&&!c&&e<t||c&&n&&o&&!r&&!a||l&&n&&o||!s&&o||!u)return-1}return 0}function Oi(e,t,n,i){for(var o=-1,a=e.length,s=n.length,l=-1,u=t.length,c=wn(a-s,0),d=r(u+c),f=!i;++l<u;)d[l]=t[l];for(;++o<s;)(f||o<a)&&(d[n[o]]=e[o]);for(;c--;)d[l++]=e[o++];return d}function Ni(e,t,n,i){for(var o=-1,a=e.length,s=-1,l=n.length,u=-1,c=t.length,d=wn(a-l,0),f=r(d+c),p=!i;++o<d;)f[o]=e[o];for(var h=o;++u<c;)f[h+u]=t[u];for(;++s<l;)(p||o<a)&&(f[h+n[s]]=e[o++]);return f}function Mi(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function Li(e,t,n,r){var o=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var l=t[a],u=r?r(n[l],e[l],l,n,e):i;u===i&&(u=e[l]),o?sr(n,l,u):rr(n,l,u)}return n}function Pi(e,t){return function(n,r){var i=Ga(n)?Et:or,o=t?t():{};return i(n,e,co(r,2),o)}}function Ai(e){return Jr((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:i,s=o>2?n[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&ko(n[0],n[1],s)&&(a=o<3?i:a,o=1),t=je(t);++r<o;){var l=n[r];l&&e(t,l,r,a)}return t}))}function Di(e,t){return function(n,r){if(null==n)return n;if(!Xa(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=je(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Ri(e){return function(t,n,r){for(var i=-1,o=je(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}function Ii(e){return function(t){var n=sn(t=xs(t))?hn(t):i,r=n?n[0]:t.charAt(0),o=n?_i(n,1).join(""):t.slice(1);return r[e]()+o}}function Fi(e){return function(t){return Dt(el(qs(t).replace(Je,"")),e,"")}}function zi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Bn(e.prototype),r=e.apply(n,t);return rs(r)?r:n}}function Ui(e){return function(t,n,r){var o=je(t);if(!Xa(t)){var a=co(n,3);t=As(t),n=function(e){return a(o[e],e,o)}}var s=e(t,n,r);return s>-1?o[a?t[s]:s]:i}}function Hi(e){return io((function(t){var n=t.length,r=n,a=Vn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new Ne(o);if(a&&!l&&"wrapper"==lo(s))var l=new Vn([],!0)}for(r=l?r:n;++r<n;){var u=lo(s=t[r]),c="wrapper"==u?so(s):i;l=c&&So(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[lo(c[0])].apply(l,c[3]):1==s.length&&So(s)?l[u]():l.thru(s)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Ga(r))return l.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function Wi(e,t,n,o,a,s,l,u,c,f){var p=t&d,h=1&t,m=2&t,v=24&t,g=512&t,y=m?i:zi(e);return function i(){for(var d=arguments.length,b=r(d),w=d;w--;)b[w]=arguments[w];if(v)var x=uo(i),k=nn(b,x);if(o&&(b=Oi(b,o,a,v)),s&&(b=Ni(b,s,l,v)),d-=k,v&&d<f){var _=cn(b,x);return Xi(e,t,Wi,i.placeholder,n,b,_,u,c,f-d)}var S=h?n:this,C=m?S[e]:e;return d=b.length,u?b=Mo(b,u):g&&d>1&&b.reverse(),p&&c<d&&(b.length=c),this&&this!==pt&&this instanceof i&&(C=y||zi(C)),C.apply(S,b)}}function Bi(e,t){return function(n,r){return function(e,t,n,r){return kr(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function $i(e,t){return function(n,r){var o;if(n===i&&r===i)return t;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=di(n),r=di(r)):(n=ci(n),r=ci(r)),o=e(n,r)}return o}}function Vi(e){return io((function(t){return t=Pt(t,Qt(co())),Jr((function(n){var r=this;return e(t,(function(e){return Ct(e,r,n)}))}))}))}function qi(e,t){var n=(t=t===i?" ":di(t)).length;if(n<2)return n?Qr(t,e):t;var r=Qr(t,mt(e/pn(t)));return sn(t)?_i(hn(r),0,e).join(""):r.slice(0,e)}function Gi(e){return function(t,n,o){return o&&"number"!=typeof o&&ko(t,n,o)&&(n=o=i),t=vs(t),n===i?(n=t,t=0):n=vs(n),function(e,t,n,i){for(var o=-1,a=wn(mt((t-e)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=e,e+=n;return s}(t,n,o=o===i?t<n?1:-1:vs(o),e)}}function Yi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=bs(t),n=bs(n)),e(t,n)}}function Xi(e,t,n,r,o,a,s,l,d,f){var p=8&t;t|=p?u:c,4&(t&=~(p?c:u))||(t&=-4);var h=[e,t,o,p?a:i,p?s:i,p?i:a,p?i:s,l,d,f],m=n.apply(i,h);return So(e)&&Po(m,h),m.placeholder=r,Ro(m,e,t)}function Ki(e){var t=Ee[e];return function(e,n){if(e=bs(e),(n=null==n?0:xn(gs(n),292))&&qt(e)){var r=(xs(e)+"e").split("e");return+((r=(xs(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Qi=On&&1/dn(new On([,-0]))[1]==p?function(e){return new On(e)}:dl;function Ji(e){return function(t){var n=go(t);return n==C?ln(t):n==N?fn(t):function(e,t){return Pt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Zi(e,t,n,a,p,h,m,v){var g=2&t;if(!g&&"function"!=typeof e)throw new Ne(o);var y=a?a.length:0;if(y||(t&=-97,a=p=i),m=m===i?m:wn(gs(m),0),v=v===i?v:gs(v),y-=p?p.length:0,t&c){var b=a,w=p;a=p=i}var x=g?i:so(e),k=[e,t,n,a,p,b,w,h,m,v];if(x&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,a=r==d&&8==n||r==d&&n==f&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!a)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var l=t[3];if(l){var u=e[3];e[3]=u?Oi(u,l,t[4]):l,e[4]=u?cn(e[3],s):t[4]}(l=t[5])&&(u=e[5],e[5]=u?Ni(u,l,t[6]):l,e[6]=u?cn(e[5],s):t[6]);(l=t[7])&&(e[7]=l);r&d&&(e[8]=null==e[8]?t[8]:xn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(k,x),e=k[0],t=k[1],n=k[2],a=k[3],p=k[4],!(v=k[9]=k[9]===i?g?0:e.length:wn(k[9]-y,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||t==l?function(e,t,n){var o=zi(e);return function a(){for(var s=arguments.length,l=r(s),u=s,c=uo(a);u--;)l[u]=arguments[u];var d=s<3&&l[0]!==c&&l[s-1]!==c?[]:cn(l,c);return(s-=d.length)<n?Xi(e,t,Wi,a.placeholder,i,l,d,i,i,n-s):Ct(this&&this!==pt&&this instanceof a?o:e,this,l)}}(e,t,v):t!=u&&33!=t||p.length?Wi.apply(i,k):function(e,t,n,i){var o=1&t,a=zi(e);return function t(){for(var s=-1,l=arguments.length,u=-1,c=i.length,d=r(c+l),f=this&&this!==pt&&this instanceof t?a:e;++u<c;)d[u]=i[u];for(;l--;)d[u++]=arguments[++s];return Ct(f,o?n:this,d)}}(e,t,n,a);else var _=function(e,t,n){var r=1&t,i=zi(e);return function t(){return(this&&this!==pt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,n);return Ro((x?ni:Po)(_,k),e,t)}function eo(e,t,n,r){return e===i||Ba(e,Pe[n])&&!Re.call(r,n)?t:e}function to(e,t,n,r,o,a){return rs(e)&&rs(t)&&(a.set(t,e),$r(e,t,i,to,a),a.delete(t)),e}function no(e){return ss(e)?i:e}function ro(e,t,n,r,o,a){var s=1&n,l=e.length,u=t.length;if(l!=u&&!(s&&u>l))return!1;var c=a.get(e),d=a.get(t);if(c&&d)return c==t&&d==e;var f=-1,p=!0,h=2&n?new Kn:i;for(a.set(e,t),a.set(t,e);++f<l;){var m=e[f],v=t[f];if(r)var g=s?r(v,m,f,t,e,a):r(m,v,f,e,t,a);if(g!==i){if(g)continue;p=!1;break}if(h){if(!It(t,(function(e,t){if(!Zt(h,t)&&(m===e||o(m,e,n,r,a)))return h.push(t)}))){p=!1;break}}else if(m!==v&&!o(m,v,n,r,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function io(e){return Do(Oo(e,i,Yo),e+"")}function oo(e){return Er(e,As,mo)}function ao(e){return Er(e,Ds,vo)}var so=Ln?function(e){return Ln.get(e)}:dl;function lo(e){for(var t=e.name+"",n=Pn[t],r=Re.call(Pn,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function uo(e){return(Re.call(Wn,"placeholder")?Wn:e).placeholder}function co(){var e=Wn.iteratee||sl;return e=e===sl?Ir:e,arguments.length?e(arguments[0],arguments[1]):e}function fo(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function po(e){for(var t=As(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,jo(i)]}return t}function ho(e,t){var n=function(e,t){return null==e?i:e[t]}(e,t);return Rr(n)?n:i}var mo=yt?function(e){return null==e?[]:(e=je(e),Nt(yt(e),(function(t){return Xe.call(e,t)})))}:yl,vo=yt?function(e){for(var t=[];e;)At(t,mo(e)),e=Ge(e);return t}:yl,go=jr;function yo(e,t,n){for(var r=-1,i=(t=xi(t,e)).length,o=!1;++r<i;){var a=Uo(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&ns(i)&&xo(a,i)&&(Ga(e)||qa(e))}function bo(e){return"function"!=typeof e.constructor||Eo(e)?{}:Bn(Ge(e))}function wo(e){return Ga(e)||qa(e)||!!(Qe&&e&&e[Qe])}function xo(e,t){var n=typeof e;return!!(t=null==t?h:t)&&("number"==n||"symbol"!=n&&we.test(e))&&e>-1&&e%1==0&&e<t}function ko(e,t,n){if(!rs(n))return!1;var r=typeof t;return!!("number"==r?Xa(n)&&xo(t,n.length):"string"==r&&t in n)&&Ba(n[t],e)}function _o(e,t){if(Ga(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ds(e))||(ne.test(e)||!te.test(e)||null!=t&&e in je(t))}function So(e){var t=lo(e),n=Wn[t];if("function"!=typeof n||!(t in qn.prototype))return!1;if(e===n)return!0;var r=so(n);return!!r&&e===r[0]}(En&&go(new En(new ArrayBuffer(1)))!=D||jn&&go(new jn)!=C||Tn&&go(Tn.resolve())!=T||On&&go(new On)!=N||Nn&&go(new Nn)!=P)&&(go=function(e){var t=jr(e),n=t==j?e.constructor:i,r=n?Ho(n):"";if(r)switch(r){case An:return D;case Dn:return C;case Rn:return T;case In:return N;case Fn:return P}return t});var Co=Ae?es:bl;function Eo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Pe)}function jo(e){return e==e&&!rs(e)}function To(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==i||e in je(n)))}}function Oo(e,t,n){return t=wn(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=wn(i.length-t,0),s=r(a);++o<a;)s[o]=i[t+o];o=-1;for(var l=r(t+1);++o<t;)l[o]=i[o];return l[t]=n(s),Ct(e,this,l)}}function No(e,t){return t.length<2?e:Cr(e,oi(t,0,-1))}function Mo(e,t){for(var n=e.length,r=xn(t.length,n),o=Mi(e);r--;){var a=t[r];e[r]=xo(a,n)?o[a]:i}return e}function Lo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Po=Io(ni),Ao=ht||function(e,t){return pt.setTimeout(e,t)},Do=Io(ri);function Ro(e,t,n){var r=t+"";return Do(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(le,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return jt(g,(function(n){var r="_."+n[0];t&n[1]&&!Mt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ue);return t?t[1].split(ce):[]}(r),n)))}function Io(e){var t=0,n=0;return function(){var r=kn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Fo(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n<t;){var a=Kr(n,o),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var zo=function(e){var t=Ia(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(re,(function(e,n,r,i){t.push(r?i.replace(pe,"$1"):n||e)})),t}));function Uo(e){if("string"==typeof e||ds(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ho(e){if(null!=e){try{return De.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Wo(e){if(e instanceof qn)return e.clone();var t=new Vn(e.__wrapped__,e.__chain__);return t.__actions__=Mi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Bo=Jr((function(e,t){return Ka(e)?pr(e,br(t,1,Ka,!0)):[]})),$o=Jr((function(e,t){var n=Zo(t);return Ka(n)&&(n=i),Ka(e)?pr(e,br(t,1,Ka,!0),co(n,2)):[]})),Vo=Jr((function(e,t){var n=Zo(t);return Ka(n)&&(n=i),Ka(e)?pr(e,br(t,1,Ka,!0),i,n):[]}));function qo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:gs(n);return i<0&&(i=wn(r+i,0)),Ut(e,co(t,3),i)}function Go(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return n!==i&&(o=gs(n),o=n<0?wn(r+o,0):xn(o,r-1)),Ut(e,co(t,3),o,!0)}function Yo(e){return(null==e?0:e.length)?br(e,1):[]}function Xo(e){return e&&e.length?e[0]:i}var Ko=Jr((function(e){var t=Pt(e,bi);return t.length&&t[0]===e[0]?Mr(t):[]})),Qo=Jr((function(e){var t=Zo(e),n=Pt(e,bi);return t===Zo(n)?t=i:n.pop(),n.length&&n[0]===e[0]?Mr(n,co(t,2)):[]})),Jo=Jr((function(e){var t=Zo(e),n=Pt(e,bi);return(t="function"==typeof t?t:i)&&n.pop(),n.length&&n[0]===e[0]?Mr(n,i,t):[]}));function Zo(e){var t=null==e?0:e.length;return t?e[t-1]:i}var ea=Jr(ta);function ta(e,t){return e&&e.length&&t&&t.length?Yr(e,t):e}var na=io((function(e,t){var n=null==e?0:e.length,r=lr(e,t);return Xr(e,Pt(t,(function(e){return xo(e,n)?+e:e})).sort(Ti)),r}));function ra(e){return null==e?e:Cn.call(e)}var ia=Jr((function(e){return fi(br(e,1,Ka,!0))})),oa=Jr((function(e){var t=Zo(e);return Ka(t)&&(t=i),fi(br(e,1,Ka,!0),co(t,2))})),aa=Jr((function(e){var t=Zo(e);return t="function"==typeof t?t:i,fi(br(e,1,Ka,!0),i,t)}));function sa(e){if(!e||!e.length)return[];var t=0;return e=Nt(e,(function(e){if(Ka(e))return t=wn(e.length,t),!0})),Xt(t,(function(t){return Pt(e,Vt(t))}))}function la(e,t){if(!e||!e.length)return[];var n=sa(e);return null==t?n:Pt(n,(function(e){return Ct(t,i,e)}))}var ua=Jr((function(e,t){return Ka(e)?pr(e,t):[]})),ca=Jr((function(e){return gi(Nt(e,Ka))})),da=Jr((function(e){var t=Zo(e);return Ka(t)&&(t=i),gi(Nt(e,Ka),co(t,2))})),fa=Jr((function(e){var t=Zo(e);return t="function"==typeof t?t:i,gi(Nt(e,Ka),i,t)})),pa=Jr(sa);var ha=Jr((function(e){var t=e.length,n=t>1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,la(e,n)}));function ma(e){var t=Wn(e);return t.__chain__=!0,t}function va(e,t){return t(e)}var ga=io((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return lr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof qn&&xo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:va,args:[o],thisArg:i}),new Vn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)}));var ya=Pi((function(e,t,n){Re.call(e,n)?++e[n]:sr(e,n,1)}));var ba=Ui(qo),wa=Ui(Go);function xa(e,t){return(Ga(e)?jt:hr)(e,co(t,3))}function ka(e,t){return(Ga(e)?Tt:mr)(e,co(t,3))}var _a=Pi((function(e,t,n){Re.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Sa=Jr((function(e,t,n){var i=-1,o="function"==typeof t,a=Xa(e)?r(e.length):[];return hr(e,(function(e){a[++i]=o?Ct(t,e,n):Lr(e,t,n)})),a})),Ca=Pi((function(e,t,n){sr(e,n,t)}));function Ea(e,t){return(Ga(e)?Pt:Hr)(e,co(t,3))}var ja=Pi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Ta=Jr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ko(e,t[0],t[1])?t=[]:n>2&&ko(t[0],t[1],t[2])&&(t=[t[0]]),qr(e,br(t,1),[])})),Oa=ft||function(){return pt.Date.now()};function Na(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Zi(e,d,i,i,i,i,t)}function Ma(e,t){var n;if("function"!=typeof t)throw new Ne(o);return e=gs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var La=Jr((function(e,t,n){var r=1;if(n.length){var i=cn(n,uo(La));r|=u}return Zi(e,r,t,n,i)})),Pa=Jr((function(e,t,n){var r=3;if(n.length){var i=cn(n,uo(Pa));r|=u}return Zi(t,r,e,n,i)}));function Aa(e,t,n){var r,a,s,l,u,c,d=0,f=!1,p=!1,h=!0;if("function"!=typeof e)throw new Ne(o);function m(t){var n=r,o=a;return r=a=i,d=t,l=e.apply(o,n)}function v(e){return d=e,u=Ao(y,t),f?m(e):l}function g(e){var n=e-c;return c===i||n>=t||n<0||p&&e-d>=s}function y(){var e=Oa();if(g(e))return b(e);u=Ao(y,function(e){var n=t-(e-c);return p?xn(n,s-(e-d)):n}(e))}function b(e){return u=i,h&&r?m(e):(r=a=i,l)}function w(){var e=Oa(),n=g(e);if(r=arguments,a=this,c=e,n){if(u===i)return v(c);if(p)return Si(u),u=Ao(y,t),m(c)}return u===i&&(u=Ao(y,t)),l}return t=bs(t)||0,rs(n)&&(f=!!n.leading,s=(p="maxWait"in n)?wn(bs(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h),w.cancel=function(){u!==i&&Si(u),d=0,r=c=a=u=i},w.flush=function(){return u===i?l:b(Oa())},w}var Da=Jr((function(e,t){return fr(e,1,t)})),Ra=Jr((function(e,t,n){return fr(e,bs(t)||0,n)}));function Ia(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ne(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ia.Cache||Xn),n}function Fa(e){if("function"!=typeof e)throw new Ne(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ia.Cache=Xn;var za=ki((function(e,t){var n=(t=1==t.length&&Ga(t[0])?Pt(t[0],Qt(co())):Pt(br(t,1),Qt(co()))).length;return Jr((function(r){for(var i=-1,o=xn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return Ct(e,this,r)}))})),Ua=Jr((function(e,t){var n=cn(t,uo(Ua));return Zi(e,u,i,t,n)})),Ha=Jr((function(e,t){var n=cn(t,uo(Ha));return Zi(e,c,i,t,n)})),Wa=io((function(e,t){return Zi(e,f,i,i,i,t)}));function Ba(e,t){return e===t||e!=e&&t!=t}var $a=Yi(Tr),Va=Yi((function(e,t){return e>=t})),qa=Pr(function(){return arguments}())?Pr:function(e){return is(e)&&Re.call(e,"callee")&&!Xe.call(e,"callee")},Ga=r.isArray,Ya=bt?Qt(bt):function(e){return is(e)&&jr(e)==A};function Xa(e){return null!=e&&ns(e.length)&&!es(e)}function Ka(e){return is(e)&&Xa(e)}var Qa=Ft||bl,Ja=wt?Qt(wt):function(e){return is(e)&&jr(e)==x};function Za(e){if(!is(e))return!1;var t=jr(e);return t==k||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ss(e)}function es(e){if(!rs(e))return!1;var t=jr(e);return t==_||t==S||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ts(e){return"number"==typeof e&&e==gs(e)}function ns(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function is(e){return null!=e&&"object"==typeof e}var os=xt?Qt(xt):function(e){return is(e)&&go(e)==C};function as(e){return"number"==typeof e||is(e)&&jr(e)==E}function ss(e){if(!is(e)||jr(e)!=j)return!1;var t=Ge(e);if(null===t)return!0;var n=Re.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==Ue}var ls=kt?Qt(kt):function(e){return is(e)&&jr(e)==O};var us=_t?Qt(_t):function(e){return is(e)&&go(e)==N};function cs(e){return"string"==typeof e||!Ga(e)&&is(e)&&jr(e)==M}function ds(e){return"symbol"==typeof e||is(e)&&jr(e)==L}var fs=St?Qt(St):function(e){return is(e)&&ns(e.length)&&!!at[jr(e)]};var ps=Yi(Ur),hs=Yi((function(e,t){return e<=t}));function ms(e){if(!e)return[];if(Xa(e))return cs(e)?hn(e):Mi(e);if(et&&e[et])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[et]());var t=go(e);return(t==C?ln:t==N?dn:Bs)(e)}function vs(e){return e?(e=bs(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function gs(e){var t=vs(e),n=t%1;return t==t?n?t-n:t:0}function ys(e){return e?ur(gs(e),0,v):0}function bs(e){if("number"==typeof e)return e;if(ds(e))return m;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Kt(e);var n=ge.test(e);return n||be.test(e)?ct(e.slice(2),n?2:8):ve.test(e)?m:+e}function ws(e){return Li(e,Ds(e))}function xs(e){return null==e?"":di(e)}var ks=Ai((function(e,t){if(Eo(t)||Xa(t))Li(t,As(t),e);else for(var n in t)Re.call(t,n)&&rr(e,n,t[n])})),_s=Ai((function(e,t){Li(t,Ds(t),e)})),Ss=Ai((function(e,t,n,r){Li(t,Ds(t),e,r)})),Cs=Ai((function(e,t,n,r){Li(t,As(t),e,r)})),Es=io(lr);var js=Jr((function(e,t){e=je(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&ko(t[0],t[1],o)&&(r=1);++n<r;)for(var a=t[n],s=Ds(a),l=-1,u=s.length;++l<u;){var c=s[l],d=e[c];(d===i||Ba(d,Pe[c])&&!Re.call(e,c))&&(e[c]=a[c])}return e})),Ts=Jr((function(e){return e.push(i,to),Ct(Is,i,e)}));function Os(e,t,n){var r=null==e?i:Cr(e,t);return r===i?n:r}function Ns(e,t){return null!=e&&yo(e,t,Nr)}var Ms=Bi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=ze.call(t)),e[t]=n}),rl(al)),Ls=Bi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=ze.call(t)),Re.call(e,t)?e[t].push(n):e[t]=[n]}),co),Ps=Jr(Lr);function As(e){return Xa(e)?Jn(e):Fr(e)}function Ds(e){return Xa(e)?Jn(e,!0):zr(e)}var Rs=Ai((function(e,t,n){$r(e,t,n)})),Is=Ai((function(e,t,n,r){$r(e,t,n,r)})),Fs=io((function(e,t){var n={};if(null==e)return n;var r=!1;t=Pt(t,(function(t){return t=xi(t,e),r||(r=t.length>1),t})),Li(e,ao(e),n),r&&(n=cr(n,7,no));for(var i=t.length;i--;)pi(n,t[i]);return n}));var zs=io((function(e,t){return null==e?{}:function(e,t){return Gr(e,t,(function(t,n){return Ns(e,n)}))}(e,t)}));function Us(e,t){if(null==e)return{};var n=Pt(ao(e),(function(e){return[e]}));return t=co(t),Gr(e,n,(function(e,n){return t(e,n[0])}))}var Hs=Ji(As),Ws=Ji(Ds);function Bs(e){return null==e?[]:Jt(e,As(e))}var $s=Fi((function(e,t,n){return t=t.toLowerCase(),e+(n?Vs(t):t)}));function Vs(e){return Zs(xs(e).toLowerCase())}function qs(e){return(e=xs(e))&&e.replace(xe,rn).replace(Ze,"")}var Gs=Fi((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ys=Fi((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Xs=Ii("toLowerCase");var Ks=Fi((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Qs=Fi((function(e,t,n){return e+(n?" ":"")+Zs(t)}));var Js=Fi((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Zs=Ii("toUpperCase");function el(e,t,n){return e=xs(e),(t=n?i:t)===i?function(e){return rt.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(de)||[]}(e):e.match(t)||[]}var tl=Jr((function(e,t){try{return Ct(e,i,t)}catch(e){return Za(e)?e:new Se(e)}})),nl=io((function(e,t){return jt(t,(function(t){t=Uo(t),sr(e,t,La(e[t],e))})),e}));function rl(e){return function(){return e}}var il=Hi(),ol=Hi(!0);function al(e){return e}function sl(e){return Ir("function"==typeof e?e:cr(e,1))}var ll=Jr((function(e,t){return function(n){return Lr(n,e,t)}})),ul=Jr((function(e,t){return function(n){return Lr(e,n,t)}}));function cl(e,t,n){var r=As(t),i=Sr(t,r);null!=n||rs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Sr(t,As(t)));var o=!(rs(n)&&"chain"in n&&!n.chain),a=es(e);return jt(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Mi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,At([this.value()],arguments))})})),e}function dl(){}var fl=Vi(Pt),pl=Vi(Ot),hl=Vi(It);function ml(e){return _o(e)?Vt(Uo(e)):function(e){return function(t){return Cr(t,e)}}(e)}var vl=Gi(),gl=Gi(!0);function yl(){return[]}function bl(){return!1}var wl=$i((function(e,t){return e+t}),0),xl=Ki("ceil"),kl=$i((function(e,t){return e/t}),1),_l=Ki("floor");var Sl,Cl=$i((function(e,t){return e*t}),1),El=Ki("round"),jl=$i((function(e,t){return e-t}),0);return Wn.after=function(e,t){if("function"!=typeof t)throw new Ne(o);return e=gs(e),function(){if(--e<1)return t.apply(this,arguments)}},Wn.ary=Na,Wn.assign=ks,Wn.assignIn=_s,Wn.assignInWith=Ss,Wn.assignWith=Cs,Wn.at=Es,Wn.before=Ma,Wn.bind=La,Wn.bindAll=nl,Wn.bindKey=Pa,Wn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ga(e)?e:[e]},Wn.chain=ma,Wn.chunk=function(e,t,n){t=(n?ko(e,t,n):t===i)?1:wn(gs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,l=r(mt(o/t));a<o;)l[s++]=oi(e,a,a+=t);return l},Wn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Wn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return At(Ga(n)?Mi(n):[n],br(t,1))},Wn.cond=function(e){var t=null==e?0:e.length,n=co();return e=t?Pt(e,(function(e){if("function"!=typeof e[1])throw new Ne(o);return[n(e[0]),e[1]]})):[],Jr((function(n){for(var r=-1;++r<t;){var i=e[r];if(Ct(i[0],this,n))return Ct(i[1],this,n)}}))},Wn.conforms=function(e){return function(e){var t=As(e);return function(n){return dr(n,e,t)}}(cr(e,1))},Wn.constant=rl,Wn.countBy=ya,Wn.create=function(e,t){var n=Bn(e);return null==t?n:ar(n,t)},Wn.curry=function e(t,n,r){var o=Zi(t,8,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Wn.curryRight=function e(t,n,r){var o=Zi(t,l,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Wn.debounce=Aa,Wn.defaults=js,Wn.defaultsDeep=Ts,Wn.defer=Da,Wn.delay=Ra,Wn.difference=Bo,Wn.differenceBy=$o,Wn.differenceWith=Vo,Wn.drop=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,(t=n||t===i?1:gs(t))<0?0:t,r):[]},Wn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,0,(t=r-(t=n||t===i?1:gs(t)))<0?0:t):[]},Wn.dropRightWhile=function(e,t){return e&&e.length?mi(e,co(t,3),!0,!0):[]},Wn.dropWhile=function(e,t){return e&&e.length?mi(e,co(t,3),!0):[]},Wn.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&ko(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=gs(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:gs(r))<0&&(r+=o),r=n>r?0:ys(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Wn.filter=function(e,t){return(Ga(e)?Nt:yr)(e,co(t,3))},Wn.flatMap=function(e,t){return br(Ea(e,t),1)},Wn.flatMapDeep=function(e,t){return br(Ea(e,t),p)},Wn.flatMapDepth=function(e,t,n){return n=n===i?1:gs(n),br(Ea(e,t),n)},Wn.flatten=Yo,Wn.flattenDeep=function(e){return(null==e?0:e.length)?br(e,p):[]},Wn.flattenDepth=function(e,t){return(null==e?0:e.length)?br(e,t=t===i?1:gs(t)):[]},Wn.flip=function(e){return Zi(e,512)},Wn.flow=il,Wn.flowRight=ol,Wn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Wn.functions=function(e){return null==e?[]:Sr(e,As(e))},Wn.functionsIn=function(e){return null==e?[]:Sr(e,Ds(e))},Wn.groupBy=_a,Wn.initial=function(e){return(null==e?0:e.length)?oi(e,0,-1):[]},Wn.intersection=Ko,Wn.intersectionBy=Qo,Wn.intersectionWith=Jo,Wn.invert=Ms,Wn.invertBy=Ls,Wn.invokeMap=Sa,Wn.iteratee=sl,Wn.keyBy=Ca,Wn.keys=As,Wn.keysIn=Ds,Wn.map=Ea,Wn.mapKeys=function(e,t){var n={};return t=co(t,3),kr(e,(function(e,r,i){sr(n,t(e,r,i),e)})),n},Wn.mapValues=function(e,t){var n={};return t=co(t,3),kr(e,(function(e,r,i){sr(n,r,t(e,r,i))})),n},Wn.matches=function(e){return Wr(cr(e,1))},Wn.matchesProperty=function(e,t){return Br(e,cr(t,1))},Wn.memoize=Ia,Wn.merge=Rs,Wn.mergeWith=Is,Wn.method=ll,Wn.methodOf=ul,Wn.mixin=cl,Wn.negate=Fa,Wn.nthArg=function(e){return e=gs(e),Jr((function(t){return Vr(t,e)}))},Wn.omit=Fs,Wn.omitBy=function(e,t){return Us(e,Fa(co(t)))},Wn.once=function(e){return Ma(2,e)},Wn.orderBy=function(e,t,n,r){return null==e?[]:(Ga(t)||(t=null==t?[]:[t]),Ga(n=r?i:n)||(n=null==n?[]:[n]),qr(e,t,n))},Wn.over=fl,Wn.overArgs=za,Wn.overEvery=pl,Wn.overSome=hl,Wn.partial=Ua,Wn.partialRight=Ha,Wn.partition=ja,Wn.pick=zs,Wn.pickBy=Us,Wn.property=ml,Wn.propertyOf=function(e){return function(t){return null==e?i:Cr(e,t)}},Wn.pull=ea,Wn.pullAll=ta,Wn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Yr(e,t,co(n,2)):e},Wn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Yr(e,t,i,n):e},Wn.pullAt=na,Wn.range=vl,Wn.rangeRight=gl,Wn.rearg=Wa,Wn.reject=function(e,t){return(Ga(e)?Nt:yr)(e,Fa(co(t,3)))},Wn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=co(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return Xr(e,i),n},Wn.rest=function(e,t){if("function"!=typeof e)throw new Ne(o);return Jr(e,t=t===i?t:gs(t))},Wn.reverse=ra,Wn.sampleSize=function(e,t,n){return t=(n?ko(e,t,n):t===i)?1:gs(t),(Ga(e)?er:ei)(e,t)},Wn.set=function(e,t,n){return null==e?e:ti(e,t,n)},Wn.setWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ti(e,t,n,r)},Wn.shuffle=function(e){return(Ga(e)?tr:ii)(e)},Wn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&ko(e,t,n)?(t=0,n=r):(t=null==t?0:gs(t),n=n===i?r:gs(n)),oi(e,t,n)):[]},Wn.sortBy=Ta,Wn.sortedUniq=function(e){return e&&e.length?ui(e):[]},Wn.sortedUniqBy=function(e,t){return e&&e.length?ui(e,co(t,2)):[]},Wn.split=function(e,t,n){return n&&"number"!=typeof n&&ko(e,t,n)&&(t=n=i),(n=n===i?v:n>>>0)?(e=xs(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=di(t))&&sn(e)?_i(hn(e),0,n):e.split(t,n):[]},Wn.spread=function(e,t){if("function"!=typeof e)throw new Ne(o);return t=null==t?0:wn(gs(t),0),Jr((function(n){var r=n[t],i=_i(n,0,t);return r&&At(i,r),Ct(e,this,i)}))},Wn.tail=function(e){var t=null==e?0:e.length;return t?oi(e,1,t):[]},Wn.take=function(e,t,n){return e&&e.length?oi(e,0,(t=n||t===i?1:gs(t))<0?0:t):[]},Wn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,(t=r-(t=n||t===i?1:gs(t)))<0?0:t,r):[]},Wn.takeRightWhile=function(e,t){return e&&e.length?mi(e,co(t,3),!1,!0):[]},Wn.takeWhile=function(e,t){return e&&e.length?mi(e,co(t,3)):[]},Wn.tap=function(e,t){return t(e),e},Wn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Ne(o);return rs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Aa(e,t,{leading:r,maxWait:t,trailing:i})},Wn.thru=va,Wn.toArray=ms,Wn.toPairs=Hs,Wn.toPairsIn=Ws,Wn.toPath=function(e){return Ga(e)?Pt(e,Uo):ds(e)?[e]:Mi(zo(xs(e)))},Wn.toPlainObject=ws,Wn.transform=function(e,t,n){var r=Ga(e),i=r||Qa(e)||fs(e);if(t=co(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:rs(e)&&es(o)?Bn(Ge(e)):{}}return(i?jt:kr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Wn.unary=function(e){return Na(e,1)},Wn.union=ia,Wn.unionBy=oa,Wn.unionWith=aa,Wn.uniq=function(e){return e&&e.length?fi(e):[]},Wn.uniqBy=function(e,t){return e&&e.length?fi(e,co(t,2)):[]},Wn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?fi(e,i,t):[]},Wn.unset=function(e,t){return null==e||pi(e,t)},Wn.unzip=sa,Wn.unzipWith=la,Wn.update=function(e,t,n){return null==e?e:hi(e,t,wi(n))},Wn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:hi(e,t,wi(n),r)},Wn.values=Bs,Wn.valuesIn=function(e){return null==e?[]:Jt(e,Ds(e))},Wn.without=ua,Wn.words=el,Wn.wrap=function(e,t){return Ua(wi(t),e)},Wn.xor=ca,Wn.xorBy=da,Wn.xorWith=fa,Wn.zip=pa,Wn.zipObject=function(e,t){return yi(e||[],t||[],rr)},Wn.zipObjectDeep=function(e,t){return yi(e||[],t||[],ti)},Wn.zipWith=ha,Wn.entries=Hs,Wn.entriesIn=Ws,Wn.extend=_s,Wn.extendWith=Ss,cl(Wn,Wn),Wn.add=wl,Wn.attempt=tl,Wn.camelCase=$s,Wn.capitalize=Vs,Wn.ceil=xl,Wn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=bs(n))==n?n:0),t!==i&&(t=(t=bs(t))==t?t:0),ur(bs(e),t,n)},Wn.clone=function(e){return cr(e,4)},Wn.cloneDeep=function(e){return cr(e,5)},Wn.cloneDeepWith=function(e,t){return cr(e,5,t="function"==typeof t?t:i)},Wn.cloneWith=function(e,t){return cr(e,4,t="function"==typeof t?t:i)},Wn.conformsTo=function(e,t){return null==t||dr(e,t,As(t))},Wn.deburr=qs,Wn.defaultTo=function(e,t){return null==e||e!=e?t:e},Wn.divide=kl,Wn.endsWith=function(e,t,n){e=xs(e),t=di(t);var r=e.length,o=n=n===i?r:ur(gs(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Wn.eq=Ba,Wn.escape=function(e){return(e=xs(e))&&Q.test(e)?e.replace(X,on):e},Wn.escapeRegExp=function(e){return(e=xs(e))&&oe.test(e)?e.replace(ie,"\\$&"):e},Wn.every=function(e,t,n){var r=Ga(e)?Ot:vr;return n&&ko(e,t,n)&&(t=i),r(e,co(t,3))},Wn.find=ba,Wn.findIndex=qo,Wn.findKey=function(e,t){return zt(e,co(t,3),kr)},Wn.findLast=wa,Wn.findLastIndex=Go,Wn.findLastKey=function(e,t){return zt(e,co(t,3),_r)},Wn.floor=_l,Wn.forEach=xa,Wn.forEachRight=ka,Wn.forIn=function(e,t){return null==e?e:wr(e,co(t,3),Ds)},Wn.forInRight=function(e,t){return null==e?e:xr(e,co(t,3),Ds)},Wn.forOwn=function(e,t){return e&&kr(e,co(t,3))},Wn.forOwnRight=function(e,t){return e&&_r(e,co(t,3))},Wn.get=Os,Wn.gt=$a,Wn.gte=Va,Wn.has=function(e,t){return null!=e&&yo(e,t,Or)},Wn.hasIn=Ns,Wn.head=Xo,Wn.identity=al,Wn.includes=function(e,t,n,r){e=Xa(e)?e:Bs(e),n=n&&!r?gs(n):0;var i=e.length;return n<0&&(n=wn(i+n,0)),cs(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ht(e,t,n)>-1},Wn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:gs(n);return i<0&&(i=wn(r+i,0)),Ht(e,t,i)},Wn.inRange=function(e,t,n){return t=vs(t),n===i?(n=t,t=0):n=vs(n),function(e,t,n){return e>=xn(t,n)&&e<wn(t,n)}(e=bs(e),t,n)},Wn.invoke=Ps,Wn.isArguments=qa,Wn.isArray=Ga,Wn.isArrayBuffer=Ya,Wn.isArrayLike=Xa,Wn.isArrayLikeObject=Ka,Wn.isBoolean=function(e){return!0===e||!1===e||is(e)&&jr(e)==w},Wn.isBuffer=Qa,Wn.isDate=Ja,Wn.isElement=function(e){return is(e)&&1===e.nodeType&&!ss(e)},Wn.isEmpty=function(e){if(null==e)return!0;if(Xa(e)&&(Ga(e)||"string"==typeof e||"function"==typeof e.splice||Qa(e)||fs(e)||qa(e)))return!e.length;var t=go(e);if(t==C||t==N)return!e.size;if(Eo(e))return!Fr(e).length;for(var n in e)if(Re.call(e,n))return!1;return!0},Wn.isEqual=function(e,t){return Ar(e,t)},Wn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:i)?n(e,t):i;return r===i?Ar(e,t,i,n):!!r},Wn.isError=Za,Wn.isFinite=function(e){return"number"==typeof e&&qt(e)},Wn.isFunction=es,Wn.isInteger=ts,Wn.isLength=ns,Wn.isMap=os,Wn.isMatch=function(e,t){return e===t||Dr(e,t,po(t))},Wn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:i,Dr(e,t,po(t),n)},Wn.isNaN=function(e){return as(e)&&e!=+e},Wn.isNative=function(e){if(Co(e))throw new Se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Rr(e)},Wn.isNil=function(e){return null==e},Wn.isNull=function(e){return null===e},Wn.isNumber=as,Wn.isObject=rs,Wn.isObjectLike=is,Wn.isPlainObject=ss,Wn.isRegExp=ls,Wn.isSafeInteger=function(e){return ts(e)&&e>=-9007199254740991&&e<=h},Wn.isSet=us,Wn.isString=cs,Wn.isSymbol=ds,Wn.isTypedArray=fs,Wn.isUndefined=function(e){return e===i},Wn.isWeakMap=function(e){return is(e)&&go(e)==P},Wn.isWeakSet=function(e){return is(e)&&"[object WeakSet]"==jr(e)},Wn.join=function(e,t){return null==e?"":yn.call(e,t)},Wn.kebabCase=Gs,Wn.last=Zo,Wn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=gs(n))<0?wn(r+o,0):xn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Ut(e,Bt,o,!0)},Wn.lowerCase=Ys,Wn.lowerFirst=Xs,Wn.lt=ps,Wn.lte=hs,Wn.max=function(e){return e&&e.length?gr(e,al,Tr):i},Wn.maxBy=function(e,t){return e&&e.length?gr(e,co(t,2),Tr):i},Wn.mean=function(e){return $t(e,al)},Wn.meanBy=function(e,t){return $t(e,co(t,2))},Wn.min=function(e){return e&&e.length?gr(e,al,Ur):i},Wn.minBy=function(e,t){return e&&e.length?gr(e,co(t,2),Ur):i},Wn.stubArray=yl,Wn.stubFalse=bl,Wn.stubObject=function(){return{}},Wn.stubString=function(){return""},Wn.stubTrue=function(){return!0},Wn.multiply=Cl,Wn.nth=function(e,t){return e&&e.length?Vr(e,gs(t)):i},Wn.noConflict=function(){return pt._===this&&(pt._=He),this},Wn.noop=dl,Wn.now=Oa,Wn.pad=function(e,t,n){e=xs(e);var r=(t=gs(t))?pn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return qi(gt(i),n)+e+qi(mt(i),n)},Wn.padEnd=function(e,t,n){e=xs(e);var r=(t=gs(t))?pn(e):0;return t&&r<t?e+qi(t-r,n):e},Wn.padStart=function(e,t,n){e=xs(e);var r=(t=gs(t))?pn(e):0;return t&&r<t?qi(t-r,n)+e:e},Wn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),_n(xs(e).replace(ae,""),t||0)},Wn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ko(e,t,n)&&(t=n=i),n===i&&("boolean"==typeof t?(n=t,t=i):"boolean"==typeof e&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=vs(e),t===i?(t=e,e=0):t=vs(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=Sn();return xn(e+o*(t-e+ut("1e-"+((o+"").length-1))),t)}return Kr(e,t)},Wn.reduce=function(e,t,n){var r=Ga(e)?Dt:Gt,i=arguments.length<3;return r(e,co(t,4),n,i,hr)},Wn.reduceRight=function(e,t,n){var r=Ga(e)?Rt:Gt,i=arguments.length<3;return r(e,co(t,4),n,i,mr)},Wn.repeat=function(e,t,n){return t=(n?ko(e,t,n):t===i)?1:gs(t),Qr(xs(e),t)},Wn.replace=function(){var e=arguments,t=xs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Wn.result=function(e,t,n){var r=-1,o=(t=xi(t,e)).length;for(o||(o=1,e=i);++r<o;){var a=null==e?i:e[Uo(t[r])];a===i&&(r=o,a=n),e=es(a)?a.call(e):a}return e},Wn.round=El,Wn.runInContext=e,Wn.sample=function(e){return(Ga(e)?Zn:Zr)(e)},Wn.size=function(e){if(null==e)return 0;if(Xa(e))return cs(e)?pn(e):e.length;var t=go(e);return t==C||t==N?e.size:Fr(e).length},Wn.snakeCase=Ks,Wn.some=function(e,t,n){var r=Ga(e)?It:ai;return n&&ko(e,t,n)&&(t=i),r(e,co(t,3))},Wn.sortedIndex=function(e,t){return si(e,t)},Wn.sortedIndexBy=function(e,t,n){return li(e,t,co(n,2))},Wn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=si(e,t);if(r<n&&Ba(e[r],t))return r}return-1},Wn.sortedLastIndex=function(e,t){return si(e,t,!0)},Wn.sortedLastIndexBy=function(e,t,n){return li(e,t,co(n,2),!0)},Wn.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=si(e,t,!0)-1;if(Ba(e[n],t))return n}return-1},Wn.startCase=Qs,Wn.startsWith=function(e,t,n){return e=xs(e),n=null==n?0:ur(gs(n),0,e.length),t=di(t),e.slice(n,n+t.length)==t},Wn.subtract=jl,Wn.sum=function(e){return e&&e.length?Yt(e,al):0},Wn.sumBy=function(e,t){return e&&e.length?Yt(e,co(t,2)):0},Wn.template=function(e,t,n){var r=Wn.templateSettings;n&&ko(e,t,n)&&(t=i),e=xs(e),t=Ss({},t,r,eo);var o,a,s=Ss({},t.imports,r.imports,eo),l=As(s),u=Jt(s,l),c=0,d=t.interpolate||ke,f="__p += '",p=Te((t.escape||ke).source+"|"+d.source+"|"+(d===ee?he:ke).source+"|"+(t.evaluate||ke).source+"|$","g"),h="//# sourceURL="+(Re.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ot+"]")+"\n";e.replace(p,(function(t,n,r,i,s,l){return r||(r=i),f+=e.slice(c,l).replace(_e,an),n&&(o=!0,f+="' +\n__e("+n+") +\n'"),s&&(a=!0,f+="';\n"+s+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=l+t.length,t})),f+="';\n";var m=Re.call(t,"variable")&&t.variable;if(m){if(fe.test(m))throw new Se("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(a?f.replace(V,""):f).replace(q,"$1").replace(G,"$1;"),f="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var v=tl((function(){return Ce(l,h+"return "+f).apply(i,u)}));if(v.source=f,Za(v))throw v;return v},Wn.times=function(e,t){if((e=gs(e))<1||e>h)return[];var n=v,r=xn(e,v);t=co(t),e-=v;for(var i=Xt(r,t);++n<e;)t(n);return i},Wn.toFinite=vs,Wn.toInteger=gs,Wn.toLength=ys,Wn.toLower=function(e){return xs(e).toLowerCase()},Wn.toNumber=bs,Wn.toSafeInteger=function(e){return e?ur(gs(e),-9007199254740991,h):0===e?e:0},Wn.toString=xs,Wn.toUpper=function(e){return xs(e).toUpperCase()},Wn.trim=function(e,t,n){if((e=xs(e))&&(n||t===i))return Kt(e);if(!e||!(t=di(t)))return e;var r=hn(e),o=hn(t);return _i(r,en(r,o),tn(r,o)+1).join("")},Wn.trimEnd=function(e,t,n){if((e=xs(e))&&(n||t===i))return e.slice(0,mn(e)+1);if(!e||!(t=di(t)))return e;var r=hn(e);return _i(r,0,tn(r,hn(t))+1).join("")},Wn.trimStart=function(e,t,n){if((e=xs(e))&&(n||t===i))return e.replace(ae,"");if(!e||!(t=di(t)))return e;var r=hn(e);return _i(r,en(r,hn(t))).join("")},Wn.truncate=function(e,t){var n=30,r="...";if(rs(t)){var o="separator"in t?t.separator:o;n="length"in t?gs(t.length):n,r="omission"in t?di(t.omission):r}var a=(e=xs(e)).length;if(sn(e)){var s=hn(e);a=s.length}if(n>=a)return e;var l=n-pn(r);if(l<1)return r;var u=s?_i(s,0,l).join(""):e.slice(0,l);if(o===i)return u+r;if(s&&(l+=u.length-l),ls(o)){if(e.slice(l).search(o)){var c,d=u;for(o.global||(o=Te(o.source,xs(me.exec(o))+"g")),o.lastIndex=0;c=o.exec(d);)var f=c.index;u=u.slice(0,f===i?l:f)}}else if(e.indexOf(di(o),l)!=l){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+r},Wn.unescape=function(e){return(e=xs(e))&&K.test(e)?e.replace(Y,vn):e},Wn.uniqueId=function(e){var t=++Ie;return xs(e)+t},Wn.upperCase=Js,Wn.upperFirst=Zs,Wn.each=xa,Wn.eachRight=ka,Wn.first=Xo,cl(Wn,(Sl={},kr(Wn,(function(e,t){Re.call(Wn.prototype,t)||(Sl[t]=e)})),Sl),{chain:!1}),Wn.VERSION="4.17.21",jt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Wn[e].placeholder=Wn})),jt(["drop","take"],(function(e,t){qn.prototype[e]=function(n){n=n===i?1:wn(gs(n),0);var r=this.__filtered__&&!t?new qn(this):this.clone();return r.__filtered__?r.__takeCount__=xn(n,r.__takeCount__):r.__views__.push({size:xn(n,v),type:e+(r.__dir__<0?"Right":"")}),r},qn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),jt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;qn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:co(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),jt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");qn.prototype[e]=function(){return this[n](1).value()[0]}})),jt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");qn.prototype[e]=function(){return this.__filtered__?new qn(this):this[n](1)}})),qn.prototype.compact=function(){return this.filter(al)},qn.prototype.find=function(e){return this.filter(e).head()},qn.prototype.findLast=function(e){return this.reverse().find(e)},qn.prototype.invokeMap=Jr((function(e,t){return"function"==typeof e?new qn(this):this.map((function(n){return Lr(n,e,t)}))})),qn.prototype.reject=function(e){return this.filter(Fa(co(e)))},qn.prototype.slice=function(e,t){e=gs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new qn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=gs(t))<0?n.dropRight(-t):n.take(t-e)),n)},qn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},qn.prototype.toArray=function(){return this.take(v)},kr(qn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Wn[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);o&&(Wn.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,l=t instanceof qn,u=s[0],c=l||Ga(t),d=function(e){var t=o.apply(Wn,At([e],s));return r&&f?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(l=c=!1);var f=this.__chain__,p=!!this.__actions__.length,h=a&&!f,m=l&&!p;if(!a&&c){t=m?t:new qn(this);var v=e.apply(t,s);return v.__actions__.push({func:va,args:[d],thisArg:i}),new Vn(v,f)}return h&&m?e.apply(this,s):(v=this.thru(d),h?r?v.value()[0]:v.value():v)})})),jt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Me[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Wn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ga(i)?i:[],e)}return this[n]((function(n){return t.apply(Ga(n)?n:[],e)}))}})),kr(qn.prototype,(function(e,t){var n=Wn[t];if(n){var r=n.name+"";Re.call(Pn,r)||(Pn[r]=[]),Pn[r].push({name:t,func:n})}})),Pn[Wi(i,2).name]=[{name:"wrapper",func:i}],qn.prototype.clone=function(){var e=new qn(this.__wrapped__);return e.__actions__=Mi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Mi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Mi(this.__views__),e},qn.prototype.reverse=function(){if(this.__filtered__){var e=new qn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},qn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ga(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=xn(t,e+a);break;case"takeRight":e=wn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,u=r?s:a-1,c=this.__iteratees__,d=c.length,f=0,p=xn(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return vi(e,this.__actions__);var h=[];e:for(;l--&&f<p;){for(var m=-1,v=e[u+=t];++m<d;){var g=c[m],y=g.iteratee,b=g.type,w=y(v);if(2==b)v=w;else if(!w){if(1==b)continue e;break e}}h[f++]=v}return h},Wn.prototype.at=ga,Wn.prototype.chain=function(){return ma(this)},Wn.prototype.commit=function(){return new Vn(this.value(),this.__chain__)},Wn.prototype.next=function(){this.__values__===i&&(this.__values__=ms(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Wn.prototype.plant=function(e){for(var t,n=this;n instanceof $n;){var r=Wo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Wn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof qn){var t=e;return this.__actions__.length&&(t=new qn(this)),(t=t.reverse()).__actions__.push({func:va,args:[ra],thisArg:i}),new Vn(t,this.__chain__)}return this.thru(ra)},Wn.prototype.toJSON=Wn.prototype.valueOf=Wn.prototype.value=function(){return vi(this.__wrapped__,this.__actions__)},Wn.prototype.first=Wn.prototype.head,et&&(Wn.prototype[et]=function(){return this}),Wn}();pt._=gn,(r=function(){return gn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},7418:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var a,s,l=i(e),u=1;u<arguments.length;u++){for(var c in a=Object(arguments[u]))n.call(a,c)&&(l[c]=a[c]);if(t){s=t(a);for(var d=0;d<s.length;d++)r.call(a,s[d])&&(l[s[d]]=a[s[d]])}}return l}},4779:(e,t,n)=>{var r=n(6173);e.exports=p,e.exports.parse=o,e.exports.compile=function(e,t){return s(o(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=f;var i=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,a=0,s="",c=t&&t.delimiter||"/";null!=(n=i.exec(e));){var d=n[0],f=n[1],p=n.index;if(s+=e.slice(a,p),a=p+d.length,f)s+=f[1];else{var h=e[a],m=n[2],v=n[3],g=n[4],y=n[5],b=n[6],w=n[7];s&&(r.push(s),s="");var x=null!=m&&null!=h&&h!==m,k="+"===b||"*"===b,_="?"===b||"*"===b,S=n[2]||c,C=g||y;r.push({name:v||o++,prefix:m||"",delimiter:S,optional:_,repeat:k,partial:x,asterisk:!!w,pattern:C?u(C):w?".*":"[^"+l(S)+"]+?"})}}return a<e.length&&(s+=e.substr(a)),s&&r.push(s),r}function a(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function s(e,t){for(var n=new Array(e.length),i=0;i<e.length;i++)"object"==typeof e[i]&&(n[i]=new RegExp("^(?:"+e[i].pattern+")$",d(t)));return function(t,i){for(var o="",s=t||{},l=(i||{}).pretty?a:encodeURIComponent,u=0;u<e.length;u++){var c=e[u];if("string"!=typeof c){var d,f=s[c.name];if(null==f){if(c.optional){c.partial&&(o+=c.prefix);continue}throw new TypeError('Expected "'+c.name+'" to be defined')}if(r(f)){if(!c.repeat)throw new TypeError('Expected "'+c.name+'" to not repeat, but received `'+JSON.stringify(f)+"`");if(0===f.length){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to not be empty')}for(var p=0;p<f.length;p++){if(d=l(f[p]),!n[u].test(d))throw new TypeError('Expected all "'+c.name+'" to match "'+c.pattern+'", but received `'+JSON.stringify(d)+"`");o+=(0===p?c.prefix:c.delimiter)+d}}else{if(d=c.asterisk?encodeURI(f).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):l(f),!n[u].test(d))throw new TypeError('Expected "'+c.name+'" to match "'+c.pattern+'", but received "'+d+'"');o+=c.prefix+d}}else o+=c}return o}}function l(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function u(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function c(e,t){return e.keys=t,e}function d(e){return e&&e.sensitive?"":"i"}function f(e,t,n){r(t)||(n=t||n,t=[]);for(var i=(n=n||{}).strict,o=!1!==n.end,a="",s=0;s<e.length;s++){var u=e[s];if("string"==typeof u)a+=l(u);else{var f=l(u.prefix),p="(?:"+u.pattern+")";t.push(u),u.repeat&&(p+="(?:"+f+p+")*"),a+=p=u.optional?u.partial?f+"("+p+")?":"(?:"+f+"("+p+"))?":f+"("+p+")"}}var h=l(n.delimiter||"/"),m=a.slice(-h.length)===h;return i||(a=(m?a.slice(0,-h.length):a)+"(?:"+h+"(?=$))?"),a+=o?"$":i&&m?"":"(?="+h+"|$)",c(new RegExp("^"+a,d(n)),t)}function p(e,t,n){return r(t)||(n=t||n,t=[]),n=n||{},e instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return c(e,t)}(e,t):r(e)?function(e,t,n){for(var r=[],i=0;i<e.length;i++)r.push(p(e[i],t,n).source);return c(new RegExp("(?:"+r.join("|")+")",d(n)),t)}(e,t,n):function(e,t,n){return f(o(e,n),t,n)}(e,t,n)}},6173:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},2703:(e,t,n)=>{"use strict";var r=n(414);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},9656:(e,t,n)=>{"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function i(e){return(i="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})(e)}var o,a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});t.Rt=void 0;var s,l=n(7294),u="undefined"==typeof navigator||!0===n.g.PREVENT_CODEMIRROR_RENDER;u||(s=n(4631));var c=function(){function e(){}return e.equals=function(e,t){var n=this,r=Object.keys,o=i(e),a=i(t);return e&&t&&"object"===o&&o===a?r(e).length===r(t).length&&r(e).every((function(r){return n.equals(e[r],t[r])})):e===t},e}(),d=function(){function e(e,t){this.editor=e,this.props=t}return e.prototype.delegateCursor=function(e,t,n){var r=this.editor.getDoc();n&&this.editor.focus(),t?r.setCursor(e):r.setCursor(e,null,{scroll:!1})},e.prototype.delegateScroll=function(e){this.editor.scrollTo(e.x,e.y)},e.prototype.delegateSelection=function(e,t){this.editor.getDoc().setSelections(e),t&&this.editor.focus()},e.prototype.apply=function(e){e&&e.selection&&e.selection.ranges&&this.delegateSelection(e.selection.ranges,e.selection.focus||!1),e&&e.cursor&&this.delegateCursor(e.cursor,e.autoScroll||!1,this.editor.getOption("autofocus")||!1),e&&e.scroll&&this.delegateScroll(e.scroll)},e.prototype.applyNext=function(e,t,n){e&&e.selection&&e.selection.ranges&&t&&t.selection&&t.selection.ranges&&!c.equals(e.selection.ranges,t.selection.ranges)&&this.delegateSelection(t.selection.ranges,t.selection.focus||!1),e&&e.cursor&&t&&t.cursor&&!c.equals(e.cursor,t.cursor)&&this.delegateCursor(n.cursor||t.cursor,t.autoScroll||!1,t.autoCursor||!1),e&&e.scroll&&t&&t.scroll&&!c.equals(e.scroll,t.scroll)&&this.delegateScroll(t.scroll)},e.prototype.applyUserDefined=function(e,t){t&&t.cursor&&this.delegateCursor(t.cursor,e.autoScroll||!1,this.editor.getOption("autofocus")||!1)},e.prototype.wire=function(e){var t=this;Object.keys(e||{}).filter((function(e){return/^on/.test(e)})).forEach((function(e){switch(e){case"onBlur":t.editor.on("blur",(function(e,n){t.props.onBlur(t.editor,n)}));break;case"onContextMenu":t.editor.on("contextmenu",(function(e,n){t.props.onContextMenu(t.editor,n)}));break;case"onCopy":t.editor.on("copy",(function(e,n){t.props.onCopy(t.editor,n)}));break;case"onCursor":t.editor.on("cursorActivity",(function(e){t.props.onCursor(t.editor,t.editor.getDoc().getCursor())}));break;case"onCursorActivity":t.editor.on("cursorActivity",(function(e){t.props.onCursorActivity(t.editor)}));break;case"onCut":t.editor.on("cut",(function(e,n){t.props.onCut(t.editor,n)}));break;case"onDblClick":t.editor.on("dblclick",(function(e,n){t.props.onDblClick(t.editor,n)}));break;case"onDragEnter":t.editor.on("dragenter",(function(e,n){t.props.onDragEnter(t.editor,n)}));break;case"onDragLeave":t.editor.on("dragleave",(function(e,n){t.props.onDragLeave(t.editor,n)}));break;case"onDragOver":t.editor.on("dragover",(function(e,n){t.props.onDragOver(t.editor,n)}));break;case"onDragStart":t.editor.on("dragstart",(function(e,n){t.props.onDragStart(t.editor,n)}));break;case"onDrop":t.editor.on("drop",(function(e,n){t.props.onDrop(t.editor,n)}));break;case"onFocus":t.editor.on("focus",(function(e,n){t.props.onFocus(t.editor,n)}));break;case"onGutterClick":t.editor.on("gutterClick",(function(e,n,r,i){t.props.onGutterClick(t.editor,n,r,i)}));break;case"onInputRead":t.editor.on("inputRead",(function(e,n){t.props.onInputRead(t.editor,n)}));break;case"onKeyDown":t.editor.on("keydown",(function(e,n){t.props.onKeyDown(t.editor,n)}));break;case"onKeyHandled":t.editor.on("keyHandled",(function(e,n,r){t.props.onKeyHandled(t.editor,n,r)}));break;case"onKeyPress":t.editor.on("keypress",(function(e,n){t.props.onKeyPress(t.editor,n)}));break;case"onKeyUp":t.editor.on("keyup",(function(e,n){t.props.onKeyUp(t.editor,n)}));break;case"onMouseDown":t.editor.on("mousedown",(function(e,n){t.props.onMouseDown(t.editor,n)}));break;case"onPaste":t.editor.on("paste",(function(e,n){t.props.onPaste(t.editor,n)}));break;case"onRenderLine":t.editor.on("renderLine",(function(e,n,r){t.props.onRenderLine(t.editor,n,r)}));break;case"onScroll":t.editor.on("scroll",(function(e){t.props.onScroll(t.editor,t.editor.getScrollInfo())}));break;case"onSelection":t.editor.on("beforeSelectionChange",(function(e,n){t.props.onSelection(t.editor,n)}));break;case"onTouchStart":t.editor.on("touchstart",(function(e,n){t.props.onTouchStart(t.editor,n)}));break;case"onUpdate":t.editor.on("update",(function(e){t.props.onUpdate(t.editor)}));break;case"onViewportChange":t.editor.on("viewportChange",(function(e,n,r){t.props.onViewportChange(t.editor,n,r)}))}}))},e}();(function(e){function t(t){var n=e.call(this,t)||this;return u||(n.applied=!1,n.appliedNext=!1,n.appliedUserDefined=!1,n.deferred=null,n.emulating=!1,n.hydrated=!1,n.initCb=function(){n.props.editorDidConfigure&&n.props.editorDidConfigure(n.editor)},n.mounted=!1),n}a(t,e),t.prototype.hydrate=function(e){var t=this,n=e&&e.options?e.options:{},i=r({},s.defaults,this.editor.options,n);Object.keys(i).some((function(e){return t.editor.getOption(e)!==i[e]}))&&Object.keys(i).forEach((function(e){n.hasOwnProperty(e)&&t.editor.getOption(e)!==i[e]&&(t.editor.setOption(e,i[e]),t.mirror.setOption(e,i[e]))})),this.hydrated||(this.deferred?this.resolveChange(e.value):this.initChange(e.value||"")),this.hydrated=!0},t.prototype.initChange=function(e){this.emulating=!0;var t=this.editor.getDoc(),n=t.lastLine(),r=t.getLine(t.lastLine()).length;t.replaceRange(e||"",{line:0,ch:0},{line:n,ch:r}),this.mirror.setValue(e),t.clearHistory(),this.mirror.clearHistory(),this.emulating=!1},t.prototype.resolveChange=function(e){this.emulating=!0;var t=this.editor.getDoc();if("undo"===this.deferred.origin?t.undo():"redo"===this.deferred.origin?t.redo():t.replaceRange(this.deferred.text,this.deferred.from,this.deferred.to,this.deferred.origin),e&&e!==t.getValue()){var n=t.getCursor();t.setValue(e),t.setCursor(n)}this.emulating=!1,this.deferred=null},t.prototype.mirrorChange=function(e){var t=this.editor.getDoc();return"undo"===e.origin?(t.setHistory(this.mirror.getHistory()),this.mirror.undo()):"redo"===e.origin?(t.setHistory(this.mirror.getHistory()),this.mirror.redo()):this.mirror.replaceRange(e.text,e.from,e.to,e.origin),this.mirror.getValue()},t.prototype.componentDidMount=function(){var e=this;u||(this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&s.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=s(this.ref,this.props.options),this.shared=new d(this.editor,this.props),this.mirror=s((function(){}),this.props.options),this.editor.on("electricInput",(function(){e.mirror.setHistory(e.editor.getDoc().getHistory())})),this.editor.on("cursorActivity",(function(){e.mirror.setCursor(e.editor.getDoc().getCursor())})),this.editor.on("beforeChange",(function(t,n){if(!e.emulating){n.cancel(),e.deferred=n;var r=e.mirrorChange(e.deferred);e.props.onBeforeChange&&e.props.onBeforeChange(e.editor,e.deferred,r)}})),this.editor.on("change",(function(t,n){e.mounted&&e.props.onChange&&e.props.onChange(e.editor,n,e.editor.getValue())})),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getOption("autofocus")&&this.editor.focus(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},t.prototype.componentDidUpdate=function(e){if(!u){var t={cursor:null};this.props.value!==e.value&&(this.hydrated=!1),this.props.autoCursor||void 0===this.props.autoCursor||(t.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.appliedNext||(this.shared.applyNext(e,this.props,t),this.appliedNext=!0),this.shared.applyUserDefined(e,t),this.appliedUserDefined=!0}},t.prototype.componentWillUnmount=function(){u||this.props.editorWillUnmount&&this.props.editorWillUnmount(s)},t.prototype.shouldComponentUpdate=function(e,t){return!u},t.prototype.render=function(){var e=this;if(u)return null;var t=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return l.createElement("div",{className:t,ref:function(t){return e.ref=t}})}})(l.Component);var f=function(e){function t(t){var n=e.call(this,t)||this;return u||(n.applied=!1,n.appliedUserDefined=!1,n.continueChange=!1,n.detached=!1,n.hydrated=!1,n.initCb=function(){n.props.editorDidConfigure&&n.props.editorDidConfigure(n.editor)},n.mounted=!1,n.onBeforeChangeCb=function(){n.continueChange=!0}),n}return a(t,e),t.prototype.hydrate=function(e){var t=this,n=e&&e.options?e.options:{},i=r({},s.defaults,this.editor.options,n);if(Object.keys(i).some((function(e){return t.editor.getOption(e)!==i[e]}))&&Object.keys(i).forEach((function(e){n.hasOwnProperty(e)&&t.editor.getOption(e)!==i[e]&&t.editor.setOption(e,i[e])})),!this.hydrated){var o=this.editor.getDoc(),a=o.lastLine(),l=o.getLine(o.lastLine()).length;o.replaceRange(e.value||"",{line:0,ch:0},{line:a,ch:l})}this.hydrated=!0},t.prototype.componentDidMount=function(){var e=this;u||(this.detached=!0===this.props.detach,this.props.defineMode&&this.props.defineMode.name&&this.props.defineMode.fn&&s.defineMode(this.props.defineMode.name,this.props.defineMode.fn),this.editor=s(this.ref,this.props.options),this.shared=new d(this.editor,this.props),this.editor.on("beforeChange",(function(t,n){e.props.onBeforeChange&&e.props.onBeforeChange(e.editor,n,e.editor.getValue(),e.onBeforeChangeCb)})),this.editor.on("change",(function(t,n){e.mounted&&e.props.onChange&&(e.props.onBeforeChange?e.continueChange&&e.props.onChange(e.editor,n,e.editor.getValue()):e.props.onChange(e.editor,n,e.editor.getValue()))})),this.hydrate(this.props),this.shared.apply(this.props),this.applied=!0,this.mounted=!0,this.shared.wire(this.props),this.editor.getDoc().clearHistory(),this.props.editorDidMount&&this.props.editorDidMount(this.editor,this.editor.getValue(),this.initCb))},t.prototype.componentDidUpdate=function(e){if(this.detached&&!1===this.props.detach&&(this.detached=!1,e.editorDidAttach&&e.editorDidAttach(this.editor)),this.detached||!0!==this.props.detach||(this.detached=!0,e.editorDidDetach&&e.editorDidDetach(this.editor)),!u&&!this.detached){var t={cursor:null};this.props.value!==e.value&&(this.hydrated=!1,this.applied=!1,this.appliedUserDefined=!1),e.autoCursor||void 0===e.autoCursor||(t.cursor=this.editor.getDoc().getCursor()),this.hydrate(this.props),this.applied||(this.shared.apply(e),this.applied=!0),this.appliedUserDefined||(this.shared.applyUserDefined(e,t),this.appliedUserDefined=!0)}},t.prototype.componentWillUnmount=function(){u||this.props.editorWillUnmount&&this.props.editorWillUnmount(s)},t.prototype.shouldComponentUpdate=function(e,t){var n=!0;return u&&(n=!1),this.detached&&e.detach&&(n=!1),n},t.prototype.render=function(){var e=this;if(u)return null;var t=this.props.className?"react-codemirror2 "+this.props.className:"react-codemirror2";return l.createElement("div",{className:t,ref:function(t){return e.ref=t}})},t}(l.Component);t.Rt=f},4448:(e,t,n)=>{"use strict";var r=n(7294),i=n(7418),o=n(3840);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(a(227));var s=new Set,l={};function u(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(l[e]=t,e=0;e<t.length;e++)s.add(t[e])}var d=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p=Object.prototype.hasOwnProperty,h={},m={};function v(e,t,n,r,i,o,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new v(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];g[t]=new v(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new v(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){g[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new v(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new v(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new v(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)}));var y=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}function w(e,t,n,r){var i=g.hasOwnProperty(t)?g[t]:null;(null!==i?0===i.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!p.call(m,e)||!p.call(h,e)&&(f.test(e)?m[e]=!0:(h[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(y,b);g[t]=new v(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(y,b);g[t]=new v(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(y,b);g[t]=new v(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){g[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)})),g.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){g[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)}));var x=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k=60103,_=60106,S=60107,C=60108,E=60114,j=60109,T=60110,O=60112,N=60113,M=60120,L=60115,P=60116,A=60121,D=60128,R=60129,I=60130,F=60131;if("function"==typeof Symbol&&Symbol.for){var z=Symbol.for;k=z("react.element"),_=z("react.portal"),S=z("react.fragment"),C=z("react.strict_mode"),E=z("react.profiler"),j=z("react.provider"),T=z("react.context"),O=z("react.forward_ref"),N=z("react.suspense"),M=z("react.suspense_list"),L=z("react.memo"),P=z("react.lazy"),A=z("react.block"),z("react.scope"),D=z("react.opaque.id"),R=z("react.debug_trace_mode"),I=z("react.offscreen"),F=z("react.legacy_hidden")}var U,H="function"==typeof Symbol&&Symbol.iterator;function W(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=H&&e[H]||e["@@iterator"])?e:null}function B(e){if(void 0===U)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);U=t&&t[1]||""}return"\n"+U+e}var $=!1;function V(e,t){if(!e||$)return"";$=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(e){if(e&&r&&"string"==typeof e.stack){for(var i=e.stack.split("\n"),o=r.stack.split("\n"),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(1!==a||1!==s)do{if(a--,0>--s||i[a]!==o[s])return"\n"+i[a].replace(" at new "," at ")}while(1<=a&&0<=s);break}}}finally{$=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?B(e):""}function q(e){switch(e.tag){case 5:return B(e.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return e=V(e.type,!1);case 11:return e=V(e.type.render,!1);case 22:return e=V(e.type._render,!1);case 1:return e=V(e.type,!0);default:return""}}function G(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case S:return"Fragment";case _:return"Portal";case E:return"Profiler";case C:return"StrictMode";case N:return"Suspense";case M:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case T:return(e.displayName||"Context")+".Consumer";case j:return(e._context.displayName||"Context")+".Provider";case O:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case L:return G(e.type);case A:return G(e._render);case P:t=e._payload,e=e._init;try{return G(e(t))}catch(e){}}return null}function Y(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function X(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function K(e){e._valueTracker||(e._valueTracker=function(e){var t=X(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=X(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function J(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Z(e,t){var n=t.checked;return i({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ee(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=Y(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function te(e,t){null!=(t=t.checked)&&w(e,"checked",t,!1)}function ne(e,t){te(e,t);var n=Y(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ie(e,t.type,n):t.hasOwnProperty("defaultValue")&&ie(e,t.type,Y(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function re(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ie(e,t,n){"number"===t&&J(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function oe(e,t){return e=i({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function ae(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Y(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function se(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(a(91));return i({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function le(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(a(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:Y(n)}}function ue(e,t){var n=Y(t.value),r=Y(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ce(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var de="http://www.w3.org/1999/xhtml",fe="http://www.w3.org/2000/svg";function pe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function he(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?pe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var me,ve,ge=(ve=function(e,t){if(e.namespaceURI!==fe||"innerHTML"in e)e.innerHTML=t;else{for((me=me||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=me.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ve(e,t)}))}:ve);function ye(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var be={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},we=["Webkit","ms","Moz","O"];function xe(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||be.hasOwnProperty(e)&&be[e]?(""+t).trim():t+"px"}function ke(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=xe(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(be).forEach((function(e){we.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),be[t]=be[e]}))}));var _e=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Se(e,t){if(t){if(_e[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(a(62))}}function Ce(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Ee(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var je=null,Te=null,Oe=null;function Ne(e){if(e=ei(e)){if("function"!=typeof je)throw Error(a(280));var t=e.stateNode;t&&(t=ni(t),je(e.stateNode,e.type,t))}}function Me(e){Te?Oe?Oe.push(e):Oe=[e]:Te=e}function Le(){if(Te){var e=Te,t=Oe;if(Oe=Te=null,Ne(e),t)for(e=0;e<t.length;e++)Ne(t[e])}}function Pe(e,t){return e(t)}function Ae(e,t,n,r,i){return e(t,n,r,i)}function De(){}var Re=Pe,Ie=!1,Fe=!1;function ze(){null===Te&&null===Oe||(De(),Le())}function Ue(e,t){var n=e.stateNode;if(null===n)return null;var r=ni(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(a(231,t,typeof n));return n}var He=!1;if(d)try{var We={};Object.defineProperty(We,"passive",{get:function(){He=!0}}),window.addEventListener("test",We,We),window.removeEventListener("test",We,We)}catch(ve){He=!1}function Be(e,t,n,r,i,o,a,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(e){this.onError(e)}}var $e=!1,Ve=null,qe=!1,Ge=null,Ye={onError:function(e){$e=!0,Ve=e}};function Xe(e,t,n,r,i,o,a,s,l){$e=!1,Ve=null,Be.apply(Ye,arguments)}function Ke(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Qe(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Je(e){if(Ke(e)!==e)throw Error(a(188))}function Ze(e){if(!(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ke(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return Je(i),e;if(o===r)return Je(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function et(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var tt,nt,rt,it,ot=!1,at=[],st=null,lt=null,ut=null,ct=new Map,dt=new Map,ft=[],pt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ht(e,t,n,r,i){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:i,targetContainers:[r]}}function mt(e,t){switch(e){case"focusin":case"focusout":st=null;break;case"dragenter":case"dragleave":lt=null;break;case"mouseover":case"mouseout":ut=null;break;case"pointerover":case"pointerout":ct.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":dt.delete(t.pointerId)}}function vt(e,t,n,r,i,o){return null===e||e.nativeEvent!==o?(e=ht(t,n,r,i,o),null!==t&&(null!==(t=ei(t))&&nt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function gt(e){var t=Zr(e.target);if(null!==t){var n=Ke(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Qe(n)))return e.blockedOn=t,void it(e.lanePriority,(function(){o.unstable_runWithPriority(e.priority,(function(){rt(n)}))}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function yt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Zt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ei(n))&&nt(t),e.blockedOn=n,!1;t.shift()}return!0}function bt(e,t,n){yt(e)&&n.delete(t)}function wt(){for(ot=!1;0<at.length;){var e=at[0];if(null!==e.blockedOn){null!==(e=ei(e.blockedOn))&&tt(e);break}for(var t=e.targetContainers;0<t.length;){var n=Zt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&at.shift()}null!==st&&yt(st)&&(st=null),null!==lt&&yt(lt)&&(lt=null),null!==ut&&yt(ut)&&(ut=null),ct.forEach(bt),dt.forEach(bt)}function xt(e,t){e.blockedOn===t&&(e.blockedOn=null,ot||(ot=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,wt)))}function kt(e){function t(t){return xt(t,e)}if(0<at.length){xt(at[0],e);for(var n=1;n<at.length;n++){var r=at[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==st&&xt(st,e),null!==lt&&xt(lt,e),null!==ut&&xt(ut,e),ct.forEach(t),dt.forEach(t),n=0;n<ft.length;n++)(r=ft[n]).blockedOn===e&&(r.blockedOn=null);for(;0<ft.length&&null===(n=ft[0]).blockedOn;)gt(n),null===n.blockedOn&&ft.shift()}function _t(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var St={animationend:_t("Animation","AnimationEnd"),animationiteration:_t("Animation","AnimationIteration"),animationstart:_t("Animation","AnimationStart"),transitionend:_t("Transition","TransitionEnd")},Ct={},Et={};function jt(e){if(Ct[e])return Ct[e];if(!St[e])return e;var t,n=St[e];for(t in n)if(n.hasOwnProperty(t)&&t in Et)return Ct[e]=n[t];return e}d&&(Et=document.createElement("div").style,"AnimationEvent"in window||(delete St.animationend.animation,delete St.animationiteration.animation,delete St.animationstart.animation),"TransitionEvent"in window||delete St.transitionend.transition);var Tt=jt("animationend"),Ot=jt("animationiteration"),Nt=jt("animationstart"),Mt=jt("transitionend"),Lt=new Map,Pt=new Map,At=["abort","abort",Tt,"animationEnd",Ot,"animationIteration",Nt,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Mt,"transitionEnd","waiting","waiting"];function Dt(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];i="on"+(i[0].toUpperCase()+i.slice(1)),Pt.set(r,t),Lt.set(r,i),u(i,[r])}}(0,o.unstable_now)();var Rt=8;function It(e){if(0!=(1&e))return Rt=15,1;if(0!=(2&e))return Rt=14,2;if(0!=(4&e))return Rt=13,4;var t=24&e;return 0!==t?(Rt=12,t):0!=(32&e)?(Rt=11,32):0!==(t=192&e)?(Rt=10,t):0!=(256&e)?(Rt=9,256):0!==(t=3584&e)?(Rt=8,t):0!=(4096&e)?(Rt=7,4096):0!==(t=4186112&e)?(Rt=6,t):0!==(t=62914560&e)?(Rt=5,t):67108864&e?(Rt=4,67108864):0!=(134217728&e)?(Rt=3,134217728):0!==(t=805306368&e)?(Rt=2,t):0!=(1073741824&e)?(Rt=1,1073741824):(Rt=8,e)}function Ft(e,t){var n=e.pendingLanes;if(0===n)return Rt=0;var r=0,i=0,o=e.expiredLanes,a=e.suspendedLanes,s=e.pingedLanes;if(0!==o)r=o,i=Rt=15;else if(0!==(o=134217727&n)){var l=o&~a;0!==l?(r=It(l),i=Rt):0!==(s&=o)&&(r=It(s),i=Rt)}else 0!==(o=n&~a)?(r=It(o),i=Rt):0!==s&&(r=It(s),i=Rt);if(0===r)return 0;if(r=n&((0>(r=31-$t(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0==(t&a)){if(It(t),i<=Rt)return t;Rt=i}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-$t(t)),r|=e[n],t&=~i;return r}function zt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function Ut(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=Ht(24&~t))?Ut(10,t):e;case 10:return 0===(e=Ht(192&~t))?Ut(8,t):e;case 8:return 0===(e=Ht(3584&~t))&&(0===(e=Ht(4186112&~t))&&(e=512)),e;case 2:return 0===(t=Ht(805306368&~t))&&(t=268435456),t}throw Error(a(358,e))}function Ht(e){return e&-e}function Wt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Bt(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-$t(t)]=n}var $t=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Vt(e)/qt|0)|0},Vt=Math.log,qt=Math.LN2;var Gt=o.unstable_UserBlockingPriority,Yt=o.unstable_runWithPriority,Xt=!0;function Kt(e,t,n,r){Ie||De();var i=Jt,o=Ie;Ie=!0;try{Ae(i,e,t,n,r)}finally{(Ie=o)||ze()}}function Qt(e,t,n,r){Yt(Gt,Jt.bind(null,e,t,n,r))}function Jt(e,t,n,r){var i;if(Xt)if((i=0==(4&t))&&0<at.length&&-1<pt.indexOf(e))e=ht(null,e,t,n,r),at.push(e);else{var o=Zt(e,t,n,r);if(null===o)i&&mt(e,r);else{if(i){if(-1<pt.indexOf(e))return e=ht(o,e,t,n,r),void at.push(e);if(function(e,t,n,r,i){switch(t){case"focusin":return st=vt(st,e,t,n,r,i),!0;case"dragenter":return lt=vt(lt,e,t,n,r,i),!0;case"mouseover":return ut=vt(ut,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return ct.set(o,vt(ct.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,dt.set(o,vt(dt.get(o)||null,e,t,n,r,i)),!0}return!1}(o,e,t,n,r))return;mt(e,r)}Lr(e,t,r,null,n)}}}function Zt(e,t,n,r){var i=Ee(r);if(null!==(i=Zr(i))){var o=Ke(i);if(null===o)i=null;else{var a=o.tag;if(13===a){if(null!==(i=Qe(o)))return i;i=null}else if(3===a){if(o.stateNode.hydrate)return 3===o.tag?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return Lr(e,t,r,i,n),null}var en=null,tn=null,nn=null;function rn(){if(nn)return nn;var e,t,n=tn,r=n.length,i="value"in en?en.value:en.textContent,o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===i[o-t];t++);return nn=i.slice(e,1<t?1-t:void 0)}function on(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function an(){return!0}function sn(){return!1}function ln(e){function t(t,n,r,i,o){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(i):i[a]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?an:sn,this.isPropagationStopped=sn,this}return i(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=an)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=an)},persist:function(){},isPersistent:an}),t}var un,cn,dn,fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pn=ln(fn),hn=i({},fn,{view:0,detail:0}),mn=ln(hn),vn=i({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==dn&&(dn&&"mousemove"===e.type?(un=e.screenX-dn.screenX,cn=e.screenY-dn.screenY):cn=un=0,dn=e),un)},movementY:function(e){return"movementY"in e?e.movementY:cn}}),gn=ln(vn),yn=ln(i({},vn,{dataTransfer:0})),bn=ln(i({},hn,{relatedTarget:0})),wn=ln(i({},fn,{animationName:0,elapsedTime:0,pseudoElement:0})),xn=ln(i({},fn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),kn=ln(i({},fn,{data:0})),_n={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Cn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function En(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Cn[e])&&!!t[e]}function jn(){return En}var Tn=ln(i({},hn,{key:function(e){if(e.key){var t=_n[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=on(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Sn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jn,charCode:function(e){return"keypress"===e.type?on(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?on(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),On=ln(i({},vn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Nn=ln(i({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jn})),Mn=ln(i({},fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Ln=ln(i({},vn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Pn=[9,13,27,32],An=d&&"CompositionEvent"in window,Dn=null;d&&"documentMode"in document&&(Dn=document.documentMode);var Rn=d&&"TextEvent"in window&&!Dn,In=d&&(!An||Dn&&8<Dn&&11>=Dn),Fn=String.fromCharCode(32),zn=!1;function Un(e,t){switch(e){case"keyup":return-1!==Pn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Wn=!1;var Bn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Bn[e.type]:"textarea"===t}function Vn(e,t,n,r){Me(r),0<(t=Ar(t,"onChange")).length&&(n=new pn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var qn=null,Gn=null;function Yn(e){Er(e,0)}function Xn(e){if(Q(ti(e)))return e}function Kn(e,t){if("change"===e)return t}var Qn=!1;if(d){var Jn;if(d){var Zn="oninput"in document;if(!Zn){var er=document.createElement("div");er.setAttribute("oninput","return;"),Zn="function"==typeof er.oninput}Jn=Zn}else Jn=!1;Qn=Jn&&(!document.documentMode||9<document.documentMode)}function tr(){qn&&(qn.detachEvent("onpropertychange",nr),Gn=qn=null)}function nr(e){if("value"===e.propertyName&&Xn(Gn)){var t=[];if(Vn(t,Gn,e,Ee(e)),e=Yn,Ie)e(t);else{Ie=!0;try{Pe(e,t)}finally{Ie=!1,ze()}}}}function rr(e,t,n){"focusin"===e?(tr(),Gn=n,(qn=t).attachEvent("onpropertychange",nr)):"focusout"===e&&tr()}function ir(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Xn(Gn)}function or(e,t){if("click"===e)return Xn(t)}function ar(e,t){if("input"===e||"change"===e)return Xn(t)}var sr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},lr=Object.prototype.hasOwnProperty;function ur(e,t){if(sr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!lr.call(t,n[r])||!sr(e[n[r]],t[n[r]]))return!1;return!0}function cr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dr(e,t){var n,r=cr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=cr(r)}}function fr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?fr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function pr(){for(var e=window,t=J();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=J((e=t.contentWindow).document)}return t}function hr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var mr=d&&"documentMode"in document&&11>=document.documentMode,vr=null,gr=null,yr=null,br=!1;function wr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;br||null==vr||vr!==J(r)||("selectionStart"in(r=vr)&&hr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},yr&&ur(yr,r)||(yr=r,0<(r=Ar(gr,"onSelect")).length&&(t=new pn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=vr)))}Dt("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Dt("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Dt(At,2);for(var xr="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),kr=0;kr<xr.length;kr++)Pt.set(xr[kr],0);c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _r="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Sr=new Set("cancel close invalid load scroll toggle".split(" ").concat(_r));function Cr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,o,s,l,u){if(Xe.apply(this,arguments),$e){if(!$e)throw Error(a(198));var c=Ve;$e=!1,Ve=null,qe||(qe=!0,Ge=c)}}(r,t,void 0,e),e.currentTarget=null}function Er(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&i.isPropagationStopped())break e;Cr(i,s,u),o=l}else for(a=0;a<r.length;a++){if(l=(s=r[a]).instance,u=s.currentTarget,s=s.listener,l!==o&&i.isPropagationStopped())break e;Cr(i,s,u),o=l}}}if(qe)throw e=Ge,qe=!1,Ge=null,e}function jr(e,t){var n=ri(t),r=e+"__bubble";n.has(r)||(Mr(t,e,2,!1),n.add(r))}var Tr="_reactListening"+Math.random().toString(36).slice(2);function Or(e){e[Tr]||(e[Tr]=!0,s.forEach((function(t){Sr.has(t)||Nr(t,!1,e,null),Nr(t,!0,e,null)})))}function Nr(e,t,n,r){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,o=n;if("selectionchange"===e&&9!==n.nodeType&&(o=n.ownerDocument),null!==r&&!t&&Sr.has(e)){if("scroll"!==e)return;i|=2,o=r}var a=ri(o),s=e+"__"+(t?"capture":"bubble");a.has(s)||(t&&(i|=4),Mr(o,e,i,t),a.add(s))}function Mr(e,t,n,r){var i=Pt.get(t);switch(void 0===i?2:i){case 0:i=Kt;break;case 1:i=Qt;break;default:i=Jt}n=i.bind(null,t,n,e),i=void 0,!He||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Lr(e,t,n,r,i){var o=r;if(0==(1&t)&&0==(2&t)&&null!==r)e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===i||8===s.nodeType&&s.parentNode===i)break;if(4===a)for(a=r.return;null!==a;){var l=a.tag;if((3===l||4===l)&&((l=a.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;a=a.return}for(;null!==s;){if(null===(a=Zr(s)))return;if(5===(l=a.tag)||6===l){r=o=a;continue e}s=s.parentNode}}r=r.return}!function(e,t,n){if(Fe)return e(t,n);Fe=!0;try{Re(e,t,n)}finally{Fe=!1,ze()}}((function(){var r=o,i=Ee(n),a=[];e:{var s=Lt.get(e);if(void 0!==s){var l=pn,u=e;switch(e){case"keypress":if(0===on(n))break e;case"keydown":case"keyup":l=Tn;break;case"focusin":u="focus",l=bn;break;case"focusout":u="blur",l=bn;break;case"beforeblur":case"afterblur":l=bn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=gn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=yn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Nn;break;case Tt:case Ot:case Nt:l=wn;break;case Mt:l=Mn;break;case"scroll":l=mn;break;case"wheel":l=Ln;break;case"copy":case"cut":case"paste":l=xn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=On}var c=0!=(4&t),d=!c&&"scroll"===e,f=c?null!==s?s+"Capture":null:s;c=[];for(var p,h=r;null!==h;){var m=(p=h).stateNode;if(5===p.tag&&null!==m&&(p=m,null!==f&&(null!=(m=Ue(h,f))&&c.push(Pr(h,m,p)))),d)break;h=h.return}0<c.length&&(s=new l(s,u,null,n,i),a.push({event:s,listeners:c}))}}if(0==(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||0!=(16&t)||!(u=n.relatedTarget||n.fromElement)||!Zr(u)&&!u[Qr])&&(l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(u=(u=n.relatedTarget||n.toElement)?Zr(u):null)&&(u!==(d=Ke(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(l=null,u=r),l!==u)){if(c=gn,m="onMouseLeave",f="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(c=On,m="onPointerLeave",f="onPointerEnter",h="pointer"),d=null==l?s:ti(l),p=null==u?s:ti(u),(s=new c(m,h+"leave",l,n,i)).target=d,s.relatedTarget=p,m=null,Zr(i)===r&&((c=new c(f,h+"enter",u,n,i)).target=p,c.relatedTarget=d,m=c),d=m,l&&u)e:{for(f=u,h=0,p=c=l;p;p=Dr(p))h++;for(p=0,m=f;m;m=Dr(m))p++;for(;0<h-p;)c=Dr(c),h--;for(;0<p-h;)f=Dr(f),p--;for(;h--;){if(c===f||null!==f&&c===f.alternate)break e;c=Dr(c),f=Dr(f)}c=null}else c=null;null!==l&&Rr(a,s,l,c,!1),null!==u&&null!==d&&Rr(a,d,u,c,!0)}if("select"===(l=(s=r?ti(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var v=Kn;else if($n(s))if(Qn)v=ar;else{v=ir;var g=rr}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(v=or);switch(v&&(v=v(e,r))?Vn(a,v,n,i):(g&&g(e,s,r),"focusout"===e&&(g=s._wrapperState)&&g.controlled&&"number"===s.type&&ie(s,"number",s.value)),g=r?ti(r):window,e){case"focusin":($n(g)||"true"===g.contentEditable)&&(vr=g,gr=r,yr=null);break;case"focusout":yr=gr=vr=null;break;case"mousedown":br=!0;break;case"contextmenu":case"mouseup":case"dragend":br=!1,wr(a,n,i);break;case"selectionchange":if(mr)break;case"keydown":case"keyup":wr(a,n,i)}var y;if(An)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Wn?Un(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(In&&"ko"!==n.locale&&(Wn||"onCompositionStart"!==b?"onCompositionEnd"===b&&Wn&&(y=rn()):(tn="value"in(en=i)?en.value:en.textContent,Wn=!0)),0<(g=Ar(r,b)).length&&(b=new kn(b,e,null,n,i),a.push({event:b,listeners:g}),y?b.data=y:null!==(y=Hn(n))&&(b.data=y))),(y=Rn?function(e,t){switch(e){case"compositionend":return Hn(t);case"keypress":return 32!==t.which?null:(zn=!0,Fn);case"textInput":return(e=t.data)===Fn&&zn?null:e;default:return null}}(e,n):function(e,t){if(Wn)return"compositionend"===e||!An&&Un(e,t)?(e=rn(),nn=tn=en=null,Wn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return In&&"ko"!==t.locale?null:t.data;default:return null}}(e,n))&&(0<(r=Ar(r,"onBeforeInput")).length&&(i=new kn("onBeforeInput","beforeinput",null,n,i),a.push({event:i,listeners:r}),i.data=y))}Er(a,t)}))}function Pr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ar(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,o=i.stateNode;5===i.tag&&null!==o&&(i=o,null!=(o=Ue(e,n))&&r.unshift(Pr(e,o,i)),null!=(o=Ue(e,t))&&r.push(Pr(e,o,i))),e=e.return}return r}function Dr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Rr(e,t,n,r,i){for(var o=t._reactName,a=[];null!==n&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==u&&(s=u,i?null!=(l=Ue(n,o))&&a.unshift(Pr(n,l,s)):i||null!=(l=Ue(n,o))&&a.push(Pr(n,l,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}function Ir(){}var Fr=null,zr=null;function Ur(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Hr(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Wr="function"==typeof setTimeout?setTimeout:void 0,Br="function"==typeof clearTimeout?clearTimeout:void 0;function $r(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function Vr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function qr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Gr=0;var Yr=Math.random().toString(36).slice(2),Xr="__reactFiber$"+Yr,Kr="__reactProps$"+Yr,Qr="__reactContainer$"+Yr,Jr="__reactEvents$"+Yr;function Zr(e){var t=e[Xr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Qr]||n[Xr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=qr(e);null!==e;){if(n=e[Xr])return n;e=qr(e)}return t}n=(e=n).parentNode}return null}function ei(e){return!(e=e[Xr]||e[Qr])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function ti(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function ni(e){return e[Kr]||null}function ri(e){var t=e[Jr];return void 0===t&&(t=e[Jr]=new Set),t}var ii=[],oi=-1;function ai(e){return{current:e}}function si(e){0>oi||(e.current=ii[oi],ii[oi]=null,oi--)}function li(e,t){oi++,ii[oi]=e.current,e.current=t}var ui={},ci=ai(ui),di=ai(!1),fi=ui;function pi(e,t){var n=e.type.contextTypes;if(!n)return ui;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function hi(e){return null!=(e=e.childContextTypes)}function mi(){si(di),si(ci)}function vi(e,t,n){if(ci.current!==ui)throw Error(a(168));li(ci,t),li(di,n)}function gi(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in e))throw Error(a(108,G(t)||"Unknown",o));return i({},n,r)}function yi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ui,fi=ci.current,li(ci,e),li(di,di.current),!0}function bi(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=gi(e,t,fi),r.__reactInternalMemoizedMergedChildContext=e,si(di),si(ci),li(ci,e)):si(di),li(di,n)}var wi=null,xi=null,ki=o.unstable_runWithPriority,_i=o.unstable_scheduleCallback,Si=o.unstable_cancelCallback,Ci=o.unstable_shouldYield,Ei=o.unstable_requestPaint,ji=o.unstable_now,Ti=o.unstable_getCurrentPriorityLevel,Oi=o.unstable_ImmediatePriority,Ni=o.unstable_UserBlockingPriority,Mi=o.unstable_NormalPriority,Li=o.unstable_LowPriority,Pi=o.unstable_IdlePriority,Ai={},Di=void 0!==Ei?Ei:function(){},Ri=null,Ii=null,Fi=!1,zi=ji(),Ui=1e4>zi?ji:function(){return ji()-zi};function Hi(){switch(Ti()){case Oi:return 99;case Ni:return 98;case Mi:return 97;case Li:return 96;case Pi:return 95;default:throw Error(a(332))}}function Wi(e){switch(e){case 99:return Oi;case 98:return Ni;case 97:return Mi;case 96:return Li;case 95:return Pi;default:throw Error(a(332))}}function Bi(e,t){return e=Wi(e),ki(e,t)}function $i(e,t,n){return e=Wi(e),_i(e,t,n)}function Vi(){if(null!==Ii){var e=Ii;Ii=null,Si(e)}qi()}function qi(){if(!Fi&&null!==Ri){Fi=!0;var e=0;try{var t=Ri;Bi(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Ri=null}catch(t){throw null!==Ri&&(Ri=Ri.slice(e+1)),_i(Oi,Vi),t}finally{Fi=!1}}}var Gi=x.ReactCurrentBatchConfig;function Yi(e,t){if(e&&e.defaultProps){for(var n in t=i({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var Xi=ai(null),Ki=null,Qi=null,Ji=null;function Zi(){Ji=Qi=Ki=null}function eo(e){var t=Xi.current;si(Xi),e.type._context._currentValue=t}function to(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function no(e,t){Ki=e,Ji=Qi=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(Aa=!0),e.firstContext=null)}function ro(e,t){if(Ji!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(Ji=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Qi){if(null===Ki)throw Error(a(308));Qi=t,Ki.dependencies={lanes:0,firstContext:t,responders:null}}else Qi=Qi.next=t;return e._currentValue}var io=!1;function oo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function ao(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function so(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function lo(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function uo(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?i=o=a:o=o.next=a,n=n.next}while(null!==n);null===o?i=o=t:o=o.next=t}else i=o=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function co(e,t,n,r){var o=e.updateQueue;io=!1;var a=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(null!==l){o.shared.pending=null;var u=l,c=u.next;u.next=null,null===s?a=c:s.next=c,s=u;var d=e.alternate;if(null!==d){var f=(d=d.updateQueue).lastBaseUpdate;f!==s&&(null===f?d.firstBaseUpdate=c:f.next=c,d.lastBaseUpdate=u)}}if(null!==a){for(f=o.baseState,s=0,d=c=u=null;;){l=a.lane;var p=a.eventTime;if((r&l)===l){null!==d&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var h=e,m=a;switch(l=t,p=n,m.tag){case 1:if("function"==typeof(h=m.payload)){f=h.call(p,f,l);break e}f=h;break e;case 3:h.flags=-4097&h.flags|64;case 0:if(null==(l="function"==typeof(h=m.payload)?h.call(p,f,l):h))break e;f=i({},f,l);break e;case 2:io=!0}}null!==a.callback&&(e.flags|=32,null===(l=o.effects)?o.effects=[a]:l.push(a))}else p={eventTime:p,lane:l,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===d?(c=d=p,u=f):d=d.next=p,s|=l;if(null===(a=a.next)){if(null===(l=o.shared.pending))break;a=l.next,l.next=null,o.lastBaseUpdate=l,o.shared.pending=null}}null===d&&(u=f),o.baseState=u,o.firstBaseUpdate=c,o.lastBaseUpdate=d,Fs|=s,e.lanes=s,e.memoizedState=f}}function fo(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(a(191,i));i.call(r)}}}var po=(new r.Component).refs;function ho(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:i({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var mo={isMounted:function(e){return!!(e=e._reactInternals)&&Ke(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ul(),i=cl(e),o=so(r,i);o.payload=t,null!=n&&(o.callback=n),lo(e,o),dl(e,i,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ul(),i=cl(e),o=so(r,i);o.tag=1,o.payload=t,null!=n&&(o.callback=n),lo(e,o),dl(e,i,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ul(),r=cl(e),i=so(n,r);i.tag=2,null!=t&&(i.callback=t),lo(e,i),dl(e,r,n)}};function vo(e,t,n,r,i,o,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,a):!t.prototype||!t.prototype.isPureReactComponent||(!ur(n,r)||!ur(i,o))}function go(e,t,n){var r=!1,i=ui,o=t.contextType;return"object"==typeof o&&null!==o?o=ro(o):(i=hi(t)?fi:ci.current,o=(r=null!=(r=t.contextTypes))?pi(e,i):ui),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=mo,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function yo(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&mo.enqueueReplaceState(t,t.state,null)}function bo(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=po,oo(e);var o=t.contextType;"object"==typeof o&&null!==o?i.context=ro(o):(o=hi(t)?fi:ci.current,i.context=pi(e,o)),co(e,n,i,r),i.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(ho(e,t,o,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&mo.enqueueReplaceState(i,i.state,null),co(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4)}var wo=Array.isArray;function xo(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var r=n.stateNode}if(!r)throw Error(a(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:((t=function(e){var t=r.refs;t===po&&(t=r.refs={}),null===e?delete t[i]:t[i]=e})._stringRef=i,t)}if("string"!=typeof e)throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function ko(e,t){if("textarea"!==e.type)throw Error(a(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function _o(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Bl(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags=2,n):r:(t.flags=2,n):n}function s(t){return e&&null===t.alternate&&(t.flags=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Gl(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function u(e,t,n,r){return null!==t&&t.elementType===n.type?((r=i(t,n.props)).ref=xo(e,t,n),r.return=e,r):((r=$l(n.type,n.key,n.props,null,e.mode,r)).ref=xo(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Yl(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function d(e,t,n,r,o){return null===t||7!==t.tag?((t=Vl(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function f(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Gl(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case k:return(n=$l(t.type,t.key,t.props,null,e.mode,n)).ref=xo(e,null,t),n.return=e,n;case _:return(t=Yl(t,e.mode,n)).return=e,t}if(wo(t)||W(t))return(t=Vl(t,e.mode,n,null)).return=e,t;ko(e,t)}return null}function p(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case k:return n.key===i?n.type===S?d(e,t,n.props.children,r,i):u(e,t,n,r):null;case _:return n.key===i?c(e,t,n,r):null}if(wo(n)||W(n))return null!==i?null:d(e,t,n,r,null);ko(e,n)}return null}function h(e,t,n,r,i){if("string"==typeof r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case k:return e=e.get(null===r.key?n:r.key)||null,r.type===S?d(t,e,r.props.children,i,r.key):u(t,e,r,i);case _:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i)}if(wo(r)||W(r))return d(t,e=e.get(n)||null,r,i,null);ko(t,r)}return null}function m(i,a,s,l){for(var u=null,c=null,d=a,m=a=0,v=null;null!==d&&m<s.length;m++){d.index>m?(v=d,d=null):v=d.sibling;var g=p(i,d,s[m],l);if(null===g){null===d&&(d=v);break}e&&d&&null===g.alternate&&t(i,d),a=o(g,a,m),null===c?u=g:c.sibling=g,c=g,d=v}if(m===s.length)return n(i,d),u;if(null===d){for(;m<s.length;m++)null!==(d=f(i,s[m],l))&&(a=o(d,a,m),null===c?u=d:c.sibling=d,c=d);return u}for(d=r(i,d);m<s.length;m++)null!==(v=h(d,i,m,s[m],l))&&(e&&null!==v.alternate&&d.delete(null===v.key?m:v.key),a=o(v,a,m),null===c?u=v:c.sibling=v,c=v);return e&&d.forEach((function(e){return t(i,e)})),u}function v(i,s,l,u){var c=W(l);if("function"!=typeof c)throw Error(a(150));if(null==(l=c.call(l)))throw Error(a(151));for(var d=c=null,m=s,v=s=0,g=null,y=l.next();null!==m&&!y.done;v++,y=l.next()){m.index>v?(g=m,m=null):g=m.sibling;var b=p(i,m,y.value,u);if(null===b){null===m&&(m=g);break}e&&m&&null===b.alternate&&t(i,m),s=o(b,s,v),null===d?c=b:d.sibling=b,d=b,m=g}if(y.done)return n(i,m),c;if(null===m){for(;!y.done;v++,y=l.next())null!==(y=f(i,y.value,u))&&(s=o(y,s,v),null===d?c=y:d.sibling=y,d=y);return c}for(m=r(i,m);!y.done;v++,y=l.next())null!==(y=h(m,i,v,y.value,u))&&(e&&null!==y.alternate&&m.delete(null===y.key?v:y.key),s=o(y,s,v),null===d?c=y:d.sibling=y,d=y);return e&&m.forEach((function(e){return t(i,e)})),c}return function(e,r,o,l){var u="object"==typeof o&&null!==o&&o.type===S&&null===o.key;u&&(o=o.props.children);var c="object"==typeof o&&null!==o;if(c)switch(o.$$typeof){case k:e:{for(c=o.key,u=r;null!==u;){if(u.key===c){switch(u.tag){case 7:if(o.type===S){n(e,u.sibling),(r=i(u,o.props.children)).return=e,e=r;break e}break;default:if(u.elementType===o.type){n(e,u.sibling),(r=i(u,o.props)).ref=xo(e,u,o),r.return=e,e=r;break e}}n(e,u);break}t(e,u),u=u.sibling}o.type===S?((r=Vl(o.props.children,e.mode,l,o.key)).return=e,e=r):((l=$l(o.type,o.key,o.props,null,e.mode,l)).ref=xo(e,r,o),l.return=e,e=l)}return s(e);case _:e:{for(u=o.key;null!==r;){if(r.key===u){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=i(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Yl(o,e.mode,l)).return=e,e=r}return s(e)}if("string"==typeof o||"number"==typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,o)).return=e,e=r):(n(e,r),(r=Gl(o,e.mode,l)).return=e,e=r),s(e);if(wo(o))return m(e,r,o,l);if(W(o))return v(e,r,o,l);if(c&&ko(e,o),void 0===o&&!u)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(a(152,G(e.type)||"Component"))}return n(e,r)}}var So=_o(!0),Co=_o(!1),Eo={},jo=ai(Eo),To=ai(Eo),Oo=ai(Eo);function No(e){if(e===Eo)throw Error(a(174));return e}function Mo(e,t){switch(li(Oo,t),li(To,e),li(jo,Eo),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:he(null,"");break;default:t=he(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}si(jo),li(jo,t)}function Lo(){si(jo),si(To),si(Oo)}function Po(e){No(Oo.current);var t=No(jo.current),n=he(t,e.type);t!==n&&(li(To,e),li(jo,n))}function Ao(e){To.current===e&&(si(jo),si(To))}var Do=ai(0);function Ro(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Io=null,Fo=null,zo=!1;function Uo(e,t){var n=Hl(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Ho(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function Wo(e){if(zo){var t=Fo;if(t){var n=t;if(!Ho(e,t)){if(!(t=Vr(n.nextSibling))||!Ho(e,t))return e.flags=-1025&e.flags|2,zo=!1,void(Io=e);Uo(Io,n)}Io=e,Fo=Vr(t.firstChild)}else e.flags=-1025&e.flags|2,zo=!1,Io=e}}function Bo(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Io=e}function $o(e){if(e!==Io)return!1;if(!zo)return Bo(e),zo=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Hr(t,e.memoizedProps))for(t=Fo;t;)Uo(e,t),t=Vr(t.nextSibling);if(Bo(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){Fo=Vr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}Fo=null}}else Fo=Io?Vr(e.stateNode.nextSibling):null;return!0}function Vo(){Fo=Io=null,zo=!1}var qo=[];function Go(){for(var e=0;e<qo.length;e++)qo[e]._workInProgressVersionPrimary=null;qo.length=0}var Yo=x.ReactCurrentDispatcher,Xo=x.ReactCurrentBatchConfig,Ko=0,Qo=null,Jo=null,Zo=null,ea=!1,ta=!1;function na(){throw Error(a(321))}function ra(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sr(e[n],t[n]))return!1;return!0}function ia(e,t,n,r,i,o){if(Ko=o,Qo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Yo.current=null===e||null===e.memoizedState?Na:Ma,e=n(r,i),ta){o=0;do{if(ta=!1,!(25>o))throw Error(a(301));o+=1,Zo=Jo=null,t.updateQueue=null,Yo.current=La,e=n(r,i)}while(ta)}if(Yo.current=Oa,t=null!==Jo&&null!==Jo.next,Ko=0,Zo=Jo=Qo=null,ea=!1,t)throw Error(a(300));return e}function oa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Zo?Qo.memoizedState=Zo=e:Zo=Zo.next=e,Zo}function aa(){if(null===Jo){var e=Qo.alternate;e=null!==e?e.memoizedState:null}else e=Jo.next;var t=null===Zo?Qo.memoizedState:Zo.next;if(null!==t)Zo=t,Jo=e;else{if(null===e)throw Error(a(310));e={memoizedState:(Jo=e).memoizedState,baseState:Jo.baseState,baseQueue:Jo.baseQueue,queue:Jo.queue,next:null},null===Zo?Qo.memoizedState=Zo=e:Zo=Zo.next=e}return Zo}function sa(e,t){return"function"==typeof t?t(e):t}function la(e){var t=aa(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=Jo,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var l=s=o=null,u=i;do{var c=u.lane;if((Ko&c)===c)null!==l&&(l=l.next={lane:0,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null}),r=u.eagerReducer===e?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,eagerReducer:u.eagerReducer,eagerState:u.eagerState,next:null};null===l?(s=l=d,o=r):l=l.next=d,Qo.lanes|=c,Fs|=c}u=u.next}while(null!==u&&u!==i);null===l?o=r:l.next=s,sr(r,t.memoizedState)||(Aa=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function ua(e){var t=aa(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{o=e(o,s.action),s=s.next}while(s!==i);sr(o,t.memoizedState)||(Aa=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ca(e,t,n){var r=t._getVersion;r=r(t._source);var i=t._workInProgressVersionPrimary;if(null!==i?e=i===r:(e=e.mutableReadLanes,(e=(Ko&e)===e)&&(t._workInProgressVersionPrimary=r,qo.push(t))),e)return n(t._source);throw qo.push(t),Error(a(350))}function da(e,t,n,r){var i=Ns;if(null===i)throw Error(a(349));var o=t._getVersion,s=o(t._source),l=Yo.current,u=l.useState((function(){return ca(i,t,n)})),c=u[1],d=u[0];u=Zo;var f=e.memoizedState,p=f.refs,h=p.getSnapshot,m=f.source;f=f.subscribe;var v=Qo;return e.memoizedState={refs:p,source:t,subscribe:r},l.useEffect((function(){p.getSnapshot=n,p.setSnapshot=c;var e=o(t._source);if(!sr(s,e)){e=n(t._source),sr(d,e)||(c(e),e=cl(v),i.mutableReadLanes|=e&i.pendingLanes),e=i.mutableReadLanes,i.entangledLanes|=e;for(var r=i.entanglements,a=e;0<a;){var l=31-$t(a),u=1<<l;r[l]|=e,a&=~u}}}),[n,t,r]),l.useEffect((function(){return r(t._source,(function(){var e=p.getSnapshot,n=p.setSnapshot;try{n(e(t._source));var r=cl(v);i.mutableReadLanes|=r&i.pendingLanes}catch(e){n((function(){throw e}))}}))}),[t,r]),sr(h,n)&&sr(m,t)&&sr(f,r)||((e={pending:null,dispatch:null,lastRenderedReducer:sa,lastRenderedState:d}).dispatch=c=Ta.bind(null,Qo,e),u.queue=e,u.baseQueue=null,d=ca(i,t,n),u.memoizedState=u.baseState=d),d}function fa(e,t,n){return da(aa(),e,t,n)}function pa(e){var t=oa();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:sa,lastRenderedState:e}).dispatch=Ta.bind(null,Qo,e),[t.memoizedState,e]}function ha(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Qo.updateQueue)?(t={lastEffect:null},Qo.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ma(e){return e={current:e},oa().memoizedState=e}function va(){return aa().memoizedState}function ga(e,t,n,r){var i=oa();Qo.flags|=e,i.memoizedState=ha(1|t,n,void 0,void 0===r?null:r)}function ya(e,t,n,r){var i=aa();r=void 0===r?null:r;var o=void 0;if(null!==Jo){var a=Jo.memoizedState;if(o=a.destroy,null!==r&&ra(r,a.deps))return void ha(t,n,o,r)}Qo.flags|=e,i.memoizedState=ha(1|t,n,o,r)}function ba(e,t){return ga(516,4,e,t)}function wa(e,t){return ya(516,4,e,t)}function xa(e,t){return ya(4,2,e,t)}function ka(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function _a(e,t,n){return n=null!=n?n.concat([e]):null,ya(4,2,ka.bind(null,t,e),n)}function Sa(){}function Ca(e,t){var n=aa();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ra(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ea(e,t){var n=aa();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ra(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ja(e,t){var n=Hi();Bi(98>n?98:n,(function(){e(!0)})),Bi(97<n?97:n,(function(){var n=Xo.transition;Xo.transition=1;try{e(!1),t()}finally{Xo.transition=n}}))}function Ta(e,t,n){var r=ul(),i=cl(e),o={lane:i,action:n,eagerReducer:null,eagerState:null,next:null},a=t.pending;if(null===a?o.next=o:(o.next=a.next,a.next=o),t.pending=o,a=e.alternate,e===Qo||null!==a&&a===Qo)ta=ea=!0;else{if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var s=t.lastRenderedState,l=a(s,n);if(o.eagerReducer=a,o.eagerState=l,sr(l,s))return}catch(e){}dl(e,i,r)}}var Oa={readContext:ro,useCallback:na,useContext:na,useEffect:na,useImperativeHandle:na,useLayoutEffect:na,useMemo:na,useReducer:na,useRef:na,useState:na,useDebugValue:na,useDeferredValue:na,useTransition:na,useMutableSource:na,useOpaqueIdentifier:na,unstable_isNewReconciler:!1},Na={readContext:ro,useCallback:function(e,t){return oa().memoizedState=[e,void 0===t?null:t],e},useContext:ro,useEffect:ba,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,ga(4,2,ka.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ga(4,2,e,t)},useMemo:function(e,t){var n=oa();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=oa();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Ta.bind(null,Qo,e),[r.memoizedState,e]},useRef:ma,useState:pa,useDebugValue:Sa,useDeferredValue:function(e){var t=pa(e),n=t[0],r=t[1];return ba((function(){var t=Xo.transition;Xo.transition=1;try{r(e)}finally{Xo.transition=t}}),[e]),n},useTransition:function(){var e=pa(!1),t=e[0];return ma(e=ja.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=oa();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},da(r,e,t,n)},useOpaqueIdentifier:function(){if(zo){var e=!1,t=function(e){return{$$typeof:D,toString:e,valueOf:e}}((function(){throw e||(e=!0,n("r:"+(Gr++).toString(36))),Error(a(355))})),n=pa(t)[1];return 0==(2&Qo.mode)&&(Qo.flags|=516,ha(5,(function(){n("r:"+(Gr++).toString(36))}),void 0,null)),t}return pa(t="r:"+(Gr++).toString(36)),t},unstable_isNewReconciler:!1},Ma={readContext:ro,useCallback:Ca,useContext:ro,useEffect:wa,useImperativeHandle:_a,useLayoutEffect:xa,useMemo:Ea,useReducer:la,useRef:va,useState:function(){return la(sa)},useDebugValue:Sa,useDeferredValue:function(e){var t=la(sa),n=t[0],r=t[1];return wa((function(){var t=Xo.transition;Xo.transition=1;try{r(e)}finally{Xo.transition=t}}),[e]),n},useTransition:function(){var e=la(sa)[0];return[va().current,e]},useMutableSource:fa,useOpaqueIdentifier:function(){return la(sa)[0]},unstable_isNewReconciler:!1},La={readContext:ro,useCallback:Ca,useContext:ro,useEffect:wa,useImperativeHandle:_a,useLayoutEffect:xa,useMemo:Ea,useReducer:ua,useRef:va,useState:function(){return ua(sa)},useDebugValue:Sa,useDeferredValue:function(e){var t=ua(sa),n=t[0],r=t[1];return wa((function(){var t=Xo.transition;Xo.transition=1;try{r(e)}finally{Xo.transition=t}}),[e]),n},useTransition:function(){var e=ua(sa)[0];return[va().current,e]},useMutableSource:fa,useOpaqueIdentifier:function(){return ua(sa)[0]},unstable_isNewReconciler:!1},Pa=x.ReactCurrentOwner,Aa=!1;function Da(e,t,n,r){t.child=null===e?Co(t,null,n,r):So(t,e.child,n,r)}function Ra(e,t,n,r,i){n=n.render;var o=t.ref;return no(t,i),r=ia(e,t,n,r,o,i),null===e||Aa?(t.flags|=1,Da(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,ns(e,t,i))}function Ia(e,t,n,r,i,o){if(null===e){var a=n.type;return"function"!=typeof a||Wl(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=$l(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Fa(e,t,a,r,i,o))}return a=e.child,0==(i&o)&&(i=a.memoizedProps,(n=null!==(n=n.compare)?n:ur)(i,r)&&e.ref===t.ref)?ns(e,t,o):(t.flags|=1,(e=Bl(a,r)).ref=t.ref,e.return=t,t.child=e)}function Fa(e,t,n,r,i,o){if(null!==e&&ur(e.memoizedProps,r)&&e.ref===t.ref){if(Aa=!1,0==(o&i))return t.lanes=e.lanes,ns(e,t,o);0!=(16384&e.flags)&&(Aa=!0)}return Ha(e,t,n,r,o)}function za(e,t,n){var r=t.pendingProps,i=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0==(4&t.mode))t.memoizedState={baseLanes:0},bl(t,n);else{if(0==(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},bl(t,e),null;t.memoizedState={baseLanes:0},bl(t,null!==o?o.baseLanes:n)}else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,bl(t,r);return Da(e,t,i,n),t.child}function Ua(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function Ha(e,t,n,r,i){var o=hi(n)?fi:ci.current;return o=pi(t,o),no(t,i),n=ia(e,t,n,r,o,i),null===e||Aa?(t.flags|=1,Da(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,ns(e,t,i))}function Wa(e,t,n,r,i){if(hi(n)){var o=!0;yi(t)}else o=!1;if(no(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),go(t,n,r),bo(t,n,r,i),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;"object"==typeof u&&null!==u?u=ro(u):u=pi(t,u=hi(n)?fi:ci.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==u)&&yo(t,a,r,u),io=!1;var f=t.memoizedState;a.state=f,co(t,r,a,i),l=t.memoizedState,s!==r||f!==l||di.current||io?("function"==typeof c&&(ho(t,n,c,r),l=t.memoizedState),(s=io||vo(t,n,s,r,f,l,u))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4)):("function"==typeof a.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4),r=!1)}else{a=t.stateNode,ao(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Yi(t.type,s),a.props=u,d=t.pendingProps,f=a.context,"object"==typeof(l=n.contextType)&&null!==l?l=ro(l):l=pi(t,l=hi(n)?fi:ci.current);var p=n.getDerivedStateFromProps;(c="function"==typeof p||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||f!==l)&&yo(t,a,r,l),io=!1,f=t.memoizedState,a.state=f,co(t,r,a,i);var h=t.memoizedState;s!==d||f!==h||di.current||io?("function"==typeof p&&(ho(t,n,p,r),h=t.memoizedState),(u=io||vo(t,n,u,r,f,h,l))?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,h,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,h,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=l,r=u):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=256),r=!1)}return Ba(e,t,n,r,o,i)}function Ba(e,t,n,r,i,o){Ua(e,t);var a=0!=(64&t.flags);if(!r&&!a)return i&&bi(t,n,!1),ns(e,t,o);r=t.stateNode,Pa.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=So(t,e.child,null,o),t.child=So(t,null,s,o)):Da(e,t,s,o),t.memoizedState=r.state,i&&bi(t,n,!0),t.child}function $a(e){var t=e.stateNode;t.pendingContext?vi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&vi(0,t.context,!1),Mo(e,t.containerInfo)}var Va,qa,Ga,Ya={dehydrated:null,retryLane:0};function Xa(e,t,n){var r,i=t.pendingProps,o=Do.current,a=!1;return(r=0!=(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&0!=(2&o)),r?(a=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(o|=1),li(Do,1&o),null===e?(void 0!==i.fallback&&Wo(t),e=i.children,o=i.fallback,a?(e=Ka(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Ya,e):"number"==typeof i.unstable_expectedLoadTime?(e=Ka(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Ya,t.lanes=33554432,e):((n=ql({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,a?(i=Ja(e,t,i.children,i.fallback,n),a=t.child,o=e.child.memoizedState,a.memoizedState=null===o?{baseLanes:n}:{baseLanes:o.baseLanes|n},a.childLanes=e.childLanes&~n,t.memoizedState=Ya,i):(n=Qa(e,t,i.children,n),t.memoizedState=null,n))}function Ka(e,t,n,r){var i=e.mode,o=e.child;return t={mode:"hidden",children:t},0==(2&i)&&null!==o?(o.childLanes=0,o.pendingProps=t):o=ql(t,i,0,null),n=Vl(n,i,r,null),o.return=e,n.return=e,o.sibling=n,e.child=o,n}function Qa(e,t,n,r){var i=e.child;return e=i.sibling,n=Bl(i,{mode:"visible",children:n}),0==(2&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function Ja(e,t,n,r,i){var o=t.mode,a=e.child;e=a.sibling;var s={mode:"hidden",children:n};return 0==(2&o)&&t.child!==a?((n=t.child).childLanes=0,n.pendingProps=s,null!==(a=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=a,a.nextEffect=null):t.firstEffect=t.lastEffect=null):n=Bl(a,s),null!==e?r=Bl(e,r):(r=Vl(r,o,i,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function Za(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),to(e.return,t)}function es(e,t,n,r,i,o){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,lastEffect:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i,a.lastEffect=o)}function ts(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Da(e,t,r.children,n),0!=(2&(r=Do.current)))r=1&r|2,t.flags|=64;else{if(null!==e&&0!=(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Za(e,n);else if(19===e.tag)Za(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(li(Do,r),0==(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Ro(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),es(t,!1,i,n,o,t.lastEffect);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Ro(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}es(t,!0,n,null,o,t.lastEffect);break;case"together":es(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function ns(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Fs|=t.lanes,0!=(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=Bl(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Bl(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function rs(e,t){if(!zo)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function is(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return hi(t.type)&&mi(),null;case 3:return Lo(),si(di),si(ci),Go(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||($o(t)?t.flags|=4:r.hydrate||(t.flags|=256)),null;case 5:Ao(t);var o=No(Oo.current);if(n=t.type,null!==e&&null!=t.stateNode)qa(e,t,n,r),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(a(166));return null}if(e=No(jo.current),$o(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Xr]=t,r[Kr]=s,n){case"dialog":jr("cancel",r),jr("close",r);break;case"iframe":case"object":case"embed":jr("load",r);break;case"video":case"audio":for(e=0;e<_r.length;e++)jr(_r[e],r);break;case"source":jr("error",r);break;case"img":case"image":case"link":jr("error",r),jr("load",r);break;case"details":jr("toggle",r);break;case"input":ee(r,s),jr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},jr("invalid",r);break;case"textarea":le(r,s),jr("invalid",r)}for(var u in Se(n,s),e=null,s)s.hasOwnProperty(u)&&(o=s[u],"children"===u?"string"==typeof o?r.textContent!==o&&(e=["children",o]):"number"==typeof o&&r.textContent!==""+o&&(e=["children",""+o]):l.hasOwnProperty(u)&&null!=o&&"onScroll"===u&&jr("scroll",r));switch(n){case"input":K(r),re(r,s,!0);break;case"textarea":K(r),ce(r);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(r.onclick=Ir)}r=e,t.updateQueue=r,null!==r&&(t.flags|=4)}else{switch(u=9===o.nodeType?o:o.ownerDocument,e===de&&(e=pe(n)),e===de?"script"===n?((e=u.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=u.createElement(n,{is:r.is}):(e=u.createElement(n),"select"===n&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,n),e[Xr]=t,e[Kr]=r,Va(e,t),t.stateNode=e,u=Ce(n,r),n){case"dialog":jr("cancel",e),jr("close",e),o=r;break;case"iframe":case"object":case"embed":jr("load",e),o=r;break;case"video":case"audio":for(o=0;o<_r.length;o++)jr(_r[o],e);o=r;break;case"source":jr("error",e),o=r;break;case"img":case"image":case"link":jr("error",e),jr("load",e),o=r;break;case"details":jr("toggle",e),o=r;break;case"input":ee(e,r),o=Z(e,r),jr("invalid",e);break;case"option":o=oe(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=i({},r,{value:void 0}),jr("invalid",e);break;case"textarea":le(e,r),o=se(e,r),jr("invalid",e);break;default:o=r}Se(n,o);var c=o;for(s in c)if(c.hasOwnProperty(s)){var d=c[s];"style"===s?ke(e,d):"dangerouslySetInnerHTML"===s?null!=(d=d?d.__html:void 0)&&ge(e,d):"children"===s?"string"==typeof d?("textarea"!==n||""!==d)&&ye(e,d):"number"==typeof d&&ye(e,""+d):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(l.hasOwnProperty(s)?null!=d&&"onScroll"===s&&jr("scroll",e):null!=d&&w(e,s,d,u))}switch(n){case"input":K(e),re(e,r,!1);break;case"textarea":K(e),ce(e);break;case"option":null!=r.value&&e.setAttribute("value",""+Y(r.value));break;case"select":e.multiple=!!r.multiple,null!=(s=r.value)?ae(e,!!r.multiple,s,!1):null!=r.defaultValue&&ae(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof o.onClick&&(e.onclick=Ir)}Ur(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)Ga(0,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(a(166));n=No(Oo.current),No(jo.current),$o(t)?(r=t.stateNode,n=t.memoizedProps,r[Xr]=t,r.nodeValue!==n&&(t.flags|=4)):((r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Xr]=t,t.stateNode=r)}return null;case 13:return si(Do),r=t.memoizedState,0!=(64&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&$o(t):n=null!==e.memoizedState,r&&!n&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&Do.current)?0===Ds&&(Ds=3):(0!==Ds&&3!==Ds||(Ds=4),null===Ns||0==(134217727&Fs)&&0==(134217727&zs)||ml(Ns,Ls))),(r||n)&&(t.flags|=4),null);case 4:return Lo(),null===e&&Or(t.stateNode.containerInfo),null;case 10:return eo(t),null;case 17:return hi(t.type)&&mi(),null;case 19:if(si(Do),null===(r=t.memoizedState))return null;if(s=0!=(64&t.flags),null===(u=r.rendering))if(s)rs(r,!1);else{if(0!==Ds||null!==e&&0!=(64&e.flags))for(e=t.child;null!==e;){if(null!==(u=Ro(e))){for(t.flags|=64,rs(r,!1),null!==(s=u.updateQueue)&&(t.updateQueue=s,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=n,n=t.child;null!==n;)e=r,(s=n).flags&=2,s.nextEffect=null,s.firstEffect=null,s.lastEffect=null,null===(u=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,e=u.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return li(Do,1&Do.current|2),t.child}e=e.sibling}null!==r.tail&&Ui()>Bs&&(t.flags|=64,s=!0,rs(r,!1),t.lanes=33554432)}else{if(!s)if(null!==(e=Ro(u))){if(t.flags|=64,s=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),rs(r,!0),null===r.tail&&"hidden"===r.tailMode&&!u.alternate&&!zo)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Ui()-r.renderingStartTime>Bs&&1073741824!==n&&(t.flags|=64,s=!0,rs(r,!1),t.lanes=33554432);r.isBackwards?(u.sibling=t.child,t.child=u):(null!==(n=r.last)?n.sibling=u:t.child=u,r.last=u)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Ui(),n.sibling=null,t=Do.current,li(Do,s?1&t|2:1&t),n):null;case 23:case 24:return wl(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(a(156,t.tag))}function os(e){switch(e.tag){case 1:hi(e.type)&&mi();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Lo(),si(di),si(ci),Go(),0!=(64&(t=e.flags)))throw Error(a(285));return e.flags=-4097&t|64,e;case 5:return Ao(e),null;case 13:return si(Do),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return si(Do),null;case 4:return Lo(),null;case 10:return eo(e),null;case 23:case 24:return wl(),null;default:return null}}function as(e,t){try{var n="",r=t;do{n+=q(r),r=r.return}while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i}}function ss(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}Va=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},qa=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,No(jo.current);var a,s=null;switch(n){case"input":o=Z(e,o),r=Z(e,r),s=[];break;case"option":o=oe(e,o),r=oe(e,r),s=[];break;case"select":o=i({},o,{value:void 0}),r=i({},r,{value:void 0}),s=[];break;case"textarea":o=se(e,o),r=se(e,r),s=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=Ir)}for(d in Se(n,r),n=null,o)if(!r.hasOwnProperty(d)&&o.hasOwnProperty(d)&&null!=o[d])if("style"===d){var u=o[d];for(a in u)u.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==d&&"children"!==d&&"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&"autoFocus"!==d&&(l.hasOwnProperty(d)?s||(s=[]):(s=s||[]).push(d,null));for(d in r){var c=r[d];if(u=null!=o?o[d]:void 0,r.hasOwnProperty(d)&&c!==u&&(null!=c||null!=u))if("style"===d)if(u){for(a in u)!u.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&u[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(s||(s=[]),s.push(d,n)),n=c;else"dangerouslySetInnerHTML"===d?(c=c?c.__html:void 0,u=u?u.__html:void 0,null!=c&&u!==c&&(s=s||[]).push(d,c)):"children"===d?"string"!=typeof c&&"number"!=typeof c||(s=s||[]).push(d,""+c):"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&(l.hasOwnProperty(d)?(null!=c&&"onScroll"===d&&jr("scroll",e),s||u===c||(s=[])):"object"==typeof c&&null!==c&&c.$$typeof===D?c.toString():(s=s||[]).push(d,c))}n&&(s=s||[]).push("style",n);var d=s;(t.updateQueue=d)&&(t.flags|=4)}},Ga=function(e,t,n,r){n!==r&&(t.flags|=4)};var ls="function"==typeof WeakMap?WeakMap:Map;function us(e,t,n){(n=so(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Gs||(Gs=!0,Ys=r),ss(0,t)},n}function cs(e,t,n){(n=so(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return ss(0,t),r(i)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Xs?Xs=new Set([this]):Xs.add(this),ss(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var ds="function"==typeof WeakSet?WeakSet:Set;function fs(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){Il(e,t)}else t.current=null}function ps(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Yi(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&$r(t.stateNode.containerInfo));case 5:case 6:case 4:case 17:return}throw Error(a(163))}function hs(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3==(3&e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var i=e;r=i.next,0!=(4&(i=i.tag))&&0!=(1&i)&&(Al(n,e),Pl(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:Yi(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&fo(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}fo(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&Ur(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&kt(n)))));case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(a(163))}function ms(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)"function"==typeof(r=r.style).setProperty?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var i=n.memoizedProps.style;i=null!=i&&i.hasOwnProperty("display")?i.display:null,r.style.display=xe("display",i)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function vs(e,t){if(xi&&"function"==typeof xi.onCommitFiberUnmount)try{xi.onCommitFiberUnmount(wi,t)}catch(e){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,i=r.destroy;if(r=r.tag,void 0!==i)if(0!=(4&r))Al(t,n);else{r=t;try{i()}catch(e){Il(r,e)}}n=n.next}while(n!==e)}break;case 1:if(fs(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(e){Il(t,e)}break;case 5:fs(t);break;case 4:ks(e,t)}}function gs(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function ys(e){return 5===e.tag||3===e.tag||4===e.tag}function bs(e){e:{for(var t=e.return;null!==t;){if(ys(t))break e;t=t.return}throw Error(a(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(a(161))}16&n.flags&&(ye(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||ys(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}r?ws(e,n,t):xs(e,n,t)}function ws(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Ir));else if(4!==r&&null!==(e=e.child))for(ws(e,t,n),e=e.sibling;null!==e;)ws(e,t,n),e=e.sibling}function xs(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(xs(e,t,n),e=e.sibling;null!==e;)xs(e,t,n),e=e.sibling}function ks(e,t){for(var n,r,i=t,o=!1;;){if(!o){o=i.return;e:for(;;){if(null===o)throw Error(a(160));switch(n=o.stateNode,o.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}o=o.return}o=!0}if(5===i.tag||6===i.tag){e:for(var s=e,l=i,u=l;;)if(vs(s,u),null!==u.child&&4!==u.tag)u.child.return=u,u=u.child;else{if(u===l)break e;for(;null===u.sibling;){if(null===u.return||u.return===l)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}r?(s=n,l=i.stateNode,8===s.nodeType?s.parentNode.removeChild(l):s.removeChild(l)):n.removeChild(i.stateNode)}else if(4===i.tag){if(null!==i.child){n=i.stateNode.containerInfo,r=!0,i.child.return=i,i=i.child;continue}}else if(vs(e,i),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(o=!1)}i.sibling.return=i.return,i=i.sibling}}function _s(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var r=n=n.next;do{3==(3&r.tag)&&(e=r.destroy,r.destroy=void 0,void 0!==e&&e()),r=r.next}while(r!==n)}return;case 1:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var i=null!==e?e.memoizedProps:r;e=t.type;var o=t.updateQueue;if(t.updateQueue=null,null!==o){for(n[Kr]=r,"input"===e&&"radio"===r.type&&null!=r.name&&te(n,r),Ce(e,i),t=Ce(e,r),i=0;i<o.length;i+=2){var s=o[i],l=o[i+1];"style"===s?ke(n,l):"dangerouslySetInnerHTML"===s?ge(n,l):"children"===s?ye(n,l):w(n,s,l,t)}switch(e){case"input":ne(n,r);break;case"textarea":ue(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(o=r.value)?ae(n,!!r.multiple,o,!1):e!==!!r.multiple&&(null!=r.defaultValue?ae(n,!!r.multiple,r.defaultValue,!0):ae(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(a(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,kt(n.containerInfo)));case 12:return;case 13:return null!==t.memoizedState&&(Ws=Ui(),ms(t.child,!0)),void Ss(t);case 19:return void Ss(t);case 17:return;case 23:case 24:return void ms(t,null!==t.memoizedState)}throw Error(a(163))}function Ss(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new ds),t.forEach((function(t){var r=zl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Cs(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var Es=Math.ceil,js=x.ReactCurrentDispatcher,Ts=x.ReactCurrentOwner,Os=0,Ns=null,Ms=null,Ls=0,Ps=0,As=ai(0),Ds=0,Rs=null,Is=0,Fs=0,zs=0,Us=0,Hs=null,Ws=0,Bs=1/0;function $s(){Bs=Ui()+500}var Vs,qs=null,Gs=!1,Ys=null,Xs=null,Ks=!1,Qs=null,Js=90,Zs=[],el=[],tl=null,nl=0,rl=null,il=-1,ol=0,al=0,sl=null,ll=!1;function ul(){return 0!=(48&Os)?Ui():-1!==il?il:il=Ui()}function cl(e){if(0==(2&(e=e.mode)))return 1;if(0==(4&e))return 99===Hi()?1:2;if(0===ol&&(ol=Is),0!==Gi.transition){0!==al&&(al=null!==Hs?Hs.pendingLanes:0),e=ol;var t=4186112&~al;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=Hi(),0!=(4&Os)&&98===e?e=Ut(12,ol):e=Ut(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),ol),e}function dl(e,t,n){if(50<nl)throw nl=0,rl=null,Error(a(185));if(null===(e=fl(e,t)))return null;Bt(e,t,n),e===Ns&&(zs|=t,4===Ds&&ml(e,Ls));var r=Hi();1===t?0!=(8&Os)&&0==(48&Os)?vl(e):(pl(e,n),0===Os&&($s(),Vi())):(0==(4&Os)||98!==r&&99!==r||(null===tl?tl=new Set([e]):tl.add(e)),pl(e,n)),Hs=e}function fl(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function pl(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,i=e.pingedLanes,o=e.expirationTimes,s=e.pendingLanes;0<s;){var l=31-$t(s),u=1<<l,c=o[l];if(-1===c){if(0==(u&r)||0!=(u&i)){c=t,It(u);var d=Rt;o[l]=10<=d?c+250:6<=d?c+5e3:-1}}else c<=t&&(e.expiredLanes|=u);s&=~u}if(r=Ft(e,e===Ns?Ls:0),t=Rt,0===r)null!==n&&(n!==Ai&&Si(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Ai&&Si(n)}15===t?(n=vl.bind(null,e),null===Ri?(Ri=[n],Ii=_i(Oi,qi)):Ri.push(n),n=Ai):14===t?n=$i(99,vl.bind(null,e)):n=$i(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(a(358,e))}}(t),hl.bind(null,e)),e.callbackPriority=t,e.callbackNode=n}}function hl(e){if(il=-1,al=ol=0,0!=(48&Os))throw Error(a(327));var t=e.callbackNode;if(Ll()&&e.callbackNode!==t)return null;var n=Ft(e,e===Ns?Ls:0);if(0===n)return null;var r=n,i=Os;Os|=16;var o=_l();for(Ns===e&&Ls===r||($s(),xl(e,r));;)try{El();break}catch(t){kl(e,t)}if(Zi(),js.current=o,Os=i,null!==Ms?r=0:(Ns=null,Ls=0,r=Ds),0!=(Is&zs))xl(e,0);else if(0!==r){if(2===r&&(Os|=64,e.hydrate&&(e.hydrate=!1,$r(e.containerInfo)),0!==(n=zt(e))&&(r=Sl(e,n))),1===r)throw t=Rs,xl(e,0),ml(e,n),pl(e,Ui()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(a(345));case 2:Ol(e);break;case 3:if(ml(e,n),(62914560&n)===n&&10<(r=Ws+500-Ui())){if(0!==Ft(e,0))break;if(((i=e.suspendedLanes)&n)!==n){ul(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Wr(Ol.bind(null,e),r);break}Ol(e);break;case 4:if(ml(e,n),(4186112&n)===n)break;for(r=e.eventTimes,i=-1;0<n;){var s=31-$t(n);o=1<<s,(s=r[s])>i&&(i=s),n&=~o}if(n=i,10<(n=(120>(n=Ui()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Es(n/1960))-n)){e.timeoutHandle=Wr(Ol.bind(null,e),n);break}Ol(e);break;case 5:Ol(e);break;default:throw Error(a(329))}}return pl(e,Ui()),e.callbackNode===t?hl.bind(null,e):null}function ml(e,t){for(t&=~Us,t&=~zs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-$t(t),r=1<<n;e[n]=-1,t&=~r}}function vl(e){if(0!=(48&Os))throw Error(a(327));if(Ll(),e===Ns&&0!=(e.expiredLanes&Ls)){var t=Ls,n=Sl(e,t);0!=(Is&zs)&&(n=Sl(e,t=Ft(e,t)))}else n=Sl(e,t=Ft(e,0));if(0!==e.tag&&2===n&&(Os|=64,e.hydrate&&(e.hydrate=!1,$r(e.containerInfo)),0!==(t=zt(e))&&(n=Sl(e,t))),1===n)throw n=Rs,xl(e,0),ml(e,t),pl(e,Ui()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ol(e),pl(e,Ui()),null}function gl(e,t){var n=Os;Os|=1;try{return e(t)}finally{0===(Os=n)&&($s(),Vi())}}function yl(e,t){var n=Os;Os&=-2,Os|=8;try{return e(t)}finally{0===(Os=n)&&($s(),Vi())}}function bl(e,t){li(As,Ps),Ps|=t,Is|=t}function wl(){Ps=As.current,si(As)}function xl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Br(n)),null!==Ms)for(n=Ms.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&mi();break;case 3:Lo(),si(di),si(ci),Go();break;case 5:Ao(r);break;case 4:Lo();break;case 13:case 19:si(Do);break;case 10:eo(r);break;case 23:case 24:wl()}n=n.return}Ns=e,Ms=Bl(e.current,null),Ls=Ps=Is=t,Ds=0,Rs=null,Us=zs=Fs=0}function kl(e,t){for(;;){var n=Ms;try{if(Zi(),Yo.current=Oa,ea){for(var r=Qo.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}ea=!1}if(Ko=0,Zo=Jo=Qo=null,ta=!1,Ts.current=null,null===n||null===n.return){Ds=1,Rs=t,Ms=null;break}e:{var o=e,a=n.return,s=n,l=t;if(t=Ls,s.flags|=2048,s.firstEffect=s.lastEffect=null,null!==l&&"object"==typeof l&&"function"==typeof l.then){var u=l;if(0==(2&s.mode)){var c=s.alternate;c?(s.updateQueue=c.updateQueue,s.memoizedState=c.memoizedState,s.lanes=c.lanes):(s.updateQueue=null,s.memoizedState=null)}var d=0!=(1&Do.current),f=a;do{var p;if(p=13===f.tag){var h=f.memoizedState;if(null!==h)p=null!==h.dehydrated;else{var m=f.memoizedProps;p=void 0!==m.fallback&&(!0!==m.unstable_avoidThisFallback||!d)}}if(p){var v=f.updateQueue;if(null===v){var g=new Set;g.add(u),f.updateQueue=g}else v.add(u);if(0==(2&f.mode)){if(f.flags|=64,s.flags|=16384,s.flags&=-2981,1===s.tag)if(null===s.alternate)s.tag=17;else{var y=so(-1,1);y.tag=2,lo(s,y)}s.lanes|=1;break e}l=void 0,s=t;var b=o.pingCache;if(null===b?(b=o.pingCache=new ls,l=new Set,b.set(u,l)):void 0===(l=b.get(u))&&(l=new Set,b.set(u,l)),!l.has(s)){l.add(s);var w=Fl.bind(null,o,u,s);u.then(w,w)}f.flags|=4096,f.lanes=t;break e}f=f.return}while(null!==f);l=Error((G(s.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==Ds&&(Ds=2),l=as(l,s),f=a;do{switch(f.tag){case 3:o=l,f.flags|=4096,t&=-t,f.lanes|=t,uo(f,us(0,o,t));break e;case 1:o=l;var x=f.type,k=f.stateNode;if(0==(64&f.flags)&&("function"==typeof x.getDerivedStateFromError||null!==k&&"function"==typeof k.componentDidCatch&&(null===Xs||!Xs.has(k)))){f.flags|=4096,t&=-t,f.lanes|=t,uo(f,cs(f,o,t));break e}}f=f.return}while(null!==f)}Tl(n)}catch(e){t=e,Ms===n&&null!==n&&(Ms=n=n.return);continue}break}}function _l(){var e=js.current;return js.current=Oa,null===e?Oa:e}function Sl(e,t){var n=Os;Os|=16;var r=_l();for(Ns===e&&Ls===t||xl(e,t);;)try{Cl();break}catch(t){kl(e,t)}if(Zi(),Os=n,js.current=r,null!==Ms)throw Error(a(261));return Ns=null,Ls=0,Ds}function Cl(){for(;null!==Ms;)jl(Ms)}function El(){for(;null!==Ms&&!Ci();)jl(Ms)}function jl(e){var t=Vs(e.alternate,e,Ps);e.memoizedProps=e.pendingProps,null===t?Tl(e):Ms=t,Ts.current=null}function Tl(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(2048&t.flags)){if(null!==(n=is(n,t,Ps)))return void(Ms=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!=(1073741824&Ps)||0==(4&n.mode)){for(var r=0,i=n.child;null!==i;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}null!==e&&0==(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(n=os(t)))return n.flags&=2047,void(Ms=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(Ms=t);Ms=t=e}while(null!==t);0===Ds&&(Ds=5)}function Ol(e){var t=Hi();return Bi(99,Nl.bind(null,e,t)),null}function Nl(e,t){do{Ll()}while(null!==Qs);if(0!=(48&Os))throw Error(a(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(a(177));e.callbackNode=null;var r=n.lanes|n.childLanes,i=r,o=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var s=e.eventTimes,l=e.expirationTimes;0<o;){var u=31-$t(o),c=1<<u;i[u]=0,s[u]=-1,l[u]=-1,o&=~c}if(null!==tl&&0==(24&r)&&tl.has(e)&&tl.delete(e),e===Ns&&(Ms=Ns=null,Ls=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(i=Os,Os|=32,Ts.current=null,Fr=Xt,hr(s=pr())){if("selectionStart"in s)l={start:s.selectionStart,end:s.selectionEnd};else e:if(l=(l=s.ownerDocument)&&l.defaultView||window,(c=l.getSelection&&l.getSelection())&&0!==c.rangeCount){l=c.anchorNode,o=c.anchorOffset,u=c.focusNode,c=c.focusOffset;try{l.nodeType,u.nodeType}catch(e){l=null;break e}var d=0,f=-1,p=-1,h=0,m=0,v=s,g=null;t:for(;;){for(var y;v!==l||0!==o&&3!==v.nodeType||(f=d+o),v!==u||0!==c&&3!==v.nodeType||(p=d+c),3===v.nodeType&&(d+=v.nodeValue.length),null!==(y=v.firstChild);)g=v,v=y;for(;;){if(v===s)break t;if(g===l&&++h===o&&(f=d),g===u&&++m===c&&(p=d),null!==(y=v.nextSibling))break;g=(v=g).parentNode}v=y}l=-1===f||-1===p?null:{start:f,end:p}}else l=null;l=l||{start:0,end:0}}else l=null;zr={focusedElem:s,selectionRange:l},Xt=!1,sl=null,ll=!1,qs=r;do{try{Ml()}catch(e){if(null===qs)throw Error(a(330));Il(qs,e),qs=qs.nextEffect}}while(null!==qs);sl=null,qs=r;do{try{for(s=e;null!==qs;){var b=qs.flags;if(16&b&&ye(qs.stateNode,""),128&b){var w=qs.alternate;if(null!==w){var x=w.ref;null!==x&&("function"==typeof x?x(null):x.current=null)}}switch(1038&b){case 2:bs(qs),qs.flags&=-3;break;case 6:bs(qs),qs.flags&=-3,_s(qs.alternate,qs);break;case 1024:qs.flags&=-1025;break;case 1028:qs.flags&=-1025,_s(qs.alternate,qs);break;case 4:_s(qs.alternate,qs);break;case 8:ks(s,l=qs);var k=l.alternate;gs(l),null!==k&&gs(k)}qs=qs.nextEffect}}catch(e){if(null===qs)throw Error(a(330));Il(qs,e),qs=qs.nextEffect}}while(null!==qs);if(x=zr,w=pr(),b=x.focusedElem,s=x.selectionRange,w!==b&&b&&b.ownerDocument&&fr(b.ownerDocument.documentElement,b)){null!==s&&hr(b)&&(w=s.start,void 0===(x=s.end)&&(x=w),"selectionStart"in b?(b.selectionStart=w,b.selectionEnd=Math.min(x,b.value.length)):(x=(w=b.ownerDocument||document)&&w.defaultView||window).getSelection&&(x=x.getSelection(),l=b.textContent.length,k=Math.min(s.start,l),s=void 0===s.end?k:Math.min(s.end,l),!x.extend&&k>s&&(l=s,s=k,k=l),l=dr(b,k),o=dr(b,s),l&&o&&(1!==x.rangeCount||x.anchorNode!==l.node||x.anchorOffset!==l.offset||x.focusNode!==o.node||x.focusOffset!==o.offset)&&((w=w.createRange()).setStart(l.node,l.offset),x.removeAllRanges(),k>s?(x.addRange(w),x.extend(o.node,o.offset)):(w.setEnd(o.node,o.offset),x.addRange(w))))),w=[];for(x=b;x=x.parentNode;)1===x.nodeType&&w.push({element:x,left:x.scrollLeft,top:x.scrollTop});for("function"==typeof b.focus&&b.focus(),b=0;b<w.length;b++)(x=w[b]).element.scrollLeft=x.left,x.element.scrollTop=x.top}Xt=!!Fr,zr=Fr=null,e.current=n,qs=r;do{try{for(b=e;null!==qs;){var _=qs.flags;if(36&_&&hs(b,qs.alternate,qs),128&_){w=void 0;var S=qs.ref;if(null!==S){var C=qs.stateNode;switch(qs.tag){case 5:w=C;break;default:w=C}"function"==typeof S?S(w):S.current=w}}qs=qs.nextEffect}}catch(e){if(null===qs)throw Error(a(330));Il(qs,e),qs=qs.nextEffect}}while(null!==qs);qs=null,Di(),Os=i}else e.current=n;if(Ks)Ks=!1,Qs=e,Js=t;else for(qs=r;null!==qs;)t=qs.nextEffect,qs.nextEffect=null,8&qs.flags&&((_=qs).sibling=null,_.stateNode=null),qs=t;if(0===(r=e.pendingLanes)&&(Xs=null),1===r?e===rl?nl++:(nl=0,rl=e):nl=0,n=n.stateNode,xi&&"function"==typeof xi.onCommitFiberRoot)try{xi.onCommitFiberRoot(wi,n,void 0,64==(64&n.current.flags))}catch(e){}if(pl(e,Ui()),Gs)throw Gs=!1,e=Ys,Ys=null,e;return 0!=(8&Os)||Vi(),null}function Ml(){for(;null!==qs;){var e=qs.alternate;ll||null===sl||(0!=(8&qs.flags)?et(qs,sl)&&(ll=!0):13===qs.tag&&Cs(e,qs)&&et(qs,sl)&&(ll=!0));var t=qs.flags;0!=(256&t)&&ps(e,qs),0==(512&t)||Ks||(Ks=!0,$i(97,(function(){return Ll(),null}))),qs=qs.nextEffect}}function Ll(){if(90!==Js){var e=97<Js?97:Js;return Js=90,Bi(e,Dl)}return!1}function Pl(e,t){Zs.push(t,e),Ks||(Ks=!0,$i(97,(function(){return Ll(),null})))}function Al(e,t){el.push(t,e),Ks||(Ks=!0,$i(97,(function(){return Ll(),null})))}function Dl(){if(null===Qs)return!1;var e=Qs;if(Qs=null,0!=(48&Os))throw Error(a(331));var t=Os;Os|=32;var n=el;el=[];for(var r=0;r<n.length;r+=2){var i=n[r],o=n[r+1],s=i.destroy;if(i.destroy=void 0,"function"==typeof s)try{s()}catch(e){if(null===o)throw Error(a(330));Il(o,e)}}for(n=Zs,Zs=[],r=0;r<n.length;r+=2){i=n[r],o=n[r+1];try{var l=i.create;i.destroy=l()}catch(e){if(null===o)throw Error(a(330));Il(o,e)}}for(l=e.current.firstEffect;null!==l;)e=l.nextEffect,l.nextEffect=null,8&l.flags&&(l.sibling=null,l.stateNode=null),l=e;return Os=t,Vi(),!0}function Rl(e,t,n){lo(e,t=us(0,t=as(n,t),1)),t=ul(),null!==(e=fl(e,1))&&(Bt(e,1,t),pl(e,t))}function Il(e,t){if(3===e.tag)Rl(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){Rl(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Xs||!Xs.has(r))){var i=cs(n,e=as(t,e),1);if(lo(n,i),i=ul(),null!==(n=fl(n,1)))Bt(n,1,i),pl(n,i);else if("function"==typeof r.componentDidCatch&&(null===Xs||!Xs.has(r)))try{r.componentDidCatch(t,e)}catch(e){}break}}n=n.return}}function Fl(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=ul(),e.pingedLanes|=e.suspendedLanes&n,Ns===e&&(Ls&n)===n&&(4===Ds||3===Ds&&(62914560&Ls)===Ls&&500>Ui()-Ws?xl(e,0):Us|=n),pl(e,t)}function zl(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(0==(2&(t=e.mode))?t=1:0==(4&t)?t=99===Hi()?1:2:(0===ol&&(ol=Is),0===(t=Ht(62914560&~ol))&&(t=4194304))),n=ul(),null!==(e=fl(e,t))&&(Bt(e,t,n),pl(e,n))}function Ul(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Hl(e,t,n,r){return new Ul(e,t,n,r)}function Wl(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Bl(e,t){var n=e.alternate;return null===n?((n=Hl(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function $l(e,t,n,r,i,o){var s=2;if(r=e,"function"==typeof e)Wl(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case S:return Vl(n.children,i,o,t);case R:s=8,i|=16;break;case C:s=8,i|=1;break;case E:return(e=Hl(12,n,t,8|i)).elementType=E,e.type=E,e.lanes=o,e;case N:return(e=Hl(13,n,t,i)).type=N,e.elementType=N,e.lanes=o,e;case M:return(e=Hl(19,n,t,i)).elementType=M,e.lanes=o,e;case I:return ql(n,i,o,t);case F:return(e=Hl(24,n,t,i)).elementType=F,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case j:s=10;break e;case T:s=9;break e;case O:s=11;break e;case L:s=14;break e;case P:s=16,r=null;break e;case A:s=22;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=Hl(s,n,t,i)).elementType=e,t.type=r,t.lanes=o,t}function Vl(e,t,n,r){return(e=Hl(7,e,r,t)).lanes=n,e}function ql(e,t,n,r){return(e=Hl(23,e,r,t)).elementType=I,e.lanes=n,e}function Gl(e,t,n){return(e=Hl(6,e,null,t)).lanes=n,e}function Yl(e,t,n){return(t=Hl(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xl(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Wt(0),this.expirationTimes=Wt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wt(0),this.mutableSourceEagerHydrationData=null}function Kl(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:_,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function Ql(e,t,n,r){var i=t.current,o=ul(),s=cl(i);e:if(n){t:{if(Ke(n=n._reactInternals)!==n||1!==n.tag)throw Error(a(170));var l=n;do{switch(l.tag){case 3:l=l.stateNode.context;break t;case 1:if(hi(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}}l=l.return}while(null!==l);throw Error(a(171))}if(1===n.tag){var u=n.type;if(hi(u)){n=gi(n,u,l);break e}}n=l}else n=ui;return null===t.context?t.context=n:t.pendingContext=n,(t=so(o,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),lo(i,t),dl(i,s,o),s}function Jl(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function Zl(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function eu(e,t){Zl(e,t),(e=e.alternate)&&Zl(e,t)}function tu(e,t,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new Xl(e,t,null!=n&&!0===n.hydrate),t=Hl(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,oo(t),e[Qr]=n.current,Or(8===e.nodeType?e.parentNode:e),r)for(e=0;e<r.length;e++){var i=(t=r[e])._getVersion;i=i(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,i]:n.mutableSourceEagerHydrationData.push(t,i)}this._internalRoot=n}function nu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function ru(e,t,n,r,i){var o=n._reactRootContainer;if(o){var a=o._internalRoot;if("function"==typeof i){var s=i;i=function(){var e=Jl(a);s.call(e)}}Ql(t,a,e,i)}else{if(o=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new tu(e,0,t?{hydrate:!0}:void 0)}(n,r),a=o._internalRoot,"function"==typeof i){var l=i;i=function(){var e=Jl(a);l.call(e)}}yl((function(){Ql(t,a,e,i)}))}return Jl(a)}function iu(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!nu(t))throw Error(a(200));return Kl(e,t,null,n)}Vs=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||di.current)Aa=!0;else{if(0==(n&r)){switch(Aa=!1,t.tag){case 3:$a(t),Vo();break;case 5:Po(t);break;case 1:hi(t.type)&&yi(t);break;case 4:Mo(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var i=t.type._context;li(Xi,i._currentValue),i._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!=(n&t.child.childLanes)?Xa(e,t,n):(li(Do,1&Do.current),null!==(t=ns(e,t,n))?t.sibling:null);li(Do,1&Do.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(64&e.flags)){if(r)return ts(e,t,n);t.flags|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),li(Do,Do.current),r)break;return null;case 23:case 24:return t.lanes=0,za(e,t,n)}return ns(e,t,n)}Aa=0!=(16384&e.flags)}else Aa=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=pi(t,ci.current),no(t,n),i=ia(null,t,r,e,i,n),t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,hi(r)){var o=!0;yi(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,oo(t);var s=r.getDerivedStateFromProps;"function"==typeof s&&ho(t,r,s,e),i.updater=mo,t.stateNode=i,i._reactInternals=t,bo(t,r,e,n),t=Ba(null,t,r,!0,o,n)}else t.tag=0,Da(null,t,i,n),t=t.child;return t;case 16:i=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=(o=i._init)(i._payload),t.type=i,o=t.tag=function(e){if("function"==typeof e)return Wl(e)?1:0;if(null!=e){if((e=e.$$typeof)===O)return 11;if(e===L)return 14}return 2}(i),e=Yi(i,e),o){case 0:t=Ha(null,t,i,e,n);break e;case 1:t=Wa(null,t,i,e,n);break e;case 11:t=Ra(null,t,i,e,n);break e;case 14:t=Ia(null,t,i,Yi(i.type,e),r,n);break e}throw Error(a(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,Ha(e,t,r,i=t.elementType===r?i:Yi(r,i),n);case 1:return r=t.type,i=t.pendingProps,Wa(e,t,r,i=t.elementType===r?i:Yi(r,i),n);case 3:if($a(t),r=t.updateQueue,null===e||null===r)throw Error(a(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,ao(e,t),co(t,r,null,n),(r=t.memoizedState.element)===i)Vo(),t=ns(e,t,n);else{if((o=(i=t.stateNode).hydrate)&&(Fo=Vr(t.stateNode.containerInfo.firstChild),Io=t,o=zo=!0),o){if(null!=(e=i.mutableSourceEagerHydrationData))for(i=0;i<e.length;i+=2)(o=e[i])._workInProgressVersionPrimary=e[i+1],qo.push(o);for(n=Co(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Da(e,t,r,n),Vo();t=t.child}return t;case 5:return Po(t),null===e&&Wo(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,s=i.children,Hr(r,i)?s=null:null!==o&&Hr(r,o)&&(t.flags|=16),Ua(e,t),Da(e,t,s,n),t.child;case 6:return null===e&&Wo(t),null;case 13:return Xa(e,t,n);case 4:return Mo(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=So(t,null,r,n):Da(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Ra(e,t,r,i=t.elementType===r?i:Yi(r,i),n);case 7:return Da(e,t,t.pendingProps,n),t.child;case 8:case 12:return Da(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value;var l=t.type._context;if(li(Xi,l._currentValue),l._currentValue=o,null!==s)if(l=s.value,0===(o=sr(l,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,o):1073741823))){if(s.children===i.children&&!di.current){t=ns(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var u=l.dependencies;if(null!==u){s=l.child;for(var c=u.firstContext;null!==c;){if(c.context===r&&0!=(c.observedBits&o)){1===l.tag&&((c=so(-1,n&-n)).tag=2,lo(l,c)),l.lanes|=n,null!==(c=l.alternate)&&(c.lanes|=n),to(l.return,n),u.lanes|=n;break}c=c.next}}else s=10===l.tag&&l.type===t.type?null:l.child;if(null!==s)s.return=l;else for(s=l;null!==s;){if(s===t){s=null;break}if(null!==(l=s.sibling)){l.return=s.return,s=l;break}s=s.return}l=s}Da(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=(o=t.pendingProps).children,no(t,n),r=r(i=ro(i,o.unstable_observedBits)),t.flags|=1,Da(e,t,r,n),t.child;case 14:return o=Yi(i=t.type,t.pendingProps),Ia(e,t,i,o=Yi(i.type,o),r,n);case 15:return Fa(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Yi(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,hi(r)?(e=!0,yi(t)):e=!1,no(t,n),go(t,r,i),bo(t,r,i,n),Ba(null,t,r,!0,e,n);case 19:return ts(e,t,n);case 23:case 24:return za(e,t,n)}throw Error(a(156,t.tag))},tu.prototype.render=function(e){Ql(e,this._internalRoot,null,null)},tu.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Ql(null,e,null,(function(){t[Qr]=null}))},tt=function(e){13===e.tag&&(dl(e,4,ul()),eu(e,4))},nt=function(e){13===e.tag&&(dl(e,67108864,ul()),eu(e,67108864))},rt=function(e){if(13===e.tag){var t=ul(),n=cl(e);dl(e,n,t),eu(e,n)}},it=function(e,t){return t()},je=function(e,t,n){switch(t){case"input":if(ne(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ni(r);if(!i)throw Error(a(90));Q(r),ne(r,i)}}}break;case"textarea":ue(e,n);break;case"select":null!=(t=n.value)&&ae(e,!!n.multiple,t,!1)}},Pe=gl,Ae=function(e,t,n,r,i){var o=Os;Os|=4;try{return Bi(98,e.bind(null,t,n,r,i))}finally{0===(Os=o)&&($s(),Vi())}},De=function(){0==(49&Os)&&(function(){if(null!==tl){var e=tl;tl=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,pl(e,Ui())}))}Vi()}(),Ll())},Re=function(e,t){var n=Os;Os|=2;try{return e(t)}finally{0===(Os=n)&&($s(),Vi())}};var ou={Events:[ei,ti,ni,Me,Le,Ll,{current:!1}]},au={findFiberByHostInstance:Zr,bundleType:0,version:"17.0.1",rendererPackageName:"react-dom"},su={bundleType:au.bundleType,version:au.version,rendererPackageName:au.rendererPackageName,rendererConfig:au.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:x.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ze(e))?null:e.stateNode},findFiberByHostInstance:au.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var lu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lu.isDisabled&&lu.supportsFiber)try{wi=lu.inject(su),xi=lu}catch(ve){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ou,t.createPortal=iu,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(a(188));throw Error(a(268,Object.keys(e)))}return e=null===(e=Ze(t))?null:e.stateNode},t.flushSync=function(e,t){var n=Os;if(0!=(48&n))return e(t);Os|=1;try{if(e)return Bi(99,e.bind(null,t))}finally{Os=n,Vi()}},t.hydrate=function(e,t,n){if(!nu(t))throw Error(a(200));return ru(null,e,t,!0,n)},t.render=function(e,t,n){if(!nu(t))throw Error(a(200));return ru(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!nu(e))throw Error(a(40));return!!e._reactRootContainer&&(yl((function(){ru(null,null,e,!1,(function(){e._reactRootContainer=null,e[Qr]=null}))})),!0)},t.unstable_batchedUpdates=gl,t.unstable_createPortal=function(e,t){return iu(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!nu(n))throw Error(a(200));if(null==e||void 0===e._reactInternals)throw Error(a(38));return ru(e,t,n,!1,r)},t.version="17.0.1"},3935:(e,t,n)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(4448)},9921:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,v=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case c:case d:case o:case s:case a:case p:return e;default:switch(e=e&&e.$$typeof){case u:case f:case v:case m:case l:return e;default:return t}}case i:return t}}}function k(e){return x(e)===d}t.AsyncMode=c,t.ConcurrentMode=d,t.ContextConsumer=u,t.ContextProvider=l,t.Element=r,t.ForwardRef=f,t.Fragment=o,t.Lazy=v,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=a,t.Suspense=p,t.isAsyncMode=function(e){return k(e)||x(e)===c},t.isConcurrentMode=k,t.isContextConsumer=function(e){return x(e)===u},t.isContextProvider=function(e){return x(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return x(e)===f},t.isFragment=function(e){return x(e)===o},t.isLazy=function(e){return x(e)===v},t.isMemo=function(e){return x(e)===m},t.isPortal=function(e){return x(e)===i},t.isProfiler=function(e){return x(e)===s},t.isStrictMode=function(e){return x(e)===a},t.isSuspense=function(e){return x(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===s||e===a||e===p||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===m||e.$$typeof===l||e.$$typeof===u||e.$$typeof===f||e.$$typeof===y||e.$$typeof===b||e.$$typeof===w||e.$$typeof===g)},t.typeOf=x},9864:(e,t,n)=>{"use strict";e.exports=n(9921)},2686:(e,t,n)=>{var r=n(3888),i=n(3138),o=n(1855),a=o.MUST_USE_PROPERTY,s=o.HAS_BOOLEAN_VALUE,l=o.HAS_NUMERIC_VALUE,u=o.HAS_POSITIVE_NUMERIC_VALUE,c=o.HAS_OVERLOADED_BOOLEAN_VALUE;function d(e,t){return(e&t)===t}function f(e,t,n){var r,i,o,f=e.Properties,p=e.DOMAttributeNames;for(i in f)r=p[i]||(n?i:i.toLowerCase()),o=f[i],t[r]={attributeName:r,propertyName:i,mustUseProperty:d(o,a),hasBooleanValue:d(o,s),hasNumericValue:d(o,l),hasPositiveNumericValue:d(o,u),hasOverloadedBooleanValue:d(o,c)}}var p={};f(r,p);var h={};f(i,h,!0);var m={};f(r,m),f(i,m,!0);e.exports={html:p,svg:h,properties:m,isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"))}},3888:e=>{e.exports={Properties:{autoFocus:4,accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:4,allowTransparency:0,alt:0,as:0,async:4,autoComplete:0,autoPlay:4,capture:4,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:5,cite:0,classID:0,className:0,cols:24,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:4,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:4,defer:4,dir:0,disabled:4,download:32,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:4,formTarget:0,frameBorder:0,headers:0,height:0,hidden:4,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:4,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:5,muted:5,name:0,nonce:0,noValidate:4,open:4,optimum:0,pattern:0,placeholder:0,playsInline:4,poster:0,preload:0,profile:0,radioGroup:0,readOnly:4,referrerPolicy:0,rel:0,required:4,reversed:4,role:0,rows:24,rowSpan:8,sandbox:0,scope:0,scoped:4,scrolling:0,seamless:4,selected:5,shape:0,size:24,sizes:0,span:24,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:8,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:4,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"}}},3138:e=>{e.exports={Properties:{accentHeight:0,accumulate:0,additive:0,alignmentBaseline:0,allowReorder:0,alphabetic:0,amplitude:0,arabicForm:0,ascent:0,attributeName:0,attributeType:0,autoReverse:0,azimuth:0,baseFrequency:0,baseProfile:0,baselineShift:0,bbox:0,begin:0,bias:0,by:0,calcMode:0,capHeight:0,clip:0,clipPath:0,clipRule:0,clipPathUnits:0,colorInterpolation:0,colorInterpolationFilters:0,colorProfile:0,colorRendering:0,contentScriptType:0,contentStyleType:0,cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:0,direction:0,display:0,divisor:0,dominantBaseline:0,dur:0,dx:0,dy:0,edgeMode:0,elevation:0,enableBackground:0,end:0,exponent:0,externalResourcesRequired:0,fill:0,fillOpacity:0,fillRule:0,filter:0,filterRes:0,filterUnits:0,floodColor:0,floodOpacity:0,focusable:0,fontFamily:0,fontSize:0,fontSizeAdjust:0,fontStretch:0,fontStyle:0,fontVariant:0,fontWeight:0,format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:0,glyphOrientationHorizontal:0,glyphOrientationVertical:0,glyphRef:0,gradientTransform:0,gradientUnits:0,hanging:0,horizAdvX:0,horizOriginX:0,ideographic:0,imageRendering:0,in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:0,kernelUnitLength:0,kerning:0,keyPoints:0,keySplines:0,keyTimes:0,lengthAdjust:0,letterSpacing:0,lightingColor:0,limitingConeAngle:0,local:0,markerEnd:0,markerMid:0,markerStart:0,markerHeight:0,markerUnits:0,markerWidth:0,mask:0,maskContentUnits:0,maskUnits:0,mathematical:0,mode:0,numOctaves:0,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:0,overlineThickness:0,paintOrder:0,panose1:0,pathLength:0,patternContentUnits:0,patternTransform:0,patternUnits:0,pointerEvents:0,points:0,pointsAtX:0,pointsAtY:0,pointsAtZ:0,preserveAlpha:0,preserveAspectRatio:0,primitiveUnits:0,r:0,radius:0,refX:0,refY:0,renderingIntent:0,repeatCount:0,repeatDur:0,requiredExtensions:0,requiredFeatures:0,restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:0,slope:0,spacing:0,specularConstant:0,specularExponent:0,speed:0,spreadMethod:0,startOffset:0,stdDeviation:0,stemh:0,stemv:0,stitchTiles:0,stopColor:0,stopOpacity:0,strikethroughPosition:0,strikethroughThickness:0,string:0,stroke:0,strokeDasharray:0,strokeDashoffset:0,strokeLinecap:0,strokeLinejoin:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0,surfaceScale:0,systemLanguage:0,tableValues:0,targetX:0,targetY:0,textAnchor:0,textDecoration:0,textRendering:0,textLength:0,to:0,transform:0,u1:0,u2:0,underlinePosition:0,underlineThickness:0,unicode:0,unicodeBidi:0,unicodeRange:0,unitsPerEm:0,vAlphabetic:0,vHanging:0,vIdeographic:0,vMathematical:0,values:0,vectorEffect:0,version:0,vertAdvY:0,vertOriginX:0,vertOriginY:0,viewBox:0,viewTarget:0,visibility:0,widths:0,wordSpacing:0,writingMode:0,x:0,xHeight:0,x1:0,x2:0,xChannelSelector:0,xlinkActuate:0,xlinkArcrole:0,xlinkHref:0,xlinkRole:0,xlinkShow:0,xlinkTitle:0,xlinkType:0,xmlBase:0,xmlns:0,xmlnsXlink:0,xmlLang:0,xmlSpace:0,y:0,y1:0,y2:0,yChannelSelector:0,z:0,zoomAndPan:0},DOMAttributeNames:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space"}}},1855:e=>{e.exports={MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32}},5251:(e,t,n)=>{"use strict";n(7418);var r=n(7294),i=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),t.Fragment=o("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,n){var r,o={},u=null,c=null;for(r in void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:u,ref:c,props:o,_owner:a.current}}t.jsx=u,t.jsxs=u},2408:(e,t,n)=>{"use strict";var r=n(7418),i=60103,o=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var a=60109,s=60110,l=60112;t.Suspense=60113;var u=60115,c=60116;if("function"==typeof Symbol&&Symbol.for){var d=Symbol.for;i=d("react.element"),o=d("react.portal"),t.Fragment=d("react.fragment"),t.StrictMode=d("react.strict_mode"),t.Profiler=d("react.profiler"),a=d("react.provider"),s=d("react.context"),l=d("react.forward_ref"),t.Suspense=d("react.suspense"),u=d("react.memo"),c=d("react.lazy")}var f="function"==typeof Symbol&&Symbol.iterator;function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m={};function v(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||h}function g(){}function y(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(p(85));this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=v.prototype;var b=y.prototype=new g;b.constructor=y,r(b,v.prototype),b.isPureReactComponent=!0;var w={current:null},x=Object.prototype.hasOwnProperty,k={key:!0,ref:!0,__self:!0,__source:!0};function _(e,t,n){var r,o={},a=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)x.call(t,r)&&!k.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(1===l)o.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];o.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps)void 0===o[r]&&(o[r]=l[r]);return{$$typeof:i,type:e,key:a,ref:s,props:o,_owner:w.current}}function S(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var C=/\/+/g;function E(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function j(e,t,n,r,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l=!1;if(null===e)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case i:case o:l=!0}}if(l)return a=a(l=e),e=""===r?"."+E(l,0):r,Array.isArray(a)?(n="",null!=e&&(n=e.replace(C,"$&/")+"/"),j(a,t,n,"",(function(e){return e}))):null!=a&&(S(a)&&(a=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,n+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(C,"$&/")+"/")+e)),t.push(a)),1;if(l=0,r=""===r?".":r+":",Array.isArray(e))for(var u=0;u<e.length;u++){var c=r+E(s=e[u],u);l+=j(s,t,n,c,a)}else if("function"==typeof(c=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=f&&e[f]||e["@@iterator"])?e:null}(e)))for(e=c.call(e),u=0;!(s=e.next()).done;)l+=j(s=s.value,t,n,c=r+E(s,u++),a);else if("object"===s)throw t=""+e,Error(p(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return l}function T(e,t,n){if(null==e)return e;var r=[],i=0;return j(e,r,"","",(function(e){return t.call(n,e,i++)})),r}function O(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var N={current:null};function M(){var e=N.current;if(null===e)throw Error(p(321));return e}var L={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:w,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:T,forEach:function(e,t,n){T(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return T(e,(function(){t++})),t},toArray:function(e){return T(e,(function(e){return e}))||[]},only:function(e){if(!S(e))throw Error(p(143));return e}},t.Component=v,t.PureComponent=y,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L,t.cloneElement=function(e,t,n){if(null==e)throw Error(p(267,e));var o=r({},e.props),a=e.key,s=e.ref,l=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,l=w.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(c in t)x.call(t,c)&&!k.hasOwnProperty(c)&&(o[c]=void 0===t[c]&&void 0!==u?u[c]:t[c])}var c=arguments.length-2;if(1===c)o.children=n;else if(1<c){u=Array(c);for(var d=0;d<c;d++)u[d]=arguments[d+2];o.children=u}return{$$typeof:i,type:e.type,key:a,ref:s,props:o,_owner:l}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=_,t.createFactory=function(e){var t=_.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:l,render:e}},t.isValidElement=S,t.lazy=function(e){return{$$typeof:c,_payload:{_status:-1,_result:e},_init:O}},t.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return M().useCallback(e,t)},t.useContext=function(e,t){return M().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return M().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return M().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return M().useLayoutEffect(e,t)},t.useMemo=function(e,t){return M().useMemo(e,t)},t.useReducer=function(e,t,n){return M().useReducer(e,t,n)},t.useRef=function(e){return M().useRef(e)},t.useState=function(e){return M().useState(e)},t.version="17.0.1"},7294:(e,t,n)=>{"use strict";e.exports=n(2408)},5893:(e,t,n)=>{"use strict";e.exports=n(5251)},53:(e,t)=>{"use strict";var n,r,i,o;if("object"==typeof performance&&"function"==typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var u=null,c=null,d=function(){if(null!==u)try{var e=t.unstable_now();u(!0,e),u=null}catch(e){throw setTimeout(d,0),e}};n=function(e){null!==u?setTimeout(n,0,e):(u=e,setTimeout(d,0))},r=function(e,t){c=setTimeout(e,t)},i=function(){clearTimeout(c)},t.unstable_shouldYield=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var f=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var h=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!=typeof h&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var m=!1,v=null,g=-1,y=5,b=0;t.unstable_shouldYield=function(){return t.unstable_now()>=b},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):y=0<e?Math.floor(1e3/e):5};var w=new MessageChannel,x=w.port2;w.port1.onmessage=function(){if(null!==v){var e=t.unstable_now();b=e+y;try{v(!0,e)?x.postMessage(null):(m=!1,v=null)}catch(e){throw x.postMessage(null),e}}else m=!1},n=function(e){v=e,m||(m=!0,x.postMessage(null))},r=function(e,n){g=f((function(){e(t.unstable_now())}),n)},i=function(){p(g),g=-1}}function k(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,i=e[r];if(!(void 0!==i&&0<C(i,t)))break e;e[r]=t,e[n]=i,n=r}}function _(e){return void 0===(e=e[0])?null:e}function S(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length;r<i;){var o=2*(r+1)-1,a=e[o],s=o+1,l=e[s];if(void 0!==a&&0>C(a,n))void 0!==l&&0>C(l,a)?(e[r]=l,e[s]=n,r=s):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==l&&0>C(l,n)))break e;e[r]=l,e[s]=n,r=s}}}return t}return null}function C(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var E=[],j=[],T=1,O=null,N=3,M=!1,L=!1,P=!1;function A(e){for(var t=_(j);null!==t;){if(null===t.callback)S(j);else{if(!(t.startTime<=e))break;S(j),t.sortIndex=t.expirationTime,k(E,t)}t=_(j)}}function D(e){if(P=!1,A(e),!L)if(null!==_(E))L=!0,n(R);else{var t=_(j);null!==t&&r(D,t.startTime-e)}}function R(e,n){L=!1,P&&(P=!1,i()),M=!0;var o=N;try{for(A(n),O=_(E);null!==O&&(!(O.expirationTime>n)||e&&!t.unstable_shouldYield());){var a=O.callback;if("function"==typeof a){O.callback=null,N=O.priorityLevel;var s=a(O.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?O.callback=s:O===_(E)&&S(E),A(n)}else S(E);O=_(E)}if(null!==O)var l=!0;else{var u=_(j);null!==u&&r(D,u.startTime-n),l=!1}return l}finally{O=null,N=o,M=!1}}var I=o;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){L||M||(L=!0,n(R))},t.unstable_getCurrentPriorityLevel=function(){return N},t.unstable_getFirstCallbackNode=function(){return _(E)},t.unstable_next=function(e){switch(N){case 1:case 2:case 3:var t=3;break;default:t=N}var n=N;N=t;try{return e()}finally{N=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=I,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=N;N=e;try{return t()}finally{N=n}},t.unstable_scheduleCallback=function(e,o,a){var s=t.unstable_now();switch("object"==typeof a&&null!==a?a="number"==typeof(a=a.delay)&&0<a?s+a:s:a=s,e){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return e={id:T++,callback:o,priorityLevel:e,startTime:a,expirationTime:l=a+l,sortIndex:-1},a>s?(e.sortIndex=a,k(j,e),null===_(E)&&e===_(j)&&(P?i():P=!0,r(D,a-s))):(e.sortIndex=l,k(E,e),L||M||(L=!0,n(R))),e},t.unstable_wrapCallback=function(e){var t=N;return function(){var n=N;N=t;try{return e.apply(this,arguments)}finally{N=n}}}},3840:(e,t,n)=>{"use strict";e.exports=n(53)},1476:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var i=r(n(7848)),o=n(6678);t.default=function(e,t){var n={};return e&&"string"==typeof e?(i.default(e,(function(e,r){e&&r&&(n[o.camelCase(e,t)]=r)})),n):n}},6678:(e,t)=>{"use strict";t.__esModule=!0,t.camelCase=void 0;var n=/^--[a-zA-Z0-9-]+$/,r=/-([a-z])/g,i=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,a=function(e,t){return t.toUpperCase()},s=function(e,t){return t+"-"};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||i.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),t.reactCompat||(e=e.replace(o,s)),e.replace(r,a))}},7848:(e,t,n)=>{var r=n(8139);e.exports=function(e,t){var n,i=null;if(!e||"string"!=typeof e)return i;for(var o,a,s=r(e),l="function"==typeof t,u=0,c=s.length;u<c;u++)o=(n=s[u]).property,a=n.value,l?t(o,a,n):a&&(i||(i={}),i[o]=a);return i}},2963:e=>{"use strict";e.exports=function(e,t,n,r){if(null===e)return"";var i=e.length;return n=~~n,r=r||"…",0===(t=~~t)&&0===n||t>=i||n>=i||t+n>=i?e:0===n?e.slice(0,t)+r:e.slice(0,t)+r+e.slice(i-n)}},655:(e,t,n)=>{"use strict";n.d(t,{CR:()=>l,XA:()=>s,ZT:()=>i,_T:()=>a,fl:()=>u,pi:()=>o});var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function u(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(l(arguments[t]));return e}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{"use strict";var e={};n.r(e),n.d(e,{Express:()=>gn,Mongo:()=>Sn,Mysql:()=>xn,Postgres:()=>wn});var t={};function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function i(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}n.r(t),n.d(t,{json:()=>Ms,matchPattern:()=>Ns,regexp:()=>Ls,required:()=>Os});const a=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],a=t&&t.split("/")||[],s=e&&i(e),l=t&&i(t),u=s||l;if(e&&i(e)?a=r:r.length&&(a.pop(),a=a.concat(r)),!a.length)return"/";if(a.length){var c=a[a.length-1];n="."===c||".."===c||""===c}else n=!1;for(var d=0,f=a.length;f>=0;f--){var p=a[f];"."===p?o(a,f):".."===p?(o(a,f),d++):d&&(o(a,f),d--)}if(!u)for(;d--;d)a.unshift("..");!u||""===a[0]||a[0]&&i(a[0])||a.unshift("");var h=a.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h};function s(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}const l=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=s(t),i=s(n);return r!==t||i!==n?e(r,i):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1};var u="Invariant failed";const c=function(e,t){if(!e)throw new Error(u)};function d(e){return"/"===e.charAt(0)?e:"/"+e}function f(e){return"/"===e.charAt(0)?e.substr(1):e}function p(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function h(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function m(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function v(e,t,n,i){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=r({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),i?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=a(o.pathname,i.pathname)):o.pathname=i.pathname:o.pathname||(o.pathname="/"),o}function g(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var y=!("undefined"==typeof window||!window.document||!window.document.createElement);function b(e,t){t(window.confirm(e))}var w="popstate",x="hashchange";function k(){try{return window.history.state||{}}catch(e){return{}}}function _(e){void 0===e&&(e={}),y||c(!1);var t,n=window.history,i=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,o=!(-1===window.navigator.userAgent.indexOf("Trident")),a=e,s=a.forceRefresh,l=void 0!==s&&s,u=a.getUserConfirmation,f=void 0===u?b:u,_=a.keyLength,S=void 0===_?6:_,C=e.basename?h(d(e.basename)):"";function E(e){var t=e||{},n=t.key,r=t.state,i=window.location,o=i.pathname+i.search+i.hash;return C&&(o=p(o,C)),v(o,r,n)}function j(){return Math.random().toString(36).substr(2,S)}var T=g();function O(e){r(H,e),H.length=n.length,T.notifyListeners(H.location,H.action)}function N(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||P(E(e.state))}function M(){P(E(k()))}var L=!1;function P(e){if(L)L=!1,O();else{T.confirmTransitionTo(e,"POP",f,(function(t){t?O({action:"POP",location:e}):function(e){var t=H.location,n=D.indexOf(t.key);-1===n&&(n=0);var r=D.indexOf(e.key);-1===r&&(r=0);var i=n-r;i&&(L=!0,I(i))}(e)}))}}var A=E(k()),D=[A.key];function R(e){return C+m(e)}function I(e){n.go(e)}var F=0;function z(e){1===(F+=e)&&1===e?(window.addEventListener(w,N),o&&window.addEventListener(x,M)):0===F&&(window.removeEventListener(w,N),o&&window.removeEventListener(x,M))}var U=!1;var H={length:n.length,action:"POP",location:A,createHref:R,push:function(e,t){var r="PUSH",o=v(e,t,j(),H.location);T.confirmTransitionTo(o,r,f,(function(e){if(e){var t=R(o),a=o.key,s=o.state;if(i)if(n.pushState({key:a,state:s},null,t),l)window.location.href=t;else{var u=D.indexOf(H.location.key),c=D.slice(0,u+1);c.push(o.key),D=c,O({action:r,location:o})}else window.location.href=t}}))},replace:function(e,t){var r="REPLACE",o=v(e,t,j(),H.location);T.confirmTransitionTo(o,r,f,(function(e){if(e){var t=R(o),a=o.key,s=o.state;if(i)if(n.replaceState({key:a,state:s},null,t),l)window.location.replace(t);else{var u=D.indexOf(H.location.key);-1!==u&&(D[u]=o.key),O({action:r,location:o})}else window.location.replace(t)}}))},go:I,goBack:function(){I(-1)},goForward:function(){I(1)},block:function(e){void 0===e&&(e=!1);var t=T.setPrompt(e);return U||(z(1),U=!0),function(){return U&&(U=!1,z(-1)),t()}},listen:function(e){var t=T.appendListener(e);return z(1),function(){z(-1),t()}}};return H}var S="hashchange",C={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+f(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:f,decodePath:d},slash:{encodePath:d,decodePath:d}};function E(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function j(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function T(e){window.location.replace(E(window.location.href)+"#"+e)}function O(e){void 0===e&&{},y||c(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),i=n.getUserConfirmation,o=void 0===i?b:i,a=n.hashType,s=void 0===a?"slash":a,l=e.basename?h(d(e.basename)):"",u=C[s],f=u.encodePath,w=u.decodePath;function x(){var e=w(j());return l&&p(e,l),v(e)}var k=g();function _(e){r(U,e),U.length=t.length,k.notifyListeners(U.location,U.action)}var O=!1,N=null;function M(){var e,t,n=j(),r=f(n);if(n!==r)T(r);else{var i=x(),a=U.location;if(!O&&(i,a.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(N===m(i))return;null,function(e){if(O)!1,_();else{var t="POP";k.confirmTransitionTo(e,t,o,(function(n){n?_({action:t,location:e}):function(e){var t=U.location,n=D.lastIndexOf(m(t));-1===n&&0;var r=D.lastIndexOf(m(e));-1===r&&0;var i=n-r;i&&(!0,R(i))}(e)}))}}(i)}}var L=j(),P=f(L);L!==P&&T(P);var A=x(),D=[m(A)];function R(e){t.go(e)}var I=0;function F(e){1===(I+=e)&&1===e?window.addEventListener(S,M):0===I&&window.removeEventListener(S,M)}var z=!1;var U={length:t.length,action:"POP",location:A,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&E(window.location.href),n+"#"+f(l+m(e))},push:function(e,t){var n="PUSH",r=v(e,void 0,void 0,U.location);k.confirmTransitionTo(r,n,o,(function(e){if(e){var t=m(r),i=f(l+t);if(j()!==i){t,function(e){window.location.hash=e}(i);var o=D.lastIndexOf(m(U.location)),a=D.slice(0,o+1);a.push(t),a,_({action:n,location:r})}else _()}}))},replace:function(e,t){var n="REPLACE",r=v(e,void 0,void 0,U.location);k.confirmTransitionTo(r,n,o,(function(e){if(e){var t=m(r),i=f(l+t);j()!==i&&(t,T(i));var o=D.indexOf(m(U.location));-1!==o&&(D[o]=t),_({action:n,location:r})}}))},go:R,goBack:function(){R(-1)},goForward:function(){R(1)},block:function(e){void 0===e&&!1;var t=k.setPrompt(e);return z||(F(1),!0),function(){return z&&(!1,F(-1)),t()}},listen:function(e){var t=k.appendListener(e);return F(1),function(){F(-1),t()}}};return U}function N(e,t,n){return Math.min(Math.max(e,t),n)}function M(e){void 0===e&&{};var t=e,n=t.getUserConfirmation,i=t.initialEntries,o=void 0===i?["/"]:i,a=t.initialIndex,s=void 0===a?0:a,l=t.keyLength,u=void 0===l?6:l,c=g();function d(e){r(w,e),w.length=w.entries.length,c.notifyListeners(w.location,w.action)}function f(){return Math.random().toString(36).substr(2,u)}var p=N(s,0,o.length-1),h=o.map((function(e){return v(e,void 0,"string"==typeof e?f():e.key||f())})),y=m;function b(e){var t=N(w.index+e,0,w.entries.length-1),r=w.entries[t];c.confirmTransitionTo(r,"POP",n,(function(e){e?d({action:"POP",location:r,index:t}):d()}))}var w={length:h.length,action:"POP",location:h[p],index:p,entries:h,createHref:y,push:function(e,t){var r="PUSH",i=v(e,t,f(),w.location);c.confirmTransitionTo(i,r,n,(function(e){if(e){var t=w.index+1,n=w.entries.slice(0);n.length>t?n.splice(t,n.length-t,i):n.push(i),d({action:r,location:i,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",i=v(e,t,f(),w.location);c.confirmTransitionTo(i,r,n,(function(e){e&&(w.entries[w.index]=i,d({action:r,location:i}))}))},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var t=w.index+e;return t>=0&&t<w.entries.length},block:function(e){return void 0===e&&!1,c.setPrompt(e)},listen:function(e){return c.appendListener(e)}};return w}var L=n(7294),P=n(3935);function A(e,t){return(A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function D(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,A(e,t)}var R=n(5697),I=n.n(R),F=1073741823,z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:{};function U(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter((function(t){return t!==e}))},get:function(){return e},set:function(n,r){e=n,t.forEach((function(t){return t(e,r)}))}}}const H=L.createContext||function(e,t){var n,r,i="__create-react-context-"+function(){var e="__global_unique_id__";return z[e]=(z[e]||0)+1}()+"__",o=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).emitter=U(t.props.value),t}D(n,e);var r=n.prototype;return r.getChildContext=function(){var e;return(e={})[i]=this.emitter,e},r.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,i=e.value;((o=r)===(a=i)?0!==o||1/o==1/a:o!=o&&a!=a)?n=0:(n="function"==typeof t?t(r,i):F,0!==(n|=0)&&this.emitter.set(e.value,n))}var o,a},r.render=function(){return this.props.children},n}(L.Component);o.childContextTypes=((n={})[i]=I().object.isRequired,n);var a=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).state={value:e.getValue()},e.onUpdate=function(t,n){0!=((0|e.observedBits)&n)&&e.setState({value:e.getValue()})},e}D(n,t);var r=n.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?F:t},r.componentDidMount=function(){this.context[i]&&this.context[i].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?F:e},r.componentWillUnmount=function(){this.context[i]&&this.context[i].off(this.onUpdate)},r.getValue=function(){return this.context[i]?this.context[i].get():e},r.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(L.Component);return a.contextTypes=((r={})[i]=I().object,r),{Provider:o,Consumer:a}};var W=n(4779),B=n.n(W);n(9864);function $(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var V=n(8679),q=n.n(V),G=function(e){var t=H();return t.displayName=e,t}("Router-History"),Y=function(e){var t=H();return t.displayName=e,t}("Router"),X=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}D(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return L.createElement(Y.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},L.createElement(G.Provider,{children:this.props.children||null,value:this.props.history}))},t}(L.Component);L.Component;var K=function(e){function t(){return e.apply(this,arguments)||this}D(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(L.Component);var Q={},J=0;function Z(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(Q[e])return Q[e];var t=B().compile(e);return J<1e4&&(Q[e]=t,J++),t}(e)(t,{pretty:!0})}function ee(e){var t=e.computedMatch,n=e.to,i=e.push,o=void 0!==i&&i;return L.createElement(Y.Consumer,null,(function(e){e||c(!1);var i=e.history,a=e.staticContext,s=o?i.push:i.replace,u=v(t?"string"==typeof n?Z(n,t.params):r({},n,{pathname:Z(n.pathname,t.params)}):n);return a?(s(u),null):L.createElement(K,{onMount:function(){s(u)},onUpdate:function(e,t){var n,i,o=v(t.to);n=o,i=r({},u,{key:o.key}),n.pathname===i.pathname&&n.search===i.search&&n.hash===i.hash&&n.key===i.key&&l(n.state,i.state)||s(u)},to:n})}))}var te={},ne=0;function re(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,i=n.exact,o=void 0!==i&&i,a=n.strict,s=void 0!==a&&a,l=n.sensitive,u=void 0!==l&&l;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=te[n]||(te[n]={});if(r[e])return r[e];var i=[],o={regexp:B()(e,i,t),keys:i};return ne<1e4&&(r[e]=o,ne++),o}(n,{end:o,strict:s,sensitive:u}),i=r.regexp,a=r.keys,l=i.exec(e);if(!l)return null;var c=l[0],d=l.slice(1),f=e===c;return o&&!f?null:{path:n,url:"/"===n&&""===c?"/":c,isExact:f,params:a.reduce((function(e,t,n){return e[t.name]=d[n],e}),{})}}),null)}var ie=function(e){function t(){return e.apply(this,arguments)||this}return D(t,e),t.prototype.render=function(){var e=this;return L.createElement(Y.Consumer,null,(function(t){t||c(!1);var n=e.props.location||t.location,i=r({},t,{location:n,match:e.props.computedMatch?e.props.computedMatch:e.props.path?re(n.pathname,e.props):t.match}),o=e.props,a=o.children,s=o.component,l=o.render;return Array.isArray(a)&&0===a.length&&(a=null),L.createElement(Y.Provider,{value:i},i.match?a?"function"==typeof a?a(i):a:s?L.createElement(s,i):l?l(i):null:"function"==typeof a?a(i):null)}))},t}(L.Component);function oe(e){return"/"===e.charAt(0)?e:"/"+e}function ae(e,t){if(!e)return t;var n=oe(e);return 0!==t.pathname.indexOf(n)?t:r({},t,{pathname:t.pathname.substr(n.length)})}function se(e){return"string"==typeof e?e:m(e)}function le(e){return function(){c(!1)}}function ue(){}L.Component;var ce=function(e){function t(){return e.apply(this,arguments)||this}return D(t,e),t.prototype.render=function(){var e=this;return L.createElement(Y.Consumer,null,(function(t){t||c(!1);var n,i,o=e.props.location||t.location;return L.Children.forEach(e.props.children,(function(e){if(null==i&&L.isValidElement(e)){n=e;var a=e.props.path||e.props.from;i=a?re(o.pathname,r({},e.props,{path:a})):t.match}})),i?L.cloneElement(n,{location:o,computedMatch:i}):null}))},t}(L.Component);var de=L.useContext;function fe(){return de(G)}function pe(){return de(Y).location}var he,me=n(655),ve=n(6769),ge=n(8554),ye=n(2343),be=n(2844),we=n(7321),xe=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],ke=function(){function e(t){void 0===t&&(t={}),this._options=t,this.name=e.id}return e.prototype.setupOnce=function(){(0,ve.c)((function(t){var n=(0,ge.Gd)();if(!n)return t;var r=n.getIntegration(e);if(r){var i=n.getClient(),o=i?i.getOptions():{},a="function"==typeof r._mergeOptions?r._mergeOptions(o):{};return"function"!=typeof r._shouldDropEvent?t:r._shouldDropEvent(t,a)?null:t}return t}))},e.prototype._shouldDropEvent=function(e,t){return this._isSentryError(e,t)?(ye.k.warn("Event dropped due to being internal Sentry Error.\nEvent: "+(0,be.jH)(e)),!0):this._isIgnoredError(e,t)?(ye.k.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+(0,be.jH)(e)),!0):this._isDeniedUrl(e,t)?(ye.k.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+(0,be.jH)(e)+".\nUrl: "+this._getEventFilterUrl(e)),!0):!this._isAllowedUrl(e,t)&&(ye.k.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+(0,be.jH)(e)+".\nUrl: "+this._getEventFilterUrl(e)),!0)},e.prototype._isSentryError=function(e,t){if(!t.ignoreInternal)return!1;try{return e&&e.exception&&e.exception.values&&e.exception.values[0]&&"SentryError"===e.exception.values[0].type||!1}catch(e){return!1}},e.prototype._isIgnoredError=function(e,t){return!(!t.ignoreErrors||!t.ignoreErrors.length)&&this._getPossibleEventMessages(e).some((function(e){return t.ignoreErrors.some((function(t){return(0,we.zC)(e,t)}))}))},e.prototype._isDeniedUrl=function(e,t){if(!t.denyUrls||!t.denyUrls.length)return!1;var n=this._getEventFilterUrl(e);return!!n&&t.denyUrls.some((function(e){return(0,we.zC)(n,e)}))},e.prototype._isAllowedUrl=function(e,t){if(!t.allowUrls||!t.allowUrls.length)return!0;var n=this._getEventFilterUrl(e);return!n||t.allowUrls.some((function(e){return(0,we.zC)(n,e)}))},e.prototype._mergeOptions=function(e){return void 0===e&&(e={}),{allowUrls:(0,me.fl)(this._options.whitelistUrls||[],this._options.allowUrls||[],e.whitelistUrls||[],e.allowUrls||[]),denyUrls:(0,me.fl)(this._options.blacklistUrls||[],this._options.denyUrls||[],e.blacklistUrls||[],e.denyUrls||[]),ignoreErrors:(0,me.fl)(this._options.ignoreErrors||[],e.ignoreErrors||[],xe),ignoreInternal:void 0===this._options.ignoreInternal||this._options.ignoreInternal}},e.prototype._getPossibleEventMessages=function(e){if(e.message)return[e.message];if(e.exception)try{var t=e.exception.values&&e.exception.values[0]||{},n=t.type,r=void 0===n?"":n,i=t.value,o=void 0===i?"":i;return[""+o,r+": "+o]}catch(t){return ye.k.error("Cannot extract message for event "+(0,be.jH)(e)),[]}return[]},e.prototype._getEventFilterUrl=function(e){try{if(e.stacktrace){var t=e.stacktrace.frames;return t&&t[t.length-1].filename||null}if(e.exception){var n=e.exception.values&&e.exception.values[0].stacktrace&&e.exception.values[0].stacktrace.frames;return n&&n[n.length-1].filename||null}return null}catch(t){return ye.k.error("Cannot extract url for event "+(0,be.jH)(e)),null}},e.id="InboundFilters",e}(),_e=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){he=Function.prototype.toString,Function.prototype.toString=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.__sentry_original__||this;return he.apply(n,e)}},e.id="FunctionToString",e}();var Se=n(9732),Ce="6.8.0",Ee=n(7199),je=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){return e.__proto__=t,e}:function(e,t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n]);return e});var Te=function(e){function t(t){var n=this.constructor,r=e.call(this,t)||this;return r.message=t,r.name=n.prototype.constructor.name,je(r,n.prototype),r}return(0,me.ZT)(t,e),t}(Error),Oe=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/,Ne="Invalid Dsn",Me=function(){function e(e){"string"==typeof e?this._fromString(e):this._fromComponents(e),this._validate()}return e.prototype.toString=function(e){void 0===e&&(e=!1);var t=this,n=t.host,r=t.path,i=t.pass,o=t.port,a=t.projectId;return t.protocol+"://"+t.publicKey+(e&&i?":"+i:"")+"@"+n+(o?":"+o:"")+"/"+(r?r+"/":r)+a},e.prototype._fromString=function(e){var t=Oe.exec(e);if(!t)throw new Te(Ne);var n=(0,me.CR)(t.slice(1),6),r=n[0],i=n[1],o=n[2],a=void 0===o?"":o,s=n[3],l=n[4],u=void 0===l?"":l,c="",d=n[5],f=d.split("/");if(f.length>1&&(c=f.slice(0,-1).join("/"),d=f.pop()),d){var p=d.match(/^\d+/);p&&(d=p[0])}this._fromComponents({host:s,pass:a,path:c,projectId:d,port:u,protocol:r,publicKey:i})},e.prototype._fromComponents=function(e){"user"in e&&!("publicKey"in e)&&(e.publicKey=e.user),this.user=e.publicKey||"",this.protocol=e.protocol,this.publicKey=e.publicKey||"",this.pass=e.pass||"",this.host=e.host,this.port=e.port||"",this.path=e.path||"",this.projectId=e.projectId},e.prototype._validate=function(){var e=this;if(["protocol","publicKey","host","projectId"].forEach((function(t){if(!e[t])throw new Te("Invalid Dsn: "+t+" missing")})),!this.projectId.match(/^\d+$/))throw new Te("Invalid Dsn: Invalid projectId "+this.projectId);if("http"!==this.protocol&&"https"!==this.protocol)throw new Te("Invalid Dsn: Invalid protocol "+this.protocol);if(this.port&&isNaN(parseInt(this.port,10)))throw new Te("Invalid Dsn: Invalid port "+this.port)},e}(),Le=n(7597),Pe=n(6893),Ae=n(1170),De=n(7482),Re=[];function Ie(e){return e.reduce((function(e,t){return e.every((function(e){return t.name!==e.name}))&&e.push(t),e}),[])}function Fe(e){var t={};return function(e){var t=e.defaultIntegrations&&(0,me.fl)(e.defaultIntegrations)||[],n=e.integrations,r=(0,me.fl)(Ie(t));Array.isArray(n)?r=(0,me.fl)(r.filter((function(e){return n.every((function(t){return t.name!==e.name}))})),Ie(n)):"function"==typeof n&&(r=n(r),r=Array.isArray(r)?r:[r]);var i=r.map((function(e){return e.name})),o="Debug";return-1!==i.indexOf(o)&&r.push.apply(r,(0,me.fl)(r.splice(i.indexOf(o),1))),r}(e).forEach((function(e){t[e.name]=e,function(e){-1===Re.indexOf(e.name)&&(e.setupOnce(ve.c,ge.Gd),Re.push(e.name),ye.k.log("Integration installed: "+e.name))}(e)})),t}var ze,Ue=function(){function e(e,t){this._integrations={},this._processing=0,this._backend=new e(t),this._options=t,t.dsn&&(this._dsn=new Me(t.dsn))}return e.prototype.captureException=function(e,t,n){var r=this,i=t&&t.event_id;return this._process(this._getBackend().eventFromException(e,t).then((function(e){return r._captureEvent(e,t,n)})).then((function(e){i=e}))),i},e.prototype.captureMessage=function(e,t,n,r){var i=this,o=n&&n.event_id,a=(0,Le.pt)(e)?this._getBackend().eventFromMessage(String(e),t,n):this._getBackend().eventFromException(e,n);return this._process(a.then((function(e){return i._captureEvent(e,n,r)})).then((function(e){o=e}))),o},e.prototype.captureEvent=function(e,t,n){var r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((function(e){r=e}))),r},e.prototype.captureSession=function(e){this._isEnabled()?"string"!=typeof e.release?ye.k.warn("Discarded session because of missing or non-string release"):(this._sendSession(e),e.update({init:!1})):ye.k.warn("SDK not enabled, will not capture session.")},e.prototype.getDsn=function(){return this._dsn},e.prototype.getOptions=function(){return this._options},e.prototype.flush=function(e){var t=this;return this._isClientProcessing(e).then((function(n){return t._getBackend().getTransport().close(e).then((function(e){return n&&e}))}))},e.prototype.close=function(e){var t=this;return this.flush(e).then((function(e){return t.getOptions().enabled=!1,e}))},e.prototype.setupIntegrations=function(){this._isEnabled()&&(this._integrations=Fe(this._options))},e.prototype.getIntegration=function(e){try{return this._integrations[e.id]||null}catch(t){return ye.k.warn("Cannot retrieve integration "+e.id+" from the current Client"),null}},e.prototype._updateSessionFromEvent=function(e,t){var n,r,i=!1,o=!1,a=t.exception&&t.exception.values;if(a){o=!0;try{for(var s=(0,me.XA)(a),l=s.next();!l.done;l=s.next()){var u=l.value.mechanism;if(u&&!1===u.handled){i=!0;break}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}var c=e.status===Ee.$.Ok;(c&&0===e.errors||c&&i)&&(e.update((0,me.pi)((0,me.pi)({},i&&{status:Ee.$.Crashed}),{errors:e.errors||Number(o||i)})),this.captureSession(e))},e.prototype._sendSession=function(e){this._getBackend().sendSession(e)},e.prototype._isClientProcessing=function(e){var t=this;return new Pe.c((function(n){var r=0,i=setInterval((function(){0==t._processing?(clearInterval(i),n(!0)):(r+=1,e&&r>=e&&(clearInterval(i),n(!1)))}),1)}))},e.prototype._getBackend=function(){return this._backend},e.prototype._isEnabled=function(){return!1!==this.getOptions().enabled&&void 0!==this._dsn},e.prototype._prepareEvent=function(e,t,n){var r=this,i=this.getOptions().normalizeDepth,o=void 0===i?3:i,a=(0,me.pi)((0,me.pi)({},e),{event_id:e.event_id||(n&&n.event_id?n.event_id:(0,be.DM)()),timestamp:e.timestamp||(0,Ae.yW)()});this._applyClientOptions(a),this._applyIntegrationsMetadata(a);var s=t;n&&n.captureContext&&(s=ve.s.clone(s).update(n.captureContext));var l=Pe.c.resolve(a);return s&&(l=s.applyToEvent(a,n)),l.then((function(e){return"number"==typeof o&&o>0?r._normalizeEvent(e,o):e}))},e.prototype._normalizeEvent=function(e,t){if(!e)return null;var n=(0,me.pi)((0,me.pi)((0,me.pi)((0,me.pi)((0,me.pi)({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((function(e){return(0,me.pi)((0,me.pi)({},e),e.data&&{data:(0,De.Fv)(e.data,t)})}))}),e.user&&{user:(0,De.Fv)(e.user,t)}),e.contexts&&{contexts:(0,De.Fv)(e.contexts,t)}),e.extra&&{extra:(0,De.Fv)(e.extra,t)});return e.contexts&&e.contexts.trace&&(n.contexts.trace=e.contexts.trace),n},e.prototype._applyClientOptions=function(e){var t=this.getOptions(),n=t.environment,r=t.release,i=t.dist,o=t.maxValueLength,a=void 0===o?250:o;"environment"in e||(e.environment="environment"in t?n:"production"),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=(0,we.$G)(e.message,a));var s=e.exception&&e.exception.values&&e.exception.values[0];s&&s.value&&(s.value=(0,we.$G)(s.value,a));var l=e.request;l&&l.url&&(l.url=(0,we.$G)(l.url,a))},e.prototype._applyIntegrationsMetadata=function(e){var t=Object.keys(this._integrations);t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=(0,me.fl)(e.sdk.integrations||[],t))},e.prototype._sendEvent=function(e){this._getBackend().sendEvent(e)},e.prototype._captureEvent=function(e,t,n){return this._processEvent(e,t,n).then((function(e){return e.event_id}),(function(e){ye.k.error(e)}))},e.prototype._processEvent=function(e,t,n){var r=this,i=this.getOptions(),o=i.beforeSend,a=i.sampleRate;if(!this._isEnabled())return Pe.c.reject(new Te("SDK not enabled, will not capture event."));var s="transaction"===e.type;return!s&&"number"==typeof a&&Math.random()>a?Pe.c.reject(new Te("Discarding event because it's not included in the random sample (sampling rate = "+a+")")):this._prepareEvent(e,n,t).then((function(e){if(null===e)throw new Te("An event processor returned null, will not send event.");if(t&&t.data&&!0===t.data.__sentry__||s||!o)return e;var n=o(e,t);return r._ensureBeforeSendRv(n)})).then((function(e){if(null===e)throw new Te("`beforeSend` returned `null`, will not send event.");var t=n&&n.getSession&&n.getSession();return!s&&t&&r._updateSessionFromEvent(t,e),r._sendEvent(e),e})).then(null,(function(e){if(e instanceof Te)throw e;throw r.captureException(e,{data:{__sentry__:!0},originalException:e}),new Te("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+e)}))},e.prototype._process=function(e){var t=this;this._processing+=1,e.then((function(e){return t._processing-=1,e}),(function(e){return t._processing-=1,e}))},e.prototype._ensureBeforeSendRv=function(e){var t="`beforeSend` method has to return `null` or a valid event.";if((0,Le.J8)(e))return e.then((function(e){if(!(0,Le.PO)(e)&&null!==e)throw new Te(t);return e}),(function(e){throw new Te("beforeSend rejected with "+e)}));if(!(0,Le.PO)(e)&&null!==e)throw new Te(t);return e},e}();!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.Invalid="invalid",e.Failed="failed"}(ze||(ze={})),function(e){e.fromHttpCode=function(t){return t>=200&&t<300?e.Success:429===t?e.RateLimit:t>=400&&t<500?e.Invalid:t>=500?e.Failed:e.Unknown}}(ze||(ze={}));var He,We=function(){function e(){}return e.prototype.sendEvent=function(e){return Pe.c.resolve({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:ze.Skipped})},e.prototype.close=function(e){return Pe.c.resolve(!0)},e}(),Be=function(){function e(e){this._options=e,this._options.dsn||ye.k.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return e.prototype.eventFromException=function(e,t){throw new Te("Backend has to implement `eventFromException` method")},e.prototype.eventFromMessage=function(e,t,n){throw new Te("Backend has to implement `eventFromMessage` method")},e.prototype.sendEvent=function(e){this._transport.sendEvent(e).then(null,(function(e){ye.k.error("Error while sending event: "+e)}))},e.prototype.sendSession=function(e){this._transport.sendSession?this._transport.sendSession(e).then(null,(function(e){ye.k.error("Error while sending session: "+e)})):ye.k.warn("Dropping session because custom transport doesn't implement sendSession")},e.prototype.getTransport=function(){return this._transport},e.prototype._setupTransport=function(){return new We},e}();!function(e){e.Fatal="fatal",e.Error="error",e.Warning="warning",e.Log="log",e.Info="info",e.Debug="debug",e.Critical="critical"}(He||(He={})),function(e){e.fromString=function(t){switch(t){case"debug":return e.Debug;case"info":return e.Info;case"warn":case"warning":return e.Warning;case"error":return e.Error;case"fatal":return e.Fatal;case"critical":return e.Critical;case"log":default:return e.Log}}}(He||(He={}));var $e=n(8823),Ve="?",qe=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ge=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ye=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Xe=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ke=/\((\S*)(?::(\d+))(?::(\d+))\)/,Qe=/Minified React error #\d+;/i;function Je(e){var t=null,n=0;e&&("number"==typeof e.framesToPop?n=e.framesToPop:Qe.test(e.message)&&(n=1));try{if(t=function(e){if(!e||!e.stacktrace)return null;for(var t,n=e.stacktrace,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\((.*)\))? in (.*):\s*$/i,o=n.split("\n"),a=[],s=0;s<o.length;s+=2){var l=null;(t=r.exec(o[s]))?l={url:t[2],func:t[3],args:[],line:+t[1],column:null}:(t=i.exec(o[s]))&&(l={url:t[6],func:t[3]||t[4],args:t[5]?t[5].split(","):[],line:+t[1],column:+t[2]}),l&&(!l.func&&l.line&&(l.func=Ve),a.push(l))}if(!a.length)return null;return{message:et(e),name:e.name,stack:a}}(e))return Ze(t,n)}catch(e){}try{if(t=function(e){if(!e||!e.stack)return null;for(var t,n,r,i=[],o=e.stack.split("\n"),a=0;a<o.length;++a){if(n=qe.exec(o[a])){var s=n[2]&&0===n[2].indexOf("native");n[2]&&0===n[2].indexOf("eval")&&(t=Ke.exec(n[2]))&&(n[2]=t[1],n[3]=t[2],n[4]=t[3]);var l=n[2]&&0===n[2].indexOf("address at ")?n[2].substr("address at ".length):n[2],u=n[1]||Ve,c=-1!==u.indexOf("safari-extension"),d=-1!==u.indexOf("safari-web-extension");(c||d)&&(u=-1!==u.indexOf("@")?u.split("@")[0]:Ve,l=c?"safari-extension:"+l:"safari-web-extension:"+l),r={url:l,func:u,args:s?[n[2]]:[],line:n[3]?+n[3]:null,column:n[4]?+n[4]:null}}else if(n=Ye.exec(o[a]))r={url:n[2],func:n[1]||Ve,args:[],line:+n[3],column:n[4]?+n[4]:null};else{if(!(n=Ge.exec(o[a])))continue;n[3]&&n[3].indexOf(" > eval")>-1&&(t=Xe.exec(n[3]))?(n[1]=n[1]||"eval",n[3]=t[1],n[4]=t[2],n[5]=""):0!==a||n[5]||void 0===e.columnNumber||(i[0].column=e.columnNumber+1),r={url:n[3],func:n[1]||Ve,args:n[2]?n[2].split(","):[],line:n[4]?+n[4]:null,column:n[5]?+n[5]:null}}!r.func&&r.line&&(r.func=Ve),i.push(r)}if(!i.length)return null;return{message:et(e),name:e.name,stack:i}}(e))return Ze(t,n)}catch(e){}return{message:et(e),name:e&&e.name,stack:[],failed:!0}}function Ze(e,t){try{return(0,me.pi)((0,me.pi)({},e),{stack:e.stack.slice(t)})}catch(t){return e}}function et(e){var t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function tt(e){var t=rt(e.stack),n={type:e.name,value:e.message};return t&&t.length&&(n.stacktrace={frames:t}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function nt(e){return{exception:{values:[tt(e)]}}}function rt(e){if(!e||!e.length)return[];var t=e,n=t[0].func||"",r=t[t.length-1].func||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(t=t.slice(1)),-1!==r.indexOf("sentryWrapped")&&(t=t.slice(0,-1)),t.slice(0,50).map((function(e){return{colno:null===e.column?void 0:e.column,filename:e.url||t[0].url,function:e.func||"?",in_app:!0,lineno:null===e.line?void 0:e.line}})).reverse()}function it(e,t,n){var r;if(void 0===n&&(n={}),(0,Le.VW)(e)&&e.error)return r=nt(Je(e=e.error));if((0,Le.TX)(e)||(0,Le.fm)(e)){var i=e,o=i.name||((0,Le.TX)(i)?"DOMError":"DOMException"),a=i.message?o+": "+i.message:o;return r=ot(a,t,n),(0,be.Db)(r,a),"code"in i&&(r.tags=(0,me.pi)((0,me.pi)({},r.tags),{"DOMException.code":""+i.code})),r}return(0,Le.VZ)(e)?r=nt(Je(e)):(0,Le.PO)(e)||(0,Le.cO)(e)?(r=function(e,t,n){var r={exception:{values:[{type:(0,Le.cO)(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:"Non-Error "+(n?"promise rejection":"exception")+" captured with keys: "+(0,De.zf)(e)}]},extra:{__serialized__:(0,De.Qy)(e)}};if(t){var i=rt(Je(t).stack);r.stacktrace={frames:i}}return r}(e,t,n.rejection),(0,be.EG)(r,{synthetic:!0}),r):(r=ot(e,t,n),(0,be.Db)(r,""+e,void 0),(0,be.EG)(r,{synthetic:!0}),r)}function ot(e,t,n){void 0===n&&(n={});var r={message:e};if(n.attachStacktrace&&t){var i=rt(Je(t).stack);r.stacktrace={frames:i}}return r}function at(e){if(e.metadata&&e.metadata.sdk){var t=e.metadata.sdk;return{name:t.name,version:t.version}}}function st(e,t){return t?(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=(0,me.fl)(e.sdk.integrations||[],t.integrations||[]),e.sdk.packages=(0,me.fl)(e.sdk.packages||[],t.packages||[]),e):e}function lt(e,t){var n=at(t),r="aggregates"in e?"sessions":"session";return{body:JSON.stringify((0,me.pi)((0,me.pi)({sent_at:(new Date).toISOString()},n&&{sdk:n}),t.forceEnvelope()&&{dsn:t.getDsn().toString()}))+"\n"+JSON.stringify({type:r})+"\n"+JSON.stringify(e),type:r,url:t.getEnvelopeEndpointWithUrlEncodedAuth()}}function ut(e,t){var n=at(t),r=e.type||"event",i="transaction"===r||t.forceEnvelope(),o=e.debug_meta||{},a=o.transactionSampling,s=(0,me._T)(o,["transactionSampling"]),l=a||{},u=l.method,c=l.rate;0===Object.keys(s).length?delete e.debug_meta:e.debug_meta=s;var d={body:JSON.stringify(n?st(e,t.metadata.sdk):e),type:r,url:i?t.getEnvelopeEndpointWithUrlEncodedAuth():t.getStoreEndpointWithUrlEncodedAuth()};if(i){var f=JSON.stringify((0,me.pi)((0,me.pi)({event_id:e.event_id,sent_at:(new Date).toISOString()},n&&{sdk:n}),t.forceEnvelope()&&{dsn:t.getDsn().toString()}))+"\n"+JSON.stringify({type:r,sample_rates:[{id:u,rate:c}]})+"\n"+d.body;d.body=f}return d}var ct=function(){function e(e,t,n){void 0===t&&(t={}),this.dsn=e,this._dsnObject=new Me(e),this.metadata=t,this._tunnel=n}return e.prototype.getDsn=function(){return this._dsnObject},e.prototype.forceEnvelope=function(){return!!this._tunnel},e.prototype.getBaseApiEndpoint=function(){var e=this.getDsn(),t=e.protocol?e.protocol+":":"",n=e.port?":"+e.port:"";return t+"//"+e.host+n+(e.path?"/"+e.path:"")+"/api/"},e.prototype.getStoreEndpoint=function(){return this._getIngestEndpoint("store")},e.prototype.getStoreEndpointWithUrlEncodedAuth=function(){return this.getStoreEndpoint()+"?"+this._encodedAuth()},e.prototype.getEnvelopeEndpointWithUrlEncodedAuth=function(){return this.forceEnvelope()?this._tunnel:this._getEnvelopeEndpoint()+"?"+this._encodedAuth()},e.prototype.getStoreEndpointPath=function(){var e=this.getDsn();return(e.path?"/"+e.path:"")+"/api/"+e.projectId+"/store/"},e.prototype.getRequestHeaders=function(e,t){var n=this.getDsn(),r=["Sentry sentry_version=7"];return r.push("sentry_client="+e+"/"+t),r.push("sentry_key="+n.publicKey),n.pass&&r.push("sentry_secret="+n.pass),{"Content-Type":"application/json","X-Sentry-Auth":r.join(", ")}},e.prototype.getReportDialogEndpoint=function(e){void 0===e&&(e={});var t=this.getDsn(),n=this.getBaseApiEndpoint()+"embed/error-page/",r=[];for(var i in r.push("dsn="+t.toString()),e)if("dsn"!==i)if("user"===i){if(!e.user)continue;e.user.name&&r.push("name="+encodeURIComponent(e.user.name)),e.user.email&&r.push("email="+encodeURIComponent(e.user.email))}else r.push(encodeURIComponent(i)+"="+encodeURIComponent(e[i]));return r.length?n+"?"+r.join("&"):n},e.prototype._getEnvelopeEndpoint=function(){return this._getIngestEndpoint("envelope")},e.prototype._getIngestEndpoint=function(e){return this._tunnel?this._tunnel:""+this.getBaseApiEndpoint()+this.getDsn().projectId+"/"+e+"/"},e.prototype._encodedAuth=function(){var e={sentry_key:this.getDsn().publicKey,sentry_version:"7"};return(0,De._j)(e)},e}(),dt=function(){function e(e){this._limit=e,this._buffer=[]}return e.prototype.isReady=function(){return void 0===this._limit||this.length()<this._limit},e.prototype.add=function(e){var t=this;if(!this.isReady())return Pe.c.reject(new Te("Not adding Promise due to buffer limit reached."));var n=e();return-1===this._buffer.indexOf(n)&&this._buffer.push(n),n.then((function(){return t.remove(n)})).then(null,(function(){return t.remove(n).then(null,(function(){}))})),n},e.prototype.remove=function(e){return this._buffer.splice(this._buffer.indexOf(e),1)[0]},e.prototype.length=function(){return this._buffer.length},e.prototype.drain=function(e){var t=this;return new Pe.c((function(n){var r=setTimeout((function(){e&&e>0&&n(!1)}),e);Pe.c.all(t._buffer).then((function(){clearTimeout(r),n(!0)})).then(null,(function(){n(!0)}))}))},e}(),ft={event:"error",transaction:"transaction",session:"session",attachment:"attachment"},pt=function(){function e(e){this.options=e,this._buffer=new dt(30),this._rateLimits={},this._api=new ct(e.dsn,e._metadata,e.tunnel),this.url=this._api.getStoreEndpointWithUrlEncodedAuth()}return e.prototype.sendEvent=function(e){throw new Te("Transport Class has to implement `sendEvent` method")},e.prototype.close=function(e){return this._buffer.drain(e)},e.prototype._handleResponse=function(e){var t=e.requestType,n=e.response,r=e.headers,i=e.resolve,o=e.reject,a=ze.fromHttpCode(n.status);this._handleRateLimit(r)&&ye.k.warn("Too many "+t+" requests, backing off until: "+this._disabledUntil(t)),a!==ze.Success?o(n):i({status:a})},e.prototype._disabledUntil=function(e){var t=ft[e];return this._rateLimits[t]||this._rateLimits.all},e.prototype._isRateLimited=function(e){return this._disabledUntil(e)>new Date(Date.now())},e.prototype._handleRateLimit=function(e){var t,n,r,i,o=Date.now(),a=e["x-sentry-rate-limits"],s=e["retry-after"];if(a){try{for(var l=(0,me.XA)(a.trim().split(",")),u=l.next();!u.done;u=l.next()){var c=u.value.split(":",2),d=parseInt(c[0],10),f=1e3*(isNaN(d)?60:d);try{for(var p=(r=void 0,(0,me.XA)(c[1].split(";"))),h=p.next();!h.done;h=p.next()){var m=h.value;this._rateLimits[m||"all"]=new Date(o+f)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return!0}return!!s&&(this._rateLimits.all=new Date(o+(0,be.JY)(o,s)),!0)},e}();var ht=function(e){function t(t,n){void 0===n&&(n=function(){var e,t,n=(0,be.Rf)();if((0,$e.Du)(n.fetch))return n.fetch.bind(n);var r=n.document,i=n.fetch;if("function"==typeof(null===(e=r)||void 0===e?void 0:e.createElement))try{var o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o),(null===(t=o.contentWindow)||void 0===t?void 0:t.fetch)&&(i=o.contentWindow.fetch),r.head.removeChild(o)}catch(e){ye.k.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return i.bind(n)}());var r=e.call(this,t)||this;return r._fetch=n,r}return(0,me.ZT)(t,e),t.prototype.sendEvent=function(e){return this._sendRequest(ut(e,this._api),e)},t.prototype.sendSession=function(e){return this._sendRequest(lt(e,this._api),e)},t.prototype._sendRequest=function(e,t){var n=this;if(this._isRateLimited(e.type))return Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429});var r={body:e.body,method:"POST",referrerPolicy:(0,$e.hv)()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(r,this.options.fetchParameters),void 0!==this.options.headers&&(r.headers=this.options.headers),this._buffer.add((function(){return new Pe.c((function(t,i){n._fetch(e.url,r).then((function(r){var o={"x-sentry-rate-limits":r.headers.get("X-Sentry-Rate-Limits"),"retry-after":r.headers.get("Retry-After")};n._handleResponse({requestType:e.type,response:r,headers:o,resolve:t,reject:i})})).catch(i)}))}))},t}(pt),mt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,me.ZT)(t,e),t.prototype.sendEvent=function(e){return this._sendRequest(ut(e,this._api),e)},t.prototype.sendSession=function(e){return this._sendRequest(lt(e,this._api),e)},t.prototype._sendRequest=function(e,t){var n=this;return this._isRateLimited(e.type)?Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429}):this._buffer.add((function(){return new Pe.c((function(t,r){var i=new XMLHttpRequest;for(var o in i.onreadystatechange=function(){if(4===i.readyState){var o={"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")};n._handleResponse({requestType:e.type,response:i,headers:o,resolve:t,reject:r})}},i.open("POST",e.url),n.options.headers)n.options.headers.hasOwnProperty(o)&&i.setRequestHeader(o,n.options.headers[o]);i.send(e.body)}))}))},t}(pt),vt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,me.ZT)(t,e),t.prototype.eventFromException=function(e,t){return function(e,t,n){var r=it(t,n&&n.syntheticException||void 0,{attachStacktrace:e.attachStacktrace});return(0,be.EG)(r,{handled:!0,type:"generic"}),r.level=He.Error,n&&n.event_id&&(r.event_id=n.event_id),Pe.c.resolve(r)}(this._options,e,t)},t.prototype.eventFromMessage=function(e,t,n){return void 0===t&&(t=He.Info),function(e,t,n,r){void 0===n&&(n=He.Info);var i=ot(t,r&&r.syntheticException||void 0,{attachStacktrace:e.attachStacktrace});return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),Pe.c.resolve(i)}(this._options,e,t,n)},t.prototype._setupTransport=function(){if(!this._options.dsn)return e.prototype._setupTransport.call(this);var t=(0,me.pi)((0,me.pi)({},this._options.transportOptions),{dsn:this._options.dsn,tunnel:this._options.tunnel,_metadata:this._options._metadata});return this._options.transport?new this._options.transport(t):(0,$e.Ak)()?new ht(t):new mt(t)},t}(Be);function gt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=(0,ge.Gd)();if(r&&r[e])return r[e].apply(r,(0,me.fl)(t));throw new Error("No hub defined or "+e+" was not found on the hub, please open a bug report.")}function yt(e,t){var n;try{throw new Error("Sentry syntheticException")}catch(e){n=e}return gt("captureException",e,{captureContext:t,originalException:e,syntheticException:n})}function bt(e){gt("withScope",e)}var wt=0;function xt(){return wt>0}function kt(){wt+=1,setTimeout((function(){wt-=1}))}function _t(e,t,n){if(void 0===t&&(t={}),"function"!=typeof e)return e;try{if(e.__sentry__)return e;if(e.__sentry_wrapped__)return e.__sentry_wrapped__}catch(t){return e}var r=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);var i=r.map((function(e){return _t(e,t)}));return e.handleEvent?e.handleEvent.apply(this,i):e.apply(this,i)}catch(e){throw kt(),bt((function(n){n.addEventProcessor((function(e){var n=(0,me.pi)({},e);return t.mechanism&&((0,be.Db)(n,void 0,void 0),(0,be.EG)(n,t.mechanism)),n.extra=(0,me.pi)((0,me.pi)({},n.extra),{arguments:r}),n})),yt(e)})),e}};try{for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}catch(e){}e.prototype=e.prototype||{},r.prototype=e.prototype,Object.defineProperty(e,"__sentry_wrapped__",{enumerable:!1,value:r}),Object.defineProperties(r,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:e}});try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:function(){return e.name}})}catch(e){}return r}function St(e){if(void 0===e&&(e={}),e.eventId)if(e.dsn){var t=document.createElement("script");t.async=!0,t.src=new ct(e.dsn).getReportDialogEndpoint(e),e.onLoad&&(t.onload=e.onLoad),(document.head||document.body).appendChild(t)}else ye.k.error("Missing dsn option in showReportDialog call");else ye.k.error("Missing eventId option in showReportDialog call")}var Ct=n(8464),Et=function(){function e(t){this.name=e.id,this._options=(0,me.pi)({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t)}return e.prototype.addSentryBreadcrumb=function(e){this._options.sentry&&(0,ge.Gd)().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:(0,be.jH)(e)},{event:e})},e.prototype.setupOnce=function(){var e=this;this._options.console&&(0,Se.o)({callback:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e._consoleBreadcrumb.apply(e,(0,me.fl)(t))},type:"console"}),this._options.dom&&(0,Se.o)({callback:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e._domBreadcrumb.apply(e,(0,me.fl)(t))},type:"dom"}),this._options.xhr&&(0,Se.o)({callback:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e._xhrBreadcrumb.apply(e,(0,me.fl)(t))},type:"xhr"}),this._options.fetch&&(0,Se.o)({callback:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e._fetchBreadcrumb.apply(e,(0,me.fl)(t))},type:"fetch"}),this._options.history&&(0,Se.o)({callback:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e._historyBreadcrumb.apply(e,(0,me.fl)(t))},type:"history"})},e.prototype._consoleBreadcrumb=function(e){var t={category:"console",data:{arguments:e.args,logger:"console"},level:He.fromString(e.level),message:(0,we.nK)(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;t.message="Assertion failed: "+((0,we.nK)(e.args.slice(1)," ")||"console.assert"),t.data.arguments=e.args.slice(1)}(0,ge.Gd)().addBreadcrumb(t,{input:e.args,level:e.level})},e.prototype._domBreadcrumb=function(e){var t,n="object"==typeof this._options.dom?this._options.dom.serializeAttribute:void 0;"string"==typeof n&&(n=[n]);try{t=e.event.target?(0,Ct.R)(e.event.target,n):(0,Ct.R)(e.event,n)}catch(e){t="<unknown>"}0!==t.length&&(0,ge.Gd)().addBreadcrumb({category:"ui."+e.name,message:t},{event:e.event,name:e.name,global:e.global})},e.prototype._xhrBreadcrumb=function(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;var t=e.xhr.__sentry_xhr__||{},n=t.method,r=t.url,i=t.status_code,o=t.body;(0,ge.Gd)().addBreadcrumb({category:"xhr",data:{method:n,url:r,status_code:i},type:"http"},{xhr:e.xhr,input:o})}else;},e.prototype._fetchBreadcrumb=function(e){e.endTimestamp&&(e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?(0,ge.Gd)().addBreadcrumb({category:"fetch",data:e.fetchData,level:He.Error,type:"http"},{data:e.error,input:e.args}):(0,ge.Gd)().addBreadcrumb({category:"fetch",data:(0,me.pi)((0,me.pi)({},e.fetchData),{status_code:e.response.status}),type:"http"},{input:e.args,response:e.response})))},e.prototype._historyBreadcrumb=function(e){var t=(0,be.Rf)(),n=e.from,r=e.to,i=(0,be.en)(t.location.href),o=(0,be.en)(n),a=(0,be.en)(r);o.path||(o=i),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),(0,ge.Gd)().addBreadcrumb({category:"navigation",data:{from:n,to:r}})},e.id="Breadcrumbs",e}(),jt=function(e){function t(t){void 0===t&&(t={});return t._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:Ce}],version:Ce},e.call(this,vt,t)||this}return(0,me.ZT)(t,e),t.prototype.showReportDialog=function(e){void 0===e&&(e={}),(0,be.Rf)().document&&(this._isEnabled()?St((0,me.pi)((0,me.pi)({},e),{dsn:e.dsn||this.getDsn()})):ye.k.error("Trying to call showReportDialog with Sentry Client disabled"))},t.prototype._prepareEvent=function(t,n,r){return t.platform=t.platform||"javascript",e.prototype._prepareEvent.call(this,t,n,r)},t.prototype._sendEvent=function(t){var n=this.getIntegration(Et);n&&n.addSentryBreadcrumb(t),e.prototype._sendEvent.call(this,t)},t}(Ue),Tt=n(360),Ot=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Nt=function(){function e(t){this.name=e.id,this._options=(0,me.pi)({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t)}return e.prototype.setupOnce=function(){var e=(0,be.Rf)();(this._options.setTimeout&&(0,De.hl)(e,"setTimeout",this._wrapTimeFunction.bind(this)),this._options.setInterval&&(0,De.hl)(e,"setInterval",this._wrapTimeFunction.bind(this)),this._options.requestAnimationFrame&&(0,De.hl)(e,"requestAnimationFrame",this._wrapRAF.bind(this)),this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&(0,De.hl)(XMLHttpRequest.prototype,"send",this._wrapXHR.bind(this)),this._options.eventTarget)&&(Array.isArray(this._options.eventTarget)?this._options.eventTarget:Ot).forEach(this._wrapEventTarget.bind(this))},e.prototype._wrapTimeFunction=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t[0];return t[0]=_t(r,{mechanism:{data:{function:(0,Tt.$)(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}},e.prototype._wrapRAF=function(e){return function(t){return e.call(this,_t(t,{mechanism:{data:{function:"requestAnimationFrame",handler:(0,Tt.$)(e)},handled:!0,type:"instrument"}}))}},e.prototype._wrapEventTarget=function(e){var t=(0,be.Rf)(),n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,De.hl)(n,"addEventListener",(function(t){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=_t(r.handleEvent.bind(r),{mechanism:{data:{function:"handleEvent",handler:(0,Tt.$)(r),target:e},handled:!0,type:"instrument"}}))}catch(e){}return t.call(this,n,_t(r,{mechanism:{data:{function:"addEventListener",handler:(0,Tt.$)(r),target:e},handled:!0,type:"instrument"}}),i)}})),(0,De.hl)(n,"removeEventListener",(function(e){return function(t,n,r){var i,o=n;try{var a=null===(i=o)||void 0===i?void 0:i.__sentry_wrapped__;a&&e.call(this,t,a,r)}catch(e){}return e.call(this,t,o,r)}})))},e.prototype._wrapXHR=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=this,i=["onload","onerror","onprogress","onreadystatechange"];return i.forEach((function(e){e in r&&"function"==typeof r[e]&&(0,De.hl)(r,e,(function(t){var n={mechanism:{data:{function:e,handler:(0,Tt.$)(t)},handled:!0,type:"instrument"}};return t.__sentry_original__&&(n.mechanism.data.handler=(0,Tt.$)(t.__sentry_original__)),_t(t,n)}))})),e.apply(this,t)}},e.id="TryCatch",e}(),Mt=function(){function e(t){this.name=e.id,this._onErrorHandlerInstalled=!1,this._onUnhandledRejectionHandlerInstalled=!1,this._options=(0,me.pi)({onerror:!0,onunhandledrejection:!0},t)}return e.prototype.setupOnce=function(){Error.stackTraceLimit=50,this._options.onerror&&(ye.k.log("Global Handler attached: onerror"),this._installGlobalOnErrorHandler()),this._options.onunhandledrejection&&(ye.k.log("Global Handler attached: onunhandledrejection"),this._installGlobalOnUnhandledRejectionHandler())},e.prototype._installGlobalOnErrorHandler=function(){var t=this;this._onErrorHandlerInstalled||((0,Se.o)({callback:function(n){var r=n.error,i=(0,ge.Gd)(),o=i.getIntegration(e),a=r&&!0===r.__sentry_own_request__;if(o&&!xt()&&!a){var s=i.getClient(),l=void 0===r&&(0,Le.HD)(n.msg)?t._eventFromIncompleteOnError(n.msg,n.url,n.line,n.column):t._enhanceEventWithInitialFrame(it(r||n.msg,void 0,{attachStacktrace:s&&s.getOptions().attachStacktrace,rejection:!1}),n.url,n.line,n.column);(0,be.EG)(l,{handled:!1,type:"onerror"}),i.captureEvent(l,{originalException:r})}},type:"error"}),this._onErrorHandlerInstalled=!0)},e.prototype._installGlobalOnUnhandledRejectionHandler=function(){var t=this;this._onUnhandledRejectionHandlerInstalled||((0,Se.o)({callback:function(n){var r=n;try{"reason"in n?r=n.reason:"detail"in n&&"reason"in n.detail&&(r=n.detail.reason)}catch(e){}var i=(0,ge.Gd)(),o=i.getIntegration(e),a=r&&!0===r.__sentry_own_request__;if(!o||xt()||a)return!0;var s=i.getClient(),l=(0,Le.pt)(r)?t._eventFromRejectionWithPrimitive(r):it(r,void 0,{attachStacktrace:s&&s.getOptions().attachStacktrace,rejection:!0});l.level=He.Error,(0,be.EG)(l,{handled:!1,type:"onunhandledrejection"}),i.captureEvent(l,{originalException:r})},type:"unhandledrejection"}),this._onUnhandledRejectionHandlerInstalled=!0)},e.prototype._eventFromIncompleteOnError=function(e,t,n,r){var i,o=(0,Le.VW)(e)?e.message:e,a=o.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);a&&(i=a[1],o=a[2]);var s={exception:{values:[{type:i||"Error",value:o}]}};return this._enhanceEventWithInitialFrame(s,t,n,r)},e.prototype._eventFromRejectionWithPrimitive=function(e){return{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(e)}]}}},e.prototype._enhanceEventWithInitialFrame=function(e,t,n,r){e.exception=e.exception||{},e.exception.values=e.exception.values||[],e.exception.values[0]=e.exception.values[0]||{},e.exception.values[0].stacktrace=e.exception.values[0].stacktrace||{},e.exception.values[0].stacktrace.frames=e.exception.values[0].stacktrace.frames||[];var i=isNaN(parseInt(r,10))?void 0:r,o=isNaN(parseInt(n,10))?void 0:n,a=(0,Le.HD)(t)&&t.length>0?t:(0,be.l4)();return 0===e.exception.values[0].stacktrace.frames.length&&e.exception.values[0].stacktrace.frames.push({colno:i,filename:a,function:"?",in_app:!0,lineno:o}),e},e.id="GlobalHandlers",e}(),Lt=function(){function e(t){void 0===t&&(t={}),this.name=e.id,this._key=t.key||"cause",this._limit=t.limit||5}return e.prototype.setupOnce=function(){(0,ve.c)((function(t,n){var r=(0,ge.Gd)().getIntegration(e);return r?r._handler(t,n):t}))},e.prototype._handler=function(e,t){if(!(e.exception&&e.exception.values&&t&&(0,Le.V9)(t.originalException,Error)))return e;var n=this._walkErrorTree(t.originalException,this._key);return e.exception.values=(0,me.fl)(n,e.exception.values),e},e.prototype._walkErrorTree=function(e,t,n){if(void 0===n&&(n=[]),!(0,Le.V9)(e[t],Error)||n.length+1>=this._limit)return n;var r=tt(Je(e[t]));return this._walkErrorTree(e[t],t,(0,me.fl)([r],n))},e.id="LinkedErrors",e}(),Pt=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(t,n){t((function(t){var r=n().getIntegration(e);if(r){try{if(r._shouldDropEvent(t,r._previousEvent))return null}catch(e){return r._previousEvent=t}return r._previousEvent=t}return t}))},e.prototype._shouldDropEvent=function(e,t){return!!t&&(!!this._isSameMessageEvent(e,t)||!!this._isSameExceptionEvent(e,t))},e.prototype._isSameMessageEvent=function(e,t){var n=e.message,r=t.message;return!(!n&&!r)&&(!(n&&!r||!n&&r)&&(n===r&&(!!this._isSameFingerprint(e,t)&&!!this._isSameStacktrace(e,t))))},e.prototype._getFramesFromEvent=function(e){var t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(e){return}else if(e.stacktrace)return e.stacktrace.frames},e.prototype._isSameStacktrace=function(e,t){var n=this._getFramesFromEvent(e),r=this._getFramesFromEvent(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(n=n,(r=r).length!==n.length)return!1;for(var i=0;i<r.length;i++){var o=r[i],a=n[i];if(o.filename!==a.filename||o.lineno!==a.lineno||o.colno!==a.colno||o.function!==a.function)return!1}return!0},e.prototype._getExceptionFromEvent=function(e){return e.exception&&e.exception.values&&e.exception.values[0]},e.prototype._isSameExceptionEvent=function(e,t){var n=this._getExceptionFromEvent(t),r=this._getExceptionFromEvent(e);return!(!n||!r)&&(n.type===r.type&&n.value===r.value&&(!!this._isSameFingerprint(e,t)&&!!this._isSameStacktrace(e,t)))},e.prototype._isSameFingerprint=function(e,t){var n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return!(n.join("")!==r.join(""))}catch(e){return!1}},e.id="Dedupe",e}(),At=(0,be.Rf)(),Dt=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){(0,ve.c)((function(t){var n,r,i;if((0,ge.Gd)().getIntegration(e)){if(!At.navigator&&!At.location&&!At.document)return t;var o=(null===(n=t.request)||void 0===n?void 0:n.url)||(null===(r=At.location)||void 0===r?void 0:r.href),a=(At.document||{}).referrer,s=(At.navigator||{}).userAgent,l=(0,me.pi)((0,me.pi)((0,me.pi)({},null===(i=t.request)||void 0===i?void 0:i.headers),a&&{Referer:a}),s&&{"User-Agent":s}),u=(0,me.pi)((0,me.pi)({},o&&{url:o}),{headers:l});return(0,me.pi)((0,me.pi)({},t),{request:u})}return t}))},e.id="UserAgent",e}(),Rt=[new ke,new _e,new Nt,new Et,new Mt,new Lt,new Pt,new Dt];function It(e){if(void 0===e&&(e={}),void 0===e.defaultIntegrations&&(e.defaultIntegrations=Rt),void 0===e.release){var t=(0,be.Rf)();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(e.release=t.SENTRY_RELEASE.id)}void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),function(e,t){var n;!0===t.debug&&ye.k.enable();var r=(0,ge.Gd)();null===(n=r.getScope())||void 0===n||n.update(t.initialScope);var i=new e(t);r.bindClient(i)}(jt,e),e.autoSessionTracking&&function(){if(void 0===(0,be.Rf)().document)return void ye.k.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");var e=(0,ge.Gd)();if("function"!=typeof e.startSession||"function"!=typeof e.captureSession)return;e.startSession({ignoreDuration:!0}),e.captureSession(),(0,Se.o)({callback:function(t){var n=t.from,r=t.to;void 0!==n&&n!==r&&(e.startSession({ignoreDuration:!0}),e.captureSession())},type:"history"})}()}var Ft,zt=(0,be.Rf)();function Ut(e,t,n){return Ht(e,"react-router-v5",t,n)}function Ht(e,t,n,r){function i(e){if(n===[]||!r)return e;for(var t=Wt(n,e,r),i=0;i<t.length;i++)if(t[i].match.isExact)return t[i].match.path;return e}return void 0===n&&(n=[]),function(n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!0);var a=e&&e.location?e.location.pathname:zt&&zt.location?zt.location.pathname:void 0;r&&a&&(Ft=n({name:i(a),op:"pageload",tags:{"routing.instrumentation":t}})),o&&e.listen&&e.listen((function(e,r){if(r&&("PUSH"===r||"POP"===r)){Ft&&Ft.finish();var o={"routing.instrumentation":t};Ft=n({name:i(e.pathname),op:"navigation",tags:o})}}))}}function Wt(e,t,n,r){return void 0===r&&(r=[]),e.some((function(e){var i=e.path?n(t,e):r.length?r[r.length-1].match:function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}}(t);return i&&(r.push({route:e,match:i}),e.routes&&Wt(e.routes,t,n,r)),!!i})),r}var Bt=n(6141),$t=n(6458),Vt=n(5734),qt=n(3233),Gt=(0,be.Rf)();var Yt,Xt,Kt=n(1422),Qt=function(e,t,n,r){var i;return function(){n&&t.isFinal&&n.disconnect(),t.value>=0&&(r||t.isFinal||"hidden"===document.visibilityState)&&(t.delta=t.value-(i||0),(t.delta||t.isFinal||void 0===i)&&(e(t),i=t.value))}},Jt=function(e,t){return void 0===t&&(t=-1),{name:e,value:t,delta:0,entries:[],id:Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),isFinal:!1}},Zt=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(e){}},en=!1,tn=!1,nn=function(e){en=!e.persisted},rn=function(e,t){void 0===t&&(t=!1),tn||(addEventListener("pagehide",nn),addEventListener("beforeunload",(function(){})),tn=!0),addEventListener("visibilitychange",(function(t){var n=t.timeStamp;"hidden"===document.visibilityState&&e({timeStamp:n,isUnloading:en})}),{capture:!0,once:t})},on=function(){return void 0===Yt&&(Yt="hidden"===document.visibilityState?0:1/0,rn((function(e){var t=e.timeStamp;return Yt=t}),!0)),{get timeStamp(){return Yt}}},an=function(e,t){void 0===t&&(t=!1);var n,r=Jt("LCP"),i=on(),o=function(e){var t=e.startTime;t<i.timeStamp?(r.value=t,r.entries.push(e)):r.isFinal=!0,n()},a=Zt("largest-contentful-paint",o);if(a){n=Qt(e,r,a,t);var s=function(){r.isFinal||(a.takeRecords().map(o),r.isFinal=!0,n())};(Xt||(Xt=new Promise((function(e){return["scroll","keydown","pointerdown"].map((function(t){addEventListener(t,e,{once:!0,passive:!0,capture:!0})}))}))),Xt).then(s),rn(s,!0)}},sn=(0,be.Rf)(),ln=function(){function e(){var e;this._measurements={},this._performanceCursor=0,!(0,Kt.KV)()&&(null===(e=sn)||void 0===e?void 0:e.performance)&&(sn.performance.mark&&sn.performance.mark("sentry-tracing-init"),this._trackCLS(),this._trackLCP(),this._trackFID())}return e.prototype.addPerformanceEntries=function(e){var t=this;if(sn&&sn.performance&&sn.performance.getEntries&&Ae.Z1){ye.k.log("[Tracing] Adding & adjusting spans using Performance API");var n,r,i,o,a,s=(0,qt.XL)(Ae.Z1);if(sn.document)for(var l=0;l<document.scripts.length;l++)if("true"===document.scripts[l].dataset.entry){n=document.scripts[l].src;break}if(sn.performance.getEntries().slice(this._performanceCursor).forEach((function(l){var u=(0,qt.XL)(l.startTime),c=(0,qt.XL)(l.duration);if(!("navigation"===e.op&&s+u<e.startTimestamp))switch(l.entryType){case"navigation":!function(e,t,n){un({transaction:e,entry:t,event:"unloadEvent",timeOrigin:n}),un({transaction:e,entry:t,event:"redirect",timeOrigin:n}),un({transaction:e,entry:t,event:"domContentLoadedEvent",timeOrigin:n}),un({transaction:e,entry:t,event:"loadEvent",timeOrigin:n}),un({transaction:e,entry:t,event:"connect",timeOrigin:n}),un({transaction:e,entry:t,event:"secureConnection",timeOrigin:n,eventEnd:"connectEnd",description:"TLS/SSL"}),un({transaction:e,entry:t,event:"fetch",timeOrigin:n,eventEnd:"domainLookupStart",description:"cache"}),un({transaction:e,entry:t,event:"domainLookup",timeOrigin:n,description:"DNS"}),function(e,t,n){cn(e,{op:"browser",description:"request",startTimestamp:n+(0,qt.XL)(t.requestStart),endTimestamp:n+(0,qt.XL)(t.responseEnd)}),cn(e,{op:"browser",description:"response",startTimestamp:n+(0,qt.XL)(t.responseStart),endTimestamp:n+(0,qt.XL)(t.responseEnd)})}(e,t,n)}(e,l,s),o=s+(0,qt.XL)(l.responseStart),a=s+(0,qt.XL)(l.requestStart);break;case"mark":case"paint":case"measure":var d=function(e,t,n,r,i){var o=i+n,a=o+r;return cn(e,{description:t.name,endTimestamp:a,op:t.entryType,startTimestamp:o}),o}(e,l,u,c,s);void 0===i&&"sentry-tracing-init"===l.name&&(i=d);var f=on(),p=l.startTime<f.timeStamp;"first-paint"===l.name&&p&&(ye.k.log("[Measurements] Adding FP"),t._measurements.fp={value:l.startTime},t._measurements["mark.fp"]={value:d}),"first-contentful-paint"===l.name&&p&&(ye.k.log("[Measurements] Adding FCP"),t._measurements.fcp={value:l.startTime},t._measurements["mark.fcp"]={value:d});break;case"resource":var h=l.name.replace(window.location.origin,""),m=function(e,t,n,r,i,o){if("xmlhttprequest"===t.initiatorType||"fetch"===t.initiatorType)return;var a={};"transferSize"in t&&(a["Transfer Size"]=t.transferSize);"encodedBodySize"in t&&(a["Encoded Body Size"]=t.encodedBodySize);"decodedBodySize"in t&&(a["Decoded Body Size"]=t.decodedBodySize);var s=o+r,l=s+i;return cn(e,{description:n,endTimestamp:l,op:t.initiatorType?"resource."+t.initiatorType:"resource",startTimestamp:s,data:a}),l}(e,l,h,u,c,s);void 0===r&&(n||"").indexOf(h)>-1&&(r=m)}})),void 0!==r&&void 0!==i&&cn(e,{description:"evaluation",endTimestamp:i,op:"script",startTimestamp:r}),this._performanceCursor=Math.max(performance.getEntries().length-1,0),this._trackNavigator(e),"pageload"===e.op){var u=(0,qt.XL)(Ae.Z1);"number"==typeof o&&(ye.k.log("[Measurements] Adding TTFB"),this._measurements.ttfb={value:1e3*(o-e.startTimestamp)},"number"==typeof a&&a<=o&&(this._measurements["ttfb.requestTime"]={value:1e3*(o-a)})),["fcp","fp","lcp"].forEach((function(n){if(t._measurements[n]&&!(u>=e.startTimestamp)){var r=t._measurements[n].value,i=u+(0,qt.XL)(r),o=Math.abs(1e3*(i-e.startTimestamp)),a=o-r;ye.k.log("[Measurements] Normalized "+n+" from "+r+" to "+o+" ("+a+")"),t._measurements[n].value=o}})),this._measurements["mark.fid"]&&this._measurements.fid&&cn(e,{description:"first input delay",endTimestamp:this._measurements["mark.fid"].value+(0,qt.XL)(this._measurements.fid.value),op:"web.vitals",startTimestamp:this._measurements["mark.fid"].value}),e.setMeasurements(this._measurements),this._tagMetricInfo(e)}}},e.prototype._tagMetricInfo=function(e){this._lcpEntry&&(ye.k.log("[Measurements] Adding LCP Data"),this._lcpEntry.element&&e.setTag("lcp.element",(0,Ct.R)(this._lcpEntry.element)),this._lcpEntry.id&&e.setTag("lcp.id",this._lcpEntry.id),this._lcpEntry.url&&e.setTag("lcp.url",this._lcpEntry.url.trim().slice(0,200)),e.setTag("lcp.size",this._lcpEntry.size)),this._clsEntry&&(ye.k.log("[Measurements] Adding CLS Data"),this._clsEntry.sources.map((function(t,n){return e.setTag("cls.source."+(n+1),(0,Ct.R)(t.node))})))},e.prototype._trackCLS=function(){var e=this;!function(e,t){void 0===t&&(t=!1);var n,r=Jt("CLS",0),i=function(e){e.hadRecentInput||(r.value+=e.value,r.entries.push(e),n())},o=Zt("layout-shift",i);o&&(n=Qt(e,r,o,t),rn((function(e){var t=e.isUnloading;o.takeRecords().map(i),t&&(r.isFinal=!0),n()})))}((function(t){var n=t.entries.pop();n&&(ye.k.log("[Measurements] Adding CLS"),e._measurements.cls={value:t.value},e._clsEntry=n)}))},e.prototype._trackNavigator=function(e){var t=sn.navigator;if(t){var n=t.connection;n&&(n.effectiveType&&e.setTag("effectiveConnectionType",n.effectiveType),n.type&&e.setTag("connectionType",n.type),dn(n.rtt)&&(this._measurements["connection.rtt"]={value:n.rtt}),dn(n.downlink)&&(this._measurements["connection.downlink"]={value:n.downlink})),dn(t.deviceMemory)&&e.setTag("deviceMemory",String(t.deviceMemory)),dn(t.hardwareConcurrency)&&e.setTag("hardwareConcurrency",String(t.hardwareConcurrency))}},e.prototype._trackLCP=function(){var e=this;an((function(t){var n=t.entries.pop();if(n){var r=(0,qt.XL)(Ae.Z1),i=(0,qt.XL)(n.startTime);ye.k.log("[Measurements] Adding LCP"),e._measurements.lcp={value:t.value},e._measurements["mark.lcp"]={value:r+i},e._lcpEntry=n}}))},e.prototype._trackFID=function(){var e,t,n,r,i,o,a=this;e=function(e){var t=e.entries.pop();if(t){var n=(0,qt.XL)(Ae.Z1),r=(0,qt.XL)(t.startTime);ye.k.log("[Measurements] Adding FID"),a._measurements.fid={value:e.value},a._measurements["mark.fid"]={value:n+r}}},t=Jt("FID"),n=on(),i=Zt("first-input",r=function(e){e.startTime<n.timeStamp&&(t.value=e.processingStart-e.startTime,t.entries.push(e),t.isFinal=!0,o())}),o=Qt(e,t,i),i?rn((function(){i.takeRecords().map(r),i.disconnect()}),!0):window.perfMetrics&&window.perfMetrics.onFirstInputDelay&&window.perfMetrics.onFirstInputDelay((function(e,r){r.timeStamp<n.timeStamp&&(t.value=e,t.isFinal=!0,t.entries=[{entryType:"first-input",name:r.type,target:r.target,cancelable:r.cancelable,startTime:r.timeStamp,processingStart:r.timeStamp+e}],o())}))},e}();function un(e){var t=e.transaction,n=e.entry,r=e.event,i=e.timeOrigin,o=e.eventEnd,a=e.description,s=o?n[o]:n[r+"End"],l=n[r+"Start"];l&&s&&cn(t,{op:"browser",description:null!=a?a:r,startTimestamp:i+(0,qt.XL)(l),endTimestamp:i+(0,qt.XL)(s)})}function cn(e,t){var n=t.startTimestamp,r=(0,me._T)(t,["startTimestamp"]);return n&&e.startTimestamp>n&&(e.startTimestamp=n),e.startChild((0,me.pi)({startTimestamp:n},r))}function dn(e){return"number"==typeof e&&isFinite(e)}var fn={traceFetch:!0,traceXHR:!0,tracingOrigins:["localhost",/^\//]};function pn(e){var t=(0,me.pi)((0,me.pi)({},fn),e),n=t.traceFetch,r=t.traceXHR,i=t.tracingOrigins,o=t.shouldCreateSpanForRequest,a={},s=function(e){if(a[e])return a[e];var t=i;return a[e]=t.some((function(t){return(0,we.zC)(e,t)}))&&!(0,we.zC)(e,"sentry_key"),a[e]},l=s;"function"==typeof o&&(l=function(e){return s(e)&&o(e)});var u={};n&&(0,Se.o)({callback:function(e){!function(e,t,n){if(!(0,qt.zu)()||!e.fetchData||!t(e.fetchData.url))return;if(e.endTimestamp&&e.fetchData.__span){return void((i=n[e.fetchData.__span])&&(e.response?i.setHttpStatus(e.response.status):e.error&&i.setStatus(Vt.p.InternalError),i.finish(),delete n[e.fetchData.__span]))}var r=(0,qt.x1)();if(r){var i=r.startChild({data:(0,me.pi)((0,me.pi)({},e.fetchData),{type:"fetch"}),description:e.fetchData.method+" "+e.fetchData.url,op:"http"});e.fetchData.__span=i.spanId,n[i.spanId]=i;var o=e.args[0]=e.args[0],a=e.args[1]=e.args[1]||{},s=a.headers;(0,Le.V9)(o,Request)&&(s=o.headers),s?"function"==typeof s.append?s.append("sentry-trace",i.toTraceparent()):s=Array.isArray(s)?(0,me.fl)(s,[["sentry-trace",i.toTraceparent()]]):(0,me.pi)((0,me.pi)({},s),{"sentry-trace":i.toTraceparent()}):s={"sentry-trace":i.toTraceparent()},a.headers=s}}(e,l,u)},type:"fetch"}),r&&(0,Se.o)({callback:function(e){!function(e,t,n){var r,i;if(!(0,qt.zu)()||(null===(r=e.xhr)||void 0===r?void 0:r.__sentry_own_request__)||!(null===(i=e.xhr)||void 0===i?void 0:i.__sentry_xhr__)||!t(e.xhr.__sentry_xhr__.url))return;var o=e.xhr.__sentry_xhr__;if(e.endTimestamp&&e.xhr.__sentry_xhr_span_id__){return void((s=n[e.xhr.__sentry_xhr_span_id__])&&(s.setHttpStatus(o.status_code),s.finish(),delete n[e.xhr.__sentry_xhr_span_id__]))}var a=(0,qt.x1)();if(a){var s=a.startChild({data:(0,me.pi)((0,me.pi)({},o.data),{type:"xhr",method:o.method,url:o.url}),description:o.method+" "+o.url,op:"http"});if(e.xhr.__sentry_xhr_span_id__=s.spanId,n[e.xhr.__sentry_xhr_span_id__]=s,e.xhr.setRequestHeader)try{e.xhr.setRequestHeader("sentry-trace",s.toTraceparent())}catch(e){}}}(e,l,u)},type:"xhr"})}var hn=(0,be.Rf)();var mn=(0,me.pi)({idleTimeout:$t.nT,markBackgroundTransactions:!0,maxTransactionDuration:600,routingInstrumentation:function(e,t,n){if(void 0===t&&(t=!0),void 0===n&&(n=!0),hn&&hn.location){var r,i=hn.location.href;t&&(r=e({name:hn.location.pathname,op:"pageload"})),n&&(0,Se.o)({callback:function(t){var n=t.to,o=t.from;void 0===o&&i&&-1!==i.indexOf(n)?i=void 0:o!==n&&(i=void 0,r&&(ye.k.log("[Tracing] Finishing current transaction with op: "+r.op),r.finish()),r=e({name:hn.location.pathname,op:"navigation"}))},type:"history"})}else ye.k.warn("Could not initialize routing instrumentation due to invalid location")},startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0},fn),vn=function(){function e(t){this.name=e.id,this._metrics=new ln,this._emitOptionsWarning=!1;var n=fn.tracingOrigins;t&&t.tracingOrigins&&Array.isArray(t.tracingOrigins)&&0!==t.tracingOrigins.length?n=t.tracingOrigins:this._emitOptionsWarning=!0,this.options=(0,me.pi)((0,me.pi)((0,me.pi)({},mn),t),{tracingOrigins:n})}return e.prototype.setupOnce=function(e,t){var n=this;this._getCurrentHub=t,this._emitOptionsWarning&&(ye.k.warn("[Tracing] You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace."),ye.k.warn("[Tracing] We added a reasonable default for you: "+fn.tracingOrigins));var r=this.options,i=r.routingInstrumentation,o=r.startTransactionOnLocationChange,a=r.startTransactionOnPageLoad,s=r.markBackgroundTransactions,l=r.traceFetch,u=r.traceXHR,c=r.tracingOrigins,d=r.shouldCreateSpanForRequest;i((function(e){return n._createRouteTransaction(e)}),a,o),s&&(Gt&&Gt.document?Gt.document.addEventListener("visibilitychange",(function(){var e=(0,qt.x1)();Gt.document.hidden&&e&&(ye.k.log("[Tracing] Transaction: "+Vt.p.Cancelled+" -> since tab moved to the background, op: "+e.op),e.status||e.setStatus(Vt.p.Cancelled),e.setTag("visibilitychange","document.hidden"),e.finish())})):ye.k.warn("[Tracing] Could not set up background tab detection due to lack of global document")),pn({traceFetch:l,traceXHR:u,tracingOrigins:c,shouldCreateSpanForRequest:d})},e.prototype._createRouteTransaction=function(e){var t=this;if(this._getCurrentHub){var n=this.options,r=n.beforeNavigate,i=n.idleTimeout,o=n.maxTransactionDuration,a="pageload"===e.op?function(){var e=(t="sentry-trace",n=document.querySelector("meta[name="+t+"]"),n?n.getAttribute("content"):null);var t,n;if(e)return(0,qt.qG)(e);return}():void 0,s=(0,me.pi)((0,me.pi)((0,me.pi)({},e),a),{trimEnd:!0}),l="function"==typeof r?r(s):s,u=void 0===l?(0,me.pi)((0,me.pi)({},s),{sampled:!1}):l;!1===u.sampled&&ye.k.log("[Tracing] Will not send "+u.op+" transaction because of beforeNavigate."),ye.k.log("[Tracing] Starting "+u.op+" transaction on scope");var c=this._getCurrentHub(),d=(0,be.Rf)().location,f=(0,Bt.lb)(c,u,i,!0,{location:d});return f.registerBeforeFinishCallback((function(e,n){t._metrics.addPerformanceEntries(e),function(e,t,n){var r=n-t.startTimestamp;n&&(r>e||r<0)&&(t.setStatus(Vt.p.DeadlineExceeded),t.setTag("maxTransactionDurationExceeded","true"))}((0,qt.WB)(o),e,n)})),f}ye.k.warn("[Tracing] Did not create "+e.op+" transaction because _getCurrentHub is invalid.")},e.id="BrowserTracing",e}();var gn=function(){function e(t){void 0===t&&(t={}),this.name=e.id,this._router=t.router||t.app,this._methods=(Array.isArray(t.methods)?t.methods:[]).concat("use")}return e.prototype.setupOnce=function(){this._router?function(e,t){void 0===t&&(t=[]);t.forEach((function(t){return function(e,t){var n=e[t];return e[t]=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.call.apply(n,(0,me.fl)([this],bn(e,t)))},e}(e,t)}))}(this._router,this._methods):ye.k.error("ExpressIntegration is missing an Express instance")},e.id="Express",e}();function yn(e,t){var n=e.length;switch(n){case 2:return function(n,r){var i=r.__sentry_transaction;if(i){var o=i.startChild({description:e.name,op:"middleware."+t});r.once("finish",(function(){o.finish()}))}return e.call(this,n,r)};case 3:return function(n,r,i){var o,a=null===(o=r.__sentry_transaction)||void 0===o?void 0:o.startChild({description:e.name,op:"middleware."+t});e.call(this,n,r,(function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];null===(e=a)||void 0===e||e.finish(),i.call.apply(i,(0,me.fl)([this],t))}))};case 4:return function(n,r,i,o){var a,s=null===(a=i.__sentry_transaction)||void 0===a?void 0:a.startChild({description:e.name,op:"middleware."+t});e.call(this,n,r,i,(function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];null===(e=s)||void 0===e||e.finish(),o.call.apply(o,(0,me.fl)([this],t))}))};default:throw new Error("Express middleware takes 2-4 arguments. Got: "+n)}}function bn(e,t){return e.map((function(e){return"function"==typeof e?yn(e,t):Array.isArray(e)?e.map((function(e){return"function"==typeof e?yn(e,t):e})):e}))}var wn=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(e,t){var n=(0,Kt.$y)("pg");n?(0,De.hl)(n.Client.prototype,"query",(function(e){return function(n,r,i){var o,a,s,l=null===(a=null===(o=t().getScope())||void 0===o?void 0:o.getSpan())||void 0===a?void 0:a.startChild({description:"string"==typeof n?n:n.text,op:"db"});if("function"==typeof i)return e.call(this,n,r,(function(e,t){var n;null===(n=l)||void 0===n||n.finish(),i(e,t)}));if("function"==typeof r)return e.call(this,n,(function(e,t){var n;null===(n=l)||void 0===n||n.finish(),r(e,t)}));var u=void 0!==r?e.call(this,n,r):e.call(this,n);return(0,Le.J8)(u)?u.then((function(e){var t;return null===(t=l)||void 0===t||t.finish(),e})):(null===(s=l)||void 0===s||s.finish(),u)}})):ye.k.error("Postgres Integration was unable to require `pg` package.")},e.id="Postgres",e}(),xn=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(e,t){var n=(0,Kt.$y)("mysql/lib/Connection.js");n?(0,De.hl)(n,"createQuery",(function(e){return function(n,r,i){var o,a,s=null===(a=null===(o=t().getScope())||void 0===o?void 0:o.getSpan())||void 0===a?void 0:a.startChild({description:"string"==typeof n?n:n.sql,op:"db"});return"function"==typeof i?e.call(this,n,r,(function(e,t,n){var r;null===(r=s)||void 0===r||r.finish(),i(e,t,n)})):"function"==typeof r?e.call(this,n,(function(e,t,n){var i;null===(i=s)||void 0===i||i.finish(),r(e,t,n)})):e.call(this,n,r,i)}})):ye.k.error("Mysql Integration was unable to require `mysql` package.")},e.id="Mysql",e}(),kn=["aggregate","bulkWrite","countDocuments","createIndex","createIndexes","deleteMany","deleteOne","distinct","drop","dropIndex","dropIndexes","estimatedDocumentCount","find","findOne","findOneAndDelete","findOneAndReplace","findOneAndUpdate","indexes","indexExists","indexInformation","initializeOrderedBulkOp","insertMany","insertOne","isCapped","mapReduce","options","parallelCollectionScan","rename","replaceOne","stats","updateMany","updateOne"],_n={bulkWrite:["operations"],countDocuments:["query"],createIndex:["fieldOrSpec"],createIndexes:["indexSpecs"],deleteMany:["filter"],deleteOne:["filter"],distinct:["key","query"],dropIndex:["indexName"],find:["query"],findOne:["query"],findOneAndDelete:["filter"],findOneAndReplace:["filter","replacement"],findOneAndUpdate:["filter","update"],indexExists:["indexes"],insertMany:["docs"],insertOne:["doc"],mapReduce:["map","reduce"],rename:["newName"],replaceOne:["filter","doc"],updateMany:["filter","update"],updateOne:["filter","update"]},Sn=function(){function e(t){void 0===t&&(t={}),this.name=e.id,this._operations=Array.isArray(t.operations)?t.operations:kn,this._describeOperations=!("describeOperations"in t)||t.describeOperations,this._useMongoose=!!t.useMongoose}return e.prototype.setupOnce=function(e,t){var n=this._useMongoose?"mongoose":"mongodb",r=(0,Kt.$y)(n);r?this._instrumentOperations(r.Collection,this._operations,t):ye.k.error("Mongo Integration was unable to require `"+n+"` package.")},e.prototype._instrumentOperations=function(e,t,n){var r=this;t.forEach((function(t){return r._patchOperation(e,t,n)}))},e.prototype._patchOperation=function(e,t,n){if(t in e.prototype){var r=this._getSpanContextFromOperationArguments.bind(this);(0,De.hl)(e.prototype,t,(function(e){return function(){for(var i,o,a,s,l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];var c=l[l.length-1],d=n().getScope(),f=null===(i=d)||void 0===i?void 0:i.getSpan();if("function"!=typeof c||"mapReduce"===t&&2===l.length){var p=null===(o=f)||void 0===o?void 0:o.startChild(r(this,t,l)),h=e.call.apply(e,(0,me.fl)([this],l));return(0,Le.J8)(h)?h.then((function(e){var t;return null===(t=p)||void 0===t||t.finish(),e})):(null===(a=p)||void 0===a||a.finish(),h)}var m=null===(s=f)||void 0===s?void 0:s.startChild(r(this,t,l.slice(0,-1)));return e.call.apply(e,(0,me.fl)([this],l.slice(0,-1),[function(e,t){var n;null===(n=m)||void 0===n||n.finish(),c(e,t)}]))}}))}},e.prototype._getSpanContextFromOperationArguments=function(e,t,n){var r={collectionName:e.collectionName,dbName:e.dbName,namespace:e.namespace},i={op:"db",description:t,data:r},o=_n[t],a=Array.isArray(this._describeOperations)?this._describeOperations.includes(t):this._describeOperations;if(!o||!a)return i;try{if("mapReduce"===t){var s=(0,me.CR)(n,2),l=s[0],u=s[1];r[o[0]]="string"==typeof l?l:l.name||"<anonymous>",r[o[1]]="string"==typeof u?u:u.name||"<anonymous>"}else for(var c=0;c<o.length;c++)r[o[c]]=JSON.stringify(n[c])}catch(e){}return i},e.id="Mongo",e}(),Cn=(0,me.pi)((0,me.pi)({},e),{BrowserTracing:vn});(0,Bt.ro)();const En=()=>{const e={};APP_SETTINGS.user.email&>("setUser",{email:APP_SETTINGS.user.email,username:APP_SETTINGS.user.username}),APP_SETTINGS.version&&Object.entries(APP_SETTINGS.version).forEach((([t,n])=>{const{version:r,commit:i}=null!=n?n:{};r&&(e["version-"+t]=r),i&&(e["commit-"+t]=i)})),function(e){gt("setTags",e)}(e)},jn=()=>{var e,t;const n=null===(e=APP_SETTINGS.version)||void 0===e||null===(t=e["label-studio-os-package"])||void 0===t?void 0:t.version;return n||"label-studio@1.7.5dev-frontend"},Tn=function(e){var t=e.displayName||e.name,n=function(t){return Ft&&t&&t.computedMatch&&t.computedMatch.isExact&&Ft.setName(t.computedMatch.path),L.createElement(e,(0,me.pi)({},t))};return n.displayName="sentryRoute("+t+")",q()(n,e),n}(ie);function On(){return(On=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Nn=L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 0a1.5 1.5 0 00-1.5 1.5V5h3V1.5A1.5 1.5 0 009 0zm0 20c1.38 0 2.5-1.343 2.5-3s-1.12-3-2.5-3-2.5 1.343-2.5 3 1.12 3 2.5 3z",fill:"#07F",fillOpacity:.5}),Mn=L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M.5 14a1.172 1.172 0 00.828 2h15.344a1.172 1.172 0 00.828-2c-1.521-1.521-2.161-.232-2.5-5-.315-4.433-2-6.5-6-6.5S3.32 4.592 3 9c-.346 4.764-.97 3.47-2.5 5z",fill:"#07F"});function Ln(e,t){return L.createElement("svg",On({width:18,height:20,viewBox:"0 0 18 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Nn,Mn)}const Pn=L.forwardRef(Ln);function An(){return(An=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Dn=L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 2.992c0-1.023 0-1.535.211-1.89a1.5 1.5 0 01.82-.657c.392-.129.891-.018 1.89.204l5.038 1.12c.388.086.583.13.779.146a3 3 0 00.524 0c.196-.017.39-.06.78-.146l5.037-1.12c.999-.222 1.498-.333 1.89-.204a1.5 1.5 0 01.82.658c.211.354.211.866.211 1.889v9.441c0 .916 0 1.374-.162 1.752a2.001 2.001 0 01-.669.833c-.334.24-.78.34-1.675.539l-5.106 1.135c-.518.115-.777.172-1.039.195-.232.02-.466.02-.698 0-.262-.023-.521-.08-1.04-.195l-5.105-1.135c-.894-.199-1.341-.298-1.675-.539a2 2 0 01-.669-.833C0 13.807 0 13.349 0 12.433V2.992z",fill:"#000",fillOpacity:.4}),Rn=L.createElement("mask",{id:"book_svg__a",maskUnits:"userSpaceOnUse",x:0,y:0,width:18,height:17},L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 2.992c0-1.023 0-1.535.211-1.89a1.5 1.5 0 01.82-.657c.392-.129.891-.018 1.89.204l5.038 1.12c.388.086.583.13.779.146a3 3 0 00.524 0c.196-.017.39-.06.78-.146l5.037-1.12c.999-.222 1.498-.333 1.89-.204a1.5 1.5 0 01.82.658c.211.354.211.866.211 1.889v9.441c0 .916 0 1.374-.162 1.752a2.001 2.001 0 01-.669.833c-.334.24-.78.34-1.675.539l-5.106 1.135c-.518.115-.777.172-1.039.195-.232.02-.466.02-.698 0-.262-.023-.521-.08-1.04-.195l-5.105-1.135c-.894-.199-1.341-.298-1.675-.539a2 2 0 01-.669-.833C0 13.807 0 13.349 0 12.433V2.992z",fill:"#fff"})),In=L.createElement("g",{mask:"url(#book_svg__a)",fill:"#000"},L.createElement("path",{d:"M10-1h9v19h-9zM-1-1h9v19h-9z"}));function Fn(e,t){return L.createElement("svg",An({width:18,height:17,viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Dn,Rn,In)}const zn=L.forwardRef(Fn);function Un(){return(Un=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Hn=L.createElement("path",{opacity:.9,d:"M4 11h2M3 8c0-2-1.5-2.5-1.5-4s1-3 3.5-3 3.5 1.5 3.5 3S7 6 7 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"square"});function Wn(e,t){return L.createElement("svg",Un({width:10,height:12,viewBox:"0 0 10 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Hn)}const Bn=L.forwardRef(Wn);function $n(){return($n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Vn=L.createElement("path",{d:"M2 4l3 3 5-5",stroke:"currentColor",strokeWidth:2,strokeLinecap:"square"});function qn(e,t){return L.createElement("svg",$n({width:12,height:9,viewBox:"0 0 12 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Vn)}const Gn=L.forwardRef(qn);function Yn(){return(Yn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Xn=L.createElement("path",{d:"M14 2L2 14M2 2l12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"square"});function Kn(e,t){return L.createElement("svg",Yn({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Xn)}const Qn=L.forwardRef(Kn);function Jn(){return(Jn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Zn=L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M.163.819C0 1.139 0 1.559 0 2.4v13.2c0 .84 0 1.26.163 1.581a1.5 1.5 0 00.656.655c.32.164.74.164 1.581.164h9.2c.84 0 1.26 0 1.581-.163a1.5 1.5 0 00.655-.656c.164-.32.164-.74.164-1.581V2.4c0-.84 0-1.26-.164-1.581a1.5 1.5 0 00-.655-.656C12.861 0 12.441 0 11.6 0H2.4C1.56 0 1.14 0 .819.163A1.5 1.5 0 00.163.82zM10 11a2 2 0 100-4 2 2 0 000 4z",fill:"#000"});function er(e,t){return L.createElement("svg",Jn({width:14,height:18,viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Zn)}const tr=L.forwardRef(er);function nr(){return(nr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var rr=L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 7a2 2 0 100 4 2 2 0 000-4zm5 2a2 2 0 114 0 2 2 0 01-4 0zm7 0a2 2 0 114 0 2 2 0 01-4 0z",fill:"currentColor"});function ir(e,t){return L.createElement("svg",nr({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),rr)}const or=L.forwardRef(ir);function ar(){return(ar=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var sr=L.createElement("path",{d:"M13.348 10.313c.433.75-.11 1.687-.974 1.687H1.126a1.126 1.126 0 01-.974-1.687L5.776.563a1.126 1.126 0 011.948 0l5.624 9.75zM6.75 8.297a1.078 1.078 0 100 2.156 1.078 1.078 0 000-2.156zM5.726 4.422L5.9 7.609c.008.15.132.266.281.266H7.32c.15 0 .273-.117.28-.266l.175-3.187a.281.281 0 00-.281-.297H6.007a.281.281 0 00-.28.297z",fill:"#F5222D"});function lr(e,t){return L.createElement("svg",ar({width:14,height:12,viewBox:"0 0 14 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),sr)}const ur=L.forwardRef(lr);function cr(){return(cr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var dr=L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 3.2c0-1.12 0-1.68.218-2.108a2 2 0 01.874-.874C1.52 0 2.08 0 3.2 0h2.4c.88 0 1.32 0 1.724.115a3 3 0 01.99.495c.334.254.598.606 1.126 1.31L11 4H0v-.8z",fill:"#000",fillOpacity:.4}),fr=L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 5.4c0-.84 0-1.26.163-1.581a1.5 1.5 0 01.656-.656C1.139 3 1.559 3 2.4 3h13.2c.84 0 1.26 0 1.581.163a1.5 1.5 0 01.655.656c.164.32.164.74.164 1.581v8.2c0 .84 0 1.26-.163 1.581a1.5 1.5 0 01-.656.655c-.32.164-.74.164-1.581.164H2.4c-.84 0-1.26 0-1.581-.164a1.5 1.5 0 01-.656-.655C0 14.861 0 14.441 0 13.6V5.4z",fill:"#000"});function pr(e,t){return L.createElement("svg",cr({width:18,height:16,viewBox:"0 0 18 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),dr,fr)}const hr=L.forwardRef(pr);function mr(){return(mr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var vr=L.createElement("g",{clipPath:"url(#github_svg__clip0)",fill:"#231E1B"},L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 .223a9 9 0 00-2.845 17.54c.45.083.615-.196.615-.435 0-.214-.008-.924-.011-1.675-2.506.544-3.033-1.06-3.033-1.06-.41-1.041-.999-1.318-.999-1.318-.816-.559.061-.547.061-.547.904.064 1.38.927 1.38.927.804 1.375 2.106.978 2.619.748.08-.581.314-.98.57-1.204-1.998-.228-4.1-1-4.1-4.447 0-.982.353-1.786.928-2.416-.094-.227-.401-1.142.086-2.382 0 0 .756-.241 2.476.923.718-.2 1.487-.3 2.253-.303a8.624 8.624 0 012.255.303c1.718-1.164 2.472-.923 2.472-.923.49 1.24.182 2.155.088 2.382.577.63.926 1.434.926 2.416 0 3.456-2.106 4.217-4.11 4.44.324.28.612.828.612 1.667 0 1.204-.01 2.173-.01 2.47 0 .24.162.52.618.432A9 9 0 009 .223z"}),L.createElement("path",{d:"M3.408 13.144c-.02.044-.091.058-.155.027-.066-.03-.101-.091-.08-.136.019-.046.089-.058.154-.028.066.03.103.092.08.137zM3.773 13.55c-.043.04-.127.02-.183-.042-.06-.063-.07-.146-.027-.186.045-.04.125-.021.185.042.058.062.07.146.025.186zM4.128 14.069c-.055.039-.146.003-.201-.078-.055-.08-.055-.175.001-.214.056-.039.145-.005.202.076.055.08.055.177-.002.216zM4.614 14.57c-.05.055-.155.04-.231-.034-.08-.073-.1-.176-.05-.23.05-.055.154-.038.232.035.077.071.1.175.049.229zM5.285 14.86c-.023.07-.124.104-.225.074-.102-.031-.169-.114-.148-.185.02-.072.122-.104.225-.073.103.031.168.113.148.185zM6.02 14.914c.004.075-.083.136-.19.138-.107.003-.195-.059-.195-.132 0-.074.085-.135.192-.137.106-.001.194.058.194.131zM6.706 14.798c.013.073-.061.146-.169.167-.104.02-.2-.025-.214-.097-.014-.074.062-.149.167-.168.107-.02.202.025.216.098z"})),gr=L.createElement("defs",null,L.createElement("clipPath",{id:"github_svg__clip0"},L.createElement("path",{fill:"#fff",transform:"translate(0 .223)",d:"M0 0h18v17.554H0z"})));function yr(e,t){return L.createElement("svg",mr({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),vr,gr)}const br=L.forwardRef(yr);function wr(){return(wr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var xr=L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 2c2.702 0 5.158.655 7.232 1.828a13.01 13.01 0 014.94 4.94C29.345 10.842 30 13.298 30 16s-.655 5.158-1.828 7.232a13.01 13.01 0 01-4.94 4.94C21.158 29.345 18.702 30 16 30s-5.158-.655-7.232-1.828a13.01 13.01 0 01-4.94-4.94C2.655 21.158 2 18.702 2 16s.655-5.158 1.828-7.232a13.009 13.009 0 014.94-4.94C10.842 2.655 13.298 2 16 2z",fill:"#09F"}),kr=L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.501 12.5c.552 0 .98.456.957 1.002l-.416 9.995a1.053 1.053 0 01-.924.996L16 24.5a1.058 1.058 0 01-1.042-1.003l-.355-8.502c-.013-.273-.23-.595-.474-.712l-1.322-.635a.599.599 0 01-.307-.498V13c0-.276.23-.5.502-.5H16.5zM16 7.5a1.5 1.5 0 110 3 1.5 1.5 0 010-3z",fill:"#fff"});function _r(e,t){return L.createElement("svg",wr({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),xr,kr)}const Sr=L.forwardRef(_r);function Cr(){return(Cr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Er=L.createElement("path",{opacity:.9,d:"M1 1h8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"square"});function jr(e,t){return L.createElement("svg",Cr({width:10,height:2,viewBox:"0 0 10 2",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Er)}const Tr=L.forwardRef(jr);function Or(){return(Or=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Nr=L.createElement("mask",{id:"person-circle_svg__a",height:20,maskUnits:"userSpaceOnUse",width:20,x:0,y:0},L.createElement("circle",{cx:10,cy:10,fill:"#fff",r:10})),Mr=L.createElement("circle",{cx:10,cy:10,fill:"#000",fillOpacity:.4,r:10}),Lr=L.createElement("g",{mask:"url(#person-circle_svg__a)"},L.createElement("path",{d:"M3.605 17.411a3 3 0 011.32-2.198l2.183-1.454c.563-.376.608-1.204.153-1.705-.7-.77-1.515-1.912-1.515-3.054 0-2 .25-6 4.25-6s4.25 4 4.25 6c0 1.142-.815 2.284-1.515 3.054-.455.5-.41 1.33.153 1.705l2.182 1.454a3 3 0 011.321 2.198l.249 2.49A1 1 0 0115.641 21H4.351a1 1 0 01-.995-1.1z",fill:"#000"}));function Pr(e,t){return L.createElement("svg",Or({fill:"none",height:20,viewBox:"0 0 20 20",width:20,xmlns:"http://www.w3.org/2000/svg",ref:t},e),Nr,Mr,Lr)}const Ar=L.forwardRef(Pr);function Dr(){return(Dr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Rr=L.createElement("g",{fillRule:"evenodd",clipRule:"evenodd",fill:"#000"},L.createElement("path",{d:"M5.08 11.074c.2-.234.3-.351.406-.425a1 1 0 011.076-.04c.11.064.22.173.438.391.218.218.327.327.392.438a1 1 0 01-.041 1.076c-.074.105-.19.206-.425.406l-5.39 4.62A.764.764 0 01.46 16.463l4.62-5.39z",fillOpacity:.6}),L.createElement("path",{d:"M10.303 1.697c.594-.594.891-.891 1.233-1.002a1.5 1.5 0 01.928 0c.342.111.639.408 1.233 1.002l2.606 2.606c.594.594.891.891 1.002 1.233a1.5 1.5 0 010 .928c-.111.342-.408.639-1.002 1.233l-2.769 2.769c-.2.2-.299.299-.383.41-.074.099-.14.204-.194.315a4.174 4.174 0 00-.196.526l-.942 2.827c-.271.813-.407 1.22-.66 1.408a1 1 0 01-.77.182c-.31-.055-.613-.359-1.22-.965L2.831 8.831c-.607-.607-.91-.91-.964-1.22a1 1 0 01.181-.77c.188-.253.595-.389 1.408-.66l2.827-.942c.268-.09.401-.134.526-.196a2 2 0 00.315-.194c.111-.084.211-.184.41-.383l2.769-2.769z"}));function Ir(e,t){return L.createElement("svg",Dr({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Rr)}const Fr=L.forwardRef(Ir);function zr(){return(zr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Ur=L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 0v6h6v2H8v6H6V8H0V6h6V0h2z",fill:"currentColor"});function Hr(e,t){return L.createElement("svg",zr({width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Ur)}const Wr=L.forwardRef(Hr);function Br(){return(Br=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var $r=L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 0a4 4 0 100 8h10a4 4 0 000-8H4zm0 10a4 4 0 000 8h10a4 4 0 000-8H4zm2 4a2 2 0 11-4 0 2 2 0 014 0zm8-8a2 2 0 100-4 2 2 0 000 4z",fill:"#000"});function Vr(e,t){return L.createElement("svg",Br({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),$r)}const qr=L.forwardRef(Vr);function Gr(){return(Gr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Yr=L.createElement("path",{d:"M3.781 11.375c0 1.041-.85 1.891-1.89 1.891-1.041 0-1.891-.85-1.891-1.89 0-1.041.85-1.892 1.89-1.892h1.891v1.891zM4.734 11.375c0-1.04.85-1.89 1.891-1.89s1.891.85 1.891 1.89v4.735c0 1.04-.85 1.891-1.89 1.891-1.041 0-1.892-.85-1.892-1.891v-4.735z",fill:"#E01E5A"}),Xr=L.createElement("path",{d:"M6.625 3.782c-1.04 0-1.89-.85-1.89-1.891C4.734.85 5.584 0 6.624 0c1.041 0 1.891.85 1.891 1.891v1.89h-1.89zM6.625 4.734c1.04 0 1.891.85 1.891 1.891s-.85 1.891-1.89 1.891H1.89C.85 8.516 0 7.666 0 6.626c0-1.041.85-1.892 1.89-1.892h4.735z",fill:"#36C5F0"}),Kr=L.createElement("path",{d:"M14.219 6.625c0-1.04.85-1.89 1.89-1.89 1.041 0 1.892.85 1.892 1.89 0 1.041-.85 1.891-1.891 1.891h-1.891v-1.89zM13.266 6.626c0 1.04-.85 1.89-1.891 1.89-1.04 0-1.891-.85-1.891-1.89V1.89c0-1.04.85-1.891 1.89-1.891 1.042 0 1.892.85 1.892 1.891v4.735z",fill:"#2EB67D"}),Qr=L.createElement("path",{d:"M11.374 14.219c1.04 0 1.89.85 1.89 1.89 0 1.041-.85 1.892-1.89 1.892s-1.891-.85-1.891-1.891v-1.891h1.89zM11.374 13.266c-1.04 0-1.89-.85-1.89-1.89 0-1.041.85-1.892 1.89-1.892h4.735c1.04 0 1.891.85 1.891 1.891s-.85 1.891-1.891 1.891h-4.735z",fill:"#ECB22E"});function Jr(e,t){return L.createElement("svg",Gr({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),Yr,Xr,Kr,Qr)}const Zr=L.forwardRef(Jr);function ei(){return(ei=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ti=L.createElement("g",{fillRule:"evenodd",clipRule:"evenodd",fill:"#000"},L.createElement("path",{d:"M1 1h18v14H1V1z",fillOpacity:.4}),L.createElement("path",{d:"M.163.819C0 1.139 0 1.559 0 2.4v11.2c0 .84 0 1.26.163 1.581a1.5 1.5 0 00.656.655c.32.164.74.164 1.581.164h15.2c.84 0 1.26 0 1.581-.164a1.5 1.5 0 00.655-.655c.164-.32.164-.74.164-1.581V2.4c0-.84 0-1.26-.163-1.581a1.5 1.5 0 00-.656-.656C18.861 0 18.441 0 17.6 0H2.4C1.56 0 1.14 0 .819.163A1.5 1.5 0 00.163.82zM5.42 3.815a1.5 1.5 0 00-1.98.124l-.124.142a1.5 1.5 0 00.124 1.98L5.378 8 3.439 9.94l-.124.14a1.5 1.5 0 002.246 1.98l3-3 .124-.14a1.5 1.5 0 00-.124-1.98l-3-3-.142-.125z"}));function ni(e,t){return L.createElement("svg",ei({width:20,height:16,viewBox:"0 0 20 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),ti)}const ri=L.forwardRef(ni);function ii(){return(ii=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var oi=L.createElement("path",{d:"M28 17V0H3C1.337 0 0 1.337 0 3v58c0 1.663 1.337 3 3 3h42c1.663 0 3-1.337 3-3V20H31c-1.65 0-3-1.35-3-3zm8.148 27.001H28v10a2 2 0 01-2 2h-4a2 2 0 01-2-2v-10h-8.148c-1.784 0-2.676-2.161-1.408-3.42L22.496 28.62a2.131 2.131 0 013.005 0L37.554 40.58c1.268 1.259.378 3.42-1.407 3.42zm10.977-30.876L34.888.875A2.998 2.998 0 0032.763 0H32v16h16v-.762a2.99 2.99 0 00-.875-2.113z"});function ai(e,t){return L.createElement("svg",ii({width:48,height:64,viewBox:"0 0 48 64",fill:"#1890FF",xmlns:"http://www.w3.org/2000/svg",ref:t},e),oi)}const si=L.forwardRef(ai);function li(){return(li=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ui=L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.548.453c-.603-.603-1.205-.603-1.808 0l-.78.779L10.77 3.04l.779-.78c.603-.602.603-1.205 0-1.807zm-1.632 3.44L8.108 2.083 1.905 8.288S-.506 11.3.097 11.904c.602.603 3.616-1.808 3.616-1.808l6.203-6.204z",fill:"#000"});function ci(e,t){return L.createElement("svg",li({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t},e),ui)}const di=L.forwardRef(ci),fi=(e,t)=>{const n=null!=t?t:(e,t)=>e===t;return(null!=e?e:[]).reduce(((e,t)=>(e.findIndex((e=>n(e,t)))<0&&e.push(t),e)),[])},pi=e=>null!=e,hi=e=>"string"==typeof e&&""===e.trim(),mi=e=>{const t=Object.entries(e).reduce(((e,[t,n])=>pi(n)&&!hi(n)?"[object Object]"===Object.prototype.toString.call(n)?[...e,[t,mi(n)]]:[...e,[t,n]]:e),[]);return Object.fromEntries(t)},vi=(e="")=>e.match(/^https?/)||e.match(/^\/\//)?e:[APP_SETTINGS.hostname.replace(/([/]+)$/,""),e.replace(/^([/]+)/,"")].join("/"),gi=e=>{const t=document.createElement("textarea");t.style.position="fixed",document.body.appendChild(t),t.value=e,t.focus(),t.select(),document.execCommand("copy"),t.remove()},yi=(e,t,n)=>Math.max(t,Math.min(e,n));var bi=n(5893);const wi=null!=="ls-"?"ls-":"dm-",xi=(0,L.createContext)(null),ki=(e,t={})=>{const{elem:n,mix:r,mod:i}=null!=t?t:{},o=e,a={block:e=>ki(e,{elem:n,mix:r,mod:i}),elem:t=>ki(e,{elem:t,mix:r,mod:i}),mod(t={}){const a=Object.assign({},null!=i?i:{},t);return ki(null!=e?e:o,{elem:n,mix:r,mod:a})},mix:(...t)=>ki(e,{elem:n,mix:t,mod:i}),select(e=document){return e.querySelector(this.toCSSSelector())},selectAll(e=document){return e.querySelectorAll(this.toCSSSelector())},closest(e){return e.closest(this.toCSSSelector())},toString:()=>((e,t,n,r)=>{const i=e,o=t?`${i}__${t}`:null,a=Object.entries(null!=r?r:{}).reduce(((e,[t,n])=>{const r=[null!=o?o:i];return null==n||!1!==n&&(r.push(t),!0!==n&&r.push(n),e.push(r.join("_"))),e}),[]),s=[];if(s.push(null!=o?o:i),s.push(...a),n){const e=Array.isArray(n)?n:[n],t=[].concat(...e).filter((e=>pi(e)&&""!==e)).map((e=>{return"string"==typeof e?e:null==e||null===(t=e.toClassName)||void 0===t?void 0:t.call(e);var t})).reduce(((e,t)=>[...e,...t.split(/\s+/)]),[]);s.push(...t)}return s.filter((e=>!hi(e))).map((e=>new RegExp(wi).test(e)?e:`${wi}${e}`)).join(" ")})(e,n,r,i),toClassName(){return this.toString()},toCSSSelector(){return`.${this.toClassName().replace(/(\s+)/g,".")}`}};return Object.defineProperty(a,"Block",{value:Si}),Object.defineProperty(a,"Elem",{value:Ci}),Object.defineProperty(a,"__class",{value:{block:e,elem:n,mix:r,mod:i}}),a},_i=e=>{const t=null!=e?e:(0,L.createContext)(null),n=(0,L.forwardRef)((({tag:e="div",name:n,mod:r,mix:i,...o},a)=>{const s=ki(n),l=[].concat(i).filter((e=>!!e)),u=s.mod(r).mix(...l,o.className).toClassName(),c={...o,ref:a,className:u};return(0,bi.jsx)(t.Provider,{value:s,children:(0,L.createElement)(e,c)})}));n.displayName="Block";const r=(0,L.forwardRef)((({component:e,block:n,name:r,mod:i,mix:o,...a},s)=>{var l;const u=(0,L.useContext)(t),c=[].concat(o).filter((e=>!!e)),d=null!==(l=a.tag)&&void 0!==l?l:"div",f=(n?ki(n):u).elem(r).mod(i).mix(...c,a.className).toClassName(),p={...a,ref:s,className:f};return"string"!=typeof d&&(p.block=u),(0,L.createElement)(null!=e?e:d,p)}));return r.displayName="Elem",{Block:n,Elem:r,Context:t}},{Block:Si,Elem:Ci}=_i(xi),Ei=(0,L.createContext)();Ei.displayName="FormContext";const ji=(0,L.createContext)();ji.displayName="FormValidationContext";const Ti=(0,L.createContext)();Ti.displayName="FormSubmissionContext";const Oi=(0,L.createContext)();Oi.displayName="FormStateContext";const Ni=(0,L.createContext)();Ni.displayName="FormResponseContext";const Mi=L.forwardRef((({children:e,type:t,extra:n,className:r,size:i,waiting:o,icon:a,tag:s,look:l,...u},c)=>{const d=null!=s?s:u.href?"a":"button",f={size:i,waiting:o,type:t,look:null!=l?l:[],withIcon:!!a,withExtra:!!n};var p,h;!0===L.useContext(Ti)&&(null!==(p=f.look)&&void 0!==p&&null!==(h=p.includes)&&void 0!==h&&h.call(p,"primary")&&"submit"===t?f.waiting=!0:u.disabled=!0);u.primary&&(f.look="primary",delete u.primary);const m=L.useMemo((()=>{if(!a)return null;if(pi(a.props.size))return a;switch(i){case"small":return L.cloneElement(a,{...a.props,size:12,width:12,height:12});case"compact":return L.cloneElement(a,{...a.props,size:14,width:14,height:14});default:return a}}),[a,i]);return(0,bi.jsx)(Si,{name:"button",mod:f,mix:r,ref:c,tag:d,type:t,...u,children:(0,bi.jsxs)(bi.Fragment,{children:[m&&(0,bi.jsx)(Ci,{tag:"span",name:"icon",children:m}),m&&e?(0,bi.jsx)("span",{children:e}):e,void 0!==n?(0,bi.jsx)(Ci,{name:"extra",children:n}):null]})})}));Mi.displayName="Button",Mi.Group=({className:e,children:t,collapsed:n})=>(0,bi.jsx)(Si,{name:"button-group",mod:{collapsed:n},mix:e,children:t});const{Block:Li}=_i(),Pi=({direction:e="horizontal",size:t,className:n,style:r,children:i,spread:o,stretch:a,align:s})=>(0,bi.jsx)(Li,{name:"space",mod:{direction:e,size:t,spread:o,stretch:a,align:s},mix:n,style:r,children:i}),Ai=({title:e,message:t,errorId:n,stacktrace:r,validation:i,version:o,onGoBack:a,onReload:s,possum:l=!1})=>{const u=(0,L.useMemo)((()=>(null!=r?r:"").trim()),[r]),[c,d]=(0,L.useState)(!1),f=(0,L.useCallback)((()=>{d(!0),gi(u),setTimeout((()=>d(!1)),1200)}),[u]);return(0,bi.jsxs)(Si,{name:"error-message",children:[!1!==l&&(0,bi.jsx)(Ci,{tag:"img",name:"heidi",src:vi("/static/images/opossum_broken.svg"),height:"111",alt:"Heidi's down"}),e&&(0,bi.jsx)(Ci,{name:"title",children:e}),t&&(0,bi.jsx)(Ci,{name:"detail",dangerouslySetInnerHTML:{__html:String(t)}}),u&&(0,bi.jsx)(Ci,{name:"stracktrace",dangerouslySetInnerHTML:{__html:u.replace(/(\n)/g,"<br>")}}),(null==i?void 0:i.length)>0&&(0,bi.jsx)(Ci,{tag:"ul",name:"validation",children:i.map((([e,t])=>(0,bi.jsx)(L.Fragment,{children:[].concat(t).map(((e,t)=>(0,bi.jsx)(Ci,{tag:"li",name:"message",dangerouslySetInnerHTML:{__html:e}},t)))},e)))}),(o||n)&&(0,bi.jsx)(Ci,{name:"version",children:(0,bi.jsxs)(Pi,{children:[o&&`Version: ${o}`,n&&`Error ID: ${n}`]})}),(0,bi.jsx)(Ci,{name:"actions",children:(0,bi.jsxs)(Pi,{spread:!0,children:[(0,bi.jsx)(Ci,{tag:Mi,name:"action-slack",target:"_blank",icon:(0,bi.jsx)(Zr,{}),href:"https://slack.labelstudio.heartex.com/?source=product-error-msg",children:"Ask on Slack"}),(0,bi.jsxs)(Pi,{size:"small",children:[u&&(0,bi.jsx)(Mi,{disabled:c,onClick:f,style:{width:180},children:c?"Copied":"Copy Stacktrace"}),a&&(0,bi.jsx)(Mi,{onClick:a,children:"Go Back"}),s&&(0,bi.jsx)(Mi,{onClick:s,children:"Reload"})]})]})})]})},Di=(0,L.createContext)(window.APP_SETTINGS);Di.displayName="ConfigContext";Di.Consumer;const Ri=({children:e})=>{var t;const[n,r]=(0,L.useState)(null!==(t=window.APP_SETTINGS)&&void 0!==t?t:{}),i=e=>{e&&r(e)},o=(0,L.useMemo)((()=>({...n,update:i})),[n]);return(0,bi.jsx)(Di.Provider,{value:o,children:e})},Ii=()=>(0,L.useContext)(Di),Fi=(0,L.createContext)(),zi=({children:e})=>{const t=io(),[n,r]=(0,L.useState)(),i=(0,L.useCallback)((()=>{t.callApi("me").then((e=>{r(e)}))}),[]);return(0,L.useEffect)((()=>{i()}),[i]),(0,bi.jsx)(Fi.Provider,{value:{user:n,fetch:i},children:e})},Ui=e=>{var t;let n=e.children||null;if(!e.providers)throw"MultiProvider: Missing providers prop";if(!e.children)throw"MultiProvider: Missing children";return e.providers.length?([...null!==(t=e.providers)&&void 0!==t?t:[]].reverse().forEach((e=>{n=L.cloneElement(e,null,n)})),n):n},Hi=(e,{init:t,transition:n,onStart:r,beforeTransition:i,afterTransition:o}={})=>new Promise((async a=>{null==t||t(e);const s=()=>{null==r||r(e)},l=async()=>{await(null==o?void 0:o(e)),e.removeEventListener("transitionstart",s),e.removeEventListener("transitionend",l),a()};e.addEventListener("transitionstart",s),e.addEventListener("transitionend",l),await(null==i?void 0:i()),setTimeout((()=>n(e)),30)}));function Wi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{Block:Bi,Elem:$i}=_i(),Vi=(0,L.createContext)();class qi extends L.Component{constructor(e){var t;super(e),Wi(this,"modalRef",L.createRef()),Wi(this,"onClickOutside",(e=>{if(!this.modalRef.current)return;const{closeOnClickOutside:t}=this.props,n=!1!==this.props.allowClose,r=this.modalRef.current.contains(e.target),i=ki("modal").elem("content").closest(e.target),o=ki("modal").elem("close").closest(e.target);n&&(r&&o||null===i&&!1!==t)&&this.hide()})),Wi(this,"closeOnEscape",(e=>{!1!==this.props.allowClose&&"Escape"===e.key&&this.state.visible&&(e.stopPropagation(),e.preventDefault(),this.hide())})),this.state={title:e.title,body:e.body,footer:e.footer,visible:!e.animateAppearance&&(null!==(t=e.visible)&&void 0!==t&&t),transition:e.visible?"visible":null}}componentDidMount(){this.props.animateAppearance&&setTimeout((()=>this.show()),30),document.addEventListener("keydown",this.closeOnEscape,{capture:!0})}componentWillUnmount(){document.removeEventListener("keydown",this.closeOnEscape,{capture:!0})}componentDidUpdate(e,t){t.visible!==this.state.visible&&(document.body.style.overflow=this.state.visible?"hidden":"")}setBody(e){this.setState({body:e})}show(e){return new Promise((t=>{this.setState({visible:!0},(async()=>{var n,r;null==e||e(),null===(n=(r=this.props).onShow)||void 0===n||n.call(r),await this.transition("appear",t)}))}))}hide(e){return new Promise((t=>{this.transition("disappear",(()=>{this.setState({visible:!1},(()=>{var n,r;null===(n=(r=this.props).onHide)||void 0===n||n.call(r),t(),null==e||e()}))}))}))}render(){if(!this.state.visible)return null;const e=this.props.bare,t={fullscreen:!!this.props.fullscreen,bare:this.props.bare,visible:this.props.visible||this.state.visible},n=[this.transitionClass,this.props.className],r={};this.props.width&&(r.width=this.props.width),this.props.height&&(r.height=this.props.height);const i=(0,bi.jsx)(Vi.Provider,{value:this,children:(0,bi.jsx)(Bi,{name:"modal",ref:this.modalRef,mod:t,mix:n,onClick:this.onClickOutside,children:(0,bi.jsx)($i,{name:"wrapper",children:(0,bi.jsxs)($i,{name:"content",style:Object.assign({},this.props.style,r),children:[!e&&(0,bi.jsxs)(qi.Header,{children:[(0,bi.jsx)($i,{name:"title",children:this.state.title}),!1!==this.props.allowClose&&(0,bi.jsx)($i,{tag:Mi,name:"close",type:"text",icon:(0,bi.jsx)(Qn,{})})]}),(0,bi.jsx)($i,{name:"body",mod:{bare:e},children:this.body}),this.props.footer&&(0,bi.jsx)(qi.Footer,{bare:this.props.bareFooter,children:this.footer})]})})})});return(0,P.createPortal)(i,document.body)}transition(e,t){return Hi(this.modalRef.current,{transition:async()=>new Promise((t=>{this.setState({transition:e},(()=>{t()}))})),beforeTransition:async()=>new Promise((t=>{this.setState({transition:`before-${e}`},(()=>{t()}))})),afterTransition:async()=>new Promise((n=>{this.setState({transition:"appear"===e?"visible":null},(()=>{null==t||t(),n()}))}))})}get transitionClass(){switch(this.state.transition){case"before-appear":return"before-appear";case"appear":return"appear before-appear";case"before-disappear":return"before-disappear";case"disappear":return"disappear before-disappear";case"visible":return"visible"}return null}get body(){if(this.state.body){const e=this.state.body;return e instanceof Function?(0,bi.jsx)(e,{}):e}return this.props.children}get footer(){if(this.state.footer){const e=this.state.footer;return e instanceof Function?(0,bi.jsx)(e,{}):e}return null}}qi.Header=({children:e,divided:t})=>(0,bi.jsx)($i,{name:"header",mod:{divided:t},children:e}),qi.Footer=({children:e,bare:t})=>(0,bi.jsx)($i,{name:"footer",mod:{bare:t},children:e});const Gi=()=>(0,L.useContext)(Vi),Yi=e=>{const t=(0,L.createRef)(),n=document.createElement("div");let r=0;n.className=ki("modal-holder").toClassName(),document.body.appendChild(n);const i=(e,i)=>{r++,(0,P.render)((0,bi.jsx)(Ui,{providers:e.simple?[]:[(0,bi.jsx)(Ri,{},"config"),(0,bi.jsx)(ro,{},"api"),(0,bi.jsx)(zi,{},"current-user")],children:(0,bi.jsx)(qi,{ref:t,...e,onHide:()=>{var t;null===(t=e.onHidden)||void 0===t||t.call(e),(0,P.unmountComponentAtNode)(n),n.remove()},animateAppearance:i})},`modal-${r}`),n)};return i(e,!0),{update(t){i({...e,...null!=t?t:{},visible:!0},!1)},close(){const e=t.current.hide();return(0,P.unmountComponentAtNode)(n),n.remove(),e}}},Xi=({okText:e,onOk:t,cancelText:n,onCancel:r,buttonLook:i,...o})=>{const a=Yi({...o,allowClose:!1,footer:(0,bi.jsxs)(Pi,{align:"end",children:[(0,bi.jsx)(Mi,{onClick:()=>{null==r||r(),a.close()},size:"compact",autoFocus:!0,children:null!=n?n:"Cancel"}),(0,bi.jsx)(Mi,{onClick:()=>{null==t||t(),a.close()},size:"compact",look:null!=i?i:"primary",children:null!=e?e:"OK"})]})});return a};Object.assign(qi,{info:({okText:e,onOkPress:t,...n})=>{const r=Yi({...n,footer:(0,bi.jsx)(Pi,{align:"end",children:(0,bi.jsx)(Mi,{onClick:()=>{null==t||t(),r.close()},look:"primary",size:"compact",children:null!=e?e:"OK"})})});return r},confirm:Xi,modal:Yi});const Ki={gateway:`${window.APP_SETTINGS.hostname}/api`,endpoints:{users:"/users",me:"/current-user/whoami",memberships:"/organizations/:pk/memberships",inviteLink:"/invite",resetInviteLink:"POST:/invite/reset-token",projects:"/projects",project:"/projects/:pk",updateProject:"PATCH:/projects/:pk",createProject:"POST:/projects",deleteProject:"DELETE:/projects/:pk",configTemplates:"/templates",validateConfig:"POST:/projects/:pk/validate",createSampleTask:"POST:/projects/:pk/sample-task",fileUploads:"/projects/:pk/file-uploads",deleteFileUploads:"DELETE:/projects/:pk/file-uploads",importFiles:"POST:/projects/:pk/import",reimportFiles:"POST:/projects/:pk/reimport",dataSummary:"/projects/:pk/summary",deleteTabs:"DELETE:/dm/views/reset",listStorages:"/storages/:target?",storageTypes:"/storages/:target?/types",storageForms:"/storages/:target?/:type/form",createStorage:"POST:/storages/:target?/:type",deleteStorage:"DELETE:/storages/:target?/:type/:pk",updateStorage:"PATCH:/storages/:target?/:type/:pk",syncStorage:"POST:/storages/:target?/:type/:pk/sync",validateStorage:"POST:/storages/:target?/:type/validate",mlBackends:"GET:/ml",mlBackend:"GET:/ml/:pk",addMLBackend:"POST:/ml",updateMLBackend:"PATCH:/ml/:pk",deleteMLBackend:"DELETE:/ml/:pk",trainMLBackend:"POST:/ml/:pk/train",predictWithML:"POST:/ml/:pk/predict",projectModelVersions:"/projects/:pk/model-versions",modelVersions:"/ml/:pk/versions",mlInteractive:"POST:/ml/:pk/interactive-annotating",export:"/projects/:pk/export",previousExports:"/projects/:pk/export/files",exportFormats:"/projects/:pk/export/formats",version:"/version",webhooks:"/webhooks",webhook:"/webhooks/:pk",updateWebhook:"PATCH:/webhooks/:pk",createWebhook:"POST:/webhooks",deleteWebhook:"DELETE:/webhooks/:pk",webhooksInfo:"/webhooks/info"},alwaysExpectJSON:!1};function Qi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ji=new class{constructor(e){var t,n,r,i,o;Qi(this,"gateway",null),Qi(this,"commonHeaders",{}),Qi(this,"mockDelay",0),Qi(this,"mockDisabled",!1),Qi(this,"requestMode","same-origin"),Qi(this,"sharedParams",{}),this.commonHeaders=null!==(t=e.commonHeaders)&&void 0!==t?t:{},this.gateway=this.resolveGateway(e.gateway),this.requestMode=this.detectMode(),this.mockDelay=null!==(n=e.mockDelay)&&void 0!==n?n:0,this.mockDisabled=null!==(r=e.mockDisabled)&&void 0!==r&&r,this.sharedParams=null!==(i=e.sharedParams)&&void 0!==i?i:{},this.alwaysExpectJSON=null===(o=e.alwaysExpectJSON)||void 0===o||o,this.resolveMethods(e.endpoints)}isValidMethod(e){return this[e]instanceof Function}resolveGateway(e){if(e instanceof URL)return e.toString();try{return new URL(e).toString()}catch(t){const n=new URL(window.location.href);return n.search="",n.hash="","/"===e[0]?n.pathname=e.replace(/([/])$/,""):n.pathname=`${n.pathname}/${e}`.replace(/([/]+)/g,"/").replace(/([/])$/,""),n.toString()}}detectMode(){return window.location.origin===new URL(this.gateway).origin?"same-origin":"cors"}resolveMethods(e,t){if(e){new Map(Object.entries(e)).forEach(((e,n)=>{const{scope:r,...i}=this.getSettings(e);Object.defineProperty(this,n,{value:this.createApiCallExecutor(i,[t])}),Object.defineProperty(this,`${n}Raw`,{value:this.createApiCallExecutor(i,[t],!0)}),r&&this.resolveMethods(r,[...null!=t?t:[],i.path])}))}}createApiCallExecutor(e,t,n=!1){return async(r,{headers:i,signal:o,body:a}={})=>{let s,l;try{var u,c,d,f;const p={...null!=r?r:{},...null!==(u=this.sharedParams)&&void 0!==u?u:{}},{method:h,url:m}=this.createUrl(e.path,p,t),v=null!=h?h:(null!==(c=e.method)&&void 0!==c?c:"get").toUpperCase(),g=Object.assign(this.getDefaultHeaders(v),null!==(d=this.commonHeaders)&&void 0!==d?d:{},null!==(f=e.headers)&&void 0!==f?f:{},null!=i?i:{}),y=new Headers(g),b={method:v,headers:y,mode:this.requestMode,credentials:"cors"===this.requestMode?"omit":"same-origin"};if(o&&(b.signal=o),"GET"!==v){const e=y.get("Content-Type"),{sharedParams:t}=this;let n=null!=a?a:{};n instanceof FormData?Object.entries(null!=t?t:{}).forEach((([e,t])=>{n.append(e,t)})):Object.assign(n,{...null!=t?t:{},...null!=a?a:{}}),n instanceof FormData?b.body=n:b.body="multipart/form-data"===e?this.createRequestBody(n):"application/json"===e?this.bodyToJSON(n):n,"multipart/form-data"===e&&y.delete("Content-Type")}let w;if(e.mock,w=await fetch(m,b),l={headers:new Map(Array.from(w.headers)),status:w.status,url:w.url},n)return w;if(w.ok){const t=await w.text();try{const n=204!==w.status?JSON.parse(this.alwaysExpectJSON?t:t||"{}"):{ok:!0};if(e.convert instanceof Function)return await e.convert(n);s=n}catch(e){s=this.generateException(e,t)}}else s=this.generateError(w)}catch(e){s=this.generateException(e)}return Object.defineProperty(s,"$meta",{value:l,configurable:!1,enumerable:!1,writable:!1}),s}}getSettings(e){return"string"==typeof e&&(e={path:e}),{method:"GET",mock:void 0,convert:void 0,scope:void 0,...e}}getDefaultHeaders(e){switch(e){case"POST":case"PATCH":case"DELETE":return{"Content-Type":"application/json"};default:return{}}}createUrl(e,t={},n){const r=new URL(this.gateway),i=[],{path:o,method:a}=this.resolveEndpoint(e,t),s=[].concat(...null!=n?n:[],o).filter((e=>void 0!==e)).join("/").replace(/([/]+)/g,"/").replace(/:([^/]+)/g,((...e)=>{const n=e[1],[r,o]=n.match(/([^?]+)(\??)/).slice(1,3),a=t[r];if(i.push(r),void 0===a){if("?"===o)return"";throw new Error(`Can't find key \`${r}\` in data`)}return a}));return r.pathname+=s.replace(/\/+/g,"/").replace(/\/+$/g,""),t&&"object"==typeof t&&Object.entries(t).forEach((([e,t])=>{i.includes(e)||r.searchParams.set(e,t)})),{url:r.toString(),method:a}}resolveEndpoint(e,t){var n;let r;r=e instanceof Function?e(t):e;const i=/^(GET|POST|PATCH|DELETE|PUT|HEAD|OPTIONS):/;return{method:null===(n=r.match(i))||void 0===n?void 0:n[1],path:r.replace(i,"")}}createRequestBody(e){if(e instanceof FormData)return e;const t=new FormData;return Object.entries(e).forEach((([e,n])=>{t.append(e,n)})),t}bodyToJSON(e){const t=(e=>{if(e instanceof FormData){const t=e.entries();return Array.from(t).reduce(((e,[t,n])=>({...e,[t]:n})),{})}return e})(e);return JSON.stringify(t)}async generateError(e,t){var n;const r=(async()=>{const t=await e.text();try{return JSON.parse(t)}catch(e){return t}})();return{status:e.status,error:(null!==(n=null==t?void 0:t.message)&&void 0!==n?n:e.statusText)||"Server Error",response:await r}}generateException(e,t){console.error(e);return{error:e.message,details:(()=>{try{return JSON.parse(t)}catch(e){return t}})()}}mockRequest(e,t,n,r){return new Promise((async i=>{let o=null,a=!0;try{const i=new Request(n);"string"==typeof n.body&&(i.body=JSON.parse(n.body)),o=await r.mock(e,null!=t?t:{},i)}catch(e){console.error(e),a=!1}setTimeout((()=>{i({ok:a,json:()=>Promise.resolve(o)})}),this.mockDelay)}))}}(Ki),Zi=(0,L.createContext)();Zi.displayName="ApiContext";let eo=!1;const to=e=>{var t,n,r,i;const{response:o}=e;return{isShutdown:"Failed to fetch"===String(null!==(t=null==o?void 0:o.detail)&&void 0!==t?t:null==e?void 0:e.error),title:e.error?"Runtime error":"Server error",message:null!==(n=null==o?void 0:o.detail)&&void 0!==n?n:null==e?void 0:e.error,stacktrace:null!==(r=null==o?void 0:o.exc_info)&&void 0!==r?r:null,version:null==o?void 0:o.version,validation:Object.entries(null!==(i=null==o?void 0:o.validation_errors)&&void 0!==i?i:{})}},no=async(e,t=!0)=>{let n=e;if(n instanceof Response&&(n=await Ji.generateError(e)),401===e.status)return void(location.href=vi("/"));const{isShutdown:r,...i}=to(n);return t&&Yi({allowClose:!r,body:r?(0,bi.jsx)(Ai,{possum:!1,title:"Connection refused",message:"Server not responding. Is it still running?"}):(0,bi.jsx)(Ai,{...i}),simple:!0,style:{width:680}}),r},ro=(0,L.forwardRef)((({children:e},t)=>{const[n,r]=(0,L.useState)(null),i=(0,L.useCallback)((async(e,{params:t={},errorFilter:n,...i}={})=>{if(eo)return;r(null);const a=await Ji[e](t,i);if(401===a.status)return eo=!0,void(location.href=vi("/"));if(a.error){const e=!1===(null==n?void 0:n(a));if(!n||e){r(a);const e=await no(a,o.showModal);return eo=eo||e,null}}return a}),[]),o=(0,L.useMemo)((()=>({api:Ji,callApi:i,handleError:no,error:n,showModal:!0,errorFormatter:to,isValidMethod:(...e)=>Ji.isValidMethod(...e)})),[n]);return(0,L.useEffect)((()=>{t&&(t.current=o)}),[t]),(0,bi.jsx)(Zi.Provider,{value:o,children:e})})),io=()=>(0,L.useContext)(Zi),oo=L.createContext({});oo.displayName="AppStoreContext";const ao=({children:e})=>{const[t,n]=L.useState({}),r=L.useCallback((e=>{n({...t,...null!=e?e:{}})}),[t]),i=L.useMemo((()=>({store:t,update:r})),[t,r]);return(0,bi.jsx)(oo.Provider,{value:i,children:e})},so=()=>L.useContext(oo),lo=new Map,uo=new Map,co=(0,L.createContext)({}),fo=({libraries:e,children:t})=>{const n=(0,L.useMemo)((()=>(e=>async t=>{var n;const{scriptSrc:r,cssSrc:i,checkAvailability:o}=e[t],a=o(),s=null!==(n=lo.get(t))&&void 0!==n?n:new Set;if(lo.set(t,s),a)return a;const l=new Promise((e=>{s.add((()=>{setTimeout((()=>{e(o())}),10)}))}));return uo.has(t)||uo.set(t,(async()=>{const e=[];r&&e.push(new Promise((e=>{const t=document.createElement("script");t.type="text/javascript",t.onload=()=>{e()},t.src=r,t.dataset.replaced=!0,document.head.appendChild(t)}))),i&&e.push(new Promise((e=>{const t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.onload=()=>{e()},t.href=i,t.dataset.replaced=!0,document.head.appendChild(t)}))),await Promise.all(e),s.forEach((e=>e()))})()),l})(e)),[e]);return(0,bi.jsx)(co.Provider,{value:{requestLibrary:n},children:t})},po=e=>{const t=(0,L.useContext)(co),[n,r]=(0,L.useState)(),i=(0,L.useCallback)((async()=>{const n=await t.requestLibrary(e);r(!!n)}),[t,e]);return(0,L.useEffect)((()=>{i()}),[i]),n};function ho(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t),i=n.length;if(r.length!==i)return!1;for(var o=0;o<i;o++){var a=n[o];if(e[a]!==t[a]||!Object.prototype.hasOwnProperty.call(t,a))return!1}return!0}L.Component;L.Component;var mo=function(e,t){return"function"==typeof e?e(t):e},vo=function(e,t){return"string"==typeof e?v(e,null,null,t):e},go=function(e){return e},yo=L.forwardRef;void 0===yo&&(yo=go);var bo=yo((function(e,t){var n=e.innerRef,i=e.navigate,o=e.onClick,a=$(e,["innerRef","navigate","onClick"]),s=a.target,l=r({},a,{onClick:function(e){try{o&&o(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||s&&"_self"!==s||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),i())}});return l.ref=go!==yo&&t||n,L.createElement("a",l)}));var wo=yo((function(e,t){var n=e.component,i=void 0===n?bo:n,o=e.replace,a=e.to,s=e.innerRef,l=$(e,["component","replace","to","innerRef"]);return L.createElement(Y.Consumer,null,(function(e){e||c(!1);var n=e.history,u=vo(mo(a,e.location),e.location),d=u?n.createHref(u):"",f=r({},l,{href:d,navigate:function(){var t=mo(a,e.location);(o?n.replace:n.push)(t)}});return go!==yo?f.ref=t||s:f.innerRef=s,L.createElement(i,f)}))})),xo=function(e){return e},ko=L.forwardRef;void 0===ko&&(ko=xo);var _o=ko((function(e,t){var n=e["aria-current"],i=void 0===n?"page":n,o=e.activeClassName,a=void 0===o?"active":o,s=e.activeStyle,l=e.className,u=e.exact,d=e.isActive,f=e.location,p=e.sensitive,h=e.strict,m=e.style,v=e.to,g=e.innerRef,y=$(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return L.createElement(Y.Consumer,null,(function(e){e||c(!1);var n=f||e.location,o=vo(mo(v,n),n),b=o.pathname,w=b&&b.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),x=w?re(n.pathname,{path:w,exact:u,sensitive:p,strict:h}):null,k=!!(d?d(x,n):x),_=k?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(l,a):l,S=k?r({},m,{},s):m,C=r({"aria-current":k&&i||null,className:_,style:S,to:o},y);return xo!==ko?C.ref=t||g:C.innerRef=g,L.createElement(wo,C)}))}));const So=(e,t,n="bottom-left",r=0)=>{let i=0,o=0;const a=((e,t)=>{const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return{source:n,target:r,get top(){return n.top-r.height},get bottom(){return n.top+n.height},get horizontalCenter(){return n.left+n.width/2-r.width/2},get horizontalLeft(){return n.left},get horizontalRight(){return n.left+n.width-r.width}}})(e,t);let s=n.split("-");switch(n){case"top-center":o=a.top-r,i=a.horizontalCenter;break;case"top-left":o=a.top-r,i=a.horizontalLeft;break;case"top-right":o=a.top-r,i=a.horizontalRight;break;case"bottom-center":o=a.bottom+r,i=a.horizontalCenter;break;case"bottom-left":o=a.bottom+r,i=a.horizontalLeft;break;case"bottom-right":o=a.bottom+r,i=a.horizontalRight}return o<window.scrollX?(o=a.bottom+r,s[0]="bottom"):o+a.target.height>window.scrollX+window.innerHeight&&(o=a.top-r,s[0]="top"),i<0?(i=a.horizontalLeft,s[1]="left"):i+a.target.width>window.innerWidth&&(i=a.horizontalRight,s[1]="right"),{top:o,left:i,pos:a,align:s.join("-")}},Co=L.createContext(),Eo=(0,L.forwardRef)((({tag:e,children:t,dropdown:n,content:r,toggle:i,closeOnClickOutside:o=!0,...a},s)=>{var l,u,c;const d=null!==(l=null!=s?s:n)&&void 0!==l?l:(0,L.useRef)(),f=L.Children.only(t),[p]=(0,L.useState)(new Set),h=null!==(u=f.props.ref)&&void 0!==u?u:(0,L.useRef)(),m=(0,L.useContext)(Co),v=(0,L.useCallback)((e=>{var t,n,r,i,o;const a=null===(t=h.current)||void 0===t||null===(n=t.contains)||void 0===n?void 0:n.call(t,e),s=null===(r=d.current)||void 0===r||null===(i=r.dropdown)||void 0===i||null===(o=i.contains)||void 0===o?void 0:o.call(i,e),l=Array.from(p).reduce(((t,n)=>t||n.hasTarget(e)),!1);return a||s||l}),[h,d]),g=(0,L.useCallback)((e=>{var t,n;o&&(v(e.target)||null===(t=d.current)||void 0===t||null===(n=t.close)||void 0===n||n.call(t))}),[o,v]),y=(0,L.useCallback)((e=>{var t,n,r,o,a;return(null===(t=d.current)||void 0===t||null===(n=t.dropdown)||void 0===n||null===(r=n.contains)||void 0===r?void 0:r.call(n,e.target))?e.stopPropagation():!1===i?null==d||null===(o=d.current)||void 0===o?void 0:o.open():void(null==d||null===(a=d.current)||void 0===a||a.toggle())}),[d]),b=(0,L.cloneElement)(f,{...f.props,tag:e,key:"dd-trigger",ref:h,onClickCapture:null!==(c=f.props)&&void 0!==c&&c.onClick?null:y}),w=r?(0,bi.jsx)(To,{...a,ref:d,children:r}):null;(0,L.useEffect)((()=>(document.addEventListener("click",g,{capture:!0}),()=>document.removeEventListener("click",g,{capture:!0}))),[g]);const x=(0,L.useMemo)((()=>({triggerRef:h,dropdown:d,hasTarget:v,addChild:e=>p.add(e),removeChild:e=>p.delete(e),open:()=>{var e,t;return null==d||null===(e=d.current)||void 0===e||null===(t=e.open)||void 0===t?void 0:t.call(e)},close:()=>{var e,t;return null==d||null===(e=d.current)||void 0===e||null===(t=e.close)||void 0===t?void 0:t.call(e)}})),[h,d]);return(0,L.useEffect)((()=>{if(m)return m.addChild(x),()=>m.removeChild(x)}),[]),(0,bi.jsxs)(Co.Provider,{value:x,children:[b,w]})}));let jo=1;const To=(0,L.forwardRef)((({animated:e=!0,visible:t=!1,...n},r)=>{var i,o;const a=ki("dropdown"),s=(0,L.useRef)(),{triggerRef:l}=null!==(i=(0,L.useContext)(Co))&&void 0!==i?i:{},u=void 0===l,{children:c}=n,[d,f]=(0,L.useState)(t),[p,h]=(0,L.useState)(t),[m,v]=(0,L.useState)({}),[g,y]=(0,L.useState)(t?"visible":null),b=(0,L.useCallback)((()=>{var e,t;const r=s.current,i=null!==(e=null==l?void 0:l.current)&&void 0!==e?e:r.parentNode,{left:o,top:a}=So(i,r,`bottom-${null!==(t=n.align)&&void 0!==t?t:"left"}`);v({left:o,top:a})}),[l]),w=(0,L.useMemo)((()=>jo++),[]),x=(0,L.useCallback)((async(t=!1)=>{if(!1!==n.enabled||!0!==t)return new Promise((n=>{const r=s.current;!1!==e?Hi(r,{transition:()=>{y(t?"appear":"disappear")},beforeTransition:()=>{y(t?"before-appear":"before-disappear")},afterTransition:()=>{y(t?"visible":null),n()}}):(y(t?"visible":null),n())}))}),[e]),k=(0,L.useCallback)((async e=>{var t,r;null===(t=n.onToggle)||void 0===t||t.call(n,e),await x(e),h(e),null===(r=n.onVisibilityChanged)||void 0===r||r.call(n,e)}),[n,x]),_=(0,L.useCallback)((async()=>{!1!==p&&!1!==d&&(await k(!1),f(!1))}),[p,x,n,d]),S=(0,L.useCallback)((async()=>{!0!==p&&!0!==d&&f(!0)}),[p,x,n,d]),C=(0,L.useCallback)((async()=>{!p?S():_()}),[_,p,S]);(0,L.useEffect)((()=>{r&&(r.current={dropdown:s.current,visible:null!==g,toggle:C,open:S,close:_})}),[_,S,r,C,s,g]),(0,L.useEffect)((()=>{h(t)}),[t]),(0,L.useEffect)((()=>{u||"before-appear"!==g||b()}),[g,b,u]),(0,L.useEffect)((()=>{!1===n.enabled&&x(!1)}),[n.enabled]),(0,L.useEffect)((()=>{d&&k(!0)}),[d]);const E=c.props&&"Menu"===c.props.type?(0,L.cloneElement)(c,{...c.props,className:a.elem("menu").mix(c.props.className)}):c,j=(0,L.useMemo)((()=>{switch(g){case"before-appear":return"before-appear";case"appear":return"appear before-appear";case"before-disappear":return"before-disappear";case"disappear":return"disappear before-disappear";case"visible":return"visible";default:return t?"visible":null}}),[g,t]),T={...null!==(o=n.style)&&void 0!==o?o:{},...null!=m?m:{},zIndex:1e3+w},O=(0,bi.jsx)(Si,{ref:s,name:"dropdown",mix:[n.className,j],style:T,onClick:e=>e.stopPropagation(),children:E});return d?!0===n.inline?O:P.createPortal(O,document.body):null}));To.displayName="Dropdown",To.Trigger=Eo,To.Trigger=Eo;const Oo=L.createContext(),{Block:No,Elem:Mo}=_i(),Lo=(0,L.forwardRef)((({children:e,className:t,style:n,size:r,selectedKeys:i,closeDropdownOnItemClick:o},a)=>{const s=(0,L.useContext)(Co),l=(0,L.useMemo)((()=>new Set(null!=i?i:[])),[i]),u=(0,L.useCallback)((e=>{const t=ki("main-menu").elem("item").closest(e.target);s&&t&&!1!==o&&s.close()}),[s]),c=(0,L.useMemo)((()=>!!s),[s]);return(0,bi.jsx)(Oo.Provider,{value:{selected:l},children:(0,bi.jsx)(No,{ref:a,tag:"ul",name:"main-menu",mod:{size:r,collapsed:c},mix:t,style:n,onClick:u,children:e})})}));Lo.Item=({children:e,label:t,icon:n,to:r,className:i,href:o,exact:a=!1,forceReload:s=!1,active:l=!1,onClick:u,...c})=>{const d=ki("main-menu",{elem:"item"}),f=[d.toClassName()];((()=>{const e=location.pathname.replace(/\/$/,""),t=null!=r?r:o;return a?e===t:e.includes(t)})()||l)&&f.push(d.mod({active:!0})),i&&f.push(i);const p=(0,bi.jsxs)(bi.Fragment,{children:[n&&(0,bi.jsx)("span",{className:d.elem("item-icon"),children:n}),null!=e?e:t]}),h={className:f.join(" "),onClick:u,...c},m=d.mod({active:!0}).toClassName(),v=null!=r?r:o;return s&&(h.onClick=()=>location.href=null!=r?r:o),(0,bi.jsx)("li",{children:r?(0,bi.jsx)(_o,{to:v,...h,exact:a,activeClassName:m,"data-external":!0,children:p}):v?(0,bi.jsx)("a",{href:vi(v),...h,children:p}):(0,bi.jsx)("span",{...h,children:p})})},Lo.Spacer=()=>(0,bi.jsx)(Mo,{block:"main-menu",tag:"li",name:"spacer"}),Lo.Divider=()=>(0,bi.jsx)(Mo,{block:"main-menu",tag:"li",name:"divider"}),Lo.Builder=(e,t)=>(null!=t?t:[]).map(((t,n)=>{if("SPACER"===t)return(0,bi.jsx)(Lo.Spacer,{},n);if("DIVIDER"===t)return(0,bi.jsx)(Lo.Divider,{},n);let r,i;if(Array.isArray(t))[i,r]=t;else{const{menuItem:e,title:n,path:o}=t;r=null!=n?n:e,i=o}if("function"==typeof i)return(0,bi.jsx)(Lo.Item,{onClick:i,children:r},n);const o=`${e}${i}`.replace(/([/]+)/g,"/");return(0,bi.jsx)(Lo.Item,{to:o,exact:!0,children:r},n)})),Lo.Group=({children:e,title:t,className:n,style:r})=>(0,bi.jsxs)(No,{name:"menu-group",mix:n,style:r,children:[(0,bi.jsx)(Mo,{name:"title",children:t}),(0,bi.jsx)(Mo,{tag:"ul",name:"list",children:e})]});const{Block:Po,Elem:Ao}=_i(),Do=()=>{const e=Ii(),t=Ic(),n=Rc(),[r,i]=(0,L.useState)(t);return(0,L.useEffect)((()=>{t.length?i(t):e.breadcrumbs&&i(e.breadcrumbs)}),[t,e]),(0,bi.jsx)(Po,{name:"breadcrumbs",children:(0,bi.jsx)(Ao,{tag:"ul",name:"list",children:r.map(((e,t,r)=>{var i;const o=t===r.length-1,a=`item-${t}-${e.title}`,s=null!==(i=e.href)&&void 0!==i?i:e.path,l=null!==n(s),u=(0,bi.jsx)(Ao,{tag:"span",name:"label",mod:{faded:t===e.length-1},children:e.title}),c=e.submenu?(0,bi.jsx)(To,{children:(0,bi.jsx)(Lo,{children:e.submenu.map(((t,n)=>{var r;return(0,bi.jsx)(Lo.Item,{label:t.title,icon:t.icon,href:null!==(r=t.href)&&void 0!==r?r:t.path,active:t.active},`${n}-${e.title}`)}))})}):null;return e.onClick?(0,bi.jsx)(Ao,{tag:"li",name:"item",mod:{last:o},children:(0,bi.jsx)("span",{onClick:e.onClick,children:u})},a):c?(0,bi.jsx)(Ao,{tag:"li",component:To.Trigger,name:"item",mod:{last:o},content:c,children:(0,bi.jsx)("span",{children:u})},a):s&&!o?(0,bi.jsx)(Ao,{tag:"li",name:"item",mod:{last:o},children:l?(0,bi.jsx)(_o,{to:s,"data-external":!0,children:u}):(0,bi.jsx)("a",{href:vi(s),children:u})},a):(0,bi.jsx)(Ao,{tag:"li",name:"item",mod:{last:o},children:u},a)}))})})},Ro=({header:e,extra:t,children:n,style:r})=>{const i=ki("card");return(0,bi.jsxs)("div",{className:i,style:r,children:[(e||t)&&(0,bi.jsxs)("div",{className:i.elem("header"),children:[(0,bi.jsx)("div",{className:i.elem("header-content"),children:e}),t&&(0,bi.jsx)("div",{className:i.elem("header-extra"),children:t})]}),(0,bi.jsx)("div",{className:i.elem("content"),children:n})]})},Io=({children:e,count:t,size:n,gap:r})=>{const i=L.useRef(),o={"--columns":Math.max(1,null!=t?t:1),"--column-width":n,"--column-gap":r};return(0,bi.jsx)("div",{ref:i,className:ki("columns"),style:o,children:e})};Io.Column=({title:e,children:t})=>(0,bi.jsxs)("div",{className:ki("columns").elem("item"),children:[(0,bi.jsx)("div",{className:ki("columns").elem("title"),children:e}),t]});const Fo=({opened:e,animated:t=!0})=>{const n=ki("hamburger");return(0,bi.jsxs)("span",{className:n.mod({animated:t,opened:e}),children:[(0,bi.jsx)("span",{}),(0,bi.jsx)("span",{}),(0,bi.jsx)("span",{})]})};var zo=n(488);zo.domToReact,zo.htmlToDOM,zo.attributesToProps;const Uo=zo,Ho=new Set,Wo=(e,t)=>!![null,void 0,"","text/javascript"].includes(e.type)&&((void 0!==e.dataset.alwaysReload||!0===t||!Ho.has(e.outerHTML))&&!!e.parentNode),Bo=(e,t)=>new Promise((n=>{var r;const i=document.createElement("script"),o=(t=null!==(r=t)&&void 0!==r?r:e).src||(e=>{const t=new Blob([e],{type:"text/javascript"});return URL.createObjectURL(t).toString()})(t.text);if(Ho.add(t.outerHTML),t.async)n();else{const e=({type:t})=>{i.removeEventListener("load",e),i.removeEventListener("error",e),n("error"!==t&&i)};i.addEventListener("load",e),i.addEventListener("error",e)}void 0!==t.dataset.alwaysReload&&(i.dataset.alwaysReload=""),t.id&&(i.id=t.id),t.className&&(i.className=t.className),i.dataset.replaced="true",i.async=t.async,i.defer=t.defer,i.type="text/javascript",i.src=o,e.parentNode.insertBefore(i,e),e.remove()})),$o=async(e,{sourceScript:t,forceUpdate:n=!1}={})=>{var r;if(t=null!==(r=t)&&void 0!==r?r:e,Wo(e,n)&&(t===e||Wo(t,n)))return Bo(e,t)},Vo=async e=>{const t=e.querySelectorAll("script");if(!t.length)return[];const n=function*(e){for(;e.length;){const t=e.shift();yield $o(t).then((e=>e))}}(Array.from(t)),r=[];for await(const e of n)r.push(e);return r},qo=new Map,Go=async(e,t)=>{e&&t&&(e.replaceWith(t),await Vo(t))},Yo=async(e,t)=>{const n=["style:not([data-replaced])","link[rel=stylesheet]:not([data-replaced])"].join(", "),r=Array.from(e.querySelectorAll(n)),i=Array.from(t.querySelectorAll(n)),o=(a=r,new Set(Array.from(a).map((e=>e.outerHTML))));var a;const s=i.filter((e=>!o.has(e.outerHTML)));await Promise.all(s.map((e=>new Promise((t=>{e.onload=()=>t(e.outerHTML),document.head.append(e)})))))},Xo=async(e,t)=>{document.title=e.title,await Yo(document,e),await(async(e,t)=>{Go(e.querySelector("title"),t.querySelector("title"));const n=document.createDocumentFragment();Array.from(t.querySelectorAll("script")).filter((e=>Wo(e))).forEach((e=>n.appendChild(e))),Array.from(e.querySelectorAll("script")).filter((e=>Wo(e))).forEach((e=>e.remove())),e.appendChild(n),await Vo(e)})(document.head,e.head),await(async(e,t)=>{const n=e.querySelector("script#app-settings"),r=t.querySelector("script#app-settings");n&&r&&await $o(n,{sourceScript:r,forceUpdate:!0})})(document,e),await(async(e,t)=>{const n=e.querySelector("#dynamic-content"),r=t.querySelector("#dynamic-content");n&&r?await Go(n,r):await Go(e.body.children[0],r)})(document,e),null==t||t()},Ko=()=>{const{href:e}=location;return e.replace(/#(.*)/g,"")},Qo=async e=>{const t=await(async e=>{try{if(qo.has(e))return qo.get(e);{const t=await fetch(e),n=await t.text();return 401===t.status?void(location.href=vi("/")):t.ok?(qo.set(e,n),n):(Yi({body:()=>(0,bi.jsx)(Ai,{title:`Error ${t.status}: ${t.statusText}`,errorId:t.status,stacktrace:`Cannot load url ${e}\n\n${n}`}),allowClose:!1,style:{width:680}}),null)}}catch(e){return Yi({body:()=>(0,bi.jsx)(Ai,{possum:!1,title:"Connection refused",message:"Server not responding. Is it still running?"}),simple:!0,allowClose:!1,style:{width:680}}),null}})(e);return t?(e=>(new DOMParser).parseFromString(e,"text/html"))(t):null};let Jo=Ko();const Zo=(e,t)=>{const[n,r]=(0,L.useState)(e);return[n,(0,L.useCallback)((async e=>{Jo=e,Ho.clear();const n=await Qo(e);return!!n&&(await Xo(n,t),r(n),!0)}),[])]},ea=(0,L.createContext)(null),ta=(ea.Consumer,({children:e})=>{const t=document,n=fe(),r=(0,L.useContext)(Di),i=(0,L.useCallback)((()=>{r.update(window.APP_SETTINGS)}),[]),[o,a]=Zo(t,i),s=(0,L.useCallback)((async e=>{const t=e.target.closest("a[href]:not([target]):not([download])");if(!(e=>!!e&&!e.dataset.external&&!e.getAttribute("href").match(/#/)&&e.origin===location.origin)(t))return;if(t.matches("[data-external]"))return;if(e.metaKey||e.ctrlKey)return;e.preventDefault();await a(t.href)&&n.push(`${(e=>{if(APP_SETTINGS.hostname){const t=APP_SETTINGS.hostname,n=new URL(t).pathname.replace(/([/]+)$/,"");return e.replace(new RegExp(`^${n}`),"")}return e||"/"})(t.pathname)}${t.search}`)}),[]),l=(0,L.useCallback)((()=>{const e=Ko();e===Jo||(Jo=e,a(e))}),[]);return(0,L.useEffect)((()=>(document.addEventListener("click",s,{capture:!0}),window.addEventListener("popstate",l),()=>{document.removeEventListener("click",s,{capture:!0}),window.removeEventListener("popstate",l)})),[]),(0,bi.jsx)(ea.Provider,{value:o,children:e})}),na=(e,t,n,r)=>{let i,o=!1;if(!n||0===n.length||n instanceof Function){var a;const s=t.querySelector(`template#${e}`),l=null!==(a=s.innerHTML)&&void 0!==a?a:"";if(r){const e=Uo(l);i=n instanceof Function&&n(e)||e}else{const e=n instanceof Function&&n(s);e?i=e:(i=l,o=!0)}}else i=n;return{children:i,setInnerHTML:o}},ra=L.forwardRef((({id:e,tagName:t,children:n,source:r,onRenderFinished:i,parse:o=!1,raw:a=!1,...s},l)=>{const u=null!=l?l:L.useRef(),[c,d]=L.useState(na(e,r,n,o));return L.useEffect((()=>{d(na(e,r,n,o))}),[r,n]),L.useEffect((()=>{u.current&&Vo(u.current),null==i||i()}),[c]),c.setInnerHTML?s.dangerouslySetInnerHTML={__html:c.children}:s.children=c.children,!0===a&&c.children?(0,bi.jsx)(L.Fragment,{children:c.children}):L.createElement(null!=t?t:"div",{...s,ref:u})})),ia=L.forwardRef(((e,t)=>{const n=L.useContext(ea);return n?(0,bi.jsx)(ra,{...e,source:n,ref:t}):null})),oa=(0,L.forwardRef)((({title:e,children:t,defaultVisible:n,disabled:r,style:i},o)=>{if(!t||Array.isArray(t))throw new Error("Tooltip does accept a single child only");const a=null!=o?o:(0,L.useRef)(),s=(0,L.useRef)(),[l,u]=(0,L.useState)({}),[c,d]=(0,L.useState)(n?"visible":null),[f,p]=(0,L.useState)(!1),[h,m]=(0,L.useState)("top-center"),v=(0,L.useCallback)((()=>{const{left:e,top:t,align:n}=So(a.current,s.current,h,10);u({left:e,top:t}),m(n)}),[a.current,s.current]),g=(0,L.useCallback)((e=>{s.current&&Hi(s.current,{beforeTransition(){d(e?"before-appear":"before-disappear")},transition(){e&&v(),d(e?"appear":"disappear")},afterTransition(){d(e?"visible":null),!1===e&&p(!1)}})}),[f,v,s]),y=(0,L.useMemo)((()=>{switch(c){case"before-appear":return"before-appear";case"appear":return"appear before-appear";case"before-disappear":return"before-disappear";case"disappear":return"disappear before-disappear";case"visible":return"visible";default:return c?"visible":null}}),[c]),b=(0,L.useMemo)((()=>f?(0,bi.jsx)(Si,{ref:s,name:"tooltip",mod:{align:h},mix:y,style:{...l,...null!=i?i:{}},children:(0,bi.jsx)(Ci,{name:"body",children:e})}):null),[f,l,e,y,s]),w=L.Children.only(t),x=(0,L.cloneElement)(w,{...w.props,ref:a,onMouseEnter(e){var t,n;!0!==r&&(p(!0),null===(t=(n=w.props).onMouseEnter)||void 0===t||t.call(n,e))},onMouseLeave(e){var t,n;!0!==r&&(g(!1),null===(t=(n=w.props).onMouseLeave)||void 0===t||t.call(n,e))}});return(0,L.useEffect)((()=>{f&&g(!0)}),[f]),(0,bi.jsxs)(bi.Fragment,{children:[x,(0,P.createPortal)(b,document.body)]})}));oa.displayName="Tooltip";const aa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",sa=(0,L.forwardRef)((({username:e,size:t,src:n,user:r,className:i,showUsername:o,style:a,...s},l)=>{var u;const c=(0,L.useRef)(),[d,f]=(0,L.useState)(e),[p,h]=(0,L.useState)(null!==(u=null==r?void 0:r.avatar)&&void 0!==u?u:n),[m,v]=(0,L.useState)(!1),[g,y]=(0,L.useState)(!0);t&&(a=Object.assign({width:t,height:t,fontSize:.4*t},a)),(0,L.useEffect)((()=>{if(r){const{first_name:e,last_name:t,email:n,initials:i,username:o}=r;i?f(i):o?f(o):e&&t?f(`${e[0]}${t[0]}`):n&&f(n.substring(0,2)),r.avatar&&h(r.avatar)}else f(e),h(n)}),[r]);const b=(0,L.useCallback)((()=>{v(!0),p!==aa&&y(!1)}),[p]),w=(0,bi.jsxs)(Si,{ref:l,name:"userpic",mix:i,style:a,...s,children:[(0,bi.jsx)(Ci,{tag:"img",name:"avatar",ref:c,src:p,alt:(null!=d?d:"").toUpperCase(),style:{opacity:m?1:0},onLoad:b,onError:()=>h(aa)}),g&&(0,bi.jsx)(Ci,{tag:"span",name:"username",children:(null!=d?d:"").toUpperCase()})]}),x=(0,L.useMemo)((()=>{var t,n;return null!=r&&r.first_name||null!=r&&r.last_name?`${null!==(t=null==r?void 0:r.first_name)&&void 0!==t?t:""} ${null!==(n=null==r?void 0:r.last_name)&&void 0!==n?n:""}`.trim():null!=r&&r.email?r.email:e}),[r,e]);return o&&x?(0,bi.jsx)(oa,{title:x,children:w}):w}));function la(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function ua(e){la(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function ca(e){la(1,arguments);var t=ua(e);return!isNaN(t)}sa.displayName="Userpic";var da={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function fa(e){return function(t){var n=t||{},r=n.width?String(n.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var pa={date:fa({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:fa({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:fa({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})};var ha={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ma(e){return function(t,n){var r,i=n||{};if("formatting"===(i.context?String(i.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=i.width?String(i.width):o;r=e.formattingValues[a]||e.formattingValues[o]}else{var s=e.defaultWidth,l=i.width?String(i.width):e.defaultWidth;r=e.values[l]||e.values[s]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function va(e){return function(t,n){var r=String(t),i=n||{},o=i.width,a=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],s=r.match(a);if(!s)return null;var l,u=s[0],c=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth];return l="[object Array]"===Object.prototype.toString.call(c)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}(c,(function(e){return e.test(u)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}(c,(function(e){return e.test(u)})),l=e.valueCallback?e.valueCallback(l):l,{value:l=i.valueCallback?i.valueCallback(l):l,rest:r.slice(u.length)}}}var ga;const ya={code:"en-US",formatDistance:function(e,t,n){var r;return n=n||{},r="string"==typeof da[e]?da[e]:1===t?da[e].one:da[e].other.replace("{{count}}",t),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r},formatLong:pa,formatRelative:function(e,t,n,r){return ha[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:ma({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ma({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:ma({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:ma({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:ma({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(ga={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e,t){var n=String(e),r=t||{},i=n.match(ga.matchPattern);if(!i)return null;var o=i[0],a=n.match(ga.parsePattern);if(!a)return null;var s=ga.valueCallback?ga.valueCallback(a[0]):a[0];return{value:s=r.valueCallback?r.valueCallback(s):s,rest:n.slice(o.length)}}),era:va({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:va({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:va({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:va({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:va({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function ba(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function wa(e,t){la(2,arguments);var n=ua(e).getTime(),r=ba(t);return new Date(n+r)}function xa(e,t){la(2,arguments);var n=ba(t);return wa(e,-n)}function ka(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}const _a={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return ka("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):ka(n+1,2)},d:function(e,t){return ka(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return"am"===n?"a.m.":"p.m."}},h:function(e,t){return ka(e.getUTCHours()%12||12,t.length)},H:function(e,t){return ka(e.getUTCHours(),t.length)},m:function(e,t){return ka(e.getUTCMinutes(),t.length)},s:function(e,t){return ka(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds();return ka(Math.floor(r*Math.pow(10,n-3)),t.length)}};var Sa=864e5;function Ca(e){la(1,arguments);var t=1,n=ua(e),r=n.getUTCDay(),i=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-i),n.setUTCHours(0,0,0,0),n}function Ea(e){la(1,arguments);var t=ua(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=Ca(r),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var a=Ca(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function ja(e){la(1,arguments);var t=Ea(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=Ca(n);return r}var Ta=6048e5;function Oa(e,t){la(1,arguments);var n=t||{},r=n.locale,i=r&&r.options&&r.options.weekStartsOn,o=null==i?0:ba(i),a=null==n.weekStartsOn?o:ba(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=ua(e),l=s.getUTCDay(),u=(l<a?7:0)+l-a;return s.setUTCDate(s.getUTCDate()-u),s.setUTCHours(0,0,0,0),s}function Na(e,t){la(1,arguments);var n=ua(e,t),r=n.getUTCFullYear(),i=t||{},o=i.locale,a=o&&o.options&&o.options.firstWeekContainsDate,s=null==a?1:ba(a),l=null==i.firstWeekContainsDate?s:ba(i.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var u=new Date(0);u.setUTCFullYear(r+1,0,l),u.setUTCHours(0,0,0,0);var c=Oa(u,t),d=new Date(0);d.setUTCFullYear(r,0,l),d.setUTCHours(0,0,0,0);var f=Oa(d,t);return n.getTime()>=c.getTime()?r+1:n.getTime()>=f.getTime()?r:r-1}function Ma(e,t){la(1,arguments);var n=t||{},r=n.locale,i=r&&r.options&&r.options.firstWeekContainsDate,o=null==i?1:ba(i),a=null==n.firstWeekContainsDate?o:ba(n.firstWeekContainsDate),s=Na(e,t),l=new Date(0);l.setUTCFullYear(s,0,a),l.setUTCHours(0,0,0,0);var u=Oa(l,t);return u}var La=6048e5;var Pa="midnight",Aa="noon",Da="morning",Ra="afternoon",Ia="evening",Fa="night";function za(e,t){var n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),o=r%60;if(0===o)return n+String(i);var a=t||"";return n+String(i)+a+ka(o,2)}function Ua(e,t){return e%60==0?(e>0?"-":"+")+ka(Math.abs(e)/60,2):Ha(e,t)}function Ha(e,t){var n=t||"",r=e>0?"-":"+",i=Math.abs(e);return r+ka(Math.floor(i/60),2)+n+ka(i%60,2)}const Wa={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return _a.y(e,t)},Y:function(e,t,n,r){var i=Na(e,r),o=i>0?i:1-i;return"YY"===t?ka(o%100,2):"Yo"===t?n.ordinalNumber(o,{unit:"year"}):ka(o,t.length)},R:function(e,t){return ka(Ea(e),t.length)},u:function(e,t){return ka(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ka(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ka(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return _a.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return ka(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var i=function(e,t){la(1,arguments);var n=ua(e),r=Oa(n,t).getTime()-Ma(n,t).getTime();return Math.round(r/La)+1}(e,r);return"wo"===t?n.ordinalNumber(i,{unit:"week"}):ka(i,t.length)},I:function(e,t,n){var r=function(e){la(1,arguments);var t=ua(e),n=Ca(t).getTime()-ja(t).getTime();return Math.round(n/Ta)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):ka(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):_a.d(e,t)},D:function(e,t,n){var r=function(e){la(1,arguments);var t=ua(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),i=n-r;return Math.floor(i/Sa)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):ka(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var i=e.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return ka(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var i=e.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return ka(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),i=0===r?7:r;switch(t){case"i":return String(i);case"ii":return ka(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,i=e.getUTCHours();switch(r=12===i?Aa:0===i?Pa:i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,i=e.getUTCHours();switch(r=i>=17?Ia:i>=12?Ra:i>=4?Da:Fa,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return _a.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):_a.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):ka(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):ka(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):_a.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):_a.s(e,t)},S:function(e,t){return _a.S(e,t)},X:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return Ua(i);case"XXXX":case"XX":return Ha(i);case"XXXXX":case"XXX":default:return Ha(i,":")}},x:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return Ua(i);case"xxxx":case"xx":return Ha(i);case"xxxxx":case"xxx":default:return Ha(i,":")}},O:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+za(i,":");case"OOOO":default:return"GMT"+Ha(i,":")}},z:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+za(i,":");case"zzzz":default:return"GMT"+Ha(i,":")}},t:function(e,t,n,r){var i=r._originalDate||e;return ka(Math.floor(i.getTime()/1e3),t.length)},T:function(e,t,n,r){return ka((r._originalDate||e).getTime(),t.length)}};function Ba(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function $a(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}const Va={p:$a,P:function(e,t){var n,r=e.match(/(P+)(p+)?/),i=r[1],o=r[2];if(!o)return Ba(e,t);switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",Ba(i,t)).replace("{{time}}",$a(o,t))}};var qa=6e4;function Ga(e){return e.getTime()%qa}function Ya(e){var t=new Date(e.getTime()),n=Math.ceil(t.getTimezoneOffset());t.setSeconds(0,0);var r=n>0?(qa+Ga(t))%qa:Ga(t);return n*qa+r}var Xa=["D","DD"],Ka=["YY","YYYY"];function Qa(e){return-1!==Xa.indexOf(e)}function Ja(e){return-1!==Ka.indexOf(e)}function Za(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var es=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ts=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ns=/^'([^]*?)'?$/,rs=/''/g,is=/[a-zA-Z]/;function os(e,t,n){la(2,arguments);var r=String(t),i=n||{},o=i.locale||ya,a=o.options&&o.options.firstWeekContainsDate,s=null==a?1:ba(a),l=null==i.firstWeekContainsDate?s:ba(i.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var u=o.options&&o.options.weekStartsOn,c=null==u?0:ba(u),d=null==i.weekStartsOn?c:ba(i.weekStartsOn);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");var f=ua(e);if(!ca(f))throw new RangeError("Invalid time value");var p=Ya(f),h=xa(f,p),m={firstWeekContainsDate:l,weekStartsOn:d,locale:o,_originalDate:f},v=r.match(ts).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,Va[t])(e,o.formatLong,m):e})).join("").match(es).map((function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return as(n);var a=Wa[r];if(a)return!i.useAdditionalWeekYearTokens&&Ja(n)&&Za(n,t,e),!i.useAdditionalDayOfYearTokens&&Qa(n)&&Za(n,t,e),a(h,n,o.localize,m);if(r.match(is))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n})).join("");return v}function as(e){return e.match(ns)[1].replace(rs,"'")}const ss=(0,L.createContext)(),ls=({children:e})=>{const t=io(),[n,r]=(0,L.useReducer)(((e,t)=>{if("fetch-version"===t.type)return{...e,...t.payload}})),i=(0,L.useCallback)((async()=>{const e=await t.callApi("version");if(null!==e){const t=e["label-studio-os-package"];r({type:"fetch-version",payload:{version:t.version,latestVersion:t.latest_version_from_pypi,newVersion:t.current_version_is_outdated,updateTime:os(new Date(t.latest_version_upload_time),"MMM d")}})}}),[]);return(0,L.useEffect)((()=>{i()}),[]),(0,bi.jsx)(ss.Provider,{value:n,children:e})},us=({showNewVersion:e,showCurrentVersion:t})=>{var n;const{newVersion:r,updateTime:i,latestVersion:o,version:a}=null!==(n=(0,L.useContext)(ss))&&void 0!==n?n:{};return r&&e?(0,bi.jsx)(Si,{tag:"li",name:"version-notifier",children:(0,bi.jsxs)("a",{href:"https://pypi.org/project/label-studio/#history",target:"_blank",children:[(0,bi.jsx)(Ci,{name:"icon",children:(0,bi.jsx)(Pn,{})}),(0,bi.jsxs)(Ci,{name:"content",children:[(0,bi.jsxs)(Ci,{name:"title","data-date":i,children:[o," Available"]}),(0,bi.jsxs)(Ci,{name:"description",children:["Current version: ",a]})]})]})}):a&&t?(0,bi.jsxs)(Si,{tag:wo,name:"current-version",to:"/version",target:"_blank",children:["v",a]}):null},cs=(0,L.createContext)(),ds=({className:e})=>(0,bi.jsx)(ia,{id:"context-menu-left",className:e,children:e=>(0,bi.jsx)(Do,{fromTemplate:e})}),fs=({className:e,...t})=>{const{ContextComponent:n,contextProps:r}=zc();return n?(0,bi.jsx)("div",{className:e,children:(0,bi.jsx)(n,{...t,...null!=r?r:{}})}):(0,bi.jsx)(ia,{id:"context-menu-right",className:e})},ps=({enabled:e,defaultOpened:t,defaultPinned:n,children:r,onSidebarToggle:i,onSidebarPin:o})=>{const a=(0,L.useRef)(),s=(0,L.useRef)(),l=Uc(),u=Ii(),[c,d]=(0,L.useState)(null!=t&&t),[f,p]=(0,L.useState)(null!=n&&n),[h,m]=(0,L.useState)({Component:null,props:{}}),v=ki("menu-header"),g=v.elem("context"),y=ki("sidebar"),b=ki("content-wrapper"),w=v.elem("context-item"),x=!pi(u.user.allow_newsletters),k=(0,L.useCallback)((e=>{e.preventDefault();const t=!f;p(t),null==o||o(t)}),[f]),_=(0,L.useCallback)((e=>{const t=e;d(t),null==i||i(t)}),[c]),S=(0,L.useMemo)((()=>({PageContext:h,setContext(e){setTimeout((()=>{m({...h,Component:e})}))},setProps(e){setTimeout((()=>{m({...h,props:e})}))},contextIsSet:e=>h.Component===e})),[h]);return(0,L.useEffect)((()=>{var e,t;f||(null==a||null===(t=a.current)||void 0===t||t.close());null==s||null===(e=s.current)||void 0===e||e.close()}),[l]),(0,bi.jsxs)("div",{className:b,children:[e&&(0,bi.jsxs)("div",{className:v,children:[(0,bi.jsx)(To.Trigger,{dropdown:a,closeOnClickOutside:!f,children:(0,bi.jsxs)("div",{className:`${v.elem("trigger")} main-menu-trigger`,children:[(0,bi.jsx)("img",{src:vi("/static/icons/logo-black.svg"),alt:"Label Studio Logo",height:"22"}),(0,bi.jsx)(Fo,{opened:c})]})}),(0,bi.jsxs)("div",{className:g,children:[(0,bi.jsx)(ds,{className:w.mod({left:!0})}),(0,bi.jsx)(fs,{className:w.mod({right:!0})})]}),(0,bi.jsx)(To.Trigger,{ref:s,align:"right",content:(0,bi.jsxs)(Lo,{children:[(0,bi.jsx)(Lo.Item,{icon:(0,bi.jsx)(qr,{}),label:"Account & Settings",href:"/user/account","data-external":!0}),(0,bi.jsx)(Lo.Item,{icon:(0,bi.jsx)(tr,{}),label:"Log Out",href:vi("/logout"),"data-external":!0}),x&&(0,bi.jsxs)(bi.Fragment,{children:[(0,bi.jsx)(Lo.Divider,{}),(0,bi.jsxs)(Lo.Item,{className:ki("newsletter-menu-item"),href:"/user/account","data-external":!0,children:[(0,bi.jsx)("span",{children:"Please check new notification settings in the Account & Settings page"}),(0,bi.jsx)("span",{className:ki("newsletter-menu-badge")})]})]})]}),children:(0,bi.jsxs)("div",{title:u.user.email,className:v.elem("user"),children:[(0,bi.jsx)(sa,{user:u.user}),x&&(0,bi.jsx)("div",{className:v.elem("userpic-badge")})]})})]}),(0,bi.jsx)(ls,{children:(0,bi.jsxs)("div",{className:b.elem("body"),children:[e&&(0,bi.jsx)(To,{ref:a,onToggle:_,onVisibilityChanged:()=>window.dispatchEvent(new Event("resize")),visible:c,className:[y,y.mod({floating:!f})].join(" "),style:{width:240},children:(0,bi.jsxs)(Lo,{children:[(0,bi.jsx)(Lo.Item,{label:"Projects",to:"/projects",icon:(0,bi.jsx)(hr,{}),"data-external":!0,exact:!0}),(0,bi.jsx)(Lo.Item,{label:"Organization",to:"/organization",icon:(0,bi.jsx)(Ar,{}),"data-external":!0,exact:!0}),(0,bi.jsx)(Lo.Spacer,{}),(0,bi.jsx)(us,{showNewVersion:!0}),(0,bi.jsx)(Lo.Item,{label:"API",href:"/docs/api",icon:(0,bi.jsx)(ri,{}),target:"_blank"}),(0,bi.jsx)(Lo.Item,{label:"Docs",href:"https://labelstud.io/guide",icon:(0,bi.jsx)(zn,{}),target:"_blank"}),(0,bi.jsx)(Lo.Item,{label:"GitHub",href:"https://github.com/heartexlabs/label-studio",icon:(0,bi.jsx)(br,{}),target:"_blank"}),(0,bi.jsx)(Lo.Item,{label:"Slack Community",href:"https://slack.labelstudio.heartex.com/?source=product-menu",icon:(0,bi.jsx)(Zr,{}),target:"_blank"}),(0,bi.jsx)(us,{showCurrentVersion:!0}),(0,bi.jsx)(Lo.Divider,{}),(0,bi.jsx)(Lo.Item,{icon:(0,bi.jsx)(Fr,{}),className:y.elem("pin"),onClick:k,active:f,children:f?"Unpin menu":"Pin menu"})]})}),(0,bi.jsx)(cs.Provider,{value:S,children:(0,bi.jsx)("div",{className:b.elem("content").mod({withSidebar:f&&c}),children:r})})]})})]})},hs=({children:e,menu:t,path:n,menuItems:r})=>{const i=ki("sidebar-menu");return(0,bi.jsxs)("div",{className:i,children:[r&&r.length>1?(0,bi.jsx)("div",{className:i.elem("navigation"),children:(0,bi.jsx)(Lo,{children:r?Lo.Builder(n,r):t})}):null,(0,bi.jsx)("div",{className:i.elem("content"),children:e})]})},ms=({className:e,style:t,size:n=32,stopped:r=!1})=>{const i=ki("spinner"),o="number"==typeof n?`${n}px`:n;return(0,bi.jsx)("div",{className:i.mix(e),style:{...null!=t?t:{},"--spinner-size":o},children:(0,bi.jsxs)("div",{className:i.elem("body").mod({stopped:r}),children:[(0,bi.jsx)("span",{}),(0,bi.jsx)("span",{}),(0,bi.jsx)("span",{}),(0,bi.jsx)("span",{})]})})},vs=({className:e,style:t,big:n,items:r,active:i,onSelect:o})=>{const a=ki("toggle-items");return(0,bi.jsx)("ul",{className:a.mod({big:n}).mix(e).toString(),style:t,children:Object.keys(r).map((e=>(0,bi.jsx)("li",{className:a.elem("item").mod({active:e===i}).toString(),onClick:()=>o(e),children:r[e]},e)))})},gs=(e,t)=>{const n=(0,L.useMemo)((()=>{var n;return null!==(n=null!=e?e:t)&&void 0!==n?n:""}),[e,t]),[r,i]=(0,L.useState)(n);return(0,L.useEffect)((()=>{i(n)}),[n]),[r,i]};var ys={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},bs=L.createContext&&L.createContext(ys),ws=function(){return(ws=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},xs=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function ks(e){return e&&e.map((function(e,t){return L.createElement(e.tag,ws({key:t},e.attr),ks(e.child))}))}function _s(e){return function(t){return L.createElement(Ss,ws({attr:ws({},e.attr)},t),ks(e.child))}}function Ss(e){var t=function(t){var n,r=e.attr,i=e.size,o=e.title,a=xs(e,["attr","size","title"]),s=i||t.size||"1em";return t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className),L.createElement("svg",ws({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,a,{className:n,style:ws(ws({color:e.color||t.color},t.style),e.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),o&&L.createElement("title",null,o),e.children)};return void 0!==bs?L.createElement(bs.Consumer,null,(function(e){return t(e)})):t(ys)}function Cs(e){return _s({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z"}}]})(e)}function Es(e){return _s({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function js(e){return _s({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}const Ts=({value:e,children:t,className:n})=>{const r=(0,L.useMemo)((()=>Array.isArray(t)?t.find((t=>t.props.case===e))||null:t.props.case===e?t:void 0),[t,e]);return r?L.cloneElement(r,{...r.props,className:[n,r.props.className].join(" ")}):null},Os=(e,t)=>{if(!pi(t)||hi(t))return`${e} is required`},Ns=e=>(t,n)=>{if(e="string"==typeof e?new RegExp(e):e,!hi(n)&&null===n.match(e))return`${t} must match the pattern ${e}`},Ms=(e,t)=>{const n=`${e} must be valid JSON string`;if(pi(t)&&0!==t.trim().length){if(!1===/^(\{|\[)/.test(t)||!1===/(\}|\])$/.test(t))return n;try{JSON.parse(t)}catch(e){return n}}},Ls=(e,t)=>{try{new RegExp(t)}catch(t){return`${e} must be a valid regular expression`}},Ps=(0,L.forwardRef)((({label:e,name:n,children:r,required:i,validate:o,skip:a,allowEmpty:s,protectedValue:l,skipAutofill:u,setValue:c,dependency:d,validators:f,...p},h)=>{var m;const v=(0,L.useContext)(Ei),[g,y]=(0,L.useState)(null),b=null!=h?h:(0,L.useRef)(),w=[...null!=o?o:[]];null==f||null===(m=f.forEach)||void 0===m||m.call(f,(e=>{const[n,r]=e.split(/:(.+)/).slice(0,2),i=t[n];pi(i)&&(pi(r)?w.push(i(r)):w.push(i))})),i&&w.push(Os),(0,L.useEffect)((()=>{if(!v||!d)return;let e=null;const t=v.getFieldContext(d),n=()=>{var e;null===(e=p.onDependencyChanged)||void 0===e||e.call(p,t.field)};return t?(t.field.addEventListener("change",n),e=t.field):console.warn(`Dependency field not found ${d}`),y(e),()=>t.field.removeEventListener("change",n)}),[v,b,d]);const x=(0,L.useCallback)((e=>{if(!b||!b.current)return;const t=b.current;c instanceof Function?c(e):"checkbox"===t.type||"radio"===t.type?t.checked=null!=e?e:t.checked:t.value=null===e?"":e;const n=document.createEvent("HTMLEvents");n.initEvent("change",!1,!0),t.dispatchEvent(n)}),[b]);return(0,L.useEffect)((()=>{const t=u&&(!s||l)&&"password"===b.current.type;return null==v||v.registerField({label:e,name:n,validation:w,skip:a,allowEmpty:s,skipAutofill:u,isProtected:t,protectedValue:l,field:b.current,setValue:x}),()=>null==v?void 0:v.unregisterField(n)}),[b,x]),r(b,g,v)})),As=({text:e,children:t,required:n,placement:r,description:i,size:o,large:a,style:s,simple:l,flat:u})=>{const c=ki("label"),d=[c],f=l?"div":"label",p={size:o,large:a,flat:u,placement:r,withDescription:!!i,empty:!t};return d.push(c.mod(p)),(0,L.createElement)(f,{className:d.join(" "),"data-required":n,style:s},(0,bi.jsxs)(bi.Fragment,{children:[(0,bi.jsx)("div",{className:c.elem("text"),children:(0,bi.jsxs)("div",{className:c.elem("content"),children:[e,i&&(0,bi.jsx)("div",{className:c.elem("description"),children:i})]})}),(0,bi.jsx)("div",{className:c.elem("field"),children:t})]}))},Ds=["ArrowUp","ArrowDown","Backspace","Delete",/[0-9]/],Rs=L.createContext(null),Is=({type:e})=>{const{currentValue:t,min:n,max:r,disabled:i,ref:o,onClickHandler:a}=L.useContext(Rs),s="increase"===e?r:n;return(0,bi.jsx)(Ci,{tag:"a",href:"#",name:"btn",mod:{type:e,disabled:t===s||i},onClick:a(e,o),onMouseDownCapture:e=>e.preventDefault(),children:(0,bi.jsxs)(Ts,{value:e,children:[(0,bi.jsx)(Es,{case:"decrease"}),(0,bi.jsx)(js,{case:"increase"})]})})},Fs=({label:e,className:t,validate:n,required:r,skip:i,labelProps:o,...a})=>{var s,l,u,c,d;const[f,p]=[null!==(s=a.min)&&void 0!==s?s:-1/0,null!==(l=a.max)&&void 0!==l?l:1/0],h=e=>Math.max(f,Math.min(p,e)),[m,v]=L.useState(h(null!==(u=a.value)&&void 0!==u?u:0)),[g,y]=L.useState(null!==(c=a.autofocus)&&void 0!==c&&c),[b,w]=L.useState(null!==(d=a.disabled)&&void 0!==d?d:null),x=e=>{v(h(Number(e)))},k=L.useCallback((()=>{var e;x((null!=m?m:0)+(null!==(e=a.step)&&void 0!==e?e:1))}),[m,a.step]),_=L.useCallback((()=>{var e;x((null!=m?m:0)-(null!==(e=a.step)&&void 0!==e?e:1))}),[m,a.step]),S=e=>{const t=Ds.find((t=>t instanceof RegExp?t.test(e.key):t===e.key));t||e.metaKey||e.preventDefault(),"ArrowUp"===t?(k(),e.preventDefault()):"ArrowDown"===t&&(_(),e.preventDefault())},C=e=>{const t=e.nativeEvent.clipboardData.getData("text");/([0-9]+)/.test(t)||e.preventDefault()},E=e=>{var t;e.target.value?v(h(Number(e.target.value))):v(""),null===(t=a.onChange)||void 0===t||t.call(a,e)},j=e=>{var t;y(!0),null===(t=a.onFocus)||void 0===t||t.call(a,e)},T=e=>{var t;y(!1),null===(t=a.onBlur)||void 0===t||t.call(a,e)},O=(e,t)=>n=>{var r;return n.preventDefault(),n.stopPropagation(),null===(r=document.activeElement)||void 0===r||r.blur(),y(),t.current.focus(),getSelection().removeAllRanges(),"increase"===e?k():"decrease"===e?_():void 0},N=(0,bi.jsx)(Ps,{label:e,name:a.name,validate:n,required:r,setValue:x,skip:i,onDependencyChanged:e=>{"checkbox"===e.type&&w(!e.checked)},...a,children:(e,n)=>{const r="checkbox"===(null==n?void 0:n.type)&&!1===(null==n?void 0:n.checked)||!1,i=null!=b?b:r,o={currentValue:m,min:f,max:p,disabled:i,ref:e,onClickHandler:O};return(0,bi.jsx)(Rs.Provider,{value:o,children:(0,bi.jsxs)(Si,{name:"counter",mod:{focused:g,disabled:i},mix:t,children:[(0,bi.jsx)(Is,{type:"decrease"}),(0,bi.jsx)(Ci,{ref:e,tag:"input",name:"input",type:"text",disabled:i,value:m,onKeyDown:S,onPaste:C,onChange:E,onFocus:j,onBlur:T}),(0,bi.jsx)(Is,{type:"increase"})]})})}});return e?(0,bi.jsx)(As,{...null!=o?o:{},text:e,required:r,children:N}):N},zs=({label:e,className:t,validate:n,required:r,skip:i,labelProps:o,ghost:a,...s})=>{const l=[ki("input").mod({ghost:a}),t].join(" ").trim(),u=(0,bi.jsx)(Ps,{label:e,name:s.name,validate:n,required:r,skip:i,...s,children:e=>(0,bi.jsx)("input",{...s,ref:e,className:l})});return e?(0,bi.jsx)(As,{...null!=o?o:{},text:e,required:r,children:u}):u},Us=({label:e,className:t,options:n,validate:r,required:i,skip:o,labelProps:a,ghost:s,...l})=>{const u=ki("select"),c=(0,L.useMemo)((()=>{var e;return null!==(e=l.value)&&void 0!==e?e:""}),[l.value]),[d,f]=(0,L.useState)(c),p=u.mod({ghost:s}).mix(t);(0,L.useEffect)((()=>{f(c)}),[c]);const h=(0,bi.jsx)(Ps,{name:l.name,label:e,validate:r,required:i,skip:o,setValue:e=>f(e),...l,children:e=>(0,bi.jsx)("div",{className:p,children:(0,bi.jsxs)("select",{...l,value:d,onChange:e=>{var t;f(e.target.value),null===(t=l.onChange)||void 0===t||t.call(l,e)},ref:e,className:u.elem("list"),children:[l.placeholder&&(!l.defaulValue||!l.value)&&(0,bi.jsx)("option",{value:"",disabled:!0,hidden:!0,children:l.placeholder}),(null!=n?n:[]).map((e=>{var t,n,r,i;const o=null!==(t=e.value)&&void 0!==t?t:e,a=null!==(n=e.label)&&void 0!==n?n:o,s=null!==(r=e.disabled)&&void 0!==r&&r,l=null!==(i=e.hidden)&&void 0!==i&&i;return(0,bi.jsx)("option",{value:o,disabled:s,hidden:l,children:a},o)}))]})})});return e?(0,bi.jsx)(As,{...null!=a?a:{},text:e,required:i,children:h}):h},Hs=({label:e,className:t,validate:n,required:r,skip:i,labelProps:o,...a})=>{const s=[ki("textarea"),t].join(" ").trim(),l=(0,bi.jsx)(Ps,{label:e,name:a.name,validate:n,required:r,skip:i,...a,children:e=>(0,bi.jsx)("textarea",{...a,ref:e,className:s})});return e?(0,bi.jsx)(As,{...null!=o?o:{},text:e,required:r,children:l}):l},Ws=(0,L.forwardRef)((({className:e,label:t,labelProps:n,description:r,checked:i,defaultChecked:o,onChange:a,validate:s,required:l,skip:u,...c},d)=>{const f=ki("toggle"),p=(0,L.useMemo)((()=>{var e;return null!==(e=null!=o?o:i)&&void 0!==e&&e}),[o,i]),[h,m]=gs(i,null!=o&&o),v=[f],g={};(0,L.useEffect)((()=>{m(p)}),[p]),h&&(g.checked=h),g.disabled=c.disabled,v.push(f.mod(g),e);const y=(0,bi.jsx)(Ps,{ref:t?null:d,label:t,name:c.name,validate:s,required:l,skip:u,setValue:e=>m(e),...c,children:e=>(0,bi.jsxs)("div",{className:v.join(" "),children:[(0,bi.jsx)("input",{ref:e,...c,className:f.elem("input"),type:"checkbox",checked:h,onChange:e=>{m(e.target.checked),null==a||a(e)}}),(0,bi.jsx)("span",{className:f.elem("indicator")})]})});return t?(0,bi.jsx)(As,{ref:d,placement:"right",required:l,text:t,children:y,description:r,...null!=n?n:{}}):y}));const Bs=(e,t)=>{const n=function(){const e=(0,L.useRef)(!0);return e.current?(e.current=!1,!0):e.current}();(0,L.useEffect)((()=>{if(!n)return e()}),t)},$s=(0,L.forwardRef)((({allowInput:e=!0,allowRewind:t=!0,disabled:n=!1,size:r="medium",pageSizeOptions:i=[],...o},a)=>{var s,l;const[u,c]=(0,L.useState)(!1),[d,f]=gs(o.page),[p,h]=gs(o.waiting),[m,v]=gs(o.pageSize,null!==(s=null!==(l=(e=>{const t=localStorage.getItem(`pages:${e}`);if(pi(t))return parseInt(t)})(o.name))&&void 0!==l?l:null==i?void 0:i[0])&&void 0!==s?s:10),g=(0,L.useMemo)((()=>{var e;return null!==(e=o.totalPages)&&void 0!==e?e:Math.ceil(o.totalItems/m)}),[m,o.totalItems,o.totalPages]),y=(0,L.useMemo)((()=>{const{totalItems:e}=o,t=m*d-m+1,n=t+m-1;return{start:yi(t,1,e),end:yi(n,1,e)}}),[d,g,m,o.totalItems]),b=(0,L.useCallback)((async(e,t)=>{o.onPageLoad&&(h(!0),await o.onPageLoad(e,t),h(!1))}),[o.onPageLoad]),w=(0,L.useCallback)(((e,t=!1)=>{const n=yi(e,1,g);n===d&&!0!==t||(f(n),x(n))}),[g,d,m,b]),x=(0,L.useCallback)(((e,t={})=>{if(!o.urlParamName)return;const n=new URLSearchParams(location.search);n.set(o.urlParamName,e.toString());const r=[{page:e},"",`${location.pathname}?${n.toString()}`];t.replace?history.replaceState(...r):history.pushState(...r)}),[o.urlParamName]),k=e=>{const t=parseInt(e.target.value);w(t),c(!1)};return(0,L.useEffect)((()=>{var e;null===(e=o.onInit)||void 0===e||e.call(o,d,m),x(d,{replace:!0})}),[]),Bs((()=>{var e;d>g?w(1,!0):(null===(e=o.onChange)||void 0===e||e.call(o,d,m),b(d,m))}),[m,g]),Bs((()=>{var e;null===(e=o.onChange)||void 0===e||e.call(o,d,m),b(d,m)}),[d]),(0,L.useEffect)((()=>{const e=()=>{var e;if(!o.urlParamName)return;const t=new URLSearchParams(location.search),n=parseInt(null!==(e=t.get(o.urlParamName))&&void 0!==e?e:"");isNaN(n)||n===d||f(n)};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)}),[o.urlParamName]),g>1?(0,bi.jsxs)(Si,{name:"pagination",mod:{disabled:n,size:r,waiting:p},style:o.style,children:[o.label&&pi(m)&&(0,bi.jsxs)(Ci,{name:"label",children:[o.label,": ",y.start,"-",y.end]}),(0,bi.jsxs)(Ci,{name:"navigation",children:[t&&(0,bi.jsxs)(bi.Fragment,{children:[(0,bi.jsx)(Vs,{mod:["arrow-left","arrow-left-double"],onClick:()=>w(1),disabled:1===d}),(0,bi.jsx)(Ci,{name:"divider"})]}),(0,bi.jsx)(Vs,{mod:["arrow-left"],onClick:()=>w(d-1),disabled:1===d}),(0,bi.jsx)(Ci,{name:"input",children:u?(0,bi.jsx)("input",{type:"text",autoFocus:!0,defaultValue:d,pattern:"[0-9]",onKeyDown:e=>{"Escape"===e.code?c(!1):"Enter"===e.code?k(e):null!==e.code.match(/[0-9]/)||(e=>null!==e.code.match(/arrow/i)||e.shiftKey&&null!==e.code.match(/arrow/i)||e.metaKey||e.ctrlKey||"Backspace"===e.code)(e)||(e.preventDefault(),e.stopPropagation())},onBlur:e=>{k(e)}}):(0,bi.jsxs)(Ci,{name:"page-indicator",onClick:()=>{e&&c(!0)},children:[d," ",(0,bi.jsxs)("span",{children:["of ",g]}),(0,bi.jsx)("div",{onClick:()=>{}})]})}),(0,bi.jsx)(Vs,{mod:["arrow-right"],onClick:()=>w(d+1),disabled:d===g}),t&&(0,bi.jsxs)(bi.Fragment,{children:[(0,bi.jsx)(Ci,{name:"divider"}),(0,bi.jsx)(Vs,{mod:["arrow-right","arrow-right-double"],onClick:()=>w(g),disabled:d===g})]})]}),(null==i?void 0:i.length)>0&&(0,bi.jsx)(Ci,{name:"page-size",children:(0,bi.jsx)(Us,{value:m,options:i.map((e=>({label:`${e} per page`,value:e}))),onChange:e=>{const t=parseInt(e.target.value);v(t),o.name&&((e,t)=>{localStorage.setItem(`pages:${e}`,t.toString())})(o.name,t)}})})]}):null})),Vs=e=>{const t=Object.fromEntries(e.mod.map((e=>[e,!0])));return t.disabled=!0===e.disabled,(0,bi.jsx)(Ci,{name:"btn",mod:t,onClick:e.onClick})};var qs;const Gs=(null===(qs=window.APP_SETTINGS)||void 0===qs?void 0:qs.feature_flags)||{},Ys="ff_front_dev_1682_model_version_dropdown_070622_short",Xs="ff_front_dev_2575_projects_list_performance_280622_short";function Ks(e){return e in Gs?!0===Gs[e]:!0===(null===(t=window.APP_SETTINGS)||void 0===t?void 0:t.feature_flags_default_value);var t}n(9589);var Qs=n(9656);function Js(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Zs="got ya, suspicious hacker!";class el extends L.Component{constructor(...e){super(...e),Js(this,"state",{validation:null,showValidation:!0,submitting:!1}),Js(this,"formElement",L.createRef()),Js(this,"apiRef",L.createRef()),Js(this,"fields",new Set),Js(this,"validation",new Map),Js(this,"onFormSubmitted",(async e=>{e.preventDefault(),this.validateFields(),this.validation.size?this.setState({step:"invalid"}):(this.setState({step:"submitting"}),this.submit())})),Js(this,"_onAutoSubmit",(()=>{this.validateFields(),this.validation.size||this.submit()})),Js(this,"onAutoSubmit",this.props.debounce?function(e,t,n){let r;return function(...i){const o=n&&!r;clearTimeout(r),r=setTimeout((()=>{r=null,n||e.apply(this,i)}),t),o&&e.apply(this,i)}}(this._onAutoSubmit,this.props.debounce):this._onAutoSubmit),Js(this,"onFormChanged",(async e=>{var t,n;e.stopPropagation(),null===(t=(n=this.props).onChange)||void 0===t||t.call(n,e),this.autosubmit()}))}get api(){return this.apiRef.current}componentDidMount(){this.props.formData&&setTimeout((()=>{this.fillFormData()}),50)}componentDidUpdate(e){var t,n;ho(null!==(t=e.formData)&&void 0!==t?t:{},null!==(n=this.props.formData)&&void 0!==n?n:{})||this.fillFormData()}render(){const e=[(0,bi.jsx)(Ei.Provider,{value:this},"form-ctx"),(0,bi.jsx)(ji.Provider,{value:this.state.validation},"form-validation-ctx"),(0,bi.jsx)(Ti.Provider,{value:this.state.submitting},"form-submission-ctx"),(0,bi.jsx)(Oi.Provider,{value:this.state.state},"form-state-ctx"),(0,bi.jsx)(Ni.Provider,{value:this.state.lastResponse},"form-response"),(0,bi.jsx)(ro,{ref:this.apiRef},"form-api")];return(0,bi.jsx)(Ui,{providers:e,children:(0,bi.jsxs)("form",{ref:this.formElement,className:ki("form"),action:this.props.action,onSubmit:this.onFormSubmitted,onChange:this.onFormChanged,autoComplete:this.props.autoComplete,autoSave:this.props.autoSave,style:this.props.style,children:[this.props.children,this.state.validation&&this.state.showValidation&&(0,bi.jsx)(tl,{validation:this.state.validation})]})})}registerField(e){const t=this.getFieldContext(e.name);t?Object.assign(t,e):(this.fields.add(e),setTimeout((()=>{this.fillWithFormData(e)}),0))}unregisterField(e){const t=this.getFieldContext(e);t&&this.fields.delete(t)}getField(e){var t;return null===(t=this.getFieldContext(e))||void 0===t?void 0:t.field}getFieldContext(e){return Array.from(this.fields).find((t=>t.name===e))}disableValidationMessage(){this.setState({showValidation:!1})}enableValidationMessage(){this.setState({showValidation:!0})}autosubmit(){this.props.autosubmit&&setTimeout((()=>{this.onAutoSubmit()}),100)}assembleFormData({asJSON:e=!1,full:t=!1,booleansAsNumbers:n=!1,fieldsFilter:r}={}){let i=Array.from(this.fields);r instanceof Function&&(i=i.filter(r));const o=i.reduce(((e,{name:r,field:i,skip:o,allowEmpty:a,isProtected:s})=>{const l=s&&i.value===Zs,u=o||l||(this.props.skipEmpty||!1===a)&&!i.value;if(!0===t||!u){const t=(()=>{const e=i.value;return["checkbox","radio"].includes(i.type)?pi(e)&&!["","on","off","true","false"].includes(e)?i.checked?e:null:n?Number(i.checked):i.checked:e})();null!==t&&e.push([r,t])}return e}),[]);if(e)return o.reduce(((e,[t,n])=>({...e,[t]:n})),{});{const e=new FormData;return o.forEach((([t,n])=>e.append(t,n))),e}}async submit({fieldsFilter:e}={}){var t,n,r;this.setState({submitting:!0,lastResponse:null});const i=this.formElement.current.getAttribute("action"),o=this.api.isValidMethod(i),a=this.assembleFormData({asJSON:o,fieldsFilter:e}),s=null!==(t=null===(n=(r=this.props).prepareData)||void 0===n?void 0:n.call(r,a))&&void 0!==t?t:a;let l=!1;l=o?await this.submitWithAPI(i,s):await this.submitWithFetch(s),this.setState({submitting:!1,state:l?"success":"fail"},(()=>{setTimeout((()=>{this.setState({state:null})}),1500)}))}async submitWithAPI(e,t){var n;const r=mi(null!==(n=this.props.params)&&void 0!==n?n:{}),i=await this.api.callApi(e,{params:r,body:t});var o,a,s,l;return this.setState({lastResponse:i}),null===i?(null===(o=(a=this.props).onError)||void 0===o||o.call(a),!1):(null===(s=(l=this.props).onSubmit)||void 0===s||s.call(l,i),!0)}async submitWithFetch(e){var t;const n=this.formElement.current.action,r=(null!==(t=this.props.method)&&void 0!==t?t:"POST").toUpperCase(),i=await fetch(n,{method:r,body:e});try{const e=await i.json();var o,a,s,l;if(this.setState({lastResponse:e}),e.validation_errors&&(Object.entries(e.validation_errors).forEach((([e,t])=>{const n=this.getField(e);this.validation.set(n.name,{label:n.label,field:n.field,messages:t})})),this.setState({validation:this.validation})),i.ok)return null===(o=(a=this.props).onSubmit)||void 0===o||o.call(a,e),!0;null===(s=(l=this.props).onError)||void 0===s||s.call(l,e)}catch(e){var u,c;console.log(e),null===(u=(c=this.props).onError)||void 0===u||u.call(c,e)}return!1}validateFields(){this.validation.clear();for(const e of this.fields){const t=this.validateField(e);t.length&&this.validation.set(e.name,{label:e.label,messages:t,field:e.field})}return this.validation.size?this.setState({validation:this.validation}):this.setState({validation:null}),0===this.validation.size}validateField(e){var t;const n=[],{validation:r,field:i}=e,o=(null===(t=i.value)||void 0===t?void 0:t.trim())||null;return e.isProtected&&o===Zs||r.forEach((t=>{const r=t(e.label,o);r&&n.push(r)})),n}fillFormData(){this.props.formData&&0!==this.fields.size&&Array.from(this.fields).forEach((e=>{this.fillWithFormData(e)}))}fillWithFormData(e){var t;const n=(null!==(t=this.props.formData)&&void 0!==t?t:{})[e.name];e.isProtected&&this.props.formData?e.setValue(Zs):pi(n)&&e.value!==n&&!e.skipAutofill&&e.setValue(n)}}const tl=({validation:e})=>{const t=ki("form-validation");return(0,bi.jsx)("div",{className:t,children:Array.from(e).map((([e,n])=>(0,bi.jsxs)("div",{className:t.elem("group"),onClick:()=>n.field.focus(),children:[(0,bi.jsx)("div",{className:t.elem("field"),children:n.label}),(0,bi.jsx)("div",{className:t.elem("messages"),children:n.messages.map(((n,r)=>(0,bi.jsx)("div",{className:t.elem("message"),children:n},`${e}-${r}`)))})]},e)))})};el.Validator=t,el.Row=({columnCount:e,rowGap:t,children:n,style:r,spread:i=!1})=>{const o={};return e&&(o["--column-count"]=e),t&&(o["--row-gap"]=t),(0,bi.jsx)("div",{className:ki("form").elem("row").mod({spread:i}),style:{...null!=r?r:{},...o},children:n})},el.Builder=L.forwardRef((({fields:e,formData:t,fetchFields:n,fetchFormData:r,children:i,formRowStyle:o,onSubmit:a,withActions:s,...l},u)=>{const c=null!=u?u:(0,L.useRef)(),[d,f]=(0,L.useState)(null!=e?e:[]),[p,h]=(0,L.useState)(null!=t?t:{}),m=e=>e.map(((e,t)=>{var n,r;if(!e)return(0,bi.jsx)("div",{},`spacer-${t}`);const i=null!==(n=null==p?void 0:p[e.name])&&void 0!==n?n:void 0,o=()=>e.skipAutofill&&(!e.allowEmpty||e.protectedValue)&&"password"===e.type?Zs:e.skipAutofill?null:null!=i?i:e.value,a={};!0!==l.autosubmit&&!0===e.trigger_form_update&&(a.onChange=async()=>{await c.current.submit({fieldsFilter:t=>t.name===e.name}),await g(),await y()});const s=(()=>{switch(e.type){case"select":return Us;case"counter":return Fs;case"toggle":return Ws;default:return zs}})();return["checkbox","radio","toggle"].includes(e.type)?a.checked=o():"counter"===e.type?a.value=o():a.defaultValue=o(),(0,bi.jsx)(s,{...e,...a},null!==(r=e.name)&&void 0!==r?r:t)})),v=e=>e.map(((e,t)=>(0,bi.jsx)("div",{className:ki("form").elem("column"),style:{width:e.width},children:m(e.fields)},t))),g=(0,L.useCallback)((async()=>{if(n){const e=await n();JSON.stringify(d)!==JSON.stringify(e)&&f(e)}}),[n]),y=(0,L.useCallback)((async()=>{if(r){const e=await r();!1===ho(p,e)&&h(e)}}),[r]),b=(0,L.useCallback)((async(...e)=>{null==a||a(...e),await g(),await y()}),[a,r]);return(0,L.useEffect)((()=>{g()}),[g]),(0,L.useEffect)((()=>{y()}),[y]),(0,L.useEffect)((()=>{f(e)}),[e]),(0,bi.jsxs)(el,{...l,onSubmit:b,ref:c,children:[(null!=d?d:[]).map((({columnCount:e,fields:t,columns:n},r)=>(0,bi.jsx)(el.Row,{columnCount:e,style:o,spread:!0,children:n?v(n):m(t)},r))),i,!0!==l.autosubmit&&!0===s&&(0,bi.jsx)(el.Actions,{children:(0,bi.jsx)(Mi,{type:"submit",look:"primary",style:{width:120},children:"Save"})})]})})),el.Actions=({children:e,valid:t,extra:n,size:r})=>{const i=ki("form");return(0,bi.jsxs)("div",{className:i.elem("submit").mod({size:r}),children:[(0,bi.jsx)("div",{className:i.elem("info").mod({valid:t}),children:n}),(0,bi.jsx)(Pi,{children:e})]})},el.Indicator=()=>{const e=L.useContext(Oi);return(0,bi.jsx)(Si,{name:"form-indicator",children:(0,bi.jsx)(Ts,{value:e,children:(0,bi.jsx)(Ci,{tag:"span",mod:{type:e},name:"item",case:"success",children:"Saved!"})})})},el.ResponseParser=({children:e})=>{const t=e;if(t instanceof Function==!1)throw new Error("Response Parser only accepts function as a child");const n=(0,L.useContext)(Ni);return(0,bi.jsx)(bi.Fragment,{children:n?t(n):null})};const nl="FFA39E D4380D FFC069 AD8B00 D3F261 389E0D 5CDBD3 096DD9 ADC6FF 9254DE F759AB".split(" ").map((e=>"#"+e));function*rl(e=nl){let t=0;for(;;)yield e[t],t=(t+1)%e.length}window.Palette=rl;const il={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},ol={Image:{type:"Image",settings:{strokeWidth:{title:"Width of region borders",type:Number,param:(e,t)=>e.$controls.forEach((e=>e.setAttribute("strokeWidth",t))),value:e=>{var t,n;return null!==(t=null===(n=e.$controls[0])||void 0===n?void 0:n.getAttribute("strokeWidth"))&&void 0!==t?t:1}},zoom:{title:"Allow image zoom (ctrl+wheel)",type:Boolean,param:"zoom"},zoomControl:{title:"Show controls to zoom in and out",type:Boolean,param:"zoomControl"},rotateControl:{title:"Show controls to rotate image",type:Boolean,param:"rotateControl"}}},Text:{type:"Text",settings:{granularity:{title:"Select text by words",type:Boolean,param:(e,t)=>t?e.setAttribute("granularity","word"):e.removeAttribute("granularity"),value:e=>"word"===e.getAttribute("granularity"),when:e=>e.$controls.filter((e=>e.tagName.endsWith("Labels"))).length>0}}},HyperText:{type:"HyperText"},Audio:{type:"Audio"},AudioPlus:{type:"Audio"},TimeSeries:{type:"TimeSeries"},Paragraphs:{type:"Paragraphs"},Table:{type:"Table"},Video:{type:"Video"}},al={type:"Labels",settings:{placeLabelsLeft:{title:"Display labels:",type:["bottom","left","right","top"],control:!0,when:e=>"Video"!==e.$object.tagName,param:(e,t)=>{var n,r,i;let o=e.parentNode,a=e;"FILTER"===(null===(n=o.firstChild)||void 0===n||null===(r=n.tagName)||void 0===r?void 0:r.toUpperCase())&&(a=o,o=a.parentNode);const s=e.$object,l=["top","bottom"].includes(t),u=(l?"column":"row")+(["top","left"].includes(t)?"-reverse":"");(null===(i=o.getAttribute("style"))||void 0===i?void 0:i.includes("flex"))||(o=s.ownerDocument.createElement("View"),a.parentNode.insertBefore(o,s),o.appendChild(s),o.appendChild(a)),e.setAttribute("showInline",JSON.stringify(l)),o.setAttribute("style","display:flex;align-items:start;gap:8px;flex-direction:"+u)},value:e=>{var t,n;let r=e.parentNode;"FILTER"===(null===(t=r.firstChild)||void 0===t||null===(n=t.tagName)||void 0===n?void 0:n.toUpperCase())&&(r=r.parentNode);const i=r.getAttribute("style"),o=null==i?void 0:i.match(/direction:(row|column)(-reverse)?/);if(!o){return e.compareDocumentPosition(e.$object)&Node.DOCUMENT_POSITION_FOLLOWING?"top":"bottom"}return"column"===o[1]?o[2]?"top":"bottom":o[2]?"left":"right"}},filter:{title:"Add filter for long list of labels",type:Boolean,control:!0,param:(e,t)=>{if(t){const t=e.ownerDocument.createElement("Filter"),n=e.ownerDocument.createElement("View");t.setAttribute("toName",e.getAttribute("name")),t.setAttribute("minlength",0),t.setAttribute("name","filter"),e.parentNode.insertBefore(n,e),n.appendChild(t),n.appendChild(e)}else{if("FILTER"===e.previousElementSibling.tagName.toUpperCase()){const t=e.parentNode;t.parentNode.insertBefore(e,t),t.parentNode.removeChild(t)}}},value:e=>{var t;return"FILTER"===(null===(t=e.previousElementSibling)||void 0===t?void 0:t.tagName.toUpperCase())}}}},sl={Labels:al,RectangleLabels:al};function ll(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ul="<View></View>",cl="$undefined$",dl=e=>["",ul].includes(e.replace(/\s+/g,""));class fl{constructor(e){ll(this,"objects",[]),ll(this,"controls",[]),ll(this,"details",!1),ll(this,"palette",rl()),this.tpl=e,this.config=e.config;const t=new DOMParser;this.$root=t.parseFromString(this.config,"application/xml"),this.serializer=new XMLSerializer,this.initRoot()}flatten(e){const t=[];for(let n of e.children)t.push(n),n.children.length&&t.push(...this.flatten(n));return t}onConfigUpdate(){}render(){const e=this.serializer.serializeToString(this.$root);this.onConfigUpdate(e)}initRoot(){const e=this.flatten(this.$root);this.objects=e.filter((e=>e.tagName in ol&&e.getAttribute("value")));const t=this.objects.map((e=>e.getAttribute("name")));this.controls=e.filter((e=>t.includes(e.getAttribute("toName"))));for(let e of this.objects){const t=ol[e.tagName];e.$controls=this.controls.filter((t=>t.getAttribute("toName")===e.getAttribute("name"))),e.$controls.forEach((t=>t.$object=e));for(let n in t.settings)t.settings[n].object=e;let n={...t.settings};e.$controls.forEach((t=>{let r=sl[t.tagName];if(r){for(let n in r.settings)r.settings[n].control=t,r.settings[n].object=e;n={...n,...r.settings}}})),this.settings=n}}fixColumns(e){if(1===e.length&&e[0]===cl)return;const t=this.objects.map((e=>e.getAttribute("value").replace(/^\$/,"")));let n=e.filter((e=>!t.includes(e)));for(let t of this.objects){var r;if(!e.includes(t.getAttribute("value").replace(/^\$/,"")))t.setAttribute("value","$"+(null!==(r=n.shift())&&void 0!==r?r:e[0]))}this.render()}addLabels(e,t){if(!t)return;if(Array.isArray(t)||(t=t.split("\n").map((e=>e.trim())).filter(Boolean)),!t.length)return;const n=[...e.children].map((e=>e.getAttribute("value"))),r="Choices"===e.tagName;t.forEach((t=>{if(n.includes(t))return;n.push(t);const i=this.$root.createElement(r?"Choice":"Label");i.setAttribute("value",t),r||i.setAttribute("background",this.palette.next().value),e.appendChild(i)})),this.render()}removeLabel(e){e.parentNode.removeChild(e),this.render()}changeLabel(e,t){for(let n of Object.keys(t))e.setAttribute(n,t[n]);this.render()}}const pl=ki("configure"),hl=({config:e,data:t,error:n,loading:r})=>{var i,o,a,s,l,u,c,d;const f=po("lsf"),p=(0,L.useRef)(null),h=(0,L.useRef)(),m=(0,L.useMemo)((()=>({id:1,annotations:[],predictions:[],data:t})),[t]),v=(0,L.useMemo)((()=>null!=e?e:ul),[e]),g=(0,L.useCallback)(((e,t)=>{if(f&&t.data){console.info("Initializing LSF preview",{config:e,task:t});try{return new window.LabelStudio(h.current,{config:e,task:t,interfaces:["side-column"],onLabelStudioLoad(e){e.settings.bottomSidePanel=!0;const t=e.annotationStore,n=t.createAnnotation();t.selectAnnotation(n.id)}})}catch(e){return console.error(e),null}}}),[f]);return(0,L.useEffect)((()=>{const e=r||n?.6:1;document.getElementById("label-studio").style.opacity=e}),[r,n]),(0,L.useEffect)((()=>(p.current||(p.current=g(v,m)),()=>{if(p.current){console.info("Destroying LSF");try{p.current.destroy()}catch(e){}p.current=null}})),[g,v,m]),(0,L.useEffect)((()=>{var e;null!==(e=p.current)&&void 0!==e&&e.store&&(p.current.store.assignConfig(v),console.log("LSF config updated"))}),[v]),(0,L.useEffect)((()=>{var e;if(null!==(e=p.current)&&void 0!==e&&e.store){const e=p.current.store;e.resetState(),e.assignTask(m),e.initializeStore(m);const t=e.annotationStore.addAnnotation({userGenerate:!0});e.annotationStore.selectAnnotation(t.id),console.log("LSF task updated")}}),[m]),(0,bi.jsxs)("div",{className:pl.elem("preview"),children:[(0,bi.jsx)("h3",{children:"UI Preview"}),n&&(0,bi.jsxs)("div",{className:pl.elem("preview-error"),children:[(0,bi.jsxs)("h2",{children:[n.detail," ",n.id]}),null===(i=n.validation_errors)||void 0===i||null===(o=i.non_field_errors)||void 0===o||null===(a=o.map)||void 0===a?void 0:a.call(o,(e=>(0,bi.jsx)("p",{children:e},e))),null===(s=n.validation_errors)||void 0===s||null===(l=s.label_config)||void 0===l||null===(u=l.map)||void 0===u?void 0:u.call(l,(e=>(0,bi.jsx)("p",{children:e},e))),null===(c=n.validation_errors)||void 0===c||null===(d=c.map)||void 0===d?void 0:d.call(c,(e=>(0,bi.jsx)("p",{children:e},e)))]}),!t&&r&&(0,bi.jsx)(ms,{style:{width:"100%",height:"50vh"}}),(0,bi.jsx)("div",{id:"label-studio",className:pl.elem("preview-ui"),ref:h})]})},ml=ki("templates-list"),vl=()=>(0,bi.jsx)("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,bi.jsx)("path",{opacity:"0.9",d:"M2 10L6 6L2 2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"square"})}),gl=({templates:e,group:t,onSelectRecipe:n})=>{const r=e.filter((e=>e.group===t)).sort(((e,t)=>{var n,r;return(null!==(n=e.order)&&void 0!==n?n:1/0)-(null!==(r=t.order)&&void 0!==r?r:1/0)}));return(0,bi.jsx)("ul",{children:r.map((e=>(0,bi.jsxs)("li",{onClick:()=>n(e),className:ml.elem("template"),children:[(0,bi.jsx)("img",{src:e.image}),(0,bi.jsx)("h3",{children:e.title})]},e.title)))})},yl=({selectedGroup:e,selectedRecipe:t,onCustomTemplate:n,onSelectGroup:r,onSelectRecipe:i})=>{const[o,a]=L.useState([]),[s,l]=L.useState(),u=io();L.useEffect((async()=>{const e=await u.callApi("configTemplates");if(!e)return;const{templates:t,groups:n}=e;l(t),a(n)}),[]);const c=e||o[0];return(0,bi.jsxs)("div",{className:ml,children:[(0,bi.jsxs)("aside",{className:ml.elem("sidebar"),children:[(0,bi.jsx)("ul",{children:o.map((e=>(0,bi.jsxs)("li",{onClick:()=>r(e),className:ml.elem("group").mod({active:c===e,selected:(null==t?void 0:t.group)===e}),children:[e,(0,bi.jsx)(vl,{})]},e)))}),(0,bi.jsx)("button",{type:"button",onClick:n,className:ml.elem("custom-template"),children:"Custom template"})]}),(0,bi.jsxs)("main",{children:[!s&&(0,bi.jsx)(ms,{style:{width:"100%",height:200}}),(0,bi.jsx)(gl,{templates:s||[],group:c,onSelectRecipe:i})]}),(0,bi.jsxs)("footer",{children:[(0,bi.jsx)(Sr,{className:ml.elem("info-icon"),width:"20",height:"20"}),"See the documentation to ",(0,bi.jsx)("a",{href:"https://labelstud.io/guide",target:"_blank",children:"contribute a template"}),"."]})]})},bl=e=>{if(e.indexOf("\n")>=0)return e;let t=0;try{return e.replace(/<(\/)?.*?(\/)?>[\s\n]*/g,((e,n,r)=>{if(n)return t--," ".repeat(t)+e.trim()+"\n";{const n=" ".repeat(t)+e.trim()+"\n";return r||t++,n}}))}catch(t){return e}},wl=ki("wizard"),xl=ki("configure"),kl=()=>(0,bi.jsxs)("div",{className:xl.elem("empty-config"),children:[(0,bi.jsx)("p",{children:"Your labeling configuration is empty. It is required to label your data."}),(0,bi.jsxs)("p",{children:["Start from one of our predefined templates or create your own config on the Code panel. The labeling config is XML-based and you can ",(0,bi.jsx)("a",{href:"https://labelstud.io/tags/",target:"_blank",children:"read about the available tags in our documentation"}),"."]})]}),_l=({label:e,template:t,color:n})=>{const r=e.getAttribute("value");return(0,bi.jsxs)("li",{className:xl.elem("label").mod({choice:"Choice"===e.tagName}),children:[(0,bi.jsx)("label",{style:{background:n},children:(0,bi.jsx)("input",{type:"color",className:xl.elem("label-color"),value:il[n]||n,onChange:n=>t.changeLabel(e,{background:n.target.value})})}),(0,bi.jsx)("span",{children:r}),(0,bi.jsx)("button",{type:"button",className:xl.elem("delete-label"),onClick:()=>t.removeLabel(e),children:(0,bi.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"red",strokeWidth:"2",strokeLinecap:"square",xmlns:"http://www.w3.org/2000/svg",children:[(0,bi.jsx)("path",{d:"M2 12L12 2"}),(0,bi.jsx)("path",{d:"M12 12L2 2"})]})})]})},Sl=({control:e,template:t})=>{const n=L.useRef(),r=e.tagName;if("Choices"!==r&&!r.endsWith("Labels"))return null;const i=rl(),o=()=>{n.current&&(t.addLabels(e,n.current.value),n.current.value="")};return(0,bi.jsxs)("div",{className:xl.elem("labels"),children:[(0,bi.jsxs)("form",{className:xl.elem("add-labels"),action:"",children:[(0,bi.jsx)("h4",{children:"Choices"===r?"Add choices":"Add label names"}),(0,bi.jsx)("textarea",{name:"labels",id:"",cols:"30",rows:"5",ref:n,onKeyPress:e=>{"Enter"===e.key&&e.ctrlKey&&(e.preventDefault(),o())}}),(0,bi.jsx)("input",{type:"button",value:"Add",onClick:o})]}),(0,bi.jsxs)("div",{className:xl.elem("current-labels"),children:[(0,bi.jsxs)("h3",{children:["Choices"===r?"Choices":"Labels"," (",e.children.length,")"]}),(0,bi.jsx)("ul",{children:Array.from(e.children).map((e=>(0,bi.jsx)(_l,{label:e,template:t,color:e.getAttribute("background")||i.next().value},e.getAttribute("value"))))})]})]})},Cl=({template:e})=>{const{settings:t}=e;if(!t)return null;const n=Object.keys(t).map((n=>{const r=t[n],i=Array.isArray(r.type)?Array:r.type,o=r.object,a=r.control?r.control:o;if(!a)return null;if(r.when&&!r.when(a))return;let s,l,u=!1;switch(r.value?u=r.value(a):"string"==typeof r.param&&(u=a.getAttribute(r.param)),"true"===u&&(u=!0),"false"===u&&(u=!1),i){case Array:return s=t=>{"function"==typeof r.param?r.param(a,t.target.value):o.setAttribute(r.param,t.target.value),e.render()},(0,bi.jsx)("li",{children:(0,bi.jsxs)("label",{children:[r.title," ",(0,bi.jsx)("select",{value:u,onChange:s,children:r.type.map((e=>(0,bi.jsx)("option",{value:e,children:e},e)))})]})},n);case Boolean:return s=t=>{"function"==typeof r.param?r.param(a,t.target.checked):o.setAttribute(r.param,t.target.checked?"true":"false"),e.render()},(0,bi.jsx)("li",{children:(0,bi.jsxs)("label",{children:[(0,bi.jsx)("input",{type:"checkbox",checked:u,onChange:s})," ",r.title]})},n);case String:case Number:return l=r.type===Number?5:void 0,s=t=>{"function"==typeof r.param?r.param(a,t.target.value):o.setAttribute(r.param,t.target.value),e.render()},(0,bi.jsx)("li",{children:(0,bi.jsxs)("label",{children:[r.title," ",(0,bi.jsx)("input",{type:"text",onInput:s,value:u,size:l})]})},n)}}));return n.filter(Boolean).length?(0,bi.jsx)("ul",{className:xl.elem("settings"),children:(0,bi.jsxs)("li",{children:[(0,bi.jsx)("h4",{children:"Configure settings"}),(0,bi.jsx)("ul",{className:xl.elem("object-settings"),children:n})]})}):null},El=({template:e,obj:t,columns:n})=>{var r;const i=null===(r=t.getAttribute("value"))||void 0===r?void 0:r.replace(/^\$/,""),[o,a]=(0,L.useState)(!(!i||null!=n&&n.includes(i))),[s,l]=(0,L.useState)("$"+i);(0,L.useEffect)((()=>l("$"+i)),[i]);const u=n=>{const r=n.replace(/^\$/,"");t.setAttribute("value","$"+r),e.render()};return(0,bi.jsxs)("p",{children:["Use ",t.tagName.toLowerCase(),e.objects>1&&` for ${t.getAttribute("name")}`," from ",(null==n?void 0:n.length)>0&&n[0]!==cl&&"field ",(0,bi.jsxs)("select",{onChange:e=>{const t=e.target.value;"-"!==t?(o&&a(!1),u(t)):a(!0)},value:o?"-":i,children:[null==n?void 0:n.map((e=>(0,bi.jsx)("option",{value:e,children:e===cl?"<imported file>":`$${e}`},e))),!(null!=n&&n.length)&&(0,bi.jsx)("option",{value:i,children:"<imported file>"}),(0,bi.jsx)("option",{value:"-",children:"<set manually>"})]}),o&&(0,bi.jsx)("input",{value:s,onChange:e=>{const t=e.target.value.replace(/^\$/,"");l("$"+t)},onBlur:()=>{u(s)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),u(e.target.value))}})]})},jl=({columns:e,template:t})=>t.objects.length?(0,bi.jsxs)("div",{className:xl.elem("object"),children:[(0,bi.jsx)("h4",{children:"Configure data"}),t.objects.length>1&&(null==e?void 0:e.length)>0&&e.length<t.objects.length&&(0,bi.jsx)("p",{className:xl.elem("object-error"),children:"This template requires more data then you have for now"}),0===(null==e?void 0:e.length)&&(0,bi.jsx)("p",{className:xl.elem("object-error"),children:"To select which field(s) to label you need to upload the data. Alternatively, you can provide it using Code mode."}),t.objects.map((n=>(0,bi.jsx)(El,{obj:n,template:t,columns:e},n.getAttribute("name"))))]}):null,Tl=({columns:e,config:t,project:n,template:r,setTemplate:i,onBrowse:o,onSaveClick:a,onValidate:s,disableSaveButton:l,warning:u})=>{const[c,d]=L.useState(dl(t)?"code":"visual"),[f,p]=L.useState("visual"===c),[h,m]=L.useState(!1),[v,g]=L.useState(),[y,b]=L.useState(),[w,x]=L.useState(),[k,_]=L.useState(),[S,C]=(0,L.useState)(!1),[E,j]=L.useState(t),T=L.useRef(),O=io();L.useEffect((()=>(T.current=window.setTimeout((()=>g(t)),v?500:30),()=>window.clearTimeout(T.current))),[t]),L.useEffect((async()=>{if(!v)return;C(!0);const e=await O.callApi("validateConfig",{params:{pk:n.id},body:{label_config:v},errorFilter:()=>!0});if(null!=e&&e.error)return b(e.response),void C(!1);b(null),null==s||s(e);const t=await O.callApi("createSampleTask",{params:{pk:n.id},body:{label_config:v},errorFilter:()=>!0});C(!1),t&&!t.error?(_(t.sample_task),j(v)):b(null==t?void 0:t.response)}),[v]);const N=L.useCallback((e=>{try{x(null),i(e)}catch(e){x({detail:"Parser error",validation_errors:[e.message]})}}),[i]),M=(0,bi.jsxs)("p",{className:xl.elem("tags-link"),children:["Configure the labeling interface with tags.",(0,bi.jsx)("br",{}),(0,bi.jsx)("a",{href:"https://labelstud.io/tags/",target:"_blank",children:"See all available tags"}),"."]});return(0,bi.jsxs)("div",{className:xl,children:[(0,bi.jsxs)("div",{className:xl.elem("container"),children:[(0,bi.jsxs)("header",{children:[(0,bi.jsx)("button",{onClick:o,children:"Browse Templates"}),(0,bi.jsx)(vs,{items:{code:"Code",visual:"Visual"},active:c,onSelect:e=>{d(e),"visual"===e&&p(!0)}})]}),(0,bi.jsxs)("div",{className:xl.elem("editor"),children:["code"===c&&(0,bi.jsx)("div",{className:xl.elem("code"),style:{display:"code"===c?void 0:"none"},children:(0,bi.jsx)(Qs.Rt,{name:"code",id:"edit_code",value:bl(t),detach:!0,options:{mode:"xml",theme:"default",lineNumbers:!0},onChange:(e,t,n)=>N(n)})}),f&&(0,bi.jsxs)("div",{className:xl.elem("visual"),style:{display:"visual"===c?void 0:"none"},children:[dl(t)&&(0,bi.jsx)(kl,{}),(0,bi.jsx)(jl,{columns:e,project:n,template:r}),r.controls.map((e=>(0,bi.jsx)(Sl,{control:e,template:r},e.getAttribute("name")))),(0,bi.jsx)(Cl,{template:r})]})]}),!0!==l&&a&&(0,bi.jsx)(el.Actions,{size:"small",extra:"code"===c&&M,valid:!0,children:(0,bi.jsx)(Mi,{look:"primary",size:"compact",style:{width:120},onClick:async()=>{b(null),m(!0);const e=await a();m(!1),!0!==e&&b(e)},waiting:h,children:h?"Saving...":"Save"})})]}),(0,bi.jsx)(hl,{config:E,data:k,loading:S,error:w||y||"code"===c&&u})]})},Ol=({config:e="",columns:t,project:n,onUpdate:r,onSaveClick:i,onValidate:o,disableSaveButton:a,show:s=!0})=>{const[l,u]=L.useState(""),[c,d]=L.useState("list"),[f,p]=L.useState(null),[h,m]=L.useState(null),[v,g]=L.useState(null),y=io(),b=L.useCallback((e=>{u(e),r(e)}),[u,r]),w=L.useCallback((e=>{const t=new fl({config:e});t.onConfigUpdate=b,b(e),g(t)}),[b,g]),[x,k]=L.useState();L.useEffect((()=>{null!=t&&t.length&&k(t)}),[t]);const[_,S]=L.useState();L.useEffect((async()=>{if(t)return;if(!n||x)return;const e=await y.callApi("dataSummary",{params:{pk:n.id},errorFilter:()=>!0});null!=e&&e.common_data_columns&&k(e.common_data_columns)}),[x,n]);const C=L.useCallback((e=>{if(!e)return m(null),void d("list");w(e.config),m(e),d("view")})),E=L.useCallback((()=>{w(ul),d("view")}));return L.useEffect((()=>{e&&(w(e),d("view"))}),[]),s?(0,bi.jsxs)("div",{className:wl,"data-mode":"list",id:"config-wizard",children:["list"===c&&(0,bi.jsx)(yl,{case:"list",selectedGroup:f,selectedRecipe:h,onSelectGroup:p,onSelectRecipe:C,onCustomTemplate:E}),"view"===c&&(0,bi.jsx)(Tl,{case:"view",columns:x,config:l,project:n,selectedRecipe:h,template:v,setTemplate:w,onBrowse:d.bind(null,"list"),onValidate:o,disableSaveButton:a,onSaveClick:i,warning:_})]}):null},Nl=ki("upload_page"),Ml=ki("dropzone");function Ll(e){return[].concat(...e)}function Pl(e,t){return new Promise((n=>{if(t=t||"",e.isFile){if("."===e.name[0])return n([]);n([e])}else if(e.isDirectory){const r=e.createReader(),i=t+e.name+"/";r.readEntries((function(e){Promise.all(e.map((e=>Pl(e,i)))).then(Ll).then(n)}))}}))}const Al=()=>(0,bi.jsxs)(qi.Footer,{children:[(0,bi.jsx)(Sr,{className:Nl.elem("info-icon"),width:"20",height:"20"}),"See the documentation to ",(0,bi.jsx)("a",{target:"_blank",href:"https://labelstud.io/guide/predictions.html",children:"import preannotated data"})," ","or to ",(0,bi.jsx)("a",{target:"_blank",href:"https://labelstud.io/guide/storage.html",children:"sync data from a database or cloud storage"}),"."]}),Dl=({children:e,sendFiles:t})=>{const[n,r]=(0,L.useState)(!1),i=e=>{e.preventDefault(),r(!0)},o=r.bind(null,!1),a=(0,L.useRef)(),s=(0,L.useCallback)((e=>{var n;e.preventDefault(),o(),(n=e.dataTransfer.items,new Promise((e=>{if(!n.length)return e([]);if(!n[0].webkitGetAsEntry)return e(n);const t=Array.from(n).map((e=>e.webkitGetAsEntry()));Promise.all(t.map(Pl)).then(Ll).then((e=>e.map((e=>new Promise((t=>e.file(t))))))).then((e=>Promise.all(e))).then(e)}))).then((e=>t(e)))}),[o,t]);return(0,bi.jsx)("div",{id:"holder",className:Ml.mod({hovered:n}),ref:a,onDragStart:i,onDragOver:i,onDragLeave:o,onDrop:s,children:e})},Rl=({error:e})=>{var t;if(!e)return null;let n=null!==(t=e.validation_errors)&&void 0!==t?t:e.extra;var r;n&&"object"==typeof n&&!Array.isArray(n)&&(n=null!==(r=n.non_field_errors)&&void 0!==r?r:Object.values(n));return Array.isArray(n)&&(n=n.join("; ")),(0,bi.jsxs)("div",{className:Nl.elem("error"),children:[(0,bi.jsx)(ur,{style:{marginRight:8}}),e.id&&`[${e.id}] `,e.detail||e.message,n&&` (${n})`]})},Il=({project:e,show:t=!0,onWaiting:n,onFileListUpdate:r,highlightCsvHandling:i,dontCommitToProject:o=!1,csvHandling:a,setCsvHandling:s,addColumns:l})=>{var u,c;const[d,f]=(0,L.useState)(!1),[p,h]=(0,L.useState)(),m=io(),[v,g]=(0,L.useReducer)(((e,t)=>{if(t.sending)return{...e,uploading:[...t.sending,...e.uploading]};if(t.sent)return{...e,uploading:e.uploading.filter((e=>!t.sent.includes(e)))};if(t.uploaded)return{...e,uploaded:fi([...e.uploaded,...t.uploaded],((e,t)=>e.id===t.id))};if(t.ids){const n=fi([...e.ids,...t.ids]);return null==r||r(n),{...e,ids:n}}return e}),{uploaded:[],uploading:[],ids:[]}),y=Boolean((null===(u=v.uploaded)||void 0===u?void 0:u.length)||(null===(c=v.uploading)||void 0===c?void 0:c.length)),b=(0,L.useCallback)((async t=>{const n={};t&&(n.ids=JSON.stringify(t));const r=await m.callApi("fileUploads",{params:{pk:e.id,...n}});return g({uploaded:null!=r?r:[]}),null!=r&&r.length&&g({ids:r.map((e=>e.id))}),r}),[e]),w=()=>{f(!0),h(null)},x=e=>{if(console.error(e),"string"==typeof e&&e.includes("RequestDataTooBig")){var t;const n="Imported file is too big",r=null===(t=e.match(/"exception_value">(.*)<\/pre>/))||void 0===t?void 0:t[1];e={message:n,extra:r}}h(e),f(!1),null==n||n(!1)},k=(0,L.useCallback)((async e=>{const{could_be_tasks_list:t,data_columns:r,file_upload_ids:i}=e;return g({ids:i}),t&&!a&&s("choose"),f(!0),null==n||n(!1),l(r),b(i).then((()=>f(!1)))}),[l,b,f]),_=(0,L.useCallback)((async(t,n)=>{g({sending:t});const r=o?{commit_to_project:"false"}:{},i=n instanceof FormData?"multipart/form-data":"application/x-www-form-urlencoded",a=await m.callApi("importFiles",{params:{pk:e.id,...r},headers:{"Content-Type":i},body:n,errorFilter:()=>!0});a&&!a.error?null==k||k(a):null==x||x(null==a?void 0:a.response),g({sent:t})}),[e,k]),S=(0,L.useCallback)((e=>{w(),null==n||n(!0),e=[...e];const t=new FormData;for(let n of e)t.append(n.name,n);return _(e,t)}),[_,w]),C=(0,L.useCallback)((e=>{S(e.target.files),e.target.value=""}),[S]),E=(0,L.useCallback)((e=>{var t;e.preventDefault(),w();const r=null===(t=j.current)||void 0===t?void 0:t.value;if(!r)return void f(!1);j.current.value="",null==n||n(!0);const i=new URLSearchParams({url:r});_([{name:r}],i)}),[_]);(0,L.useEffect)((()=>{void 0!==(null==e?void 0:e.id)&&b().then((e=>{a||Array.isArray(e)&&e.some((({file:e})=>/\.[ct]sv$/.test(e)))&&s("choose")}))}),[e,b]);const j=(0,L.useRef)();if(!e)return null;if(!t)return null;const T={name:"csv",type:"radio",onChange:e=>s(e.target.value)};return(0,bi.jsxs)("div",{className:Nl,children:[i&&(0,bi.jsx)("div",{className:Nl.elem("csv-splash")}),(0,bi.jsx)("input",{id:"file-input",type:"file",name:"file",multiple:!0,onChange:C,style:{display:"none"}}),(0,bi.jsxs)("header",{children:[(0,bi.jsxs)("form",{className:Nl.elem("url-form")+" inline",method:"POST",onSubmit:E,children:[(0,bi.jsx)("input",{placeholder:"Dataset URL",name:"url",ref:j}),(0,bi.jsx)("button",{type:"submit",children:"Add URL"})]}),(0,bi.jsx)("span",{children:"or"}),(0,bi.jsxs)("button",{onClick:()=>document.getElementById("file-input").click(),className:Nl.elem("upload-button"),children:[(0,bi.jsx)(si,{width:"16",height:"16",className:Nl.elem("upload-icon")}),"Upload ",v.uploaded.length?"More ":"","Files"]}),(0,bi.jsxs)("div",{className:Nl.elem("csv-handling").mod({highlighted:i,hidden:!a}),children:[(0,bi.jsx)("span",{children:"Treat CSV/TSV as"}),(0,bi.jsxs)("label",{children:[(0,bi.jsx)("input",{...T,value:"tasks",checked:"tasks"===a})," List of tasks"]}),(0,bi.jsxs)("label",{children:[(0,bi.jsx)("input",{...T,value:"ts",checked:"ts"===a})," Time Series or Whole Text File"]})]}),(0,bi.jsx)("div",{className:Nl.elem("status"),children:v.uploaded.length?`${v.uploaded.length} files uploaded`:""})]}),(0,bi.jsx)(Rl,{error:p}),(0,bi.jsx)("main",{children:(0,bi.jsxs)(Dl,{sendFiles:S,project:e,children:[!y&&(0,bi.jsx)("label",{htmlFor:"file-input",children:(0,bi.jsxs)("div",{className:Ml.elem("content"),children:[(0,bi.jsxs)("header",{children:["Drag & drop files here",(0,bi.jsx)("br",{}),"or click to browse"]}),(0,bi.jsx)(si,{height:"64",className:Ml.elem("icon")}),(0,bi.jsxs)("dl",{children:[(0,bi.jsx)("dt",{children:"Text"}),(0,bi.jsx)("dd",{children:"txt"}),(0,bi.jsx)("dt",{children:"Audio"}),(0,bi.jsx)("dd",{children:"wav, aiff, mp3, au, flac, m4a, ogg"}),(0,bi.jsx)("dt",{children:"Video"}),(0,bi.jsx)("dd",{children:"mpeg4/H.264 webp, webm*"}),(0,bi.jsx)("dt",{children:"Images"}),(0,bi.jsx)("dd",{children:"jpg, png, gif, bmp, svg, webp"}),(0,bi.jsx)("dt",{children:"HTML"}),(0,bi.jsx)("dd",{children:"html, htm, xml"}),(0,bi.jsx)("dt",{children:"Time Series"}),(0,bi.jsx)("dd",{children:"csv, tsv"}),(0,bi.jsx)("dt",{children:"Common Formats"}),(0,bi.jsx)("dd",{children:"csv, tsv, txt, json"})]}),(0,bi.jsxs)("b",{children:["* – Support depends on the browser",(0,bi.jsx)("br",{}),"* – Use ",(0,bi.jsx)("a",{href:"https://labelstud.io/guide/storage.html",target:"_blank",children:"Cloud Storages"})," if you want to import a large number of files"]})]})}),y&&(0,bi.jsx)("table",{children:(0,bi.jsxs)("tbody",{children:[v.uploading.map(((e,t)=>(0,bi.jsxs)("tr",{children:[(0,bi.jsx)("td",{children:e.name}),(0,bi.jsx)("td",{children:(0,bi.jsx)("span",{className:Nl.elem("file-status").mod({uploading:!0})})})]},`${t}-${e.name}`))),v.uploaded.map((e=>(0,bi.jsxs)("tr",{children:[(0,bi.jsx)("td",{children:e.file}),(0,bi.jsx)("td",{children:(0,bi.jsx)("span",{className:Nl.elem("file-status")})}),(0,bi.jsx)("td",{children:e.size})]},e.file)))]})})]})}),(0,bi.jsx)(Al,{})]})},Fl=e=>{const[t,n]=L.useState(!1),[r,i]=L.useState([]),[o,a]=L.useState([]),[s,l]=L.useState(),u="choose"===s,c=io();return{columns:["choose","ts"].includes(s)?["$undefined$"]:o,uploading:t,uploadDisabled:u,finishUpload:async()=>{n(!0);const t=await c.callApi("reimportFiles",{params:{pk:e.id},body:{file_upload_ids:r,files_as_tasks_list:"tasks"===s}});return n(!1),t},fileIds:r,pageProps:{onWaiting:n,highlightCsvHandling:u,addColumns:e=>a((t=>fi(t.concat(e)))),csvHandling:s,setCsvHandling:l,onFileListUpdate:i,dontCommitToProject:!0}}},zl=({name:e,setName:t,onSaveName:n,onSubmit:r,error:i,description:o,setDescription:a,show:s=!0})=>s?(0,bi.jsxs)("form",{className:ki("project-name"),onSubmit:e=>{e.preventDefault(),r()},children:[(0,bi.jsxs)("div",{className:"field field--wide",children:[(0,bi.jsx)("label",{htmlFor:"project_name",children:"Project Name"}),(0,bi.jsx)("input",{name:"name",id:"project_name",value:e,onChange:e=>t(e.target.value),onBlur:n}),i&&(0,bi.jsx)("span",{className:"error",children:i})]}),(0,bi.jsxs)("div",{className:"field field--wide",children:[(0,bi.jsx)("label",{htmlFor:"project_description",children:"Description"}),(0,bi.jsx)("textarea",{name:"description",id:"project_description",placeholder:"Optional description of your project",rows:"4",value:o,onChange:e=>a(e.target.value)})]})]}):null,Ul=({onClose:e})=>{const[t,n]=L.useState("name"),[r,i]=L.useState(!1),o=(()=>{const e=io(),[t,n]=L.useState(),r=L.useCallback((async()=>{var t;const r=await e.callApi("projects"),i=null!==(t=null==r?void 0:r.results)&&void 0!==t?t:[];let o=i.length+1,a=`New Project #${o}`;for(;i.find((({title:e})=>e===a));)o++,a=`New Project #${o}`;const s=await e.callApi("createProject",{body:{title:a}});s&&n(s)}),[]);return L.useEffect((()=>{r()}),[]),t})(),a=fe(),s=io(),[l,u]=L.useState(""),[c,d]=L.useState(),[f,p]=L.useState(""),[h,m]=L.useState("<View></View>");L.useEffect((()=>{d(null)}),[l]);const{columns:v,uploading:g,uploadDisabled:y,finishUpload:b,pageProps:w}=Fl(o),x=ki("create-project"),k=x.elem("tab"),_={name:(0,bi.jsx)("span",{className:k.mod({disabled:!!c}),children:"Project Name"}),import:(0,bi.jsx)("span",{className:k.mod({disabled:y}),children:"Data Import"}),config:"Labeling Setup"};L.useEffect((()=>o&&!l&&u(o.title)),[o]);const S=L.useMemo((()=>({title:l,description:f,label_config:h})),[l,f,h]),C=L.useCallback((async()=>{if(!await b())return;i(!0);const e=await s.callApi("updateProject",{params:{pk:o.id},body:S});i(!1),null!==e&&a.push(`/projects/${e.id}/data`)}),[o,S,b]),E=L.useCallback((async()=>{i(!0),o&&await s.callApi("deleteProject",{params:{pk:o.id}}),i(!1),a.replace("/projects"),null==e||e()}),[o]);return(0,bi.jsx)(qi,{onHide:E,fullscreen:!0,visible:!0,bare:!0,closeOnClickOutside:!1,children:(0,bi.jsxs)("div",{className:x,children:[(0,bi.jsxs)(qi.Header,{children:[(0,bi.jsx)("h1",{children:"Create Project"}),(0,bi.jsx)(vs,{items:_,active:t,onSelect:n}),(0,bi.jsxs)(Pi,{children:[(0,bi.jsx)(Mi,{look:"danger",size:"compact",onClick:E,waiting:r,children:"Delete"}),(0,bi.jsx)(Mi,{look:"primary",size:"compact",onClick:C,waiting:r||g,disabled:!o||y||c,children:"Save"})]})]}),(0,bi.jsx)(zl,{name:l,setName:u,error:c,onSaveName:async()=>{var e;if(c)return;const t=await s.callApi("updateProjectRaw",{params:{pk:o.id},body:{title:l}});if(t.ok)return;const n=await t.json();d(null===(e=n.validation_errors)||void 0===e?void 0:e.title)},onSubmit:C,description:f,setDescription:p,show:"name"===t}),(0,bi.jsx)(Il,{project:o,show:"import"===t,...w}),(0,bi.jsx)(Ol,{project:o,onUpdate:m,show:"config"===t,columns:v,disableSaveButton:!0})]})})};var Hl=function(e){var t=e.initValue,n=e.useHookBody,r=e.applyStateChange,i=(0,L.useRef)(t);if("function"!=typeof n)throw new Error("function expected as hook body parameter. got "+typeof n);var o=n();return(0,L.useLayoutEffect)((function(){i.current!==o&&(i.current=o,r(o))}),[r,o]),null},Wl=function(e){console&&console.warn&&console.warn(e)};function Bl(){return(Bl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var $l=!1,Vl=!1,ql=!1,Gl=[],Yl=function(e){Gl.push(e)},Xl=Yl,Kl=function(){Vl=!0,(0,L.useEffect)((function(){return $l&&Wl("SingletonHooksContainer is mounted second time. You should mount SingletonHooksContainer before any other component and never unmount it.Alternatively, dont use SingletonHooksContainer it at all, we will handle that for you."),$l=!0,function(){return Wl("SingletonHooksContainer is removed from DOM. its not supported, singleton hooks will stop updating.")}}),[]);var e=(0,L.useState)([]),t=e[0],n=e[1];return(0,L.useEffect)((function(){Xl=function(e){return n((function(t){return[].concat(t,[e])}))},n(Gl)}),[]),L.createElement(L.Fragment,null,t.map((function(e,t){return L.createElement(Hl,Bl({},e,{key:t}))})))},Ql=function(e){var t;Vl||ql||(ql=!0,t=Kl,window&&window.document?(0,P.render)(L.createElement(t,null),window.document.createElement("div")):Wl("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.")),Xl(e)},Jl=function(e,t){var n=!1,r=!1,i=void 0,o=[],a=function(e){var t;i=e,t=function(){return o.forEach((function(t){return t(e)}))},(0,P.unstable_batchedUpdates)(t)},s=function(){return r||(i="function"==typeof e?e():e,r=!0),i};return function(){var r=(0,L.useState)(s),l=r[0],u=r[1];return(0,L.useEffect)((function(){return n||(n=!0,Ql({initValue:e,useHookBody:t,applyStateChange:a})),o.push(u),i!==l&&u(i),function(){o.splice(o.indexOf(u),1)}}),[]),l}};const Zl=[],eu=()=>{0};let tu=eu,nu=eu,ru=eu,iu=eu,ou=eu,au=[];const su=Jl(Zl,(()=>{const[e,t]=(0,L.useState)(Zl);return au=e,tu=e=>{const n=[...null!=e?e:[]];t(n),au=n},nu=(0,L.useCallback)((e=>{if(!pi(null==e?void 0:e.key))throw Error("Crumb must have a key");const t=[...au,e];tu(t),au=t}),[e]),ru=(0,L.useCallback)((e=>{const t=au.filter((t=>t.key!==e));tu(t),au=t}),[e]),iu=(0,L.useCallback)(((e,t)=>{const n=au.map((n=>n.key===e?{...n,onClick:t}:n));tu(n),au=n}),[e]),ou=(0,L.useCallback)((e=>{const t=au.map((t=>(t.key===e&&delete t.onClick,t)));tu(t),au=t}),[e]),e})),lu=()=>{const e=fe(),t=Uc(),n=(0,L.useRef)(),r=(()=>{const e=fe(),{pathname:t}=Uc();return(0,L.useCallback)((n=>(e.replace("/"),setTimeout((()=>{e.replace(null!=n?n:t)}),10),t)),[t])})(),{project:i}=Vc(),[o,a]=(0,L.useState)(!1),s=io(),{uploading:l,uploadDisabled:u,finishUpload:c,fileIds:d,pageProps:f}=Fl(i),p=(0,L.useCallback)((()=>{const e=t.pathname.replace(uu.path,""),n=t.search;return r(`${e}${"?"!==n?n:""}`)}),[t,e]),h=(0,L.useCallback)((async()=>{var e;a(!0),await s.callApi("deleteFileUploads",{params:{pk:i.id},body:{file_upload_ids:d}}),a(!1),null==n||null===(e=n.current)||void 0===e||e.hide(),p()}),[n,i,d,p]),m=(0,L.useCallback)((async()=>{await c()&&p()}),[p,c]);return(0,bi.jsxs)(qi,{title:"Import data",ref:n,onHide:()=>p(),closeOnClickOutside:!1,fullscreen:!0,visible:!0,bare:!0,children:[(0,bi.jsxs)(qi.Header,{divided:!0,children:[(0,bi.jsx)(Ci,{block:"modal",name:"title",children:"Import Data"}),(0,bi.jsxs)(Pi,{children:[(0,bi.jsx)(Mi,{waiting:o,onClick:h,children:"Cancel"}),(0,bi.jsx)(Mi,{look:"primary",onClick:m,waiting:o||l,disabled:u,children:"Import"})]})]}),(0,bi.jsx)(Il,{project:i,...f})]})},uu=()=>(0,bi.jsx)($c,{children:(0,bi.jsx)(lu,{})});uu.path="/import",uu.modal=!0;const{Block:cu,Elem:du}=_i(),fu=()=>{const e=fe(),t=Uc(),n=Fc(),r=io(),[i,o]=(0,L.useState)([]),[a,s]=(0,L.useState)(!1),[l,u]=(0,L.useState)(!1),[c,d]=(0,L.useState)([]),[f,p]=(0,L.useState)("JSON"),h=(0,L.useRef)();return(0,L.useEffect)((()=>{pi(n.id)&&(r.callApi("previousExports",{params:{pk:n.id}}).then((({export_files:e})=>{o(e.slice(0,1))})),r.callApi("exportFormats",{params:{pk:n.id}}).then((e=>{var t;d(e),p(null===(t=e[0])||void 0===t?void 0:t.name)})))}),[n]),(0,bi.jsx)(qi,{onHide:()=>{const n=t.pathname.replace(fu.path,""),r=t.search;e.replace(`${n}${"?"!==r?r:""}`)},title:"Export data",style:{width:720},closeOnClickOutside:!1,allowClose:!a,visible:!0,children:(0,bi.jsxs)(cu,{name:"export-page",children:[(0,bi.jsx)(pu,{availableFormats:c,selected:f,onClick:e=>p(e.name)}),(0,bi.jsx)(el,{ref:h,children:(0,bi.jsx)(zs,{type:"hidden",name:"exportType",value:f})}),(0,bi.jsx)(du,{name:"footer",children:(0,bi.jsxs)(Pi,{style:{width:"100%"},spread:!0,children:[(0,bi.jsx)(du,{name:"recent"}),(0,bi.jsx)(du,{name:"actions",children:(0,bi.jsxs)(Pi,{children:[l&&"Files are being prepared. It might take some time.",(0,bi.jsx)(du,{tag:Mi,name:"finish",look:"primary",onClick:async()=>{s(!0);const e=setTimeout((()=>{u(!0)}),1e3),t=h.current.assembleFormData({asJSON:!0,full:!0,booleansAsNumbers:!0}),i=await r.callApi("exportRaw",{params:{pk:n.id,...t}});if(i.ok){((e,t)=>{const n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=t,n.click()})(await i.blob(),i.headers.get("filename"))}else r.handleError(i);s(!1),u(!1),clearTimeout(e)},waiting:a,children:"Export"})]})})]})})]})})},pu=({availableFormats:e,selected:t,onClick:n})=>(0,bi.jsxs)(cu,{name:"formats",children:[(0,bi.jsx)(du,{name:"info",children:"You can export dataset in one of the following formats:"}),(0,bi.jsx)(du,{name:"list",children:e.map((e=>{var r,i;return(0,bi.jsxs)(du,{name:"item",mod:{active:!e.disabled,selected:e.name===t},onClick:e.disabled?null:()=>n(e),children:[(0,bi.jsxs)(du,{name:"name",children:[e.title,(0,bi.jsx)(Pi,{size:"small",children:null===(r=e.tags)||void 0===r||null===(i=r.map)||void 0===i?void 0:i.call(r,((e,t)=>(0,bi.jsx)(du,{name:"tag",children:e},t)))})]}),e.description&&(0,bi.jsx)(du,{name:"description",children:e.description})]},e.name)}))}),(0,bi.jsxs)(du,{name:"feedback",children:["Can't find an export format?",(0,bi.jsx)("br",{}),"Please let us know in ",(0,bi.jsx)("a",{className:"no-go",href:"https://slack.labelstudio.heartex.com/?source=product-export",children:"Slack"})," or submit an issue to the ",(0,bi.jsx)("a",{className:"no-go",href:"https://github.com/heartexlabs/label-studio-converter/issues",children:"Repository"})]})]});fu.path="/export",fu.modal=!0;const hu={gateway:"/api/dm",endpoints:{project:"/project",columns:"/columns",tabs:"/views",createTab:"POST:/views",updateTab:"PATCH:/views/:tabID",deleteTab:"DELETE:/views/:tabID",annotations:"/views/:tabID/annotations",task:"/../tasks/:taskID",tasks:"/../tasks",nextTask:"/tasks/next",annotation:"/../annotations/:id",skipTask:{method:"post",path:e=>{const t="/../tasks/:taskID/annotations";return!pi(e.annotationID)?t:`${t}/:annotationID`}},submitAnnotation:"POST:/../tasks/:taskID/annotations",updateAnnotation:"PATCH:/../annotations/:annotationID",deleteAnnotation:"DELETE:/../annotations/:annotationID",setSelectedItems:"POST:/views/:tabID/selected-items",addSelectedItem:"PATCH:/views/:tabID/selected-items",actions:"/actions",deleteSelectedItem:"DELETE:/views/:tabID/selected-items",invokeAction:"POST:/actions"}},mu=(e,t)=>Z(`/projects/:id${e}`,t),vu=({...e})=>{const t=(0,L.useRef)(),n=Fc(),r=fe(),i=io(),{project:o}=Vc(),a=po("lsf"),s=po("dm"),l=Hc(),[u,c]=(0,L.useState)(!1),d=(0,L.useRef)(),f=null==o?void 0:o.id,p=(0,L.useCallback)((async()=>{var u;if(!a)return;if(!s)return;if(!t.current)return;if(null==o||!o.id)return;if(d.current)return;const f=await i.callApi("mlBackends",{params:{project:o.id}}),p=(null!=f?f:[]).find((({is_interactive:e})=>e)),h=d.current=null!==(u=d.current)&&void 0!==u?u:await(async(e,t,n)=>{if(!window.LabelStudio)throw Error("Label Studio Frontend doesn't exist on the page");if(!e&&e.dataset.dmInitialized)return;e.dataset.dmInitialized=!0;const{...r}=e.dataset,i={root:e,projectId:n.id,apiGateway:`${window.APP_SETTINGS.hostname}/api/dm`,apiVersion:2,project:n.project,polling:!window.APP_SETTINGS,showPreviews:!1,apiEndpoints:hu.endpoints,interfaces:{import:!0,export:!0,backButton:!1,labelingHeader:!1,autoAnnotation:n.autoAnnotation},labelStudio:{keymap:window.APP_SETTINGS.editor_keymap},...t,...r};return new window.DataManager(i)})(t.current,e,{...n,project:o,autoAnnotation:pi(p)});Object.assign(window,{dataManager:h}),h.on("crash",(()=>c())),h.on("settingsClicked",(()=>{r.push(mu("/settings/labeling",{id:n.id}))})),h.on("importClicked",(()=>{r.push(mu("/data/import",{id:n.id}))})),h.on("exportClicked",(()=>{r.push(mu("/data/export",{id:n.id}))})),h.on("error",(e=>{i.handleError(e)})),p&&h.on("lsf:regionFinishedDrawing",((e,t)=>{const{lsf:n,task:r,currentAnnotation:o}=h.lsf,a=t.map((e=>e.id)),s=o.serializeAnnotation().filter((e=>a.includes(e.id))),l=i.callApi("mlInteractive",{params:{pk:p.id},body:{task:r.id,context:{result:s}}});n.loadSuggestions(l,(e=>e.data?e.data.result:[]))})),l({dmRef:h})}),[a,s,f]),h=(0,L.useCallback)((()=>{d.current&&(d.current.destroy(),d.current=null)}),[d]);return(0,L.useEffect)((()=>(p(),()=>h())),[t,p]),s&&a?u?(0,bi.jsxs)(Si,{name:"crash",children:[(0,bi.jsx)(Ci,{name:"info",children:"Project was deleted or not yet created"}),(0,bi.jsx)(Mi,{to:"/projects",children:"Back to projects"})]}):(0,bi.jsx)(Si,{ref:t,name:"datamanager"}):(0,bi.jsx)("div",{style:{flex:1,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,bi.jsx)(ms,{size:64})})};vu.path="/data",vu.pages={ExportPage:fu,ImportModal:uu},vu.context=({dmRef:e})=>{var t;const n=Uc(),{project:r}=Vc(),[i,o]=(0,L.useState)(null!==(t=null==e?void 0:e.mode)&&void 0!==t?t:"explorer"),a=t=>{o(t),(t=>{const r="explorer"===t,i=n.pathname.replace(vu.path,"");r?(ou(i),ru("dm-crumb")):(iu(i,(t=>{var n,r;t.preventDefault(),t.stopPropagation(),null==e||null===(n=e.store)||void 0===n||null===(r=n.closeLabeling)||void 0===r||r.call(n)})),nu({key:"dm-crumb",title:"Labeling"}))})(t),(e=>{const t="labelstream"===e,{expert_instruction:n,show_instruction:i}=r;t&&i&&n&&Yi({title:"Labeling Instructions",body:(0,bi.jsx)("div",{dangerouslySetInnerHTML:{__html:n}}),style:{width:680}})})(t)};return(0,L.useEffect)((()=>(e&&e.on("modeChanged",a),()=>{var t;null==e||null===(t=e.off)||void 0===t||t.call(e,"modeChanged",a)})),[e,r]),r&&r.id?(0,bi.jsxs)(Pi,{size:"small",children:[r.expert_instruction&&"explorer"!==i&&(0,bi.jsx)(Mi,{size:"compact",onClick:()=>{Yi({title:"Instructions",body:()=>(0,bi.jsx)("div",{dangerouslySetInnerHTML:{__html:r.expert_instruction}})})},children:"Instructions"}),Object.entries({"/settings":"Settings"}).map((([e,t])=>(0,bi.jsx)(Mi,{tag:_o,size:"compact",to:`/projects/${r.id}${e}`,"data-external":!0,children:t},e)))]}):null};const gu=({onDelete:e})=>Yi({title:"Delete",body:()=>{Gi();const e=ki("webhook-delete-modal");return(0,bi.jsx)("div",{className:e,children:(0,bi.jsx)("div",{className:e.elem("modal-text"),children:"Are you sure you want to delete the webhook? This action cannot be undone."})})},footer:()=>{const t=Gi(),n=ki("webhook-delete-modal");return(0,bi.jsxs)(Pi,{align:"end",children:[(0,bi.jsx)(Mi,{className:n.elem("width-button"),onClick:()=>{t.hide()},children:"Cancel"}),(0,bi.jsx)(Mi,{look:"destructive",className:n.elem("width-button"),onClick:async()=>{await e(),t.hide()},children:"Delete"})]})},style:{width:512}}),yu=({onSelectActive:e,onAddWebhook:t,webhooks:n,fetchWebhooks:r})=>{const i=io();if(null===n)return(0,bi.jsx)(bi.Fragment,{});const o=(0,L.useCallback)((async e=>{let t=e.target.checked;await i.callApi("updateWebhook",{params:{pk:e.target.name},body:{is_active:t}}),await r()}),[]);return(0,bi.jsxs)(Si,{name:"webhook",children:[(0,bi.jsx)(Ci,{name:"controls",children:(0,bi.jsx)(Mi,{onClick:t,children:"Add Webhook"})}),(0,bi.jsx)(Ci,{children:0===n.length?null:(0,bi.jsx)(Si,{name:"webhook-list",children:n.map((t=>(0,bi.jsxs)(Ci,{name:"item",children:[(0,bi.jsx)(Ci,{name:"item-active",children:(0,bi.jsx)(Ws,{name:t.id,checked:t.is_active,onChange:o})}),(0,bi.jsx)(Ci,{name:"item-url",onClick:()=>e(t.id),children:t.url}),(0,bi.jsxs)(Ci,{name:"item-date",children:["Created ",os(new Date(t.created_at),"dd MMM yyyy, HH:mm")]}),(0,bi.jsxs)(Ci,{name:"item-control",children:[(0,bi.jsx)(Mi,{onClick:()=>e(t.id),icon:(0,bi.jsx)(di,{}),children:"Edit"}),(0,bi.jsx)(Mi,{onClick:()=>gu({onDelete:async()=>{await i.callApi("deleteWebhook",{params:{pk:t.id}}),await r()}}),look:"danger",icon:(0,bi.jsx)(Qn,{}),children:"Delete"})]})]},t.id)))})})]})};var bu=n(6486);const wu=({webhook:e,webhooksInfo:t,fetchWebhooks:n,onBack:r,onSelectActive:i})=>{const o=ki("webhook-detail"),a=io(),[s,l]=(0,L.useState)(Object.entries((null==e?void 0:e.headers)||[])),[u,c]=(0,L.useState)(!e||e.send_for_all_actions),[d,f]=(0,L.useState)(new Set(null==e?void 0:e.actions)),[p,h]=(0,L.useState)(!e||e.is_active),[m,v]=(0,L.useState)(!e||e.send_payload),{project:g}=Vc(),[y,b]=(0,L.useState)(g.id);(0,L.useEffect)((()=>{0===Object.keys(g).length?b(null):b(g.id)}),[g]);const w=(e,t,n)=>{let r=(0,bu.cloneDeep)(s);"key"===e&&(r[n][0]=t.target.value),"value"===e&&(r[n][1]=t.target.value),l(r)},x=e=>{let t=new Set(d);e.target.checked?t.add(e.target.name):t.delete(e.target.name),f(t)};return(0,L.useEffect)((()=>{if(null===e)return l([]),c(!0),f(new Set),h(!0),void v(!0);l(Object.entries(e.headers)),c(e.send_for_all_actions),f(new Set(e.actions)),h(e.is_active),v(e.send_payload)}),[e]),void 0===y?(0,bi.jsx)(bi.Fragment,{}):(0,bi.jsxs)(Si,{name:"webhook",children:[(0,bi.jsx)(Ci,{name:"title",children:(0,bi.jsxs)(bi.Fragment,{children:[(0,bi.jsx)(Ci,{tag:"span",name:"title-base",onClick:()=>{i(null)},children:"Webhooks"})," / ",null===e?"New Webhook":"Edit Webhook"]})}),(0,bi.jsx)(Ci,{name:"content",children:(0,bi.jsx)(Si,{name:"webhook-detail",children:(0,bi.jsxs)(el,{action:null===e?"createWebhook":"updateWebhook",params:null===e?{}:{pk:e.id},formData:e,prepareData:e=>({...e,project:y,send_for_all_actions:u,headers:Object.fromEntries(s.filter((([e])=>""!==e))),actions:Array.from(d),is_active:p,send_payload:m}),onSubmit:async e=>{e.error_message||(await n(),i(null))},children:[(0,bi.jsxs)(el.Row,{style:{marginBottom:"40px"},columnCount:1,children:[(0,bi.jsx)(As,{text:"Payload URL",style:{marginLeft:"-16px"},large:!0}),(0,bi.jsxs)(Pi,{className:o.elem("url-space"),children:[(0,bi.jsx)(zs,{name:"url",className:o.elem("url-input"),placeholder:"URL"}),(0,bi.jsxs)(Pi,{align:"end",className:o.elem("activator"),children:[(0,bi.jsx)("span",{className:o.elem("black-text"),children:"Is Active"}),(0,bi.jsx)(Ws,{skip:!0,checked:p,onChange:e=>{h(e.target.checked)}})]})]})]}),(0,bi.jsx)(el.Row,{style:{marginBottom:"40px"},columnCount:1,children:(0,bi.jsx)("div",{className:o.elem("headers"),children:(0,bi.jsxs)("div",{className:o.elem("headers-content"),children:[(0,bi.jsxs)(Pi,{spread:!0,className:o.elem("headers-control"),children:[(0,bi.jsx)(As,{text:"Headers",large:!0}),(0,bi.jsx)(Mi,{type:"button",onClick:()=>{l([...s,["",""]])},className:o.elem("headers-add"),icon:(0,bi.jsx)(Wr,{})})]}),s.map((([e,t],n)=>(0,bi.jsxs)(Pi,{className:o.elem("headers-row"),columnCount:3,children:[(0,bi.jsx)(zs,{className:o.elem("headers-input"),skip:!0,placeholder:"header",value:e,onChange:e=>w("key",e,n)}),(0,bi.jsx)(zs,{className:o.elem("headers-input"),skip:!0,placeholder:"value",value:t,onChange:e=>w("value",e,n)}),(0,bi.jsx)("div",{children:(0,bi.jsx)(Mi,{className:o.elem("headers-remove"),type:"button",icon:(0,bi.jsx)(Qn,{}),onClick:()=>(e=>{let t=(0,bu.cloneDeep)(s);t.splice(e,1),l(t)})(n)})})]},n)))]})})}),(0,bi.jsxs)(Si,{name:"webhook-payload",style:{marginBottom:"40px"},children:[(0,bi.jsx)(Ci,{name:"title",children:(0,bi.jsx)(As,{text:"Payload",large:!0})}),(0,bi.jsxs)(Ci,{name:"content",children:[(0,bi.jsx)(Ci,{name:"content-row",children:(0,bi.jsx)(Ws,{skip:!0,checked:m,onChange:e=>{v(e.target.checked)},label:"Send payload"})}),(0,bi.jsx)(Ci,{name:"content-row",children:(0,bi.jsx)(Ws,{skip:!0,checked:u,label:"Send for all actions",onChange:e=>{c(e.target.checked)}})}),(0,bi.jsx)("div",{children:u?null:(0,bi.jsxs)(Ci,{name:"content-row-actions",children:[(0,bi.jsx)(Ci,{tag:"h4",name:"title",mod:{black:!0},children:"Send Payload for"}),(0,bi.jsx)(Ci,{name:"actions",children:Object.entries(t).map((([e,t])=>(0,bi.jsx)(el.Row,{columnCount:1,children:(0,bi.jsx)("div",{children:(0,bi.jsx)(Ws,{skip:!0,name:e,type:"checkbox",label:t.name,onChange:x,checked:d.has(e)})})},e)))})]})})]})]}),(0,bi.jsxs)(Ci,{name:"controls",children:[null===e?null:(0,bi.jsx)(Mi,{look:"danger",type:"button",className:o.elem("delete-button"),onClick:()=>gu({onDelete:async()=>{await a.callApi("deleteWebhook",{params:{pk:e.id}}),r(),await n()}}),children:"Delete Webhook..."}),(0,bi.jsx)("div",{className:o.elem("status"),children:(0,bi.jsx)(el.Indicator,{})}),(0,bi.jsx)(Mi,{type:"button",className:o.elem("cancel-button"),onClick:r,children:"Cancel"}),(0,bi.jsx)(Mi,{primary:!0,className:o.elem("save-button"),children:null===e?"Add Webhook":"Save"})]})]})})})]})},xu={title:"Webhooks",path:"/webhooks",component:()=>{const[e,t]=(0,L.useState)(null),[n,r]=(0,L.useState)(null),[i,o]=(0,L.useState)(null),a=fe(),s=io(),{project:l}=Vc(),u=(0,L.useMemo)((()=>a.location.pathname.startsWith("/projects")?0===Object.keys(l).length?null:l.id:void 0),[l,a]);console.log(u,a.location.pathname);const c=(0,L.useCallback)((async()=>{if(null===u)return void r(null);let e={};e.project=void 0!==u?u:null;const t=await s.callApi("webhooks",{params:e});t&&r(t)}),[u]),d=(0,L.useCallback)((async()=>{if(null===u)return void o(null);let e={};void 0!==u&&(e["organization-only"]=!1);const t=await s.callApi("webhooksInfo",{params:e});t&&o(t)}),[u]);if((0,L.useEffect)((()=>{c(),d()}),[l,u]),null===n||null===i||null===u)return null;let f=null;return f="new"===e?(0,bi.jsx)(wu,{onSelectActive:t,onBack:()=>t(null),webhook:null,fetchWebhooks:c,webhooksInfo:i}):null===e?(0,bi.jsx)(yu,{onSelectActive:t,onAddWebhook:()=>{t("new")},fetchWebhooks:c,webhooks:n}):(0,bi.jsx)(wu,{onSelectActive:t,onBack:()=>t(null),webhook:n[n.findIndex((t=>t.id===e))],fetchWebhooks:c,webhooksInfo:i}),(0,bi.jsxs)(Si,{name:"webhook-wrap",children:[f,(0,bi.jsxs)(Ci,{name:"footer",children:[(0,bi.jsx)(Ci,{name:"footer-icon",children:(0,bi.jsx)(Sr,{width:"28",height:"28"})}),(0,bi.jsxs)(Ci,{name:"footer-text",children:[(0,bi.jsx)("p",{children:"Webhooks allow external services to be notified when certain events happen. When the specified events occur, a POST request is sent to each of the URLs you provide."}),(0,bi.jsxs)("p",{children:[(0,bi.jsx)("a",{href:"https://labelstud.io/guide/webhooks.html",children:"Read more in the documentation"}),"."]})]})]})]})}},ku=()=>{const{project:e}=Vc(),t=io(),n=fe(),[r,i]=(0,L.useState)(null),o=(0,L.useMemo)((()=>[{type:"annotations",disabled:!0,label:`Delete ${e.total_annotations_number} Annotations`},{type:"tasks",disabled:!0,label:`Delete ${e.task_number} Tasks`},{type:"predictions",disabled:!0,label:`Delete ${e.total_predictions_number} Predictions`},{type:"tabs",label:"Drop All Tabs"},{type:"project",label:"Delete Project"}]),[e]);return(0,bi.jsxs)("div",{style:{width:480},children:[(0,bi.jsx)(As,{text:"Delete Annotations, Tasks, or Project",description:"Perform these actions at your own risk. Actions you take on this page can't be reverted. Make sure your data is backed up.",style:{display:"block",width:415}}),e.id?(0,bi.jsx)(Pi,{direction:"vertical",spread:!0,style:{marginTop:32},children:o.map((o=>{const a=r===o.type,s=o.disabled||r&&!a;return!0!==o.disabled&&(0,bi.jsx)(Mi,{look:"danger",disabled:s,waiting:a,onClick:(l=o.type,()=>{Xi({title:"Action confirmation",body:"You're about to delete all things. This action cannot be undone.",okText:"Proceed",buttonLook:"destructive",onOk:async()=>{i(l),"annotations"===l||"tasks"===l||"predictions"===l||("tabs"===l?await t.callApi("deleteTabs",{body:{project:e.id}}):"project"===l&&(await t.callApi("deleteProject",{params:{pk:e.id}}),n.replace("/projects"))),i(null)}})}),children:o.label},o.type);var l}))}):(0,bi.jsx)("div",{style:{display:"flex",justifyContent:"center",marginTop:32},children:(0,bi.jsx)(ms,{size:32})})]})};ku.title="Danger Zone",ku.path="/danger-zone";const _u=(0,L.createContext)(),{Block:Su,Elem:Cu}=_i(),Eu=({label:e,className:t,validate:n,required:r,skip:i,simple:o,labelProps:a,size:s,value:l,onChange:u,children:c,...d})=>{const[f,p]=(0,L.useState)(l),h=(0,bi.jsx)(Ps,{name:d.name,label:e,validate:n,required:r,skip:i,setValue:e=>p(e),...d,children:(e,n,r)=>(0,bi.jsx)(_u.Provider,{value:{value:f,onChange:e=>{(e=>{p(e),null==u||u(e)})(e),r.autosubmit()},setValue:p,isSimple:!0===o},children:(0,bi.jsxs)(Su,{name:"radio-group",mod:{size:s,simple:o},mix:t,children:[(0,bi.jsx)("input",{ref:e,name:d.name,type:"hidden",defaultValue:f}),(0,bi.jsx)(Cu,{name:"buttons",children:c})]})})});return e?(0,bi.jsx)(As,{...null!=a?a:{},text:e,simple:o,required:r,children:h}):h};Eu.Button=({value:e,disabled:t,children:n,label:r,description:i,...o})=>{const{onChange:a,setValue:s,value:l,isSimple:u}=(0,L.useContext)(_u),c=e===l,d=(0,L.useCallback)((t=>{t.preventDefault(),t.stopPropagation(),a(e)}),[e]);return(0,L.useEffect)((()=>{o.checked&&s(e)}),[o.checked]),(0,bi.jsx)(Cu,{name:"button",mod:{checked:c,disabled:t},onClickCapture:d,children:u?(0,bi.jsx)(As,{placement:"right",text:r,description:i,children:(0,bi.jsx)("input",{type:"radio",value:e,checked:c,readOnly:!0,style:{pointerEvents:"none"}})}):n})};const ju=()=>{const{project:e,fetchProject:t}=(0,L.useContext)(Wc),n=(0,L.useCallback)((()=>{e.id&&t(e.id,!0)}),[e]);return(0,bi.jsx)("div",{style:{width:480},children:(0,bi.jsxs)(el,{action:"updateProject",formData:{...e},params:{pk:e.id},onSubmit:n,children:[(0,bi.jsxs)(el.Row,{columnCount:1,rowGap:"32px",children:[(0,bi.jsx)(zs,{name:"title",label:"Project Name",labelProps:{large:!0}}),(0,bi.jsx)(Hs,{name:"description",label:"Description",labelProps:{large:!0},style:{minHeight:128}}),(0,bi.jsx)(Eu,{name:"color",label:"Color",size:"large",labelProps:{size:"large"},children:["#FFFFFF","#F52B4F","#FA8C16","#F6C549","#9ACA4F","#51AAFD","#7F64FF","#D55C9D"].map((e=>(0,bi.jsx)(Eu.Button,{value:e,children:(0,bi.jsx)(Si,{name:"color",style:{"--background":e}})},e)))}),(0,bi.jsx)(Eu,{label:"Task Sampling",labelProps:{size:"large"},name:"sampling",simple:!0,children:[{value:"Sequential",label:"Sequential",description:"Tasks are ordered by Data manager ordering"},{value:"Uniform",label:"Random",description:"Tasks are chosen with uniform random"}].map((({value:e,label:t,description:n})=>(0,bi.jsx)(Eu.Button,{value:`${e} sampling`,label:`${t} sampling`,description:n},e)))})]}),(0,bi.jsxs)(el.Actions,{children:[(0,bi.jsx)(el.Indicator,{children:(0,bi.jsx)("span",{case:"success",children:"Saved!"})}),(0,bi.jsx)(Mi,{type:"submit",look:"primary",style:{width:120},children:"Save"})]})]})})};ju.menuItem="General",ju.path="/",ju.exact=!0;const Tu=()=>{const{project:e,fetchProject:t}=(0,L.useContext)(Wc),n=(0,L.useContext)(cs),r=(0,L.useRef)();(0,L.useEffect)((()=>{n.setProps({formRef:r})}),[r]);const i=(0,L.useCallback)((()=>{t(e.id,!0)}),[e]);return(0,bi.jsx)("div",{style:{width:480},children:(0,bi.jsxs)(el,{ref:r,action:"updateProject",formData:{...e},params:{pk:e.id},onSubmit:i,children:[(0,bi.jsxs)(el.Row,{columnCount:1,children:[(0,bi.jsx)(As,{text:"Labeling Instructions",large:!0}),(0,bi.jsx)("div",{style:{paddingLeft:16},children:(0,bi.jsx)(Ws,{label:"Show before labeling",name:"show_instruction"})}),(0,bi.jsxs)("div",{style:{color:"rgba(0,0,0,0.4)",paddingLeft:16},children:[(0,bi.jsx)("p",{children:"Write instructions to help users complete labeling tasks."}),(0,bi.jsx)("p",{children:"The instruction field supports HTML markup and it allows to integrate with images, iframes (pdf)."})]})]}),(0,bi.jsx)(el.Row,{columnCount:1,children:(0,bi.jsx)(Hs,{name:"expert_instruction",style:{minHeight:128}})}),(0,bi.jsxs)(el.Actions,{children:[(0,bi.jsx)(el.Indicator,{children:(0,bi.jsx)("span",{case:"success",children:"Saved!"})}),(0,bi.jsx)(Mi,{type:"submit",look:"primary",style:{width:120},children:"Save"})]})]})})};Tu.title="Instructions",Tu.path="/instruction";const Ou=()=>{const e=fe(),{project:t,fetchProject:n}=Vc(),[r,i]=(0,L.useState)(""),[o,a]=(0,L.useState)(!1),s=io(),l=(0,L.useCallback)((async()=>{const i=await s.callApi("updateProjectRaw",{params:{pk:t.id},body:{label_config:r}});if(i.ok)return e.push(`/projects/${t.id}/data`),!0;const o=await i.json();return n(),o}),[t,r]),u=((0,L.useMemo)((()=>{if(t.label_config){const e=!hi(t.label_config),n="<View></View>"===t.label_config.replace(/\s/g,""),r=t.task_number>0;return console.log({hasConfig:e,configIsEmpty:n,hasTasks:r,project:t}),e&&!n&&r}return!1}),[t]),(0,L.useCallback)((async()=>{l()}),[o,l])),c=(0,L.useCallback)((e=>{i(e),n()})),d=(0,L.useCallback)((e=>{a(e.config_essential_data_has_changed)}),[]);return t.id?(0,bi.jsx)(Ol,{config:t.label_config,project:t,onUpdate:c,onSaveClick:u,onValidate:d}):null};Ou.title="Labeling Interface",Ou.path="/labeling";const Nu=({children:e,className:t,size:n="medium",noOffset:r=!1,...i})=>(0,bi.jsx)(Si,{name:"description",mod:{size:n,noOffset:r},mix:t,...i,children:e}),Mu=({height:e})=>(0,bi.jsx)("div",{style:{height:e}}),Lu=({children:e,includeValidation:t,className:n,style:r})=>{const i=L.useContext(Zi);return L.useEffect((()=>{i.showModal=!1}),[i]),i.error?(0,bi.jsxs)(Si,{name:"inline-error",mix:n,style:r,children:[(0,bi.jsx)(Ai,{possum:!1,...i.errorFormatter(i.error,{includeValidation:t})}),e]}):null};var Pu=n(2963),Au=n.n(Pu);const Du=({style:e,className:t,children:n})=>(0,bi.jsx)("dl",{className:ki("dl").mix(t),style:e,children:n});Du.Item=({retmClassName:e,descriptionClassName:t,term:n,descriptionStyle:r,termStyle:i,children:o})=>(0,bi.jsxs)(bi.Fragment,{children:[(0,bi.jsx)("dt",{className:ki("dl").elem("dt").mix(e),style:r,children:n}),(0,bi.jsx)("dd",{className:ki("dl").elem("dd").mix(t),style:i,children:o})]});const Ru=({backends:e,fetchBackends:t,onEdit:n})=>{const r=ki("ml"),i=(0,L.useContext)(Zi),o=(0,L.useCallback)((async e=>{await i.callApi("deleteMLBackend",{params:{pk:e.id}}),await t()}),[t,i]),a=(0,L.useCallback)((async e=>{await i.callApi("trainMLBackend",{params:{pk:e.id}}),await t()}),[t,i]);return(0,bi.jsx)("div",{className:r,children:e.map((e=>(0,bi.jsx)(Iu,{backend:e,onStartTrain:a,onDelete:o,onEdit:n},e.id)))})},Iu=({backend:e,onStartTrain:t,onEdit:n,onDelete:r})=>{const i=(0,L.useCallback)((e=>{Xi({title:"Delete ML Backend",body:"This action cannot be undone. Are you sure?",buttonLook:"destructive",onOk(){null==r||r(e)}})}),[e,r]);return(0,bi.jsxs)(Ro,{style:{marginTop:0},header:e.title,extra:(0,bi.jsxs)("div",{className:ki("ml").elem("info"),children:[(0,bi.jsx)(Fu,{backend:e}),(0,bi.jsx)(To.Trigger,{align:"right",content:(0,bi.jsxs)(Lo,{size:"small",children:[(0,bi.jsx)(Lo.Item,{onClick:()=>n(e),children:"Edit"}),(0,bi.jsx)(Lo.Item,{onClick:()=>i(e),children:"Delete"})]}),children:(0,bi.jsx)(Mi,{type:"link",icon:(0,bi.jsx)(Cs,{})})})]}),children:[(0,bi.jsxs)(Du,{className:ki("ml").elem("summary"),children:[(0,bi.jsx)(Du.Item,{term:"URL",termStyle:{whiteSpace:"nowrap"},children:Au()(e.url,20,10,"...")}),e.description&&(0,bi.jsx)(Du.Item,{term:"Description",children:e.description}),(0,bi.jsx)(Du.Item,{term:"Version",children:e.model_version&&ca(e.model_version)?os(new Date(isNaN(e.model_version)?e.model_version:Number(e.model_version)),"MMMM dd, yyyy ∙ HH:mm:ss"):e.model_version||"unknown"})]}),(0,bi.jsx)(Mi,{disabled:"CO"!==e.state,onClick:()=>t(e),children:"Start Training"})]})},Fu=({backend:e})=>{const{state:t}=e;return(0,bi.jsxs)("div",{className:ki("ml").elem("status"),children:[(0,bi.jsx)("span",{className:ki("ml").elem("indicator").mod({state:t})}),(0,bi.jsxs)(Ts,{value:t,className:ki("ml").elem("status-label"),children:[(0,bi.jsx)("span",{case:"DI",children:"Disconnected"}),(0,bi.jsx)("span",{case:"CO",children:"Connected"}),(0,bi.jsx)("span",{case:"ER",children:"Error"}),(0,bi.jsx)("span",{case:"TR",children:"Training"}),(0,bi.jsx)("span",{case:"PR",children:"Predicting"})]})]})},zu=({name:e="model_version",valueName:t="model_version",apiName:n="projectModelVersions",placeholder:r="No model version selected",...i})=>{const o=io(),{project:a,updateProject:s}=(0,L.useContext)(Wc),[l,u]=(0,L.useState)(!0),[c,d]=(0,L.useState)([]),[f,p]=(0,L.useState)(null);(0,L.useEffect)((()=>{p((null==a?void 0:a[t])||null)}),[null==a?void 0:a[t]]);const h=(0,L.useCallback)((async e=>{e.preventDefault(),e.stopPropagation(),await s({model_version:null})}),[s]),m=(0,L.useCallback)((async()=>{const e=null==a?void 0:a.id;if(!e)return;const t=await o.callApi(n,{params:{pk:e}});t&&d(Object.entries(t).reduce(((e,[t,n])=>[...e,{value:t,label:`${t} (${n} predictions)`}]),[])),u(!1)}),[null==a?void 0:a.id,n]);return(0,L.useEffect)(m,[m]),(0,bi.jsxs)(el.Row,{columnCount:1,children:[(0,bi.jsx)(As,{text:"Model Version",description:(0,bi.jsxs)(bi.Fragment,{children:["Model version allows you to specify which prediction will be shown to the annotators.",f&&(0,bi.jsxs)(bi.Fragment,{children:[(0,bi.jsx)("br",{}),(0,bi.jsxs)("b",{children:["Current project model version: ",f]})]})]}),style:{marginTop:16},large:!0}),(0,bi.jsxs)("div",{style:{display:"flex",alignItems:"center",width:400,paddingLeft:16},children:[(0,bi.jsx)("div",{style:{flex:1,paddingRight:16},children:(0,bi.jsx)(Us,{name:e,disabled:!c.length,value:f,onChange:e=>p(e.target.value),options:c,placeholder:l?"Loading ...":r,...i})}),(0,bi.jsx)(Mi,{onClick:h,children:"Reset"})]})]})},Uu=({name:e="model_version",valueName:t="model_version",apiName:n="modelVersions",placeholder:r="No model version selected",object:i,...o})=>{const a=io(),[s,l]=(0,L.useState)(null),[u,c]=(0,L.useState)(!0),[d,f]=(0,L.useState)([]),[p,h]=(0,L.useState)(null);(0,L.useEffect)((()=>{if(d.length&&null!=i&&i[t]){const e=d.find((e=>e.value===parseInt(null==i?void 0:i[t])));h(e)}}),[null==i?void 0:i[t],d]);const m=(0,L.useCallback)((async()=>{var e;const t=null==i?void 0:i.id;if(!t)return;const r=await a.callApi(n,{params:{pk:t}});null!=r&&r.message&&l(r.message),null!=r&&null!==(e=r.versions)&&void 0!==e&&e.length&&f(r.versions.map((e=>({value:e,label:e})))),c(!1)}),[null==i?void 0:i.id,n]);return(0,L.useEffect)(m,[]),(0,bi.jsxs)(Si,{name:"modelVersionSelector",children:[(0,bi.jsx)(Us,{name:e,disabled:!d.length,value:p,onChange:e=>h(e.target.value),options:d,placeholder:u?"Loading ...":r,...o}),s&&(0,bi.jsx)(Ci,{name:"message",children:s})]})},Hu=()=>{const e=io(),{project:t,fetchProject:n}=(0,L.useContext)(Wc),[r,i]=(0,L.useState)(),[o,a]=(0,L.useState)([]),s=(0,L.useCallback)((async()=>{const n=await e.callApi("mlBackends",{params:{project:t.id}});n&&a(n)}),[t,a]),l=(0,L.useCallback)((e=>{const n=e?"updateMLBackend":"addMLBackend",r={title:(e?"Edit":"Add")+" model",style:{width:760},closeOnClickOutside:!1,body:(0,bi.jsxs)(el,{action:n,formData:{...null!=e?e:{}},params:{pk:null==e?void 0:e.id},onSubmit:async e=>{e.error_message||(await s(),o.close())},children:[(0,bi.jsx)(zs,{type:"hidden",name:"project",value:t.id}),(0,bi.jsxs)(el.Row,{columnCount:2,children:[(0,bi.jsx)(zs,{name:"title",label:"Title",placeholder:"ML Model"}),(0,bi.jsx)(zs,{name:"url",label:"URL",required:!0})]}),(0,bi.jsx)(el.Row,{columnCount:1,children:(0,bi.jsx)(Hs,{name:"description",label:"Description",style:{minHeight:120}})}),Ks(Ys)&&!!e&&(0,bi.jsx)(el.Row,{columnCount:2,children:(0,bi.jsx)(Uu,{object:e,apiName:"modelVersions",label:"Version"})}),Ks(Ys)&&(0,bi.jsx)(el.Row,{columnCount:1,children:(0,bi.jsx)("div",{children:(0,bi.jsx)(Ws,{name:"auto_update",label:"Allow version auto-update"})})}),(0,bi.jsx)(el.Row,{columnCount:1,children:(0,bi.jsx)("div",{children:(0,bi.jsx)(Ws,{name:"is_interactive",label:"Use for interactive preannotations"})})}),(0,bi.jsx)(el.Actions,{children:(0,bi.jsx)(Mi,{type:"submit",look:"primary",onClick:()=>i(null),children:"Validate and Save"})}),(0,bi.jsx)(el.ResponseParser,{children:t=>(0,bi.jsx)(bi.Fragment,{children:t.error_message&&(0,bi.jsx)(Ai,{error:{response:{detail:`Failed to ${e?"save":"add new"} ML backend.`,exc_info:t.error_message}}})})}),(0,bi.jsx)(Lu,{})]})},o=Yi(r)}),[t,s,r]);return(0,L.useEffect)((()=>{t.id&&s()}),[t]),(0,bi.jsxs)(bi.Fragment,{children:[(0,bi.jsxs)(Nu,{style:{marginTop:0,maxWidth:680},children:["Add one or more machine learning models to predict labels for your data. To import predictions without connecting a model,"," ",(0,bi.jsx)("a",{href:"https://labelstud.io/guide/predictions.html",target:"_blank",children:"see the documentation"}),"."]}),(0,bi.jsx)(Mi,{onClick:()=>l(),children:"Add Model"}),(0,bi.jsx)(Mu,{height:32}),(0,bi.jsxs)(el,{action:"updateProject",formData:{...t},params:{pk:t.id},onSubmit:()=>n(),autosubmit:!0,children:[(0,bi.jsxs)(el.Row,{columnCount:1,children:[(0,bi.jsx)(As,{text:"ML-Assisted Labeling",large:!0}),(0,bi.jsx)("div",{style:{paddingLeft:16},children:(0,bi.jsx)(Ws,{label:"Start model training after any annotations are submitted or updated",name:"start_training_on_annotation_update"})}),(0,bi.jsx)("div",{style:{paddingLeft:16},children:(0,bi.jsx)(Ws,{label:"Retrieve predictions when loading a task automatically",name:"evaluate_predictions_automatically"})}),(0,bi.jsx)("div",{style:{paddingLeft:16},children:(0,bi.jsx)(Ws,{label:"Show predictions to annotators in the Label Stream and Quick View",name:"show_collab_predictions"})})]}),!Ks(Ys)&&(0,bi.jsx)(zu,{}),(0,bi.jsxs)(el.Actions,{children:[(0,bi.jsx)(el.Indicator,{children:(0,bi.jsx)("span",{case:"success",children:"Saved!"})}),(0,bi.jsx)(Mi,{type:"submit",look:"primary",style:{width:120},children:"Save"})]})]}),(0,bi.jsx)(Ru,{onEdit:e=>l(e),fetchBackends:s,backends:o})]})};Hu.title="Machine Learning",Hu.path="/ml";const Wu=({storage:e,className:t,storageTypes:n=[]})=>{var r,i;return(0,bi.jsx)("div",{className:t,children:(0,bi.jsxs)(Du,{children:[(0,bi.jsx)(Du.Item,{term:"Type",children:null!==(r=null===(i=n.find((t=>t.name===e.type)))||void 0===i?void 0:i.title)&&void 0!==r?r:e.type}),(0,bi.jsxs)(Ts,{value:e.type,children:[(0,bi.jsx)(Bu,{case:"s3",storage:e}),(0,bi.jsx)($u,{case:"gcs",storage:e}),(0,bi.jsx)(Vu,{case:"azure",storage:e}),(0,bi.jsx)(qu,{case:"redis",storage:e}),(0,bi.jsx)(Gu,{case:"localfiles",storage:e})]}),(0,bi.jsx)(Du.Item,{term:"Last Sync",children:e.last_sync?os(new Date(e.last_sync),"MMMM dd, yyyy ∙ HH:mm:ss"):"Never synced"})]})})},Bu=({storage:e})=>(0,bi.jsx)(Du.Item,{term:"Bucket",children:e.bucket}),$u=({storage:e})=>(0,bi.jsx)(Du.Item,{term:"Bucket",children:e.bucket}),Vu=({storage:e})=>(0,bi.jsx)(Du.Item,{term:"Container",children:e.container}),qu=({storage:e})=>(0,bi.jsxs)(bi.Fragment,{children:[(0,bi.jsx)(Du.Item,{term:"Path",children:e.path}),(0,bi.jsxs)(Du.Item,{term:"Host",children:[e.host,e.port?`:${e.post}`:""]})]}),Gu=({storage:e})=>(0,bi.jsx)(Du.Item,{term:"Path",children:e.path}),Yu=({rootClass:e,target:t,storage:n,onEditStorage:r,onDeleteStorage:i,storageTypes:o})=>{var a;const[s,l]=(0,L.useState)(!1),u=(0,L.useContext)(Zi),[c,d]=(0,L.useState)({...n}),[f,p]=(0,L.useState)(null),h=(0,L.useCallback)((async()=>{l(!0),p(null);const e=await u.callApi("syncStorage",{params:{target:t,type:c.type,pk:c.id}});e&&(d(e),p(e.last_sync_count)),l(!1)}),[n]);return(0,L.useEffect)((()=>{d(n)}),[n]),(0,bi.jsxs)(Ro,{header:null!==(a=c.title)&&void 0!==a?a:`Untitled ${c.type}`,extra:(0,bi.jsx)(To.Trigger,{align:"right",content:(0,bi.jsxs)(Lo,{size:"compact",style:{width:110},children:[(0,bi.jsx)(Lo.Item,{onClick:()=>r(c),children:"Edit"}),(0,bi.jsx)(Lo.Item,{onClick:()=>i(c),children:"Delete"})]}),children:(0,bi.jsx)(Mi,{type:"link",style:{width:32,height:32,marginRight:-10},icon:(0,bi.jsx)(Cs,{})})}),children:[(0,bi.jsx)(Wu,{storage:c,className:e.elem("summary"),storageTypes:o}),(0,bi.jsx)("div",{className:e.elem("sync"),children:(0,bi.jsxs)(Pi,{size:"small",children:[(0,bi.jsx)(Mi,{waiting:s,onClick:h,children:"Sync Storage"}),null!==f?(0,bi.jsxs)("div",{className:e.elem("sync-count"),children:["Synced ",f," task(s)"]}):null]})})]})},Xu=(0,L.forwardRef)((({onSubmit:e,target:t,project:n,rootClass:r,storage:i,storageTypes:o},a)=>{var s,l,u,c;const d=(0,L.useContext)(Zi),f=null!=a?a:(0,L.useRef)(),[p,h]=(0,L.useState)(null!==(s=null!==(l=null==i?void 0:i.type)&&void 0!==l?l:null==o||null===(u=o[0])||void 0===u?void 0:u.name)&&void 0!==s?s:"s3"),[m,v]=(0,L.useState)(!1),[g,y]=(0,L.useState)(null),[b,w]=(0,L.useState)([]);(0,L.useEffect)((()=>{d.callApi("storageForms",{params:{target:t,type:p}}).then((e=>w(null!=e?e:[])))}),[p]);const x={columnCount:1,fields:[{skip:!0,type:"select",name:"storage_type",label:"Storage Type",disabled:!!i,options:o.map((({name:e,title:t})=>({value:e,label:t}))),value:null!==(c=null==i?void 0:i.type)&&void 0!==c?c:p,onChange:e=>{h(e.target.value)}}]},k=(0,L.useCallback)((async()=>{v(!0),y(null);const e=f.current;if(e&&e.validateFields()){const n=e.assembleFormData({asJSON:!0}),r=e.getField("storage_type").value;pi(null==i?void 0:i.id)&&(n.id=i.id);const o=await e.api.callApi("validateStorage",{params:{target:t,type:r},body:n});y(null!==o)}v(!1)}),[f,t,p,i]),_=(0,L.useMemo)((()=>i?"updateStorage":"createStorage"),[i]);return(0,bi.jsxs)(el.Builder,{ref:f,action:_,params:{target:t,type:p,project:n,pk:null==i?void 0:i.id},fields:[x,...null!=b?b:[]],formData:{...null!=i?i:{}},skipEmpty:!1,onSubmit:e,autoFill:"off",autoComplete:"off",children:[(0,bi.jsx)(zs,{type:"hidden",name:"project",value:n}),(0,bi.jsxs)(el.Actions,{valid:g,extra:null!==g&&(0,bi.jsx)(Si,{name:"form-indicator",children:(0,bi.jsxs)(Ts,{value:g,children:[(0,bi.jsx)(Ci,{tag:"span",mod:{type:"success"},name:"item",case:!0,children:"Successfully connected!"}),(0,bi.jsx)(Ci,{tag:"span",mod:{type:"fail"},name:"item",case:!1,children:"Connection failed"})]})}),children:[(0,bi.jsx)(zs,{type:"hidden",name:"project",value:n}),(0,bi.jsxs)(Mi.Group,{className:r.elem("buttons"),children:[(0,bi.jsx)(Mi,{type:"button",waiting:m,onClick:k,children:"Check Connection"}),(0,bi.jsx)(Mi,{type:"submit",look:"primary",children:i?"Save":"Add Storage"})]})]}),(0,bi.jsx)(Lu,{})]})})),Ku=({title:e,target:t,rootClass:n,buttonLabel:r})=>{const i=(0,L.useContext)(Zi),{project:o}=Vc(),[a,s]=(0,L.useState)([]),[l,u]=(0,L.useState)(!1),[c,d]=(0,L.useState)(!1),[f,p]=(0,L.useState)([]);(0,L.useEffect)((()=>{i.callApi("storageTypes",{params:{target:t}}).then((e=>{p(e)}))}),[]);const h=(0,L.useCallback)((async()=>{if(!o.id)return void console.warn("Project ID not provided");u(!0);const e=await i.callApi("listStorages",{params:{project:o.id,target:t}}),n=await i.callApi("storageTypes",{params:{target:t}});p(n),null!==e&&(s(e),d(!0)),u(!1)}),[o]),m=(0,L.useCallback)((e=>{const r=Yi({title:`${e?"Edit":"Add"} ${"export"===t?"Target":"Source"} Storage`,closeOnClickOutside:!1,style:{width:760},body:(0,bi.jsx)(Xu,{target:t,storage:e,project:o.id,rootClass:n,storageTypes:f,onSubmit:async()=>{await h(),r.close()}}),footer:(0,bi.jsxs)(bi.Fragment,{children:["Save completed annotations to Amazon S3, Google Cloud, Microsoft Azure, or Redis.",(0,bi.jsx)("br",{}),(0,bi.jsx)("a",{href:"https://labelstud.io/guide/storage.html",children:"See more in the documentation"}),"."]})})}),[o,h,t,n]),v=(0,L.useCallback)((async e=>{m(e)}),[m]),g=(0,L.useCallback)((async e=>{Xi({title:"Deleting storage",body:"This action cannot be undone. Are you sure?",buttonLook:"destructive",onOk:async()=>{null!==await i.callApi("deleteStorage",{params:{type:e.type,pk:e.id,target:t}})&&h()}})}),[h]);return(0,L.useEffect)((()=>{h()}),[h]),(0,bi.jsxs)(Io.Column,{title:e,children:[(0,bi.jsx)("div",{className:n.elem("controls"),children:(0,bi.jsx)(Mi,{onClick:()=>m(),children:r})}),l&&!c?(0,bi.jsx)("div",{className:n.elem("empty"),children:(0,bi.jsx)(ms,{size:32})}):0===a.length?null:a.map((e=>(0,bi.jsx)(Yu,{storage:e,target:t,rootClass:n,storageTypes:f,onEditStorage:v,onDeleteStorage:g},e.id)))]})},Qu=()=>{const e=ki("storage-settings");return(0,bi.jsxs)(Si,{name:"storage-settings",children:[(0,bi.jsx)(Nu,{style:{marginTop:0},children:"Use cloud or database storage as the source for your labeling tasks or the target of your completed annotations."}),(0,bi.jsxs)(Io,{count:2,gap:"40px",size:"320px",className:e,children:[(0,bi.jsx)(Ku,{title:"Source Cloud Storage",buttonLabel:"Add Source Storage",rootClass:e}),(0,bi.jsx)(Ku,{title:"Target Cloud Storage",target:"export",buttonLabel:"Add Target Storage",rootClass:e})]})]})};Qu.title="Cloud Storage",Qu.path="/storage";const Ju={title:"Settings",path:"/settings",exact:!0,layout:({children:e,...t})=>(0,bi.jsx)(hs,{menuItems:[ju,Ou,Tu,Hu,Qu,xu,ku],path:t.match.url,children:e}),component:ju,pages:{InstructionsSettings:Tu,LabelingSettings:Ou,MachineLearningSettings:Hu,StorageSettings:Qu,WebhookPage:xu,DangerZone:ku}};var Zu=n(5792),ec=n.n(Zu);const tc=({projects:e,currentPage:t,totalItems:n,loadNextPage:r,pageSize:i})=>(0,bi.jsxs)(bi.Fragment,{children:[(0,bi.jsx)(Ci,{name:"list",children:e.map((e=>(0,bi.jsx)(rc,{project:e},e.id)))}),(0,bi.jsx)(Ci,{name:"pages",children:(0,bi.jsx)($s,{name:"projects-list",label:"Projects",page:t,totalItems:n,urlParamName:"page",pageSize:i,pageSizeOptions:[10,30,50,100],onPageLoad:(e,t)=>r(e,t)})})]}),nc=({openModal:e})=>(0,bi.jsxs)(Si,{name:"empty-projects-page",children:[(0,bi.jsx)(Ci,{name:"heidi",tag:"img",src:vi("/static/images/opossum_looking.png")}),(0,bi.jsx)(Ci,{name:"header",tag:"h1",children:"Heidi doesn’t see any projects here"}),(0,bi.jsx)("p",{children:"Create one and start labeling your data"}),(0,bi.jsx)(Ci,{name:"action",tag:Mi,onClick:e,look:"primary",children:"Create Project"})]}),rc=({project:e})=>{var t;const n=(0,L.useMemo)((()=>"#FFFFFF"===e.color?null:e.color),[e]),r=(0,L.useMemo)((()=>n?{"--header-color":n,"--background-color":ec()(n).alpha(.2).css()}:{}),[n]);return(0,bi.jsx)(Ci,{tag:_o,name:"link",to:`/projects/${e.id}/data`,"data-external":!0,children:(0,bi.jsxs)(Si,{name:"project-card",mod:{colored:!!n},style:r,children:[(0,bi.jsxs)(Ci,{name:"header",children:[(0,bi.jsxs)(Ci,{name:"title",children:[(0,bi.jsx)(Ci,{name:"title-text",children:null!==(t=e.title)&&void 0!==t?t:"New project"}),(0,bi.jsx)(Ci,{name:"menu",onClick:e=>{e.stopPropagation(),e.preventDefault()},children:(0,bi.jsx)(To.Trigger,{content:(0,bi.jsxs)(Lo,{children:[(0,bi.jsx)(Lo.Item,{href:`/projects/${e.id}/settings`,children:"Settings"}),(0,bi.jsx)(Lo.Item,{href:`/projects/${e.id}/data?labeling=1`,children:"Label"})]}),children:(0,bi.jsx)(Mi,{size:"small",type:"text",icon:(0,bi.jsx)(or,{})})})})]}),(0,bi.jsx)(Ci,{name:"summary",children:(0,bi.jsxs)(Ci,{name:"annotation",children:[(0,bi.jsxs)(Ci,{name:"total",children:[e.finished_task_number," / ",e.task_number]}),(0,bi.jsxs)(Ci,{name:"detail",children:[(0,bi.jsxs)(Ci,{name:"detail-item",mod:{type:"completed"},children:[(0,bi.jsx)(Ci,{tag:Gn,name:"icon"}),e.total_annotations_number]}),(0,bi.jsxs)(Ci,{name:"detail-item",mod:{type:"rejected"},children:[(0,bi.jsx)(Ci,{tag:Tr,name:"icon"}),e.skipped_annotations_number]}),(0,bi.jsxs)(Ci,{name:"detail-item",mod:{type:"predictions"},children:[(0,bi.jsx)(Ci,{tag:Bn,name:"icon"}),e.total_predictions_number]})]})]})})]}),(0,bi.jsx)(Ci,{name:"description",children:e.description}),(0,bi.jsxs)(Ci,{name:"info",children:[(0,bi.jsx)(Ci,{name:"created-date",children:os(new Date(e.created_at),"dd MMM ’yy, HH:mm")}),(0,bi.jsx)(Ci,{name:"created-by",children:(0,bi.jsx)(sa,{src:"#",user:e.created_by,showUsername:!0})})]})]})})},ic=()=>{var e;const t=L.useContext(Zi),n=(()=>{const e=(0,L.useRef)(new AbortController);(0,L.useEffect)((()=>()=>{e.current.abort()}),[]);const t=(0,L.useCallback)((()=>{var t,n;null===(t=e.current)||void 0===t||null===(n=t.abort)||void 0===n||n.call(t),e.current=new AbortController}),[]);return{controller:e,renew:t}})(),[r,i]=L.useState([]),[o,a]=L.useState(null),[s,l]=(0,L.useState)((()=>{const e=new URLSearchParams(location.search).get("page");return e?parseInt(e):1})()),[u,c]=(0,L.useState)(1),d=Hc(),f=parseInt(null!==(e=localStorage.getItem("pages:projects-list"))&&void 0!==e?e:30),[p,h]=L.useState(!1),m=h.bind(null,!0),v=h.bind(null,!1),g=async(e=s,r=f)=>{var o,l,u;a("loading"),n.renew();const d={page:e,page_size:r};Ks(Xs)&&(d.include=["id","title","created_by","created_at","color","is_published","assignment_settings"].join(","));const p=await t.callApi("projects",{params:d,...Ks(Xs)?{signal:n.controller.current.signal,errorFilter:e=>e.error.includes("aborted")}:null});if(c(null!==(o=null==p?void 0:p.count)&&void 0!==o?o:1),i(null!==(l=p.results)&&void 0!==l?l:[]),a("loaded"),Ks(Xs)&&null!=p&&null!==(u=p.results)&&void 0!==u&&u.length){var h,m;const e=await t.callApi("projects",{params:{ids:null==p||null===(h=p.results)||void 0===h?void 0:h.map((({id:e})=>e)).join(","),include:["id","description","num_tasks_with_annotations","task_number","skipped_annotations_number","total_annotations_number","total_predictions_number","ground_truth_number","finished_task_number"].join(","),page_size:r},signal:n.controller.current.signal,errorFilter:e=>e.error.includes("aborted")});null!=e&&null!==(m=e.results)&&void 0!==m&&m.length&&i((t=>e.results.map((e=>({...t.find((({id:t})=>t===e.id)),...e})))))}};return L.useEffect((()=>{g()}),[]),L.useEffect((()=>{d({openModal:m,showButton:r.length>0})}),[r.length]),(0,bi.jsx)(Si,{name:"projects-page",children:(0,bi.jsxs)(Ts,{value:o,children:[(0,bi.jsx)(Ci,{name:"loading",case:"loading",children:(0,bi.jsx)(ms,{size:64})}),(0,bi.jsxs)(Ci,{name:"content",case:"loaded",children:[r.length?(0,bi.jsx)(tc,{projects:r,currentPage:s,totalItems:u,loadNextPage:async(e,t)=>{l(e),await g(e,t)},pageSize:f}):(0,bi.jsx)(nc,{openModal:m}),p&&(0,bi.jsx)(Ul,{onClose:v})]})]})})};ic.title="Projects",ic.path="/projects",ic.exact=!0,ic.routes=({store:e})=>[{title:()=>{var t;return null===(t=e.project)||void 0===t?void 0:t.title},path:"/:id(\\d+)",exact:!0,component:()=>{const e=function(){var e=de(Y).match;return e?e.params:{}}();return(0,bi.jsx)(ee,{to:`/projects/${e.id}/data`})},pages:{DataManagerPage:vu,SettingsPage:Ju}}],ic.context=({openModal:e,showButton:t})=>t?(0,bi.jsx)(Mi,{onClick:e,look:"primary",size:"compact",children:"Create"}):null;function oc(e,t){la(2,arguments);var n=ua(e),r=ua(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function ac(e,t){la(2,arguments);var n=ua(e),r=ua(t),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return 12*i+o}function sc(e){la(1,arguments);var t=ua(e);return t.setHours(23,59,59,999),t}function lc(e){la(1,arguments);var t=ua(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function uc(e){la(1,arguments);var t=ua(e);return sc(t).getTime()===lc(t).getTime()}function cc(e,t){la(2,arguments);var n=ua(e),r=ua(t),i=oc(n,r),o=Math.abs(ac(n,r));1===n.getMonth()&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*o);var a=oc(n,r)===-i;uc(ua(e))&&1===o&&1===oc(e,r)&&(a=!1);var s=i*(o-a);return 0===s?0:s}function dc(e,t){la(2,arguments);var n=ua(e),r=ua(t);return n.getTime()-r.getTime()}function fc(e,t){la(2,arguments);var n=dc(e,t)/1e3;return n>0?Math.floor(n):Math.ceil(n)}function pc(e){return function(e,t){if(null==e)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in t=t||{})t.hasOwnProperty(n)&&(e[n]=t[n]);return e}({},e)}var hc=1440,mc=43200;function vc(e,t,n){la(2,arguments);var r=n||{},i=r.locale||ya;if(!i.formatDistance)throw new RangeError("locale must contain formatDistance property");var o=oc(e,t);if(isNaN(o))throw new RangeError("Invalid time value");var a,s,l=pc(r);l.addSuffix=Boolean(r.addSuffix),l.comparison=o,o>0?(a=ua(t),s=ua(e)):(a=ua(e),s=ua(t));var u,c=fc(s,a),d=(Ya(s)-Ya(a))/1e3,f=Math.round((c-d)/60);if(f<2)return r.includeSeconds?c<5?i.formatDistance("lessThanXSeconds",5,l):c<10?i.formatDistance("lessThanXSeconds",10,l):c<20?i.formatDistance("lessThanXSeconds",20,l):c<40?i.formatDistance("halfAMinute",null,l):c<60?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",1,l):0===f?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",f,l);if(f<45)return i.formatDistance("xMinutes",f,l);if(f<90)return i.formatDistance("aboutXHours",1,l);if(f<hc){var p=Math.round(f/60);return i.formatDistance("aboutXHours",p,l)}if(f<2520)return i.formatDistance("xDays",1,l);if(f<mc){var h=Math.round(f/hc);return i.formatDistance("xDays",h,l)}if(f<86400)return u=Math.round(f/mc),i.formatDistance("aboutXMonths",u,l);if((u=cc(s,a))<12){var m=Math.round(f/mc);return i.formatDistance("xMonths",m,l)}var v=u%12,g=Math.floor(u/12);return v<3?i.formatDistance("aboutXYears",g,l):v<9?i.formatDistance("overXYears",g,l):i.formatDistance("almostXYears",g+1,l)}const gc=({defaultText:e="",timeout:t=1200})=>{const[n,r]=(0,L.useState)(!1);return[n,(0,L.useCallback)((n=>{r(!0),gi(pi(n)?n:e),setTimeout((()=>r(!1)),t)}),[e,t])]},yc=(0,L.forwardRef)((({children:e,title:t,textForCopy:n,...r},i)=>{const[o,a]=gc({defaultText:n}),s=(0,L.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),a()}),[]),l=L.Children.only(e),u=(0,L.cloneElement)(l,{...l.props,ref:i,onClick:s});return(0,bi.jsx)(oa,{title:o?"Copied!":t,onClick:s,...r,children:u})})),bc=({onSelect:e,selectedUser:t,defaultSelected:n})=>{const r=io(),[i,o]=(0,L.useState)(),[a]=((e,t=1)=>{const n=new URLSearchParams(location.search).get(e),[r,i]=(0,L.useState)(n?parseInt(n):t);return[r,i]})("page",1),[s]=((e,t=1)=>{const n=new URLSearchParams(location.search).get(e),[r,i]=(0,L.useState)(n?parseInt(n):t);return[r,i]})("page_size",30),[l,u]=(0,L.useState)(0);console.log({currentPage:a,currentPageSize:s});const c=(0,L.useCallback)((async(e,t)=>{const n=await r.callApi("memberships",{params:{pk:1,contributed_to_projects:1,page:e,page_size:t}});n.results&&(o(n.results),u(n.count))}),[]),d=(0,L.useCallback)((n=>{(null==t?void 0:t.id)===n.id?null==e||e(null):null==e||e(n)}),[t]);return(0,L.useEffect)((()=>{c(a,s)}),[]),(0,L.useEffect)((()=>{if(pi(n)&&i){const e=i.find((({user:e})=>e.id===Number(n)));e&&d(e.user)}}),[i,n]),(0,bi.jsx)(bi.Fragment,{children:(0,bi.jsxs)(Si,{name:"people-list",children:[(0,bi.jsx)(Ci,{name:"wrapper",children:i?(0,bi.jsxs)(Ci,{name:"users",children:[(0,bi.jsxs)(Ci,{name:"header",children:[(0,bi.jsx)(Ci,{name:"column",mix:"avatar"}),(0,bi.jsx)(Ci,{name:"column",mix:"email",children:"Email"}),(0,bi.jsx)(Ci,{name:"column",mix:"name",children:"Name"}),(0,bi.jsx)(Ci,{name:"column",mix:"last-activity",children:"Last Activity"})]}),(0,bi.jsx)(Ci,{name:"body",children:i.map((({user:e})=>{const n=e.id===(null==t?void 0:t.id);return(0,bi.jsxs)(Ci,{name:"user",mod:{active:n},onClick:()=>d(e),children:[(0,bi.jsx)(Ci,{name:"field",mix:"avatar",children:(0,bi.jsx)(yc,{title:"User ID: "+e.id,textForCopy:e.id,children:(0,bi.jsx)(sa,{user:e,style:{width:28,height:28}})})}),(0,bi.jsx)(Ci,{name:"field",mix:"email",children:e.email}),(0,bi.jsxs)(Ci,{name:"field",mix:"name",children:[e.first_name," ",e.last_name]}),(0,bi.jsx)(Ci,{name:"field",mix:"last-activity",children:vc(new Date(e.last_activity),new Date,{addSuffix:!0})})]},`user-${e.id}`)}))})]}):(0,bi.jsx)(Ci,{name:"loading",children:(0,bi.jsx)(ms,{size:36})})}),(0,bi.jsx)($s,{page:a,urlParamName:"page",totalItems:l,pageSize:s,pageSizeOptions:[30,50,100],onPageLoad:c,style:{paddingTop:16}})]})})},wc=({projects:e})=>(0,bi.jsx)(Ci,{name:"links-list",children:e.map((e=>(0,bi.jsx)(Ci,{tag:_o,name:"project-link",to:`/projects/${e.id}`,"data-external":!0,children:e.title},`project-${e.id}`)))}),xc=({user:e,onClose:t})=>{const n=[e.first_name,e.last_name].filter((e=>!!e)).join(" ").trim();return(0,bi.jsxs)(Si,{name:"user-info",children:[(0,bi.jsx)(Ci,{name:"close",tag:Mi,type:"link",onClick:t,children:(0,bi.jsx)(Qn,{})}),(0,bi.jsxs)(Ci,{name:"header",children:[(0,bi.jsx)(sa,{user:e,style:{width:64,height:64,fontSize:28}}),n&&(0,bi.jsx)(Ci,{name:"full-name",children:n}),(0,bi.jsx)(Ci,{tag:"p",name:"email",children:e.email})]}),e.phone&&(0,bi.jsx)(Ci,{name:"section",children:(0,bi.jsx)("a",{href:`tel:${e.phone}`,children:e.phone})}),!!e.created_projects.length&&(0,bi.jsxs)(Ci,{name:"section",children:[(0,bi.jsx)(Ci,{name:"section-title",children:"Created Projects"}),(0,bi.jsx)(wc,{projects:e.created_projects})]}),!!e.contributed_to_projects.length&&(0,bi.jsxs)(Ci,{name:"section",children:[(0,bi.jsx)(Ci,{name:"section-title",children:"Contributed to"}),(0,bi.jsx)(wc,{projects:e.contributed_to_projects})]}),(0,bi.jsxs)(Ci,{tag:"p",name:"last-active",children:["Last activity on: ",os(new Date(e.last_activity),"dd MMM yyyy, KK:mm a")]})]})},kc=({link:e})=>(0,bi.jsxs)(Si,{name:"invite",children:[(0,bi.jsx)(zs,{value:e,style:{width:"100%"},readOnly:!0}),(0,bi.jsxs)(Nu,{style:{width:"70%",marginTop:16},children:["Invite people to join your Label Studio instance. People that you invite have full access to all of your projects. ",(0,bi.jsx)("a",{href:"https://labelstud.io/guide/signup.html",children:"Learn more"}),"."]})]}),_c=()=>{const e=io(),t=(0,L.useRef)(),n=Ii(),[r,i]=(0,L.useState)(null),[o,a]=(0,L.useState)(),s=(0,L.useCallback)((e=>{i(e),localStorage.setItem("selectedUser",null==e?void 0:e.id)}),[i]),l=(0,L.useCallback)((e=>{const t=n.hostname||location.origin;a(`${t}${e}`)}),[n,a]),u=(0,L.useCallback)((()=>{e.callApi("resetInviteLink").then((({invite_url:e})=>{l(e)}))}),[l]),c=(0,L.useCallback)((e=>({title:"Invite people",style:{width:640,height:472},body:()=>(0,bi.jsx)(kc,{link:e}),footer:()=>{const[t,n]=(0,L.useState)(!1),r=(0,L.useCallback)((()=>{n(!0),gi(e),setTimeout((()=>n(!1)),1500)}),[]);return(0,bi.jsxs)(Pi,{spread:!0,children:[(0,bi.jsx)(Pi,{children:(0,bi.jsx)(Mi,{style:{width:170},onClick:()=>u(),children:"Reset Link"})}),(0,bi.jsx)(Pi,{children:(0,bi.jsx)(Mi,{primary:!0,style:{width:170},onClick:r,children:t?"Copied!":"Copy link"})})]})},bareFooter:!0})),[]),d=(0,L.useCallback)((()=>{t.current=Yi(c(o))}),[c,o]),f=(0,L.useMemo)((()=>localStorage.getItem("selectedUser")),[]);return(0,L.useEffect)((()=>{e.callApi("inviteLink").then((({invite_url:e})=>{l(e)}))}),[]),(0,L.useEffect)((()=>{var e;null===(e=t.current)||void 0===e||e.update(c(o))}),[o]),(0,bi.jsxs)(Si,{name:"people",children:[(0,bi.jsx)(Ci,{name:"controls",children:(0,bi.jsxs)(Pi,{spread:!0,children:[(0,bi.jsx)(Pi,{}),(0,bi.jsx)(Pi,{children:(0,bi.jsx)(Mi,{icon:(0,bi.jsx)(Wr,{}),primary:!0,onClick:d,children:"Add People"})})]})}),(0,bi.jsxs)(Ci,{name:"content",children:[(0,bi.jsx)(bc,{selectedUser:r,defaultSelected:f,onSelect:e=>s(e)}),r&&(0,bi.jsx)(xc,{user:r,onClose:()=>s(null)})]})]})};var Sc;_c.title="People",_c.path="/";const Cc=null===(Sc=window.APP_SETTINGS.flags)||void 0===Sc?void 0:Sc.allow_organization_webhooks,Ec={};Cc&&(Ec[xu]=xu);const jc=[ic,{title:"Organization",path:"/organization",exact:!0,layout:({children:e,...t})=>{let n=[_c];return Cc&&n.push(xu),(0,bi.jsx)(hs,{menuItems:n,path:t.match.url,children:e})},component:_c,pages:Ec}],Tc=e=>{const t=[],n=[];try{L.Children.toArray(e).forEach((e=>{var r;null!=e&&null!==(r=e.props)&&void 0!==r&&r.modal?t.push(e):n.push(e)}))}catch(t){console.log(t),console.log({children:e})}return[t,n]},Oc=({children:e,render:t,route:n,component:r,staticComponent:i,...o})=>{const a=L.useContext(cs),s=e=>{let t=[],n=[];e.props&&e.props.children?([t,n]=Tc(e.props.children),e=L.cloneElement(e,{children:n})):Array.isArray(e)&&([t,n]=Tc(e),e=n);const r=()=>(!1===(null==a?void 0:a.contextIsSet(null))&&(null==a||a.setContext(null)),null!=i?i:(0,bi.jsx)(ia,{id:"main-content"})),o=t.reduce(((e,t)=>(t.props.exact?e.exact.push(t):e.modal.push(t),e)),{exact:[],modal:[]});return(0,bi.jsxs)(bi.Fragment,{children:[o.modal,(0,bi.jsxs)(ce,{children:[o.exact,e,(0,bi.jsx)(Tn,{exact:!0,children:(0,bi.jsx)(r,{})})]})]})},l={};return t?l.render=e=>s(t(e)):e instanceof Function?l.children=t=>s(e(t)):r?l.component=e=>s(r(e)):l.children=s(e),!1!==n?(0,bi.jsx)(Tn,{...o,...l}):s(e)},Nc=(e,t)=>e instanceof Function?e(t):e,Mc=(e,t)=>{const n=([e,n])=>{var r;const i={path:n.path};return i.exact=!!n.exact,i.modal=!!n.modal,n.title&&(i.title=n.title),n.render&&(i.render=n.render),n instanceof L.Component||n instanceof Function?e&&/Layout/.test(e)?i.layout=n:i.component=n:(i.component=n.component,i.layout=n.layout),n.pages?i.routes=Mc(Nc(n.pages,t),t):n.routes&&(i.routes=Mc(Nc(n.routes,t),t)),null!==(r=i.component)&&void 0!==r&&r.context&&(i.context=i.component.context),i};try{return Array.isArray(e)?e.map((e=>n([null,e]))):Object.entries(e).map(n)}catch(e){return console.log(e),[]}},Lc=(e,t)=>{const n=(e,r)=>e.map((e=>((e,r)=>{const{component:i,layout:o,path:a,modal:s,routes:l,...u}=e,c=r?`${r}${a}`:a;if(l){const e=n(l,c),t=t=>{const l=[];return i&&l.push(n([{path:a,modal:s,...u,component:i}],r)),l.push(...e),o?(0,bi.jsx)(o,{...t,children:l}):l};return(0,bi.jsx)(Oc,{path:c,render:t},c)}{const e={key:c,path:c,modal:!!i.modal};return(0,bi.jsx)(Tn,{...e,exact:!0,render:()=>(0,bi.jsx)(i,{...null!=t?t:{}}),...u})}})(e,r)));return n(e)},Pc=(0,L.createContext)(),Ac=(e,t,n="")=>{const r=[],i=t.find((t=>{const r=`${n}${t.path}`;return re(e,{path:r})}));if(i){const t=`${n}${i.path}`;r.push({...i,path:t}),i.routes&&r.push(...Ac(e,i.routes,t))}return r},Dc=({children:e})=>{const t=fe(),n=Uc(),r=Ii(),{store:i}=so(),o=su(),[a,s]=(0,L.useState)(null),[l,u]=(0,L.useState)(null),c=(0,L.useMemo)((()=>Mc(jc,{config:r,store:i})),[n,r,i,t]),d=(0,L.useMemo)((()=>Ac(n.pathname,c)),[n,c]),f=(0,L.useMemo)((()=>d.filter((e=>!e.modal)).slice(-1)[0]),[d]),[p,h]=(0,L.useState)(null==f?void 0:f.path),m=(0,L.useMemo)((()=>({routesMap:c,breadcrumbs:o,currentContext:a,setContextProps:u,path:p,findComponent:e=>Ac(e,c)})),[o,c,a,p,s]);return(0,L.useEffect)((()=>{const e=null==f?void 0:f.context;s({component:null!=e?e:null,props:l}),h(null==f?void 0:f.path);try{const e=d.map((e=>{var t,r,i;const o=re(n.pathname,{path:e.path}),a=Z(e.path,o.params);return{path:a,title:e.title instanceof Function?e.title():e.title,key:null!==(t=null!==(r=null===(i=e.component)||void 0===i?void 0:i.displayName)&&void 0!==r?r:e.key)&&void 0!==t?t:a}})).filter((e=>!!e.title));tu(e)}catch(e){console.log(e)}}),[n,c,l,d,f]),(0,bi.jsx)(Pc.Provider,{value:m,children:e})},Rc=()=>{var e,t;return null!==(e=null===(t=(0,L.useContext)(Pc))||void 0===t?void 0:t.findComponent)&&void 0!==e?e:()=>null},Ic=()=>{var e,t;return null!==(e=null===(t=(0,L.useContext)(Pc))||void 0===t?void 0:t.breadcrumbs)&&void 0!==e?e:[]},Fc=()=>{const e=Uc(),t=null===(n=(0,L.useContext)(Pc))||void 0===n?void 0:n.path;var n;const r=(0,L.useMemo)((()=>{var n;const r=e.search.replace(/^\?/,"").split("&").map((e=>{const[t,n]=e.split("=").map((e=>decodeURIComponent(e)));return[t,n]})),i=Object.fromEntries(r),o=re(e.pathname,null!=t?t:"");return{...i,...null!==(n=null==o?void 0:o.params)&&void 0!==n?n:{}}}),[e,t]);return null!=r?r:{}},zc=()=>{var e;const t=(0,L.useContext)(Pc),{component:n,props:r}=null!==(e=null==t?void 0:t.currentContext)&&void 0!==e?e:{};return{ContextComponent:n,contextProps:r}},Uc=()=>{const e=pe();return(0,L.useMemo)((()=>{var t;return null!==(t=e.location)&&void 0!==t?t:e}),[e])},Hc=()=>{const e=(0,L.useContext)(Pc).setContextProps;return(0,L.useMemo)((()=>e),[e])},Wc=(0,L.createContext)({});Wc.displayName="ProjectContext";const Bc=new Map,$c=({children:e})=>{var t;const n=io(),r=Fc(),{update:i}=so(),[o,a]=(0,L.useState)(null!==(t=Bc.get(+r.id))&&void 0!==t?t:{}),s=(0,L.useCallback)((async(e,t=!1)=>{const s=+(null!=e?e:r.id);if(isNaN(s))return;!t&&Bc.has(s)&&a({...Bc.get(s)});const l=await n.callApi("project",{params:{pk:s},errorFilter:()=>!1});return!1===ho(o,l)&&(a(l),i({project:l}),Bc.set(l.id,l)),l}),[r]),l=(0,L.useCallback)((async e=>{const t=await n.callApi("updateProject",{params:{pk:o.id},body:e});return t.$meta&&(a(t),i({project:t})),t}),[o,a,i]);return(0,L.useEffect)((()=>{+r.id!==(null==o?void 0:o.id)&&a({}),s()}),[r]),(0,L.useEffect)((()=>()=>Bc.clear()),[]),(0,bi.jsx)(Wc.Provider,{value:{project:o,fetchProject:s,updateProject:l,invalidateCache(){Bc.clear(),a({})}},children:e})},Vc=()=>{var e;return null!==(e=(0,L.useContext)(Wc))&&void 0!==e?e:{}},qc=L.createContext();class Gc extends L.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,{componentStack:t}){this.setState({error:e,hasError:!0,errorInfo:t})}render(){if(this.state.hasError){var e,t;const{error:n,errorInfo:r}=this.state,i=()=>{history.back(),setTimeout((()=>location.reload()),32)};return(0,bi.jsx)(qi,{onHide:()=>location.reload(),style:{width:"60vw"},visible:!0,bare:!0,children:(0,bi.jsx)("div",{style:{padding:40},children:(0,bi.jsx)(Ai,{title:"Runtime error",message:n,stacktrace:`${r?`Component Stack: ${r}`:""}\n\n${null!==(e=null===(t=this.state.error)||void 0===t?void 0:t.stack)&&void 0!==e?e:""}`,onGoBack:i,onReload:()=>location.reload()})})})}return(0,bi.jsx)(qc.Provider,{value:{hasError:this.state.hasError,error:this.state.error,errorInfo:this.state.errorInfo,silence:this.silence,unsilence:this.unsilence},children:this.props.children})}}const Yc=({content:e})=>{const t=null!==(n=null===(r=(0,L.useContext)(Pc))||void 0===r?void 0:r.routesMap)&&void 0!==n?n:[];var n,r;const i=Lc(t,{content:e});return i?(0,bi.jsx)(Oc,{path:"/",children:i}):null},Xc=({content:e})=>{const t="true"===localStorage.getItem("sidebar-pinned"),n=t&&"true"===localStorage.getItem("sidebar-opened");return(0,bi.jsx)(ps,{enabled:!0,defaultOpened:n,defaultPinned:t,onSidebarToggle:e=>localStorage.setItem("sidebar-opened",e),onSidebarPin:e=>localStorage.setItem("sidebar-pinned",e),children:(0,bi.jsx)(Yc,{content:e})})},Kc=_({basename:new URL(APP_SETTINGS.hostname||location.origin).pathname||"/"});window.LSH=Kc,(e=>{En(),It({dsn:"https://5f51920ff82a4675a495870244869c6b@o227124.ingest.sentry.io/5838868",integrations:[new Cn.BrowserTracing({routingInstrumentation:Ut(e)})],environment:"production",tracesSampleRate:.25,release:jn()})})(Kc);const Qc=({content:e})=>{const t={lsf:{scriptSrc:window.EDITOR_JS,cssSrc:window.EDITOR_CSS,checkAvailability:()=>!!window.LabelStudio},dm:{scriptSrc:window.DM_JS,cssSrc:window.DM_CSS,checkAvailability:()=>!!window.DataManager}};return(0,bi.jsx)(Gc,{children:(0,bi.jsx)(X,{history:Kc,children:(0,bi.jsx)(Ui,{providers:[(0,bi.jsx)(ao,{},"app-store"),(0,bi.jsx)(ro,{},"api"),(0,bi.jsx)(Ri,{},"config"),(0,bi.jsx)(fo,{libraries:t},"lsf"),(0,bi.jsx)(Dc,{},"rotes"),(0,bi.jsx)($c,{},"project")],children:(0,bi.jsx)(ta,{children:(0,bi.jsx)(Xc,{content:e})})})})})},Jc=document.querySelector(".app-wrapper"),Zc=document.querySelector("#main-content");(0,P.render)((0,bi.jsx)(Qc,{content:Zc.innerHTML}),Jc)})()})();
//# sourceMappingURL=index.js.map