pxt-core 13.2.18 → 13.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/built/backendutils.d.ts +2 -2
- package/built/backendutils.js +3 -3
- package/built/pxt.js +24 -1
- package/built/pxtlib.js +24 -1
- package/built/target.js +1 -1
- package/built/targetlight.js +1 -1
- package/built/web/main.js +1 -1
- package/built/web/pxtapp.js +1 -1
- package/built/web/pxtembed.js +1 -1
- package/built/web/pxtlib.js +1 -1
- package/built/web/pxtworker.js +1 -1
- package/built/web/skillmap/js/{main.0a30c78e.js → main.d873f450.js} +2 -2
- package/localtypings/pxtarget.d.ts +6 -0
- package/package.json +2 -2
- package/webapp/public/marked/marked.min.js +26 -26
- package/webapp/public/skillmap.html +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! For license information please see main.
|
|
2
|
-
(()=>{var e={46(e,t,n){"use strict";var r=n(5550)(),o=n(1061)("Object.prototype.toString"),a=function(e){return!(r&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===o(e)},i=function(e){return!!a(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==o(e)&&"[object Function]"===o(e.callee)},l=function(){return a(arguments)}();a.isLegacyArguments=i,e.exports=l?a:i},71(e,t,n){"use strict";function r(e){return r="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},r(e)}function o(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}var l,s,c={};function u(e,t,n){n||(n=Error);var r=function(n){function r(n,i,l){var s;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),s=o(this,a(r).call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,i,l))),s.code=e,s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(r,n),r}(n);c[e]=r}function d(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}u("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),u("ERR_INVALID_ARG_TYPE",function(e,t,o){var a,i,s;if(void 0===l&&(l=n(6362)),l("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(i="not ",t.substr(0,4)===i)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-9,n)===t}(e," argument"))s="The ".concat(e," ").concat(a," ").concat(d(t,"type"));else{var c=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+1>e.length)&&-1!==e.indexOf(".",n)}(e)?"property":"argument";s='The "'.concat(e,'" ').concat(c," ").concat(a," ").concat(d(t,"type"))}return s+". Received type ".concat(r(o))},TypeError),u("ERR_INVALID_ARG_VALUE",function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=n(3575));var o=s.inspect(t);return o.length>128&&(o="".concat(o.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(r,". Received ").concat(o)},TypeError,RangeError),u("ERR_INVALID_RETURN_VALUE",function(e,t,n){var o;return o=n&&n.constructor&&n.constructor.name?"instance of ".concat(n.constructor.name):"type ".concat(r(n)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(o,".")},TypeError),u("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];void 0===l&&(l=n(6362)),l(t.length>0,"At least one arg needs to be specified");var o="The ",a=t.length;switch(t=t.map(function(e){return'"'.concat(e,'"')}),a){case 1:o+="".concat(t[0]," argument");break;case 2:o+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:o+=t.slice(0,a-1).join(", "),o+=", and ".concat(t[a-1]," arguments")}return"".concat(o," must be specified")},TypeError),e.exports.codes=c},225(e,t,n){"use strict";var r;if(!Object.keys){var o=Object.prototype.hasOwnProperty,a=Object.prototype.toString,i=n(543),l=Object.prototype.propertyIsEnumerable,s=!l.call({toString:null},"toString"),c=l.call(function(){},"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=function(e){var t=e.constructor;return t&&t.prototype===e},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!p["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{d(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();r=function(e){var t=null!==e&&"object"==typeof e,n="[object Function]"===a.call(e),r=i(e),l=t&&"[object String]"===a.call(e),p=[];if(!t&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var h=c&&n;if(l&&e.length>0&&!o.call(e,0))for(var m=0;m<e.length;++m)p.push(String(m));if(r&&e.length>0)for(var g=0;g<e.length;++g)p.push(String(g));else for(var y in e)h&&"prototype"===y||!o.call(e,y)||p.push(String(y));if(s)for(var v=function(e){if("undefined"==typeof window||!f)return d(e);try{return d(e)}catch(e){return!1}}(e),b=0;b<u.length;++b)v&&"constructor"===u[b]||!o.call(e,u[b])||p.push(u[b]);return p}}e.exports=r},465(e,t,n){"use strict";e.exports=n(1923)},543(e){"use strict";var t=Object.prototype.toString;e.exports=function(e){var n=t.call(e),r="[object Arguments]"===n;return r||(r="[object Array]"!==n&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),r}},630(e,t,n){"use strict";e.exports=n(2138)},690(e,t,n){"use strict";var r=n(7375),o=n(9460),a=o([r("%String.prototype.indexOf%")]);e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&a(e,".prototype.")>-1?o([n]):n}},757(e,t,n){"use strict";var r="undefined"!=typeof Symbol&&Symbol,o=n(3175);e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&o()}},1e3(e,t,n){"use strict";var r=n(6806),o=Object.prototype.toString,a=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){if(!r(t))throw new TypeError("iterator must be a function");var i,l;arguments.length>=3&&(i=n),l=e,"[object Array]"===o.call(l)?function(e,t,n){for(var r=0,o=e.length;r<o;r++)a.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))}(e,t,i):"string"==typeof e?function(e,t,n){for(var r=0,o=e.length;r<o;r++)null==n?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)}(e,t,i):function(e,t,n){for(var r in e)a.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))}(e,t,i)}},1016(e){"use strict";e.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},1061(e,t,n){"use strict";var r=n(7375),o=n(3629),a=o(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&a(e,".prototype.")>-1?o(n):n}},1173(e,t,n){"use strict";e.exports=n(5636)},1253(e,t,n){"use strict";var r,o,a,i,l=n(3705);if("object"==typeof performance&&"function"==typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var c=Date,u=c.now();t.unstable_now=function(){return c.now()-u}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var d=null,p=null,f=function(){if(null!==d)try{var e=t.unstable_now();d(!0,e),d=null}catch(e){throw setTimeout(f,0),e}};r=function(e){null!==d?setTimeout(r,0,e):(d=e,setTimeout(f,0))},o=function(e,t){p=setTimeout(e,t)},a=function(){clearTimeout(p)},t.unstable_shouldYield=function(){return!1},i=t.unstable_forceFrameRate=function(){}}else{var h=window.setTimeout,m=window.clearTimeout;if(void 0!==l){var g=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&l.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 g&&l.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var y=!1,v=null,b=-1,w=5,k=0;t.unstable_shouldYield=function(){return t.unstable_now()>=k},i=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?l.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<e?Math.floor(1e3/e):5};var x=new MessageChannel,S=x.port2;x.port1.onmessage=function(){if(null!==v){var e=t.unstable_now();k=e+w;try{v(!0,e)?S.postMessage(null):(y=!1,v=null)}catch(e){throw S.postMessage(null),e}}else y=!1},r=function(e){v=e,y||(y=!0,S.postMessage(null))},o=function(e,n){b=h(function(){e(t.unstable_now())},n)},a=function(){m(b),b=-1}}function C(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,o=e[r];if(!(void 0!==o&&0<T(o,t)))break e;e[r]=t,e[n]=o,n=r}}function E(e){return void 0===(e=e[0])?null:e}function I(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length;r<o;){var a=2*(r+1)-1,i=e[a],l=a+1,s=e[l];if(void 0!==i&&0>T(i,n))void 0!==s&&0>T(s,i)?(e[r]=s,e[l]=n,r=l):(e[r]=i,e[a]=n,r=a);else{if(!(void 0!==s&&0>T(s,n)))break e;e[r]=s,e[l]=n,r=l}}}return t}return null}function T(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var j=[],N=[],A=1,P=null,O=3,_=!1,R=!1,M=!1;function L(e){for(var t=E(N);null!==t;){if(null===t.callback)I(N);else{if(!(t.startTime<=e))break;I(N),t.sortIndex=t.expirationTime,C(j,t)}t=E(N)}}function U(e){if(M=!1,L(e),!R)if(null!==E(j))R=!0,r(D);else{var t=E(N);null!==t&&o(U,t.startTime-e)}}function D(e,n){R=!1,M&&(M=!1,a()),_=!0;var r=O;try{for(L(n),P=E(j);null!==P&&(!(P.expirationTime>n)||e&&!t.unstable_shouldYield());){var i=P.callback;if("function"==typeof i){P.callback=null,O=P.priorityLevel;var l=i(P.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?P.callback=l:P===E(j)&&I(j),L(n)}else I(j);P=E(j)}if(null!==P)var s=!0;else{var c=E(N);null!==c&&o(U,c.startTime-n),s=!1}return s}finally{P=null,O=r,_=!1}}var F=i;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(){R||_||(R=!0,r(D))},t.unstable_getCurrentPriorityLevel=function(){return O},t.unstable_getFirstCallbackNode=function(){return E(j)},t.unstable_next=function(e){switch(O){case 1:case 2:case 3:var t=3;break;default:t=O}var n=O;O=t;try{return e()}finally{O=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=F,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=O;O=e;try{return t()}finally{O=n}},t.unstable_scheduleCallback=function(e,n,i){var l=t.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?l+i:l,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:A++,callback:n,priorityLevel:e,startTime:i,expirationTime:s=i+s,sortIndex:-1},i>l?(e.sortIndex=i,C(N,e),null===E(j)&&e===E(N)&&(M?a():M=!0,o(U,i-l))):(e.sortIndex=s,C(j,e),R||_||(R=!0,r(D))),e},t.unstable_wrapCallback=function(e){var t=O;return function(){var n=O;O=t;try{return e.apply(this,arguments)}finally{O=n}}}},1264(e){"use strict";e.exports=Function.prototype.apply},1338(e,t,n){"use strict";var r=n(4961);e.exports=function(e){return!!r(e)}},1555(e){"use strict";e.exports=Object.getOwnPropertyDescriptor},1581(e){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},1596(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},1619(e){"use strict";e.exports=URIError},1923(e,t,n){"use strict";n(8898);var r=n(1173),o=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var a=Symbol.for;o=a("react.element"),t.Fragment=a("react.fragment")}var i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,a={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)l.call(t,r)&&!s.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:a,_owner:i.current}}t.jsx=c,t.jsxs=c},2138(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function k(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case a:case l:case i:case f:return e;default:switch(e=e&&e.$$typeof){case c:case p:case g:case m:case s:return e;default:return t}}case o:return t}}}function x(e){return k(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=s,t.Element=r,t.ForwardRef=p,t.Fragment=a,t.Lazy=g,t.Memo=m,t.Portal=o,t.Profiler=l,t.StrictMode=i,t.Suspense=f,t.isAsyncMode=function(e){return x(e)||k(e)===u},t.isConcurrentMode=x,t.isContextConsumer=function(e){return k(e)===c},t.isContextProvider=function(e){return k(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return k(e)===p},t.isFragment=function(e){return k(e)===a},t.isLazy=function(e){return k(e)===g},t.isMemo=function(e){return k(e)===m},t.isPortal=function(e){return k(e)===o},t.isProfiler=function(e){return k(e)===l},t.isStrictMode=function(e){return k(e)===i},t.isSuspense=function(e){return k(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===d||e===l||e===i||e===f||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===p||e.$$typeof===v||e.$$typeof===b||e.$$typeof===w||e.$$typeof===y)},t.typeOf=k},2155(e,t,n){"use strict";var r=Function.prototype.call,o=Object.prototype.hasOwnProperty,a=n(6989);e.exports=a.call(r,o)},2938(e){"use strict";e.exports=Math.max},3110(e,t,n){"use strict";var r=n(6989),o=n(1264),a=n(7858),i=n(6265);e.exports=i||r.call(a,o)},3123(e){"use strict";e.exports=EvalError},3175(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var r in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0}},3500(e,t,n){"use strict";var r=n(3705),o=n(1173),a=n(8898),i=n(5664);function l(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(!o)throw Error(l(227));var s=new Set,c={};function u(e,t){d(e,t),d(e+"Capture",t)}function d(e,t){for(c[e]=t,e=0;e<t.length;e++)s.add(t[e])}var p=!("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]*$/,h=Object.prototype.hasOwnProperty,m={},g={};function y(e,t,n,r,o,a,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=i}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){v[e]=new y(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];v[t]=new y(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){v[e]=new y(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){v[e]=new y(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){v[e]=new y(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){v[e]=new y(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){v[e]=new y(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){v[e]=new y(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){v[e]=new y(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function w(e){return e[1].toUpperCase()}function k(e,t,n,r){var o=v.hasOwnProperty(t)?v[t]:null;(null!==o?0===o.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,o,r)&&(n=null),r||null===o?function(e){return!!h.call(g,e)||!h.call(m,e)&&(f.test(e)?g[e]=!0:(m[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!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(b,w);v[t]=new y(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(b,w);v[t]=new y(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(b,w);v[t]=new y(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){v[e]=new y(e,1,!1,e.toLowerCase(),null,!1,!1)}),v.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){v[e]=new y(e,1,!1,e.toLowerCase(),null,!0,!0)});var x=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=60103,C=60106,E=60107,I=60108,T=60114,j=60109,N=60110,A=60112,P=60113,O=60120,_=60115,R=60116,M=60121,L=60128,U=60129,D=60130,F=60131;if("function"==typeof Symbol&&Symbol.for){var z=Symbol.for;S=z("react.element"),C=z("react.portal"),E=z("react.fragment"),I=z("react.strict_mode"),T=z("react.profiler"),j=z("react.provider"),N=z("react.context"),A=z("react.forward_ref"),P=z("react.suspense"),O=z("react.suspense_list"),_=z("react.memo"),R=z("react.lazy"),M=z("react.block"),z("react.scope"),L=z("react.opaque.id"),U=z("react.debug_trace_mode"),D=z("react.offscreen"),F=z("react.legacy_hidden")}var $,B="function"==typeof Symbol&&Symbol.iterator;function H(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=B&&e[B]||e["@@iterator"])?e:null}function q(e){if(void 0===$)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);$=t&&t[1]||""}return"\n"+$+e}var W=!1;function V(e,t){if(!e||W)return"";W=!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 o=e.stack.split("\n"),a=r.stack.split("\n"),i=o.length-1,l=a.length-1;1<=i&&0<=l&&o[i]!==a[l];)l--;for(;1<=i&&0<=l;i--,l--)if(o[i]!==a[l]){if(1!==i||1!==l)do{if(i--,0>--l||o[i]!==a[l])return"\n"+o[i].replace(" at new "," at ")}while(1<=i&&0<=l);break}}}finally{W=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?q(e):""}function G(e){switch(e.tag){case 5:return q(e.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return V(e.type,!1);case 11:return V(e.type.render,!1);case 22:return V(e.type._render,!1);case 1:return V(e.type,!0);default:return""}}function K(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 E:return"Fragment";case C:return"Portal";case T:return"Profiler";case I:return"StrictMode";case P:return"Suspense";case O:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case N:return(e.displayName||"Context")+".Consumer";case j:return(e._context.displayName||"Context")+".Provider";case A:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case _:return K(e.type);case M:return K(e._render);case R:t=e._payload,e=e._init;try{return K(e(t))}catch(e){}}return null}function Q(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function Y(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Z(e){e._valueTracker||(e._valueTracker=function(e){var t=Y(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 o=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,a.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 X(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Y(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 ee(e,t){var n=t.checked;return a({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function te(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=Q(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 ne(e,t){null!=(t=t.checked)&&k(e,"checked",t,!1)}function re(e,t){ne(e,t);var n=Q(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")?ae(e,t.type,n):t.hasOwnProperty("defaultValue")&&ae(e,t.type,Q(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function oe(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 ae(e,t,n){"number"===t&&J(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function ie(e,t){return e=a({children:void 0},t),(t=function(e){var t="";return o.Children.forEach(e,function(e){null!=e&&(t+=e)}),t}(t.children))&&(e.children=t),e}function le(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Q(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function se(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(l(91));return a({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ce(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(l(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(l(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:Q(n)}}function ue(e,t){var n=Q(t.value),r=Q(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 de(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var pe="http://www.w3.org/1999/xhtml";function fe(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?fe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var me,ge,ye=(ge=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"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 ge(e,t)})}:ge);function ve(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 ke(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 xe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=ke(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(be).forEach(function(e){we.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),be[t]=be[e]})});var Se=a({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 Ce(e,t){if(t){if(Se[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(l(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(l(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(l(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(l(62))}}function Ee(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 Ie(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Te=null,je=null,Ne=null;function Ae(e){if(e=ro(e)){if("function"!=typeof Te)throw Error(l(280));var t=e.stateNode;t&&(t=ao(t),Te(e.stateNode,e.type,t))}}function Pe(e){je?Ne?Ne.push(e):Ne=[e]:je=e}function Oe(){if(je){var e=je,t=Ne;if(Ne=je=null,Ae(e),t)for(e=0;e<t.length;e++)Ae(t[e])}}function _e(e,t){return e(t)}function Re(e,t,n,r,o){return e(t,n,r,o)}function Me(){}var Le=_e,Ue=!1,De=!1;function Fe(){null===je&&null===Ne||(Me(),Oe())}function ze(e,t){var n=e.stateNode;if(null===n)return null;var r=ao(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(l(231,t,typeof n));return n}var $e=!1;if(p)try{var Be={};Object.defineProperty(Be,"passive",{get:function(){$e=!0}}),window.addEventListener("test",Be,Be),window.removeEventListener("test",Be,Be)}catch(ge){$e=!1}function He(e,t,n,r,o,a,i,l,s){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this.onError(e)}}var qe=!1,We=null,Ve=!1,Ge=null,Ke={onError:function(e){qe=!0,We=e}};function Qe(e,t,n,r,o,a,i,l,s){qe=!1,We=null,He.apply(Ke,arguments)}function Ye(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Ze(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 Xe(e){if(Ye(e)!==e)throw Error(l(188))}function Je(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ye(e)))throw Error(l(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var a=o.alternate;if(null===a){if(null!==(r=o.return)){n=r;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===n)return Xe(o),e;if(a===r)return Xe(o),t;a=a.sibling}throw Error(l(188))}if(n.return!==r.return)n=o,r=a;else{for(var i=!1,s=o.child;s;){if(s===n){i=!0,n=o,r=a;break}if(s===r){i=!0,r=o,n=a;break}s=s.sibling}if(!i){for(s=a.child;s;){if(s===n){i=!0,n=a,r=o;break}if(s===r){i=!0,r=a,n=o;break}s=s.sibling}if(!i)throw Error(l(189))}}if(n.alternate!==r)throw Error(l(190))}if(3!==n.tag)throw Error(l(188));return n.stateNode.current===n?e:t}(e),!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,ot,at=!1,it=[],lt=null,st=null,ct=null,ut=new Map,dt=new Map,pt=[],ft="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,o){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:o,targetContainers:[r]}}function mt(e,t){switch(e){case"focusin":case"focusout":lt=null;break;case"dragenter":case"dragleave":st=null;break;case"mouseover":case"mouseout":ct=null;break;case"pointerover":case"pointerout":ut.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":dt.delete(t.pointerId)}}function gt(e,t,n,r,o,a){return null===e||e.nativeEvent!==a?(e=ht(t,n,r,o,a),null!==t&&null!==(t=ro(t))&&nt(t),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function yt(e){var t=no(e.target);if(null!==t){var n=Ye(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Ze(n)))return e.blockedOn=t,void ot(e.lanePriority,function(){i.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 vt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Jt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ro(n))&&nt(t),e.blockedOn=n,!1;t.shift()}return!0}function bt(e,t,n){vt(e)&&n.delete(t)}function wt(){for(at=!1;0<it.length;){var e=it[0];if(null!==e.blockedOn){null!==(e=ro(e.blockedOn))&&tt(e);break}for(var t=e.targetContainers;0<t.length;){var n=Jt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&it.shift()}null!==lt&&vt(lt)&&(lt=null),null!==st&&vt(st)&&(st=null),null!==ct&&vt(ct)&&(ct=null),ut.forEach(bt),dt.forEach(bt)}function kt(e,t){e.blockedOn===t&&(e.blockedOn=null,at||(at=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,wt)))}function xt(e){function t(t){return kt(t,e)}if(0<it.length){kt(it[0],e);for(var n=1;n<it.length;n++){var r=it[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==lt&&kt(lt,e),null!==st&&kt(st,e),null!==ct&&kt(ct,e),ut.forEach(t),dt.forEach(t),n=0;n<pt.length;n++)(r=pt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<pt.length&&null===(n=pt[0]).blockedOn;)yt(n),null===n.blockedOn&&pt.shift()}function St(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ct={animationend:St("Animation","AnimationEnd"),animationiteration:St("Animation","AnimationIteration"),animationstart:St("Animation","AnimationStart"),transitionend:St("Transition","TransitionEnd")},Et={},It={};function Tt(e){if(Et[e])return Et[e];if(!Ct[e])return e;var t,n=Ct[e];for(t in n)if(n.hasOwnProperty(t)&&t in It)return Et[e]=n[t];return e}p&&(It=document.createElement("div").style,"AnimationEvent"in window||(delete Ct.animationend.animation,delete Ct.animationiteration.animation,delete Ct.animationstart.animation),"TransitionEvent"in window||delete Ct.transitionend.transition);var jt=Tt("animationend"),Nt=Tt("animationiteration"),At=Tt("animationstart"),Pt=Tt("transitionend"),Ot=new Map,_t=new Map,Rt=["abort","abort",jt,"animationEnd",Nt,"animationIteration",At,"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",Pt,"transitionEnd","waiting","waiting"];function Mt(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],o=e[n+1];o="on"+(o[0].toUpperCase()+o.slice(1)),_t.set(r,t),Ot.set(r,o),u(o,[r])}}(0,i.unstable_now)();var Lt=8;function Ut(e){if(1&e)return Lt=15,1;if(2&e)return Lt=14,2;if(4&e)return Lt=13,4;var t=24&e;return 0!==t?(Lt=12,t):32&e?(Lt=11,32):0!=(t=192&e)?(Lt=10,t):256&e?(Lt=9,256):0!=(t=3584&e)?(Lt=8,t):4096&e?(Lt=7,4096):0!=(t=4186112&e)?(Lt=6,t):0!=(t=62914560&e)?(Lt=5,t):67108864&e?(Lt=4,67108864):134217728&e?(Lt=3,134217728):0!=(t=805306368&e)?(Lt=2,t):1073741824&e?(Lt=1,1073741824):(Lt=8,e)}function Dt(e,t){var n=e.pendingLanes;if(0===n)return Lt=0;var r=0,o=0,a=e.expiredLanes,i=e.suspendedLanes,l=e.pingedLanes;if(0!==a)r=a,o=Lt=15;else if(0!=(a=134217727&n)){var s=a&~i;0!==s?(r=Ut(s),o=Lt):0!==(l&=a)&&(r=Ut(l),o=Lt)}else 0!==(a=n&~i)?(r=Ut(a),o=Lt):0!==l&&(r=Ut(l),o=Lt);if(0===r)return 0;if(r=n&((0>(r=31-qt(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0===(t&i)){if(Ut(t),o<=Lt)return t;Lt=o}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)o=1<<(n=31-qt(t)),r|=e[n],t&=~o;return r}function Ft(e){return 0!=(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function zt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=$t(24&~t))?zt(10,t):e;case 10:return 0===(e=$t(192&~t))?zt(8,t):e;case 8:return 0===(e=$t(3584&~t))&&0===(e=$t(4186112&~t))&&(e=512),e;case 2:return 0===(t=$t(805306368&~t))&&(t=268435456),t}throw Error(l(358,e))}function $t(e){return e&-e}function Bt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ht(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-qt(t)]=n}var qt=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Wt(e)/Vt|0)|0},Wt=Math.log,Vt=Math.LN2,Gt=i.unstable_UserBlockingPriority,Kt=i.unstable_runWithPriority,Qt=!0;function Yt(e,t,n,r){Ue||Me();var o=Xt,a=Ue;Ue=!0;try{Re(o,e,t,n,r)}finally{(Ue=a)||Fe()}}function Zt(e,t,n,r){Kt(Gt,Xt.bind(null,e,t,n,r))}function Xt(e,t,n,r){var o;if(Qt)if((o=!(4&t))&&0<it.length&&-1<ft.indexOf(e))e=ht(null,e,t,n,r),it.push(e);else{var a=Jt(e,t,n,r);if(null===a)o&&mt(e,r);else{if(o){if(-1<ft.indexOf(e))return e=ht(a,e,t,n,r),void it.push(e);if(function(e,t,n,r,o){switch(t){case"focusin":return lt=gt(lt,e,t,n,r,o),!0;case"dragenter":return st=gt(st,e,t,n,r,o),!0;case"mouseover":return ct=gt(ct,e,t,n,r,o),!0;case"pointerover":var a=o.pointerId;return ut.set(a,gt(ut.get(a)||null,e,t,n,r,o)),!0;case"gotpointercapture":return a=o.pointerId,dt.set(a,gt(dt.get(a)||null,e,t,n,r,o)),!0}return!1}(a,e,t,n,r))return;mt(e,r)}Mr(e,t,r,null,n)}}}function Jt(e,t,n,r){var o=Ie(r);if(null!==(o=no(o))){var a=Ye(o);if(null===a)o=null;else{var i=a.tag;if(13===i){if(null!==(o=Ze(a)))return o;o=null}else if(3===i){if(a.stateNode.hydrate)return 3===a.tag?a.stateNode.containerInfo:null;o=null}else a!==o&&(o=null)}}return Mr(e,t,r,o,n),null}var en=null,tn=null,nn=null;function rn(){if(nn)return nn;var e,t,n=tn,r=n.length,o="value"in en?en.value:en.textContent,a=o.length;for(e=0;e<r&&n[e]===o[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===o[a-t];t++);return nn=o.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 ln(){return!1}function sn(e){function t(t,n,r,o,a){for(var i in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(i)&&(t=e[i],this[i]=t?t(o):o[i]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?an:ln,this.isPropagationStopped=ln,this}return a(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 cn,un,dn,pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fn=sn(pn),hn=a({},pn,{view:0,detail:0}),mn=sn(hn),gn=a({},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?(cn=e.screenX-dn.screenX,un=e.screenY-dn.screenY):un=cn=0,dn=e),cn)},movementY:function(e){return"movementY"in e?e.movementY:un}}),yn=sn(gn),vn=sn(a({},gn,{dataTransfer:0})),bn=sn(a({},hn,{relatedTarget:0})),wn=sn(a({},pn,{animationName:0,elapsedTime:0,pseudoElement:0})),kn=a({},pn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xn=sn(kn),Sn=sn(a({},pn,{data:0})),Cn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},En={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"},In={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=In[e])&&!!t[e]}function jn(){return Tn}var Nn=a({},hn,{key:function(e){if(e.key){var t=Cn[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?En[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}}),An=sn(Nn),Pn=sn(a({},gn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),On=sn(a({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jn})),_n=sn(a({},pn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Rn=a({},gn,{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}),Mn=sn(Rn),Ln=[9,13,27,32],Un=p&&"CompositionEvent"in window,Dn=null;p&&"documentMode"in document&&(Dn=document.documentMode);var Fn=p&&"TextEvent"in window&&!Dn,zn=p&&(!Un||Dn&&8<Dn&&11>=Dn),$n=String.fromCharCode(32),Bn=!1;function Hn(e,t){switch(e){case"keyup":return-1!==Ln.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Wn=!1,Vn={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 Gn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Vn[e.type]:"textarea"===t}function Kn(e,t,n,r){Pe(r),0<(t=Ur(t,"onChange")).length&&(n=new fn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Qn=null,Yn=null;function Zn(e){Nr(e,0)}function Xn(e){if(X(oo(e)))return e}function Jn(e,t){if("change"===e)return t}var er=!1;if(p){var tr;if(p){var nr="oninput"in document;if(!nr){var rr=document.createElement("div");rr.setAttribute("oninput","return;"),nr="function"==typeof rr.oninput}tr=nr}else tr=!1;er=tr&&(!document.documentMode||9<document.documentMode)}function or(){Qn&&(Qn.detachEvent("onpropertychange",ar),Yn=Qn=null)}function ar(e){if("value"===e.propertyName&&Xn(Yn)){var t=[];if(Kn(t,Yn,e,Ie(e)),e=Zn,Ue)e(t);else{Ue=!0;try{_e(e,t)}finally{Ue=!1,Fe()}}}}function ir(e,t,n){"focusin"===e?(or(),Yn=n,(Qn=t).attachEvent("onpropertychange",ar)):"focusout"===e&&or()}function lr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Xn(Yn)}function sr(e,t){if("click"===e)return Xn(t)}function cr(e,t){if("input"===e||"change"===e)return Xn(t)}var ur="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},dr=Object.prototype.hasOwnProperty;function pr(e,t){if(ur(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(!dr.call(t,n[r])||!ur(e[n[r]],t[n[r]]))return!1;return!0}function fr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hr(e,t){var n,r=fr(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=fr(r)}}function mr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?mr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function gr(){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 yr(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 vr=p&&"documentMode"in document&&11>=document.documentMode,br=null,wr=null,kr=null,xr=!1;function Sr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;xr||null==br||br!==J(r)||(r="selectionStart"in(r=br)&&yr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},kr&&pr(kr,r)||(kr=r,0<(r=Ur(wr,"onSelect")).length&&(t=new fn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=br)))}Mt("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),Mt("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),Mt(Rt,2);for(var Cr="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Er=0;Er<Cr.length;Er++)_t.set(Cr[Er],0);d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("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 Ir="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Tr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ir));function jr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,o,a,i,s,c){if(Qe.apply(this,arguments),qe){if(!qe)throw Error(l(198));var u=We;qe=!1,We=null,Ve||(Ve=!0,Ge=u)}}(r,t,void 0,e),e.currentTarget=null}function Nr(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],s=l.instance,c=l.currentTarget;if(l=l.listener,s!==a&&o.isPropagationStopped())break e;jr(o,l,c),a=s}else for(i=0;i<r.length;i++){if(s=(l=r[i]).instance,c=l.currentTarget,l=l.listener,s!==a&&o.isPropagationStopped())break e;jr(o,l,c),a=s}}}if(Ve)throw e=Ge,Ve=!1,Ge=null,e}function Ar(e,t){var n=io(t),r=e+"__bubble";n.has(r)||(Rr(t,e,2,!1),n.add(r))}var Pr="_reactListening"+Math.random().toString(36).slice(2);function Or(e){e[Pr]||(e[Pr]=!0,s.forEach(function(t){Tr.has(t)||_r(t,!1,e,null),_r(t,!0,e,null)}))}function _r(e,t,n,r){var o=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,a=n;if("selectionchange"===e&&9!==n.nodeType&&(a=n.ownerDocument),null!==r&&!t&&Tr.has(e)){if("scroll"!==e)return;o|=2,a=r}var i=io(a),l=e+"__"+(t?"capture":"bubble");i.has(l)||(t&&(o|=4),Rr(a,e,o,t),i.add(l))}function Rr(e,t,n,r){var o=_t.get(t);switch(void 0===o?2:o){case 0:o=Yt;break;case 1:o=Zt;break;default:o=Xt}n=o.bind(null,t,n,e),o=void 0,!$e||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Mr(e,t,n,r,o){var a=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var i=r.tag;if(3===i||4===i){var l=r.stateNode.containerInfo;if(l===o||8===l.nodeType&&l.parentNode===o)break;if(4===i)for(i=r.return;null!==i;){var s=i.tag;if((3===s||4===s)&&((s=i.stateNode.containerInfo)===o||8===s.nodeType&&s.parentNode===o))return;i=i.return}for(;null!==l;){if(null===(i=no(l)))return;if(5===(s=i.tag)||6===s){r=a=i;continue e}l=l.parentNode}}r=r.return}!function(e,t,n){if(De)return e();De=!0;try{return Le(e,t,n)}finally{De=!1,Fe()}}(function(){var r=a,o=Ie(n),i=[];e:{var l=Ot.get(e);if(void 0!==l){var s=fn,c=e;switch(e){case"keypress":if(0===on(n))break e;case"keydown":case"keyup":s=An;break;case"focusin":c="focus",s=bn;break;case"focusout":c="blur",s=bn;break;case"beforeblur":case"afterblur":s=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":s=yn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":s=vn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":s=On;break;case jt:case Nt:case At:s=wn;break;case Pt:s=_n;break;case"scroll":s=mn;break;case"wheel":s=Mn;break;case"copy":case"cut":case"paste":s=xn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":s=Pn}var u=!!(4&t),d=!u&&"scroll"===e,p=u?null!==l?l+"Capture":null:l;u=[];for(var f,h=r;null!==h;){var m=(f=h).stateNode;if(5===f.tag&&null!==m&&(f=m,null!==p&&null!=(m=ze(h,p))&&u.push(Lr(h,m,f))),d)break;h=h.return}0<u.length&&(l=new s(l,c,null,n,o),i.push({event:l,listeners:u}))}}if(!(7&t)){if(s="mouseout"===e||"pointerout"===e,(!(l="mouseover"===e||"pointerover"===e)||16&t||!(c=n.relatedTarget||n.fromElement)||!no(c)&&!c[eo])&&(s||l)&&(l=o.window===o?o:(l=o.ownerDocument)?l.defaultView||l.parentWindow:window,s?(s=r,null!==(c=(c=n.relatedTarget||n.toElement)?no(c):null)&&(c!==(d=Ye(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(s=null,c=r),s!==c)){if(u=yn,m="onMouseLeave",p="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(u=Pn,m="onPointerLeave",p="onPointerEnter",h="pointer"),d=null==s?l:oo(s),f=null==c?l:oo(c),(l=new u(m,h+"leave",s,n,o)).target=d,l.relatedTarget=f,m=null,no(o)===r&&((u=new u(p,h+"enter",c,n,o)).target=f,u.relatedTarget=d,m=u),d=m,s&&c)e:{for(p=c,h=0,f=u=s;f;f=Dr(f))h++;for(f=0,m=p;m;m=Dr(m))f++;for(;0<h-f;)u=Dr(u),h--;for(;0<f-h;)p=Dr(p),f--;for(;h--;){if(u===p||null!==p&&u===p.alternate)break e;u=Dr(u),p=Dr(p)}u=null}else u=null;null!==s&&Fr(i,l,s,u,!1),null!==c&&null!==d&&Fr(i,d,c,u,!0)}if("select"===(s=(l=r?oo(r):window).nodeName&&l.nodeName.toLowerCase())||"input"===s&&"file"===l.type)var g=Jn;else if(Gn(l))if(er)g=cr;else{g=lr;var y=ir}else(s=l.nodeName)&&"input"===s.toLowerCase()&&("checkbox"===l.type||"radio"===l.type)&&(g=sr);switch(g&&(g=g(e,r))?Kn(i,g,n,o):(y&&y(e,l,r),"focusout"===e&&(y=l._wrapperState)&&y.controlled&&"number"===l.type&&ae(l,"number",l.value)),y=r?oo(r):window,e){case"focusin":(Gn(y)||"true"===y.contentEditable)&&(br=y,wr=r,kr=null);break;case"focusout":kr=wr=br=null;break;case"mousedown":xr=!0;break;case"contextmenu":case"mouseup":case"dragend":xr=!1,Sr(i,n,o);break;case"selectionchange":if(vr)break;case"keydown":case"keyup":Sr(i,n,o)}var v;if(Un)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?Hn(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(zn&&"ko"!==n.locale&&(Wn||"onCompositionStart"!==b?"onCompositionEnd"===b&&Wn&&(v=rn()):(tn="value"in(en=o)?en.value:en.textContent,Wn=!0)),0<(y=Ur(r,b)).length&&(b=new Sn(b,e,null,n,o),i.push({event:b,listeners:y}),(v||null!==(v=qn(n)))&&(b.data=v))),(v=Fn?function(e,t){switch(e){case"compositionend":return qn(t);case"keypress":return 32!==t.which?null:(Bn=!0,$n);case"textInput":return(e=t.data)===$n&&Bn?null:e;default:return null}}(e,n):function(e,t){if(Wn)return"compositionend"===e||!Un&&Hn(e,t)?(e=rn(),nn=tn=en=null,Wn=!1,e):null;switch(e){case"paste":default: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 zn&&"ko"!==t.locale?null:t.data}}(e,n))&&0<(r=Ur(r,"onBeforeInput")).length&&(o=new Sn("onBeforeInput","beforeinput",null,n,o),i.push({event:o,listeners:r}),o.data=v)}Nr(i,t)})}function Lr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ur(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,a=o.stateNode;5===o.tag&&null!==a&&(o=a,null!=(a=ze(e,n))&&r.unshift(Lr(e,a,o)),null!=(a=ze(e,t))&&r.push(Lr(e,a,o))),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 Fr(e,t,n,r,o){for(var a=t._reactName,i=[];null!==n&&n!==r;){var l=n,s=l.alternate,c=l.stateNode;if(null!==s&&s===r)break;5===l.tag&&null!==c&&(l=c,o?null!=(s=ze(n,a))&&i.unshift(Lr(n,s,l)):o||null!=(s=ze(n,a))&&i.push(Lr(n,s,l))),n=n.return}0!==i.length&&e.push({event:t,listeners:i})}function zr(){}var $r=null,Br=null;function Hr(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function qr(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,Vr="function"==typeof clearTimeout?clearTimeout:void 0;function Gr(e){(1===e.nodeType||9===e.nodeType&&null!=(e=e.body))&&(e.textContent="")}function Kr(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 Yr=0,Zr=Math.random().toString(36).slice(2),Xr="__reactFiber$"+Zr,Jr="__reactProps$"+Zr,eo="__reactContainer$"+Zr,to="__reactEvents$"+Zr;function no(e){var t=e[Xr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[eo]||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 ro(e){return!(e=e[Xr]||e[eo])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function oo(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(l(33))}function ao(e){return e[Jr]||null}function io(e){var t=e[to];return void 0===t&&(t=e[to]=new Set),t}var lo=[],so=-1;function co(e){return{current:e}}function uo(e){0>so||(e.current=lo[so],lo[so]=null,so--)}function po(e,t){so++,lo[so]=e.current,e.current=t}var fo={},ho=co(fo),mo=co(!1),go=fo;function yo(e,t){var n=e.type.contextTypes;if(!n)return fo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,a={};for(o in n)a[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function vo(e){return null!==(e=e.childContextTypes)&&void 0!==e}function bo(){uo(mo),uo(ho)}function wo(e,t,n){if(ho.current!==fo)throw Error(l(168));po(ho,t),po(mo,n)}function ko(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(l(108,K(t)||"Unknown",o));return a({},n,r)}function xo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fo,go=ho.current,po(ho,e),po(mo,mo.current),!0}function So(e,t,n){var r=e.stateNode;if(!r)throw Error(l(169));n?(e=ko(e,t,go),r.__reactInternalMemoizedMergedChildContext=e,uo(mo),uo(ho),po(ho,e)):uo(mo),po(mo,n)}var Co=null,Eo=null,Io=i.unstable_runWithPriority,To=i.unstable_scheduleCallback,jo=i.unstable_cancelCallback,No=i.unstable_shouldYield,Ao=i.unstable_requestPaint,Po=i.unstable_now,Oo=i.unstable_getCurrentPriorityLevel,_o=i.unstable_ImmediatePriority,Ro=i.unstable_UserBlockingPriority,Mo=i.unstable_NormalPriority,Lo=i.unstable_LowPriority,Uo=i.unstable_IdlePriority,Do={},Fo=void 0!==Ao?Ao:function(){},zo=null,$o=null,Bo=!1,Ho=Po(),qo=1e4>Ho?Po:function(){return Po()-Ho};function Wo(){switch(Oo()){case _o:return 99;case Ro:return 98;case Mo:return 97;case Lo:return 96;case Uo:return 95;default:throw Error(l(332))}}function Vo(e){switch(e){case 99:return _o;case 98:return Ro;case 97:return Mo;case 96:return Lo;case 95:return Uo;default:throw Error(l(332))}}function Go(e,t){return e=Vo(e),Io(e,t)}function Ko(e,t,n){return e=Vo(e),To(e,t,n)}function Qo(){if(null!==$o){var e=$o;$o=null,jo(e)}Yo()}function Yo(){if(!Bo&&null!==zo){Bo=!0;var e=0;try{var t=zo;Go(99,function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}}),zo=null}catch(t){throw null!==zo&&(zo=zo.slice(e+1)),To(_o,Qo),t}finally{Bo=!1}}}var Zo=x.ReactCurrentBatchConfig;function Xo(e,t){if(e&&e.defaultProps){for(var n in t=a({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var Jo=co(null),ea=null,ta=null,na=null;function ra(){na=ta=ea=null}function oa(e){var t=Jo.current;uo(Jo),e.type._context._currentValue=t}function aa(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 ia(e,t){ea=e,na=ta=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(Ui=!0),e.firstContext=null)}function la(e,t){if(na!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(na=e,t=1073741823),t={context:e,observedBits:t,next:null},null===ta){if(null===ea)throw Error(l(308));ta=t,ea.dependencies={lanes:0,firstContext:t,responders:null}}else ta=ta.next=t;return e._currentValue}var sa=!1;function ca(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function ua(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 da(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function pa(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 fa(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?o=a=i:a=a.next=i,n=n.next}while(null!==n);null===a?o=a=t:a=a.next=t}else o=a=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:a,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ha(e,t,n,r){var o=e.updateQueue;sa=!1;var i=o.firstBaseUpdate,l=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var c=s,u=c.next;c.next=null,null===l?i=u:l.next=u,l=c;var d=e.alternate;if(null!==d){var p=(d=d.updateQueue).lastBaseUpdate;p!==l&&(null===p?d.firstBaseUpdate=u:p.next=u,d.lastBaseUpdate=c)}}if(null!==i){for(p=o.baseState,l=0,d=u=c=null;;){s=i.lane;var f=i.eventTime;if((r&s)===s){null!==d&&(d=d.next={eventTime:f,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var h=e,m=i;switch(s=t,f=n,m.tag){case 1:if("function"==typeof(h=m.payload)){p=h.call(f,p,s);break e}p=h;break e;case 3:h.flags=-4097&h.flags|64;case 0:if(null===(s="function"==typeof(h=m.payload)?h.call(f,p,s):h)||void 0===s)break e;p=a({},p,s);break e;case 2:sa=!0}}null!==i.callback&&(e.flags|=32,null===(s=o.effects)?o.effects=[i]:s.push(i))}else f={eventTime:f,lane:s,tag:i.tag,payload:i.payload,callback:i.callback,next:null},null===d?(u=d=f,c=p):d=d.next=f,l|=s;if(null===(i=i.next)){if(null===(s=o.shared.pending))break;i=s.next,s.next=null,o.lastBaseUpdate=s,o.shared.pending=null}}null===d&&(c=p),o.baseState=c,o.firstBaseUpdate=u,o.lastBaseUpdate=d,Fl|=l,e.lanes=l,e.memoizedState=p}}function ma(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(null!==o){if(r.callback=null,r=n,"function"!=typeof o)throw Error(l(191,o));o.call(r)}}}var ga=(new o.Component).refs;function ya(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:a({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var va={isMounted:function(e){return!!(e=e._reactInternals)&&Ye(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=us(),o=ds(e),a=da(r,o);a.payload=t,null!=n&&(a.callback=n),pa(e,a),ps(e,o,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=us(),o=ds(e),a=da(r,o);a.tag=1,a.payload=t,null!=n&&(a.callback=n),pa(e,a),ps(e,o,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=us(),r=ds(e),o=da(n,r);o.tag=2,null!=t&&(o.callback=t),pa(e,o),ps(e,r,n)}};function ba(e,t,n,r,o,a,i){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,i):!(t.prototype&&t.prototype.isPureReactComponent&&pr(n,r)&&pr(o,a))}function wa(e,t,n){var r=!1,o=fo,a=t.contextType;return"object"==typeof a&&null!==a?a=la(a):(o=vo(t)?go:ho.current,a=(r=null!==(r=t.contextTypes)&&void 0!==r)?yo(e,o):fo),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=va,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=a),t}function ka(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&&va.enqueueReplaceState(t,t.state,null)}function xa(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=ga,ca(e);var a=t.contextType;"object"==typeof a&&null!==a?o.context=la(a):(a=vo(t)?go:ho.current,o.context=yo(e,a)),ha(e,n,o,r),o.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(ya(e,t,a,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&va.enqueueReplaceState(o,o.state,null),ha(e,n,o,r),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.flags|=4)}var Sa=Array.isArray;function Ca(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(l(309));var r=n.stateNode}if(!r)throw Error(l(147,e));var o=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===o?t.ref:(t=function(e){var t=r.refs;t===ga&&(t=r.refs={}),null===e?delete t[o]:t[o]=e},t._stringRef=o,t)}if("string"!=typeof e)throw Error(l(284));if(!n._owner)throw Error(l(290,e))}return e}function Ea(e,t){if("textarea"!==e.type)throw Error(l(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function Ia(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 o(e,t){return(e=qs(e,t)).index=0,e.sibling=null,e}function a(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 i(t){return e&&null===t.alternate&&(t.flags=2),t}function s(e,t,n,r){return null===t||6!==t.tag?((t=Ks(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function c(e,t,n,r){return null!==t&&t.elementType===n.type?((r=o(t,n.props)).ref=Ca(e,t,n),r.return=e,r):((r=Ws(n.type,n.key,n.props,null,e.mode,r)).ref=Ca(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Qs(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function d(e,t,n,r,a){return null===t||7!==t.tag?((t=Vs(n,e.mode,r,a)).return=e,t):((t=o(t,n)).return=e,t)}function p(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Ks(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case S:return(n=Ws(t.type,t.key,t.props,null,e.mode,n)).ref=Ca(e,null,t),n.return=e,n;case C:return(t=Qs(t,e.mode,n)).return=e,t}if(Sa(t)||H(t))return(t=Vs(t,e.mode,n,null)).return=e,t;Ea(e,t)}return null}function f(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==o?null:s(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case S:return n.key===o?n.type===E?d(e,t,n.props.children,r,o):c(e,t,n,r):null;case C:return n.key===o?u(e,t,n,r):null}if(Sa(n)||H(n))return null!==o?null:d(e,t,n,r,null);Ea(e,n)}return null}function h(e,t,n,r,o){if("string"==typeof r||"number"==typeof r)return s(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case S:return e=e.get(null===r.key?n:r.key)||null,r.type===E?d(t,e,r.props.children,o,r.key):c(t,e,r,o);case C:return u(t,e=e.get(null===r.key?n:r.key)||null,r,o)}if(Sa(r)||H(r))return d(t,e=e.get(n)||null,r,o,null);Ea(t,r)}return null}function m(o,i,l,s){for(var c=null,u=null,d=i,m=i=0,g=null;null!==d&&m<l.length;m++){d.index>m?(g=d,d=null):g=d.sibling;var y=f(o,d,l[m],s);if(null===y){null===d&&(d=g);break}e&&d&&null===y.alternate&&t(o,d),i=a(y,i,m),null===u?c=y:u.sibling=y,u=y,d=g}if(m===l.length)return n(o,d),c;if(null===d){for(;m<l.length;m++)null!==(d=p(o,l[m],s))&&(i=a(d,i,m),null===u?c=d:u.sibling=d,u=d);return c}for(d=r(o,d);m<l.length;m++)null!==(g=h(d,o,m,l[m],s))&&(e&&null!==g.alternate&&d.delete(null===g.key?m:g.key),i=a(g,i,m),null===u?c=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(o,e)}),c}function g(o,i,s,c){var u=H(s);if("function"!=typeof u)throw Error(l(150));if(null==(s=u.call(s)))throw Error(l(151));for(var d=u=null,m=i,g=i=0,y=null,v=s.next();null!==m&&!v.done;g++,v=s.next()){m.index>g?(y=m,m=null):y=m.sibling;var b=f(o,m,v.value,c);if(null===b){null===m&&(m=y);break}e&&m&&null===b.alternate&&t(o,m),i=a(b,i,g),null===d?u=b:d.sibling=b,d=b,m=y}if(v.done)return n(o,m),u;if(null===m){for(;!v.done;g++,v=s.next())null!==(v=p(o,v.value,c))&&(i=a(v,i,g),null===d?u=v:d.sibling=v,d=v);return u}for(m=r(o,m);!v.done;g++,v=s.next())null!==(v=h(m,o,g,v.value,c))&&(e&&null!==v.alternate&&m.delete(null===v.key?g:v.key),i=a(v,i,g),null===d?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(o,e)}),u}return function(e,r,a,s){var c="object"==typeof a&&null!==a&&a.type===E&&null===a.key;c&&(a=a.props.children);var u="object"==typeof a&&null!==a;if(u)switch(a.$$typeof){case S:e:{for(u=a.key,c=r;null!==c;){if(c.key===u){if(7===c.tag){if(a.type===E){n(e,c.sibling),(r=o(c,a.props.children)).return=e,e=r;break e}}else if(c.elementType===a.type){n(e,c.sibling),(r=o(c,a.props)).ref=Ca(e,c,a),r.return=e,e=r;break e}n(e,c);break}t(e,c),c=c.sibling}a.type===E?((r=Vs(a.props.children,e.mode,s,a.key)).return=e,e=r):((s=Ws(a.type,a.key,a.props,null,e.mode,s)).ref=Ca(e,r,a),s.return=e,e=s)}return i(e);case C:e:{for(c=a.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),(r=o(r,a.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Qs(a,e.mode,s)).return=e,e=r}return i(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==r&&6===r.tag?(n(e,r.sibling),(r=o(r,a)).return=e,e=r):(n(e,r),(r=Ks(a,e.mode,s)).return=e,e=r),i(e);if(Sa(a))return m(e,r,a,s);if(H(a))return g(e,r,a,s);if(u&&Ea(e,a),void 0===a&&!c)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(l(152,K(e.type)||"Component"))}return n(e,r)}}var Ta=Ia(!0),ja=Ia(!1),Na={},Aa=co(Na),Pa=co(Na),Oa=co(Na);function _a(e){if(e===Na)throw Error(l(174));return e}function Ra(e,t){switch(po(Oa,t),po(Pa,e),po(Aa,Na),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)}uo(Aa),po(Aa,t)}function Ma(){uo(Aa),uo(Pa),uo(Oa)}function La(e){_a(Oa.current);var t=_a(Aa.current),n=he(t,e.type);t!==n&&(po(Pa,e),po(Aa,n))}function Ua(e){Pa.current===e&&(uo(Aa),uo(Pa))}var Da=co(0);function Fa(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(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 za=null,$a=null,Ba=!1;function Ha(e,t){var n=Bs(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 qa(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);default:return!1}}function Wa(e){if(Ba){var t=$a;if(t){var n=t;if(!qa(e,t)){if(!(t=Kr(n.nextSibling))||!qa(e,t))return e.flags=-1025&e.flags|2,Ba=!1,void(za=e);Ha(za,n)}za=e,$a=Kr(t.firstChild)}else e.flags=-1025&e.flags|2,Ba=!1,za=e}}function Va(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;za=e}function Ga(e){if(e!==za)return!1;if(!Ba)return Va(e),Ba=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!qr(t,e.memoizedProps))for(t=$a;t;)Ha(e,t),t=Kr(t.nextSibling);if(Va(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(l(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){$a=Kr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}$a=null}}else $a=za?Kr(e.stateNode.nextSibling):null;return!0}function Ka(){$a=za=null,Ba=!1}var Qa=[];function Ya(){for(var e=0;e<Qa.length;e++)Qa[e]._workInProgressVersionPrimary=null;Qa.length=0}var Za=x.ReactCurrentDispatcher,Xa=x.ReactCurrentBatchConfig,Ja=0,ei=null,ti=null,ni=null,ri=!1,oi=!1;function ai(){throw Error(l(321))}function ii(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ur(e[n],t[n]))return!1;return!0}function li(e,t,n,r,o,a){if(Ja=a,ei=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Za.current=null===e||null===e.memoizedState?_i:Ri,e=n(r,o),oi){a=0;do{if(oi=!1,!(25>a))throw Error(l(301));a+=1,ni=ti=null,t.updateQueue=null,Za.current=Mi,e=n(r,o)}while(oi)}if(Za.current=Oi,t=null!==ti&&null!==ti.next,Ja=0,ni=ti=ei=null,ri=!1,t)throw Error(l(300));return e}function si(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ni?ei.memoizedState=ni=e:ni=ni.next=e,ni}function ci(){if(null===ti){var e=ei.alternate;e=null!==e?e.memoizedState:null}else e=ti.next;var t=null===ni?ei.memoizedState:ni.next;if(null!==t)ni=t,ti=e;else{if(null===e)throw Error(l(310));e={memoizedState:(ti=e).memoizedState,baseState:ti.baseState,baseQueue:ti.baseQueue,queue:ti.queue,next:null},null===ni?ei.memoizedState=ni=e:ni=ni.next=e}return ni}function ui(e,t){return"function"==typeof t?t(e):t}function di(e){var t=ci(),n=t.queue;if(null===n)throw Error(l(311));n.lastRenderedReducer=e;var r=ti,o=r.baseQueue,a=n.pending;if(null!==a){if(null!==o){var i=o.next;o.next=a.next,a.next=i}r.baseQueue=o=a,n.pending=null}if(null!==o){o=o.next,r=r.baseState;var s=i=a=null,c=o;do{var u=c.lane;if((Ja&u)===u)null!==s&&(s=s.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),r=c.eagerReducer===e?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===s?(i=s=d,a=r):s=s.next=d,ei.lanes|=u,Fl|=u}c=c.next}while(null!==c&&c!==o);null===s?a=r:s.next=i,ur(r,t.memoizedState)||(Ui=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=s,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function pi(e){var t=ci(),n=t.queue;if(null===n)throw Error(l(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,a=t.memoizedState;if(null!==o){n.pending=null;var i=o=o.next;do{a=e(a,i.action),i=i.next}while(i!==o);ur(a,t.memoizedState)||(Ui=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function fi(e,t,n){var r=t._getVersion;r=r(t._source);var o=t._workInProgressVersionPrimary;if(null!==o?e=o===r:(e=e.mutableReadLanes,(e=(Ja&e)===e)&&(t._workInProgressVersionPrimary=r,Qa.push(t))),e)return n(t._source);throw Qa.push(t),Error(l(350))}function hi(e,t,n,r){var o=Pl;if(null===o)throw Error(l(349));var a=t._getVersion,i=a(t._source),s=Za.current,c=s.useState(function(){return fi(o,t,n)}),u=c[1],d=c[0];c=ni;var p=e.memoizedState,f=p.refs,h=f.getSnapshot,m=p.source;p=p.subscribe;var g=ei;return e.memoizedState={refs:f,source:t,subscribe:r},s.useEffect(function(){f.getSnapshot=n,f.setSnapshot=u;var e=a(t._source);if(!ur(i,e)){e=n(t._source),ur(d,e)||(u(e),e=ds(g),o.mutableReadLanes|=e&o.pendingLanes),e=o.mutableReadLanes,o.entangledLanes|=e;for(var r=o.entanglements,l=e;0<l;){var s=31-qt(l),c=1<<s;r[s]|=e,l&=~c}}},[n,t,r]),s.useEffect(function(){return r(t._source,function(){var e=f.getSnapshot,n=f.setSnapshot;try{n(e(t._source));var r=ds(g);o.mutableReadLanes|=r&o.pendingLanes}catch(e){n(function(){throw e})}})},[t,r]),ur(h,n)&&ur(m,t)&&ur(p,r)||((e={pending:null,dispatch:null,lastRenderedReducer:ui,lastRenderedState:d}).dispatch=u=Pi.bind(null,ei,e),c.queue=e,c.baseQueue=null,d=fi(o,t,n),c.memoizedState=c.baseState=d),d}function mi(e,t,n){return hi(ci(),e,t,n)}function gi(e){var t=si();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:ui,lastRenderedState:e}).dispatch=Pi.bind(null,ei,e),[t.memoizedState,e]}function yi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ei.updateQueue)?(t={lastEffect:null},ei.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 vi(e){return e={current:e},si().memoizedState=e}function bi(){return ci().memoizedState}function wi(e,t,n,r){var o=si();ei.flags|=e,o.memoizedState=yi(1|t,n,void 0,void 0===r?null:r)}function ki(e,t,n,r){var o=ci();r=void 0===r?null:r;var a=void 0;if(null!==ti){var i=ti.memoizedState;if(a=i.destroy,null!==r&&ii(r,i.deps))return void yi(t,n,a,r)}ei.flags|=e,o.memoizedState=yi(1|t,n,a,r)}function xi(e,t){return wi(516,4,e,t)}function Si(e,t){return ki(516,4,e,t)}function Ci(e,t){return ki(4,2,e,t)}function Ei(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 Ii(e,t,n){return n=null!=n?n.concat([e]):null,ki(4,2,Ei.bind(null,t,e),n)}function Ti(){}function ji(e,t){var n=ci();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ii(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ni(e,t){var n=ci();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ii(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ai(e,t){var n=Wo();Go(98>n?98:n,function(){e(!0)}),Go(97<n?97:n,function(){var n=Xa.transition;Xa.transition=1;try{e(!1),t()}finally{Xa.transition=n}})}function Pi(e,t,n){var r=us(),o=ds(e),a={lane:o,action:n,eagerReducer:null,eagerState:null,next:null},i=t.pending;if(null===i?a.next=a:(a.next=i.next,i.next=a),t.pending=a,i=e.alternate,e===ei||null!==i&&i===ei)oi=ri=!0;else{if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var l=t.lastRenderedState,s=i(l,n);if(a.eagerReducer=i,a.eagerState=s,ur(s,l))return}catch(e){}ps(e,o,r)}}var Oi={readContext:la,useCallback:ai,useContext:ai,useEffect:ai,useImperativeHandle:ai,useLayoutEffect:ai,useMemo:ai,useReducer:ai,useRef:ai,useState:ai,useDebugValue:ai,useDeferredValue:ai,useTransition:ai,useMutableSource:ai,useOpaqueIdentifier:ai,unstable_isNewReconciler:!1},_i={readContext:la,useCallback:function(e,t){return si().memoizedState=[e,void 0===t?null:t],e},useContext:la,useEffect:xi,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,wi(4,2,Ei.bind(null,t,e),n)},useLayoutEffect:function(e,t){return wi(4,2,e,t)},useMemo:function(e,t){var n=si();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=si();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=Pi.bind(null,ei,e),[r.memoizedState,e]},useRef:vi,useState:gi,useDebugValue:Ti,useDeferredValue:function(e){var t=gi(e),n=t[0],r=t[1];return xi(function(){var t=Xa.transition;Xa.transition=1;try{r(e)}finally{Xa.transition=t}},[e]),n},useTransition:function(){var e=gi(!1),t=e[0];return vi(e=Ai.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=si();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},hi(r,e,t,n)},useOpaqueIdentifier:function(){if(Ba){var e=!1,t=function(e){return{$$typeof:L,toString:e,valueOf:e}}(function(){throw e||(e=!0,n("r:"+(Yr++).toString(36))),Error(l(355))}),n=gi(t)[1];return!(2&ei.mode)&&(ei.flags|=516,yi(5,function(){n("r:"+(Yr++).toString(36))},void 0,null)),t}return gi(t="r:"+(Yr++).toString(36)),t},unstable_isNewReconciler:!1},Ri={readContext:la,useCallback:ji,useContext:la,useEffect:Si,useImperativeHandle:Ii,useLayoutEffect:Ci,useMemo:Ni,useReducer:di,useRef:bi,useState:function(){return di(ui)},useDebugValue:Ti,useDeferredValue:function(e){var t=di(ui),n=t[0],r=t[1];return Si(function(){var t=Xa.transition;Xa.transition=1;try{r(e)}finally{Xa.transition=t}},[e]),n},useTransition:function(){var e=di(ui)[0];return[bi().current,e]},useMutableSource:mi,useOpaqueIdentifier:function(){return di(ui)[0]},unstable_isNewReconciler:!1},Mi={readContext:la,useCallback:ji,useContext:la,useEffect:Si,useImperativeHandle:Ii,useLayoutEffect:Ci,useMemo:Ni,useReducer:pi,useRef:bi,useState:function(){return pi(ui)},useDebugValue:Ti,useDeferredValue:function(e){var t=pi(ui),n=t[0],r=t[1];return Si(function(){var t=Xa.transition;Xa.transition=1;try{r(e)}finally{Xa.transition=t}},[e]),n},useTransition:function(){var e=pi(ui)[0];return[bi().current,e]},useMutableSource:mi,useOpaqueIdentifier:function(){return pi(ui)[0]},unstable_isNewReconciler:!1},Li=x.ReactCurrentOwner,Ui=!1;function Di(e,t,n,r){t.child=null===e?ja(t,null,n,r):Ta(t,e.child,n,r)}function Fi(e,t,n,r,o){n=n.render;var a=t.ref;return ia(t,o),r=li(e,t,n,r,a,o),null===e||Ui?(t.flags|=1,Di(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~o,rl(e,t,o))}function zi(e,t,n,r,o,a){if(null===e){var i=n.type;return"function"!=typeof i||Hs(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Ws(n.type,null,r,t,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,$i(e,t,i,r,o,a))}return i=e.child,0===(o&a)&&(o=i.memoizedProps,(n=null!==(n=n.compare)?n:pr)(o,r)&&e.ref===t.ref)?rl(e,t,a):(t.flags|=1,(e=qs(i,r)).ref=t.ref,e.return=t,t.child=e)}function $i(e,t,n,r,o,a){if(null!==e&&pr(e.memoizedProps,r)&&e.ref===t.ref){if(Ui=!1,0===(a&o))return t.lanes=e.lanes,rl(e,t,a);16384&e.flags&&(Ui=!0)}return qi(e,t,n,r,a)}function Bi(e,t,n){var r=t.pendingProps,o=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(4&t.mode){if(!(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},ws(t,e),null;t.memoizedState={baseLanes:0},ws(t,null!==a?a.baseLanes:n)}else t.memoizedState={baseLanes:0},ws(t,n);else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,ws(t,r);return Di(e,t,o,n),t.child}function Hi(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function qi(e,t,n,r,o){var a=vo(n)?go:ho.current;return a=yo(t,a),ia(t,o),n=li(e,t,n,r,a,o),null===e||Ui?(t.flags|=1,Di(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~o,rl(e,t,o))}function Wi(e,t,n,r,o){if(vo(n)){var a=!0;xo(t)}else a=!1;if(ia(t,o),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),wa(t,n,r),xa(t,n,r,o),r=!0;else if(null===e){var i=t.stateNode,l=t.memoizedProps;i.props=l;var s=i.context,c=n.contextType;c="object"==typeof c&&null!==c?la(c):yo(t,c=vo(n)?go:ho.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof i.getSnapshotBeforeUpdate;d||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(l!==r||s!==c)&&ka(t,i,r,c),sa=!1;var p=t.memoizedState;i.state=p,ha(t,r,i,o),s=t.memoizedState,l!==r||p!==s||mo.current||sa?("function"==typeof u&&(ya(t,n,u,r),s=t.memoizedState),(l=sa||ba(t,n,l,r,p,s,c))?(d||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||("function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"==typeof i.componentDidMount&&(t.flags|=4)):("function"==typeof i.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=s),i.props=r,i.state=s,i.context=c,r=l):("function"==typeof i.componentDidMount&&(t.flags|=4),r=!1)}else{i=t.stateNode,ua(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:Xo(t.type,l),i.props=c,d=t.pendingProps,p=i.context,s="object"==typeof(s=n.contextType)&&null!==s?la(s):yo(t,s=vo(n)?go:ho.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(l!==d||p!==s)&&ka(t,i,r,s),sa=!1,p=t.memoizedState,i.state=p,ha(t,r,i,o);var h=t.memoizedState;l!==d||p!==h||mo.current||sa?("function"==typeof f&&(ya(t,n,f,r),h=t.memoizedState),(c=sa||ba(t,n,c,r,p,h,s))?(u||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(r,h,s),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(r,h,s)),"function"==typeof i.componentDidUpdate&&(t.flags|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof i.componentDidUpdate||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=h),i.props=r,i.state=h,i.context=s,r=c):("function"!=typeof i.componentDidUpdate||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=256),r=!1)}return Vi(e,t,n,r,a,o)}function Vi(e,t,n,r,o,a){Hi(e,t);var i=!!(64&t.flags);if(!r&&!i)return o&&So(t,n,!1),rl(e,t,a);r=t.stateNode,Li.current=t;var l=i&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&i?(t.child=Ta(t,e.child,null,a),t.child=Ta(t,null,l,a)):Di(e,t,l,a),t.memoizedState=r.state,o&&So(t,n,!0),t.child}function Gi(e){var t=e.stateNode;t.pendingContext?wo(0,t.pendingContext,t.pendingContext!==t.context):t.context&&wo(0,t.context,!1),Ra(e,t.containerInfo)}var Ki,Qi,Yi,Zi={dehydrated:null,retryLane:0};function Xi(e,t,n){var r,o=t.pendingProps,a=Da.current,i=!1;return(r=!!(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&!!(2&a)),r?(i=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===o.fallback||!0===o.unstable_avoidThisFallback||(a|=1),po(Da,1&a),null===e?(void 0!==o.fallback&&Wa(t),e=o.children,a=o.fallback,i?(e=Ji(t,e,a,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Zi,e):"number"==typeof o.unstable_expectedLoadTime?(e=Ji(t,e,a,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Zi,t.lanes=33554432,e):((n=Gs({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,i?(o=function(e,t,n,r,o){var a=t.mode,i=e.child;e=i.sibling;var l={mode:"hidden",children:n};return 2&a||t.child===i?n=qs(i,l):((n=t.child).childLanes=0,n.pendingProps=l,null!==(i=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=i,i.nextEffect=null):t.firstEffect=t.lastEffect=null),null!==e?r=qs(e,r):(r=Vs(r,a,o,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}(e,t,o.children,o.fallback,n),i=t.child,a=e.child.memoizedState,i.memoizedState=null===a?{baseLanes:n}:{baseLanes:a.baseLanes|n},i.childLanes=e.childLanes&~n,t.memoizedState=Zi,o):(n=function(e,t,n,r){var o=e.child;return e=o.sibling,n=qs(o,{mode:"visible",children:n}),!(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}(e,t,o.children,n),t.memoizedState=null,n))}function Ji(e,t,n,r){var o=e.mode,a=e.child;return t={mode:"hidden",children:t},2&o||null===a?a=Gs(t,o,0,null):(a.childLanes=0,a.pendingProps=t),n=Vs(n,o,r,null),a.return=e,n.return=e,a.sibling=n,e.child=a,n}function el(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),aa(e.return,t)}function tl(e,t,n,r,o,a){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o,lastEffect:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o,i.lastEffect=a)}function nl(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;if(Di(e,t,r.children,n),2&(r=Da.current))r=1&r|2,t.flags|=64;else{if(null!==e&&64&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&el(e,n);else if(19===e.tag)el(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(po(Da,r),2&t.mode)switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===Fa(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),tl(t,!1,o,n,a,t.lastEffect);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===Fa(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}tl(t,!0,n,null,a,t.lastEffect);break;case"together":tl(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function rl(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Fl|=t.lanes,0!==(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(l(153));if(null!==t.child){for(n=qs(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=qs(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function ol(e,t){if(!Ba)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 al(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:case 17:return vo(t.type)&&bo(),null;case 3:return Ma(),uo(mo),uo(ho),Ya(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Ga(t)?t.flags|=4:r.hydrate||(t.flags|=256)),null;case 5:Ua(t);var o=_a(Oa.current);if(n=t.type,null!==e&&null!=t.stateNode)Qi(e,t,n,r),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(l(166));return null}if(e=_a(Aa.current),Ga(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Xr]=t,r[Jr]=i,n){case"dialog":Ar("cancel",r),Ar("close",r);break;case"iframe":case"object":case"embed":Ar("load",r);break;case"video":case"audio":for(e=0;e<Ir.length;e++)Ar(Ir[e],r);break;case"source":Ar("error",r);break;case"img":case"image":case"link":Ar("error",r),Ar("load",r);break;case"details":Ar("toggle",r);break;case"input":te(r,i),Ar("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Ar("invalid",r);break;case"textarea":ce(r,i),Ar("invalid",r)}for(var s in Ce(n,i),e=null,i)i.hasOwnProperty(s)&&(o=i[s],"children"===s?"string"==typeof o?r.textContent!==o&&(e=["children",o]):"number"==typeof o&&r.textContent!==""+o&&(e=["children",""+o]):c.hasOwnProperty(s)&&null!=o&&"onScroll"===s&&Ar("scroll",r));switch(n){case"input":Z(r),oe(r,i,!0);break;case"textarea":Z(r),de(r);break;case"select":case"option":break;default:"function"==typeof i.onClick&&(r.onclick=zr)}r=e,t.updateQueue=r,null!==r&&(t.flags|=4)}else{switch(s=9===o.nodeType?o:o.ownerDocument,e===pe&&(e=fe(n)),e===pe?"script"===n?((e=s.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),"select"===n&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Xr]=t,e[Jr]=r,Ki(e,t),t.stateNode=e,s=Ee(n,r),n){case"dialog":Ar("cancel",e),Ar("close",e),o=r;break;case"iframe":case"object":case"embed":Ar("load",e),o=r;break;case"video":case"audio":for(o=0;o<Ir.length;o++)Ar(Ir[o],e);o=r;break;case"source":Ar("error",e),o=r;break;case"img":case"image":case"link":Ar("error",e),Ar("load",e),o=r;break;case"details":Ar("toggle",e),o=r;break;case"input":te(e,r),o=ee(e,r),Ar("invalid",e);break;case"option":o=ie(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=a({},r,{value:void 0}),Ar("invalid",e);break;case"textarea":ce(e,r),o=se(e,r),Ar("invalid",e);break;default:o=r}Ce(n,o);var u=o;for(i in u)if(u.hasOwnProperty(i)){var d=u[i];"style"===i?xe(e,d):"dangerouslySetInnerHTML"===i?null!=(d=d?d.__html:void 0)&&ye(e,d):"children"===i?"string"==typeof d?("textarea"!==n||""!==d)&&ve(e,d):"number"==typeof d&&ve(e,""+d):"suppressContentEditableWarning"!==i&&"suppressHydrationWarning"!==i&&"autoFocus"!==i&&(c.hasOwnProperty(i)?null!=d&&"onScroll"===i&&Ar("scroll",e):null!=d&&k(e,i,d,s))}switch(n){case"input":Z(e),oe(e,r,!1);break;case"textarea":Z(e),de(e);break;case"option":null!=r.value&&e.setAttribute("value",""+Q(r.value));break;case"select":e.multiple=!!r.multiple,null!=(i=r.value)?le(e,!!r.multiple,i,!1):null!=r.defaultValue&&le(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof o.onClick&&(e.onclick=zr)}Hr(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)Yi(0,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(l(166));n=_a(Oa.current),_a(Aa.current),Ga(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 uo(Da),r=t.memoizedState,64&t.flags?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&Ga(t):n=null!==e.memoizedState,r&&!n&&!!(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||1&Da.current?0===Ll&&(Ll=3):(0!==Ll&&3!==Ll||(Ll=4),null===Pl||!(134217727&Fl)&&!(134217727&zl)||gs(Pl,_l))),(r||n)&&(t.flags|=4),null);case 4:return Ma(),null===e&&Or(t.stateNode.containerInfo),null;case 10:return oa(t),null;case 19:if(uo(Da),null===(r=t.memoizedState))return null;if(i=!!(64&t.flags),null===(s=r.rendering))if(i)ol(r,!1);else{if(0!==Ll||null!==e&&64&e.flags)for(e=t.child;null!==e;){if(null!==(s=Fa(e))){for(t.flags|=64,ol(r,!1),null!==(i=s.updateQueue)&&(t.updateQueue=i,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=n,n=t.child;null!==n;)e=r,(i=n).flags&=2,i.nextEffect=null,i.firstEffect=null,i.lastEffect=null,null===(s=i.alternate)?(i.childLanes=0,i.lanes=e,i.child=null,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return po(Da,1&Da.current|2),t.child}e=e.sibling}null!==r.tail&&qo()>ql&&(t.flags|=64,i=!0,ol(r,!1),t.lanes=33554432)}else{if(!i)if(null!==(e=Fa(s))){if(t.flags|=64,i=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),ol(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!Ba)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*qo()-r.renderingStartTime>ql&&1073741824!==n&&(t.flags|=64,i=!0,ol(r,!1),t.lanes=33554432);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(n=r.last)?n.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=qo(),n.sibling=null,t=Da.current,po(Da,i?1&t|2:1&t),n):null;case 23:case 24:return ks(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(l(156,t.tag))}function il(e){switch(e.tag){case 1:vo(e.type)&&bo();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Ma(),uo(mo),uo(ho),Ya(),64&(t=e.flags))throw Error(l(285));return e.flags=-4097&t|64,e;case 5:return Ua(e),null;case 13:return uo(Da),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return uo(Da),null;case 4:return Ma(),null;case 10:return oa(e),null;case 23:case 24:return ks(),null;default:return null}}function ll(e,t){try{var n="",r=t;do{n+=G(r),r=r.return}while(r);var o=n}catch(e){o="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:o}}function sl(e,t){try{r.error(t.value)}catch(e){setTimeout(function(){throw e})}}Ki=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}},Qi=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,_a(Aa.current);var i,l=null;switch(n){case"input":o=ee(e,o),r=ee(e,r),l=[];break;case"option":o=ie(e,o),r=ie(e,r),l=[];break;case"select":o=a({},o,{value:void 0}),r=a({},r,{value:void 0}),l=[];break;case"textarea":o=se(e,o),r=se(e,r),l=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=zr)}for(d in Ce(n,r),n=null,o)if(!r.hasOwnProperty(d)&&o.hasOwnProperty(d)&&null!=o[d])if("style"===d){var s=o[d];for(i in s)s.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else"dangerouslySetInnerHTML"!==d&&"children"!==d&&"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&"autoFocus"!==d&&(c.hasOwnProperty(d)?l||(l=[]):(l=l||[]).push(d,null));for(d in r){var u=r[d];if(s=null!=o?o[d]:void 0,r.hasOwnProperty(d)&&u!==s&&(null!=u||null!=s))if("style"===d)if(s){for(i in s)!s.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&s[i]!==u[i]&&(n||(n={}),n[i]=u[i])}else n||(l||(l=[]),l.push(d,n)),n=u;else"dangerouslySetInnerHTML"===d?(u=u?u.__html:void 0,s=s?s.__html:void 0,null!=u&&s!==u&&(l=l||[]).push(d,u)):"children"===d?"string"!=typeof u&&"number"!=typeof u||(l=l||[]).push(d,""+u):"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&(c.hasOwnProperty(d)?(null!=u&&"onScroll"===d&&Ar("scroll",e),l||s===u||(l=[])):"object"==typeof u&&null!==u&&u.$$typeof===L?u.toString():(l=l||[]).push(d,u))}n&&(l=l||[]).push("style",n);var d=l;(t.updateQueue=d)&&(t.flags|=4)}},Yi=function(e,t,n,r){n!==r&&(t.flags|=4)};var cl="function"==typeof WeakMap?WeakMap:Map;function ul(e,t,n){(n=da(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Kl||(Kl=!0,Ql=r),sl(0,t)},n}function dl(e,t,n){(n=da(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return sl(0,t),r(o)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Yl?Yl=new Set([this]):Yl.add(this),sl(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var pl="function"==typeof WeakSet?WeakSet:Set;function fl(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){Ds(e,t)}else t.current=null}function hl(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17: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:Xo(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&Gr(t.stateNode.containerInfo))}throw Error(l(163))}function ml(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&~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 o=e;r=o.next,!!(4&(o=o.tag))&&!!(1&o)&&(Ms(n,e),Rs(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:Xo(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&ma(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:case 1:e=n.child.stateNode}ma(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&Hr(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&xt(n)))))}throw Error(l(163))}function gl(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 o=n.memoizedProps.style;o=null!=o&&o.hasOwnProperty("display")?o.display:null,r.style.display=ke("display",o)}}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 yl(e,t){if(Eo&&"function"==typeof Eo.onCommitFiberUnmount)try{Eo.onCommitFiberUnmount(Co,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,o=r.destroy;if(r=r.tag,void 0!==o)if(4&r)Ms(t,n);else{r=t;try{o()}catch(e){Ds(r,e)}}n=n.next}while(n!==e)}break;case 1:if(fl(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(e){Ds(t,e)}break;case 5:fl(t);break;case 4:Sl(e,t)}}function vl(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 bl(e){return 5===e.tag||3===e.tag||4===e.tag}function wl(e){e:{for(var t=e.return;null!==t;){if(bl(t))break e;t=t.return}throw Error(l(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(l(161))}16&n.flags&&(ve(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||bl(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?kl(e,n,t):xl(e,n,t)}function kl(e,t,n){var r=e.tag,o=5===r||6===r;if(o)e=o?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)&&void 0!==n||null!==t.onclick||(t.onclick=zr));else if(4!==r&&null!==(e=e.child))for(kl(e,t,n),e=e.sibling;null!==e;)kl(e,t,n),e=e.sibling}function xl(e,t,n){var r=e.tag,o=5===r||6===r;if(o)e=o?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(xl(e,t,n),e=e.sibling;null!==e;)xl(e,t,n),e=e.sibling}function Sl(e,t){for(var n,r,o=t,a=!1;;){if(!a){a=o.return;e:for(;;){if(null===a)throw Error(l(160));switch(n=a.stateNode,a.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}a=a.return}a=!0}if(5===o.tag||6===o.tag){e:for(var i=e,s=o,c=s;;)if(yl(i,c),null!==c.child&&4!==c.tag)c.child.return=c,c=c.child;else{if(c===s)break e;for(;null===c.sibling;){if(null===c.return||c.return===s)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}r?(i=n,s=o.stateNode,8===i.nodeType?i.parentNode.removeChild(s):i.removeChild(s)):n.removeChild(o.stateNode)}else if(4===o.tag){if(null!==o.child){n=o.stateNode.containerInfo,r=!0,o.child.return=o,o=o.child;continue}}else if(yl(e,o),null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;4===(o=o.return).tag&&(a=!1)}o.sibling.return=o.return,o=o.sibling}}function Cl(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&~r.tag)&&(e=r.destroy,r.destroy=void 0,void 0!==e&&e()),r=r.next}while(r!==n)}return;case 1:case 12:case 17:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var o=null!==e?e.memoizedProps:r;e=t.type;var a=t.updateQueue;if(t.updateQueue=null,null!==a){for(n[Jr]=r,"input"===e&&"radio"===r.type&&null!=r.name&&ne(n,r),Ee(e,o),t=Ee(e,r),o=0;o<a.length;o+=2){var i=a[o],s=a[o+1];"style"===i?xe(n,s):"dangerouslySetInnerHTML"===i?ye(n,s):"children"===i?ve(n,s):k(n,i,s,t)}switch(e){case"input":re(n,r);break;case"textarea":ue(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(a=r.value)?le(n,!!r.multiple,a,!1):e!==!!r.multiple&&(null!=r.defaultValue?le(n,!!r.multiple,r.defaultValue,!0):le(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(l(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,xt(n.containerInfo)));case 13:return null!==t.memoizedState&&(Hl=qo(),gl(t.child,!0)),void El(t);case 19:return void El(t);case 23:case 24:return void gl(t,null!==t.memoizedState)}throw Error(l(163))}function El(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new pl),t.forEach(function(t){var r=zs.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Il(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&null!==(t=t.memoizedState)&&null===t.dehydrated}var Tl=Math.ceil,jl=x.ReactCurrentDispatcher,Nl=x.ReactCurrentOwner,Al=0,Pl=null,Ol=null,_l=0,Rl=0,Ml=co(0),Ll=0,Ul=null,Dl=0,Fl=0,zl=0,$l=0,Bl=null,Hl=0,ql=1/0;function Wl(){ql=qo()+500}var Vl,Gl=null,Kl=!1,Ql=null,Yl=null,Zl=!1,Xl=null,Jl=90,es=[],ts=[],ns=null,rs=0,os=null,as=-1,is=0,ls=0,ss=null,cs=!1;function us(){return 48&Al?qo():-1!==as?as:as=qo()}function ds(e){if(!(2&(e=e.mode)))return 1;if(!(4&e))return 99===Wo()?1:2;if(0===is&&(is=Dl),0!==Zo.transition){0!==ls&&(ls=null!==Bl?Bl.pendingLanes:0),e=is;var t=4186112&~ls;return 0===(t&=-t)&&0==(t=(e=4186112&~e)&-e)&&(t=8192),t}return e=Wo(),e=zt(4&Al&&98===e?12: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),is)}function ps(e,t,n){if(50<rs)throw rs=0,os=null,Error(l(185));if(null===(e=fs(e,t)))return null;Ht(e,t,n),e===Pl&&(zl|=t,4===Ll&&gs(e,_l));var r=Wo();1===t?8&Al&&!(48&Al)?ys(e):(hs(e,n),0===Al&&(Wl(),Qo())):(!(4&Al)||98!==r&&99!==r||(null===ns?ns=new Set([e]):ns.add(e)),hs(e,n)),Bl=e}function fs(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 hs(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,o=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-qt(i),c=1<<s,u=a[s];if(-1===u){if(0===(c&r)||0!==(c&o)){u=t,Ut(c);var d=Lt;a[s]=10<=d?u+250:6<=d?u+5e3:-1}}else u<=t&&(e.expiredLanes|=c);i&=~c}if(r=Dt(e,e===Pl?_l:0),t=Lt,0===r)null!==n&&(n!==Do&&jo(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Do&&jo(n)}15===t?(n=ys.bind(null,e),null===zo?(zo=[n],$o=To(_o,Yo)):zo.push(n),n=Do):14===t?n=Ko(99,ys.bind(null,e)):(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(l(358,e))}}(t),n=Ko(n,ms.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function ms(e){if(as=-1,ls=is=0,48&Al)throw Error(l(327));var t=e.callbackNode;if(_s()&&e.callbackNode!==t)return null;var n=Dt(e,e===Pl?_l:0);if(0===n)return null;var r=n,o=Al;Al|=16;var a=Cs();for(Pl===e&&_l===r||(Wl(),xs(e,r));;)try{Ts();break}catch(t){Ss(e,t)}if(ra(),jl.current=a,Al=o,null!==Ol?r=0:(Pl=null,_l=0,r=Ll),0!==(Dl&zl))xs(e,0);else if(0!==r){if(2===r&&(Al|=64,e.hydrate&&(e.hydrate=!1,Gr(e.containerInfo)),0!==(n=Ft(e))&&(r=Es(e,n))),1===r)throw t=Ul,xs(e,0),gs(e,n),hs(e,qo()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(l(345));case 2:case 5:As(e);break;case 3:if(gs(e,n),(62914560&n)===n&&10<(r=Hl+500-qo())){if(0!==Dt(e,0))break;if(((o=e.suspendedLanes)&n)!==n){us(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Wr(As.bind(null,e),r);break}As(e);break;case 4:if(gs(e,n),(4186112&n)===n)break;for(r=e.eventTimes,o=-1;0<n;){var i=31-qt(n);a=1<<i,(i=r[i])>o&&(o=i),n&=~a}if(n=o,10<(n=(120>(n=qo()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Tl(n/1960))-n)){e.timeoutHandle=Wr(As.bind(null,e),n);break}As(e);break;default:throw Error(l(329))}}return hs(e,qo()),e.callbackNode===t?ms.bind(null,e):null}function gs(e,t){for(t&=~$l,t&=~zl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-qt(t),r=1<<n;e[n]=-1,t&=~r}}function ys(e){if(48&Al)throw Error(l(327));if(_s(),e===Pl&&0!==(e.expiredLanes&_l)){var t=_l,n=Es(e,t);0!==(Dl&zl)&&(n=Es(e,t=Dt(e,t)))}else n=Es(e,t=Dt(e,0));if(0!==e.tag&&2===n&&(Al|=64,e.hydrate&&(e.hydrate=!1,Gr(e.containerInfo)),0!==(t=Ft(e))&&(n=Es(e,t))),1===n)throw n=Ul,xs(e,0),gs(e,t),hs(e,qo()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,As(e),hs(e,qo()),null}function vs(e,t){var n=Al;Al|=1;try{return e(t)}finally{0===(Al=n)&&(Wl(),Qo())}}function bs(e,t){var n=Al;Al&=-2,Al|=8;try{return e(t)}finally{0===(Al=n)&&(Wl(),Qo())}}function ws(e,t){po(Ml,Rl),Rl|=t,Dl|=t}function ks(){Rl=Ml.current,uo(Ml)}function xs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Vr(n)),null!==Ol)for(n=Ol.return;null!==n;){var r=n;switch(r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&bo();break;case 3:Ma(),uo(mo),uo(ho),Ya();break;case 5:Ua(r);break;case 4:Ma();break;case 13:case 19:uo(Da);break;case 10:oa(r);break;case 23:case 24:ks()}n=n.return}Pl=e,Ol=qs(e.current,null),_l=Rl=Dl=t,Ll=0,Ul=null,$l=zl=Fl=0}function Ss(e,t){for(;;){var n=Ol;try{if(ra(),Za.current=Oi,ri){for(var r=ei.memoizedState;null!==r;){var o=r.queue;null!==o&&(o.pending=null),r=r.next}ri=!1}if(Ja=0,ni=ti=ei=null,oi=!1,Nl.current=null,null===n||null===n.return){Ll=1,Ul=t,Ol=null;break}e:{var a=e,i=n.return,l=n,s=t;if(t=_l,l.flags|=2048,l.firstEffect=l.lastEffect=null,null!==s&&"object"==typeof s&&"function"==typeof s.then){var c=s;if(!(2&l.mode)){var u=l.alternate;u?(l.updateQueue=u.updateQueue,l.memoizedState=u.memoizedState,l.lanes=u.lanes):(l.updateQueue=null,l.memoizedState=null)}var d=!!(1&Da.current),p=i;do{var f;if(f=13===p.tag){var h=p.memoizedState;if(null!==h)f=null!==h.dehydrated;else{var m=p.memoizedProps;f=void 0!==m.fallback&&(!0!==m.unstable_avoidThisFallback||!d)}}if(f){var g=p.updateQueue;if(null===g){var y=new Set;y.add(c),p.updateQueue=y}else g.add(c);if(!(2&p.mode)){if(p.flags|=64,l.flags|=16384,l.flags&=-2981,1===l.tag)if(null===l.alternate)l.tag=17;else{var v=da(-1,1);v.tag=2,pa(l,v)}l.lanes|=1;break e}s=void 0,l=t;var b=a.pingCache;if(null===b?(b=a.pingCache=new cl,s=new Set,b.set(c,s)):void 0===(s=b.get(c))&&(s=new Set,b.set(c,s)),!s.has(l)){s.add(l);var w=Fs.bind(null,a,c,l);c.then(w,w)}p.flags|=4096,p.lanes=t;break e}p=p.return}while(null!==p);s=Error((K(l.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!==Ll&&(Ll=2),s=ll(s,l),p=i;do{switch(p.tag){case 3:a=s,p.flags|=4096,t&=-t,p.lanes|=t,fa(p,ul(0,a,t));break e;case 1:a=s;var k=p.type,x=p.stateNode;if(!(64&p.flags||"function"!=typeof k.getDerivedStateFromError&&(null===x||"function"!=typeof x.componentDidCatch||null!==Yl&&Yl.has(x)))){p.flags|=4096,t&=-t,p.lanes|=t,fa(p,dl(p,a,t));break e}}p=p.return}while(null!==p)}Ns(n)}catch(e){t=e,Ol===n&&null!==n&&(Ol=n=n.return);continue}break}}function Cs(){var e=jl.current;return jl.current=Oi,null===e?Oi:e}function Es(e,t){var n=Al;Al|=16;var r=Cs();for(Pl===e&&_l===t||xs(e,t);;)try{Is();break}catch(t){Ss(e,t)}if(ra(),Al=n,jl.current=r,null!==Ol)throw Error(l(261));return Pl=null,_l=0,Ll}function Is(){for(;null!==Ol;)js(Ol)}function Ts(){for(;null!==Ol&&!No();)js(Ol)}function js(e){var t=Vl(e.alternate,e,Rl);e.memoizedProps=e.pendingProps,null===t?Ns(e):Ol=t,Nl.current=null}function Ns(e){var t=e;do{var n=t.alternate;if(e=t.return,2048&t.flags){if(null!==(n=il(t)))return n.flags&=2047,void(Ol=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(null!==(n=al(n,t,Rl)))return void(Ol=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||1073741824&Rl||!(4&n.mode)){for(var r=0,o=n.child;null!==o;)r|=o.lanes|o.childLanes,o=o.sibling;n.childLanes=r}null!==e&&!(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))}if(null!==(t=t.sibling))return void(Ol=t);Ol=t=e}while(null!==t);0===Ll&&(Ll=5)}function As(e){var t=Wo();return Go(99,Ps.bind(null,e,t)),null}function Ps(e,t){do{_s()}while(null!==Xl);if(48&Al)throw Error(l(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(l(177));e.callbackNode=null;var r=n.lanes|n.childLanes,o=r,a=e.pendingLanes&~o;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=o,e.mutableReadLanes&=o,e.entangledLanes&=o,o=e.entanglements;for(var i=e.eventTimes,s=e.expirationTimes;0<a;){var c=31-qt(a),u=1<<c;o[c]=0,i[c]=-1,s[c]=-1,a&=~u}if(null!==ns&&!(24&r)&&ns.has(e)&&ns.delete(e),e===Pl&&(Ol=Pl=null,_l=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(o=Al,Al|=32,Nl.current=null,$r=Qt,yr(i=gr())){if("selectionStart"in i)s={start:i.selectionStart,end:i.selectionEnd};else e:if(s=(s=i.ownerDocument)&&s.defaultView||window,(u=s.getSelection&&s.getSelection())&&0!==u.rangeCount){s=u.anchorNode,a=u.anchorOffset,c=u.focusNode,u=u.focusOffset;try{s.nodeType,c.nodeType}catch(e){s=null;break e}var d=0,p=-1,f=-1,h=0,m=0,g=i,y=null;t:for(;;){for(var v;g!==s||0!==a&&3!==g.nodeType||(p=d+a),g!==c||0!==u&&3!==g.nodeType||(f=d+u),3===g.nodeType&&(d+=g.nodeValue.length),null!==(v=g.firstChild);)y=g,g=v;for(;;){if(g===i)break t;if(y===s&&++h===a&&(p=d),y===c&&++m===u&&(f=d),null!==(v=g.nextSibling))break;y=(g=y).parentNode}g=v}s=-1===p||-1===f?null:{start:p,end:f}}else s=null;s=s||{start:0,end:0}}else s=null;Br={focusedElem:i,selectionRange:s},Qt=!1,ss=null,cs=!1,Gl=r;do{try{Os()}catch(e){if(null===Gl)throw Error(l(330));Ds(Gl,e),Gl=Gl.nextEffect}}while(null!==Gl);ss=null,Gl=r;do{try{for(i=e;null!==Gl;){var b=Gl.flags;if(16&b&&ve(Gl.stateNode,""),128&b){var w=Gl.alternate;if(null!==w){var k=w.ref;null!==k&&("function"==typeof k?k(null):k.current=null)}}switch(1038&b){case 2:wl(Gl),Gl.flags&=-3;break;case 6:wl(Gl),Gl.flags&=-3,Cl(Gl.alternate,Gl);break;case 1024:Gl.flags&=-1025;break;case 1028:Gl.flags&=-1025,Cl(Gl.alternate,Gl);break;case 4:Cl(Gl.alternate,Gl);break;case 8:Sl(i,s=Gl);var x=s.alternate;vl(s),null!==x&&vl(x)}Gl=Gl.nextEffect}}catch(e){if(null===Gl)throw Error(l(330));Ds(Gl,e),Gl=Gl.nextEffect}}while(null!==Gl);if(k=Br,w=gr(),b=k.focusedElem,i=k.selectionRange,w!==b&&b&&b.ownerDocument&&mr(b.ownerDocument.documentElement,b)){null!==i&&yr(b)&&(w=i.start,void 0===(k=i.end)&&(k=w),"selectionStart"in b?(b.selectionStart=w,b.selectionEnd=Math.min(k,b.value.length)):(k=(w=b.ownerDocument||document)&&w.defaultView||window).getSelection&&(k=k.getSelection(),s=b.textContent.length,x=Math.min(i.start,s),i=void 0===i.end?x:Math.min(i.end,s),!k.extend&&x>i&&(s=i,i=x,x=s),s=hr(b,x),a=hr(b,i),s&&a&&(1!==k.rangeCount||k.anchorNode!==s.node||k.anchorOffset!==s.offset||k.focusNode!==a.node||k.focusOffset!==a.offset)&&((w=w.createRange()).setStart(s.node,s.offset),k.removeAllRanges(),x>i?(k.addRange(w),k.extend(a.node,a.offset)):(w.setEnd(a.node,a.offset),k.addRange(w))))),w=[];for(k=b;k=k.parentNode;)1===k.nodeType&&w.push({element:k,left:k.scrollLeft,top:k.scrollTop});for("function"==typeof b.focus&&b.focus(),b=0;b<w.length;b++)(k=w[b]).element.scrollLeft=k.left,k.element.scrollTop=k.top}Qt=!!$r,Br=$r=null,e.current=n,Gl=r;do{try{for(b=e;null!==Gl;){var S=Gl.flags;if(36&S&&ml(b,Gl.alternate,Gl),128&S){w=void 0;var C=Gl.ref;if(null!==C){var E=Gl.stateNode;Gl.tag,w=E,"function"==typeof C?C(w):C.current=w}}Gl=Gl.nextEffect}}catch(e){if(null===Gl)throw Error(l(330));Ds(Gl,e),Gl=Gl.nextEffect}}while(null!==Gl);Gl=null,Fo(),Al=o}else e.current=n;if(Zl)Zl=!1,Xl=e,Jl=t;else for(Gl=r;null!==Gl;)t=Gl.nextEffect,Gl.nextEffect=null,8&Gl.flags&&((S=Gl).sibling=null,S.stateNode=null),Gl=t;if(0===(r=e.pendingLanes)&&(Yl=null),1===r?e===os?rs++:(rs=0,os=e):rs=0,n=n.stateNode,Eo&&"function"==typeof Eo.onCommitFiberRoot)try{Eo.onCommitFiberRoot(Co,n,void 0,!(64&~n.current.flags))}catch(e){}if(hs(e,qo()),Kl)throw Kl=!1,e=Ql,Ql=null,e;return!!(8&Al)||Qo(),null}function Os(){for(;null!==Gl;){var e=Gl.alternate;cs||null===ss||(8&Gl.flags?et(Gl,ss)&&(cs=!0):13===Gl.tag&&Il(e,Gl)&&et(Gl,ss)&&(cs=!0));var t=Gl.flags;!!(256&t)&&hl(e,Gl),!(512&t)||Zl||(Zl=!0,Ko(97,function(){return _s(),null})),Gl=Gl.nextEffect}}function _s(){if(90!==Jl){var e=97<Jl?97:Jl;return Jl=90,Go(e,Ls)}return!1}function Rs(e,t){es.push(t,e),Zl||(Zl=!0,Ko(97,function(){return _s(),null}))}function Ms(e,t){ts.push(t,e),Zl||(Zl=!0,Ko(97,function(){return _s(),null}))}function Ls(){if(null===Xl)return!1;var e=Xl;if(Xl=null,48&Al)throw Error(l(331));var t=Al;Al|=32;var n=ts;ts=[];for(var r=0;r<n.length;r+=2){var o=n[r],a=n[r+1],i=o.destroy;if(o.destroy=void 0,"function"==typeof i)try{i()}catch(e){if(null===a)throw Error(l(330));Ds(a,e)}}for(n=es,es=[],r=0;r<n.length;r+=2){o=n[r],a=n[r+1];try{var s=o.create;o.destroy=s()}catch(e){if(null===a)throw Error(l(330));Ds(a,e)}}for(s=e.current.firstEffect;null!==s;)e=s.nextEffect,s.nextEffect=null,8&s.flags&&(s.sibling=null,s.stateNode=null),s=e;return Al=t,Qo(),!0}function Us(e,t,n){pa(e,t=ul(0,t=ll(n,t),1)),t=us(),null!==(e=fs(e,1))&&(Ht(e,1,t),hs(e,t))}function Ds(e,t){if(3===e.tag)Us(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){Us(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Yl||!Yl.has(r))){var o=dl(n,e=ll(t,e),1);if(pa(n,o),o=us(),null!==(n=fs(n,1)))Ht(n,1,o),hs(n,o);else if("function"==typeof r.componentDidCatch&&(null===Yl||!Yl.has(r)))try{r.componentDidCatch(t,e)}catch(e){}break}}n=n.return}}function Fs(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=us(),e.pingedLanes|=e.suspendedLanes&n,Pl===e&&(_l&n)===n&&(4===Ll||3===Ll&&(62914560&_l)===_l&&500>qo()-Hl?xs(e,0):$l|=n),hs(e,t)}function zs(e,t){var n=e.stateNode;null!==n&&n.delete(t),0==(t=0)&&(2&(t=e.mode)?4&t?(0===is&&(is=Dl),0===(t=$t(62914560&~is))&&(t=4194304)):t=99===Wo()?1:2:t=1),n=us(),null!==(e=fs(e,t))&&(Ht(e,t,n),hs(e,n))}function $s(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 Bs(e,t,n,r){return new $s(e,t,n,r)}function Hs(e){return!(!(e=e.prototype)||!e.isReactComponent)}function qs(e,t){var n=e.alternate;return null===n?((n=Bs(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 Ws(e,t,n,r,o,a){var i=2;if(r=e,"function"==typeof e)Hs(e)&&(i=1);else if("string"==typeof e)i=5;else e:switch(e){case E:return Vs(n.children,o,a,t);case U:i=8,o|=16;break;case I:i=8,o|=1;break;case T:return(e=Bs(12,n,t,8|o)).elementType=T,e.type=T,e.lanes=a,e;case P:return(e=Bs(13,n,t,o)).type=P,e.elementType=P,e.lanes=a,e;case O:return(e=Bs(19,n,t,o)).elementType=O,e.lanes=a,e;case D:return Gs(n,o,a,t);case F:return(e=Bs(24,n,t,o)).elementType=F,e.lanes=a,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case j:i=10;break e;case N:i=9;break e;case A:i=11;break e;case _:i=14;break e;case R:i=16,r=null;break e;case M:i=22;break e}throw Error(l(130,null==e?e:typeof e,""))}return(t=Bs(i,n,t,o)).elementType=e,t.type=r,t.lanes=a,t}function Vs(e,t,n,r){return(e=Bs(7,e,r,t)).lanes=n,e}function Gs(e,t,n,r){return(e=Bs(23,e,r,t)).elementType=D,e.lanes=n,e}function Ks(e,t,n){return(e=Bs(6,e,null,t)).lanes=n,e}function Qs(e,t,n){return(t=Bs(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ys(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=Bt(0),this.expirationTimes=Bt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bt(0),this.mutableSourceEagerHydrationData=null}function Zs(e,t,n,r){var o=t.current,a=us(),i=ds(o);e:if(n){t:{if(Ye(n=n._reactInternals)!==n||1!==n.tag)throw Error(l(170));var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(vo(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);throw Error(l(171))}if(1===n.tag){var c=n.type;if(vo(c)){n=ko(n,c,s);break e}}n=s}else n=fo;return null===t.context?t.context=n:t.pendingContext=n,(t=da(a,i)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),pa(o,t),ps(o,i,a),i}function Xs(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Js(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function ec(e,t){Js(e,t),(e=e.alternate)&&Js(e,t)}function tc(e,t,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new Ys(e,t,null!=n&&!0===n.hydrate),t=Bs(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,ca(t),e[eo]=n.current,Or(8===e.nodeType?e.parentNode:e),r)for(e=0;e<r.length;e++){var o=(t=r[e])._getVersion;o=o(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,o]:n.mutableSourceEagerHydrationData.push(t,o)}this._internalRoot=n}function nc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function rc(e,t,n,r,o){var a=n._reactRootContainer;if(a){var i=a._internalRoot;if("function"==typeof o){var l=o;o=function(){var e=Xs(i);l.call(e)}}Zs(t,i,e,o)}else{if(a=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 tc(e,0,t?{hydrate:!0}:void 0)}(n,r),i=a._internalRoot,"function"==typeof o){var s=o;o=function(){var e=Xs(i);s.call(e)}}bs(function(){Zs(t,i,e,o)})}return Xs(i)}function oc(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!nc(t))throw Error(l(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:C,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)}Vl=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||mo.current)Ui=!0;else{if(0===(n&r)){switch(Ui=!1,t.tag){case 3:Gi(t),Ka();break;case 5:La(t);break;case 1:vo(t.type)&&xo(t);break;case 4:Ra(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var o=t.type._context;po(Jo,o._currentValue),o._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!==(n&t.child.childLanes)?Xi(e,t,n):(po(Da,1&Da.current),null!==(t=rl(e,t,n))?t.sibling:null);po(Da,1&Da.current);break;case 19:if(r=0!==(n&t.childLanes),64&e.flags){if(r)return nl(e,t,n);t.flags|=64}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),po(Da,Da.current),r)break;return null;case 23:case 24:return t.lanes=0,Bi(e,t,n)}return rl(e,t,n)}Ui=!!(16384&e.flags)}else Ui=!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,o=yo(t,ho.current),ia(t,n),o=li(null,t,r,e,o,n),t.flags|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,vo(r)){var a=!0;xo(t)}else a=!1;t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,ca(t);var i=r.getDerivedStateFromProps;"function"==typeof i&&ya(t,r,i,e),o.updater=va,t.stateNode=o,o._reactInternals=t,xa(t,r,e,n),t=Vi(null,t,r,!0,a,n)}else t.tag=0,Di(null,t,o,n),t=t.child;return t;case 16:o=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,o=(a=o._init)(o._payload),t.type=o,a=t.tag=function(e){if("function"==typeof e)return Hs(e)?1:0;if(null!=e){if((e=e.$$typeof)===A)return 11;if(e===_)return 14}return 2}(o),e=Xo(o,e),a){case 0:t=qi(null,t,o,e,n);break e;case 1:t=Wi(null,t,o,e,n);break e;case 11:t=Fi(null,t,o,e,n);break e;case 14:t=zi(null,t,o,Xo(o.type,e),r,n);break e}throw Error(l(306,o,""))}return t;case 0:return r=t.type,o=t.pendingProps,qi(e,t,r,o=t.elementType===r?o:Xo(r,o),n);case 1:return r=t.type,o=t.pendingProps,Wi(e,t,r,o=t.elementType===r?o:Xo(r,o),n);case 3:if(Gi(t),r=t.updateQueue,null===e||null===r)throw Error(l(282));if(r=t.pendingProps,o=null!==(o=t.memoizedState)?o.element:null,ua(e,t),ha(t,r,null,n),(r=t.memoizedState.element)===o)Ka(),t=rl(e,t,n);else{if((a=(o=t.stateNode).hydrate)&&($a=Kr(t.stateNode.containerInfo.firstChild),za=t,a=Ba=!0),a){if(null!=(e=o.mutableSourceEagerHydrationData))for(o=0;o<e.length;o+=2)(a=e[o])._workInProgressVersionPrimary=e[o+1],Qa.push(a);for(n=ja(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Di(e,t,r,n),Ka();t=t.child}return t;case 5:return La(t),null===e&&Wa(t),r=t.type,o=t.pendingProps,a=null!==e?e.memoizedProps:null,i=o.children,qr(r,o)?i=null:null!==a&&qr(r,a)&&(t.flags|=16),Hi(e,t),Di(e,t,i,n),t.child;case 6:return null===e&&Wa(t),null;case 13:return Xi(e,t,n);case 4:return Ra(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Ta(t,null,r,n):Di(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,Fi(e,t,r,o=t.elementType===r?o:Xo(r,o),n);case 7:return Di(e,t,t.pendingProps,n),t.child;case 8:case 12:return Di(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value;var s=t.type._context;if(po(Jo,s._currentValue),s._currentValue=a,null!==i)if(s=i.value,0==(a=ur(s,a)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(s,a):1073741823))){if(i.children===o.children&&!mo.current){t=rl(e,t,n);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var c=s.dependencies;if(null!==c){i=s.child;for(var u=c.firstContext;null!==u;){if(u.context===r&&0!==(u.observedBits&a)){1===s.tag&&((u=da(-1,n&-n)).tag=2,pa(s,u)),s.lanes|=n,null!==(u=s.alternate)&&(u.lanes|=n),aa(s.return,n),c.lanes|=n;break}u=u.next}}else i=10===s.tag&&s.type===t.type?null:s.child;if(null!==i)i.return=s;else for(i=s;null!==i;){if(i===t){i=null;break}if(null!==(s=i.sibling)){s.return=i.return,i=s;break}i=i.return}s=i}Di(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=(a=t.pendingProps).children,ia(t,n),r=r(o=la(o,a.unstable_observedBits)),t.flags|=1,Di(e,t,r,n),t.child;case 14:return a=Xo(o=t.type,t.pendingProps),zi(e,t,o,a=Xo(o.type,a),r,n);case 15:return $i(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Xo(r,o),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,vo(r)?(e=!0,xo(t)):e=!1,ia(t,n),wa(t,r,o),xa(t,r,o,n),Vi(null,t,r,!0,e,n);case 19:return nl(e,t,n);case 23:case 24:return Bi(e,t,n)}throw Error(l(156,t.tag))},tc.prototype.render=function(e){Zs(e,this._internalRoot,null,null)},tc.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Zs(null,e,null,function(){t[eo]=null})},tt=function(e){13===e.tag&&(ps(e,4,us()),ec(e,4))},nt=function(e){13===e.tag&&(ps(e,67108864,us()),ec(e,67108864))},rt=function(e){if(13===e.tag){var t=us(),n=ds(e);ps(e,n,t),ec(e,n)}},ot=function(e,t){return t()},Te=function(e,t,n){switch(t){case"input":if(re(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 o=ao(r);if(!o)throw Error(l(90));X(r),re(r,o)}}}break;case"textarea":ue(e,n);break;case"select":null!=(t=n.value)&&le(e,!!n.multiple,t,!1)}},_e=vs,Re=function(e,t,n,r,o){var a=Al;Al|=4;try{return Go(98,e.bind(null,t,n,r,o))}finally{0===(Al=a)&&(Wl(),Qo())}},Me=function(){!(49&Al)&&(function(){if(null!==ns){var e=ns;ns=null,e.forEach(function(e){e.expiredLanes|=24&e.pendingLanes,hs(e,qo())})}Qo()}(),_s())},Le=function(e,t){var n=Al;Al|=2;try{return e(t)}finally{0===(Al=n)&&(Wl(),Qo())}};var ac={Events:[ro,oo,ao,Pe,Oe,_s,{current:!1}]},ic={findFiberByHostInstance:no,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},lc={bundleType:ic.bundleType,version:ic.version,rendererPackageName:ic.rendererPackageName,rendererConfig:ic.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=Je(e))?null:e.stateNode},findFiberByHostInstance:ic.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var sc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sc.isDisabled&&sc.supportsFiber)try{Co=sc.inject(lc),Eo=sc}catch(ge){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ac,t.createPortal=oc,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(l(188));throw Error(l(268,Object.keys(e)))}return null===(e=Je(t))?null:e.stateNode},t.flushSync=function(e,t){var n=Al;if(48&n)return e(t);Al|=1;try{if(e)return Go(99,e.bind(null,t))}finally{Al=n,Qo()}},t.hydrate=function(e,t,n){if(!nc(t))throw Error(l(200));return rc(null,e,t,!0,n)},t.render=function(e,t,n){if(!nc(t))throw Error(l(200));return rc(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!nc(e))throw Error(l(40));return!!e._reactRootContainer&&(bs(function(){rc(null,null,e,!1,function(){e._reactRootContainer=null,e[eo]=null})}),!0)},t.unstable_batchedUpdates=vs,t.unstable_createPortal=function(e,t){return oc(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!nc(n))throw Error(l(200));if(null==e||void 0===e._reactInternals)throw Error(l(38));return rc(e,t,n,!1,r)},t.version="17.0.2"},3575(e,t,n){var r=n(5224),o=n(3705),a=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},i=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(u(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,o=r.length,a=String(e).replace(i,function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),l=r[n];n<o;l=r[++n])v(l)||!S(l)?a+=" "+l:a+=" "+u(l);return a},t.deprecate=function(e,n){if(void 0!==r&&!0===r.noDeprecation)return e;if(void 0===r)return function(){return t.deprecate(e,n).apply(this,arguments)};var a=!1;return function(){if(!a){if(r.throwDeprecation)throw new Error(n);r.traceDeprecation?o.trace(n):o.error(n),a=!0}return e.apply(this,arguments)}};var l={},s=/^$/;if({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG){var c={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG;c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+c+"$","i")}function u(e,n){var r={seen:[],stylize:p};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(n)?r.showHidden=n:n&&t._extend(r,n),k(r.showHidden)&&(r.showHidden=!1),k(r.depth)&&(r.depth=2),k(r.colors)&&(r.colors=!1),k(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=d),f(r,e,r.depth)}function d(e,t){var n=u.styles[t];return n?"["+u.colors[n][0]+"m"+e+"["+u.colors[n][1]+"m":e}function p(e,t){return e}function f(e,n,r){if(e.customInspect&&n&&I(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,e);return w(o)||(o=f(e,o,r)),o}var a=function(e,t){if(k(t))return e.stylize("undefined","undefined");if(w(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return b(t)?e.stylize(""+t,"number"):y(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}(e,n);if(a)return a;var i=Object.keys(n),l=function(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(n)),E(n)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return h(n);if(0===i.length){if(I(n)){var s=n.name?": "+n.name:"";return e.stylize("[Function"+s+"]","special")}if(x(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(C(n))return e.stylize(Date.prototype.toString.call(n),"date");if(E(n))return h(n)}var c,u="",d=!1,p=["{","}"];return g(n)&&(d=!0,p=["[","]"]),I(n)&&(u=" [Function"+(n.name?": "+n.name:"")+"]"),x(n)&&(u=" "+RegExp.prototype.toString.call(n)),C(n)&&(u=" "+Date.prototype.toUTCString.call(n)),E(n)&&(u=" "+h(n)),0!==i.length||d&&0!=n.length?r<0?x(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),c=d?function(e,t,n,r,o){for(var a=[],i=0,l=t.length;i<l;++i)A(t,String(i))?a.push(m(e,t,n,r,String(i),!0)):a.push("");return o.forEach(function(o){o.match(/^\d+$/)||a.push(m(e,t,n,r,o,!0))}),a}(e,n,r,l,i):i.map(function(t){return m(e,n,r,l,t,d)}),e.seen.pop(),function(e,t,n){var r=e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return r>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(c,u,p)):p[0]+u+p[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function m(e,t,n,r,o,a){var i,l,s;if((s=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?l=s.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):s.set&&(l=e.stylize("[Setter]","special")),A(r,o)||(i="["+o+"]"),l||(e.seen.indexOf(s.value)<0?(l=v(n)?f(e,s.value,null):f(e,s.value,n-1)).indexOf("\n")>-1&&(l=a?l.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+l.split("\n").map(function(e){return" "+e}).join("\n")):l=e.stylize("[Circular]","special")),k(i)){if(a&&o.match(/^\d+$/))return l;(i=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.slice(1,-1),i=e.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=e.stylize(i,"string"))}return i+": "+l}function g(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function v(e){return null===e}function b(e){return"number"==typeof e}function w(e){return"string"==typeof e}function k(e){return void 0===e}function x(e){return S(e)&&"[object RegExp]"===T(e)}function S(e){return"object"==typeof e&&null!==e}function C(e){return S(e)&&"[object Date]"===T(e)}function E(e){return S(e)&&("[object Error]"===T(e)||e instanceof Error)}function I(e){return"function"==typeof e}function T(e){return Object.prototype.toString.call(e)}function j(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!l[e])if(s.test(e)){var n=r.pid;l[e]=function(){var r=t.format.apply(t,arguments);o.error("%s %d: %s",e,n,r)}}else l[e]=function(){};return l[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=n(8534),t.isArray=g,t.isBoolean=y,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=w,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=k,t.isRegExp=x,t.types.isRegExp=x,t.isObject=S,t.isDate=C,t.types.isDate=C,t.isError=E,t.types.isNativeError=E,t.isFunction=I,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(6925);var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){o.log("%s - %s",function(){var e=new Date,t=[j(e.getHours()),j(e.getMinutes()),j(e.getSeconds())].join(":");return[e.getDate(),N[e.getMonth()],t].join(" ")}(),t.format.apply(t,arguments))},t.inherits=n(1596),t._extend=function(e,t){if(!t||!S(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var P="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!=typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise(function(e,r){t=e,n=r}),o=[],a=0;a<arguments.length;a++)o.push(arguments[a]);o.push(function(e,r){e?n(e):t(r)});try{e.apply(this,o)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),P&&Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,a(e))},t.promisify.custom=P,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var o=t.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var a=this,i=function(){return o.apply(a,arguments)};e.apply(this,t).then(function(e){r.nextTick(i.bind(null,null,e))},function(e){r.nextTick(O.bind(null,e,i))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,a(e)),t}},3629(e,t,n){"use strict";var r=n(6989),o=n(7375),a=o("%Function.prototype.apply%"),i=o("%Function.prototype.call%"),l=o("%Reflect.apply%",!0)||r.call(i,a),s=o("%Object.getOwnPropertyDescriptor%",!0),c=o("%Object.defineProperty%",!0),u=o("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=l(r,i,arguments);return s&&c&&s(t,"length").configurable&&c(t,"length",{value:1+u(0,e.length-(arguments.length-1))}),t};var d=function(){return l(r,a,arguments)};c?c(e.exports,"apply",{value:d}):e.exports.apply=d},3705(e,t,n){var r=n(3575),o=n(6362);function a(){return(new Date).getTime()}var i,l=Array.prototype.slice,s={};i="undefined"!=typeof globalThis&&globalThis.console?globalThis.console:"undefined"!=typeof window&&window.console?window.console:{};for(var c=[[function(){},"log"],[function(){i.log.apply(i,arguments)},"info"],[function(){i.log.apply(i,arguments)},"warn"],[function(){i.warn.apply(i,arguments)},"error"],[function(e){s[e]=a()},"time"],[function(e){var t=s[e];if(!t)throw new Error("No such label: "+e);delete s[e];var n=a()-t;i.log(e+": "+n+"ms")},"timeEnd"],[function(){var e=new Error;e.name="Trace",e.message=r.format.apply(null,arguments),i.error(e.stack)},"trace"],[function(e){i.log(r.inspect(e)+"\n")},"dir"],[function(e){if(!e){var t=l.call(arguments,1);o.ok(!1,r.format.apply(null,t))}},"assert"]],u=0;u<c.length;u++){var d=c[u],p=d[0],f=d[1];i[f]||(i[f]=p)}e.exports=i},3780(e){"use strict";e.exports=RangeError},3862(e,t,n){"use strict";var r=n(8726),o=n(7308);e.exports=function(){var e=o();return r(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},3876(e,t,n){"use strict";var r=n(630),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||o}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=f(n);o&&o!==h&&e(t,o,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var l=s(t),m=s(n),g=0;g<i.length;++g){var y=i[g];if(!(a[y]||r&&r[y]||m&&m[y]||l&&l[y])){var v=p(n,y);try{c(t,y,v)}catch(e){}}}}return t}},3887(e,t,n){"use strict";var r=n(6989),o=n(1264),a=n(3110);e.exports=function(){return a(r,o,arguments)}},4553(e,t,n){"use strict";var r=n(1555);if(r)try{r([],"length")}catch(e){r=null}e.exports=r},4960(e){"use strict";e.exports=Math.abs},4961(e,t,n){"use strict";var r=n(1e3),o=n(6405),a=n(8795),i=n(690),l=n(4553),s=n(6054),c=i("Object.prototype.toString"),u=n(5550)(),d=globalThis,p=o(),f=i("String.prototype.slice"),h=i("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},m={__proto__:null};r(p,u&&l&&s?function(e){var t=new d[e];if(Symbol.toStringTag in t&&s){var n=s(t),r=l(n,Symbol.toStringTag);if(!r&&n){var o=s(n);r=l(o,Symbol.toStringTag)}if(r&&r.get){var i=a(r.get);m["$"+e]=i}}}:function(e){var t=new d[e],n=t.slice||t.set;if(n){var r=a(n);m["$"+e]=r}}),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!u){var t=f(c(e),8,-1);return function(e){return h(p,e)>-1}(t)?t:"Object"===t&&function(e){var t=!1;return r(m,function(n,r){if(!t)try{n(e),t=f(r,1)}catch(e){}}),t}(e)}return l?function(e){var t=!1;return r(m,function(n,r){if(!t)try{"$"+n(e)===r&&(t=f(r,1))}catch(e){}}),t}(e):null}},5158(e){"use strict";e.exports=Math.pow},5224(e){var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var l,s=[],c=!1,u=-1;function d(){c&&l&&(c=!1,l.length?s=l.concat(s):u=-1,s.length&&p())}function p(){if(!c){var e=i(d);c=!0;for(var t=s.length;t;){for(l=s,s=[];++u<t;)l&&l[u].run();u=-1,t=s.length}l=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function h(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new f(e,t)),1!==s.length||c||i(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=h,r.addListener=h,r.once=h,r.off=h,r.removeListener=h,r.removeAllListeners=h,r.emit=h,r.prependListener=h,r.prependOnceListener=h,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},5266(e,t,n){"use strict";var r=n(6954);e.exports=r.getPrototypeOf||null},5550(e,t,n){"use strict";var r=n(3175);e.exports=function(){return r()&&!!Symbol.toStringTag}},5636(e,t,n){"use strict";var r=n(8898),o=60103,a=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var i=60109,l=60110,s=60112;t.Suspense=60113;var c=60115,u=60116;if("function"==typeof Symbol&&Symbol.for){var d=Symbol.for;o=d("react.element"),a=d("react.portal"),t.Fragment=d("react.fragment"),t.StrictMode=d("react.strict_mode"),t.Profiler=d("react.profiler"),i=d("react.provider"),l=d("react.context"),s=d("react.forward_ref"),t.Suspense=d("react.suspense"),c=d("react.memo"),u=d("react.lazy")}var p="function"==typeof Symbol&&Symbol.iterator;function f(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 g(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||h}function y(){}function v(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||h}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(f(85));this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=g.prototype;var b=v.prototype=new y;b.constructor=v,r(b,g.prototype),b.isPureReactComponent=!0;var w={current:null},k=Object.prototype.hasOwnProperty,x={key:!0,ref:!0,__self:!0,__source:!0};function S(e,t,n){var r,a={},i=null,l=null;if(null!=t)for(r in void 0!==t.ref&&(l=t.ref),void 0!==t.key&&(i=""+t.key),t)k.call(t,r)&&!x.hasOwnProperty(r)&&(a[r]=t[r]);var s=arguments.length-2;if(1===s)a.children=n;else if(1<s){for(var c=Array(s),u=0;u<s;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===a[r]&&(a[r]=s[r]);return{$$typeof:o,type:e,key:i,ref:l,props:a,_owner:w.current}}function C(e){return"object"==typeof e&&null!==e&&e.$$typeof===o}var E=/\/+/g;function I(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 T(e,t,n,r,i){var l=typeof e;"undefined"!==l&&"boolean"!==l||(e=null);var s=!1;if(null===e)s=!0;else switch(l){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case o:case a:s=!0}}if(s)return i=i(s=e),e=""===r?"."+I(s,0):r,Array.isArray(i)?(n="",null!=e&&(n=e.replace(E,"$&/")+"/"),T(i,t,n,"",function(e){return e})):null!=i&&(C(i)&&(i=function(e,t){return{$$typeof:o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(E,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=""===r?".":r+":",Array.isArray(e))for(var c=0;c<e.length;c++){var u=r+I(l=e[c],c);s+=T(l,t,n,u,i)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),c=0;!(l=e.next()).done;)s+=T(l=l.value,t,n,u=r+I(l,c++),i);else if("object"===l)throw t=""+e,Error(f(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return s}function j(e,t,n){if(null==e)return e;var r=[],o=0;return T(e,r,"","",function(e){return t.call(n,e,o++)}),r}function N(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 A={current:null};function P(){var e=A.current;if(null===e)throw Error(f(321));return e}var O={ReactCurrentDispatcher:A,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:w,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!C(e))throw Error(f(143));return e}},t.Component=g,t.PureComponent=v,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=O,t.cloneElement=function(e,t,n){if(null==e)throw Error(f(267,e));var a=r({},e.props),i=e.key,l=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(l=t.ref,s=w.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(u in t)k.call(t,u)&&!x.hasOwnProperty(u)&&(a[u]=void 0===t[u]&&void 0!==c?c[u]:t[u])}var u=arguments.length-2;if(1===u)a.children=n;else if(1<u){c=Array(u);for(var d=0;d<u;d++)c[d]=arguments[d+2];a.children=c}return{$$typeof:o,type:e.type,key:i,ref:l,props:a,_owner:s}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:l,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:i,_context:e},e.Consumer=e},t.createElement=S,t.createFactory=function(e){var t=S.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:s,render:e}},t.isValidElement=C,t.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:N}},t.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return P().useCallback(e,t)},t.useContext=function(e,t){return P().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return P().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return P().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return P().useLayoutEffect(e,t)},t.useMemo=function(e,t){return P().useMemo(e,t)},t.useReducer=function(e,t,n){return P().useReducer(e,t,n)},t.useRef=function(e){return P().useRef(e)},t.useState=function(e){return P().useState(e)},t.version="17.0.2"},5664(e,t,n){"use strict";e.exports=n(1253)},5944(e,t,n){"use strict";var r=n(7837);e.exports=function(){return"function"==typeof Object.is?Object.is:r}},6054(e,t,n){"use strict";var r=n(6298),o=n(5266),a=n(7042);e.exports=r?function(e){return r(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return o(e)}:a?function(e){return a(e)}:null},6265(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},6298(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},6362(e,t,n){"use strict";var r=n(5224),o=n(3705);function a(e){return a="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},a(e)}var i,l,s=n(71).codes,c=s.ERR_AMBIGUOUS_ARGUMENT,u=s.ERR_INVALID_ARG_TYPE,d=s.ERR_INVALID_ARG_VALUE,p=s.ERR_INVALID_RETURN_VALUE,f=s.ERR_MISSING_ARGS,h=n(8292),m=n(3575).inspect,g=n(3575).types,y=g.isPromise,v=g.isRegExp,b=Object.assign?Object.assign:n(8957).assign,w=Object.is?Object.is:n(8619);function k(){var e=n(6825);i=e.isDeepEqual,l=e.isDeepStrictEqual}new Map;var x=!1,S=e.exports=T,C={};function E(e){if(e.message instanceof Error)throw e.message;throw new h(e)}function I(e,t,n,r){if(!n){var o=!1;if(0===t)o=!0,r="No value argument passed to `assert.ok()`";else if(r instanceof Error)throw r;var a=new h({actual:n,expected:!0,message:r,operator:"==",stackStartFn:e});throw a.generatedMessage=o,a}}function T(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];I.apply(void 0,[T,t.length].concat(t))}S.fail=function e(t,n,a,i,l){var s,c=arguments.length;if(0===c?s="Failed":1===c?(a=t,t=void 0):(!1===x&&(x=!0,(r.emitWarning?r.emitWarning:o.warn.bind(o))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===c&&(i="!=")),a instanceof Error)throw a;var u={actual:t,expected:n,operator:void 0===i?"fail":i,stackStartFn:l||e};void 0!==a&&(u.message=a);var d=new h(u);throw s&&(d.message=s,d.generatedMessage=!0),d},S.AssertionError=h,S.ok=T,S.equal=function e(t,n,r){if(arguments.length<2)throw new f("actual","expected");t!=n&&E({actual:t,expected:n,message:r,operator:"==",stackStartFn:e})},S.notEqual=function e(t,n,r){if(arguments.length<2)throw new f("actual","expected");t==n&&E({actual:t,expected:n,message:r,operator:"!=",stackStartFn:e})},S.deepEqual=function e(t,n,r){if(arguments.length<2)throw new f("actual","expected");void 0===i&&k(),i(t,n)||E({actual:t,expected:n,message:r,operator:"deepEqual",stackStartFn:e})},S.notDeepEqual=function e(t,n,r){if(arguments.length<2)throw new f("actual","expected");void 0===i&&k(),i(t,n)&&E({actual:t,expected:n,message:r,operator:"notDeepEqual",stackStartFn:e})},S.deepStrictEqual=function e(t,n,r){if(arguments.length<2)throw new f("actual","expected");void 0===i&&k(),l(t,n)||E({actual:t,expected:n,message:r,operator:"deepStrictEqual",stackStartFn:e})},S.notDeepStrictEqual=function e(t,n,r){if(arguments.length<2)throw new f("actual","expected");void 0===i&&k(),l(t,n)&&E({actual:t,expected:n,message:r,operator:"notDeepStrictEqual",stackStartFn:e})},S.strictEqual=function e(t,n,r){if(arguments.length<2)throw new f("actual","expected");w(t,n)||E({actual:t,expected:n,message:r,operator:"strictEqual",stackStartFn:e})},S.notStrictEqual=function e(t,n,r){if(arguments.length<2)throw new f("actual","expected");w(t,n)&&E({actual:t,expected:n,message:r,operator:"notStrictEqual",stackStartFn:e})};var j=function e(t,n,r){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n.forEach(function(e){e in t&&(void 0!==r&&"string"==typeof r[e]&&v(t[e])&&t[e].test(r[e])?o[e]=r[e]:o[e]=t[e])})};function N(e,t,n,r){if("function"!=typeof t){if(v(t))return t.test(e);if(2===arguments.length)throw new u("expected",["Function","RegExp"],t);if("object"!==a(e)||null===e){var o=new h({actual:e,expected:t,message:n,operator:"deepStrictEqual",stackStartFn:r});throw o.operator=r.name,o}var s=Object.keys(t);if(t instanceof Error)s.push("name","message");else if(0===s.length)throw new d("error",t,"may not be an empty object");return void 0===i&&k(),s.forEach(function(o){"string"==typeof e[o]&&v(t[o])&&t[o].test(e[o])||function(e,t,n,r,o,a){if(!(n in e)||!l(e[n],t[n])){if(!r){var i=new j(e,o),s=new j(t,o,e),c=new h({actual:i,expected:s,operator:"deepStrictEqual",stackStartFn:a});throw c.actual=e,c.expected=t,c.operator=a.name,c}E({actual:e,expected:t,message:r,operator:a.name,stackStartFn:a})}}(e,t,o,n,s,r)}),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function A(e){if("function"!=typeof e)throw new u("fn","Function",e);try{e()}catch(e){return e}return C}function P(e){return y(e)||null!==e&&"object"===a(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function O(e){return Promise.resolve().then(function(){var t;if("function"==typeof e){if(!P(t=e()))throw new p("instance of Promise","promiseFn",t)}else{if(!P(e))throw new u("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then(function(){return t}).then(function(){return C}).catch(function(e){return e})})}function _(e,t,n,r){if("string"==typeof n){if(4===arguments.length)throw new u("error",["Object","Error","Function","RegExp"],n);if("object"===a(t)&&null!==t){if(t.message===n)throw new c("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===n)throw new c("error/message",'The error "'.concat(t,'" is identical to the message.'));r=n,n=void 0}else if(null!=n&&"object"!==a(n)&&"function"!=typeof n)throw new u("error",["Object","Error","Function","RegExp"],n);if(t===C){var o="";n&&n.name&&(o+=" (".concat(n.name,")")),o+=r?": ".concat(r):".";var i="rejects"===e.name?"rejection":"exception";E({actual:void 0,expected:n,operator:e.name,message:"Missing expected ".concat(i).concat(o),stackStartFn:e})}if(n&&!N(t,n,r,e))throw t}function R(e,t,n,r){if(t!==C){if("string"==typeof n&&(r=n,n=void 0),!n||N(t,n)){var o=r?": ".concat(r):".",a="doesNotReject"===e.name?"rejection":"exception";E({actual:t,expected:n,operator:e.name,message:"Got unwanted ".concat(a).concat(o,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function M(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];I.apply(void 0,[M,t.length].concat(t))}S.throws=function e(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];_.apply(void 0,[e,A(t)].concat(r))},S.rejects=function e(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return O(t).then(function(t){return _.apply(void 0,[e,t].concat(r))})},S.doesNotThrow=function e(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];R.apply(void 0,[e,A(t)].concat(r))},S.doesNotReject=function e(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return O(t).then(function(t){return R.apply(void 0,[e,t].concat(r))})},S.ifError=function e(t){if(null!=t){var n="ifError got unwanted exception: ";"object"===a(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?n+=t.constructor.name:n+=t.message:n+=m(t);var r=new h({actual:t,expected:null,operator:"ifError",message:n,stackStartFn:e}),o=t.stack;if("string"==typeof o){var i=o.split("\n");i.shift();for(var l=r.stack.split("\n"),s=0;s<i.length;s++){var c=l.indexOf(i[s]);if(-1!==c){l=l.slice(0,c);break}}r.stack="".concat(l.join("\n"),"\n").concat(i.join("\n"))}throw r}},S.strict=b(M,S,{equal:S.strictEqual,deepEqual:S.deepStrictEqual,notEqual:S.notStrictEqual,notDeepEqual:S.notDeepStrictEqual}),S.strict.strict=S.strict},6405(e,t,n){"use strict";var r=n(1016),o=globalThis;e.exports=function(){for(var e=[],t=0;t<r.length;t++)"function"==typeof o[r[t]]&&(e[e.length]=r[t]);return e}},6429(e,t,n){"use strict";e.exports=n(8577)},6516(e){"use strict";e.exports=Math.min},6709(e){"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},6806(e){"use strict";var t,n,r=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw n}}),n={},o(function(){throw 42},null,t)}catch(e){e!==n&&(o=null)}else o=null;var a=/^\s*class\b/,i=function(e){try{var t=r.call(e);return a.test(t)}catch(e){return!1}},l=function(e){try{return!i(e)&&(r.call(e),!0)}catch(e){return!1}},s=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),d=function(){return!1};if("object"==typeof document){var p=document.all;s.call(p)===s.call(document.all)&&(d=function(e){if((u||!e)&&(void 0===e||"object"==typeof e))try{var t=s.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=o?function(e){if(d(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{o(e,null,t)}catch(e){if(e!==n)return!1}return!i(e)&&l(e)}:function(e){if(d(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return l(e);if(i(e))return!1;var t=s.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&l(e)}},6825(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(e){return o="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},o(e)}var a=void 0!==/a/g.flags,i=function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t},l=function(e){var t=[];return e.forEach(function(e,n){return t.push([n,e])}),t},s=Object.is?Object.is:n(8619),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},u=Number.isNaN?Number.isNaN:n(7863);function d(e){return e.call.bind(e)}var p=d(Object.prototype.hasOwnProperty),f=d(Object.prototype.propertyIsEnumerable),h=d(Object.prototype.toString),m=n(3575).types,g=m.isAnyArrayBuffer,y=m.isArrayBufferView,v=m.isDate,b=m.isMap,w=m.isRegExp,k=m.isSet,x=m.isNativeError,S=m.isBoxedPrimitive,C=m.isNumberObject,E=m.isStringObject,I=m.isBooleanObject,T=m.isBigIntObject,j=m.isSymbolObject,N=m.isFloat32Array,A=m.isFloat64Array;function P(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var n=e.charCodeAt(t);if(n<48||n>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function O(e){return Object.keys(e).filter(P).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function _(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,o=0,a=Math.min(n,r);o<a;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0}function R(e,t,n,r){if(e===t)return 0!==e||!n||s(e,t);if(n){if("object"!==o(e))return"number"==typeof e&&u(e)&&u(t);if("object"!==o(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==o(e))return(null===t||"object"!==o(t))&&e==t;if(null===t||"object"!==o(t))return!1}var i,l,c,d,p=h(e);if(p!==h(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var f=O(e),m=O(t);return f.length===m.length&&L(e,t,n,r,1,f)}if("[object Object]"===p&&(!b(e)&&b(t)||!k(e)&&k(t)))return!1;if(v(e)){if(!v(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||(c=e,d=t,!(a?c.source===d.source&&c.flags===d.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(d))))return!1}else if(x(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(y(e)){if(n||!N(e)&&!A(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===_(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}(e,t))return!1;var P=O(e),R=O(t);return P.length===R.length&&L(e,t,n,r,0,P)}if(k(e))return!(!k(t)||e.size!==t.size)&&L(e,t,n,r,2);if(b(e))return!(!b(t)||e.size!==t.size)&&L(e,t,n,r,3);if(g(e)){if(l=t,(i=e).byteLength!==l.byteLength||0!==_(new Uint8Array(i),new Uint8Array(l)))return!1}else if(S(e)&&!function(e,t){return C(e)?C(t)&&s(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):E(e)?E(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):I(e)?I(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):T(e)?T(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):j(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return L(e,t,n,r,0)}function M(e,t){return t.filter(function(t){return f(e,t)})}function L(e,t,n,a,s,u){if(5===arguments.length){u=Object.keys(e);var d=Object.keys(t);if(u.length!==d.length)return!1}for(var h=0;h<u.length;h++)if(!p(t,u[h]))return!1;if(n&&5===arguments.length){var m=c(e);if(0!==m.length){var g=0;for(h=0;h<m.length;h++){var y=m[h];if(f(e,y)){if(!f(t,y))return!1;u.push(y),g++}else if(f(t,y))return!1}var v=c(t);if(m.length!==v.length&&M(t,v).length!==g)return!1}else{var b=c(t);if(0!==b.length&&0!==M(t,b).length)return!1}}if(0===u.length&&(0===s||1===s&&0===e.length||0===e.size))return!0;if(void 0===a)a={val1:new Map,val2:new Map,position:0};else{var w=a.val1.get(e);if(void 0!==w){var k=a.val2.get(t);if(void 0!==k)return w===k}a.position++}a.val1.set(e,a.position),a.val2.set(t,a.position);var x=function(e,t,n,a,s,c){var u=0;if(2===c){if(!function(e,t,n,r){for(var a=null,l=i(e),s=0;s<l.length;s++){var c=l[s];if("object"===o(c)&&null!==c)null===a&&(a=new Set),a.add(c);else if(!t.has(c)){if(n)return!1;if(!F(e,t,c))return!1;null===a&&(a=new Set),a.add(c)}}if(null!==a){for(var u=i(t),d=0;d<u.length;d++){var p=u[d];if("object"===o(p)&&null!==p){if(!U(a,p,n,r))return!1}else if(!n&&!e.has(p)&&!U(a,p,n,r))return!1}return 0===a.size}return!0}(e,t,n,s))return!1}else if(3===c){if(!function(e,t,n,a){for(var i=null,s=l(e),c=0;c<s.length;c++){var u=r(s[c],2),d=u[0],p=u[1];if("object"===o(d)&&null!==d)null===i&&(i=new Set),i.add(d);else{var f=t.get(d);if(void 0===f&&!t.has(d)||!R(p,f,n,a)){if(n)return!1;if(!z(e,t,d,p,a))return!1;null===i&&(i=new Set),i.add(d)}}}if(null!==i){for(var h=l(t),m=0;m<h.length;m++){var g=r(h[m],2),y=(d=g[0],g[1]);if("object"===o(d)&&null!==d){if(!$(i,e,d,y,n,a))return!1}else if(!(n||e.has(d)&&R(e.get(d),y,!1,a)||$(i,e,d,y,!1,a)))return!1}return 0===i.size}return!0}(e,t,n,s))return!1}else if(1===c)for(;u<e.length;u++){if(!p(e,u)){if(p(t,u))return!1;for(var d=Object.keys(e);u<d.length;u++){var f=d[u];if(!p(t,f)||!R(e[f],t[f],n,s))return!1}return d.length===Object.keys(t).length}if(!p(t,u)||!R(e[u],t[u],n,s))return!1}for(u=0;u<a.length;u++){var h=a[u];if(!R(e[h],t[h],n,s))return!1}return!0}(e,t,n,u,a,s);return a.val1.delete(e),a.val2.delete(t),x}function U(e,t,n,r){for(var o=i(e),a=0;a<o.length;a++){var l=o[a];if(R(t,l,n,r))return e.delete(l),!0}return!1}function D(e){switch(o(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(u(e))return!1}return!0}function F(e,t,n){var r=D(n);return null!=r?r:t.has(r)&&!e.has(r)}function z(e,t,n,r,o){var a=D(n);if(null!=a)return a;var i=t.get(a);return!(void 0===i&&!t.has(a)||!R(r,i,!1,o))&&!e.has(a)&&R(r,i,!1,o)}function $(e,t,n,r,o,a){for(var l=i(e),s=0;s<l.length;s++){var c=l[s];if(R(n,c,o,a)&&R(r,t.get(c),o,a))return e.delete(c),!0}return!1}e.exports={isDeepEqual:function(e,t){return R(e,t,!1)},isDeepStrictEqual:function(e,t){return R(e,t,!0)}}},6925(e){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},6953(e){"use strict";e.exports=Error},6954(e){"use strict";e.exports=Object},6989(e,t,n){"use strict";var r=n(8307);e.exports=Function.prototype.bind||r},7042(e,t,n){"use strict";var r,o=n(9460),a=n(4553);try{r=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var i=!!r&&a&&a(Object.prototype,"__proto__"),l=Object,s=l.getPrototypeOf;e.exports=i&&"function"==typeof i.get?o([i.get]):"function"==typeof s&&function(e){return s(null==e?e:l(e))}},7198(e,t,n){"use strict";var r,o=Object.prototype.toString,a=Function.prototype.toString,i=/^\s*(?:function)?\*/,l=n(5550)(),s=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(i.test(a.call(e)))return!0;if(!l)return"[object GeneratorFunction]"===o.call(e);if(!s)return!1;if(void 0===r){var t=function(){if(!l)return!1;try{return Function("return function*() {}")()}catch(e){}}();r=!!t&&s(t)}return s(e)===r}},7277(e){"use strict";e.exports=TypeError},7308(e,t,n){"use strict";var r=n(7433);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:r}},7375(e,t,n){"use strict";var r,o=n(6954),a=n(6953),i=n(3123),l=n(3780),s=n(8768),c=n(7430),u=n(7277),d=n(1619),p=n(4960),f=n(8974),h=n(2938),m=n(6516),g=n(5158),y=n(7856),v=n(8707),b=Function,w=function(e){try{return b('"use strict"; return ('+e+").constructor;")()}catch(e){}},k=n(4553),x=n(6709),S=function(){throw new u},C=k?function(){try{return S}catch(e){try{return k(arguments,"callee").get}catch(e){return S}}}():S,E=n(757)(),I=n(6054),T=n(5266),j=n(6298),N=n(1264),A=n(7858),P={},O="undefined"!=typeof Uint8Array&&I?I(Uint8Array):r,_={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":E&&I?I([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":i,"%Float16Array%":"undefined"==typeof Float16Array?r:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":P,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&I?I(I([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&E&&I?I((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":k,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":l,"%ReferenceError%":s,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&E&&I?I((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&I?I(""[Symbol.iterator]()):r,"%Symbol%":E?Symbol:r,"%SyntaxError%":c,"%ThrowTypeError%":C,"%TypedArray%":O,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":d,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet,"%Function.prototype.call%":A,"%Function.prototype.apply%":N,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":T,"%Math.abs%":p,"%Math.floor%":f,"%Math.max%":h,"%Math.min%":m,"%Math.pow%":g,"%Math.round%":y,"%Math.sign%":v,"%Reflect.getPrototypeOf%":j};if(I)try{null.error}catch(e){var R=I(I(e));_["%Error.prototype%"]=R}var M=function e(t){var n;if("%AsyncFunction%"===t)n=w("async function () {}");else if("%GeneratorFunction%"===t)n=w("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=w("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&I&&(n=I(o.prototype))}return _[t]=n,n},L={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},U=n(6989),D=n(2155),F=U.call(A,Array.prototype.concat),z=U.call(N,Array.prototype.splice),$=U.call(A,String.prototype.replace),B=U.call(A,String.prototype.slice),H=U.call(A,RegExp.prototype.exec),q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W=/\\(\\)?/g,V=function(e,t){var n,r=e;if(D(L,r)&&(r="%"+(n=L[r])[0]+"%"),D(_,r)){var o=_[r];if(o===P&&(o=M(r)),void 0===o&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=B(e,0,1),n=B(e,-1);if("%"===t&&"%"!==n)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return $(e,q,function(e,t,n,o){r[r.length]=n?$(o,W,"$1"):t||e}),r}(e),r=n.length>0?n[0]:"",o=V("%"+r+"%",t),a=o.name,i=o.value,l=!1,s=o.alias;s&&(r=s[0],z(n,F([0,1],s)));for(var d=1,p=!0;d<n.length;d+=1){var f=n[d],h=B(f,0,1),m=B(f,-1);if(('"'===h||"'"===h||"`"===h||'"'===m||"'"===m||"`"===m)&&h!==m)throw new c("property names with quotes must have matching quotes");if("constructor"!==f&&p||(l=!0),D(_,a="%"+(r+="."+f)+"%"))i=_[a];else if(null!=i){if(!(f in i)){if(!t)throw new u("base intrinsic for "+e+" exists, but the property is not available.");return}if(k&&d+1>=n.length){var g=k(i,f);i=(p=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:i[f]}else p=D(i,f),i=i[f];p&&!l&&(_[a]=i)}}return i}},7430(e){"use strict";e.exports=SyntaxError},7433(e){"use strict";e.exports=function(e){return e!=e}},7734(e,t,n){"use strict";var r=n(7375)("%Object.defineProperty%",!0),o=function(){if(r)try{return r({},"a",{value:1}),!0}catch(e){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==r([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},7837(e){"use strict";var t=function(e){return e!=e};e.exports=function(e,n){return 0===e&&0===n?1/e==1/n:e===n||!(!t(e)||!t(n))}},7839(e,t,n){"use strict";var r=Array.prototype.slice,o=n(543),a=Object.keys,i=a?function(e){return a(e)}:n(225),l=Object.keys;i.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return o(e)?l(r.call(e)):l(e)})}else Object.keys=i;return Object.keys||i},e.exports=i},7856(e){"use strict";e.exports=Math.round},7858(e){"use strict";e.exports=Function.prototype.call},7863(e,t,n){"use strict";var r=n(3629),o=n(8726),a=n(7433),i=n(7308),l=n(3862),s=r(i(),Number);o(s,{getPolyfill:i,implementation:a,shim:l}),e.exports=s},8259(e,t,n){"use strict";var r=n(7375),o=n(9411),a=n(8562)(),i=n(4553),l=n(7277),s=r("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new l("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||s(t)!==t)throw new l("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],r=!0,c=!0;if("length"in e&&i){var u=i(e,"length");u&&!u.configurable&&(r=!1),u&&!u.writable&&(c=!1)}return(r||c||!n)&&(a?o(e,"length",t,!0,!0):o(e,"length",t)),e}},8292(e,t,n){"use strict";var r=n(5224);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?l(e):t}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e){var t="function"==typeof Map?new Map:void 0;return s=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return c(e,arguments,d(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,e)},s(e)}function c(e,t,n){return c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&u(o,n.prototype),o},c.apply(null,arguments)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function p(e){return p="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},p(e)}var f=n(3575).inspect,h=n(71).codes.ERR_INVALID_ARG_TYPE;function m(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}var g="",y="",v="",b="",w={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function k(e){var t=Object.keys(e),n=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){n[t]=e[t]}),Object.defineProperty(n,"message",{value:e.message}),n}function x(e){return f(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function S(e,t,n){var o="",a="",i=0,l="",s=!1,c=x(e),u=c.split("\n"),d=x(t).split("\n"),f=0,h="";if("strictEqual"===n&&"object"===p(e)&&"object"===p(t)&&null!==e&&null!==t&&(n="strictEqualObject"),1===u.length&&1===d.length&&u[0]!==d[0]){var k=u[0].length+d[0].length;if(k<=10){if(!("object"===p(e)&&null!==e||"object"===p(t)&&null!==t||0===e&&0===t))return"".concat(w[n],"\n\n")+"".concat(u[0]," !== ").concat(d[0],"\n")}else if("strictEqualObject"!==n&&k<(r.stderr&&r.stderr.isTTY?r.stderr.columns:80)){for(;u[0][f]===d[0][f];)f++;f>2&&(h="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var n=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,n-e.length)}(" ",f),"^"),f=0)}}for(var S=u[u.length-1],C=d[d.length-1];S===C&&(f++<2?l="\n ".concat(S).concat(l):o=S,u.pop(),d.pop(),0!==u.length&&0!==d.length);)S=u[u.length-1],C=d[d.length-1];var E=Math.max(u.length,d.length);if(0===E){var I=c.split("\n");if(I.length>30)for(I[26]="".concat(g,"...").concat(b);I.length>27;)I.pop();return"".concat(w.notIdentical,"\n\n").concat(I.join("\n"),"\n")}f>3&&(l="\n".concat(g,"...").concat(b).concat(l),s=!0),""!==o&&(l="\n ".concat(o).concat(l),o="");var T=0,j=w[n]+"\n".concat(y,"+ actual").concat(b," ").concat(v,"- expected").concat(b),N=" ".concat(g,"...").concat(b," Lines skipped");for(f=0;f<E;f++){var A=f-i;if(u.length<f+1)A>1&&f>2&&(A>4?(a+="\n".concat(g,"...").concat(b),s=!0):A>3&&(a+="\n ".concat(d[f-2]),T++),a+="\n ".concat(d[f-1]),T++),i=f,o+="\n".concat(v,"-").concat(b," ").concat(d[f]),T++;else if(d.length<f+1)A>1&&f>2&&(A>4?(a+="\n".concat(g,"...").concat(b),s=!0):A>3&&(a+="\n ".concat(u[f-2]),T++),a+="\n ".concat(u[f-1]),T++),i=f,a+="\n".concat(y,"+").concat(b," ").concat(u[f]),T++;else{var P=d[f],O=u[f],_=O!==P&&(!m(O,",")||O.slice(0,-1)!==P);_&&m(P,",")&&P.slice(0,-1)===O&&(_=!1,O+=","),_?(A>1&&f>2&&(A>4?(a+="\n".concat(g,"...").concat(b),s=!0):A>3&&(a+="\n ".concat(u[f-2]),T++),a+="\n ".concat(u[f-1]),T++),i=f,a+="\n".concat(y,"+").concat(b," ").concat(O),o+="\n".concat(v,"-").concat(b," ").concat(P),T+=2):(a+=o,o="",1!==A&&0!==f||(a+="\n ".concat(O),T++))}if(T>20&&f<E-2)return"".concat(j).concat(N,"\n").concat(a,"\n").concat(g,"...").concat(b).concat(o,"\n")+"".concat(g,"...").concat(b)}return"".concat(j).concat(s?N:"","\n").concat(a).concat(o).concat(l).concat(h)}var C=function(e){function t(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"object"!==p(e)||null===e)throw new h("options","Object",e);var o=e.message,a=e.operator,s=e.stackStartFn,c=e.actual,u=e.expected,f=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=o)n=i(this,d(t).call(this,String(o)));else if(r.stderr&&r.stderr.isTTY&&(r.stderr&&r.stderr.getColorDepth&&1!==r.stderr.getColorDepth()?(g="[34m",y="[32m",b="[39m",v="[31m"):(g="",y="",b="",v="")),"object"===p(c)&&null!==c&&"object"===p(u)&&null!==u&&"stack"in c&&c instanceof Error&&"stack"in u&&u instanceof Error&&(c=k(c),u=k(u)),"deepStrictEqual"===a||"strictEqual"===a)n=i(this,d(t).call(this,S(c,u,a)));else if("notDeepStrictEqual"===a||"notStrictEqual"===a){var m=w[a],C=x(c).split("\n");if("notStrictEqual"===a&&"object"===p(c)&&null!==c&&(m=w.notStrictEqualObject),C.length>30)for(C[26]="".concat(g,"...").concat(b);C.length>27;)C.pop();n=1===C.length?i(this,d(t).call(this,"".concat(m," ").concat(C[0]))):i(this,d(t).call(this,"".concat(m,"\n\n").concat(C.join("\n"),"\n")))}else{var E=x(c),I="",T=w[a];"notDeepEqual"===a||"notEqual"===a?(E="".concat(w[a],"\n\n").concat(E)).length>1024&&(E="".concat(E.slice(0,1021),"...")):(I="".concat(x(u)),E.length>512&&(E="".concat(E.slice(0,509),"...")),I.length>512&&(I="".concat(I.slice(0,509),"...")),"deepEqual"===a||"equal"===a?E="".concat(T,"\n\n").concat(E,"\n\nshould equal\n\n"):I=" ".concat(a," ").concat(I)),n=i(this,d(t).call(this,"".concat(E).concat(I)))}return Error.stackTraceLimit=f,n.generatedMessage=!o,Object.defineProperty(l(n),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),n.code="ERR_ASSERTION",n.actual=c,n.expected=u,n.operator=a,Error.captureStackTrace&&Error.captureStackTrace(l(n),s),n.stack,n.name="AssertionError",i(n)}var n,s;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,e),n=t,s=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:f.custom,value:function(e,t){return f(this,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){o(e,t,n[t])})}return e}({},t,{customInspect:!1,depth:0}))}}],s&&a(n.prototype,s),t}(s(Error));e.exports=C},8307(e){"use strict";var t=Object.prototype.toString,n=Math.max,r=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var o=0;o<t.length;o+=1)n[o+e.length]=t[o];return n};e.exports=function(e){var o=this;if("function"!=typeof o||"[object Function]"!==t.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var a,i=function(e){for(var t=[],n=1,r=0;n<e.length;n+=1,r+=1)t[r]=e[n];return t}(arguments),l=n(0,o.length-i.length),s=[],c=0;c<l;c++)s[c]="$"+c;if(a=Function("binder","return function ("+function(e){for(var t="",n=0;n<e.length;n+=1)t+=e[n],n+1<e.length&&(t+=",");return t}(s)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof a){var t=o.apply(this,r(i,arguments));return Object(t)===t?t:this}return o.apply(e,r(i,arguments))}),o.prototype){var u=function(){};u.prototype=o.prototype,a.prototype=new u,u.prototype=null}return a}},8534(e,t,n){"use strict";var r=n(46),o=n(7198),a=n(4961),i=n(1338);function l(e){return e.call.bind(e)}var s="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=l(Object.prototype.toString),d=l(Number.prototype.valueOf),p=l(String.prototype.valueOf),f=l(Boolean.prototype.valueOf);if(s)var h=l(BigInt.prototype.valueOf);if(c)var m=l(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function y(e){return"[object Map]"===u(e)}function v(e){return"[object Set]"===u(e)}function b(e){return"[object WeakMap]"===u(e)}function w(e){return"[object WeakSet]"===u(e)}function k(e){return"[object ArrayBuffer]"===u(e)}function x(e){return"undefined"!=typeof ArrayBuffer&&(k.working?k(e):e instanceof ArrayBuffer)}function S(e){return"[object DataView]"===u(e)}function C(e){return"undefined"!=typeof DataView&&(S.working?S(e):e instanceof DataView)}t.isArgumentsObject=r,t.isGeneratorFunction=o,t.isTypedArray=i,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):i(e)||C(e)},t.isUint8Array=function(e){return"Uint8Array"===a(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===a(e)},t.isUint16Array=function(e){return"Uint16Array"===a(e)},t.isUint32Array=function(e){return"Uint32Array"===a(e)},t.isInt8Array=function(e){return"Int8Array"===a(e)},t.isInt16Array=function(e){return"Int16Array"===a(e)},t.isInt32Array=function(e){return"Int32Array"===a(e)},t.isFloat32Array=function(e){return"Float32Array"===a(e)},t.isFloat64Array=function(e){return"Float64Array"===a(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===a(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===a(e)},y.working="undefined"!=typeof Map&&y(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(y.working?y(e):e instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(v.working?v(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},k.working="undefined"!=typeof ArrayBuffer&&k(new ArrayBuffer),t.isArrayBuffer=x,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=C;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function I(e){return"[object SharedArrayBuffer]"===u(e)}function T(e){return void 0!==E&&(void 0===I.working&&(I.working=I(new E)),I.working?I(e):e instanceof E)}function j(e){return g(e,d)}function N(e){return g(e,p)}function A(e){return g(e,f)}function P(e){return s&&g(e,h)}function O(e){return c&&g(e,m)}t.isSharedArrayBuffer=T,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},t.isGeneratorObject=function(e){return"[object Generator]"===u(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},t.isNumberObject=j,t.isStringObject=N,t.isBooleanObject=A,t.isBigIntObject=P,t.isSymbolObject=O,t.isBoxedPrimitive=function(e){return j(e)||N(e)||A(e)||P(e)||O(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(x(e)||T(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})})},8562(e,t,n){"use strict";var r=n(6709),o=function(){return!!r};o.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},8577(e,t){"use strict";var n=60103,r=60106,o=60107,a=60108,i=60114,l=60109,s=60110,c=60112,u=60113,d=60120,p=60115,f=60116;if("function"==typeof Symbol&&Symbol.for){var h=Symbol.for;n=h("react.element"),r=h("react.portal"),o=h("react.fragment"),a=h("react.strict_mode"),i=h("react.profiler"),l=h("react.provider"),s=h("react.context"),c=h("react.forward_ref"),u=h("react.suspense"),d=h("react.suspense_list"),p=h("react.memo"),f=h("react.lazy"),h("react.block"),h("react.server.block"),h("react.fundamental"),h("react.debug_trace_mode"),h("react.legacy_hidden")}t.isContextConsumer=function(e){return function(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case o:case i:case a:case u:case d:return e;default:switch(e=e&&e.$$typeof){case s:case c:case f:case p:case l:return e;default:return t}}case r:return t}}}(e)===s}},8619(e,t,n){"use strict";var r=n(8726),o=n(3629),a=n(7837),i=n(5944),l=n(9394),s=o(i(),Object);r(s,{getPolyfill:i,implementation:a,shim:l}),e.exports=s},8707(e,t,n){"use strict";var r=n(1581);e.exports=function(e){return r(e)||0===e?e:e<0?-1:1}},8726(e,t,n){"use strict";var r=n(7839),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),a=Object.prototype.toString,i=Array.prototype.concat,l=Object.defineProperty,s=n(7734)(),c=l&&s,u=function(e,t,n,r){var o;(!(t in e)||"function"==typeof(o=r)&&"[object Function]"===a.call(o)&&r())&&(c?l(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n)},d=function(e,t){var n=arguments.length>2?arguments[2]:{},a=r(t);o&&(a=i.call(a,Object.getOwnPropertySymbols(t)));for(var l=0;l<a.length;l+=1)u(e,a[l],t[a[l]],n[a[l]])};d.supportsDescriptors=!!c,e.exports=d},8768(e){"use strict";e.exports=ReferenceError},8795(e,t,n){"use strict";var r=n(8259),o=n(6709),a=n(9460),i=n(3887);e.exports=function(e){var t=a(arguments),n=1+e.length-(arguments.length-1);return r(t,n>0?n:0,!0)},o?o(e.exports,"apply",{value:i}):e.exports.apply=i},8898(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;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,i,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var c in a=Object(arguments[s]))n.call(a,c)&&(l[c]=a[c]);if(t){i=t(a);for(var u=0;u<i.length;u++)r.call(a,i[u])&&(l[i[u]]=a[i[u]])}}return l}},8932(e,t,n){"use strict";var r=n(3705);!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){r.error(e)}}(),e.exports=n(3500)},8957(e){"use strict";function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var n=Object(e),r=1;r<arguments.length;r++){var o=arguments[r];if(null!=o)for(var a=Object.keys(Object(o)),i=0,l=a.length;i<l;i++){var s=a[i],c=Object.getOwnPropertyDescriptor(o,s);void 0!==c&&c.enumerable&&(n[s]=o[s])}}return n}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}}},8974(e){"use strict";e.exports=Math.floor},9394(e,t,n){"use strict";var r=n(5944),o=n(8726);e.exports=function(){var e=r();return o(Object,{is:e},{is:function(){return Object.is!==e}}),e}},9411(e,t,n){"use strict";var r=n(6709),o=n(7430),a=n(7277),i=n(4553);e.exports=function(e,t,n){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new a("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],d=!!i&&i(e,t);if(r)r(e,t,{configurable:null===c&&d?d.configurable:!c,enumerable:null===l&&d?d.enumerable:!l,value:n,writable:null===s&&d?d.writable:!s});else{if(!u&&(l||s||c))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=n}}},9460(e,t,n){"use strict";var r=n(6989),o=n(7277),a=n(7858),i=n(3110);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return i(r,a,e)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.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.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(1173),t=n(8932),r=e.createContext(null),o=function(e){e()},a=function(){return o},i={notify:function(){},get:function(){return[]}};function l(e,t){var n,r=i;function o(){s.onStateChange&&s.onStateChange()}function l(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){var e=a(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e(function(){for(var e=t;e;)e.callback(),e=e.next})},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}var s={addNestedSub:function(e){return l(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:l,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=i)},getListeners:function(){return r}};return s}var s="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(null,arguments)}function u(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}var d=n(3876),p=n.n(d),f=n(6429),h=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],m=["reactReduxForwardedRef"],g=[],y=[null,null];function v(e,t){var n=e[1];return[t.payload,n+1]}function b(e,t,n){s(function(){return e.apply(void 0,t)},n)}function w(e,t,n,r,o,a,i){e.current=r,t.current=o,n.current=!1,a.current&&(a.current=null,i())}function k(e,t,n,r,o,a,i,l,s,c){if(e){var u=!1,d=null,p=function(){if(!u){var e,n,p=t.getState();try{e=r(p,o.current)}catch(e){n=e,d=e}n||(d=null),e===a.current?i.current||s():(a.current=e,l.current=e,i.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};return n.onStateChange=p,n.trySubscribe(),p(),function(){if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var x=function(){return[null,0]};function S(t,n){void 0===n&&(n={});var o=n,a=o.getDisplayName,i=void 0===a?function(e){return"ConnectAdvanced("+e+")"}:a,s=o.methodName,d=void 0===s?"connectAdvanced":s,S=o.renderCountProp,C=void 0===S?void 0:S,E=o.shouldHandleStateChanges,I=void 0===E||E,T=o.storeKey,j=void 0===T?"store":T,N=(o.withRef,o.forwardRef),A=void 0!==N&&N,P=o.context,O=void 0===P?r:P,_=u(o,h),R=O;return function(n){var r=n.displayName||n.name||"Component",o=i(r),a=c({},_,{getDisplayName:i,methodName:d,renderCountProp:C,shouldHandleStateChanges:I,storeKey:j,displayName:o,wrappedComponentName:r,WrappedComponent:n}),s=_.pure,h=s?e.useMemo:function(e){return e()};function S(r){var o=(0,e.useMemo)(function(){var e=r.reactReduxForwardedRef,t=u(r,m);return[r.context,e,t]},[r]),i=o[0],s=o[1],d=o[2],p=(0,e.useMemo)(function(){return i&&i.Consumer&&(0,f.isContextConsumer)(e.createElement(i.Consumer,null))?i:R},[i,R]),S=(0,e.useContext)(p),C=Boolean(r.store)&&Boolean(r.store.getState)&&Boolean(r.store.dispatch);Boolean(S)&&Boolean(S.store);var E=C?r.store:S.store,T=(0,e.useMemo)(function(){return function(e){return t(e.dispatch,a)}(E)},[E]),j=(0,e.useMemo)(function(){if(!I)return y;var e=l(E,C?null:S.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[E,C,S]),N=j[0],A=j[1],P=(0,e.useMemo)(function(){return C?S:c({},S,{subscription:N})},[C,S,N]),O=(0,e.useReducer)(v,g,x),_=O[0][0],M=O[1];if(_&&_.error)throw _.error;var L=(0,e.useRef)(),U=(0,e.useRef)(d),D=(0,e.useRef)(),F=(0,e.useRef)(!1),z=h(function(){return D.current&&d===U.current?D.current:T(E.getState(),d)},[E,_,d]);b(w,[U,L,F,d,z,D,A]),b(k,[I,E,N,T,U,L,F,D,A,M],[E,N,T]);var $=(0,e.useMemo)(function(){return e.createElement(n,c({},z,{ref:s}))},[s,n,z]);return(0,e.useMemo)(function(){return I?e.createElement(p.Provider,{value:P},$):$},[p,$,P])}var E=s?e.memo(S):S;if(E.WrappedComponent=n,E.displayName=S.displayName=o,A){var T=e.forwardRef(function(t,n){return e.createElement(E,c({},t,{reactReduxForwardedRef:n}))});return T.displayName=o,T.WrappedComponent=n,p()(T,n)}return p()(E,n)}}function C(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function E(e,t){if(C(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(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!C(e[n[o]],t[n[o]]))return!1;return!0}function I(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function T(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function j(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=T(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=T(o),o=r(t,n)),o},r}}n(3705);const N=[function(e){return"function"==typeof e?j(e):void 0},function(e){return e?void 0:I(function(e){return{dispatch:e}})},function(e){return e&&"object"==typeof e?I(function(t){return function(e,t){var n={},r=function(r){var o=e[r];"function"==typeof o&&(n[r]=function(){return t(o.apply(void 0,arguments))})};for(var o in e)r(o);return n}(e,t)}):void 0}],A=[function(e){return"function"==typeof e?j(e):void 0},function(e){return e?void 0:I(function(){return{}})}];function P(e,t,n){return c({},n,e,t)}const O=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,o=n.pure,a=n.areMergedPropsEqual,i=!1;return function(t,n,l){var s=e(t,n,l);return i?o&&a(s,r)||(r=s):(i=!0,r=s),r}}}(e):void 0},function(e){return e?void 0:function(){return P}}];var _=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function R(e,t,n,r){return function(o,a){return n(e(o,a),t(r,a),a)}}function M(e,t,n,r,o){var a,i,l,s,c,u=o.areStatesEqual,d=o.areOwnPropsEqual,p=o.areStatePropsEqual,f=!1;function h(o,f){var h=!d(f,i),m=!u(o,a,f,i);return a=o,i=f,h&&m?(l=e(a,i),t.dependsOnOwnProps&&(s=t(r,i)),c=n(l,s,i)):h?(e.dependsOnOwnProps&&(l=e(a,i)),t.dependsOnOwnProps&&(s=t(r,i)),c=n(l,s,i)):m?function(){var t=e(a,i),r=!p(t,l);return l=t,r&&(c=n(l,s,i)),c}():c}return function(o,u){return f?h(o,u):(l=e(a=o,i=u),s=t(r,i),c=n(l,s,i),f=!0,c)}}function L(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,a=u(t,_),i=n(e,a),l=r(e,a),s=o(e,a);return(a.pure?M:R)(i,l,s,e,a)}var U=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function D(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function F(e,t){return e===t}const z=function(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?S:n,o=t.mapStateToPropsFactories,a=void 0===o?A:o,i=t.mapDispatchToPropsFactories,l=void 0===i?N:i,s=t.mergePropsFactories,d=void 0===s?O:s,p=t.selectorFactory,f=void 0===p?L:p;return function(e,t,n,o){void 0===o&&(o={});var i=o,s=i.pure,p=void 0===s||s,h=i.areStatesEqual,m=void 0===h?F:h,g=i.areOwnPropsEqual,y=void 0===g?E:g,v=i.areStatePropsEqual,b=void 0===v?E:v,w=i.areMergedPropsEqual,k=void 0===w?E:w,x=u(i,U),S=D(e,a,"mapStateToProps"),C=D(t,l,"mapDispatchToProps"),I=D(n,d,"mergeProps");return r(f,c({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:S,initMapDispatchToProps:C,initMergeProps:I,pure:p,areStatesEqual:m,areOwnPropsEqual:y,areStatePropsEqual:b,areMergedPropsEqual:k},x))}}();var $;function B(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}$=t.unstable_batchedUpdates,o=$,n(3705);var H="function"==typeof Symbol&&Symbol.observable||"@@observable",q=function(){return Math.random().toString(36).substring(7).split("").join(".")},W={INIT:"@@redux/INIT"+q(),REPLACE:"@@redux/REPLACE"+q(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+q()}};const V="ADD_SKILL_MAP",G="CLEAR_SKILL_MAPS",K="CLEAR_METADATA",Q="CHANGE_SELECTED_ITEM",Y="SET_SKILL_MAP_COMPLETED",Z="SET_HEADERID_FOR_ACTIVITY",X="OPEN_ACTIVITY",J="CLOSE_ACTIVITY",ee="SAVE_AND_CLOSE_ACTIVITY",te="RESTART_ACTIVITY",ne="SET_USER",re="UPDATE_USER_COMPLETED_TAGS",oe="RESET_USER",ae="SET_PAGE_TITLE",ie="SET_PAGE_DESCRIPTION",le="SET_PAGE_INFO_URL",se="SET_PAGE_BACKGROUND_IMAGE_URL",ce="SET_PAGE_BANNER_IMAGE_URL",ue="SET_PAGE_THEME",de="SET_PAGE_SOURCE_URL",pe="SET_PAGE_ALTERNATE_URLS",fe="SET_MODAL",he="NEXT_MODAL",me="HIDE_MODAL",ge="SHOW_COMPLETION_MODAL",ye="SET_USER_PROFILE",ve="SET_USER_PREFERENCES",be="USER_LOG_OUT",we="SHOW_USER_PROFILE",ke="HIDE_USER_PROFILE",xe="SET_SHARE_STATUS",Se="SET_CLOUD_STATUS",Ce="SET_READY_RESOURCES",Ee="SHOW_SELECT_LANGUAGE",Ie="HIDE_SELECT_LANGUAGE",Te="SHOW_SELECT_THEME",je="HIDE_SELECT_THEME",Ne="SHOW_FEEDBACK",Ae="HIDE_FEEDBACK",Pe="-SHOWN-LOGIN-PROMPT";function Oe(e){let t={cmd:"",arg:""},n=/^(\w+)(:([:./\-+=\w]+))?/.exec((e||window.location.hash).replace(/^#/,""));return n&&(t={cmd:n[1],arg:n[3]||""}),t}function _e(e){return e.trim().replace(/^[\\/]/i,"").replace(/\.md$/i,"")}function Re(e){var t;e=_e(e);return`https://www.makecode.com/api/md/${(null===(t=window.pxtTargetBundle)||void 0===t?void 0:t.name)||"arcade"}/${e}`}function Me(e){let t=function(e){return e=(e=(e=e.replace(/^\/?blob\/main\//,"")).replace(/^\/?blob\/master\//,"")).replace(/\.md$/,"")}(e.fileName||"skillmap");return{identifier:e.fullName+"#"+t,fileName:t}}function Le(e){return new Promise((t,n)=>{const r=new XMLHttpRequest;r.addEventListener("error",e=>{n(e)}),r.addEventListener("load",()=>{try{t(r.responseText)}catch(e){n(e)}}),r.open("GET",e),r.send()})}function Ue(){function e(){return(65536|function(){let e=new Uint8Array(4);return function(e){if(window.crypto)window.crypto.getRandomValues(e);else for(let t=0;t<e.length;++t)e[t]=Math.floor(255*Math.random())}(e),new Uint32Array(e.buffer)[0]}()).toString(16).slice(-4)}return e()+e()+"-"+e()+"-4"+e().slice(-3)+"-"+e()+"-"+e()+e()+e()}function De(){return"localhost"===window.location.hostname}function Fe(e){return`${De()?"":"/static/skillmap"}/${e.replace(/^\//,"")}`}let ze,$e;function Be(e,t){var n,r;(t=t||{}).page=$e,t.pageTitle=ze,null===(n=(r=window).pxtTickEvent)||void 0===n||n.call(r,e,t)}function He(e,t,n,r){return!Object.keys(null==n?void 0:n.activities).some(o=>{var a,i;return!(null!==(a=Ke(e,t,n.mapId))&&void 0!==a&&null!==(i=a.activityState[o])&&void 0!==i&&i.isCompleted)&&o!==r})}function qe(e,t,n,r){var o;return!(null===(o=Qe(e,t,n,r))||void 0===o||!o.isCompleted)}function We(e,t,n,r){let o,a,i,l=e&&n&&Ge(e,t,n,r)?"notstarted":"locked";if(e)if(n&&t&&!function(e,t,n){for(const r of t.prerequisites)if("tag"===r.type){if(!e.completedTags[n])return!1;const t=e.completedTags[n][r.tag];if(void 0===t||t<r.numberCompleted)return!1}else if("map"===r.type&&!He(e,n,t))return!1;return!0}(e,n,t))l="locked";else{const s=Qe(e,t,n.mapId,r);s&&(s.isCompleted?(l=s.currentStep&&s.maxSteps&&s.currentStep<s.maxSteps?"restarted":"completed",i=s.headerId):s.headerId&&(l="inprogress"),o=null==s?void 0:s.currentStep,a=null==s?void 0:s.maxSteps)}return{status:l,currentStep:o,maxSteps:a,completedHeadedId:i}}function Ve(e,t,n){const r={};for(const o of n)for(const n of Object.keys(o.activities)){const a=o.activities[n];if(qe(e,t,o.mapId,a.activityId)&&"activity"===a.kind)for(const e of a.tags)r[e]||(r[e]=0),r[e]++}return r}function Ge(e,t,n,r){return n.root.activityId===r||function o(a){if(qe(e,t,n.mapId,a.activityId)){if(a.next.some(e=>e.activityId===r))return!0;for(const e of a.next)if(o(e))return!0}return!1}(n.root)}function Ke(e,t,n){return e.mapProgress[t]?e.mapProgress[t][n]:void 0}function Qe(e,t,n,r){var o;return null===(o=Ke(e,t,n))||void 0===o?void 0:o.activityState[r]}function Ye(e,t){return!!(e.mapProgress&&e.mapProgress[t]&&0!=Object.keys(e.mapProgress[t]).length&&Object.keys(e.mapProgress[t]).some(n=>0!=Object.keys(e.mapProgress[t][n].activityState).length))}function Ze(e,t){return Object.keys(e.activities).filter(t=>!nt(e.activities[t])).filter(n=>tt(e.activities[n],nt(e.activities[t])).map(e=>e.activityId).some(e=>e===t)).map(t=>e.activities[t])}function Xe(e,t,n,r){return Ze(n,r).map(r=>Qe(e,t,n.mapId,r.activityId)).filter(e=>!!e)}function Je(e,t,n,r){const o=Xe(e,t,n,r).filter(e=>(null==e?void 0:e.isCompleted)&&e.maxSteps===e.currentStep).sort((e,t)=>(t.completedTime||0)-(e.completedTime||0));return null==o?void 0:o[0]}function et(e,t,n,r){if(!e||!n||!r||"activity"!==r.kind)return!1;const o=Xe(e,t,n,r.activityId),a=null==o?void 0:o.some(e=>(null==e?void 0:e.isCompleted)&&e.maxSteps===e.currentStep);return r.allowCodeCarryover&&o.length>0&&a&&Ge(e,t,n,r.activityId)}function tt(e,t=!1){let n=[];return e.next.forEach(e=>{t||!nt(e)?n.push(e):n=n.concat(tt(e))}),n}function nt(e){return"reward"===e.kind||"completion"===e.kind}function rt(e,t,n){const r=[];for(const o of Object.keys(n.activities))if(nt(n.activities[o])&&Ge(e,t,n,o)){const e=n.activities[o];for(const o of e.rewards)"completion-badge"===o.type&&r.push(ot(t,n,e))}return r}function ot(e,t,n){const r=n.rewards.filter(e=>"completion-badge"===e.type)[0];return{id:`skillmap-completion-${t.mapId}`,image:null==r?void 0:r.imageUrl,sourceURL:e,type:"skillmap-completion",title:(null==r?void 0:r.displayName)||t.displayName}}function at(e,t,n){var r;return Object.values(null!==(r=e.mapProgress[t])&&void 0!==r?r:[]).filter(e=>{var r;return!n||!(null!==(r=n.mapProgress[t])&&void 0!==r&&r[e.mapId])||0===Object.keys(n.mapProgress[t][e.mapId].activityState).length}).map(e=>Object.values(e.activityState)).reduce((e,t)=>e.concat(t,[]),[]).map(e=>e.headerId).filter(e=>!!e)}const it={title:lf("Game Maker Guide"),description:lf("Level up your game making skills by completing the tutorials in this guide."),pageSourceStatus:"unknown",pageSourceUrl:"default",user:{version:pxt.skillmap.USER_VERSION,isDebug:!0,id:Ue(),mapProgress:{},completedTags:{}},theme:{backgroundColor:"var(--pxt-target-background1)",pathColor:"var(--pxt-neutral-background1)",strokeColor:"var(--pxt-target-foreground1)",rewardNodeColor:"var(--pxt-primary-background)",rewardNodeForeground:"var(--pxt-primary-foreground)",unlockedNodeColor:"var(--pxt-secondary-background)",unlockedNodeForeground:"var(--pxt-secondary-foreground)",lockedNodeColor:"var(--pxt-neutral-background1)",lockedNodeForeground:"var(--pxt-neutral-foreground1)",completedNodeColor:"var(--pxt-secondary-background)",completedNodeForeground:"var(--pxt-secondary-foreground)",selectedStrokeColor:"var(--pxt-secondary-background)",pathOpacity:.5},maps:{},auth:{signedIn:!1},cloudState:{}};function lt(e,t,n,r,o,a,i,l=!1){var s,c;const u=n.mapId;let d=Qe(e,t,u,r);d||(d={isCompleted:!1,activityId:r,currentStep:a,maxSteps:i,headerId:o});const p=(null===(s=e.mapProgress)||void 0===s?void 0:s[t])||{};return{...e,mapProgress:{...e.mapProgress,[t]:{...p,[u]:{...(null==p?void 0:p[u])||{mapId:u},activityState:{...(null==p||null===(c=p[u])||void 0===c?void 0:c.activityState)||{},[r]:{...d,headerId:o,currentStep:a,maxSteps:i,isCompleted:d.isCompleted||l}}}}}}}function st(e,t,n,r){var o,a,i;const l=n.mapId;let s=!1;const c={};r.forEach(r=>{let o=Qe(e,t,l,r);s=s||nt(n.activities[r])&&!(null!=o&&o.isCompleted),c[r]=o||{isCompleted:!0,activityId:r,headerId:"",currentStep:0},c[r].isCompleted=!0,c[r].completedTime=Date.now()});const u=(null===(o=e.mapProgress)||void 0===o?void 0:o[t])||{};return{...e,mapProgress:{...e.mapProgress,[t]:{...u,[l]:{...(null==u?void 0:u[l])||{mapId:l},activityState:{...(null==u||null===(a=u[l])||void 0===a?void 0:a.activityState)||{},...c},completionState:s?"transitioning":null==u||null===(i=u[l])||void 0===i?void 0:i.completionState}}}}}function ct(e,t){const n=[{type:"completion",currentMapId:e.mapId,currentActivityId:t}],r=e.activities[t];if(1===r.rewards.length&&"certificate"===r.rewards[0].type)return n[0].currentReward=r.rewards[0],n;for(const o of r.rewards)n.push({type:"reward",currentMapId:e.mapId,currentActivityId:t,currentReward:o});return n}const ut=function e(t,n,r){var o;if("function"==typeof n&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(B(0));if("function"==typeof n&&void 0===r&&(r=n,n=void 0),void 0!==r){if("function"!=typeof r)throw new Error(B(1));return r(e)(t,n)}if("function"!=typeof t)throw new Error(B(2));var a=t,i=n,l=[],s=l,c=!1;function u(){s===l&&(s=l.slice())}function d(){if(c)throw new Error(B(3));return i}function p(e){if("function"!=typeof e)throw new Error(B(4));if(c)throw new Error(B(5));var t=!0;return u(),s.push(e),function(){if(t){if(c)throw new Error(B(6));t=!1,u();var n=s.indexOf(e);s.splice(n,1),l=null}}}function f(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(B(7));if(void 0===e.type)throw new Error(B(8));if(c)throw new Error(B(9));try{c=!0,i=a(i,e)}finally{c=!1}for(var t=l=s,n=0;n<t.length;n++)(0,t[n])();return e}return f({type:W.INIT}),(o={dispatch:f,subscribe:p,getState:d,replaceReducer:function(e){if("function"!=typeof e)throw new Error(B(10));a=e,f({type:W.REPLACE})}})[H]=function(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(B(11));function n(){e.next&&e.next(d())}return n(),{unsubscribe:t(n)}}})[H]=function(){return this},e},o}((e=it,t)=>{var n,r,o,a,i,l,s,c,u,d,p,f,h,m;switch(t.type){case V:return{...e,maps:{...e.maps,[t.map.mapId]:t.map}};case G:return{...e,maps:{}};case K:return{...e,title:it.title,description:it.description,infoUrl:it.infoUrl,backgroundImageUrl:void 0,pixelatedBackground:void 0,bannerImageUrl:void 0,alternateSourceUrls:void 0,theme:{...it.theme}};case Q:return{...e,selectedItem:{mapId:t.mapId,activityId:t.activityId}};case Y:return{...e,user:{...e.user,mapProgress:{...e.user.mapProgress,[e.pageSourceUrl]:{...null===(n=e.user.mapProgress)||void 0===n?void 0:n[e.pageSourceUrl],[t.mapId]:{...null===(r=e.user.mapProgress)||void 0===r||null===(o=r[e.pageSourceUrl])||void 0===o?void 0:o[t.mapId],completionState:"completed"}}}}};case X:return{...e,editorView:{currentMapId:t.mapId,currentActivityId:t.activityId,state:"active",allowCodeCarryover:!!t.carryoverCode,previousHeaderId:t.previousHeaderId,currentHeaderId:null===(a=Qe(e.user,e.pageSourceUrl,t.mapId,t.activityId))||void 0===a?void 0:a.headerId}};case ee:return{...e,editorView:{...e.editorView,state:"saving"}};case J:const g=e.maps[e.editorView.currentMapId],y=e.editorView.currentActivityId,v=t.finished?function(e,t){const n=[e.activities[t]],r=e.activities[t].next.filter(e=>nt(e));return n.concat(r)}(g,y):[],b=v.find(e=>nt(e)),w=b&&(null===(i=e.user.mapProgress[e.pageSourceUrl])||void 0===i||null===(l=i[g.mapId])||void 0===l?void 0:l.activityState[b.activityId]);return{...e,selectedItem:b&&!w?{mapId:g.mapId,activityId:b.activityId}:e.selectedItem,editorView:void 0,user:t.finished?st(e.user,e.pageSourceUrl,g,v.map(e=>e.activityId)):e.user};case te:return{...e,modalQueue:[],editorView:{state:"active",currentMapId:t.mapId,currentActivityId:t.activityId,allowCodeCarryover:!!t.carryoverCode,previousHeaderId:t.previousHeaderId},user:lt(e.user,e.pageSourceUrl,e.maps[t.mapId],t.activityId)};case Z:const k=(null===(s=e.editorView)||void 0===s?void 0:s.currentActivityId)===t.activityId&&(null===(c=e.editorView)||void 0===c?void 0:c.currentMapId)===t.mapId;return{...e,editorView:k?{...e.editorView,currentHeaderId:t.id}:e.editorView,user:lt(e.user,e.pageSourceUrl,e.maps[t.mapId],t.activityId,t.id,t.currentStep,t.maxSteps,t.isCompleted)};case ne:const x=e.pageSourceUrl;let S=function(e,t,n,r){const o=pxt.semver.parse(e.version||"0.0.0"),a=pxt.semver.parse(t);let i=e;if(0===pxt.semver.cmp(o,a))return i;if(0===pxt.semver.cmp(o,pxt.semver.parse("0.0.0"))){let t=(null==e?void 0:e.mapProgress)&&Object.keys(null==e?void 0:e.mapProgress);if((null==t?void 0:t.length)>0&&e.mapProgress[t[0]].activityState){const t=e,o={};Object.keys(r).forEach(e=>{t.mapProgress[e]&&(o[e]=t.mapProgress[e])}),i={...t,mapProgress:{[n]:o}}}}return i}(t.user,pxt.skillmap.USER_VERSION,x,e.maps);return e.alternateSourceUrls&&(S=function(e,t,n){if(0===n.length)return e;const r=e.mapProgress[t]||{};return n.forEach(t=>{const{cmd:n,arg:o}=Oe(t);let a=o;switch(n){case"github":const e=pxt.github.parseRepoId(o),t=e&&Me(e);a=(null==t?void 0:t.identifier)||o;break;case"docs":a=Re(o)}let i=e.mapProgress[a];i&&Object.keys(i).forEach(e=>{if(r[e]){const t=i[e].activityState;Object.keys(t).forEach(n=>{r[e].activityState[n]||(r[e].activityState[n]=t[n])})}else r[e]=i[e]})}),{...e,mapProgress:{...e.mapProgress,[t]:r}}}(S,x,e.alternateSourceUrls)),S.mapProgress[x]||(S.mapProgress[x]={}),Object.keys(e.maps).forEach(e=>{S.mapProgress[x][e]||(S.mapProgress[x][e]={completionState:"incomplete",mapId:e,activityState:{}})}),{...e,user:S};case oe:return pxt.storage.removeLocal(e.pageSourceUrl+Pe),{...e,user:{...e.user,completedTags:{...e.user.completedTags,[e.pageSourceUrl]:{}},mapProgress:{...e.user.mapProgress,[e.pageSourceUrl]:{}}}};case re:return e.pageSourceUrl?{...e,user:{...e.user,completedTags:{...e.user.completedTags,[e.pageSourceUrl]:Ve(e.user,e.pageSourceUrl,Object.keys(e.maps).map(t=>e.maps[t]))}}}:e;case xe:return{...e,shareState:t.headerId||t.url?{headerId:t.headerId,projectName:t.projectName,data:t.data,rewardsShare:null===(u=e.shareState)||void 0===u?void 0:u.rewardsShare}:void 0};case Se:return{...e,cloudState:{...e.cloudState,[t.headerId]:t.status}};case ae:return{...e,title:t.title};case ie:return{...e,description:t.description};case le:return{...e,infoUrl:t.infoUrl};case se:return{...e,backgroundImageUrl:t.backgroundImageUrl,pixelatedBackground:t.pixelatedBackground};case ce:return{...e,bannerImageUrl:t.bannerImageUrl};case ue:return{...e,theme:t.theme};case de:return{...e,pageSourceUrl:t.url,pageSourceStatus:t.status};case pe:return{...e,alternateSourceUrls:t.urls};case fe:return{...e,shareState:void 0!==t.rewardsShare?{headerId:(null===(d=e.shareState)||void 0===d?void 0:d.headerId)||"",projectName:(null===(p=e.shareState)||void 0===p?void 0:p.projectName)||"",data:null===(f=e.shareState)||void 0===f?void 0:f.data,rewardsShare:t.rewardsShare}:e.shareState,modalQueue:[t.modal]};case"ENQUEUE_MODALS":return{...e,modalQueue:t.modals};case he:return{...e,modalQueue:null===(h=e.modalQueue)||void 0===h?void 0:h.slice(1)};case me:return{...e,modalQueue:[]};case ge:return{...e,modalQueue:ct(e.maps[t.mapId],t.activityId)};case we:return{...e,showProfile:!0};case ke:return{...e,showProfile:!1};case ye:return{...e,auth:{...e.auth,profile:t.profile,signedIn:!(null===(m=t.profile)||void 0===m||!m.id)}};case Ee:return{...e,showSelectLanguage:!0};case Ie:return{...e,showSelectLanguage:!1};case Te:return{...e,showSelectTheme:!0};case je:return{...e,showSelectTheme:!1};case ve:return{...e,auth:{...e.auth,preferences:t.preferences}};case be:return{...e,auth:{...e.auth,signedIn:!1}};case Ce:return{...e,readyResources:t.resources};case"GRANT_SKILLMAP_BADGE":return{...e};case Ne:return{...e,showFeedback:!0};case Ae:return{...e,showFeedback:!1};default:return e}}),dt=(e,t)=>({type:Q,mapId:e,activityId:t}),pt=(e,t,n,r)=>({type:X,mapId:e,activityId:t,previousHeaderId:n,carryoverCode:r}),ft=()=>({type:ee}),ht=(e,t,n,r)=>({type:te,mapId:e,activityId:t,previousHeaderId:n,carryoverCode:r}),mt=e=>({type:ve,preferences:e}),gt=()=>({type:we}),yt=()=>({type:ke}),vt=()=>({type:Ne}),bt=(e,t,n)=>({type:xe,headerId:e,projectName:t,data:n}),wt=(e,t)=>({type:ge,mapId:e,activityId:t}),kt=(e,t,n)=>St({type:"share",currentMapId:e,currentActivityId:t},n),xt=()=>St({type:"login"}),St=(e,t)=>({type:fe,modal:e,rewardsShare:t});let Ct,Et,It;function Tt(){return Et||(Ct=new pxt.skillmap.IndexedDBWorkspace,Et=Ct.initAsync().then(e=>Ct)),Et}async function jt(){const e=await Tt();let t=await e.getUserStateAsync();return t||(t={id:Ue(),completedTags:{},mapProgress:{},version:pxt.skillmap.USER_VERSION}),t}async function Nt(){let e=await jt();if(await _t()){const t=await async function(){const e=await Ot();if(e){const t=await e.userPreferencesAsync();return null==t?void 0:t.skillmap}}();e={...e,mapProgress:(null==t?void 0:t.mapProgress)||{},completedTags:(null==t?void 0:t.completedTags)||{}}}return e}async function At(e){var t;if(e.isDebug)return;const n=await Tt();await(null===(t=pxt.auth.client())||void 0===t?void 0:t.loggedInAsync())||await n.saveUserStateAsync(e),await async function(e){const t=await Ot(),n=ut.getState().pageSourceUrl;await(null==t?void 0:t.patchUserPreferencesAsync({op:"replace",path:["skillmap"],value:e},{filter:e=>e.path.includes(n)}))}({mapProgress:e.mapProgress,completedTags:e.completedTags})}class Pt extends pxt.auth.AuthClient{onSignedIn(){return Promise.resolve()}onSignedOut(){return ut.dispatch({type:be}),Promise.resolve()}onSignInFailed(){return Promise.resolve()}async onUserProfileChanged(){const e=await pxt.auth.getUserStateAsync();var t;null!=e&&e.profile&&pxt.auth.generateUserProfilePicDataUrl(e.profile),ut.dispatch((t=e.profile,{type:ye,profile:t}))}async onUserPreferencesChanged(e){if(e.some(e=>"simulatorThemes"===e.path[0])){const e=await pxt.auth.getUserStateAsync();ut.dispatch(mt(e.preferences))}return Promise.resolve()}onStateCleared(){return Promise.resolve()}async onProfileDeleted(e){var t;const n=ut.getState();await(null===(t=n.readyResources)||void 0===t?void 0:t.exportCloudProjectsToLocal(e))}onApiError(e){return Promise.resolve()}async logoutAsync(e){const t=ut.getState().user;await At(t),super.logoutAsync(e)}}async function Ot(){if(pxt.auth.hasIdentity())return It||(It=new Promise(async(e,t)=>{const n=new Pt;await n.initAsync(),await n.authCheckAsync(),await n.initialUserPreferencesAsync(),e(n)}),It)}async function _t(){const e=await Ot();return await(null==e?void 0:e.loggedInAsync())}async function Rt(e){const t=await Ot();return await(null==t?void 0:t.logoutAsync(e))}async function Mt(){const e=await Ft();var t;if(e)return null==e||null===(t=e.colorThemeIds)||void 0===t?void 0:t[pxt.appTarget.id]}async function Lt(){const e=await Ft();return null==e?void 0:e.highContrast}async function Ut(){const e=await Ft();if(e){var t;const n=null===(t=e.simulatorThemes)||void 0===t?void 0:t[pxt.appTarget.id];return pxt.auth.isValidSimulatorThemePreference(n)?n:void 0}const n=pxt.U.jsonTryParse(pxt.storage.getLocal(pxt.auth.SIMULATOR_THEMES_LOCAL_STORAGE_KEY)),r=null==n?void 0:n[pxt.appTarget.id];return pxt.auth.isValidSimulatorThemePreference(r)?r:void 0}async function Dt(e){if(e&&!pxt.auth.isValidSimulatorThemePreference(e))return;const t=await Ot(),n=pxt.appTarget.id;if(t){const r=await t.userPreferencesAsync(),o={...null==r?void 0:r.simulatorThemes};e?o[n]=e:delete o[n],await t.patchUserPreferencesAsync({op:"replace",path:["simulatorThemes"],value:o},{immediate:!0})}else{var r;const t=null!==(r=pxt.U.jsonTryParse(pxt.storage.getLocal(pxt.auth.SIMULATOR_THEMES_LOCAL_STORAGE_KEY)))&&void 0!==r?r:{};e?t[n]=e:delete t[n],pxt.storage.setLocal(pxt.auth.SIMULATOR_THEMES_LOCAL_STORAGE_KEY,JSON.stringify(t))}}async function Ft(){const e=await Ot();if(e)return await e.userPreferencesAsync()}async function zt(e,t={}){const n=await Ot();return await(null==n?void 0:n.patchUserPreferencesAsync(e,t))}var $t=n(465);function Bt(e,...t){const n=[];e.replace(/\{\d\}/g,e=>(n.push(parseInt(e.substr(1,1))),e));const r=[];let o,a=0;for(const i of n)o=e.split(`{${i}}`),pxt.U.assert(2===o.length),r.push((0,$t.jsx)("span",{children:o[0]},a++)),r.push((0,$t.jsx)("span",{children:t[i]},a++)),e=o[1];return r.push((0,$t.jsx)("span",{children:e},a++)),r}function Ht(e){const t="number"==typeof e.which?e.which:e.keyCode;13!==t&&32!==t||(e.preventDefault(),e.stopPropagation(),e.currentTarget.click())}function qt(...e){return e.filter(e=>"string"==typeof e).reduce((e,t)=>e.concat(t.split(" ")),[]).map(e=>e.trim()).filter(e=>!!e).join(" ")}let Wt=function(e){return e[e.Selected=0]="Selected",e[e.Unselected=1]="Unselected",e[e.Waiting=2]="Waiting",e}({});function Vt(e,t,n,r,o,a=!0){const i=r?1:-1,l=e[n=Math.max(0,Math.min(e.length-1,n))];if(t===n)return l;if(o?o(l):Kt(l))return l;if(n+i>=e.length){if(!a)return l;n=0}else if(n+i<0){if(!a)return l;n=e.length-1}else n+=i;return Vt(e,t,n,r,o,a)}function Gt(e,t){if(!Kt(e))return[];const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,e=>Kt(e,!1)?t(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP:NodeFilter.FILTER_REJECT),r=[];let o=n.nextNode();for(;o;)r.push(o),o=n.nextNode();return r}function Kt(e,t=!0){if(e.checkVisibility)return e.checkVisibility({visibilityProperty:!0});const n=getComputedStyle(e);return"none"!==n.display&&"hidden"!==n.visibility&&(!t||!e.parentElement||Kt(e.parentElement,t))}function Qt(e){return!function(e){return!(!e||!e.hasAttribute("disabled"))}(e)&&!!(e.hasAttribute("tabindex")||"A"===e.tagName&&(e.hasAttribute("href")||e.hasAttributeNS("xlink","href"))||"BUTTON"===e.tagName||"INPUT"===e.tagName||"SELECT"===e.tagName||"TEXTAREA"===e.tagName||"IFRAME"===e.tagName||"EMBED"===e.tagName||"OBJECT"===e.tagName||"DIV"===e.tagName&&e.hasAttribute("contenteditable")&&"false"!==e.getAttribute("contenteditable")||("AUDIO"===e.tagName||"VIDEO"===e.tagName)&&e.hasAttribute("controls"))}function Yt(e){return!!Qt(e)&&(!e.hasAttribute("tabindex")||parseInt(e.getAttribute("tabindex"))>=0)}const Zt=e=>{const t=Jt(e);return(0,$t.jsx)("button",{...t,children:(0,$t.jsx)(Xt,{...e})})},Xt=e=>{const{label:t,labelClassName:n,leftIcon:r,rightIcon:o,children:a}=e;return(0,$t.jsxs)($t.Fragment,{children:[(r||o||t)&&(0,$t.jsxs)("span",{className:"common-button-flex",children:[r&&(0,$t.jsx)("i",{className:r,"aria-hidden":!0}),(0,$t.jsx)("span",{className:qt("common-button-label",n),children:t}),o&&(0,$t.jsx)("i",{className:"right "+o,"aria-hidden":!0})]}),a]})};function Jt(e){const{onClick:t,onClickEvent:n,onRightClick:r,onKeydown:o,onBlur:a,onFocus:i,onMouseDown:l,buttonRef:s,target:c,href:u,hardDisabled:d}=e;let{disabled:p}=e;return p=p||d,{...en(e),ref:s,onClick:p?void 0:e=>{n&&n(e),t&&t(),u&&window.open(u,c||"_blank","noopener,noreferrer"),e.stopPropagation(),e.preventDefault()},onContextMenu:e=>{r&&(r(),e.stopPropagation(),e.preventDefault())},onKeyDown:o||Ht,onBlur:a,onFocus:i,onMouseDown:l}}function en(e){const{id:t,className:n,style:r,ariaLabel:o,ariaHidden:a,ariaDescribedBy:i,ariaControls:l,ariaExpanded:s,ariaHasPopup:c,ariaPosInSet:u,ariaSetSize:d,ariaSelected:p,ariaPressed:f,role:h,title:m,type:g,hardDisabled:y,tabIndex:v,autoFocus:b}=e;let{disabled:w}=e;return w=w||y,{id:t,className:qt("common-button",n,w&&"disabled"),style:r,title:m,type:g,role:h||"button",tabIndex:v||(w?-1:0),autoFocus:b,disabled:y,"aria-label":o,"aria-hidden":a,"aria-controls":l,"aria-expanded":s,"aria-haspopup":c,"aria-posinset":u,"aria-setsize":d,"aria-describedby":i,"aria-selected":p,"aria-pressed":f}}const tn=e=>{const{id:t,className:n,role:r,ariaHidden:o,ariaLabel:a,ariaLabelledby:i,ariaDescribedBy:l,childTabStopId:s,children:c,focusSelectsItem:u,onItemReceivedFocus:d,useUpAndDownArrowKeys:p,title:f,onClose:h}=e;let m,g;const y=e=>"true"===e.getAttribute("data-isfocusable")&&null!==e.offsetParent;return(0,$t.jsx)("div",{id:t,className:n,role:r,tabIndex:s?void 0:0,onKeyDown:e=>{var t;if(null===(t=m)||void 0===t||!t.length)return;const n=document.activeElement,r=m.indexOf(n),o=e=>{e.click?e.click():e.dispatchEvent(new Event("click"))},a=e=>{e.focus(),d&&d(e),u&&o(e)};if(-1===r&&n!==g)return;let i,l;p?(i="ArrowUp",l="ArrowDown"):pxt.Util.isUserLanguageRtl()?(i="ArrowRight",l="ArrowLeft"):(i="ArrowLeft",l="ArrowRight"),u||"Enter"!==e.key&&" "!==e.key?e.key===l?(r===m.length-1||n===g?a(Vt(m,r,0,!0,y)):a(Vt(m,r,r+1,!0,y)),e.preventDefault(),e.stopPropagation()):e.key===i?(a(Vt(m,r,0===r||n===g?m.length-1:r-1,!1,y)),e.preventDefault(),e.stopPropagation()):"Home"===e.key?(a(Vt(m,r,0,!0,y)),e.preventDefault(),e.stopPropagation()):"End"===e.key?(a(Vt(m,r,m.length-1,!0,y)),e.preventDefault(),e.stopPropagation()):"Escape"===e.key&&h&&(h(),e.preventDefault(),e.stopPropagation()):(e.preventDefault(),e.stopPropagation(),o(n))},ref:e=>{if(!e||g)return;g=e;const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]),[data-isfocusable]');m=[];for(const e of t.values())m.push(e),e.setAttribute("tabindex","-1"),e.setAttribute("data-isfocusable","true");if(s){const e=g.querySelector("#"+s);e&&e.setAttribute("tabindex","0")}},"aria-hidden":o,"aria-label":a,"aria-labelledby":i,"aria-describedby":l,title:f,children:c})},nn=e=>(0,$t.jsx)(tn,{...e,role:"menubar",className:qt("common-menubar",e.className)}),rn=e.createContext(null),on=e.createContext(null),an=({children:t})=>{const[n,r]=e.useReducer(ln,{regions:[]});return(0,$t.jsx)(rn.Provider,{value:n,children:(0,$t.jsx)(on.Provider,{value:r,children:t})})};function ln(e,t){let n=e.regions.slice();switch(t.type){case"ADD_REGION":const r={id:t.id,enabled:t.enabled,order:t.order,onEscape:t.onEscape},o=n.findIndex(e=>e.id===t.id);-1!==o?n.splice(o,1,r):n.push(r);break;case"REMOVE_REGION":const a=e.regions.findIndex(e=>e.id===t.id);-1!==a&&n.splice(a,1)}return{regions:n}}const sn=e=>(0,$t.jsx)(an,{children:(0,$t.jsx)(cn,{...e})}),cn=t=>{const{children:n,id:r,className:o,onEscape:a,arrowKeyNavigation:i,dontStealFocus:l,includeOutsideTabOrder:s,dontRestoreFocus:c,dontTrapFocus:u,focusFirstItem:d,tagName:p,role:f,ariaLabelledby:h,ariaLabel:m,ariaHidden:g,ariaModal:y}=t,v=e.useRef(null),b=e.useRef(document.activeElement),[w,k]=e.useState(!1),x=e.useRef(null),{regions:S}=e.useContext(rn);e.useEffect(()=>()=>{!c&&b.current&&function(e){for(;e&&(!Qt(t=e)||!Kt(t));){const t=e.parentElement;if(!t)break;e=t}var t;e.focus()}(b.current)},[]);const C=e.useCallback(()=>{let e=s?Gt(v.current,Qt):function(e){return Gt(e,Yt)}(v.current);if(S.length){const n={};for(const e of S){var t;const r=null===(t=v.current)||void 0===t?void 0:t.querySelector(`[data-focus-trap-region="${e.id}"]`);r&&(n[e.id]=r)}for(const t of S){const r=n[t.id];!t.enabled&&r&&(e=e.filter(e=>!r.contains(e)))}const r=e.slice();e.sort((e,t)=>{const o=S.find(t=>{var r;return t.enabled&&(null===(r=n[t.id])||void 0===r?void 0:r.contains(e))}),a=S.find(e=>{var r;return e.enabled&&(null===(r=n[e.id])||void 0===r?void 0:r.contains(t))});return(null==o?void 0:o.order)===(null==a?void 0:a.order)?r.indexOf(e)-r.indexOf(t):o?a?o.order-a.order:-1:1})}return e},[S,s]),E=e.useCallback(e=>{if(!e)return;v.current=e;const t=C();l||w||e.contains(document.activeElement)||!t.length||(v.current.focus(),d&&Vt(t,-1,0,!0).focus(),k(!0))},[C,l,w,d]),I=e.useCallback(e=>{if(!v.current)return;const t=(t,n)=>{const r=C();if(!r.length)return;let o,a=r.indexOf(e.target);a<0&&(a=r.indexOf(x.current)),o=t?n?Vt(r,a,r.length-1,t):a===r.length-1?Vt(r,a,0,t):Vt(r,a,a+1,t):Vt(r,a,n?0:0===a?r.length-1:Math.max(a-1,0),t),x.current=o,o.focus(),e.preventDefault(),e.stopPropagation()};if("Escape"===e.key){let t=!1;if(S.length)for(const e of S){var n;if(!e.onEscape)continue;const r=null===(n=v.current)||void 0===n?void 0:n.querySelector(`[data-focus-trap-region="${e.id}"]`);if(null!=r&&r.contains(document.activeElement)){t=!0,e.onEscape();break}}t||a(),e.preventDefault(),e.stopPropagation()}else"Tab"===e.key?u?a():e.shiftKey?t(!1,!1):t(!0,!1):i&&("ArrowDown"===e.key?t(!0,!1):"ArrowUp"===e.key?t(!1,!1):"Home"===e.key?t(!1,!0):"End"===e.key&&t(!0,!0))},[C,a,i,S,u]);return e.createElement(p||"div",{id:r,className:qt("common-focus-trap",o),ref:E,onKeyDown:I,role:f,tabIndex:-1,"aria-labelledby":h,"aria-label":m,"aria-hidden":g,"aria-modal":y},n)},un=e=>{const{id:t,className:n,ariaHidden:r,ariaLabel:o,role:a,isChecked:i,onChange:l,label:s,style:c,tabIndex:u}=e;return(0,$t.jsxs)("div",{className:qt("common-checkbox",n,"toggle"===c&&"toggle"),children:[(0,$t.jsx)("input",{id:t,tabIndex:null!=u?u:0,type:"checkbox",checked:i,onChange:()=>{l(!i)},onKeyDown:Ht,role:a,"aria-hidden":r,"aria-label":o}),s&&(0,$t.jsx)("label",{htmlFor:t,children:s})]})},dn=e=>{const{isChecked:t}=e;return(0,$t.jsx)("span",{className:qt("common-checkbox-icon",t&&"checked"),children:t&&(0,$t.jsx)("i",{className:"fas fa-check"})})},pn=t=>{const{id:n,className:r,ariaHidden:o,ariaLabel:a,role:i,items:l,label:s,title:c,icon:u,showChevron:d,tabIndex:p,disabled:f,keepOpenOnCheckboxChange:h}=t,[m,g]=e.useState(!1),y=e.useRef(!1);let v,b;e.useEffect(()=>{if(m&&v&&y.current){const e=v.querySelector("[role=menu]");if(!e)return;const t=e.querySelectorAll("[role=menuitem], [role=menuitemcheckbox], [role=menuitemradio]");for(const e of t){const t=e;if(null!==t.offsetParent){t.focus();break}}}},[m]);const w=()=>{g(!1),b&&b.focus()},k=qt("common-menu-dropdown",r),x=n+"-menu",S=function(e){const t=[];let n={items:[]};for(const r of e)"separator"===r.role?(n.className=r.className,n.items.length>0&&(t.push(n),n={items:[]})):n.items.push(r);return n.items.length>0&&t.push(n),t}(l);return(0,$t.jsxs)("div",{className:k,ref:e=>{e&&(v=e)},onBlur:e=>{v&&m&&!v.contains(e.relatedTarget)&&g(!1)},children:[(0,$t.jsx)(Zt,{id:n,label:s,tabIndex:p,buttonRef:e=>{e&&(b=e)},title:c,leftIcon:u,rightIcon:d?m?"fas fa-chevron-up":"fas fa-chevron-down":void 0,role:i||"button",className:qt("menu-button",m&&"expanded"),onClick:null,onClickEvent:e=>{y.current=0===e.detail,g(!m)},ariaHasPopup:"true",ariaExpanded:m,ariaControls:m?x:void 0,ariaLabel:a,ariaHidden:o,disabled:f,onKeydown:e=>{"ArrowDown"!==e.key||m||(y.current=!0,g(!0))}}),m&&(0,$t.jsx)(sn,{role:"menu",className:"common-menu-dropdown-pane",id:x,arrowKeyNavigation:!0,onEscape:()=>{g(!1),b&&b.focus()},includeOutsideTabOrder:!0,dontTrapFocus:!0,dontRestoreFocus:!0,focusFirstItem:!1,ariaLabelledby:n,tagName:"ul",children:S.map((t,n)=>(0,$t.jsxs)(e.Fragment,{children:[t.items.map((t,r)=>{const o=`${n}-${r}`;return"menuitem"===t.role?(0,e.createElement)(fn,{...t,key:o,onClick:()=>{var e;w(),null===(e=t.onClick)||void 0===e||e.call(t)}}):"link"===t.role?(0,e.createElement)(mn,{...t,key:o,onClick:()=>{var e;w(),null===(e=t.onClick)||void 0===e||e.call(t)}}):(0,e.createElement)(hn,{...t,key:o,onChange:e=>{var n;h||w(),null===(n=t.onChange)||void 0===n||n.call(t,e)}})}),n<S.length-1&&(0,$t.jsx)("li",{role:"separator",className:qt("common-menu-dropdown-separator",t.className)})]},n))})]})},fn=e=>{const t=Jt(e);return(0,$t.jsx)("li",{...t,className:qt("common-menu-dropdown-item",t.className),role:"menuitem",tabIndex:-1,children:(0,$t.jsx)(Xt,{...e})})},hn=e=>{const{label:t,isChecked:n,onChange:r,id:o,className:a,ariaLabel:i,ariaHidden:l,ariaDescribedBy:s}=e;return(0,$t.jsxs)("li",{role:"menuitemcheckbox",tabIndex:-1,className:qt("common-menu-dropdown-item","common-menu-dropdown-checkbox-item",a),"aria-label":i,"aria-hidden":l,"aria-describedby":s,"aria-checked":n?"true":"false",onClick:()=>r(!n),onKeyDown:Ht,id:o,children:[(0,$t.jsx)(dn,{isChecked:n}),(0,$t.jsx)("span",{children:t})]})},mn=e=>{const{href:t,label:n,id:r,className:o,ariaLabel:a,ariaHidden:i,ariaDescribedBy:l,onClick:s}=e;return(0,$t.jsx)("li",{role:"none",children:(0,$t.jsx)("a",{role:"menuitem",className:qt("common-menu-dropdown-item","common-menu-dropdown-link-item",o),"aria-label":a,"aria-hidden":i,"aria-describedby":l,id:r,tabIndex:-1,href:t,target:"_blank",rel:"noopener noreferrer",onClick:s,onKeyDown:Ht,children:n})})};class gn extends e.Component{constructor(...e){super(...e),this.reportAbuseUrl="https://github.com/contact/report-content",this.avatarPicUrl=()=>{var e,t,n,r;const{profile:o}=this.props;return null!==(e=null==o||null===(t=o.idp)||void 0===t?void 0:t.pictureUrl)&&void 0!==e?e:null==o||null===(n=o.idp)||void 0===n||null===(r=n.picture)||void 0===r?void 0:r.dataUrl},this.onBackClicked=()=>{const{currentMapId:e,currentActivityId:t}=this.props;Be("skillmap.activity.back",{path:e||"",activity:t||""}),this.props.dispatchSaveAndCloseActivity()},this.onHomeClicked=()=>{Be("skillmap.home");const e=pxt.U.getHomeUrl();e&&window.open(e)},this.onFeedbackClicked=()=>{Be("skillmap.feedbackclicked"),this.props.dispatchShowFeedback()},this.onLogoutClicked=async()=>{pxt.tickEvent("skillmap.usermenu.signout"),await Rt(location.hash)},this.onProfileClicked=()=>{pxt.tickEvent("skillmap.profile"),this.props.dispatchShowUserProfile()}}getSettingItems(){const e=[];return this.props.preferences&&e.push({role:"menuitem",id:"theme",title:lf("Theme"),label:lf("Theme"),onClick:()=>{Be("skillmap.theme"),this.props.dispatchShowSelectTheme()}}),this.props.activityOpen||e.push({role:"menuitem",id:"language",title:lf("Language"),label:lf("Language"),onClick:()=>{Be("skillmap.language"),this.props.dispatchShowSelectLanguage()}}),this.props.showReportAbuse&&e.push({role:"link",id:"report",label:lf("Report Abuse"),href:this.reportAbuseUrl,onClick:()=>Be("skillmap.reportabuse")}),pxt.U.ocvEnabled()&&e.push({role:"menuitem",id:"feedback",title:lf("Feedback"),label:lf("Feedback"),onClick:this.onFeedbackClicked}),this.props.activityOpen||e.push({role:"menuitem",id:"reset",title:lf("Reset All"),label:lf("Reset All"),onClick:()=>{Be("skillmap.reset.warning"),this.props.dispatchShowResetUserModal()}}),e}getOrganizationLogo(e){const t=e.organizationWideLogo;return(0,$t.jsx)("div",{className:"header-logo","aria-hidden":"true",children:t?(0,$t.jsx)("img",{src:De()?`./assets/${t}`:t,alt:lf("{0} Logo",e.organization)}):(0,$t.jsx)("span",{className:"name",children:e.organization})})}getTargetLogo(e){const{activityOpen:t}=this.props,n=t&&e.useTextLogo;return(0,$t.jsx)("div",{className:"ui item logo brand "+(t?"":"noclick"),"aria-hidden":!n,children:e.useTextLogo?t?[(0,$t.jsx)(Zt,{className:"name menu-button",onClick:this.onBackClicked,title:lf("MakeCode logo, return to activity selection"),ariaLabel:lf("MakeCode logo, return to activity selection"),label:e.organizationText},"org-name"),(0,$t.jsx)(Zt,{className:"name-short menu-button",onClick:this.onBackClicked,title:lf("MakeCode logo, return to activity selection"),ariaLabel:lf("MakeCode logo, return to activity selection"),label:e.organizationShortText||e.organizationText},"org-name-short")]:[(0,$t.jsx)("span",{className:"name",children:e.organizationText},"org-name"),(0,$t.jsx)("span",{className:"name-short",children:e.organizationShortText||e.organizationText},"org-name-short")]:e.logo||e.portraitLogo?(0,$t.jsx)("img",{className:"logo",src:e.logo||e.portraitLogo,alt:lf("{0} Logo",e.boardName)}):(0,$t.jsxs)("span",{className:"name",children:[" ",e.boardName]})})}getHelpItems(){return[]}getUserMenu(){const{signedIn:e,profile:t}=this.props,n=[];e&&(n.push({role:"menuitem",id:"profile",title:lf("My Profile"),label:lf("My Profile"),onClick:this.onProfileClicked}),n.push({role:"menuitem",id:"signout",title:lf("Sign Out"),label:lf("Sign Out"),onClick:this.onLogoutClicked}));const r=this.avatarPicUrl()?(0,$t.jsx)("div",{className:"avatar",children:(0,$t.jsx)("img",{src:this.avatarPicUrl(),alt:lf("Profile Image"),referrerPolicy:"no-referrer","aria-hidden":"true"})}):void 0,o=(0,$t.jsx)("span",{children:(0,$t.jsx)("div",{className:"avatar-initials","aria-hidden":"true",children:pxt.auth.userInitials(t)})});return(0,$t.jsx)("div",{className:"user-menu",children:e?(0,$t.jsx)(pn,{id:"profile-dropdown",items:n,label:r||o,title:lf("Profile Settings")}):(0,$t.jsx)(Zt,{className:"menu-button",role:"menuitem",rightIcon:"xicon cloud-user",title:lf("Sign In"),label:lf("Sign In"),onClick:()=>{pxt.tickEvent("skillmap.usermenu.signin"),this.props.dispatchShowLoginModal()}})})}render(){var e;const{activityOpen:t}=this.props,n=pxt.auth.hasIdentity(),r=null===(e=pxt.appTarget)||void 0===e?void 0:e.appTheme,o=this.getSettingItems(),a=this.getHelpItems();return(0,$t.jsxs)(nn,{className:"header",ariaLabel:lf("Header"),children:[(0,$t.jsxs)("div",{className:"header-left",children:[this.getOrganizationLogo(r),this.getTargetLogo(r)]}),(0,$t.jsx)("div",{className:"spacer"}),(0,$t.jsxs)("div",{className:"header-right",children:[t&&(0,$t.jsx)(Zt,{className:"menu-button",role:"menuitem",leftIcon:"fas fa-arrow-left large",title:lf("Return to activity selection"),onClick:this.onBackClicked}),(0,$t.jsx)(Zt,{className:"menu-button",role:"menuitem",leftIcon:"fas fa-home large",title:lf("Return to the editor homepage"),onClick:this.onHomeClicked}),(null==a?void 0:a.length)>0&&(0,$t.jsx)(pn,{id:"skillmap-help",title:lf("Help menu"),icon:"fas fa-question-circle large",items:a}),(null==o?void 0:o.length)>0&&(0,$t.jsx)(pn,{id:"settings-help",title:lf("Settings menu"),icon:"fas fa-cog large",items:o}),n&&this.getUserMenu()]})]})}}const yn=z(function(e,t){var n,r,o,a;if(!e)return{};let i;null!==(n=e.editorView)&&void 0!==n&&n.currentHeaderId&&qe(e.user,e.pageSourceUrl,e.editorView.currentMapId,e.editorView.currentActivityId)&&(i=e.editorView.currentHeaderId);const l=!!e.editorView;var s;return null!==(r=e.editorView)&&void 0!==r&&r.currentActivityId&&(null===(s=e.maps[e.editorView.currentMapId])||void 0===s||s.activities[e.editorView.currentActivityId]),{activityOpen:l,currentMapId:l&&(null===(o=e.editorView)||void 0===o?void 0:o.currentMapId),currentActivityId:l&&(null===(a=e.editorView)||void 0===a?void 0:a.currentActivityId),showReportAbuse:"unknown"===e.pageSourceStatus,signedIn:e.auth.signedIn,profile:e.auth.profile,preferences:e.auth.preferences}},{dispatchSaveAndCloseActivity:ft,dispatchShowResetUserModal:()=>St({type:"reset"}),dispatchShowLoginModal:xt,dispatchShowUserProfile:gt,dispatchSetUserPreferences:mt,dispatchShowSelectLanguage:()=>({type:Ee}),dispatchShowSelectTheme:()=>({type:Te}),dispatchShowFeedback:vt})(gn),vn=e=>{const{value:t,max:n,id:r,className:o,title:a,label:i,role:l,ariaHidden:s,ariaLabel:c,ariaDescribedBy:u,ariaValueText:d}=e;return(0,$t.jsxs)("div",{className:qt("common-progressbar-wrapper",o),children:[i&&(0,$t.jsx)("label",{className:"common-progressbar-label",children:i}),(0,$t.jsx)("progress",{className:"common-progressbar",value:t,"aria-valuetext":d,max:n||100,id:r,role:l||"progressbar",title:a,"aria-label":c,"aria-describedby":u,"aria-hidden":s})]})};class bn{constructor(e){this.currentTheme=void 0,this.subscribers=void 0,this.document=void 0,this.document=e}static getInstance(e=document){return bn.instances.has(e)||bn.instances.set(e,new bn(e)),bn.instances.get(e)}static isCurrentThemeHighContrast(e=document){var t;const n=bn.getInstance(e);return n.isHighContrast(null===(t=n.getCurrentColorTheme())||void 0===t?void 0:t.id)}getCurrentColorTheme(){return this.currentTheme}isKnownTheme(e){var t,n;return!(null===(t=pxt.appTarget)||void 0===t||null===(n=t.colorThemeMap)||void 0===n||!n[e])}getAllColorThemes(){var e;return(null!==(e=pxt.appTarget)&&void 0!==e&&e.colorThemeMap?Object.values(pxt.appTarget.colorThemeMap):[]).sort((e,t)=>{var n,r;return e.weight!==t.weight?(null!==(n=e.weight)&&void 0!==n?n:1/0)-(null!==(r=t.weight)&&void 0!==r?r:1/0):e.id.localeCompare(t.id)})}isHighContrast(e){var t,n;return e&&e===(null===(t=pxt.appTarget)||void 0===t||null===(n=t.appTheme)||void 0===n?void 0:n.highContrastColorTheme)}performHighContrastWorkaround(e){this.isHighContrast(e)?(this.document.body.classList.add("high-contrast"),this.document.body.classList.add("hc")):(this.document.body.classList.remove("high-contrast"),this.document.body.classList.remove("hc"))}switchColorTheme(e){var t,n,r;if(e===(null===(t=this.getCurrentColorTheme())||void 0===t?void 0:t.id))return;const o=null===(n=pxt.appTarget)||void 0===n||null===(r=n.colorThemeMap)||void 0===r?void 0:r[e];if(o){const t=wn(o),n="theme-override";let r=this.document.getElementById(n);r||(r=this.document.createElement("style"),r.id=n,this.document.head.appendChild(r)),r.textContent=`.pxt-theme-root { ${t} }`,this.performHighContrastWorkaround(e),this.currentTheme=o,this.notifySubscribers()}}subscribe(e,t){var n;null!==(n=this.subscribers)&&void 0!==n&&n.some(t=>t.subscriberId===e)||(this.subscribers||(this.subscribers=[]),this.subscribers.push({subscriberId:e,onColorThemeChange:t}))}unsubscribe(e){this.subscribers=this.subscribers.filter(t=>t.subscriberId!==e)}notifySubscribers(){var e;null===(e=this.subscribers)||void 0===e||e.forEach(e=>e.onColorThemeChange())}}function wn(e){let t="";for(const[n,r]of Object.entries(e.colors))t+=`--${n}: ${r};\n`;return e.overrideCss&&(t+=`${e.overrideCss}\n`),t=DOMPurify.sanitize(t),t}bn.instances=new Map;const kn=De()?"http://localhost:3232/index.html":function(e){var t,n;if(!pxt.webConfig&&window.pxtConfig&&pxt.setupWebConfig(window.pxtConfig),null!==(t=pxt.webConfig)&&void 0!==t&&t.targetUrl&&null!==(n=pxt.webConfig)&&void 0!==n&&n.relprefix)return pxt.webConfig.targetUrl+pxt.webConfig.relprefix.substr(0,pxt.webConfig.relprefix.length-3);const r=/\/([\da-zA-Z\.]+)(?:--)?/i.exec(window.location.pathname);return`${e.replace(/\/$/,"")}/${(null==r?void 0:r[1])||""}`}(window.pxtTargetBundle.appTheme.embedUrl);class xn extends e.Component{constructor(e){super(e),this.ref=void 0,this.messageQueue=[],this.finishedActivityState=void 0,this.nextId=0,this.pendingMessages={},this.isNewActivity=!1,this.handleFrameRef=e=>{if(e&&e.contentWindow){window.addEventListener("message",this.onMessageReceived),this.ref=e,Sn(".usabilla_live_button_container",!1),Sn("footer",!1);const t=document.getElementById("root");t&&pxt.BrowserUtils.addClass(t,"editor")}},this.onMessageReceived=e=>{const t=e.data;if("opening-project"===this.state.frameState&&this.setState({loadPercent:Math.min((this.state.loadPercent||0)+7,95)}),"pxteditor"===t.type&&t.id&&this.pendingMessages[t.id])return this.pendingMessages[t.id].handler(t),void delete this.pendingMessages[t.id];switch(t.action){case"newproject":this.state.workspaceReady||(this.setState({workspaceReady:!0}),this.sendMessageAsync(),this.props.onWorkspaceReady(e=>this.sendMessageAsync(e))),"loading"===this.state.frameState&&this.setState({frameState:"no-project"});break;case"tutorialevent":this.handleTutorialEvent(t);break;case"projectcloudstatus":{const e=t;this.props.dispatchSetCloudStatus(e.headerId,e.status);break}}},this.state={frameState:"loading",workspaceReady:!1,loadPercent:0,pendingShare:!1},this.updateTheme=this.updateTheme.bind(this)}componentDidMount(){bn.getInstance(document).subscribe("skillmapframe",this.updateTheme)}async componentDidUpdate(){const{shareHeaderId:e}=this.props,{frameState:t,pendingShare:n}=this.state;"project-open"===t&&this.props.save?this.setState({frameState:"closing-project"},async()=>{await this.closeActivityAsync()}):"no-project"===t&&this.props.activityId&&this.setState({frameState:"opening-project",loadPercent:0},async()=>{await this.startActivityAsync()}),e&&!n&&this.setState({pendingShare:!0},async()=>{await this.shareProjectAsync()})}componentWillUnmount(){window.removeEventListener("message",this.onMessageReceived),Sn(".usabilla_live_button_container",!0),Sn("footer",!0);const e=document.getElementById("root");e&&pxt.BrowserUtils.removeClass(e,"editor")}render(){const{title:e,activityId:t,forcelang:n}=this.props,{frameState:r,loadPercent:o}=this.state,a=lf("Loading..."),i="opening-project"===r,l=i||"closing-project"===r;let s=kn;return"/"!==kn.charAt(kn.length-1)||De()||(s=kn.substr(0,kn.length-1)),s+="?controller=1&skillmap=1&noproject=1&nocookiebanner=1&ws=browser"+(n?`?forcelang=${n}`:""),(0,$t.jsxs)("div",{className:"makecode-frame-outer",style:{display:t?"block":"none"},children:[(0,$t.jsxs)("div",{className:"makecode-frame-loader "+(l?"":"hidden"),children:[(0,$t.jsx)("img",{src:Fe("assets/logo.svg"),alt:"MakeCode Logo"}),i&&(0,$t.jsx)(vn,{className:"makecode-frame-loader-bar",value:o}),(0,$t.jsx)("div",{className:"makecode-frame-loader-text",children:a})]}),(0,$t.jsx)("iframe",{className:"makecode-frame",src:s,title:e,ref:this.handleFrameRef})]})}updateTheme(){var e;const t=null===(e=bn.getInstance(document).getCurrentColorTheme())||void 0===e?void 0:e.id;this.sendMessageAsync({type:"pxteditor",action:"setcolorthemebyid",colorThemeId:t,savePreference:!0})}sendMessageAsync(e){return new Promise(t=>{const n=e=>{e.response=!0,e.id=this.nextId+++"",this.pendingMessages[e.id]={original:e,handler:t},this.ref.contentWindow.postMessage(e,"*")};if(this.ref)if(this.state.workspaceReady){for(;this.messageQueue.length;)n(this.messageQueue.shift());e&&n(e)}else this.messageQueue.push(e)})}async startActivityAsync(){this.props.activityHeaderId?await this.sendMessageAsync({type:"pxteditor",action:"openheader",headerId:this.props.activityHeaderId}):(this.isNewActivity=!0,await this.sendMessageAsync({type:"pxteditor",action:"startactivity",path:this.props.tutorialPath,title:this.props.title,activityType:"tutorial",carryoverPreviousCode:this.props.carryoverCode,previousProjectHeaderId:this.props.previousHeaderId}))}async closeActivityAsync(){await this.sendMessageAsync({type:"pxteditor",action:"saveproject"}),this.props.dispatchCloseActivity("finished"===this.finishedActivityState),this.props.dispatchUpdateUserCompletedTags(),this.finishedActivityState=void 0,await this.sendMessageAsync({type:"pxteditor",action:"unloadproject"}),this.setState({frameState:"no-project"})}async shareProjectAsync(){const{shareHeaderId:e,shareProjectName:t,dispatchSetShareStatus:n}=this.props;n(e,t,(await this.sendMessageAsync({type:"pxteditor",action:"shareproject",headerId:e,projectName:t})).resp),this.setState({pendingShare:!1})}handleTutorialEvent(e){const{dispatchSetHeaderIdForActivity:t,dispatchSaveAndCloseActivity:n,mapId:r,activityId:o,progress:a}=this.props;switch(e.tutorialEvent){case"progress":o&&t(r,o,e.projectHeaderId,e.currentStep+1,e.totalSteps,e.isCompleted||!(null==a||!a.isCompleted));break;case"loaded":this.onEditorLoaded();break;case"completed":this.onTutorialFinished();break;case"exit":n()}}onEditorLoaded(){const{mapId:e,activityId:t}=this.props;e&&t&&(Be("skillmap.activity.loaded",{path:e,activity:t}),this.setState({frameState:"project-open"}),this.isNewActivity&&(this.isNewActivity=!1))}onTutorialFinished(){const{mapId:e,activityId:t,signedIn:n,pageSourceUrl:r}=this.props;Be("skillmap.activity.complete",{path:e,activity:t}),this.finishedActivityState="finished",this.props.dispatchSaveAndCloseActivity();const o=pxt.storage.getLocal(r+Pe);n||o||(this.props.dispatchShowLoginPrompt(),pxt.storage.setLocal(r+Pe,"true"))}}function Sn(e,t){const n=document.querySelector(e);null!=n&&n.style&&(n.style.display=t?"":"none")}const Cn=z(function(e,t){var n,r,o;const a=null!==(n=e.shareState)&&void 0!==n&&n.data||null===(r=e.shareState)||void 0===r?void 0:r.headerId,i=null===(o=e.shareState)||void 0===o?void 0:o.projectName;if(!e||!e.editorView)return{shareHeaderId:a,shareProjectName:i};const{currentActivityId:l,currentMapId:s,currentHeaderId:c,state:u,allowCodeCarryover:d,previousHeaderId:p}=e.editorView;let f;const h=e.maps[s],m=null==h?void 0:h.activities[l];f=null==m?void 0:m.displayName;const g=Qe(e.user,e.pageSourceUrl,s,l);return{tutorialPath:m.url,title:f,mapId:s,activityId:l,activityHeaderId:c,activityType:m.type,carryoverCode:d,previousHeaderId:p,progress:g,save:"saving"===u,shareHeaderId:a,shareProjectName:i,signedIn:e.auth.signedIn,pageSourceUrl:e.pageSourceUrl}},{dispatchSetHeaderIdForActivity:(e,t,n,r,o,a)=>({type:Z,mapId:e,activityId:t,id:n,currentStep:r,maxSteps:o,isCompleted:a}),dispatchCloseActivity:(e=!1)=>({type:J,finished:e}),dispatchSaveAndCloseActivity:ft,dispatchUpdateUserCompletedTags:()=>({type:re}),dispatchSetShareStatus:bt,dispatchShowLoginPrompt:()=>St({type:"login-prompt"}),dispatchSetCloudStatus:(e,t)=>({type:Se,headerId:e,status:t})})(xn),En=n=>{const{children:r,id:o,className:a,ariaLabel:i,ariaHidden:l,ariaDescribedBy:s,role:c,title:u,hideTitle:d,leftIcon:p,actions:f,onClose:h,parentElement:m,fullscreen:g,hideDismissButton:y,rightHeader:v}=n,b=e=>{h&&h()},w=qt("common-modal-container",g&&"fullscreen",a),k=e.useRef(null);return e.useEffect(()=>{var e;const t=m||document.body,n=null===(e=k.current)||void 0===e?void 0:e.parentElement,r=[];for(const e of t.children)e!==n&&(e.hasAttribute("aria-hidden")&&"false"!==e.getAttribute("aria-hidden")||(e.setAttribute("aria-hidden","true"),r.push(e)));return()=>{for(const e of r)e.removeAttribute("aria-hidden")}},[m]),t.createPortal((0,$t.jsx)(sn,{className:w,onEscape:b,children:(0,$t.jsxs)("div",{id:o,className:"common-modal",ref:k,role:c||"dialog","aria-hidden":l,"aria-label":i,"aria-describedby":s,"aria-labelledby":"modal-title",children:[(0,$t.jsxs)("div",{className:"common-modal-header",children:[g&&!y&&(0,$t.jsx)("div",{className:"common-modal-back",children:(0,$t.jsx)(Zt,{className:"menu-button",onClick:b,title:lf("Go Back"),label:lf("Go Back"),leftIcon:"fas fa-arrow-left"})}),(0,$t.jsxs)("div",{id:"modal-title",className:qt("common-modal-title",d&&"sr-only"),children:[p&&(0,$t.jsx)("i",{className:p,"aria-hidden":!0}),u]}),v&&(0,$t.jsx)("div",{className:"common-modal-right-menu",children:v}),!g&&!y&&(0,$t.jsx)("div",{className:"common-modal-close",children:(0,$t.jsx)(Zt,{className:"menu-button",onClick:b,title:lf("Close"),rightIcon:"fas fa-times-circle"})})]}),(0,$t.jsx)("div",{className:"common-modal-body",children:r}),(null==f?void 0:f.length)&&(0,$t.jsx)("div",{className:"common-modal-footer",children:f.map((e,t)=>{var n;return(0,$t.jsx)(Zt,{className:null!==(n=e.className)&&void 0!==n?n:"primary inverted",disabled:e.disabled,onClick:e.onClick,href:e.url,label:e.label,title:e.label,rightIcon:(e.xicon?"xicon ":"")+e.icon,leftIcon:e.leftIcon},t)})})]})}),m||document.body)},In=e=>{const{badge:t,disabled:n,isNew:r,onClick:o}=e,a=o&&(()=>{o(t)}),i=n&&t.lockedImage||t.image,l=n?pxt.U.lf("Locked '{0}' badge",t.title):t.title;return(0,$t.jsxs)("div",{className:"profile-badge "+(o?"clickable":""),role:o?"button":void 0,tabIndex:o?0:void 0,title:lf("{0} Badge",t.title),onClick:a,onKeyDown:Ht,children:[r&&(0,$t.jsx)("div",{className:"profile-badge-notification",children:pxt.U.lf("New!")}),(0,$t.jsx)("img",{src:i,alt:l})]})},Tn=e=>{const{children:t}=e;return(0,$t.jsxs)("div",{className:"confetti-container",children:[t,Array(100).fill(0).map((e,t)=>{const n={animationDelay:t%100*.1+"s",left:1*Math.floor(100*Math.random())+"%"};return(0,$t.jsx)("div",{style:n,className:`confetti ${Math.random()>.5?"reverse":""} color-${Math.floor(9*Math.random())}`},t)})]})},jn=e.forwardRef((e,t)=>{const{id:n,className:r,ariaLabel:o,href:a,target:i,children:l,tabIndex:s,title:c}=e,u=qt("common-link",r);return(0,$t.jsx)("a",{id:n,className:u,ref:t,"aria-label":o,href:a,target:i,rel:"_blank"===i?"noopener noreferrer":"",tabIndex:null!=s?s:0,title:c,children:l})}),Nn=t=>{var n,r;const{onSignIn:o,onClose:a,appMessage:i,dialogMessages:l,hideDismissButton:s,lastUsedIdentityProvider:c}=t,{signInMessage:u,signUpMessage:d}=l||{signInMessage:lf("Sign in to save your progress and access your work anytime, anywhere."),signUpMessage:lf("Join now to save your progress and access your work anytime, anywhere.")},p=null!==(n=t.resolvePath)&&void 0!==n?n:e=>e,[f,h]=e.useState(!1),[m,g]=e.useState(null!==(r=t.mode)&&void 0!==r?r:"signin"),y=e.useMemo(()=>"signin"===m?lf("Sign in"):lf("Sign up"),[m]),v=e.useMemo(()=>"signin"===m?u:d,[m,u,d]),b=e.useMemo(()=>"signin"===m?(0,$t.jsxs)("div",{className:"switch",children:[(0,$t.jsx)("span",{children:lf("Don't have an account?")}),(0,$t.jsx)(Zt,{className:"link-button",onClick:()=>g("signup"),title:lf("Sign up"),label:lf("Sign up")})]}):(0,$t.jsxs)("div",{className:"switch",children:[(0,$t.jsx)("span",{children:lf("Have an account?")}),(0,$t.jsx)(Zt,{className:"link-button",onClick:()=>g("signin"),title:lf("Sign in"),label:lf("Sign in")})]}),[m]);return(0,$t.jsx)(En,{title:y,onClose:a,hideDismissButton:s,children:(0,$t.jsxs)("div",{className:"signin-form",children:[(0,$t.jsxs)("div",{className:"signin-header",children:[i||void 0," ",v]}),(0,$t.jsx)("div",{className:"signin-body",children:(0,$t.jsxs)("div",{className:"providers",children:[pxt.auth.identityProviders().map((e,t)=>{const n=e.id===c,r="signin"===m?lf("Continue with {0}",e.name):lf("Sign up with {0}",e.name),a=n?lf("{0}. You last used this option.",r):r;return(0,$t.jsx)(Zt,{className:"provider",onClick:()=>o(e,f),title:r,ariaLabel:a,label:(0,$t.jsxs)("div",{className:"label",children:[n&&(0,$t.jsx)("div",{className:"ui orange right ribbon label last-used-ribbon","aria-hidden":"true",children:lf("Last used")}),(0,$t.jsx)("div",{children:(0,$t.jsx)("img",{className:"logo",src:p(e.icon)})}),(0,$t.jsx)("div",{className:"title",children:r})]})},t)}),(0,$t.jsx)("div",{className:"rememberme",children:(0,$t.jsx)(un,{id:"rememberme",label:lf("Remember me"),isChecked:f,onChange:h})})]})}),(0,$t.jsxs)("div",{className:"signin-footer",children:[b,(0,$t.jsx)("div",{className:"learn",children:(0,$t.jsx)(jn,{href:"/identity/sign-in",target:"_blank",children:lf("Learn more")})})]})]})})},An=t=>{const{id:n,className:r,ariaHidden:o,ariaLabel:a,role:i,items:l,selected:s}=t,[c,u]=(0,e.useState)(!1),d=l.some(e=>_n(e)),p=e=>{},f=qt("common-editor-toggle",d&&"has-dropdown",c&&"focused",r);return(0,$t.jsxs)("div",{className:"common-editor-toggle-outer",children:[(0,$t.jsx)(On,{setIsFocused:u,...t}),(0,$t.jsxs)("div",{id:n,className:f,role:i||"tablist","aria-hidden":!0,"aria-label":a,children:[l.map((e,t)=>{const n=s===t;return(0,$t.jsxs)("div",{className:qt("common-editor-toggle-item",n&&"selected",_n(e)&&"common-editor-toggle-item-dropdown"),children:[(0,$t.jsx)(Pn,{item:e,isSelected:n,onKeydown:p}),_n(e)&&(0,$t.jsx)(pn,{id:"toggle-dropdown",className:"toggle-dropdown",icon:"fas fa-chevron-down",title:lf("More options"),tabIndex:-1,ariaHidden:!0,items:e.items.map(e=>({role:"menuitem",title:e.title,label:e.label,onClick:e.onClick,leftIcon:e.icon}))})]},t)}),(0,$t.jsx)("div",{className:"common-editor-toggle-handle","aria-hidden":!0})]})]})},Pn=e=>{const{item:t,isSelected:n,onKeydown:r}=e,{label:o,title:a,onClick:i,icon:l,focusable:s}=t;return(0,$t.jsx)(Zt,{className:l?void 0:"no-icon",role:s?"tab":void 0,tabIndex:-1,onKeydown:r,label:o,title:a,onClick:i,leftIcon:l,ariaHidden:!0})},On=e=>{const{items:t,id:n,selected:r,ariaHidden:o,setIsFocused:a}=e;let i;const l=t.reduce((e,t,n)=>{const o=[...e];return o.push({...t}),r===n?(o[o.length-1].selected=!0,i=n):o[o.length-1].selected=!1,_n(t)&&o.push(...t.items.filter(e=>e.focusable)),o},[]),s=`${n}-option-`;return(0,$t.jsx)(tn,{id:n,role:"tablist",className:"common-toggle-accessibility",childTabStopId:`${s}${i}`,focusSelectsItem:!0,children:l.map((e,t)=>(0,$t.jsx)(Zt,{className:e.selected?"selected":void 0,id:`${s}${t}`,role:"tab",title:e.title,label:e.label,onClick:e.onClick,onFocus:()=>a(!0),onBlur:()=>a(!1),ariaSelected:e.selected,ariaHidden:o},t))})};function _n(e){var t;return!(null===(t=e.items)||void 0===t||!t.length)}const Rn=t=>{var n;const{id:r,className:o,inputClassName:a,groupClassName:i,role:l,ariaHidden:s,ariaLabel:c,initialValue:u,label:d,title:p,placeholder:f,icon:h,iconTitle:m,disabled:g,type:y,readOnly:v,autoFocus:b,autoComplete:w,selectOnClick:k,onChange:x,onEnterKey:S,onIconClick:C,onFocus:E,onBlur:I,onOptionSelected:T,handleInputRef:j,preserveValueOnBlur:N=!0,options:A,validator:P}=t,[O,_]=e.useState(u||""),[R,M]=e.useState(!1),[L]=e.useState(t.filter?new RegExp(t.filter):void 0),U=e.useMemo(()=>A?Object.values(A):[],[A]);let D;e.useEffect(()=>{_(u||"")},[u]);const F=()=>{A&&M(!R)},z=e=>{if(!U.length)return;const t=U.indexOf(e);var n;return-1!==t?`dropdown-item-${t}-${(n=e)?n.replace(/[^a-zA-Z0-9_-]/g,"-")||"option":""}`:void 0};return(0,$t.jsxs)("div",{className:qt("common-input-wrapper",g&&"disabled",o),onBlur:e=>{R&&!D.contains(e.relatedTarget)&&M(!1)},ref:e=>{e&&(D=e)},children:[d&&(0,$t.jsx)("label",{className:"common-input-label",htmlFor:r,children:d}),(0,$t.jsxs)("div",{className:qt("common-input-group",i),children:[(0,$t.jsx)("input",{id:r,className:qt("common-input",h&&"has-icon",a),title:p,role:l||"textbox",tabIndex:g?-1:0,"aria-label":c,"aria-hidden":s,type:y||"text",placeholder:f,value:O,readOnly:!!v,autoFocus:b,onClick:e=>{k&&e.target.select(),A&&!R&&M(!0)},onChange:e=>{let t=e.target.value;var n;t&&L&&(t=(null===(n=t.match(L))||void 0===n?void 0:n.join(""))||""),v||O===t||_(t),x&&x(t)},onKeyDown:e=>{const n="number"==typeof e.which?e.which:e.keyCode;if(13===n||t.treatSpaceAsEnter&&32===n){let t=O;P&&(t=P(O,u||""),_(t)),S&&(e.preventDefault(),S(t))}else if(A&&"ArrowDown"===e.key){var r;R?null===(r=document.getElementById(z(U[0])))||void 0===r||r.focus():(F(),setTimeout(()=>{var e;null===(e=document.getElementById(z(U[0])))||void 0===e||e.focus()},0)),e.preventDefault(),e.stopPropagation()}else if(A&&R&&"ArrowUp"===e.key){var o;null===(o=document.getElementById(z(U[U.length-1])))||void 0===o||o.focus(),e.preventDefault(),e.stopPropagation()}},onBlur:()=>{let e=O;P&&(e=P(O,u||""),_(e)),I&&I(e),N||_("")},onFocus:()=>{E&&E(O)},autoComplete:w?"":"off",autoCorrect:w?"":"off",autoCapitalize:w?"":"off",spellCheck:w,disabled:g,ref:j}),h&&(C?(0,$t.jsx)(Zt,{leftIcon:h,title:m,disabled:g,onClick:()=>{C&&C(O)}}):(0,$t.jsx)("i",{className:h,"aria-hidden":!0})),A&&(0,$t.jsx)(Zt,{leftIcon:R?"fas fa-chevron-up":"fas fa-chevron-down",title:m,disabled:g,ariaHasPopup:"listbox",ariaExpanded:R,ariaLabel:c,tabIndex:-1,onClick:F})]}),R&&(0,$t.jsx)(tn,{role:"listbox",className:"common-menu-dropdown-pane common-dropdown-shadow",childTabStopId:null!==(n=z(O))&&void 0!==n?n:z(U[0]),"aria-labelledby":r,useUpAndDownArrowKeys:!0,children:(0,$t.jsx)("ul",{role:"presentation",onKeyDown:e=>{var t;"Escape"===e.code&&(e.target.blur(),F(),null===(t=document.getElementById(r))||void 0===t||t.focus(),e.stopPropagation(),e.preventDefault())},children:Object.keys(A).map(e=>(0,$t.jsx)("li",{role:"presentation",children:(0,$t.jsx)(Zt,{title:e,label:e,id:z(A[e]),className:qt("common-dropdown-item"),onClick:()=>(e=>{var t;M(!1);const n=A[e];_(n),T&&T(n),null===(t=document.getElementById(r))||void 0===t||t.focus()})(e),ariaSelected:z(A[e])===z(null!=O?O:u),role:"option"})},e))})})]})},Mn=t=>{const{id:n,className:r,role:o,ariaHidden:a,ariaLabel:i,initialValue:l,label:s,title:c,placeholder:u,autoComplete:d,cols:p,rows:f,disabled:h,minLength:m,maxLength:g,readOnly:y,resize:v,wrap:b,autoResize:w,onChange:k,onEnterKey:x,showRemainingCharacterCount:S}=t,[C,E]=e.useState(l||""),I=e.useRef(null),T=e.useRef(0),j=()=>{I.current&&(I.current.style.height="1px",I.current.style.height=`${I.current.scrollHeight}px`)};e.useEffect(()=>{E(l),w&&I.current&&j()},[l]),e.useEffect(()=>{if(!w)return()=>{};const e=new ResizeObserver(e=>{const t=e[0].contentRect.width;T.current!=t&&(requestAnimationFrame(()=>j()),T.current=t)});return I.current&&e.observe(I.current),()=>{e.disconnect()}},[w]);let N=void 0!==g&&!!S;return N&&"number"==typeof S&&(N=C.length>=g-S),(0,$t.jsxs)("div",{className:qt("common-textarea-wrapper",h&&"disabled",v&&`resize-${v}`,r),children:[s&&(0,$t.jsx)("label",{className:"common-textarea-label",children:s}),(0,$t.jsxs)("div",{className:"common-textarea-group",children:[(0,$t.jsx)("textarea",{id:n,className:"common-textarea",title:c,role:o||"textbox",tabIndex:h?-1:0,"aria-label":i,"aria-hidden":a,placeholder:u,value:C||"",cols:p,rows:f,minLength:m,maxLength:g,wrap:b,readOnly:!!y,ref:I,onChange:e=>{const t=e.target.value;y||C===t||E(t),k&&k(t),w&&I.current&&j()},onKeyDown:e=>{const t="number"==typeof e.which?e.which:e.keyCode;13!==t&&32!==t||x&&(e.preventDefault(),x(C))},autoComplete:d?"":"off",autoCorrect:d?"":"off",autoCapitalize:d?"":"off",spellCheck:d,disabled:h}),N&&(0,$t.jsx)("div",{className:"common-textarea-character-count",role:"presentation","aria-hidden":"true",children:g-C.length})]})]})},Ln=t=>{const{initialUri:n,onApply:r,onCancel:o,simRecorder:a}=t,[i,l]=e.useState(void 0),[s,c]=e.useState(void 0),[u,d]=e.useState(void 0),[p,f]=e.useState("default");let h;e.useEffect(()=>{if(u)return u.addStateChangeListener(f),u.addThumbnailListener(l),u.addErrorListener(c),()=>{u.removeStateChangeListener(f),u.removeThumbnailListener(l),u.removeErrorListener(c)}},[u]);const m=pxt.appTarget.appTheme,g=m.simScreenshotKey?lf("Screenshot ({0})",m.simScreenshotKey):lf("Screenshot"),y=m.simGifKey?lf("Record ({0})",m.simGifKey):lf("Record"),v=m.simGifKey?lf("Stop recording ({0})",m.simGifKey):lf("Stop recording"),b=lf("Rendering...");let w;switch(p){case"default":w=y;break;case"recording":w=v;break;case"rendering":w=b}const k=i?lf("New Thumbnail"):lf("Current Thumbnail"),x=qt("gif-recorder-content",i&&"has-uri");return(0,$t.jsx)($t.Fragment,{children:(0,$t.jsxs)("div",{className:x,children:[(0,$t.jsxs)("div",{className:"gif-recorder-sim",children:[(0,$t.jsx)("div",{className:"gif-recorder-sim-embed",ref:e=>{e&&(h=e)},children:e.createElement(a,{onSimRecorderInit:e=>{d(e)}})}),(0,$t.jsx)("div",{className:"gif-recorder",children:(0,$t.jsxs)("div",{className:"gif-recorder-actions",children:["default"===p&&(0,$t.jsx)(Zt,{className:"teal inverted",title:g,label:g,leftIcon:"fas fa-camera",onClick:async()=>{c(void 0),u&&u.screenshotAsync()}}),(0,$t.jsx)(Zt,{className:"teal inverted",disabled:"rendering"===p,title:w,label:w,leftIcon:"fas fa-"+("recording"===p?"square":"circle"),onClick:async()=>{if(c(void 0),u)if("recording"===u.state)u.stopRecordingAsync();else if("default"===u.state&&(u.startRecordingAsync(),h)){const e=h.querySelector("iframe");e&&e.focus()}}}),(0,$t.jsx)("div",{className:"spacer mobile-only"}),(0,$t.jsx)(Zt,{className:"mobile-only",title:lf("Cancel"),label:lf("Cancel"),onClick:o})]})})]}),(0,$t.jsxs)("div",{className:"thumbnail-controls",children:[(0,$t.jsx)("div",{className:"thumbnail-preview",children:(0,$t.jsxs)("div",{children:[(0,$t.jsxs)("div",{className:"thumbnail-header",children:[(0,$t.jsx)("span",{className:"project-share-label",children:k}),(0,$t.jsx)(Zt,{className:"link-button mobile-only",title:lf("Try again?"),label:lf("Try again?"),onClick:()=>l(void 0)})]}),(0,$t.jsxs)("div",{className:"project-share-thumbnail",children:["default"!==p&&(0,$t.jsxs)("div",{className:"project-thumbnail-placeholder",children:[(0,$t.jsx)("div",{className:"common-spinner"}),(0,$t.jsx)("div",{className:"project-thumbnail-label",children:"recording"===p?lf("Recording..."):lf("Rendering GIF...")})]}),"default"===p&&(i||n?(0,$t.jsx)("img",{src:i||n}):(0,$t.jsx)("div",{className:"thumbnail-placeholder"}))]})]})}),(0,$t.jsxs)("div",{className:"thumbnail-actions",children:[(0,$t.jsx)(Zt,{title:lf("Cancel"),label:lf("Cancel"),onClick:o}),i&&"default"===p&&(0,$t.jsx)(Zt,{className:"primary",title:lf("Apply"),label:lf("Apply"),onClick:e=>{r(i)}})]})]})]})})},Un=e=>{const{className:t,url:n,type:r,heading:o}=e,a=qt(t,"social-button","type"),i=pxt.appTarget.appTheme.socialOptions||{};let l="";switch(r){case"facebook":l=`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(n)}`;break;case"twitter":{let e=lf("Check out what I made!");i.twitterHandle&&i.orgTwitterHandle?e=lf("Check out what I made with @{0} and @{1}!",i.twitterHandle,i.orgTwitterHandle):i.twitterHandle?e=lf("Check out what I made with @{0}!",i.twitterHandle):i.orgTwitterHandle&&(e=lf("Check out what I made with @{0}!",i.orgTwitterHandle)),l=`https://twitter.com/intent/tweet?url=${encodeURIComponent(n)}&text=${encodeURIComponent(e)}`+(i.hashtags?`&hashtags=${encodeURIComponent(i.hashtags)}`:"")+(i.related?`&related=${encodeURIComponent(i.related)}`:"");break}case"discourse":l=`${i.discourse||"https://forum.makecode.com/"}new-topic?title=${encodeURIComponent(n)}`,i.discourseCategory&&(l+=`&category=${encodeURIComponent(i.discourseCategory)}`);break;case"google-classroom":l=`https://classroom.google.com/share?url=${encodeURIComponent(n)}`;break;case"microsoft-teams":l=`https://teams.microsoft.com/share?href=${encodeURIComponent(n)}`;break;case"whatsapp":l=`https://api.whatsapp.com/send?text=${encodeURIComponent(n)}`}const s=()=>{pxt.tickEvent(`share.social.${r}`)};switch(r){case"facebook":case"twitter":case"discourse":case"whatsapp":return(0,$t.jsx)(Dn,{className:qt(a,"social-icon"),ariaLabel:r,title:o,href:l,leftIcon:`icon ${r}`,heading:o,onClick:s});case"google-classroom":case"microsoft-teams":return(0,$t.jsx)(Dn,{className:a,ariaLabel:r,title:o,href:l,label:(0,$t.jsx)("img",{src:`/static/logo/social-buttons/${r}.png`,alt:o||pxt.U.rlf(r)}),heading:o,onClick:s})}return(0,$t.jsx)($t.Fragment,{})},Dn=e=>{const t=Jt(e);return(0,$t.jsx)("a",{className:t.className,title:t.title,href:e.href,target:"_blank",rel:"noopener,noreferrer",onClick:t=>{e.onClick&&e.onClick(),t.stopPropagation(),pxt.BrowserUtils.isInGame()||(t.preventDefault(),pxt.BrowserUtils.popupWindow(e.href,e.heading,600,600))},children:(0,$t.jsx)(Xt,{...e})})},Fn=e=>{const{onCancelClicked:t,onConfirmClicked:n}=e,r=[{label:lf("Cancel"),onClick:t},{label:lf("Share and Host"),onClick:n,className:"primary"}];return(0,$t.jsx)(En,{title:lf("Host a multiplayer game"),actions:r,onClose:t,children:lf("This will share the code of your game publicly. Is that okay?")})};class zn extends e.Component{constructor(e){super(e),this.state={notifications:{}}}push(e){const t=this.state.notifications,n=ts.pxtc.Util.guidGen();Object.keys(t).filter(n=>t[n].kind==e.kind).forEach(e=>this.remove(e)),t[n]=e;const r=this;setTimeout(()=>{r.remove(n)},3e3),this.setState({notifications:t})}remove(e){const t=this.state.notifications;t[e]&&(delete t[e],this.setState({notifications:t}))}render(){const{notifications:e}=this.state;return(0,$t.jsx)("div",{id:"msg","aria-live":"polite",children:Object.keys(e).map(t=>function(e,t){const{kind:n,text:r,hc:o}=t;let a="ignored info message";switch(n){case"err":a="red inverted segment";break;case"warn":a="orange inverted segment";break;case"info":a="blue inverted segment";break;case"compile":a="ignored info message"}return(0,$t.jsx)("div",{id:`${n}msg`,className:`ui ${o} ${a}`,children:r},`${e}`)}(t,e[t]))})}}let $n,Bn=!1;function Hn(n){if(Bn)$n&&$n.push(n);else{Bn=!0;const r=document.body.appendChild(document.createElement("div"));$n=t.render(e.createElement(zn,n),r),$n.push(n)}}const qn="https://vscode.dev/edu/makecode/",Wn=t=>{var n,r,o,a,i,l,s;const{projectName:c,projectDescription:u,screenshotUri:d,isLoggedIn:p,simRecorder:f,publishAsync:h,hasProjectBeenPersistentShared:m,anonymousShareByDefault:g,setAnonymousSharePreference:y,isMultiplayerGame:v,simulatorTheme:b,kind:w="share",onClose:k}=t,[x,S]=e.useState(c),[C,E]=e.useState(u),[I,T]=e.useState(d),[j,N]=e.useState("share"),[A,P]=e.useState(),[O,_]=e.useState(void 0),[R,M]=e.useState("none"),[L,U]=e.useState(!1),[D,F]=e.useState(!1),[z,$]=e.useState(!1),[B,H]=e.useState(!1),[q,W]=e.useState(!p||g),[V,G]=e.useState(!1),[K,Q]=e.useState(!1),{simScreenshot:Y,simGif:Z}=pxt.appTarget.appTheme,X=(Y||Z)&&!!f,J="share"===j||"publishing"===j,ee="publish"===j||"publish-vscode"===j,te=!ee;let ne,re,oe;e.useEffect(()=>{T(d)},[d]),e.useEffect(()=>{p?pxt.tickEvent("share.open.loggedIn",{state:j,anonymous:null==q?void 0:q.toString(),persistent:null==m?void 0:m.toString()}):pxt.tickEvent("share.open",{state:j})},[j,q,m]);const ae=()=>{N("share")},ie=[{name:"code",label:lf("Code"),title:lf("Code"),focusable:!0,onClick:()=>M("code")},{name:"editor",label:lf("Editor"),title:lf("Editor"),focusable:!0,onClick:()=>M("editor")},{name:"simulator",label:lf("Simulator"),title:lf("Simulator"),focusable:!0,onClick:()=>M("simulator")}],le=J?lf("Project Name"):"publish-vscode"===j?lf("Share Successful"):lf("Project Link"),se=void 0===O?q:O,ce=!(null===(n=pxt.appTarget)||void 0===n||null===(r=n.cloud)||void 0===r||null===(o=r.cloudProviders)||void 0===o||!o.github),ue=(()=>{if(null!=A&&A.error)return 413!==A.error.statusCode?lf("Oops! There was an error. Please ensure you are connected to the Internet and try again."):se&&ce?lf("Oops! Your project is too big to share anonymously. Sign in and create a persistent link for higher limits, or publish to GitHub instead."):se?lf("Oops! Your project is too big to share anonymously. Sign in and create a persistent link to unlock a higher size limit."):ce?lf("Oops! Your project is too big. You can create a GitHub repository to share it."):lf("Oops! Your project is too big to share.")})();return(0,$t.jsx)($t.Fragment,{children:(0,$t.jsxs)("div",{className:"project-share-info",children:[X&&"gifrecord"!==j&&(0,$t.jsxs)("div",{className:"project-share-thumbnail",children:[I?(0,$t.jsx)("img",{src:I,alt:lf("Preview of your code running on the simulator"),"aria-label":lf("Simulator preview")}):(0,$t.jsx)("div",{className:"project-thumbnail-placeholder",children:(0,$t.jsx)("div",{className:"common-spinner"})}),!ee&&(0,$t.jsx)(Zt,{className:"link-button",title:lf("Update project thumbnail"),label:lf("Update project thumbnail"),onClick:()=>N("gifrecord")})]}),(0,$t.jsxs)("div",{className:"project-share-content",children:[(J||ee)&&(0,$t.jsxs)($t.Fragment,{children:[(0,$t.jsx)("div",{className:"project-share-title project-share-label",id:"share-input-title",children:le}),te&&(0,$t.jsxs)($t.Fragment,{children:[(0,$t.jsx)(Rn,{ariaDescribedBy:"share-input-title",className:"name-input",initialValue:x,placeholder:lf("Name your project"),onChange:S,onBlur:S,onEnterKey:S,preserveValueOnBlur:!0}),pxt.appTarget.appTheme.showProjectDescription&&(0,$t.jsxs)($t.Fragment,{children:[(0,$t.jsx)("div",{className:"project-share-title project-share-label",id:"share-description-title",children:lf("Project Description")}),(0,$t.jsx)(Mn,{ariaDescribedBy:"share-description-title",ariaLabel:lf("Type a description for your project"),initialValue:void 0!==C?C:u||"",onChange:E,id:"projectDescriptionTextareaShare",maxLength:pxt.MAX_DESCRIPTION_LENGTH,showRemainingCharacterCount:500,resize:"vertical"})]}),p&&m&&(0,$t.jsx)(un,{id:"persistent-share-checkbox",label:lf("Update existing share link for this project"),isChecked:!q,onChange:e=>{pxt.tickEvent("share.persistentCheckbox",{checked:e.toString()}),W(!e),y&&y(!e)}}),b&&(0,$t.jsx)(un,{id:"share-simulator-theme-checkbox",label:lf("Share with your simulator theme"),isChecked:K,onChange:e=>{pxt.tickEvent("share.simulatorTheme",{checked:e.toString()}),Q(e)}})]}),J&&(0,$t.jsxs)($t.Fragment,{children:[(null==A?void 0:A.error)&&ue&&(0,$t.jsx)("div",{className:"project-share-error",children:ue}),(0,$t.jsxs)("div",{className:"project-share-publish-actions",children:["share"===j&&(0,$t.jsxs)($t.Fragment,{children:[(null===(a=pxt.appTarget)||void 0===a||null===(i=a.appTheme)||void 0===i?void 0:i.multiplayer)&&(v||"multiplayer"===w)&&(0,$t.jsx)(Zt,{className:qt("primary share-host-button","share"===w&&"primary inverted text-only","multiplayer"===w&&"share-publish-button"),title:lf("Host a multiplayer game"),label:lf("Host a multiplayer game"),leftIcon:"xicon multiplayer",onClick:async()=>{G(!0),pxt.tickEvent("share.hostMultiplayer")}}),"share"===w&&(0,$t.jsx)(Zt,{className:"primary share-publish-button",title:lf("Share Project"),label:lf("Share Project"),onClick:async()=>{N("publishing"),_(q);let e=await h(x,C,I,q,K?b:void 0);P(e),null!=e&&e.error?N("share"):N("publish")}}),"vscode"===w&&(0,$t.jsx)(Zt,{className:"primary share-publish-button",title:lf("Open in VS Code"),label:lf("Open in VS Code"),onClick:async()=>{N("publishing"),_(q);let e=await h(x,C,I,q,K?b:void 0);P(e),null!=e&&e.error?N("share"):(N("publish-vscode"),pxt.tickEvent("share.openInVscode"),window.open(qn+e.url.split("/").pop(),"_blank"))}})]}),"publishing"===j&&(0,$t.jsx)(Zt,{className:"primary share-publish-button",title:lf("Publishing..."),label:(0,$t.jsx)("div",{className:"common-spinner"}),onClick:()=>{}})]})]}),"publish-vscode"===j&&(0,$t.jsxs)("div",{className:"project-share-vscode",children:[(0,$t.jsx)("div",{children:lf("🎉 All set! Your project is launching in VS Code. If it doesn't open soon, just click the button below!")}),(0,$t.jsx)(jn,{className:"common-button secondary",href:qn+A.url.split("/").pop(),target:"_blank",children:lf("Open vscode.dev")})]}),"publish"===j&&(0,$t.jsxs)("div",{className:"project-share-data",children:[(0,$t.jsxs)("div",{className:"common-input-attached-button",children:[(0,$t.jsx)(Rn,{ariaDescribedBy:"share-input-title",ariaLabel:lf("Your shareable project link"),handleInputRef:e=>{e&&(re=e)},initialValue:A.url,readOnly:!0,onChange:S}),(0,$t.jsx)(Zt,{className:D?"green":"primary",title:lf("Copy link"),label:D?lf("Copied!"):lf("Copy"),leftIcon:"fas fa-link",onClick:()=>{pxt.BrowserUtils.isIpcRenderer()?F(pxt.BrowserUtils.legacyCopyText(re)):(navigator.clipboard.writeText(A.url),F(!0))},onBlur:()=>{F(!1)}})]}),(0,$t.jsxs)("div",{className:"project-share-actions",children:[(0,$t.jsxs)("div",{className:"project-share-social",children:[(0,$t.jsx)(Zt,{className:"square-button neutral embed mobile-portrait-hidden",title:lf("Show embed code"),leftIcon:"fas fa-code",onClick:()=>{"none"===R?(pxt.tickEvent("share.embed"),U(!1),H(!1),M("code")):M("none")}}),(0,$t.jsx)(Un,{className:"square-button facebook",url:null==A?void 0:A.url,type:"facebook",heading:lf("Share on Facebook")}),(0,$t.jsx)(Un,{className:"square-button twitter",url:null==A?void 0:A.url,type:"twitter",heading:lf("Share on Twitter")}),(0,$t.jsx)(Un,{className:"square-button google-classroom",url:null==A?void 0:A.url,type:"google-classroom",heading:lf("Share on Google Classroom")}),(0,$t.jsx)(Un,{className:"square-button microsoft-teams",url:null==A?void 0:A.url,type:"microsoft-teams",heading:lf("Share on Microsoft Teams")}),(0,$t.jsx)(Un,{className:"square-button whatsapp",url:null==A?void 0:A.url,type:"whatsapp",heading:lf("Share on WhatsApp")}),(null===(l=pxt.appTarget)||void 0===l||null===(s=l.appTheme)||void 0===s?void 0:s.shareToKiosk)&&(0,$t.jsx)(Zt,{className:"square-button neutral mobile-portrait-hidden social-button",title:lf("Share to MakeCode Arcade Kiosk"),leftIcon:"xicon kiosk",onClick:()=>{B?H(!1):(pxt.tickEvent("share.kiosk"),M("none"),U(!1),H(!0))}}),navigator.share&&(0,$t.jsx)(Zt,{className:"square-button device-share social-button",title:lf("Show device share options"),ariaLabel:lf("Show device share options"),leftIcon:"icon share",onClick:async()=>{var e,t;pxt.tickEvent("share.device");const n={title:document.title,url:A.url,text:lf("Check out my new MakeCode project!")};if(null!==(e=navigator)&&void 0!==e&&null!==(t=e.canShare)&&void 0!==t&&t.call(e,n))return navigator.share(n)}})]}),(0,$t.jsx)(Zt,{className:"menu-button project-qrcode",buttonRef:e=>{e&&(ne=e)},title:lf("Show QR Code"),label:(0,$t.jsx)("img",{className:"qrcode-image",src:null==A?void 0:A.qr,alt:lf("QR code to access your project"),"aria-label":lf("Project share link QR code")}),onClick:()=>{pxt.tickEvent("share.qrtoggle"),L?U(!1):(M("none"),U(!0),H(!1))}})]})]}),"none"!==R&&(0,$t.jsxs)("div",{className:"project-embed",children:[(0,$t.jsx)(An,{id:"project-embed-toggle",className:"slim tablet-compact",items:ie,selected:ie.findIndex(e=>e.name===R)}),(0,$t.jsx)(Mn,{readOnly:!0,rows:5,initialValue:null==A?void 0:A.embed[R],ariaLabel:lf("Embed code textarea")})]}),B&&(0,$t.jsxs)("div",{children:[(0,$t.jsxs)("div",{className:"project-share-label",children:[lf("Enter Kiosk Code"),(0,$t.jsx)(Zt,{className:"link-button kiosk",title:lf("Learn more about Kiosk"),leftIcon:"far fa-question-circle",onClick:()=>{window.open("https://arcade.makecode.com/hardware/kiosk","_blank")}})]}),(0,$t.jsxs)("div",{className:"common-input-attached-button",children:[(0,$t.jsx)(Rn,{handleInputRef:e=>{e&&(oe=e)},ariaDescribedBy:"share-input-title",preserveValueOnBlur:!0,placeholder:"A12B3C"}),(0,$t.jsx)(Zt,{className:z?"green":"primary",title:lf("Submit Kiosk Code"),label:z?lf("Submitted!"):lf("Submit"),onClick:async()=>{var e;pxt.tickEvent("share.kiosk.submitClicked");const t=pxt.Cloud.parseScriptId(A.url);if(null!==(e=oe)&&void 0!==e&&e.value){var n;let e=null===(n=/^[a-zA-Z0-9]{6}$/.exec(oe.value))||void 0===n?void 0:n[0];if(e){e=e.toUpperCase(),$(!0);try{await(async(e,t)=>{const n=await fetch("https://makecode.com/api/kiosk/updatecode",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({kioskCode:e,shareId:t})});if(!n.ok)throw new Error(n.statusText)})(e,t),pxt.tickEvent("share.kiosk.submitSuccessful"),Hn({kind:"info",text:lf("Game submitted to kiosk {0} successfully!",e),hc:!1})}catch(t){pxt.tickEvent("share.kiosk.submitServerError"),"Not Found"===t.message?Hn({kind:"err",text:lf("Kiosk Code not found"),hc:!1}):Hn({kind:"err",text:lf("Something went wrong submitting game to kiosk {0}",e),hc:!1})}}else Hn({kind:"err",text:lf("Invalid format for Kiosk Code"),hc:!1})}else Hn({kind:"err",text:lf("Input a six-character kiosk Code"),hc:!1})},onBlur:()=>{$(!1)}})]})]})]}),"gifrecord"===j&&(0,$t.jsx)(Ln,{initialUri:I,onApply:e=>{T(e),ae()},onCancel:ae,simRecorder:f})]}),L&&(0,$t.jsx)(En,{title:lf("QR Code"),onClose:()=>{U(!1),ne&&ne.focus()},ariaLabel:lf("QR Code modal"),children:(0,$t.jsx)("div",{className:"qrcode-modal-body",children:(0,$t.jsx)("img",{className:"qrcode-image",src:null==A?void 0:A.qr,alt:lf("QR code to access your project"),"aria-label":lf("Project share link QR code enlarged")})})}),V&&(0,$t.jsx)(Fn,{onCancelClicked:async()=>{G(!1),pxt.tickEvent("share.hostMultiplayerCancel")},onConfirmClicked:async()=>{N("publishing"),G(!1),_(q);const e=await h(x,C,I,q,K?b:void 0),t=pxt.Cloud.parseScriptId(e.url);if(!t)return void pxt.tickEvent("share.hostMultiplayerError");const n=pxt.multiplayer.makeHostLink(t,!1);pxt.tickEvent("share.hostMultiplayerShared",{shareId:t}),window.open(n,"_blank"),P(e),null!=e&&e.error?N("share"):N("publish"),"multiplayer"===w&&k()}})]})})},Vn=e=>{const{projectName:t,projectDescription:n,screenshotUri:r,isLoggedIn:o,simRecorder:a,publishAsync:i,hasProjectBeenPersistentShared:l,anonymousShareByDefault:s,setAnonymousSharePreference:c,isMultiplayerGame:u,simulatorTheme:d,kind:p,onClose:f}=e;return(0,$t.jsx)("div",{className:"project-share",children:(0,$t.jsx)(Wn,{projectName:t,projectDescription:n,isLoggedIn:o,screenshotUri:r,simRecorder:a,publishAsync:i,isMultiplayerGame:u,simulatorTheme:d,kind:p,hasProjectBeenPersistentShared:l,anonymousShareByDefault:s,setAnonymousSharePreference:c,onClose:f})})};let Gn;function Kn(){return Gn||(Gn=pxt.BrowserUtils.loadScriptAsync("pdf-lib/pdf-lib.min.js").then(()=>"undefined"!=typeof PDFLib).catch(e=>!1)),Gn}var Qn=n(3705);var Yn={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Zn(e){Yn=e}var Xn={exec:()=>null};function Jn(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(tr.caret,"$1"),n=n.replace(e,o),r},getRegex:()=>new RegExp(n,t)};return r}var er=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),tr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},nr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,rr=/(?:[*+-]|\d{1,9}[.)])/,or=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ar=Jn(or).replace(/bull/g,rr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ir=Jn(or).replace(/bull/g,rr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),lr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,sr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,cr=Jn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",sr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ur=Jn(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,rr).getRegex(),dr="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",pr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,fr=Jn("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",pr).replace("tag",dr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),hr=Jn(lr).replace("hr",nr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dr).getRegex(),mr={blockquote:Jn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",hr).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:cr,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:nr,html:fr,lheading:ar,list:ur,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:hr,table:Xn,text:/^[^\n]+/},gr=Jn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",nr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dr).getRegex(),yr={...mr,lheading:ir,table:gr,paragraph:Jn(lr).replace("hr",nr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gr).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dr).getRegex()},vr={...mr,html:Jn("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",pr).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Xn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Jn(lr).replace("hr",nr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ar).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},br=/^( {2,}|\\)\n(?!\s*$)/,wr=/[\p{P}\p{S}]/u,kr=/[\s\p{P}\p{S}]/u,xr=/[^\s\p{P}\p{S}]/u,Sr=Jn(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,kr).getRegex(),Cr=/(?!~)[\p{P}\p{S}]/u,Er=Jn(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",er?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ir=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Tr=Jn(Ir,"u").replace(/punct/g,wr).getRegex(),jr=Jn(Ir,"u").replace(/punct/g,Cr).getRegex(),Nr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ar=Jn(Nr,"gu").replace(/notPunctSpace/g,xr).replace(/punctSpace/g,kr).replace(/punct/g,wr).getRegex(),Pr=Jn(Nr,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,Cr).getRegex(),Or=Jn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,xr).replace(/punctSpace/g,kr).replace(/punct/g,wr).getRegex(),_r=Jn(/\\(punct)/,"gu").replace(/punct/g,wr).getRegex(),Rr=Jn(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Mr=Jn(pr).replace("(?:--\x3e|$)","--\x3e").getRegex(),Lr=Jn("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Mr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ur=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Dr=Jn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ur).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Fr=Jn(/^!?\[(label)\]\[(ref)\]/).replace("label",Ur).replace("ref",sr).getRegex(),zr=Jn(/^!?\[(ref)\](?:\[\])?/).replace("ref",sr).getRegex(),$r=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Br={_backpedal:Xn,anyPunctuation:_r,autolink:Rr,blockSkip:Er,br:br,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:Xn,emStrongLDelim:Tr,emStrongRDelimAst:Ar,emStrongRDelimUnd:Or,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Dr,nolink:zr,punctuation:Sr,reflink:Fr,reflinkSearch:Jn("reflink|nolink(?!\\()","g").replace("reflink",Fr).replace("nolink",zr).getRegex(),tag:Lr,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:Xn},Hr={...Br,link:Jn(/^!?\[(label)\]\((.*?)\)/).replace("label",Ur).getRegex(),reflink:Jn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ur).getRegex()},qr={...Br,emStrongRDelimAst:Pr,emStrongLDelim:jr,url:Jn(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",$r).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Jn(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",$r).getRegex()},Wr={...qr,br:Jn(br).replace("{2,}","*").getRegex(),text:Jn(qr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Vr={normal:mr,gfm:yr,pedantic:vr},Gr={normal:Br,gfm:qr,breaks:Wr,pedantic:Hr},Kr={"&":"&","<":"<",">":">",'"':""","'":"'"},Qr=e=>Kr[e];function Yr(e,t){if(t){if(tr.escapeTest.test(e))return e.replace(tr.escapeReplace,Qr)}else if(tr.escapeTestNoEncode.test(e))return e.replace(tr.escapeReplaceNoEncode,Qr);return e}function Zr(e){try{e=encodeURI(e).replace(tr.percentDecode,"%")}catch{return null}return e}function Xr(e,t){let n=e.replace(tr.findPipe,(e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}).split(tr.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(tr.slashPipe,"|");return n}function Jr(e,t,n){let r=e.length;if(0===r)return"";let o=0;for(;o<r;){let a=e.charAt(r-o-1);if(a!==t||n){if(a===t||!n)break;o++}else o++}return e.slice(0,r-o)}function eo(e,t,n,r,o){let a=t.href,i=t.title||null,l=e[1].replace(o.other.outputLinkReplace,"$1");r.state.inLink=!0;let s={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:a,title:i,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,s}var to=class{options;rules;lexer;constructor(e){this.options=e||Yn}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Jr(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let o=r[1];return t.split("\n").map(e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return r.length>=o.length?e.slice(o.length):e}).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Jr(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Jr(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Jr(t[0],"\n").split("\n"),n="",r="",o=[];for(;e.length>0;){let t,a=!1,i=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))i.push(e[t]),a=!0;else{if(a)break;i.push(e[t])}e=e.slice(t);let l=i.join("\n"),s=l.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${l}`:l,r=r?`${r}\n${s}`:s;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(s,o,!0),this.lexer.state.top=c,0===e.length)break;let u=o.at(-1);if("code"===u?.type)break;if("blockquote"===u?.type){let t=u,a=t.raw+"\n"+e.join("\n"),i=this.blockquote(a);o[o.length-1]=i,n=n.substring(0,n.length-t.raw.length)+i.raw,r=r.substring(0,r.length-t.text.length)+i.text;break}if("list"!==u?.type);else{let t=u,a=t.raw+"\n"+e.join("\n"),i=this.list(a);o[o.length-1]=i,n=n.substring(0,n.length-u.raw.length)+i.raw,r=r.substring(0,r.length-t.raw.length)+i.raw,e=a.substring(o.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:o,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let a=this.rules.other.listItemRegex(n),i=!1;for(;e;){let n=!1,r="",l="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let s=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,e=>" ".repeat(3*e.length)),c=e.split("\n",1)[0],u=!s.trim(),d=0;if(this.options.pedantic?(d=2,l=s.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,l=s.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),o=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),i=this.rules.other.htmlBeginRegex(d);for(;e;){let p,f=e.split("\n",1)[0];if(c=f,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),p=c):p=c.replace(this.rules.other.tabCharGlobal," "),o.test(c)||a.test(c)||i.test(c)||t.test(c)||n.test(c))break;if(p.search(this.rules.other.nonSpaceChar)>=d||!c.trim())l+="\n"+p.slice(d);else{if(u||s.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||o.test(s)||a.test(s)||n.test(s))break;l+="\n"+c}!u&&!c.trim()&&(u=!0),r+=f+"\n",e=e.substring(f.length+1),s=p.slice(d)}}o.loose||(i?o.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(i=!0));let p=null;this.options.gfm&&(p=this.rules.other.listIsTask.exec(l),p&&(l=l.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:r,task:!!p,loose:!1,text:l,tokens:[]}),o.raw+=r}let l=o.items.at(-1);if(!l)return;l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd(),o.raw=o.raw.trimEnd();for(let e of o.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:"checkbox",raw:t[0]+" ",checked:"[ ]"!==t[0]};e.checked=n.checked,o.loose?e.tokens[0]&&["paragraph","text"].includes(e.tokens[0].type)&&"tokens"in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:"paragraph",raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!o.loose){let t=e.tokens.filter(e=>"space"===e.type),n=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw));o.loose=n}}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)"text"===t.type&&(t.type="paragraph")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Xr(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push("right"):this.rules.other.tableAlignCenter.test(e)?a.align.push("center"):this.rules.other.tableAlignLeft.test(e)?a.align.push("left"):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of o)a.rows.push(Xr(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=Jr(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){let n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),eo(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return eo(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){let n,o,a=[...r[0]].length-1,i=a,l=0,s="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(s.lastIndex=0,t=t.slice(-1*e.length+a);null!=(r=s.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(o=[...n].length,r[3]||r[4]){i+=o;continue}if((r[5]||r[6])&&a%3&&!((a+o)%3)){l+=o;continue}if(i-=o,i>0)continue;o=Math.min(o,o+i+l);let t=[...r[0]][0].length,s=e.slice(0,a+r.index+t+o);if(Math.min(a,o)%2){let e=s.slice(1,-1);return{type:"em",raw:s,text:e,tokens:this.lexer.inlineTokens(e)}}let c=s.slice(2,-2);return{type:"strong",raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},no=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Yn,this.options.tokenizer=this.options.tokenizer||new to,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:tr,block:Vr.normal,inline:Gr.normal};this.options.pedantic?(t.block=Vr.pedantic,t.inline=Gr.pedantic):this.options.gfm&&(t.block=Vr.gfm,this.options.breaks?t.inline=Gr.breaks:t.inline=Gr.gfm),this.tokenizer.rules=t}static get rules(){return{block:Vr,inline:Gr}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(tr.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(tr.tabCharGlobal," ").replace(tr.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(o=e.substring(0,n+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){let a=t.at(-1);n&&"paragraph"===a?.type?(a.raw+=(a.raw.endsWith("\n")?"":"\n")+r.raw,a.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=o.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){Qn.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r=e,o=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(r));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(r));)r=r.slice(0,o.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(r));)n=o[2]?o[2].length:0,r=r.slice(0,o.index+n)+"["+"a".repeat(o[0].length-n-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let a=!1,i="";for(;e;){let n;if(a||(i=""),a=!1,this.options.extensions?.inline?.some(r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))continue;if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length);let r=t.at(-1);"text"===n.type&&"text"===r?.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,r,i)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}let o=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(o=e.substring(0,n+1))}if(n=this.tokenizer.inlineText(o)){e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(i=n.raw.slice(-1)),a=!0;let r=t.at(-1);"text"===r?.type?(r.raw+=n.raw,r.text+=n.text):t.push(n)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){Qn.error(t);break}throw new Error(t)}}return t}},ro=class{options;parser;constructor(e){this.options=e||Yn}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(tr.notSpaceStart)?.[0],o=e.replace(tr.endingNewline,"")+"\n";return r?'<pre><code class="language-'+Yr(r)+'">'+(n?o:Yr(o,!0))+"</code></pre>\n":"<pre><code>"+(n?o:Yr(o,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let o=t?"ol":"ul";return"<"+o+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+o+">\n"}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let o=e.rows[t];n="";for(let e=0;e<o.length;e++)n+=this.tablecell(o[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Yr(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),o=Zr(e);if(null===o)return r;let a='<a href="'+(e=o)+'"';return t&&(a+=' title="'+Yr(t)+'"'),a+=">"+r+"</a>",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let o=Zr(e);if(null===o)return Yr(n);let a=`<img src="${e=o}" alt="${n}"`;return t&&(a+=` title="${Yr(t)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Yr(e.text)}},oo=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},ao=class e{options;renderer;textRenderer;constructor(e){this.options=e||Yn,this.options.renderer=this.options.renderer||new ro,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new oo}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==n||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(e.type)){t+=n||"";continue}}let o=r;switch(o.type){case"space":t+=this.renderer.space(o);break;case"hr":t+=this.renderer.hr(o);break;case"heading":t+=this.renderer.heading(o);break;case"code":t+=this.renderer.code(o);break;case"table":t+=this.renderer.table(o);break;case"blockquote":t+=this.renderer.blockquote(o);break;case"list":t+=this.renderer.list(o);break;case"checkbox":t+=this.renderer.checkbox(o);break;case"html":t+=this.renderer.html(o);break;case"def":t+=this.renderer.def(o);break;case"paragraph":t+=this.renderer.paragraph(o);break;case"text":t+=this.renderer.text(o);break;default:{let e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return Qn.error(e),"";throw new Error(e)}}}return t}parseInline(e,t=this.renderer){let n="";for(let r=0;r<e.length;r++){let o=e[r];if(this.options.extensions?.renderers?.[o.type]){let e=this.options.extensions.renderers[o.type].call({parser:this},o);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=e||"";continue}}let a=o;switch(a.type){case"escape":case"text":n+=t.text(a);break;case"html":n+=t.html(a);break;case"link":n+=t.link(a);break;case"image":n+=t.image(a);break;case"checkbox":n+=t.checkbox(a);break;case"strong":n+=t.strong(a);break;case"em":n+=t.em(a);break;case"codespan":n+=t.codespan(a);break;case"br":n+=t.br(a);break;case"del":n+=t.del(a);break;default:{let e='Token with "'+a.type+'" type was not found.';if(this.options.silent)return Qn.error(e),"";throw new Error(e)}}}return n}},io=class{options;block;constructor(e){this.options=e||Yn}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?no.lex:no.lexInline}provideParser(){return this.block?ao.parse:ao.parseInline}},lo=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ao;Renderer=ro;TextRenderer=oo;Lexer=no;Tokenizer=to;Hooks=io;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let o=e[r].flat(1/0);n=n.concat(this.walkTokens(o,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ro(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,o=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=a.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new to(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,o=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new io;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,o=e.hooks[r],a=t[r];io.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&io.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await o.call(t,e);return a.call(t,n)})();let r=o.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await o.apply(t,e);return!1===n&&(n=await a.apply(t,e)),n})();let n=o.apply(t,e);return!1===n&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return no.lex(e,t??this.defaults)}parser(e,t){return ao.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},o={...this.defaults,...r},a=this.onError(!!o.silent,!!o.async);if(!0===this.defaults.async&&!1===r.async)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let n=o.hooks?await o.hooks.preprocess(t):t,r=await(o.hooks?await o.hooks.provideLexer():e?no.lex:no.lexInline)(n,o),a=o.hooks?await o.hooks.processAllTokens(r):r;o.walkTokens&&await Promise.all(this.walkTokens(a,o.walkTokens));let i=await(o.hooks?await o.hooks.provideParser():e?ao.parse:ao.parseInline)(a,o);return o.hooks?await o.hooks.postprocess(i):i})().catch(a);try{o.hooks&&(t=o.hooks.preprocess(t));let n=(o.hooks?o.hooks.provideLexer():e?no.lex:no.lexInline)(t,o);o.hooks&&(n=o.hooks.processAllTokens(n)),o.walkTokens&&this.walkTokens(n,o.walkTokens);let r=(o.hooks?o.hooks.provideParser():e?ao.parse:ao.parseInline)(n,o);return o.hooks&&(r=o.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+Yr(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function so(e,t){return lo.parse(e,t)}so.options=so.setOptions=function(e){return lo.setOptions(e),so.defaults=lo.defaults,Zn(so.defaults),so},so.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},so.defaults=Yn,so.use=function(...e){return lo.use(...e),so.defaults=lo.defaults,Zn(so.defaults),so},so.walkTokens=function(e,t){return lo.walkTokens(e,t)},so.parseInline=lo.parseInline,so.Parser=ao,so.parser=ao.parse,so.Renderer=ro,so.TextRenderer=oo,so.Lexer=no,so.lexer=no.lex,so.Tokenizer=to,so.Hooks=io,so.parse=so,so.options,so.setOptions,so.use,so.walkTokens,so.parseInline;var co=so,uo=(ao.parse,no.lex,n(3705));function po(e,t){this.v=e,this.k=t}function fo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ho(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return fo(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fo(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mo(e){var t,n;function r(t,n){try{var a=e[t](n),i=a.value,l=i instanceof po;Promise.resolve(l?i.v:i).then(function(n){if(l){var s="return"===t&&i.k?t:"next";if(!i.k||n.done)return r(s,n);n=e[s](n).value}o(!!a.done,n)},function(e){r("throw",e)})}catch(e){o(2,e)}}function o(e,o){2===e?t.reject(o):t.resolve({value:o,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise(function(a,i){var l={key:e,arg:o,resolve:a,reject:i,next:null};n?n=n.next=l:(t=n=l,r(e,o))})},"function"!=typeof e.return&&(this.return=void 0)}mo.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},mo.prototype.next=function(e){return this._invoke("next",e)},mo.prototype.throw=function(e){return this._invoke("throw",e)},mo.prototype.return=function(e){return this._invoke("return",e)};const go=Object.entries,yo=Object.setPrototypeOf,vo=Object.isFrozen,bo=Object.getPrototypeOf,wo=Object.getOwnPropertyDescriptor;let ko=Object.freeze,xo=Object.seal,So=Object.create,Co="undefined"!=typeof Reflect&&Reflect,Eo=Co.apply,Io=Co.construct;ko||(ko=function(e){return e}),xo||(xo=function(e){return e}),Eo||(Eo=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return e.apply(t,r)}),Io||(Io=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const To=Zo(Array.prototype.forEach);Array.prototype.indexOf;const jo=Zo(Array.prototype.lastIndexOf),No=Zo(Array.prototype.pop),Ao=Zo(Array.prototype.push),Po=Zo(Array.prototype.slice),Oo=Zo(Array.prototype.splice),_o=Array.isArray,Ro=Xo(Set),Mo=Zo(Set.prototype.add),Lo=Zo(Set.prototype.has),Uo=Zo(String.prototype.toLowerCase),Do=Zo(String.prototype.toString),Fo=Zo(String.prototype.match),zo=Zo(String.prototype.replace),$o=Zo(String.prototype.indexOf),Bo=Zo(String.prototype.trim),Ho=Zo(Number.prototype.toString),qo=Zo(Boolean.prototype.toString),Wo="undefined"==typeof BigInt?null:Zo(BigInt.prototype.toString),Vo="undefined"==typeof Symbol?null:Zo(Symbol.prototype.toString),Go=Zo(Object.prototype.hasOwnProperty),Ko=Zo(Object.prototype.toString),Qo=Zo(RegExp.prototype.test),Yo=Xo(TypeError);function Zo(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Eo(e,t,r)}}function Xo(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Io(e,n)}}function Jo(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Uo;if(yo&&yo(e,null),!_o(t))return e;let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(vo(t)||(t[r]=e),o=e)}e[o]=!0}return e}function ea(e){for(let t=0;t<e.length;t++)Go(e,t)||(e[t]=null);return e}function ta(e){const t=So(null);for(const r of go(e)){var n=ho(r,2);const o=n[0],a=n[1];Go(e,o)&&(_o(a)?t[o]=ea(a):a&&"object"==typeof a&&a.constructor===Object?t[o]=ta(a):t[o]=a)}return t}function na(e,t){for(;null!==e;){const n=wo(e,t);if(n){if(n.get)return Zo(n.get);if("function"==typeof n.value)return Zo(n.value)}e=bo(e)}return function(){return null}}const ra=ko(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),oa=ko(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),aa=ko(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ia=ko(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),la=ko(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),sa=ko(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ca=ko(["#text"]),ua=ko(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),da=ko(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),pa=ko(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),fa=ko(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ha=xo(/{{[\w\W]*|^[\w\W]*}}/g),ma=xo(/<%[\w\W]*|^[\w\W]*%>/g),ga=xo(/\${[\w\W]*/g),ya=xo(/^data-[\-\w.\u00B7-\uFFFF]+$/),va=xo(/^aria-[\-\w]+$/),ba=xo(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),wa=xo(/^(?:\w+script|data):/i),ka=xo(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),xa=xo(/^html$/i),Sa=xo(/^[a-z][.\w]*(-[.\w]+)+$/i),Ca=xo(/<[/\w!]/g),Ea=xo(/<[/\w]/g),Ia=xo(/<\/no(script|embed|frames)/i),Ta=xo(/\/>/i),ja=ko(Jo({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),Na=function(e,t,n,r){return Go(e,t)&&_o(e[t])?Jo(r.base?ta(r.base):{},e[t],r.transform):n},Aa=function(e,t,n){const r=Go(e,t)?e[t]:void 0;return r&&"object"==typeof r?ta(r):n()};var Pa=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window;const n=t=>e(t);if(n.version="3.4.17",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let r=t.document;const o=r,a=o.currentScript;t.DocumentFragment;const i=t.HTMLTemplateElement,l=t.Node,s=t.Element,c=t.NodeFilter;void 0===t.NamedNodeMap&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const u=t.DOMParser,d=t.trustedTypes,p=s.prototype,f=na(p,"cloneNode"),h=na(p,"remove"),m=na(p,"removeAttributeNode"),g=na(p,"nextSibling"),y=na(p,"childNodes"),v=na(p,"parentNode"),b=na(p,"shadowRoot"),w=na(p,"attributes"),k=l&&l.prototype?na(l.prototype,"nodeType"):null,x=l&&l.prototype?na(l.prototype,"nodeName"):null,S=l&&l.prototype?na(l.prototype,"ownerDocument"):null,C=function(e){return k?k(e):e.nodeType},E=function(e){return x?x(e):e.nodeName},I=function(e){for(;null!==e;){const t=wo(e,"namespaceURI");if(t)return t.get?Zo(t.get):null;e=bo(e)}return null}(p),T=function(e){return I?I(e):e.namespaceURI};if("function"==typeof i){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let j,N,A="",P=!1,O=0;const _=function(){if(O>0)throw Yo('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},R=function(e){_(),O++;try{return j.createHTML(e)}finally{O--}},M=r,L=M.implementation,U=M.createNodeIterator,D=M.createDocumentFragment,F=M.getElementsByTagName,z=o.importNode;let $={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof go&&"function"==typeof v&&L&&void 0!==L.createHTMLDocument;const B=ha,H=ma,q=ga,W=ya,V=va,G=wa,K=ka,Q=Sa;let Y=ba,Z=null;const X=Jo({},[...ra,...oa,...aa,...la,...ca]);let J=null;const ee=Jo({},[...ua,...da,...pa,...fa]);let te=Object.seal(So(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ne=null,re=null;const oe=Object.seal(So(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ae=!0,ie=!0,le=!1,se=!0,ce=!1,ue=!0,de=!1,pe=!1,fe=null,he=null,me=!1,ge=!1,ye=!1,ve=!1,be=!0,we=!1;const ke="user-content-";let xe=!0,Se=!1,Ce=null,Ee={},Ie=null;const Te=Jo({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let je=null;const Ne=Jo({},["audio","video","img","source","image","track"]);let Ae=null;const Pe=Jo({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Oe="http://www.w3.org/1998/Math/MathML",_e="http://www.w3.org/2000/svg",Re="http://www.w3.org/1999/xhtml";let Me=Re,Le=!1,Ue=null;const De=Jo({},[Oe,_e,Re],Do),Fe=ko(["mi","mo","mn","ms","mtext"]);let ze=Jo({},Fe);const $e=ko(["annotation-xml"]);let Be=Jo({},$e);const He=Jo({},["title","style","font","a","script"]);let qe=null;const We=["application/xhtml+xml","text/html"];let Ve=null,Ge=null;const Ke=r.createElement("form"),Qe=function(e){return e instanceof RegExp||e instanceof Function},Ye=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Ge&&Ge===e)return;e&&"object"==typeof e||(e={}),e=ta(e),qe=-1===We.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ve="application/xhtml+xml"===qe?Do:Uo,Z=Na(e,"ALLOWED_TAGS",X,{transform:Ve}),J=Na(e,"ALLOWED_ATTR",ee,{transform:Ve}),Ue=Na(e,"ALLOWED_NAMESPACES",De,{transform:Do}),Ae=Na(e,"ADD_URI_SAFE_ATTR",Pe,{transform:Ve,base:Pe}),je=Na(e,"ADD_DATA_URI_TAGS",Ne,{transform:Ve,base:Ne}),Ie=Na(e,"FORBID_CONTENTS",Te,{transform:Ve}),ne=Na(e,"FORBID_TAGS",ta({}),{transform:Ve}),re=Na(e,"FORBID_ATTR",ta({}),{transform:Ve}),Ee=!!Go(e,"USE_PROFILES")&&(e.USE_PROFILES&&"object"==typeof e.USE_PROFILES?ta(e.USE_PROFILES):e.USE_PROFILES),ae=!1!==e.ALLOW_ARIA_ATTR,ie=!1!==e.ALLOW_DATA_ATTR,le=e.ALLOW_UNKNOWN_PROTOCOLS||!1,se=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ce=e.SAFE_FOR_TEMPLATES||!1,ue=!1!==e.SAFE_FOR_XML,de=e.WHOLE_DOCUMENT||!1,ge=e.RETURN_DOM||!1,ye=e.RETURN_DOM_FRAGMENT||!1,ve=e.RETURN_TRUSTED_TYPE||!1,me=e.FORCE_BODY||!1,be=!1!==e.SANITIZE_DOM,we=e.SANITIZE_NAMED_PROPS||!1,xe=!1!==e.KEEP_CONTENT,Se=e.IN_PLACE||!1,Y=function(e){try{return Qo(e,""),!0}catch(e){return!1}}(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:ba,Me="string"==typeof e.NAMESPACE?e.NAMESPACE:Re,ze=Aa(e,"MATHML_TEXT_INTEGRATION_POINTS",()=>Jo({},Fe)),Be=Aa(e,"HTML_INTEGRATION_POINTS",()=>Jo({},$e));const t=Aa(e,"CUSTOM_ELEMENT_HANDLING",()=>So(null));if(te=So(null),Go(t,"tagNameCheck")&&Qe(t.tagNameCheck)&&(te.tagNameCheck=t.tagNameCheck),Go(t,"attributeNameCheck")&&Qe(t.attributeNameCheck)&&(te.attributeNameCheck=t.attributeNameCheck),Go(t,"allowCustomizedBuiltInElements")&&"boolean"==typeof t.allowCustomizedBuiltInElements&&(te.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),xo(te),ce&&(ie=!1),ye&&(ge=!0),Ee&&(Z=Jo({},ca),J=So(null),!0===Ee.html&&(Jo(Z,ra),Jo(J,ua)),!0===Ee.svg&&(Jo(Z,oa),Jo(J,da),Jo(J,fa)),!0===Ee.svgFilters&&(Jo(Z,aa),Jo(J,da),Jo(J,fa)),!0===Ee.mathMl&&(Jo(Z,la),Jo(J,pa),Jo(J,fa))),oe.tagCheck=null,oe.attributeCheck=null,Go(e,"ADD_TAGS")&&("function"==typeof e.ADD_TAGS?oe.tagCheck=e.ADD_TAGS:_o(e.ADD_TAGS)&&(Z===X&&(Z=ta(Z)),Jo(Z,e.ADD_TAGS,Ve))),Go(e,"ADD_ATTR")&&("function"==typeof e.ADD_ATTR?oe.attributeCheck=e.ADD_ATTR:_o(e.ADD_ATTR)&&(J===ee&&(J=ta(J)),Jo(J,e.ADD_ATTR,Ve))),Go(e,"ADD_FORBID_CONTENTS")&&_o(e.ADD_FORBID_CONTENTS)&&(Ie===Te&&(Ie=ta(Ie)),Jo(Ie,e.ADD_FORBID_CONTENTS,Ve)),xe&&(Z["#text"]=!0),de&&Jo(Z,["html","head","body"]),Z.table&&(Jo(Z,["tbody"]),delete ne.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Yo('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Yo('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const t=j;j=e.TRUSTED_TYPES_POLICY;try{A=R("")}catch(e){throw j=t,e}}else null===e.TRUSTED_TYPES_POLICY?(j=void 0,A=""):(void 0===j&&(P||(N=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return uo.warn("TrustedTypes policy "+o+" could not be created."),null}}(d,a),P=!0),j=N),j&&"string"==typeof A&&(A=R("")));ko&&ko(e),Ge=e},Ze=Jo({},[...oa,...aa,...ia]),Xe=Jo({},[...la,...sa]),Je=function(e){Ao(n.removed,{element:e});try{v(e).removeChild(e)}catch(t){if(h(e),!v(e))throw Yo("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},et=function(e,t,n){try{m(e,t)}catch(t){try{e.removeAttribute(n)}catch(e){}}},tt=function(e){at(e);const t=y(e);t&&To(Po(t),e=>{try{h(e)}catch(e){}});const n=1===C(e)?w(e):null;if(n)for(let t=n.length-1;t>=0;--t){const r=n[t],o=r&&r.name;"string"==typeof o&&et(e,r,o)}},nt=function(e,t,r){if(!r)try{r=t.getAttributeNode(e)}catch(e){r=null}Ao(n.removed,{attribute:r||null,from:t});try{r?m(t,r):t.removeAttribute(e)}catch(n){try{t.removeAttribute(e)}catch(e){}}if("is"===e)if(ge||ye)try{Je(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},rt=function(e){const t=w(e);if(t)for(let n=t.length-1;n>=0;--n){const r=t[n],o=r&&r.name;"string"!=typeof o||J[Ve(o)]||et(e,r,o)}},ot=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[e];for(;r.length>0;){const e=r.pop();if(!1===t(e))continue;if(n&&1===C(e)){const t=b(e);gt(t)&&r.push(t)}const o=y(e);if(o)for(let e=o.length-1;e>=0;--e)r.push(o[e])}},at=function(e){ot(e,e=>{1===C(e)&&rt(e)})},it=function(e){const t=[];return ot(e,e=>{t.push(e)},!0),t},lt=function(e,t){let r=!1;return To(n.removed,t=>{t.element&&(r=r||t.element===e,at(t.element))}),function(e,t){const n=Ro();To(it(e),e=>{1===C(e)&&Mo(n,e)}),To(t,e=>{1!==C(e)||Lo(n,e)||rt(e)})}(e,t),r},st=function(e,t,n,r){const o=dt(e);let a;for(;a=o.nextNode();)Lo(r,a)&&!Lo(Ce,a)&&(t&&vt($.uponSanitizeShadowNode,a,null),xt(a,n),Nt(a,n),gt(a.content)&&At(a.content))},ct=function(e,t){return!!ue&&("patchsrc"===e||"for"===e&&"label"!==t&&"output"!==t)},ut=function(e){let t=null,n=null;if(me)e="<remove></remove>"+e;else{const t=Fo(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===qe&&Me===Re&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=j?R(e):e;if(Me===Re)try{t=(new u).parseFromString(o,qe)}catch(e){}if(!t||!t.documentElement){t=L.createDocument(Me,"template",null);try{t.documentElement.innerHTML=Le?A:o}catch(e){}}const a=t.body||t.documentElement;return e&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),Me===Re?F.call(t,de?"html":"body")[0]:de?t.documentElement:a},dt=function(e){const t=S?S(e):e.ownerDocument;return U.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},pt=function(e){return e=zo(e,B," "),e=zo(e,H," "),zo(e,q," ")},ft=function(e){var t;ht(e);const n=null===(t=e.querySelectorAll)||void 0===t?void 0:t.call(e,"template");n&&To(n,e=>{gt(e.content)&&ft(e.content)})},ht=function(e){e.normalize();const t=S?S(e):e.ownerDocument,n=U.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let r=n.nextNode();for(;r;)r.data=pt(r.data),r=n.nextNode()},mt=function(e){const t=x?x(e):null;return"string"==typeof t&&"form"===Ve(t)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||e.attributes!==w(e)||"function"!=typeof e.removeAttribute||"function"!=typeof e.removeAttributeNode||"function"!=typeof e.getAttributeNode||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes||e.nodeType!==k(e)||e.childNodes!==y(e))},gt=function(e){if(!k||"object"!=typeof e||null===e)return!1;try{return 11===k(e)}catch(e){return!1}},yt=function(e){if(!k||"object"!=typeof e||null===e)return!1;try{return"number"==typeof k(e)}catch(e){return!1}};function vt(e,t,r){0!==e.length&&To(e,e=>{e.call(n,t,r,Ge)})}const bt=function(e,t){if(e instanceof RegExp)return Qo(e,t);if(e instanceof Function){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return Boolean(e(t,...r))}return!1},wt=function(e,t,n,r){return 0===e.length?t:t===n||t===r?ta(t):t},kt=function(e,t){return e!==t&&null===v(e)&&(Se&&at(e),!0)},xt=function(e,t){if(Ce&&Mo(Ce,e),vt($.beforeSanitizeElements,e,null),kt(e,t))return!0;if(mt(e))return Je(e),!0;const r=Ve(E(e));if(Z=wt($.uponSanitizeElement,Z,X,fe),vt($.uponSanitizeElement,e,{tagName:r,allowedTags:Z}),kt(e,t))return!0;if(function(e,t){return!!(ue&&e.hasChildNodes()&&!yt(e.firstElementChild)&&Qo(Ca,e.textContent)&&Qo(Ca,e.innerHTML))||!!(ue&&ja[t]&&1===C(e)&&T(e)===Re&&(yt(e.firstElementChild)||"string"==typeof e.textContent&&Qo(Ca,e.textContent)))||7===e.nodeType||!(!ue||8!==e.nodeType||!Qo(Ea,e.data))}(e,r))return Je(e),!0;if(ne[r]||!(oe.tagCheck instanceof Function&&oe.tagCheck(r))&&!Z[r]){const n=function(e,t,n){if(!ne[t]&&Et(t)&&bt(te.tagNameCheck,t))return!1;if(xe&&!Ie[t]&&!Ie[Uo(t)]){const t=v(e),r=y(e);if(r&&t)for(let o=r.length-1;o>=0;--o){const a=e===n?f(r[o],!0):r[o];t.insertBefore(a,g(e))}}return Je(e),!0}(e,r,t);return!(!1!==n||(vt($.afterSanitizeElements,e,null),!kt(e,t)))||n}if(1===C(e)&&!function(e){const t=T(e),n=Uo(E(e)),r=v(e);let o,a;return r&&1===C(r)?(o={namespaceURI:T(r)},a=Uo(E(r))):(o={namespaceURI:Me},a="template"),!!Ue[t]&&(t===_e?function(e,t,n){return t.namespaceURI===Re?"svg"===e:t.namespaceURI===Oe?"svg"===e&&("annotation-xml"===n||ze[n]):Boolean(Ze[e])}(n,o,a):t===Oe?function(e,t,n){return t.namespaceURI===Re?"math"===e:t.namespaceURI===_e?"math"===e&&Be[n]:Boolean(Xe[e])}(n,o,a):t===Re?function(e,t,n){return!(t.namespaceURI===_e&&!Be[n])&&!(t.namespaceURI===Oe&&!ze[n])&&!Xe[e]&&(He[e]||!Ze[e])}(n,o,a):!("application/xhtml+xml"!==qe||!Ue[t]))}(e))return Je(e),!0;if(("noscript"===r||"noembed"===r||"noframes"===r)&&Qo(Ia,e.innerHTML))return Je(e),!0;if(ce&&3===e.nodeType){const t=pt(e.textContent);e.textContent!==t&&(Ao(n.removed,{element:e.cloneNode()}),e.textContent=t)}return vt($.afterSanitizeElements,e,null),kt(e,t)},St=function(e,t,n){if(re[t])return!1;if(ct(t,e))return!1;if(be&&("id"===t||"name"===t)&&(n in r||n in Ke))return!1;const o=J[t]||oe.attributeCheck instanceof Function&&oe.attributeCheck(t,e);return!(!ie||!Qo(W,t))||!(!ae||!Qo(V,t))||(o?!(!Ae[t]&&!Qo(Y,zo(n,K,""))&&("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==$o(n,"data:")||!je[e])&&(!le||Qo(G,zo(n,K,"")))&&n):Et(e)&&bt(te.tagNameCheck,e)&&bt(te.attributeNameCheck,t,e)||"is"===t&&te.allowCustomizedBuiltInElements&&bt(te.tagNameCheck,n))},Ct=Jo({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Et=function(e){return!Ct[Uo(e)]&&Qo(Q,e)},It=function(e,t,n,r){if(j&&"object"==typeof d&&"function"==typeof d.getAttributeType&&!n)switch(d.getAttributeType(e,t)){case"TrustedHTML":return R(r);case"TrustedScriptURL":return function(e){_(),O++;try{return j.createScriptURL(e)}finally{O--}}(r)}return r},Tt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!mt(e)||(Je(e),!1)}catch(n){return nt(t,e),!1}},jt=function(e,t){return!(!ue||!Qo(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t))||"attributename"===Uo(e)&&null!==Fo(t,"href")},Nt=function(e,t){if(vt($.beforeSanitizeAttributes,e,null),kt(e,t))return;const r=e.attributes;if(!r||mt(e))return;J=wt($.uponSanitizeAttribute,J,ee,he);const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0};let a=r.length;const i=Ve(e.nodeName);for(;a--;){const t=r[a],l=t.name,s=t.namespaceURI,c=t.value,u=Ve(l),d=c;let p="value"===l?d:Bo(d),f=!1;o.attrName=u,o.attrValue=p,o.keepAttr=!0,o.forceKeepAttr=void 0,vt($.uponSanitizeAttribute,e,o),p=o.attrValue,!we||"id"!==u&&"name"!==u||0===$o(p,ke)||(nt(l,e,t),p=ke+p,f=!0),jt(l,p)?nt(l,e,t):o.forceKeepAttr||(!o.keepAttr||!se&&Qo(Ta,p)?nt(l,e,t):(ce&&(p=pt(p)),St(i,u,p)?(p=It(i,u,s,p),p!==d&&Tt(e,l,s,p)&&f&&No(n.removed)):nt(l,e,t)))}vt($.afterSanitizeAttributes,e,null),kt(e,t)},At=function(e){let t=null;const n=dt(e);for(vt($.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(vt($.uponSanitizeShadowNode,t,null),xt(t,e),Nt(t,e),gt(t.content)&&At(t.content),1===C(t)){const e=b(t);gt(e)&&(Pt(e),At(e))}ce&&ht(e),vt($.afterSanitizeShadowDOM,e,null)},Pt=function(e){const t=[{node:e,shadow:null}];for(;t.length>0;){const e=t.pop();if(e.shadow){At(e.shadow);continue}const n=e.node,r=1===C(n),o=y(n);if(o)for(let e=o.length-1;e>=0;--e)t.push({node:o[e],shadow:null});if(r){const e=x?x(n):null;if("string"==typeof e&&"template"===Ve(e)){const e=n.content;gt(e)&&t.push({node:e,shadow:null})}}if(r){const e=b(n);gt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,a=null,i=null,l=null;if(Le=!e,Le&&(e="\x3c!--\x3e"),"string"!=typeof e&&!yt(e)&&"string"!=typeof(e=function(e){switch(typeof e){case"string":return e;case"number":return Ho(e);case"boolean":return qo(e);case"bigint":return Wo?Wo(e):"0";case"symbol":return Vo?Vo(e):"Symbol()";case"undefined":default:return Ko(e);case"function":case"object":{if(null===e)return Ko(e);const t=e,n=na(t,"toString");if("function"==typeof n){const e=n(t);return"string"==typeof e?e:Ko(e)}return Ko(e)}}}(e)))throw Yo("dirty is not a string, aborting");if(!n.isSupported)return e;pe?(Z=fe,J=he):Ye(t),($.uponSanitizeElement.length>0||$.uponSanitizeAttribute.length>0)&&(Z=ta(Z)),$.uponSanitizeAttribute.length>0&&(J=ta(J)),n.removed=[];const s=Se&&"string"!=typeof e&&yt(e);let c=[];const u=Ce;if(s){ue&&ot(e,e=>{const t=C(e);if(7===t||8===t&&Qo(Ea,e.data)){try{h(e)}catch(e){}return!1}if(1===t){const t=e,n=Ve(E(e));try{t.hasAttribute&&t.hasAttribute("patchsrc")&&t.removeAttribute("patchsrc"),t.hasAttribute&&t.hasAttribute("for")&&ct("for",n)&&t.removeAttribute("for")}catch(e){}}return!0});const t=E(e);if("string"==typeof t){const n=Ve(t);if(!Z[n]||ne[n])throw tt(e),Yo("root node is forbidden and cannot be sanitized in-place")}if(mt(e))throw tt(e),Yo("root node is clobbered and cannot be sanitized in-place");c=it(e),Ce=Ro()}else if(yt(e))r=ut("\x3c!----\x3e"),a=r.ownerDocument.importNode(e,!0),1===a.nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?r=a:r.appendChild(a),Pt(r);else{if(!ge&&!ce&&!de&&-1===e.indexOf("<"))return j&&ve?R(e):e;if(r=ut(e),!r)return ge?null:ve?A:""}r&&me&&Je(r.firstChild);const d=s?e:r;try{s&&Pt(e);const t=dt(d);for(;i=t.nextNode();)xt(i,d),Nt(i,d),gt(i.content)&&At(i.content);s&&function(e,t){const n=Ce;let r=null;const o=()=>(r||(r=Ro(),To(t,e=>{Mo(r,e)})),r);for(let t=0;;t++){const r=it(e),a=[e];let i=!1;if(To(r,e=>{11===C(e)?Ao(a,e):i||Lo(n,e)||(i=Lo(o(),e))}),!i)return;if(t>=8)throw Yo("the tree kept changing during in-place sanitization; refusing to return it");To(a,(t,n)=>{st(t,n>0,e,o())})}}(e,c)}catch(t){throw s&&(tt(e),lt(e,c)),t}finally{Ce=u}if(s){if(lt(e,c))throw Yo("a node selected for removal could not be safely returned; refusing to sanitize in place");return ce&&ft(e),e}if(ge){if(ce&&ft(r),ye)for(l=D.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(J.shadowroot||J.shadowrootmode)&&(l=z.call(o,l,!0)),l}let p=de?r.outerHTML:r.innerHTML;return de&&Z["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&Qo(xa,r.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+p),ce&&(p=pt(p)),j&&ve?R(p):p},n.setConfig=function(){Ye(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),pe=!0,fe=Z,he=J},n.clearConfig=function(){Ge=null,pe=!1,fe=null,he=null,j=N,A=""},n.isValidAttribute=function(e,t,n){Ge||Ye({});const r=Ve(e),o=Ve(t);return("string"!=typeof n||!(jt(t,n)||!se&&Qo(Ta,n)))&&St(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&Go($,e)&&Ao($[e],t)},n.removeHook=function(e,t){if(Go($,e)){if(void 0!==t){const n=jo($[e],t);return-1===n?void 0:Oo($[e],n,1)[0]}return No($[e])}},n.removeHooks=function(e){Go($,e)&&($[e]=[])},n.removeAllHooks=function(){$={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const Oa=t=>{const n=function(t){const[n,r]=e.useState();return e.useEffect(()=>{Pa.isSupported?(async()=>{const e=await co(t);r(Pa.sanitize(e))})():r("<div></div>")},[t]),n}(t.markdown);let r=null;return e.useEffect(()=>{n&&r&&(r.innerHTML=n)},[r,n]),n?(0,$t.jsx)("div",{ref:e=>{e&&(r=e)}}):(0,$t.jsx)("div",{className:"common-spinner"})};class _a extends e.Component{constructor(e){super(e),this.textInput=void 0,this.handleOnClose=()=>{this.setState({loading:!1,resolvePublish:void 0,checkboxSelected:!1}),this.props.dispatchHideModal(),this.props.dispatchSetShareStatus()},this.handleRewardShareClick=()=>{const{mapId:e,userState:t,pageSourceUrl:n,skillMap:r,activity:o,shareState:a}=this.props,i=Je(t,n,r,o.activityId);i&&this.props.dispatchShowShareModal(e,i.activityId,!0)},this.handleMultiplayerShareClick=async()=>{const{mapId:e,userState:t,pageSourceUrl:n,skillMap:r,activity:o}=this.props,a=Je(t,n,r,o.activityId),i=null==r?void 0:r.activities[a.activityId],l=await this.publishAsync(null==i?void 0:i.displayName,t,n,e,i),s=`${pxt.BrowserUtils.isLocalHostDev()?"http://localhost:3000/--":pxt.webConfig.relprefix}multiplayer?host=${l.url.split("/").slice(-1)[0]}`;window.open(s,"_blank")},this.handleShareCopyClick=()=>{const{mapId:e,activity:t}=this.props;Be("skillmap.share.copy",{path:e,activity:t.activityId});const n=document.querySelector(".share-input input");n&&(n.select(),document.execCommand("copy"))},this.publishAsync=async(e,t,n,r,o)=>{const{dispatchSetShareStatus:a}=this.props;Be("skillmap.share",{path:r,activity:o.activityId});const i=Qe(t,n,r,o.activityId);return a(null==i?void 0:i.headerId,e),new Promise(e=>{this.setState({resolvePublish:e})})},this.state={}}componentDidUpdate(e,t,n){var r;if(this.state.resolvePublish&&null!==(r=this.props.shareState)&&void 0!==r&&r.data){const e=this.state.resolvePublish;this.setState({resolvePublish:void 0}),e(this.props.shareState.data)}}render(){const{activity:e,type:t}=this.props;switch(t){case"completion":return e?this.renderCompletionModal():(0,$t.jsx)("div",{});case"restart-warning":return e?this.renderRestartWarning():(0,$t.jsx)("div",{});case"report-abuse":return this.renderReportAbuse();case"reset":return this.renderResetWarning();case"carryover":return this.renderCodeCarryoverModal();case"share":return this.renderShareModal();case"login":return this.renderLoginModal(!1);case"login-prompt":return this.renderLoginModal(!0);case"delete-account":return this.renderDeleteAccountModal();case"reward":return this.renderRewardModal();case"markdown-intro":return this.renderMarkdownIntroModal();default:return(0,$t.jsx)("div",{})}}getCompletionActionText(e){switch(e.kind){case"activity":return lf("Start Activity");case"map":return lf("Start Skillmap");case"editor":return lf("Keep Building");case"tutorial":return lf("Start Tutorial");default:return lf("Learn More")}}getCompletionActions(e){const{userState:t,pageSourceUrl:n,mapId:r,skillMap:o,activity:a,dispatchOpenActivity:i,dispatchShowCarryoverModal:l}=this.props,s=a,c=[];return null==e||e.forEach(e=>{const u={label:e.label||this.getCompletionActionText(e),url:e.url};switch(e.kind){case"activity":const d=null==o?void 0:o.activities[e.activityId||""];d&&(u.onClick=()=>{Be("skillmap.reward.action.activity",{path:r,activity:s.activityId,nextActivityId:d.activityId}),this.handleOnClose(),et(t,n,o,d)?l(o.mapId,d.activityId):i(r,d.activityId)},c.push(u));break;case"editor":const p=Je(t,n,o,a.activityId);null!=p&&p.headerId&&(u.onClick=()=>{Be("skillmap.reward.action.editor",{path:r,activity:s.activityId}),window.open(`${kn}#skillmapimport:${p.headerId}`)},c.push(u));break;default:u.onClick=()=>Be(`skillmap.reward.action.${e.kind}`,{path:r,activity:s.activityId,url:u.url||""}),c.push(u)}}),c}renderCompletionModal(){const{skillMap:e,type:t,activity:n,userState:r,pageSourceUrl:o,dispatchNextModal:a,reward:i,mapId:l}=this.props;if(!t||!e)return(0,$t.jsx)("div",{});const s=n,c=lf("You Did It!"),u=lf("Congratulations on completing {0}. Take some time to explore any activities you missed, or reset your progress to try again. But first, be sure to claim your reward using the button below.","{0}").split("{0}"),d=Je(r,o,e,n.activityId),p=i?()=>{Be("skillmap.openCertificate",{path:l,activity:n.activityId}),window.open(i.url||e.completionUrl)}:a,f=d&&d.headerId,h=f&&n.showMultiplayerShare;return(0,$t.jsx)(Tn,{children:(0,$t.jsxs)(En,{title:c,actions:this.getCompletionActions(s.actions),className:"completion",onClose:this.handleOnClose,children:[u[0],(0,$t.jsx)("strong",{children:e.displayName}),u[1],(0,$t.jsx)(Zt,{className:"primary completion-reward",title:lf("Claim your reward!"),label:lf("Claim your reward!"),leftIcon:"fas fa-gift",onClick:p}),f&&!h&&(0,$t.jsx)(Zt,{className:"primary completion-reward",title:lf("Share your game!"),label:lf("Share your game!"),leftIcon:"fas fa-share",onClick:this.handleRewardShareClick}),h&&(0,$t.jsx)(Zt,{className:"primary completion-reward",title:lf("Play online with friends!"),label:lf("Play online with friends!"),leftIcon:"fas fa-share",onClick:this.handleMultiplayerShareClick})]})})}renderRestartWarning(){const{userState:e,pageSourceUrl:t,skillMap:n,mapId:r,activity:o,dispatchRestartActivity:a,showCodeCarryoverModal:i,dispatchShowCarryoverModal:l}=this.props,s=lf("Restart Activity?"),c=lf("Are you sure you want to restart {0}? You won't lose your path progress but the code you have written for this activity will be deleted.","{0}").split("{0}"),u=[{label:lf("CANCEL"),onClick:this.handleOnClose},{label:lf("RESTART"),onClick:()=>{if(Be("skillmap.activity.restart",{path:r,activity:o.activityId}),i){const i=Je(e,t,n,o.activityId);a(r,o.activityId,i.headerId,!!i.headerId)}else a(r,o.activityId)}}];return(0,$t.jsxs)(En,{title:s,actions:u,onClose:this.handleOnClose,children:[c[0],(0,$t.jsx)("strong",{children:o.displayName}),c[1]]})}renderResetWarning(){const{dispatchResetUser:e,dispatchHideModal:t}=this.props,n=lf("Reset All Activities?"),r=lf("Are you sure you want to reset? This will permanently erase all progress and delete the project created for each tutorial. This action cannot be undone."),o=[{label:lf("CANCEL"),onClick:this.handleOnClose},{label:lf("RESET"),onClick:()=>{Be("skillmap.reset"),e(),t()}}];return(0,$t.jsx)(En,{title:n,actions:o,onClose:this.handleOnClose,children:r})}renderReportAbuse(){const{pageSourceUrl:e,dispatchHideModal:t}=this.props,n=[{label:"REPORT",onClick:()=>{Be("skillmap.reportabuse"),async function(e,t){e&&await function(e,t){return new Promise((n,r)=>{const o=new XMLHttpRequest;o.addEventListener("error",e=>{r(e)}),o.addEventListener("load",()=>{try{n(o.responseText)}catch(e){r(e)}}),o.open("POST",e,!0),o.setRequestHeader("Content-type","application/json"),o.send(JSON.stringify(t))})}(`/api/${encodeURIComponent(e)}/abusereports`,t)}(e||"",{text:document.querySelector(".report-abuse-text").value}),t()}}];return(0,$t.jsx)(En,{title:"Report Abuse",actions:n,onClose:this.handleOnClose,children:(0,$t.jsx)("textarea",{className:"report-abuse-text",placeholder:"Describe the content and explain why you are reporting it for abuse. Provide as much detail as possible!"})})}renderCodeCarryoverModal(){const{skillMap:e,activity:t,pageSourceUrl:n,userState:r,dispatchHideModal:o,dispatchRestartActivity:a}=this.props,i=lf("Keep code from previous activity?"),l=lf("Do you want to start with your code from {0} or start fresh with starter code? Your images, tilemaps, tiles, and animations will stick around either way.").split("{0}"),s=Je(r,n,e,t.activityId),c=e.activities[null==s?void 0:s.activityId];if(!c)return(0,$t.jsx)("div",{});const u=[{label:lf("START FRESH"),onClick:async()=>{Be("skillmap.startfresh",{path:e.mapId,activity:t.activityId,previousActivity:c.activityId}),a(e.mapId,t.activityId,s.headerId,!1),o()}},{label:lf("KEEP CODE"),onClick:async()=>{Be("skillmap.keepcode",{path:e.mapId,activity:t.activityId,previousActivity:c.activityId}),a(e.mapId,t.activityId,s.headerId,!0),o()}}];return(0,$t.jsxs)(En,{title:i,actions:u,onClose:this.handleOnClose,children:[l[0],(0,$t.jsx)("strong",{children:c.displayName}),l[1]]})}renderShareModal(){const{activity:e,userState:t,pageSourceUrl:n,mapId:r}=this.props;return(0,$t.jsx)(En,{title:lf("Share Project"),className:"sharedialog",parentElement:document.getElementById("root")||void 0,onClose:this.handleOnClose,children:(0,$t.jsx)(Vn,{projectName:e.displayName,isLoggedIn:!1,publishAsync:o=>this.publishAsync(o,t,n,r,e),simRecorder:void 0,onClose:this.handleOnClose})})}renderLoginModal(e){const t=async(e,t)=>{pxt.tickEvent("identity.loginClick",{provider:e.name,rememberMe:t.toString()}),await pxt.auth.client().loginAsync(e.id,t,{hash:location.hash})};return(0,$t.jsxs)($t.Fragment,{children:[e&&(0,$t.jsx)(Nn,{appMessage:lf("Nice work! You've completed this activity."),onSignIn:t,onClose:this.handleOnClose}),!e&&(0,$t.jsx)(Nn,{onSignIn:t,onClose:this.handleOnClose})]})}renderDeleteAccountModal(){const{checkboxSelected:e}=this.state,t=[];return t.push({label:lf("Confirm"),disabled:!e,onClick:async()=>{e&&(Be("skillmap.profile.delete"),this.props.dispatchHideModal(),this.props.dispatchCloseUserProfile(),await pxt.auth.client().deleteProfileAsync(),location.reload())}}),t.push({label:lf("Back to safety"),onClick:this.props.dispatchHideModal}),(0,$t.jsxs)(En,{title:lf("Delete Profile"),className:"delete",actions:t,onClose:this.handleOnClose,children:[(0,$t.jsxs)("div",{children:[" ",lf("Are you sure? This cannot be reversed! Your cloud-saved projects will be converted to local projects on this device.")]}),(0,$t.jsxs)("div",{className:"confirm-delete checkbox",onClick:()=>{this.setState({checkboxSelected:!e})},children:[(0,$t.jsx)("i",{className:"far "+(e?"fa-check-square":"fa-square")}),lf("I understand this is permanent. No undo.")]})]})}renderRewardModal(){const{reward:e}=this.props;let t;return"certificate"===(null==e?void 0:e.type)?t=this.renderCertificateModal(e):"completion-badge"===(null==e?void 0:e.type)&&(t=this.renderBadgeModal(e)),(0,$t.jsx)(Tn,{children:t})}renderCertificateModal(e){var t;const n=lf("Rewards"),{mapId:r,skillMap:o,activity:a,hasPendingModals:i,dispatchNextModal:l,profile:s,signedIn:c,pageSourceState:u}=this.props,d="approved"===u&&(null===(t=e.url)||void 0===t?void 0:t.toLowerCase().endsWith(".pdf"));d&&Kn();const p=async()=>{const t=await fetch(e.url).then(e=>e.arrayBuffer());let n;try{var r;n=await async function(e,t){if(!await Kn())return e;if(null==t||!t.trim())return e;const{PDFDocument:n,StandardFonts:r,TextAlignment:o,rgb:a}=PDFLib,i=await n.load(e),l=await i.embedFont(r.Helvetica),s=i.getPages()[0];if(!s)return e;const{width:c,height:u}=s.getSize(),d=i.getForm();let p;try{p=d.getTextField("name-entry")}catch(e){}if(p){p.setText(t),p.enableReadOnly(),p.setAlignment(o.Center),p.disableScrolling(),p.updateAppearances(l);const[e]=p.acroField.getWidgets(),{width:n,height:r}=e.getRectangle(),a=l.widthOfTextAtSize(t,10),i=0|Math.min(l.sizeAtHeight(.8*r),n/a*10);p.setFontSize(i)}else{const e=(.5*c|0)/l.widthOfTextAtSize(t,10);let n=15;const r=Math.min(70,10*e|0);s.drawText(t,{x:c/2-l.widthOfTextAtSize(t,r)/2,y:u/2-r/2+n,size:r,font:l,color:a(.1,.1,.1)})}return await i.save()}(t,null===(r=this.textInput)||void 0===r?void 0:r.value)}catch(e){}const o=new Blob([n||t],{type:"application/pdf"}),a=URL.createObjectURL(o);window.open(a,"_blank","noopener noreferrer")},f=[],h=()=>{var t,n;Be("skillmap.openCertificate",{path:r,activity:a.activityId,addedName:null!==(t=this.textInput)&&void 0!==t&&null!==(n=t.value)&&void 0!==n&&n.trim()?1:0}),d?p():window.open(e.url||o.completionUrl),i?l():this.handleOnClose()};if(f.push({label:lf("Open Certificate"),className:"completion-reward inverted",icon:"file outline",onClick:h}),i){const t=()=>{Be("skillmap.nextReward",{path:r,activity:a.activityId,currentReward:e.type}),l()};f.push({label:lf("Next Reward"),className:"completion-reward",icon:"right circle arrow",onClick:t})}const m=c&&s&&pxt.auth.firstName(s);return(0,$t.jsxs)(En,{title:n,onClose:this.handleOnClose,actions:f,children:[lf("Use the button below to get your completion certificate!"),e.previewUrl&&(0,$t.jsx)("div",{className:"certificate-reward",children:(0,$t.jsx)("img",{src:e.previewUrl,alt:lf("certificate Preview")})}),d&&(0,$t.jsx)(Rn,{className:"cert-name-input",placeholder:"Put your name on it!",label:lf("Enter your name"),type:"text",initialValue:m||void 0,handleInputRef:e=>{e&&(this.textInput=e)},preserveValueOnBlur:!0,onEnterKey:h,title:lf("Enter your name to customize the certificate"),ariaLabel:lf("Enter your name to customize the certificate")})]})}renderBadgeModal(e){const t=lf("Rewards"),{mapId:n,skillMap:r,activity:o,hasPendingModals:a,badge:i,dispatchNextModal:l,dispatchShowUserProfile:s,dispatchHideModal:c,signedIn:u,dispatchShowLoginModal:d}=this.props,p=()=>{Be("skillmap.goToBadges",{path:n,activity:o.activityId}),c(),s()},f=()=>{Be("skillmap.badgeSignIn",{path:n,activity:o.activityId}),c(),d()},h=[];let m;if(u?(m=Bt(lf("You’ve received the {0} Badge! Find it in the badges section of your {1}."),(0,$t.jsx)("span",{children:pxt.U.rlf(i.title)}),(0,$t.jsx)("a",{onClick:p,children:lf("User Profile")})),h.push({label:lf("Go to Badges"),className:"completion-reward inverted",icon:"trophy",onClick:p})):(m=Bt(lf("You’ve received the {0} Badge! {1} to save your progress"),(0,$t.jsx)("span",{children:pxt.U.rlf(r.displayName)}),(0,$t.jsx)("a",{onClick:f,children:lf("Sign In")})),h.push({label:lf("Sign In"),className:"completion-reward inverted",xicon:!0,icon:"cloud-user",onClick:f})),a){const t=()=>{Be("skillmap.nextReward",{path:n,activity:o.activityId,currentReward:e.type}),l()};h.push({label:lf("Next Reward"),className:"completion-reward",icon:"right circle arrow",onClick:t})}return(0,$t.jsxs)(En,{title:t,onClose:this.handleOnClose,actions:h,children:[m,(0,$t.jsx)("div",{className:"badge-modal-image",children:(0,$t.jsx)(In,{badge:i})})]})}renderMarkdownIntroModal(){const{skillMap:e,markdownIntroContent:t}=this.props;return(0,$t.jsx)(En,{title:(null==e?void 0:e.displayName)||lf("Introduction"),onClose:this.handleOnClose,actions:[{label:lf("Okay"),onClick:this.handleOnClose}],children:(0,$t.jsx)(Oa,{markdown:t})})}}const Ra=z(function(e,t){var n,r,o;if(!e)return{};const{pageSourceUrl:a,shareState:i}=e,[l]=e.modalQueue||[],{currentMapId:s,currentActivityId:c,type:u,currentReward:d,markdownContent:p}=l||{},f=e.editorView?e.maps[e.editorView.currentMapId]:s&&e.maps[s],h=s&&c?null===(n=e.maps[s])||void 0===n?void 0:n.activities[c]:void 0;let m;return f&&h&&nt(h)&&"completion-badge"===(null==d?void 0:d.type)&&(m=ot(a,f,h)),{type:u,pageSourceUrl:a,skillMap:f,userState:e.user,showCodeCarryoverModal:f&&h&&et(e.user,e.pageSourceUrl,f,h),mapId:s,activity:s&&c?e.maps[s].activities[c]:void 0,shareState:i,reward:d,hasPendingModals:(null===(r=e.modalQueue)||void 0===r?void 0:r.length)&&(null===(o=e.modalQueue)||void 0===o?void 0:o.length)>1,badge:m,signedIn:e.auth.signedIn,profile:e.auth.profile,pageSourceState:e.pageSourceStatus,markdownIntroContent:p}},{dispatchHideModal:()=>({type:me}),dispatchRestartActivity:ht,dispatchOpenActivity:pt,dispatchResetUser:()=>({type:oe}),dispatchShowCarryoverModal:(e,t)=>St({type:"carryover",currentMapId:e,currentActivityId:t}),dispatchCloseUserProfile:yt,dispatchSetShareStatus:bt,dispatchShowShareModal:kt,dispatchNextModal:()=>({type:he}),dispatchShowUserProfile:gt,dispatchShowLoginModal:xt})(_a);class Ma extends e.Component{constructor(e){super(e),this.handleClick=()=>{this.props.onItemSelect&&this.props.onItemSelect(this.props.node.activityId,this.props.kind)},this.handleDoubleClick=()=>{this.props.onItemDoubleClick&&this.props.onItemDoubleClick(this.props.node.activityId,this.props.kind)},this.handleKeyDown=e=>{const t="number"==typeof e.which?e.which:e.keyCode;13!==t&&32!==t||(e.preventDefault(),e.stopPropagation(),this.props.onItemSelect&&this.props.onItemSelect(this.props.node.activityId,this.props.kind))},this.handleRef=e=>{e&&(e.addEventListener("mouseenter",()=>{this.setState({hover:!0})}),e.addEventListener("mouseleave",()=>{this.setState({hover:!1})}))},this.state={hover:!1}}getIcon(e,t){switch(t){case"reward":return"";case"completion":return"";default:switch(e){case"locked":return"";case"completed":return"";default:return""}}}getIconClass(e,t){switch(t){case"reward":case"completion":return"fas graph-icon";default:switch(e){case"locked":case"completed":return"fas graph-icon";default:return"graph-icon-x"}}}getAccessibilityStatusText(){const{status:e}=this.props;switch(e){case"completed":return lf("Completed activity.");case"inprogress":return lf("Activity in progress.");case"locked":return lf("This activity is locked. Complete the previous activity to unlock it.");case"notstarted":case"restarted":return lf("Unstarted activity.")}}getNodeMarker(e,t,n,r){const o=t/50,a=t/576;return"notstarted"===e?(0,$t.jsxs)("g",{transform:`translate(${t/2-12*o} ${-t/2-9*o})`,children:[(0,$t.jsx)("title",{children:lf("Not Started")}),(0,$t.jsx)("g",{transform:`scale(${a/2})`,children:(i=n,l=r,(0,$t.jsx)("path",{fill:i,stroke:l,strokeWidth:"50",d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"}))})]}):(0,$t.jsx)("g",{});var i,l}render(){const{hover:e}=this.state,{width:t,position:n,selected:r,status:o,kind:a,theme:i,node:l}=this.props;let s=e?i.unlockedNodeColor:i.unlockedNodeForeground,c=e?i.unlockedNodeForeground:i.unlockedNodeColor;"locked"===o?(c=e?i.lockedNodeForeground:i.lockedNodeColor,s=e?i.lockedNodeColor:i.lockedNodeForeground):"activity"!==a?(c=e?i.rewardNodeForeground:i.rewardNodeColor,s=e?i.rewardNodeColor:i.rewardNodeForeground):"completed"===o&&(c=e?i.completedNodeForeground:i.completedNodeColor,s=e?i.completedNodeColor:i.completedNodeForeground);const u=t/8,d=t/12.5,p="graph-node-"+l.activityId;let f;switch(l.kind){case"activity":f=l.description||l.displayName;break;case"completion":f=lf("A reward for completing this skillmap.")}return(0,$t.jsxs)("g",{ref:this.handleRef,className:`graph-activity ${r?"selected":""} ${e?"hover":""}`,transform:`translate(${n.x} ${n.y})`,onKeyDown:this.handleKeyDown,onClick:this.handleClick,onDoubleClick:this.handleDoubleClick,"data-activity":l.activityId,children:[(0,$t.jsxs)("foreignObject",{width:t,height:t,x:-t/2,y:-t/2,children:[(0,$t.jsx)(Zt,{className:"graph-node-button",title:l.displayName,onClick:this.handleClick,onKeydown:this.handleKeyDown,role:"menuitem",ariaHasPopup:"locked"!==o?"true":"false",ariaExpanded:r,ariaControls:r?"info-panel-actions":void 0,ariaDescribedBy:p}),(0,$t.jsxs)("div",{id:p,style:{display:"none"},children:[(0,$t.jsx)("p",{children:this.getAccessibilityStatusText()}),f&&(0,$t.jsx)("p",{children:f})]})]}),r&&("activity"!==a?(0,$t.jsx)("circle",{className:"highlight",cx:0,cy:0,r:t/2+u,stroke:i.selectedStrokeColor}):(0,$t.jsx)("rect",{className:"highlight",x:-t/2-u,y:-t/2-u,width:t+2*u,height:t+2*u,rx:t/6,stroke:i.selectedStrokeColor})),"activity"!==a?(0,$t.jsx)("circle",{className:"focus-outline",cx:0,cy:0,r:t/2+2*u,stroke:"none",fill:"none"}):(0,$t.jsx)("rect",{className:"focus-outline",x:-t/2-2*u,y:-t/2-2*u,width:t+4*u,height:t+4*u,rx:t/6,stroke:"none",fill:"none"}),"activity"!==a?(0,$t.jsx)("circle",{cx:0,cy:0,r:t/2,fill:c,stroke:s,strokeWidth:"2"}):(0,$t.jsx)("rect",{x:-t/2,y:-t/2,width:t,height:t,rx:t/10,fill:c,stroke:s,strokeWidth:"2"}),"activity"===a&&this.getNodeMarker(o,t,i.selectedStrokeColor,i.strokeColor),(0,$t.jsx)("text",{dy:d,textAnchor:"middle",alignmentBaseline:"middle",dominantBaseline:"middle",fill:s,className:this.getIconClass(o,a),children:this.getIcon(o,a)})]})}}class La extends e.Component{render(){const{className:e,points:t,strokeWidth:n,color:r}=this.props;let o,a,i="M 0 0",l="";return t.forEach(e=>{var t,n,r,s;o=e,a&&(i+=` l ${((null===(t=o)||void 0===t?void 0:t.x)||0)-a.x} ${((null===(n=o)||void 0===n?void 0:n.y)||0)-a.y}`,l=` l ${a.x-((null===(r=o)||void 0===r?void 0:r.x)||0)} ${a.y-((null===(s=o)||void 0===s?void 0:s.y)||0)} ${l}`),a=o}),(0,$t.jsx)("g",{transform:`translate(${t[0].x||0} ${t[0].y||0})`,children:(0,$t.jsx)("path",{className:e,stroke:r,strokeWidth:n,d:`${i} ${l}`})})}}class Ua extends e.Component{constructor(e){super(e),this.onItemSelect=(e,t)=>{const{user:n,pageSourceUrl:r,map:o,completionState:a,selectedActivityId:i,dispatchChangeSelectedItem:l,dispatchShowCompletionModal:s}=this.props,{status:c}=We(n,r,o,e);"completion"===t&&"completed"===c?(Be("skillmap.graph.reward.select",{path:o.mapId,activity:e}),l(o.mapId,e),s(o.mapId,e)):e!==i?(Be("skillmap.graph.item.select",{path:o.mapId,activity:e}),l(o.mapId,e)):(Be("skillmap.graph.item.deselect",{path:o.mapId,activity:e}),l(void 0))},this.onItemDoubleClick=(e,t)=>{const{user:n,pageSourceUrl:r,map:o,dispatchOpenActivity:a,dispatchRestartActivity:i}=this.props,{status:l}=We(n,r,o,e),s=o.activities[e];Be("skillmap.activity.open.doubleclick",{path:o.mapId,activity:e,status:l||""});const c=Qe(n,r,o.mapId,s.activityId),u=Je(n,r,o,s.activityId);!et(n,r,o,s)||null!=c&&c.headerId?"activity"==t&&"locked"!==l&&a(o.mapId,e):i(o.mapId,e,u.headerId,!!u.headerId)}}componentDidUpdate(e){"transitioning"===e.completionState&&setTimeout(()=>{Be("skillmap.graph.reward.auto",{path:e.map.mapId,activity:e.selectedActivityId||""}),e.dispatchSetSkillMapCompleted(e.map.mapId),e.dispatchShowCompletionModal(e.map.mapId,e.selectedActivityId)},400)}render(){const{unit:e,items:t,paths:n,map:r,user:o,selectedActivityId:a,pageSourceUrl:i,theme:l}=this.props;return(0,$t.jsxs)("g",{className:"skill-graph",children:[(0,$t.jsxs)("g",{opacity:l.pathOpacity,children:[n.map((t,n)=>(0,$t.jsx)(La,{className:"skill-graph-path-border",strokeWidth:3*e,color:l.strokeColor,points:t.points},`graph-activity-${n}`)),n.map((t,n)=>(0,$t.jsx)(La,{className:"skill-graph-path",strokeWidth:3*e-4,color:l.pathColor,points:t.points},`graph-activity-${n}`))]}),t.map((t,n)=>(0,$t.jsx)(Ma,{node:t.activity,theme:l,kind:t.activity.kind,position:t.position,width:5*e,selected:t.activity.activityId===a,onItemSelect:this.onItemSelect,onItemDoubleClick:this.onItemDoubleClick,status:We(o,i,r,t.activity.activityId).status},`graph-activity-${n}`))]})}}const Da=z(function(e,t){var n,r,o,a;if(!e)return{};const i=null===(n=e.user)||void 0===n||null===(r=n.mapProgress)||void 0===r?void 0:r[e.pageSourceUrl];return{user:e.user,pageSourceUrl:e.pageSourceUrl,theme:e.theme,selectedActivityId:e.selectedItem&&(null===(o=t.map)||void 0===o?void 0:o.mapId)==e.selectedItem.mapId?e.selectedItem.activityId:void 0,completionState:null==i||null===(a=i[t.map.mapId])||void 0===a?void 0:a.completionState}},{dispatchChangeSelectedItem:dt,dispatchShowCompletionModal:wt,dispatchSetSkillMapCompleted:e=>({type:Y,mapId:e}),dispatchOpenActivity:pt,dispatchRestartActivity:ht})(Ua),Fa=10;function za(e,t){return{x:$a(e),y:Ba(t)}}function $a(e){return(12*e+4)*Fa}function Ba(e){return(9*e+4)*Fa}function Ha(e,t){if(!e.parents||!t.parents)return!1;let n;return e.parents.forEach(e=>{t.parents.indexOf(e)>=0&&(n=e)}),!!n&&1==Math.abs(n.nextIds.indexOf(e.activityId)-n.nextIds.indexOf(t.activityId))&&e.depth==t.depth}function qa(e){let t=[],n=[e],r={};for(;n.length>0;){let e=n.shift();e&&!r[e.activityId]&&(r[e.activityId]=!0,t.push(e),n=e.next.concat(n))}return t}function Wa(e){const t=function(e){let t=[],n=[e],r={};for(;n.length>0;){let e=n.shift();e&&!r[e.activityId]&&(r[e.activityId]=!0,t.push(e),n=n.concat(e.next))}return t}(e),n={};return t.forEach(e=>{let t=e.next.slice();e.next.length=0,n[e.activityId]=JSON.parse(JSON.stringify(e)),e.next=t}),Object.keys(n).forEach(e=>n[e].next=n[e].nextIds.map(e=>n[e])),n[e.activityId]}class Va extends e.Component{constructor(e){super(e),this.onImageLoad=e=>{this.setState({backgroundSize:{width:e.target.naturalWidth,height:e.target.naturalHeight}})},this.state={backgroundSize:{width:0,height:0},backgroundColor:this.props.backgroundColor,strokeColor:this.props.strokeColor}}render(){var e;const{maps:t,graphs:n,graphSize:r,backgroundImageUrl:o,pixelatedBackground:a,backgroundColor:i,strokeColor:l}=this.props,{backgroundSize:s}=this.state;let c="black",u=lf("Background image for {0}",(null===(e=t[0])||void 0===e?void 0:e.displayName)||lf("skillmap")),d=0;const p=r.width/r.height,f=s.width/s.height,h=o&&s.width>0&&s.height>0;let m=Math.max(400,r.height),g=Math.max(600,r.width);h&&(p-f>.05?m=g*(1/f):p-f<-.05&&(g=m*f)),i===l&&(c="white"),t.length>1&&(u=lf("Background image for {0} connected skillmaps",(null==t?void 0:t.length)||0));const y=Math.max(m-r.height,0)/2,v=Math.max(g-r.width,0)/2;return(0,$t.jsx)("div",{className:"skill-graph-wrapper",children:(0,$t.jsxs)("div",{className:"skill-graph-content "+(h?"has-background":""),children:[(0,$t.jsx)(nn,{className:"skill-graph-activities",ariaLabel:lf("Skillmap"),children:(0,$t.jsx)("svg",{viewBox:`-${v+40} -${y+40} ${g+80} ${m+80}`,preserveAspectRatio:"xMidYMid meet",children:n.map((e,t)=>(d+=e.height,(0,$t.jsx)("g",{transform:`translate(0, ${d-e.height})`,children:(0,$t.jsx)(Da,{unit:Fa,...e})},t)))})}),o&&(0,$t.jsx)("div",{className:"skill-graph-background",children:(0,$t.jsx)("img",{src:o,className:a?"pixelated":void 0,alt:u,onLoad:this.onImageLoad,style:{color:c}})})]})})}}const Ga=z(function(e,t){if(!e)return{};const n=t.maps.map(e=>function(e){let t=[];t="manual"===e.layout?t.concat(function(e){const t=[],n=qa(Wa(e)).filter(e=>"layout"!==e.kind);return n.forEach(e=>{if(t.indexOf(e.activityId)<0){var n,r;t.push(e.activityId),e.depth=(null===(n=e.position)||void 0===n?void 0:n.depth)||0,e.offset=(null===(r=e.position)||void 0===r?void 0:r.offset)||0;const o=[];e.next.forEach((t,n)=>{var r,a,i;const l=(null===(r=t.position)||void 0===r?void 0:r.depth)||0,s=(null===(a=t.position)||void 0===a?void 0:a.offset)||0,c=[{depth:e.depth,offset:e.offset}];null!==(i=e.edges)&&void 0!==i&&i[n]&&e.edges[n].forEach(e=>{const t=c[c.length-1];e.depth!==t.depth&&e.offset!==t.offset&&c.push({depth:t.depth,offset:e.offset}),c.push(e)});const u=c[c.length-1];l!==u.depth&&s!==u.offset&&c.push({depth:u.depth,offset:s}),c.push({depth:l,offset:s}),o.push(c)}),e.edges=o}}),n}(e.root)):t.concat(function(e){const t=Wa(e);let n=[t];const r={},o={};let a=0;for(;n.length>0;){let e=n.shift();if(e&&!o[e.activityId]){var i;o[e.activityId]=!0;const t=null===(i=e.parents)||void 0===i?void 0:i[0];if(t){const n=r[t.activityId]||{depth:0,offset:0};0==n.depth?(n.depth=1,e.offset=t.offset+n.offset):(a+=1,n.offset=a,e.offset=a),e.depth=t.depth+n.depth,r[t.activityId]=n}else e.depth=0,e.offset=0;const l=e.next.map(t=>{let n=t;return n.parents?n.parents.push(e):n.parents=[e],n});l.filter(e=>o[e.activityId]).forEach(t=>{Ha(t,e)||(t.offset+=1,a=Math.max(a,t.offset),t.depth=Math.max(t.depth,e.depth+1))}),n=l.concat(n)}}const l=qa(t).filter(e=>"layout"!==e.kind),s={};return l.forEach(e=>{null==s[e.depth]&&(s[e.depth]=[]),s[e.depth].push(e.offset)}),l.forEach(e=>{var t;if((!e.next||0==e.next.length)&&1==(null===(t=e.parents)||void 0===t?void 0:t.length)){const t=e.parents[0],n=s[e.depth],r=n[n.indexOf(e.offset)-1];(r?e.offset-r:Math.abs(e.depth-t.depth)+Math.abs(e.offset-t.offset))>2&&(e.depth=t.depth,e.offset=(r||t.offset)+1)}}),l.forEach(e=>{if(e.parents){e.edges=[];const t=e.parents.some(t=>t.offset==e.offset)||e.parents.length>2;e.parents.forEach(n=>{var r;const o=[{depth:n.depth,offset:n.offset}];if(t){const t=s[e.depth],r=t.indexOf(e.offset),a=e.offset>n.offset&&!(t[r+1]-t[r]<e.offset-n.offset),i=e.offset<n.offset&&!(t[r]-t[r-1]<n.offset-e.offset);a||i?o.push({depth:e.depth,offset:n.offset}):o.push({depth:n.depth,offset:e.offset})}else o.push({depth:n.depth,offset:e.offset});o.push({depth:e.depth,offset:e.offset}),null===(r=e.edges)||void 0===r||r.push(o)})}}),l}(e.root));let n=0,r=0;const o=[],a=[];for(let e of t){const{depth:t,offset:i}=e;o.push({activity:e,position:za(t,i)}),e.edges&&e.edges.forEach(e=>{const t=[];e.forEach(e=>t.push(za(e.depth,e.offset))),a.push({points:t})}),n=Math.max(n,e.depth),r=Math.max(r,e.offset)}const i=$a(n)+40,l=Ba(r)+40;return{map:e,items:o,paths:a,width:i,height:l}}(e)),r=null!=n&&n.length?n.map(e=>e.width).reduce((e,t)=>Math.max(e,t)):0,o=null!=n&&n.length?n.map(e=>e.height).reduce((e,t)=>e+t):0;return{graphs:n,graphSize:{width:r,height:o}}})(Va);class Ka extends e.Component{constructor(...e){super(...e),this.handleActionButtonClick=()=>{const{status:e,mapId:t,activityId:n,previousHeaderId:r,dispatchOpenActivity:o,dispatchRestartActivity:a,showCodeCarryoverModal:i}=this.props;"locked"!==e&&(Be("skillmap.activity.open",{path:t,activity:n,status:e||""}),"notstarted"===e&&i?a(t,n,r,!!r):o(t,n))},this.handleRestartButtonClick=()=>{const{mapId:e,activityId:t,status:n,dispatchShowRestartActivityWarning:r}=this.props;Be("skillmap.sidebar.restart",{path:e,activity:t,status:n||""}),r(e,t)},this.handleShareButtonClick=()=>{const{mapId:e,activityId:t,status:n,dispatchShowShareModal:r}=this.props;Be("skillmap.sidebar.share",{path:e,activity:t,status:n||""}),r(e,t)},this.handleSaveToProjectsClick=()=>{const{completedHeaderId:e,mapId:t,activityId:n}=this.props;Be("skillmap.export",{path:t||"",activity:n||""}),window.open(`${kn}#skillmapimport:${e}`)}}getActivityActionText(){switch(this.props.status){case"locked":return lf("Locked");case"completed":return lf("View Code");case"inprogress":case"restarted":return lf("Continue");default:return lf("Start")}}isCompleted(e){return"completed"===e||"restarted"===e}render(){const{status:e,completedHeaderId:t,signedIn:n,dispatchShowLoginModal:r}=this.props,o=e&&"notstarted"!==e&&"locked"!==e;if("locked"===e)return(0,$t.jsx)("div",{});const a=pxt.auth.hasIdentity()&&!n;return(0,$t.jsxs)("div",{className:"actions "+(t?"grid":""),children:[(0,$t.jsx)(Zt,{className:"tertiary",tabIndex:-1,title:this.getActivityActionText(),label:this.getActivityActionText(),onClick:this.handleActionButtonClick}),o&&(0,$t.jsxs)($t.Fragment,{children:[(0,$t.jsx)(Zt,{className:"primary inverted",tabIndex:-1,title:lf("Restart"),label:lf("Restart"),onClick:this.handleRestartButtonClick}),(0,$t.jsx)(Zt,{className:"primary inverted",tabIndex:-1,title:lf("Share"),label:lf("Share"),onClick:this.handleShareButtonClick})]}),t&&(0,$t.jsx)(Zt,{tabIndex:-1,className:"primary inverted",title:lf("Save to My Projects"),label:lf("Save to My Projects"),onClick:this.handleSaveToProjectsClick}),a&&(0,$t.jsx)(Zt,{tabIndex:-1,className:"primary inverted",onClick:r,label:lf("Sign in to Save"),title:lf("Sign in to Save")})]})}}const Qa=z(function(e,t){if(!e)return{};const n=t,r=e.maps[n.mapId],o=r.activities[n.activityId],a=Je(e.user,e.pageSourceUrl,r,n.activityId);return{previousHeaderId:null==a?void 0:a.headerId,showCodeCarryoverModal:et(e.user,e.pageSourceUrl,r,o),signedIn:e.auth.signedIn}},{dispatchOpenActivity:pt,dispatchShowRestartActivityWarning:(e,t)=>St({type:"restart-warning",currentMapId:e,currentActivityId:t}),dispatchShowShareModal:kt,dispatchRestartActivity:ht,dispatchShowLoginModal:xt})(Ka);class Ya extends e.Component{constructor(...e){super(...e),this.handleActionButtonClick=()=>{const{status:e,mapId:t,activityId:n,dispatchShowCompletionModal:r}=this.props;if("locked"!==e)return Be("skillmap.sidebar.reward",{path:t,activity:n}),r(t,n)},this.handlePlayGameClick=()=>{const{previousHeaderId:e,mapId:t,activityId:n}=this.props;Be("skillmap.play",{path:t||"",activity:n||""}),window.open(`${kn}#skillmapimport:${e}`)}}render(){const{status:e,signedIn:t,dispatchShowLoginModal:n}=this.props;if("locked"===e)return(0,$t.jsx)("div",{});const r=pxt.auth.hasIdentity()&&!t;return(0,$t.jsxs)("div",{className:"actions",children:[(0,$t.jsx)(Zt,{tabIndex:-1,className:"primary inverted",title:lf("Claim Reward"),label:lf("Claim Reward"),onClick:this.handleActionButtonClick}),(0,$t.jsx)(Zt,{tabIndex:-1,className:"primary inverted",title:lf("Play your game"),label:lf("Play your game"),onClick:this.handlePlayGameClick}),r&&(0,$t.jsx)(Zt,{tabIndex:-1,className:"tertiary",onClick:n,label:lf("Sign in to Save"),title:lf("Sign in to Save")})]})}}const Za=z(function(e,t){if(!e)return{};const n=t,r=e.maps[n.mapId],o=Je(e.user,e.pageSourceUrl,r,n.activityId);return{signedIn:e.auth.signedIn,previousHeaderId:null==o?void 0:o.headerId}},{dispatchOpenActivity:pt,dispatchShowCompletionModal:wt,dispatchShowLoginModal:xt})(Ya);class Xa extends e.Component{render(){const{cloudStatus:e,signedIn:t}=this.props,n=pxt.cloud.cloudStatus[e];return(0,$t.jsx)("div",{className:"cloud-action",children:t?(0,$t.jsxs)("div",{className:"cloud-indicator",children:[(0,$t.jsx)("div",{className:`ui tiny cloudicon xicon ${n.icon}`,title:n.tooltip}),n.longStatus]}):(0,$t.jsx)("div",{})})}}const Ja=z(function(e,t){const{user:n,pageSourceUrl:r,selectedItem:o}=e;let a="none";if(null!=o&&o.activityId){var i;const t=null===(i=Qe(n,r,o.mapId,o.activityId))||void 0===i?void 0:i.headerId;t&&(a=e.cloudState&&e.cloudState[t]||a)}else a="synced";return{signedIn:e.auth.signedIn,cloudStatus:a}},{})(Xa);class ei extends e.Component{constructor(...e){super(...e),this.container=void 0,this.handleRef=e=>{e&&(this.container=e)}}getStatusLabel(e){switch(e){case"locked":return lf("Locked");case"completed":return lf("Completed");default:return null}}getStatusIcon(e){switch(e){case"locked":return"fas fa-lock";case"completed":return"fas fa-check-circle";default:return""}}componentDidUpdate(e){var t,n,r;if(this.container&&null!==(t=this.props.node)&&void 0!==t&&t.activityId&&(null===(n=e.node)||void 0===n?void 0:n.activityId)!==(null===(r=this.props.node)||void 0===r?void 0:r.activityId)&&!this.container.contains(document.activeElement)){const e=this.container.querySelectorAll("button[tabindex]");e.length&&e.item(0).focus()}}render(){const{mapId:e,title:t,subtitle:n,description:r,infoUrl:o,imageUrl:a,details:i,node:l,status:s,completedHeaderId:c,onFocusEscape:u,dispatchShowLoginModal:d,signedIn:p}=this.props,f=this.getStatusLabel(s),h=!l,m=l&&!nt(l),g=m&&l.tags||void 0,y=lf("Thumbnail for {0} activity in skillmap {1}",n?t:lf("starting"),n||t),v=pxt.auth.hasIdentity();return(0,$t.jsxs)("div",{className:"info-panel",ref:this.handleRef,children:[(0,$t.jsx)("div",{className:"info-panel-image",children:a?(0,$t.jsx)("img",{src:a,alt:y}):(0,$t.jsx)("i",{className:"fas fa-image"})}),(0,$t.jsxs)("div",{className:"info-panel-content",children:[n&&(0,$t.jsx)("div",{className:"info-panel-subtitle",children:n}),(0,$t.jsx)("div",{className:"info-panel-title",children:t}),f&&(0,$t.jsxs)("div",{className:"info-panel-label",children:[(0,$t.jsx)("i",{className:this.getStatusIcon(s)}),(0,$t.jsx)("span",{children:f})]}),(0,$t.jsx)("div",{className:"info-panel-description",children:r}),h&&o&&(0,$t.jsx)("a",{className:"info-panel-link",href:o,target:"_blank",rel:"noopener noreferrer",children:lf("Learning Outcomes")}),g&&g.length>0&&(0,$t.jsx)("div",{className:"info-panel-tags",children:g.map((e,t)=>(0,$t.jsx)("div",{children:e},t))}),(0,$t.jsx)("div",{className:"info-panel-detail",children:null==i?void 0:i.map((e,t)=>(0,$t.jsx)("div",{children:e},`detail_${t}`))}),(0,$t.jsx)("div",{className:"tablet-spacer"}),(0,$t.jsxs)(sn,{id:"info-panel-actions",onEscape:u,dontStealFocus:!0,arrowKeyNavigation:!0,includeOutsideTabOrder:!0,children:[!h&&(m?(0,$t.jsx)(Qa,{mapId:e,activityId:l.activityId,status:s,completedHeaderId:c}):(0,$t.jsx)(Za,{mapId:e,activityId:l.activityId,status:s})),v&&(0,$t.jsx)(Ja,{})]}),v&&h&&!p&&(0,$t.jsx)(Zt,{className:"primary inverted sign-in-button",onClick:d,label:lf("Sign in to Save"),title:lf("Sign in to Save")})]})]})}}const ti=z(function(e,t){var n;const{user:r,pageSourceUrl:o,maps:a,selectedItem:i,infoUrl:l}=e,s=i&&(null===(n=e.maps[i.mapId])||void 0===n?void 0:n.activities[i.activityId]),c="activity"===(null==s?void 0:s.kind),u=[];let d,p,f;if(a)if(null!=i&&i.activityId&&a[i.mapId]){const t=a[i.mapId],{status:n,currentStep:r,maxSteps:o,completedHeadedId:l}=We(e.user,e.pageSourceUrl,t,i.activityId);d=n,f=l,c&&(u.push(o?`${r}/${o} ${lf("Steps")}`:lf("Not Started")),u.push(c?s.type:"")),t&&(p=t.displayName)}else if(r){const e=Object.keys(a);let t=0,n=0,i=0,l=0;e.forEach(e=>{const s=a[e].activities;Object.keys(s).filter(e=>"activity"==s[e].kind).forEach(a=>++n&&qe(r,o,e,a)&&++t),Object.keys(s).filter(e=>nt(s[e])).forEach(t=>++l&&qe(r,o,e,t)&&++i)}),u.push(`${t}/${n} ${lf("Complete")}`),u.push(l?`${i}/${l} ${lf("Reward(s)")}`:"")}return{mapId:null==i?void 0:i.mapId,title:(null==s?void 0:s.displayName)||e.title,subtitle:p,description:c?s.description:e.description,infoUrl:l,imageUrl:s?null==s?void 0:s.imageUrl:e.bannerImageUrl,node:s,status:d,details:u,completedHeaderId:f,signedIn:e.auth.signedIn}},{dispatchShowLoginModal:xt})(ei);var ni=n(3705);function ri(e,t){const n=function(e){const t={mapId:e.header.toLowerCase(),displayName:e.attributes.name||si(e,"name")||e.header,description:e.attributes.description||si(e,"description"),completionUrl:e.attributes.completionurl,prerequisites:[],activities:{},allowCodeCarryover:!e.attributes.allowcodecarryover||!ii(e.attributes.allowcodecarryover)};if("manual"===e.attributes.layout&&(t.layout="manual"),e.attributes.required){const n=e.attributes.required.split(",");for(const e of n){const n=/^\s*(?:(\d+) +)?(.+)$/.exec(e);n[1]?t.prerequisites.push({type:"tag",tag:n[2].trim(),numberCompleted:parseInt(n[1])}):t.prerequisites.push({type:"map",mapId:n[2].trim()})}}return t}(e),r=t.map(oi),o=r.filter(e=>"activity"===e.kind);n.allowCodeCarryover&&o.forEach(e=>{void 0===e.allowCodeCarryover&&(e.allowCodeCarryover=!0)}),n.root=r[0];for(const e of r)n.activities[e.activityId]&&hi(`Duplicate activity id '${e.activityId}' in map '${n.mapId}'`),n.activities[e.activityId]=e;for(const e of r)for(const t of e.nextIds)n.activities[t]||hi(`Unknown activity id '${t}' in map '${n.mapId}'`),e.next.push(n.activities[t]);const a={};!function e(t,r={}){if(r[t.activityId])ni.warn(`Loop in map '${n.mapId}' detected`);else{r[t.activityId]=!0,a[t.activityId]=!0;for(const n of t.next)e(n,{...r})}}(n.root);for(const e of r)a[e.activityId]||ni.warn(`Unreachable activity detected '${e.activityId}' in map '${n.mapId}'`);return n}function oi(e){const t={activityId:e.header.toLowerCase(),imageUrl:e.attributes.imageurl,next:[],displayName:e.attributes.name||si(e,"name")||e.header,nextIds:fi(e.attributes.next)};if(e.attributes.position){const n=e.attributes.position.split(" ");t.position={depth:parseInt(n[0])||0,offset:parseInt(n[1])||0}}if(e.attributes.edges){var n;t.edges=[];const r=fi(e.attributes.edges,!1,";");null===(n=t.nextIds)||void 0===n||n.forEach((e,n)=>{var o;const a=fi(r[n])||[];null===(o=t.edges)||void 0===o||o.push(a.map(e=>{const t=e.split(" ");return{depth:parseInt(t[0])||0,offset:parseInt(t[1])||0}}))})}return"reward"===e.attributes.kind||"completion"===e.attributes.kind?function(e,t){var n,r,o;const a={...t,kind:e.attributes.kind||"reward"};if(e.attributes.type&&"certificate"===e.attributes.type.toLowerCase()&&(a.rewards||(a.rewards=[]),null===(n=a.rewards)||void 0===n||n.push({type:"certificate",url:e.attributes.url})),null!==(r=e.listAttributes)&&void 0!==r&&r.actions){const t=[],n=e.listAttributes.actions.items.filter(e=>"string"==typeof e);for(const e of n){let[n,...r]=e.split(":");const o=/\s*\[\s*(.*)\s*\](?:\(([^\s]+)\))?/gi.exec(r.join(":")),a=null==o?void 0:o[1],i=null==o?void 0:o[2];switch(n){case"activity":t.push({kind:"activity",label:a,activityId:i});break;case"map":if(i){let e=ui(i)?"github":di(i)?"docs":void 0;e||hi(`URL: ${i} must be to Github or MakeCode documentation`),t.push({kind:"map",label:a,url:`#${e}:${i}`})}break;case"tutorial":i&&(ui(i)||di(i)||hi(`URL: ${i} must be to Github or MakeCode documentation`),t.push({kind:"tutorial",label:a,url:`/#tutorial:${i}`}));break;case"docs":if(i){let e=(i.startsWith("/")?"":"/")+i;di(e)||hi(`URL: ${e} must be to MakeCode documentation`),t.push({kind:"docs",label:a,url:e})}break;case"editor":t.push({kind:"editor",label:a})}}t.length&&(a.actions=t)}if(null!==(o=e.listAttributes)&&void 0!==o&&o.rewards){const t=[],n=e.listAttributes.rewards;for(const r of n.items)if("string"==typeof r){let[e,...n]=r.split(":");switch(e){case"certificate":t.push({type:"certificate",url:n.join(":").trim()});break;case"completion-badge":t.push({type:"completion-badge",imageUrl:n.join(":").trim()})}}else if("certificate"===r.key){const n=r.items.filter(e=>"string"==typeof e),o={type:"certificate"};for(const e of n){let[t,...n]=e.split(":");"url"===t&&(o.url=n.join(":").trim()),"previewurl"!==t&&"preview"!==t||(o.previewUrl=n.join(":").trim())}o.url||hi(`Certificate in activity ${e.header} is missing url attribute`),t.push(o)}else if("completion-badge"===r.key){const n=r.items.filter(e=>"string"==typeof e),o={type:"completion-badge"};for(const e of n){let[t,...n]=e.split(":");"imageurl"!==t&&"image"!==t||(o.imageUrl=n.join(":").trim()),"displayname"!==t&&"name"!==t||(o.displayName=n.join(":").trim())}o.imageUrl||hi(`completion-badge in activity ${e.header} is missing imageurl attribute`),t.push(o)}const r=["completion-badge","certificate"];t.sort((e,t)=>r.indexOf(e.type)-r.indexOf(t.type)),t.length&&(a.rewards=t)}return"completion"===a.kind&&(a.showMultiplayerShare=ai(e.attributes.showmultiplayershare)),a}(e,t):"layout"===e.attributes.kind?function(e,t){return{...t,kind:"layout",next:[]}}(0,t):function(e,t){const n={...t,kind:"activity",description:e.attributes.description||si(e,"description"),url:e.attributes.url,tags:fi(e.attributes.tags),allowCodeCarryover:!e.attributes.allowcodecarryover||!ii(e.attributes.allowcodecarryover)};if(e.attributes.type){const t=e.attributes.type.toLowerCase();"tutorial"===t&&(n.type=t)}if(e.attributes.editor){const t=e.attributes.editor.toLowerCase();switch(t){case"py":case"blocks":case"js":n.editor=t;break;default:n.editor="blocks"}}return n.url||hi(`Activity '${n.activityId}' is missing attribute 'url'`),n.type||hi(`Activity '${n.activityId}' is missing attribute 'type'`),n}(e,t)}function ai(e){if(!e)return!1;switch(e.toLowerCase().trim()){case"1":case"yes":case"y":case"on":case"true":return!0;default:return!1}}function ii(e){if(!e)return!1;switch(e.toLowerCase().trim()){case"0":case"no":case"n":case"off":case"false":return!0;default:return!1}}function li(e){const t=e.attributes.primarycolor,n=e.attributes.secondarycolor,r=e.attributes.tertiarycolor,o=e.attributes.highlightcolor,a=e.attributes.unlockednodecolor,i=e.attributes.lockednodecolor,l=e.attributes.completednodecolor,s=si(e,"intro");return{title:e.attributes.name||si(e,"name")||e.header,description:e.attributes.description||si(e,"description"),infoUrl:pi(e.attributes.infourl),backgroundImageUrl:e.attributes.backgroundurl,pixelatedBackground:ai(e.attributes.pixelatedbackground),bannerImageUrl:e.attributes.bannerurl,alternateSources:fi(e.attributes.alternatesources),theme:{backgroundColor:r||"var(--pxt-target-background1)",pathColor:t||"#BFBFBF",strokeColor:"#000000",rewardNodeColor:o||"var(--pxt-primary-background)",rewardNodeForeground:o?ci(o):"#000000",unlockedNodeColor:a||n||"var(--pxt-secondary-background)",unlockedNodeForeground:a||n?ci(a||n):"#000000",lockedNodeColor:i||t||"#BFBFBF",lockedNodeForeground:i||t?ci(i||t):"#000000",completedNodeColor:l||n||"var(--pxt-secondary-background)",completedNodeForeground:l||n?ci(l||n):"#000000",selectedStrokeColor:o||"var(--pxt-primary-background)",pathOpacity:.5},introductoryModal:s}}function si(e,t){var n,r,o;return null===(n=e.codeBlocks)||void 0===n||null===(r=n.find(e=>e.languageCode===t))||void 0===r||null===(o=r.content)||void 0===o?void 0:o.trim()}function ci(e){return e=e.replace("#",""),Number.parseInt(e.slice(0,2),16)+Number.parseInt(e.slice(2,4),16)+Number.parseInt(e.slice(4),16)>382.5?"#000000":"#ffffff"}function ui(e){return e.match(/^(https?:\/\/)?(www\.)?github\.com\//gi)}function di(e){return e.indexOf(".")<0}function pi(e){if(e)return ui(e)?e.replace(/\?[\s\S]+$/gi,""):di(e)?`${e.startsWith("/")?"":"/"}${e}`:void hi(`URL: ${e} must be to Github or MakeCode documentation`)}function fi(e,t=!1,n=","){if(!e)return[];const r=e.split(n).map(e=>e.trim().toLowerCase()).filter(e=>!!e);if(!t){let e={};return r.forEach(t=>e[t]=t),Object.keys(e)}return r}function hi(e){throw e}function mi(e,t){Hn({kind:e,text:t,hc:!1})}const gi=e=>{const{onBadgeClick:t,availableBadges:n,userState:r}=e,o=n.slice();let a={};for(const e of r.badges){a[e.id]=!0;const t=o.findIndex(t=>t.id===e.id);t>-1?o[t]={...o[t],timestamp:o[t].timestamp||e.timestamp}:o.push(e)}const i=[];for(let e=0;e<Math.max(o.length+10,20);e++)i.push((0,$t.jsx)("div",{className:"placeholder-badge"},e));return(0,$t.jsxs)("div",{className:"profile-badge-list",children:[(0,$t.jsxs)("div",{className:"profile-badge-header",id:"profile-badge-header",children:[(0,$t.jsx)("span",{className:"profile-badge-title",children:lf("Badges")}),(0,$t.jsx)("span",{className:"profile-badge-subtitle",children:lf("Click each badge to see details")})]}),(0,$t.jsx)("div",{className:"profile-badges-scroller",children:(0,$t.jsxs)("div",{className:"profile-badges",role:"list","aria-labelledby":"profile-badge-header",children:[(0,$t.jsx)("div",{className:"profile-badges-background-container","aria-hidden":"true",children:(0,$t.jsx)("div",{className:"profile-badges-background",children:i})}),o.map(e=>(0,$t.jsxs)("div",{className:"profile-badge-and-title",role:"listitem",children:[(0,$t.jsx)(In,{onClick:t,badge:e,disabled:!a[e.id]}),(0,$t.jsx)("div",{className:"profile-badge-name",children:e.title})]},e.id))]})})]})},yi=e=>{const{message:t,icon:n,actionText:r,link:o,xicon:a,title:i}=e.notification;return(0,$t.jsxs)("div",{className:"profile-notification",children:[(0,$t.jsx)("div",{className:"profile-notification-icon",children:(0,$t.jsx)("i",{className:`${a?"xicon":"ui large circular icon "} ${n}`})}),(0,$t.jsx)("div",{className:"profile-notification-title",children:i}),(0,$t.jsx)("div",{className:"profile-notification-message",children:t}),(0,$t.jsxs)("button",{className:"ui icon button profile-notification-button",onClick:()=>{window.open(o,"_blank")},role:"link",children:[(0,$t.jsx)("i",{className:"icon external alternate"}),r]})]})},vi=e=>{const{profile:t,onSignOutClick:n,onDeleteProfileClick:r,onEmailCheckClick:o,notification:a,emailChecked:i}=e,{username:l,displayName:s,picture:c,pictureUrl:u}=t.idp,d=null!=u?u:null==c?void 0:c.dataUrl,p=(0,$t.jsxs)($t.Fragment,{children:[i===Wt.Waiting?(0,$t.jsx)("div",{className:"common-spinner"}):void 0,lf("I would like to receive the MakeCode newsletter. "),(0,$t.jsx)("a",{href:"https://makecode.com/privacy",target:"_blank",rel:"noopener noreferrer",tabIndex:0,children:lf("View Privacy Statement")})]});return(0,$t.jsxs)("div",{className:"profile-user-pane",children:[(0,$t.jsx)("div",{className:"profile-portrait",children:d?(0,$t.jsx)("div",{children:(0,$t.jsx)("img",{src:d,alt:pxt.U.lf("Profile Picture"),referrerPolicy:"no-referrer"})}):(0,$t.jsx)("div",{className:"profile-initials-portrait",children:pxt.auth.userInitials(t)})}),(0,$t.jsxs)("div",{className:"profile-user-details",children:[(0,$t.jsx)("div",{className:"profile-display-name",children:s}),l&&(0,$t.jsx)("div",{className:"profile-username",children:l})]}),a&&(0,$t.jsx)(yi,{notification:a}),(0,$t.jsx)("div",{className:"profile-spacer"}),(0,$t.jsx)("div",{className:"profile-email",children:(0,$t.jsx)(un,{id:"profile-email-checkbox",className:i===Wt.Waiting?"loading":"",isChecked:i===Wt.Selected,onChange:o,label:p})}),(0,$t.jsxs)("div",{className:"profile-actions",children:[(0,$t.jsx)(Zt,{className:"link-button",title:lf("Delete Profile"),label:lf("Delete Profile"),onClick:r}),(0,$t.jsx)(Zt,{className:"sign-out",leftIcon:"fas fa-sign-out-alt",title:lf("Sign Out"),label:lf("Sign Out"),onClick:n})]})]})},bi=e=>{const{badge:t}=e,n=new Date(t.timestamp);return(0,$t.jsxs)("div",{className:"profile-badge-info",children:[(0,$t.jsx)("div",{className:"profile-badge-info-image",children:(0,$t.jsx)(In,{badge:t,disabled:!t.timestamp})}),(0,$t.jsxs)("div",{className:"profile-badge-info-item",id:"profile-badge-info-"+t.id,children:[(0,$t.jsx)("div",{className:"profile-badge-info-header",children:lf("Awarded For:")}),(0,$t.jsx)("div",{className:"profile-badge-info-text",children:wi(t)})]}),t.timestamp?(0,$t.jsxs)("div",{className:"profile-badge-info-item",children:[(0,$t.jsx)("div",{className:"profile-badge-info-header",children:lf("Awarded On:")}),(0,$t.jsx)("div",{className:"profile-badge-info-text",children:n.toLocaleDateString(pxt.U.userLanguage())})]}):void 0]})},wi=e=>{if("skillmap-completion"===e.type)return(0,$t.jsx)("span",{children:Bt(lf("Completing {0}"),(0,$t.jsx)("a",{tabIndex:0,"aria-labelledby":"profile-badge-info-"+e.id,target:"_blank",rel:"noopener noreferrer",href:ki(e.sourceURL),children:pxt.U.rlf(e.title)}))})};function ki(e){if(-1!==e.indexOf("/api/md/")){var t;const n=e.split("/api/md/")[1].split("/").slice(1).join("/");return(null===(t=pxt.webConfig)||void 0===t?void 0:t.skillmapUrl)+"#docs:"+n}{const t=e.split("#");if(2==t.length)return pxt.webConfig.skillmapUrl+"#github:https://github.com/"+t[0]+"/"+t[1]}return pxt.BrowserUtils.isLocalHostDev()?"http://localhost:3000#local:"+e:e}const xi=e=>{var t,n,r,o,a;const{user:i,signOut:l,deleteProfile:s,onClickedEmail:c,notification:u,checkedEmail:d,showModalAsync:p}=e,f=(null==i?void 0:i.profile)||{idp:{}},h=(null==i||null===(t=i.preferences)||void 0===t?void 0:t.badges)||{badges:[]},m=(null===(n=pxt.appTarget)||void 0===n||null===(r=n.cloud)||void 0===r?void 0:r.showBadges)||!1,g=null===(o=pxt.appTarget.appTheme)||void 0===o?void 0:o.condenseProfile,y=null===(a=pxt.appTarget.appTheme)||void 0===a?void 0:a.cloudProfileIcon;return(0,$t.jsxs)("div",{className:"user-profile",children:[(0,$t.jsx)(vi,{profile:f,onSignOutClick:l,onDeleteProfileClick:s,notification:u,emailChecked:d,onEmailCheckClick:c}),m&&(0,$t.jsx)(gi,{availableBadges:pxt.appTarget.defaultBadges||[],userState:h,onBadgeClick:e=>{p({header:lf("{0} Badge",e.title),size:"tiny",hasCloseIcon:!0,onClose:()=>{const e=document.body.querySelector(".common-modal-container.fullscreen [tabindex]");e&&e.focus()},jsx:(0,$t.jsx)(bi,{badge:e})})}}),g&&(0,$t.jsxs)("div",{className:"profile-info-container",children:[(0,$t.jsx)("p",{className:"profile-info",children:lf("Now that you're logged in, your projects will be automatically saved to the cloud so you can access them from any device!")}),y&&(0,$t.jsx)("img",{className:"ui image centered medium",src:y,alt:""})]})]})};class Si extends e.Component{constructor(e){super(e),this.renderUserProfile=()=>{const{profile:e,preferences:t}=this.props,{notification:n,modal:r,emailSelected:o}=this.state;return(0,$t.jsxs)(En,{title:lf("My Profile"),fullscreen:!0,onClose:this.handleOnClose,parentElement:document.querySelector(".app-container")||void 0,children:[(0,$t.jsx)(xi,{user:{profile:e,preferences:t},signOut:this.handleSignout,deleteProfile:this.handleDeleteAccountClick,notification:n,showModalAsync:this.showModalAsync,checkedEmail:o,onClickedEmail:this.handleEmailClick}),r&&(0,$t.jsx)(En,{title:r.header,onClose:this.closeModal,className:r.className,children:r.jsx})]})},this.avatarPicUrl=()=>{var e,t,n,r;const{profile:o}=this.props;return null!==(e=null==o||null===(t=o.idp)||void 0===t?void 0:t.pictureUrl)&&void 0!==e?e:null==o||null===(n=o.idp)||void 0===n||null===(r=n.picture)||void 0===r?void 0:r.dataUrl},this.handleOnClose=()=>{this.props.dispatchCloseUserProfile()},this.handleSignout=async()=>{pxt.tickEvent("skillmap.userprofile.signout"),Rt(location.hash)},this.handleDeleteAccountClick=async()=>{this.props.dispatchShowDeleteAccountModal()},this.handleEmailClick=e=>{this.setState({emailSelected:Wt.Waiting}),async function(e){return await zt({op:"replace",path:["email"],value:e},{immediate:!0})}(e).then(t=>{var n,r;null!=t&&t.success?(r=lf("Settings saved"),pxt.debug(r),mi("info",r),this.setState({emailSelected:null!==(n=t.res)&&void 0!==n&&n.email?Wt.Selected:Wt.Unselected})):(function(e){pxt.tickEvent("notification.error",{message:e}),mi("err",e)}(lf("Oops, something went wrong")),this.setState({emailSelected:e?Wt.Unselected:Wt.Selected}))})},this.showModalAsync=async e=>{this.setState({modal:e})},this.closeModal=()=>{var e;const t=null===(e=this.state.modal)||void 0===e?void 0:e.onClose;this.setState({modal:void 0}),t&&t()},Ft().then(e=>this.setState({emailSelected:null!=e&&e.email?Wt.Selected:Wt.Unselected})),pxt.targetConfigAsync().then(e=>this.setState({notification:e.profileNotification}))}render(){const{showProfile:e}=this.props;return e?this.renderUserProfile():(0,$t.jsx)("div",{})}}const Ci=z(function(e,t){return e?{signedIn:e.auth.signedIn,profile:e.auth.profile,showProfile:e.showProfile,preferences:e.auth.preferences}:{}},{dispatchCloseUserProfile:yt,dispatchShowDeleteAccountModal:()=>St({type:"delete-account"})})(Si);class Ei{constructor(){this.sendMessageAsync=void 0}exportCloudProjectsToLocal(e){return this.sendMessageAsync({type:"pxteditor",action:"convertcloudprojectstolocal",userId:e})}}class Ii{constructor(){this.promise_=void 0,this.resources=void 0,this.appMounted=void 0,this.resolve=void 0,this.promise=()=>this.promise_,this.resources=new Ei,this.promise_=new Promise(e=>{this.resolve=e,this.checkComplete()})}setSendMessageAsync(e){this.resources.sendMessageAsync=e,this.checkComplete()}setAppMounted(){this.appMounted=!0,this.checkComplete()}checkComplete(){var e;this.resolve&&this.appMounted&&this.resources.sendMessageAsync&&(ut.dispatch((e=this.resources,{type:Ce,resources:e})),this.resolve(this.resources))}}class Ti extends e.Component{constructor(e){super(e),this.handleClick=this.handleClick.bind(this)}handleClick(){this.props.onClick(this.props.langId)}render(){const{name:e,ariaLabel:t,description:n}=this.props;return(0,$t.jsx)(Zt,{className:"ui card link card-selected language-card",onClick:this.handleClick,role:"listitem",ariaLabel:t,title:e,label:(0,$t.jsxs)("div",{className:"language-card-container",children:[(0,$t.jsx)("div",{className:"language-card-header",children:e}),(0,$t.jsx)("div",{className:"language-card-description ui desktop only",children:n})]})})}}const ji=["en"];class Ni extends e.Component{constructor(e){super(e),this.changeLanguage=this.changeLanguage.bind(this)}languageList(){var e;return pxt.appTarget.appTheme.selectLanguage&&null!==(e=pxt.appTarget.appTheme.availableLocales)&&void 0!==e&&e.length?pxt.appTarget.appTheme.availableLocales:ji}changeLanguage(e){pxt.Util.allLanguages[e]&&(this.props.onLanguageChanged(e),this.props.onClose())}render(){const e=pxt.appTarget.appTheme,t=this.languageList();return(0,$t.jsxs)(En,{onClose:this.props.onClose,title:lf("Select Language"),className:"language-selector-modal",children:[(0,$t.jsx)("div",{className:"ui cards centered language-selector",role:"list","aria-label":lf("List of available languages"),children:t.map(e=>{const t=pxt.Util.allLanguages[e];return(0,$t.jsx)(Ti,{langId:e,name:t.localizedName,ariaLabel:t.englishName,description:t.englishName,onClick:this.changeLanguage},e)})}),e.crowdinProject?(0,$t.jsx)(jn,{"aria-label":lf("How do I add a new language?"),href:"/translate",target:"_blank",children:lf("How do I add a new language?")}):void 0]})}}const Ai=t=>{const{theme:n}=t,r=e.useRef(null),o=`theme-preview-container-${n.id}`,a=`theme-preview-${n.id}`,i=(0,$t.jsx)("img",{className:"logo",src:"/static/logo/Microsoft_logo_rgb_W-white_D-square.png",alt:"Microsoft MakeCode Logo"});return e.useEffect(()=>{if(null!=r&&r.current){const e=wn(n);r.current.textContent=`.${o} { ${e} }`}},[n]),(0,$t.jsxs)("div",{className:qt("theme-preview-container",o),"aria-hidden":"true",children:[(0,$t.jsx)("style",{ref:r}),(0,$t.jsxs)("div",{className:qt("theme-preview",a),children:[(0,$t.jsxs)("div",{className:"theme-preview-header",children:[i,(0,$t.jsx)("i",{className:"fas fa-user-circle"})]}),(0,$t.jsxs)("div",{className:"theme-preview-workspace",children:[(0,$t.jsxs)("div",{className:"theme-preview-sim-sidebar",children:[(0,$t.jsx)("div",{className:"theme-preview-sim"}),(0,$t.jsxs)("div",{className:"theme-preview-sim-buttons",children:[(0,$t.jsx)("div",{className:"theme-preview-sim-button"}),(0,$t.jsx)("div",{className:"theme-preview-sim-button"}),(0,$t.jsx)("div",{className:"theme-preview-sim-button"})]})]}),(0,$t.jsxs)("div",{className:"theme-preview-toolbox",children:[(0,$t.jsx)("hr",{className:"toolbox-divider"}),(0,$t.jsx)("hr",{className:"toolbox-divider"}),(0,$t.jsx)("hr",{className:"toolbox-divider"})]}),(0,$t.jsx)("div",{className:"theme-preview-workspace-content"})]}),(0,$t.jsxs)("div",{className:"theme-preview-footer",children:[(0,$t.jsx)("div",{className:"theme-preview-download-button"}),(0,$t.jsxs)("div",{className:"theme-preview-editor-tools",children:[(0,$t.jsx)("div",{className:"theme-preview-editor-tool-button"}),(0,$t.jsx)("div",{className:"theme-preview-editor-tool-button"})]})]})]})]})},Pi=e=>{const{id:t,className:n,role:r,children:o,ariaDescribedBy:a,ariaLabelledBy:i,ariaPressed:l,ariaHidden:s,ariaLabel:c,onClick:u,label:d,labelClass:p,tabIndex:f}=e;return(0,$t.jsxs)("div",{id:t,className:qt("common-card",n),role:r,"aria-hidden":s,"aria-label":c,children:[(0,$t.jsxs)("div",{className:"common-card-body",children:[u&&(0,$t.jsx)("button",{className:"common-card-action",tabIndex:f,"aria-describedby":a,"aria-labelledby":i,"aria-pressed":l,onClick:u}),o]}),d&&(0,$t.jsx)("label",{className:qt("common-card-label",p),children:d})]})},Oi=e=>{const{onClick:t,selected:n,theme:r}=e,o=pxt.Util.rlf(`{id:color-theme-name}${r.name}`);return(0,$t.jsx)(Pi,{className:"theme-card"+(n?" selected":""),role:"listitem",ariaLabelledBy:r.id+"-title",ariaPressed:n,onClick:()=>t(r),tabIndex:0,children:(0,$t.jsxs)("div",{className:"theme-info-box",children:[(0,$t.jsx)(Ai,{theme:r}),(0,$t.jsx)("div",{id:r.id+"-title",className:"theme-picker-item-name",children:o})]})},r.id)};function _i(t,n){const[r,o]=e.useState(!1),[a,i]=e.useState(!1),[l,s]=e.useState(!1),c=e.useRef(!1),u=e.useRef(!1);e.useEffect(()=>{var e,n;!r&&u.current&&(null===(e=document.getElementById(t))||void 0===e||null===(n=e.querySelector(".theme-reset-button"))||void 0===n||n.focus(),u.current=!1)},[r,t]);const d=()=>{c.current||(u.current=!0,o(!1))},p=n?{label:lf("Reset"),className:"primary inverted theme-reset-button",onClick:()=>{s(!1),o(!0)}}:void 0,f=r&&(0,$t.jsxs)(En,{title:lf("Reset all themes?"),ariaDescribedBy:"theme-reset-description",onClose:d,hideDismissButton:a,actions:[{label:lf("Cancel"),onClick:d,disabled:a},{label:a?lf("Resetting..."):lf("Reset"),className:"primary",onClick:async()=>{if(n&&!c.current){c.current=!0,i(!0),s(!1);try{await n()}catch(e){pxt.reportException(e),s(!0)}finally{c.current=!1,i(!1)}}},disabled:a}],children:[(0,$t.jsx)("p",{id:"theme-reset-description",children:lf("Are you sure you want to reset the editor and simulator themes to their defaults? This will remove your editor-wide theme customizations. Themes set directly on projects will not be changed. This action cannot be undone.")}),l&&(0,$t.jsx)("p",{role:"alert",children:lf("Unable to reset themes. Please try again.")})]},"theme-reset-confirmation");return{resetAction:p,confirmation:f}}const Ri=e=>{const{selected:t,onModeChanged:n}=e,r=e=>{e!==t&&n(e)};return(0,$t.jsx)("div",{className:"theme-picker-toggle",children:(0,$t.jsx)(An,{id:"theme-picker-toggle",ariaLabel:lf("Theme type"),selected:"editor"===t?0:1,items:[{label:lf("Editor"),title:lf("Editor theme"),icon:"fas fa-paint-brush",focusable:!0,onClick:()=>r("editor")},{label:lf("Simulator"),title:lf("Simulator theme"),icon:"fas fa-gamepad",focusable:!0,onClick:()=>r("simulator")}]})})},Mi=t=>{var n;const[r,o]=e.useState(t.selectedThemeId||(null===(n=t.themes[0])||void 0===n?void 0:n.id)),a=t.themes.find(e=>e.id===r),{resetAction:i,confirmation:l}=_i("theme-picker-modal",t.onReset);return l||(0,$t.jsx)(En,{id:"theme-picker-modal",title:lf("Choose a Theme"),hideTitle:!!t.onSimulatorThemeClicked,onClose:t.onClose,className:t.onSimulatorThemeClicked?"theme-picker-modal":"theme-picker-modal standalone",rightHeader:t.onSimulatorThemeClicked&&(0,$t.jsx)(Ri,{selected:"editor",onModeChanged:t.onSimulatorThemeClicked}),actions:[...i?[i]:[],{label:lf("Apply"),className:"primary",disabled:!a,onClick:()=>a&&t.onSave(a)}],children:(0,$t.jsx)("div",{className:"theme-picker",role:"list","aria-label":lf("List of available themes"),children:t.themes.map(e=>(0,$t.jsx)(Oi,{theme:e,selected:e.id===r,onClick:e=>{o(e.id),t.onThemeChanged(e)}},e.id))})})};function Li(e,t,n,r){if(null==r||!r.length||(null==t?void 0:t.id)===(null==n?void 0:n.id))return e;const o=Ui(n,r);if(!o)return e;if(e){if(e.presetId!==o.presetId)return e;if(pxt.auth.simulatorThemeColorsEqual(e.theme,o.theme)&&e.theme.layout===o.theme.layout)return e}else if(null==n||!n.defaultSimulatorTheme)return e;return o}function Ui(e,t){const n=(null==t?void 0:t.find(e=>"default"===e.id))||(null==t?void 0:t[0]);if(!n)return;const r=null==e?void 0:e.defaultSimulatorTheme,o="string"==typeof r?null==t?void 0:t.find(e=>e.id===r):void 0,a="object"==typeof r?{...n.theme,...r}:(null==o?void 0:o.theme)||n.theme;return{presetId:n.id,theme:Di(a)}}function Di(e){const t={layout:e.layout||pxt.auth.DEFAULT_SIMULATOR_LAYOUT};for(const n of Object.keys(e))pxt.auth.isSimulatorThemeColorProperty(n)&&pxt.auth.isSimulatorThemeColor(e[n])&&(t[n]=e[n]);return t}function Fi(e,t,n=[]){const r=Di(e);r.layout=t;for(const e of n)pxt.auth.isSimulatorThemeColor(r[e.property])||(r[e.property]=e.defaultValue);return r}let zi,$i,Bi,Hi={baseTheme:"PublisherLightTheme"};const qi=e=>{var t,n;if(e.data.Event){const r=e.data;switch(r.Event){case"InAppFeedbackInitOptions":Wi();break;case"InAppFeedbackOnError":pxt.warn("Error Message: ",r.EventArgs);break;case"InAppFeedbackInitializationComplete":pxt.debug("InAppFeedbackInitializationComplete: ",r.EventArgs);break;case"InAppFeedbackOnSuccess":pxt.debug("InAppFeedbackOnSuccess: ",r.EventArgs);break;case"InAppFeedbackDismissWithResult":pxt.debug("InAppFeedbackDismissWithResult: ",r.EventArgs),null===(t=$i)||void 0===t||null===(n=t.onDismiss)||void 0===n||n.call(t)}}},Wi=()=>{(e=>{const t=document.getElementById(Bi);var n,r;t&&t.contentWindow.postMessage(e,null===(n=pxt.webConfig)||void 0===n||null===(r=n.ocv)||void 0===r?void 0:r.iframeEndpoint)})({event:"InAppFeedbackInitOptions",data:zi})},Vi=e=>{const{kind:t,onClose:n}=e,r="rating"===t?lf("Rate this activity"):lf("Leave Feedback for Microsoft");return(0,$t.jsx)(En,{className:"feedback-modal",title:r,onClose:n,children:(0,$t.jsx)(Gi,{kind:t,onClose:n})})},Gi=t=>{var n,r,o,a;const{kind:i,onClose:l}=t,s="rating"===i?{feedbackUiType:"NoSurface",hostPlatform:"IFrame",isDisplayed:!0,isEmailCollectionEnabled:!1,isFileUploadEnabled:!1,isScreenshotEnabled:!1,isScreenRecordingEnabled:!1,invokeOnDismissOnEsc:!1,isFeedbackForumEnabled:!1,isMyFeedbackEnabled:!1,isThankYouPageDisabled:!1,initialFeedbackType:"Unclassified",scenarioConfig:{isScenarioEnabled:!0,scenarioType:"Custom",questionDetails:{questionUiType:"Rating",questionInstruction:{displayedStringInEnglish:"What did you think of this activity?",displayedString:lf("What did you think of this activity?")},questionOptions:[{displayedStringInEnglish:"Boring",displayedString:lf("Boring")},{displayedStringInEnglish:"Not fun",displayedString:lf("Not fun")},{displayedStringInEnglish:"Kinda fun",displayedString:lf("Kinda fun")},{displayedStringInEnglish:"Fun",displayedString:lf("Fun")},{displayedStringInEnglish:"Super fun",displayedString:lf("Super fun")}],questionUiBehaviour:["CommentNotRequired"]}}}:{feedbackUiType:"NoSurface",hostPlatform:"IFrame",isDisplayed:!0,isEmailCollectionEnabled:!1,isFileUploadEnabled:!1,isScreenshotEnabled:!1,isScreenRecordingEnabled:!1,invokeOnDismissOnEsc:!1,isFeedbackForumEnabled:!1,isMyFeedbackEnabled:!1,isThankYouPageDisabled:!1},c="rating"===i?"activity-feedback-frame":"menu-feedback-frame";let u={onDismiss:()=>{l&&l()}};return(0,e.useEffect)(()=>(((e,t,n)=>{var r,o;window.addEventListener("message",qi),$i=n,zi={appId:null===(r=pxt.webConfig)||void 0===r||null===(o=r.ocv)||void 0===o?void 0:o.appId,ageGroup:"Undefined",authenticationType:"Unauthenticated",clientName:"MakeCode",feedbackConfig:e,isProduction:!1,themeOptions:Hi,telemetry:{featureArea:pxt.appTarget.id,browser:pxt.BrowserUtils.browser(),browserVersion:pxt.BrowserUtils.browserVersion(),platform:pxt.BrowserUtils.os(),feedbackOrigin:t}},Bi=t})(s,c,u),()=>{window.removeEventListener("message",qi)}),[]),(0,$t.jsx)($t.Fragment,{children:pxt.U.ocvEnabled()&&(0,$t.jsx)("iframe",{title:"feedback",id:c,src:`${null===(n=pxt.webConfig)||void 0===n||null===(r=n.ocv)||void 0===r?void 0:r.iframeEndpoint}/centrohost?appname=ocvfeedback&feature=host-ocv-inapp-feedback&platform=web&appId=${null===(o=pxt.webConfig)||void 0===o||null===(a=o.ocv)||void 0===a?void 0:a.appId}#/hostedpage`,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups"})})},Ki="custom",Qi="account";function Yi(e){const t=e.startsWith("#")?e:`#${e}`;return/^#[0-9a-f]{6}$/i.test(t)?t.toUpperCase():void 0}const Zi=t=>{var n;const{presets:r,layouts:o,initialPreference:a,defaultTheme:i,accountTheme:l,renderPreview:s,onEditorThemeClicked:c,onUseAccountTheme:u,onThemeChanged:d,onSave:p,onReset:f,onClose:h}=t,m=(null===(n=pxt.appTarget.simulator)||void 0===n?void 0:n.aspectRatio)||1.22,g={"--simulator-theme-aspect-ratio":m,"--simulator-theme-padding-bottom":100/m+"%"},y=function(e){const t={"background-color":lf("Console"),"button-stroke":lf("Button outline"),"text-color":lf("Button labels"),"button-fill":lf("Buttons"),"dpad-fill":lf("D-pad"),"joystick-handle-stroke":lf("Joystick handle outline")};return pxt.auth.DEFAULT_SIMULATOR_THEME_COLOR_PROPERTIES.map(n=>({property:n,label:t[n],defaultValue:e[n]}))}(r[0].theme),v=e=>{var t;const n=null==o||null===(t=o.find(t=>t.id===e))||void 0===t?void 0:t.colorFields;return(null==n?void 0:n.map(e=>({...e,label:pxt.Util.rlf(`{id:simulator-theme-field}${e.label}`)})))||y},b=r.find(e=>e.id===(null==a?void 0:a.presetId)),w=b?b.id:a?function(e,t){var n;return null===(n=t.find(t=>pxt.auth.simulatorThemeColorsEqual(t.theme,e)))||void 0===n?void 0:n.id}(a.theme,r)||Ki:u?Qi:r[0].id,k="default"===w?i||(null==a?void 0:a.theme)||(null==b?void 0:b.theme)||r[0].theme:(null==a?void 0:a.theme)||(null==b?void 0:b.theme)||l||r[0].theme,x=(null==a?void 0:a.theme.layout)||k.layout||pxt.auth.DEFAULT_SIMULATOR_LAYOUT,S=Fi(k,x,v(x)),[C,E]=e.useState(w),[I,T]=e.useState(S),j=I.layout,N=j===pxt.auth.DEFAULT_SIMULATOR_LAYOUT||(null==o?void 0:o.some(e=>e.id===j)),A=v(j),{resetAction:P,confirmation:O}=_i("simulator-theme-picker-modal",f),_=(e,t)=>{const n=Yi(t);if(!n)return;const r={...I,[e]:n};E(Ki),T(r),null==d||d({presetId:Ki,theme:r})};return O||(0,$t.jsx)(En,{id:"simulator-theme-picker-modal",title:lf("Simulator Theme"),hideTitle:!!c,className:"simulator-theme-picker-modal"+(c?"":" standalone"),onClose:h,rightHeader:c&&(0,$t.jsx)(Ri,{selected:"simulator",onModeChanged:c}),actions:[...P?[P]:[],{label:lf("Apply"),className:"primary",onClick:()=>C===Qi?null==u?void 0:u():p({presetId:C,theme:I})}],children:(0,$t.jsxs)("div",{className:"simulator-theme-picker",style:g,children:[s(I),(0,$t.jsxs)("div",{className:"simulator-theme-controls",children:[(0,$t.jsxs)("div",{className:"simulator-theme-select-field",children:[(0,$t.jsx)("label",{htmlFor:"simulator-theme-preset",children:u?lf("Theme"):lf("Built-in theme")}),(0,$t.jsxs)("select",{id:"simulator-theme-preset","aria-label":u?lf("Project simulator theme"):lf("Built-in simulator theme"),className:"simulator-theme-select",value:C,onChange:e=>(e=>{if(e===Qi&&u){E(e);const t=Di(l||r[0].theme);return void T(Fi(t,t.layout,v(t.layout)))}const t=r.find(t=>t.id===e);if(!t)return;const n=Di("default"===e&&i||t.theme),o=Fi(n,n.layout,v(n.layout));E(e),T(o),null==d||d({presetId:e,theme:o})})(e.target.value),children:[u&&(0,$t.jsx)("option",{value:Qi,children:lf("Use account theme")}),C===Ki&&(0,$t.jsx)("option",{value:Ki,disabled:!0,children:lf("Custom")}),r.map(e=>(0,$t.jsx)("option",{value:e.id,children:pxt.Util.rlf(`{id:simulator-theme-name}${e.name}`)},e.id))]})]}),!(null==o||!o.length)&&(0,$t.jsxs)("div",{className:"simulator-theme-select-field",children:[(0,$t.jsx)("label",{htmlFor:"simulator-theme-layout",children:lf("Layout")}),(0,$t.jsxs)("select",{id:"simulator-theme-layout","aria-label":lf("Simulator layout"),className:"simulator-theme-select",value:j,onChange:e=>(e=>{const t=Fi(I,e,v(e));E(Ki),T(t),null==d||d({presetId:Ki,theme:t})})(e.target.value),children:[(0,$t.jsx)("option",{value:pxt.auth.DEFAULT_SIMULATOR_LAYOUT,children:lf("Default")}),!N&&(0,$t.jsx)("option",{value:j,disabled:!0,children:lf("Custom ({0})",j)}),o.map(e=>(0,$t.jsx)("option",{value:e.id,children:pxt.Util.rlf(`{id:simulator-layout-name}${e.name}`)},e.id))]})]}),(0,$t.jsx)("div",{className:"simulator-theme-color-list",children:A.map(e=>(0,$t.jsxs)("div",{className:"simulator-theme-color",children:[(0,$t.jsx)("span",{children:e.label}),(0,$t.jsx)("input",{type:"color","aria-label":lf("{0} color",e.label),value:I[e.property],onChange:t=>_(e.property,t.target.value)}),(0,$t.jsx)(Rn,{ariaLabel:lf("{0} hex color",e.label),initialValue:I[e.property],onChange:t=>_(e.property,t),validator:(e,t)=>Yi(e)||t})]},e.property))})]})]})})},Xi=e=>(0,$t.jsx)(Zi,{...e,renderPreview:e=>(0,$t.jsx)(Ji,{theme:e})}),Ji=t=>{const{theme:n}=t,r=e.useRef(null),o=function(){var e,t;if(De())return"http://localhost:3232/sim/simulator.html";const n=(null===(e=pxt.webConfig)||void 0===e?void 0:e.simUrl)||(null===(t=window.pxtConfig)||void 0===t?void 0:t.simUrl);return new URL(n||"/sim/simulator.html",window.location.origin).toString()}(),a=e.useRef(),i=()=>{var e;if(a.current!==o||null===(e=r.current)||void 0===e||!e.contentWindow)return;const t={type:"setsimtheme",theme:n};r.current.contentWindow.postMessage(t,new URL(o).origin)};return e.useEffect(i,[n,o]),(0,$t.jsx)("div",{className:"simulator-theme-preview",role:"group","aria-label":lf("Simulator theme preview"),children:(0,$t.jsx)("div",{className:"simframe ui embed",children:(0,$t.jsx)("iframe",{ref:r,src:o,title:lf("Simulator theme preview"),sandbox:"allow-same-origin allow-scripts",onLoad:()=>{a.current=o,i()}})})})};var el=n(3705);class tl extends e.Component{constructor(e){super(e),this.queryFlags={},this.unsubscribeChangeListener=void 0,this.loadedUser=void 0,this.readyPromise=void 0,this.themeManager=void 0,this.themePickerInitialColorThemeId=void 0,this.ready=()=>this.readyPromise.promise(),this.handleHashChange=async e=>{await this.parseHashAsync(),e.stopPropagation(),e.preventDefault()},this.handleError=e=>{const t=e||lf("Oops! Couldn't load content, please check the URL and markdown file.");el.error(t),this.setState({error:t})},this.onMakeCodeFrameLoaded=async e=>{this.readyPromise.setSendMessageAsync(e);const t=await Ut();t&&await e({type:"pxteditor",action:"setsimulatortheme",preference:t,savePreference:!1})},this.focusCurrentActivity=()=>{document.querySelector("[data-activity="+this.props.activityId+"] button").focus(),this.props.dispatchChangeSelectedItem(void 0)},this.onStoreChange=async()=>{const{user:e}=ut.getState();e===this.loadedUser||this.loadedUser&&e.id!==this.loadedUser.id||(!this.props.signedIn||this.props.signedIn&&this.state.cloudSyncCheckHasFinished)&&(await At(e),this.loadedUser=e),await this.syncBadgesAsync()},this.changeLanguage=this.changeLanguage.bind(this),this.changeTheme=this.changeTheme.bind(this),this.previewColorTheme=this.previewColorTheme.bind(this),this.showSimulatorThemePicker=this.showSimulatorThemePicker.bind(this),this.showEditorThemePicker=this.showEditorThemePicker.bind(this),this.closeThemePicker=this.closeThemePicker.bind(this),this.saveSimulatorTheme=this.saveSimulatorTheme.bind(this),this.resetEditorThemes=this.resetEditorThemes.bind(this),this.state={cloudSyncCheckHasFinished:!1,badgeSyncLock:!1},this.readyPromise=new Ii,window.addEventListener("hashchange",this.handleHashChange),this.cloudSyncCheckAsync(),this.themeManager=bn.getInstance(document)}async parseHashAsync(){var e,t;let n,r=await pxt.targetConfigAsync();const o=window.location.hash.replace("#","");var a;n=o&&null!==(e=r.skillMap)&&void 0!==e&&null!==(t=e.pathAliases)&&void 0!==t&&t[o]?Oe(r.skillMap.pathAliases[o]):Oe(window.location.hash||(null===(a=r.skillMap)||void 0===a?void 0:a.defaultPath)),await this.fetchAndParseSkillMaps(n.cmd,n.arg)}async initLocalizationAsync(){var e;const t=pxt.appTarget.appTheme,n=window.location.href;let r,o=!1;if(/[&?]translate=1/.test(n)&&!pxt.BrowserUtils.isIE())r=ts.pxtc.Util.TRANSLATION_LOCALE;else{const e=/(live)?(force)?lang=([a-z]{2,}(-[A-Z]+)?)/i.exec(window.location.href);e&&window.location.hash.indexOf(e[0])>=0&&pxt.BrowserUtils.changeHash(window.location.hash.replace(e[0],"")),r=e?e[3]:pxt.BrowserUtils.getCookieLang()||t.defaultLocale||navigator.userLanguage||navigator.language,o=!!e&&!!e[2]}const a=pxt.appTarget.appTheme.defaultLocale;o||pxt.Util.isLocaleEnabled(r)||(r=a);const i=pxt.appTarget.id,l=null===(e=r)||void 0===e?void 0:e.toLocaleLowerCase(),s=pxt.BrowserUtils.isLocalHostDev()&&(!l||(a?a.toLocaleLowerCase()===l:"en"===l||"en-us"===l));var c;pxt.BrowserUtils.isPxtElectron()||s||pxt.Util.enableLiveLocalizationUpdates(),await async function(e){const{targetId:t,baseUrl:n,force:r}=e;let{code:o}=e;const a=await pxt.Util.downloadTranslationsAsync(t,n,o,pxt.Util.liveLocalizationEnabled(),ts.pxtc.Util.TranslationsKind.SkillMap);a&&pxt.Util.setLocalizedStrings(a)}({targetId:i,baseUrl:"",code:r,force:o}),pxt.Util.isLocaleEnabled(r)&&(pxt.BrowserUtils.setCookieLang(r),pxt.Util.setUserLanguage(r),null===(c=pxt.analytics)||void 0===c||c.addDefaultProperties({lang:r})),o&&r&&this.setState({forcelang:r})}async fetchAndParseSkillMaps(e,t){const n=await async function(e,t,n){if(!e||!t)return;let r,o;switch(e){case"docs":return async function(e,t){const n=await pxt.Cloud.markdownAsync(_e(e),t);if(n)return{text:n,identifier:Re(e),status:"approved"}}(t,n);case"github":return await async function(e){const t=pxt.github.parseRepoId(e),n=await pxt.packagesConfigAsync()||{},r=pxt.github.parseRepoId(t.slug);let o,a="unknown";switch(pxt.github.repoStatus(r,n)){case pxt.github.GitRepoStatus.Banned:a="banned",o="https://github.com/"+t.fullName;break;case pxt.github.GitRepoStatus.Approved:a="approved",o=void 0;break;default:o="https://github.com/"+t.fullName}const i=t.tag||await pxt.github.latestVersionAsync(t.slug,n,!0);if(!i)return void pxt.log(`skillmap github tag not found at ${t.fullName}`);t.tag=i;const l=await pxt.github.downloadPackageAsync(`${t.slug}#${t.tag}`,n);if(l){const{identifier:e,fileName:n}=Me(t);return{text:pxt.tutorial.resolveLocalizedMarkdown(t,l.files,n),identifier:e,reportId:o,status:a}}}(t);case"local":return await async function(e){if(De()){e=e.replace(/^\//,"").replace(/\.md$/,"");let t=await fetch("docs/"+e+".md");return{text:await t.text(),identifier:e,status:"approved"}}}(t);default:r=t}if(pxt.BrowserUtils.isSafari())try{o=await Le(r)}catch(e){o=await Le(r)}else o=await Le(r);return{text:o,identifier:r,status:"unknown"}}(e,t,this.state.forcelang),r=null==n?void 0:n.text,o=null==n?void 0:n.identifier,a=null==n?void 0:n.status;let i;if(r&&o&&a)try{"banned"===a?this.handleError(lf("This GitHub repository has been banned.")):(function(e){$e=e}(o),this.props.dispatchSetPageSourceUrl(o,a),this.props.dispatchClearMetadata());const{maps:e,metadata:t}=function(e){const t=pxt.getSectionsFromMarkdownMetadata(e);null!=t&&t.length||hi(`Cannot parse content: ${e}`);const n=[];let r,o=-1;for(let e=0;e<t.length;e++)"single"===t[e].headerKind?r=li(t[e]):"double"===t[e].headerKind&&(o>=0&&n.push(ri(t[o],t.slice(o+1,e))),o=e);return(o>0||0===n.length)&&n.push(ri(t[o],t.slice(o+1,t.length))),{maps:n,metadata:r}}(r);if((null==e?void 0:e.length)>0&&(i=e,this.props.dispatchClearSkillMaps(),e.forEach(e=>{this.props.dispatchAddSkillMap(e)})),t){const{title:e,description:n,infoUrl:r,backgroundImageUrl:o,pixelatedBackground:a,bannerImageUrl:i,theme:l,alternateSources:s,introductoryModal:c}=t;!function(e){ze=e}(e),this.props.dispatchSetPageTitle(e),n&&this.props.dispatchSetPageDescription(n),r&&this.props.dispatchSetPageInfoUrl(r),o&&this.props.dispatchSetPageBackgroundImageUrl(o,a),i&&this.props.dispatchSetPageBannerImageUrl(i),s&&this.props.dispatchSetPageAlternateUrls(s),l&&this.props.dispatchSetPageTheme(l),c&&this.props.dispatchSetModal({type:"markdown-intro",markdownContent:c})}this.setState({error:void 0})}catch(e){this.handleError(e)}else this.setState({error:lf("No content loaded.")});let l=await Nt();o&&!l.completedTags[o]&&(l.completedTags[o]={}),this.applyQueryFlags(l,i,o),this.loadedUser=l,this.props.dispatchSetUser(l);const s=await Ft();s&&this.props.dispatchSetUserPreferences(s)}async cloudSyncCheckAsync(){const e=await this.ready();if(await _t()){const t=async()=>{const t=ut.getState(),n=await jt();let r=await Nt(),o=at(n,t.pageSourceUrl,r);const a=(await e.sendMessageAsync({type:"pxteditor",action:"savelocalprojectstocloud",headerIds:o})).resp.headerIdMap;if(a){const e={...r,mapProgress:{}},o=Object.keys(n.mapProgress);for(const i of o){e.mapProgress[i]={...n.mapProgress[i]};const o=Object.keys(n.mapProgress[i]);for(const l of o)if(!Ye(r,i)){e.mapProgress[i][l]={...n.mapProgress[i][l]},e.completedTags[i]=n.completedTags[i];const r={};e.mapProgress[i][l].activityState=r;const o=n.mapProgress[i][l].activityState;for(const e of Object.keys(o)){const n=o[e];n.headerId?r[e]={...n,headerId:a[n.headerId]||n.headerId}:nt(t.maps[l].activities[e])&&(r[e]={...n})}}}const i=Object.keys(r.mapProgress);for(const t of i)Ye(r,t)&&(e.mapProgress[t]={...r.mapProgress[t]},e.completedTags[t]=r.completedTags[t]);this.props.dispatchSetUser(e),await At(e),r=e;const l=await Ft();l&&this.props.dispatchSetUserPreferences(l),await this.syncBadgesAsync()}await e.sendMessageAsync({type:"pxteditor",action:"requestprojectcloudstatus",headerIds:at(r,t.pageSourceUrl)}),this.setState({cloudSyncCheckHasFinished:!0,showingSyncLoader:!1})},n=1e4;await Promise.race([pxt.U.delay(n).then(()=>{this.state.cloudSyncCheckHasFinished||this.setState({cloudSyncCheckHasFinished:!0,showingSyncLoader:!1})}),t()])}else this.setState({cloudSyncCheckHasFinished:!0})}async initColorThemeAsync(){var e,t,n,r,o;const[a,i]=await Promise.all([Mt(),Lt()]);let l=a&&this.themeManager.isKnownTheme(a)?a:null===(e=pxt.appTarget)||void 0===e||null===(t=e.appTheme)||void 0===t?void 0:t.defaultColorTheme;const s=null===(n=pxt.appTarget)||void 0===n||null===(r=n.appTheme)||void 0===r?void 0:r.highContrastColorTheme;i&&s&&(l=s),l&&l!==(null===(o=this.themeManager.getCurrentColorTheme())||void 0===o?void 0:o.id)&&this.themeManager.switchColorTheme(l)}async componentDidMount(){this.unsubscribeChangeListener=ut.subscribe(this.onStoreChange),this.queryFlags=function(){const e={},t=window.location.search;return t&&new URLSearchParams(t).forEach((t,n)=>{"true"!==t.toLowerCase()&&"1"!==t||(t="true"),e[n]=t}),e}(),this.queryFlags.authcallback&&await async function(e){return await pxt.auth.loginCallbackAsync(e)}(this.queryFlags),await async function(){const e=await Ot();return await(null==e?void 0:e.authCheckAsync())}(),await this.initLocalizationAsync(),await this.initColorThemeAsync(),await this.parseHashAsync(),this.readyPromise.setAppMounted(),await _t()&&!this.state.cloudSyncCheckHasFinished&&this.setState({showingSyncLoader:!0})}componentDidUpdate(e){e.activityOpen&&!this.props.activityOpen&&this.initColorThemeAsync()}componentWillUnmount(){window.removeEventListener("hashchange",this.handleHashChange),this.unsubscribeChangeListener&&this.unsubscribeChangeListener()}changeLanguage(e){pxt.tickEvent("skillmap.menu.lang.changelang",{lang:e}),pxt.BrowserUtils.setCookieLang(e),async function(e){return await zt({op:"replace",path:["language"],value:e},{immediate:!0})}(e).then(()=>location.reload())}async changeTheme(e){var t;await this.persistColorTheme(e);const n=null===(t=pxt.appTarget.simulator)||void 0===t?void 0:t.themePresets;if(null!=n&&n.length){let t=this.state.simulatorThemePreference;var r;if(!t)t=Li(await Ut(),this.themePickerInitialColorThemeId?null===(r=pxt.appTarget.colorThemeMap)||void 0===r?void 0:r[this.themePickerInitialColorThemeId]:void 0,e,n);t&&await this.persistSimulatorTheme(t)}this.closeThemePicker(!1)}previewColorTheme(e){var t,n,r;const o=null===(t=pxt.appTarget.colorThemeMap)||void 0===t?void 0:t[this.state.editorThemeId||(null===(n=this.themeManager.getCurrentColorTheme())||void 0===n?void 0:n.id)];this.themePickerInitialColorThemeId||(this.themePickerInitialColorThemeId=null==o?void 0:o.id),this.themeManager.switchColorTheme(e.id);const a=null===(r=pxt.appTarget.simulator)||void 0===r?void 0:r.themePresets,i=null!=a&&a.length&&this.state.simulatorThemePreference?Li(this.state.simulatorThemePreference,o,e,a):void 0;this.setState({editorThemeId:e.id,simulatorThemePreference:i})}async showSimulatorThemePicker(){var e,t,n,r,o;const a=null===(e=pxt.appTarget.simulator)||void 0===e?void 0:e.themePresets;if(null==a||!a.length)return;const i=null===(t=pxt.appTarget.colorThemeMap)||void 0===t?void 0:t[this.state.editorThemeId||(null===(n=this.themeManager.getCurrentColorTheme())||void 0===n?void 0:n.id)];var l;this.themePickerInitialColorThemeId||(this.themePickerInitialColorThemeId=null===(l=this.themeManager.getCurrentColorTheme())||void 0===l?void 0:l.id);const s=Li(this.state.simulatorThemePreference||await Ut(),this.themePickerInitialColorThemeId?null===(r=pxt.appTarget.colorThemeMap)||void 0===r?void 0:r[this.themePickerInitialColorThemeId]:void 0,i,a)||Ui(i,a);this.setState({simulatorThemePickerOpen:!0,editorThemeId:this.state.editorThemeId||(null===(o=this.themeManager.getCurrentColorTheme())||void 0===o?void 0:o.id),simulatorThemePreference:s})}showEditorThemePicker(){this.setState({simulatorThemePickerOpen:!1})}closeThemePicker(e=!0){var t;e&&this.themePickerInitialColorThemeId&&(null===(t=this.themeManager.getCurrentColorTheme())||void 0===t?void 0:t.id)!==this.themePickerInitialColorThemeId&&this.themeManager.switchColorTheme(this.themePickerInitialColorThemeId),this.themePickerInitialColorThemeId=void 0,this.setState({simulatorThemePickerOpen:!1,editorThemeId:void 0,simulatorThemePreference:void 0}),this.props.dispatchCloseSelectTheme()}async saveSimulatorTheme(e){var t;pxt.tickEvent("skillmap.simulator.theme.save",{preset:e.presetId},{interactiveConsent:!0});const n=this.state.editorThemeId||(null===(t=this.themeManager.getCurrentColorTheme())||void 0===t?void 0:t.id),r=this.themeManager.getAllColorThemes().find(e=>e.id===n);r&&await this.persistColorTheme(r),await this.persistSimulatorTheme(e),this.closeThemePicker(!1)}async resetEditorThemes(){pxt.tickEvent("skillmap.theme.reset",void 0,{interactiveConsent:!0});const e=await async function(e,t){var n,r,o;const a=null===(n=e.appTheme)||void 0===n?void 0:n.defaultColorTheme,i=a?null===(r=e.colorThemeMap)||void 0===r?void 0:r[a]:void 0;if(!i)throw new Error("No default editor theme configured");return await t(i),await Dt(void 0),Ui(i,null===(o=e.simulator)||void 0===o?void 0:o.themePresets)}(pxt.appTarget,e=>this.persistColorTheme(e));if(e){var t;const n=await this.ready();await(null===(t=n.sendMessageAsync)||void 0===t?void 0:t.call(n,{type:"pxteditor",action:"setsimulatortheme",preference:e,savePreference:!1}))}this.closeThemePicker(!1)}async persistColorTheme(e){pxt.tickEvent("skillmap.menu.theme.changetheme",{theme:e.id}),this.themeManager.switchColorTheme(e.id),await async function(e){const t=await Ot();if(t){const n=await t.userPreferencesAsync(),r={...null==n?void 0:n.colorThemeIds,[pxt.appTarget.id]:e};await t.patchUserPreferencesAsync({op:"replace",path:["colorThemeIds"],value:r},{immediate:!0})}}(e.id),!this.themeManager.isHighContrast(e.id)&&await Lt()&&await async function(){return await zt({op:"replace",path:["highContrast"],value:!1},{immediate:!0})}()}async persistSimulatorTheme(e){var t,n;const r=function(e,t){const n=(null==t?void 0:t.find(e=>"default"===e.id))||(null==t?void 0:t[0]);return e.presetId===(null==n?void 0:n.id)&&e.theme.layout===pxt.auth.DEFAULT_SIMULATOR_LAYOUT}(e,null===(t=pxt.appTarget.simulator)||void 0===t?void 0:t.themePresets)?void 0:e;await Dt(r);const o=await this.ready();await(null===(n=o.sendMessageAsync)||void 0===n?void 0:n.call(o,{type:"pxteditor",action:"setsimulatortheme",preference:e,savePreference:!1}))}render(){var e,t,n,r,o,a;const{skillMaps:i,activityOpen:l,backgroundImageUrl:s,theme:c,pixelatedBackground:u}=this.props,{error:d,showingSyncLoader:p,forcelang:f}=this.state,h=Object.keys(i).map(e=>i[e]),m=pxt.U.ocvEnabled(),g=(null===(e=pxt.appTarget.simulator)||void 0===e?void 0:e.themePresets)||[],y=this.state.editorThemeId?null===(t=pxt.appTarget.colorThemeMap)||void 0===t?void 0:t[this.state.editorThemeId]:null===(n=this.themeManager)||void 0===n?void 0:n.getCurrentColorTheme();return(0,$t.jsxs)("div",{className:`app-container ${pxt.appTarget.id}`,children:[(0,$t.jsx)(yn,{}),p&&(0,$t.jsxs)("div",{className:"makecode-frame-loader",children:[(0,$t.jsx)("img",{src:Fe("assets/logo.svg"),alt:lf("MakeCode Logo")}),(0,$t.jsx)("div",{className:"makecode-frame-loader-text",children:lf("Saving to cloud...")})]}),(0,$t.jsxs)("div",{className:"skill-map-container "+(l?"hidden":""),style:{backgroundColor:c.backgroundColor},children:[d?(0,$t.jsx)("div",{className:"skill-map-error",children:d}):(0,$t.jsx)(Ga,{maps:h,backgroundImageUrl:s,backgroundColor:c.backgroundColor,pixelatedBackground:u,strokeColor:c.strokeColor}),!d&&(0,$t.jsx)(ti,{onFocusEscape:this.focusCurrentActivity})]}),(0,$t.jsx)(Cn,{forcelang:f,onWorkspaceReady:this.onMakeCodeFrameLoaded}),(0,$t.jsx)(Ra,{}),(0,$t.jsx)(Ci,{}),this.props.showSelectLanguage&&(0,$t.jsx)(Ni,{onLanguageChanged:this.changeLanguage,onClose:this.props.dispatchCloseSelectLanguage}),this.props.showSelectTheme&&this.themeManager&&!this.state.simulatorThemePickerOpen&&(0,$t.jsx)(Mi,{themes:this.themeManager.getAllColorThemes(),selectedThemeId:this.state.editorThemeId||(null===(r=this.themeManager.getCurrentColorTheme())||void 0===r?void 0:r.id),onThemeChanged:this.previewColorTheme,onSave:this.changeTheme,onReset:this.resetEditorThemes,onSimulatorThemeClicked:g.length?this.showSimulatorThemePicker:void 0,onClose:this.closeThemePicker}),this.props.showSelectTheme&&this.state.simulatorThemePickerOpen&&!!g.length&&(0,$t.jsx)(Xi,{presets:g,layouts:null===(o=pxt.appTarget.simulator)||void 0===o?void 0:o.themeLayouts,initialPreference:this.state.simulatorThemePreference,defaultTheme:null===(a=Ui(y,g))||void 0===a?void 0:a.theme,onThemeChanged:e=>this.setState({simulatorThemePreference:e}),onEditorThemeClicked:this.showEditorThemePicker,onSave:this.saveSimulatorTheme,onReset:this.resetEditorThemes,onClose:this.closeThemePicker}),m&&this.props.showFeedback&&(0,$t.jsx)(Vi,{kind:"rating",onClose:this.props.dispatchCloseFeedback})]})}applyQueryFlags(e,t,n){const r=n||"default";if("true"===this.queryFlags.debugNewUser&&(e.isDebug=!0,e.mapProgress={[r]:{}},e.completedTags={}),"true"===this.queryFlags.debugCompleted&&(e.isDebug=!0,e.mapProgress={[r]:{}},t))for(const a of t){e.mapProgress[r][a.mapId]={completionState:"completed",mapId:a.mapId,activityState:{}};for(const t of Object.keys(a.activities)){var o;const i=a.activities[t];if(e.mapProgress[r][a.mapId].activityState[i.activityId]?e.mapProgress[r][a.mapId].activityState[i.activityId].isCompleted=!0:e.mapProgress[r][a.mapId].activityState[i.activityId]={activityId:i.activityId,isCompleted:!0},"activity"===i.kind&&null!==(o=i.tags)&&void 0!==o&&o.length&&n)for(const t of i.tags)e.completedTags[n][t]||(e.completedTags[n][t]=0),e.completedTags[n][t]++}}}async syncBadgesAsync(){const{user:e,maps:t,pageSourceUrl:n,pageSourceStatus:r}=ut.getState();if(this.props.signedIn&&this.state.cloudSyncCheckHasFinished&&"approved"===r){let r=[];for(const o of Object.keys(t))r.push(...rt(e,n,t[o]));if(r.length){const e=await async function(){const e=await Ot();if(e){const t=await e.userPreferencesAsync();if(t)return t.badges}}()||{badges:[]};if(r=r.filter(t=>!pxt.auth.hasBadge(e,t)),r.length&&!this.state.badgeSyncLock){this.setState({badgeSyncLock:!0});try{await async function(e,t){const n=await Ot();t=t.filter(t=>!e.some(e=>pxt.auth.badgeEquals(e,t))),e=e.map(e=>({...e,timestamp:Date.now()})),await(null==n?void 0:n.patchUserPreferencesAsync({op:"replace",path:["badges"],value:{badges:[...t,...e]}}))}(r,e.badges);const t=await Ft();t&&this.props.dispatchSetUserPreferences(t)}finally{this.setState({badgeSyncLock:!1})}}}}}}const nl=z(function(e,t){var n;return e?{skillMaps:e.maps,activityOpen:!!e.editorView,backgroundImageUrl:e.backgroundImageUrl,pixelatedBackground:e.pixelatedBackground,theme:e.theme,signedIn:e.auth.signedIn,activityId:null===(n=e.selectedItem)||void 0===n?void 0:n.activityId,showSelectLanguage:e.showSelectLanguage,showSelectTheme:e.showSelectTheme,colorThemeId:e.colorThemeId,showFeedback:e.showFeedback}:{}},{dispatchAddSkillMap:e=>({type:V,map:e}),dispatchClearSkillMaps:()=>({type:G}),dispatchClearMetadata:()=>({type:K}),dispatchSetPageTitle:e=>({type:ae,title:e}),dispatchSetPageDescription:e=>({type:ie,description:e}),dispatchSetPageInfoUrl:e=>({type:le,infoUrl:e}),dispatchSetUser:e=>({type:ne,user:e}),dispatchSetPageSourceUrl:(e,t)=>({type:de,url:e,status:t}),dispatchSetPageAlternateUrls:e=>({type:pe,urls:e}),dispatchSetPageBackgroundImageUrl:(e,t)=>({type:se,backgroundImageUrl:e,pixelatedBackground:t}),dispatchSetPageBannerImageUrl:e=>({type:ce,bannerImageUrl:e}),dispatchSetPageTheme:e=>({type:ue,theme:e}),dispatchSetUserPreferences:mt,dispatchChangeSelectedItem:dt,dispatchCloseSelectLanguage:()=>({type:Ie}),dispatchCloseSelectTheme:()=>({type:je}),dispatchShowFeedback:vt,dispatchCloseFeedback:()=>({type:Ae}),dispatchSetModal:St})(tl),rl=window.pxtTargetBundle;rl.bundledpkgs={},pxt.setAppTarget(rl),pxt.Cloud.apiRoot="https://www.makecode.com/api/",De()||pxt.setupWebConfig(window.pxtConfig),t.render((0,$t.jsx)(function(t){var n=t.store,o=t.context,a=t.children,i=(0,e.useMemo)(function(){var e=l(n);return{store:n,subscription:e}},[n]),c=(0,e.useMemo)(function(){return n.getState()},[n]);s(function(){var e=i.subscription;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),c!==n.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}},[i,c]);var u=o||r;return e.createElement(u.Provider,{value:i},a)},{store:ut,children:(0,$t.jsx)(nl,{})}),document.getElementById("root"))})()})();
|
|
1
|
+
/*! For license information please see main.d873f450.js.LICENSE.txt */
|
|
2
|
+
(()=>{var e={46(e,t,n){"use strict";var r=n(5550)(),o=n(1061)("Object.prototype.toString"),a=function(e){return!(r&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===o(e)},i=function(e){return!!a(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==o(e)&&"[object Function]"===o(e.callee)},l=function(){return a(arguments)}();a.isLegacyArguments=i,e.exports=l?a:i},71(e,t,n){"use strict";function r(e){return r="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},r(e)}function o(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}var l,s,c={};function u(e,t,n){n||(n=Error);var r=function(n){function r(n,i,l){var s;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),s=o(this,a(r).call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,i,l))),s.code=e,s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(r,n),r}(n);c[e]=r}function d(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(e){return String(e)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}u("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),u("ERR_INVALID_ARG_TYPE",function(e,t,o){var a,i,s;if(void 0===l&&(l=n(6362)),l("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(i="not ",t.substr(0,4)===i)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-9,n)===t}(e," argument"))s="The ".concat(e," ").concat(a," ").concat(d(t,"type"));else{var c=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+1>e.length)&&-1!==e.indexOf(".",n)}(e)?"property":"argument";s='The "'.concat(e,'" ').concat(c," ").concat(a," ").concat(d(t,"type"))}return s+". Received type ".concat(r(o))},TypeError),u("ERR_INVALID_ARG_VALUE",function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=n(3575));var o=s.inspect(t);return o.length>128&&(o="".concat(o.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(r,". Received ").concat(o)},TypeError,RangeError),u("ERR_INVALID_RETURN_VALUE",function(e,t,n){var o;return o=n&&n.constructor&&n.constructor.name?"instance of ".concat(n.constructor.name):"type ".concat(r(n)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(o,".")},TypeError),u("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];void 0===l&&(l=n(6362)),l(t.length>0,"At least one arg needs to be specified");var o="The ",a=t.length;switch(t=t.map(function(e){return'"'.concat(e,'"')}),a){case 1:o+="".concat(t[0]," argument");break;case 2:o+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:o+=t.slice(0,a-1).join(", "),o+=", and ".concat(t[a-1]," arguments")}return"".concat(o," must be specified")},TypeError),e.exports.codes=c},225(e,t,n){"use strict";var r;if(!Object.keys){var o=Object.prototype.hasOwnProperty,a=Object.prototype.toString,i=n(543),l=Object.prototype.propertyIsEnumerable,s=!l.call({toString:null},"toString"),c=l.call(function(){},"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=function(e){var t=e.constructor;return t&&t.prototype===e},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!p["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{d(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();r=function(e){var t=null!==e&&"object"==typeof e,n="[object Function]"===a.call(e),r=i(e),l=t&&"[object String]"===a.call(e),p=[];if(!t&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var h=c&&n;if(l&&e.length>0&&!o.call(e,0))for(var m=0;m<e.length;++m)p.push(String(m));if(r&&e.length>0)for(var g=0;g<e.length;++g)p.push(String(g));else for(var y in e)h&&"prototype"===y||!o.call(e,y)||p.push(String(y));if(s)for(var v=function(e){if("undefined"==typeof window||!f)return d(e);try{return d(e)}catch(e){return!1}}(e),b=0;b<u.length;++b)v&&"constructor"===u[b]||!o.call(e,u[b])||p.push(u[b]);return p}}e.exports=r},465(e,t,n){"use strict";e.exports=n(1923)},543(e){"use strict";var t=Object.prototype.toString;e.exports=function(e){var n=t.call(e),r="[object Arguments]"===n;return r||(r="[object Array]"!==n&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),r}},630(e,t,n){"use strict";e.exports=n(2138)},690(e,t,n){"use strict";var r=n(7375),o=n(9460),a=o([r("%String.prototype.indexOf%")]);e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&a(e,".prototype.")>-1?o([n]):n}},757(e,t,n){"use strict";var r="undefined"!=typeof Symbol&&Symbol,o=n(3175);e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&o()}},1e3(e,t,n){"use strict";var r=n(6806),o=Object.prototype.toString,a=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){if(!r(t))throw new TypeError("iterator must be a function");var i,l;arguments.length>=3&&(i=n),l=e,"[object Array]"===o.call(l)?function(e,t,n){for(var r=0,o=e.length;r<o;r++)a.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))}(e,t,i):"string"==typeof e?function(e,t,n){for(var r=0,o=e.length;r<o;r++)null==n?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)}(e,t,i):function(e,t,n){for(var r in e)a.call(e,r)&&(null==n?t(e[r],r,e):t.call(n,e[r],r,e))}(e,t,i)}},1016(e){"use strict";e.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},1061(e,t,n){"use strict";var r=n(7375),o=n(3629),a=o(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&a(e,".prototype.")>-1?o(n):n}},1173(e,t,n){"use strict";e.exports=n(5636)},1253(e,t,n){"use strict";var r,o,a,i,l=n(3705);if("object"==typeof performance&&"function"==typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var c=Date,u=c.now();t.unstable_now=function(){return c.now()-u}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var d=null,p=null,f=function(){if(null!==d)try{var e=t.unstable_now();d(!0,e),d=null}catch(e){throw setTimeout(f,0),e}};r=function(e){null!==d?setTimeout(r,0,e):(d=e,setTimeout(f,0))},o=function(e,t){p=setTimeout(e,t)},a=function(){clearTimeout(p)},t.unstable_shouldYield=function(){return!1},i=t.unstable_forceFrameRate=function(){}}else{var h=window.setTimeout,m=window.clearTimeout;if(void 0!==l){var g=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&l.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 g&&l.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var y=!1,v=null,b=-1,k=5,w=0;t.unstable_shouldYield=function(){return t.unstable_now()>=w},i=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?l.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<e?Math.floor(1e3/e):5};var x=new MessageChannel,S=x.port2;x.port1.onmessage=function(){if(null!==v){var e=t.unstable_now();w=e+k;try{v(!0,e)?S.postMessage(null):(y=!1,v=null)}catch(e){throw S.postMessage(null),e}}else y=!1},r=function(e){v=e,y||(y=!0,S.postMessage(null))},o=function(e,n){b=h(function(){e(t.unstable_now())},n)},a=function(){m(b),b=-1}}function C(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,o=e[r];if(!(void 0!==o&&0<T(o,t)))break e;e[r]=t,e[n]=o,n=r}}function E(e){return void 0===(e=e[0])?null:e}function I(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length;r<o;){var a=2*(r+1)-1,i=e[a],l=a+1,s=e[l];if(void 0!==i&&0>T(i,n))void 0!==s&&0>T(s,i)?(e[r]=s,e[l]=n,r=l):(e[r]=i,e[a]=n,r=a);else{if(!(void 0!==s&&0>T(s,n)))break e;e[r]=s,e[l]=n,r=l}}}return t}return null}function T(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var j=[],N=[],A=1,P=null,O=3,_=!1,R=!1,M=!1;function L(e){for(var t=E(N);null!==t;){if(null===t.callback)I(N);else{if(!(t.startTime<=e))break;I(N),t.sortIndex=t.expirationTime,C(j,t)}t=E(N)}}function U(e){if(M=!1,L(e),!R)if(null!==E(j))R=!0,r(D);else{var t=E(N);null!==t&&o(U,t.startTime-e)}}function D(e,n){R=!1,M&&(M=!1,a()),_=!0;var r=O;try{for(L(n),P=E(j);null!==P&&(!(P.expirationTime>n)||e&&!t.unstable_shouldYield());){var i=P.callback;if("function"==typeof i){P.callback=null,O=P.priorityLevel;var l=i(P.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?P.callback=l:P===E(j)&&I(j),L(n)}else I(j);P=E(j)}if(null!==P)var s=!0;else{var c=E(N);null!==c&&o(U,c.startTime-n),s=!1}return s}finally{P=null,O=r,_=!1}}var F=i;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(){R||_||(R=!0,r(D))},t.unstable_getCurrentPriorityLevel=function(){return O},t.unstable_getFirstCallbackNode=function(){return E(j)},t.unstable_next=function(e){switch(O){case 1:case 2:case 3:var t=3;break;default:t=O}var n=O;O=t;try{return e()}finally{O=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=F,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=O;O=e;try{return t()}finally{O=n}},t.unstable_scheduleCallback=function(e,n,i){var l=t.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?l+i:l,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:A++,callback:n,priorityLevel:e,startTime:i,expirationTime:s=i+s,sortIndex:-1},i>l?(e.sortIndex=i,C(N,e),null===E(j)&&e===E(N)&&(M?a():M=!0,o(U,i-l))):(e.sortIndex=s,C(j,e),R||_||(R=!0,r(D))),e},t.unstable_wrapCallback=function(e){var t=O;return function(){var n=O;O=t;try{return e.apply(this,arguments)}finally{O=n}}}},1264(e){"use strict";e.exports=Function.prototype.apply},1338(e,t,n){"use strict";var r=n(4961);e.exports=function(e){return!!r(e)}},1555(e){"use strict";e.exports=Object.getOwnPropertyDescriptor},1581(e){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},1596(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},1619(e){"use strict";e.exports=URIError},1923(e,t,n){"use strict";n(8898);var r=n(1173),o=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var a=Symbol.for;o=a("react.element"),t.Fragment=a("react.fragment")}var i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,a={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)l.call(t,r)&&!s.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:a,_owner:i.current}}t.jsx=c,t.jsxs=c},2138(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,k=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case a:case l:case i:case f:return e;default:switch(e=e&&e.$$typeof){case c:case p:case g:case m:case s:return e;default:return t}}case o:return t}}}function x(e){return w(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=s,t.Element=r,t.ForwardRef=p,t.Fragment=a,t.Lazy=g,t.Memo=m,t.Portal=o,t.Profiler=l,t.StrictMode=i,t.Suspense=f,t.isAsyncMode=function(e){return x(e)||w(e)===u},t.isConcurrentMode=x,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===p},t.isFragment=function(e){return w(e)===a},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===l},t.isStrictMode=function(e){return w(e)===i},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===d||e===l||e===i||e===f||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===p||e.$$typeof===v||e.$$typeof===b||e.$$typeof===k||e.$$typeof===y)},t.typeOf=w},2155(e,t,n){"use strict";var r=Function.prototype.call,o=Object.prototype.hasOwnProperty,a=n(6989);e.exports=a.call(r,o)},2938(e){"use strict";e.exports=Math.max},3110(e,t,n){"use strict";var r=n(6989),o=n(1264),a=n(7858),i=n(6265);e.exports=i||r.call(a,o)},3123(e){"use strict";e.exports=EvalError},3175(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var r in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0}},3500(e,t,n){"use strict";var r=n(3705),o=n(1173),a=n(8898),i=n(5664);function l(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(!o)throw Error(l(227));var s=new Set,c={};function u(e,t){d(e,t),d(e+"Capture",t)}function d(e,t){for(c[e]=t,e=0;e<t.length;e++)s.add(t[e])}var p=!("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]*$/,h=Object.prototype.hasOwnProperty,m={},g={};function y(e,t,n,r,o,a,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=i}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){v[e]=new y(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];v[t]=new y(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){v[e]=new y(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){v[e]=new y(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){v[e]=new y(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){v[e]=new y(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){v[e]=new y(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){v[e]=new y(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){v[e]=new y(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function k(e){return e[1].toUpperCase()}function w(e,t,n,r){var o=v.hasOwnProperty(t)?v[t]:null;(null!==o?0===o.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,o,r)&&(n=null),r||null===o?function(e){return!!h.call(g,e)||!h.call(m,e)&&(f.test(e)?g[e]=!0:(m[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!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(b,k);v[t]=new y(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(b,k);v[t]=new y(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(b,k);v[t]=new y(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){v[e]=new y(e,1,!1,e.toLowerCase(),null,!1,!1)}),v.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){v[e]=new y(e,1,!1,e.toLowerCase(),null,!0,!0)});var x=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=60103,C=60106,E=60107,I=60108,T=60114,j=60109,N=60110,A=60112,P=60113,O=60120,_=60115,R=60116,M=60121,L=60128,U=60129,D=60130,F=60131;if("function"==typeof Symbol&&Symbol.for){var z=Symbol.for;S=z("react.element"),C=z("react.portal"),E=z("react.fragment"),I=z("react.strict_mode"),T=z("react.profiler"),j=z("react.provider"),N=z("react.context"),A=z("react.forward_ref"),P=z("react.suspense"),O=z("react.suspense_list"),_=z("react.memo"),R=z("react.lazy"),M=z("react.block"),z("react.scope"),L=z("react.opaque.id"),U=z("react.debug_trace_mode"),D=z("react.offscreen"),F=z("react.legacy_hidden")}var $,B="function"==typeof Symbol&&Symbol.iterator;function H(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=B&&e[B]||e["@@iterator"])?e:null}function q(e){if(void 0===$)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);$=t&&t[1]||""}return"\n"+$+e}var W=!1;function V(e,t){if(!e||W)return"";W=!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 o=e.stack.split("\n"),a=r.stack.split("\n"),i=o.length-1,l=a.length-1;1<=i&&0<=l&&o[i]!==a[l];)l--;for(;1<=i&&0<=l;i--,l--)if(o[i]!==a[l]){if(1!==i||1!==l)do{if(i--,0>--l||o[i]!==a[l])return"\n"+o[i].replace(" at new "," at ")}while(1<=i&&0<=l);break}}}finally{W=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?q(e):""}function G(e){switch(e.tag){case 5:return q(e.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return V(e.type,!1);case 11:return V(e.type.render,!1);case 22:return V(e.type._render,!1);case 1:return V(e.type,!0);default:return""}}function K(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 E:return"Fragment";case C:return"Portal";case T:return"Profiler";case I:return"StrictMode";case P:return"Suspense";case O:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case N:return(e.displayName||"Context")+".Consumer";case j:return(e._context.displayName||"Context")+".Provider";case A:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case _:return K(e.type);case M:return K(e._render);case R:t=e._payload,e=e._init;try{return K(e(t))}catch(e){}}return null}function Q(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function Y(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Z(e){e._valueTracker||(e._valueTracker=function(e){var t=Y(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 o=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,a.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 X(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Y(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 ee(e,t){var n=t.checked;return a({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function te(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=Q(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 ne(e,t){null!=(t=t.checked)&&w(e,"checked",t,!1)}function re(e,t){ne(e,t);var n=Q(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")?ae(e,t.type,n):t.hasOwnProperty("defaultValue")&&ae(e,t.type,Q(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function oe(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 ae(e,t,n){"number"===t&&J(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function ie(e,t){return e=a({children:void 0},t),(t=function(e){var t="";return o.Children.forEach(e,function(e){null!=e&&(t+=e)}),t}(t.children))&&(e.children=t),e}function le(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Q(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function se(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(l(91));return a({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ce(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(l(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(l(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:Q(n)}}function ue(e,t){var n=Q(t.value),r=Q(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 de(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var pe="http://www.w3.org/1999/xhtml";function fe(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?fe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var me,ge,ye=(ge=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"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 ge(e,t)})}:ge);function ve(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},ke=["Webkit","ms","Moz","O"];function we(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 xe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=we(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(be).forEach(function(e){ke.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),be[t]=be[e]})});var Se=a({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 Ce(e,t){if(t){if(Se[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(l(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(l(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(l(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(l(62))}}function Ee(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 Ie(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Te=null,je=null,Ne=null;function Ae(e){if(e=ro(e)){if("function"!=typeof Te)throw Error(l(280));var t=e.stateNode;t&&(t=ao(t),Te(e.stateNode,e.type,t))}}function Pe(e){je?Ne?Ne.push(e):Ne=[e]:je=e}function Oe(){if(je){var e=je,t=Ne;if(Ne=je=null,Ae(e),t)for(e=0;e<t.length;e++)Ae(t[e])}}function _e(e,t){return e(t)}function Re(e,t,n,r,o){return e(t,n,r,o)}function Me(){}var Le=_e,Ue=!1,De=!1;function Fe(){null===je&&null===Ne||(Me(),Oe())}function ze(e,t){var n=e.stateNode;if(null===n)return null;var r=ao(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(l(231,t,typeof n));return n}var $e=!1;if(p)try{var Be={};Object.defineProperty(Be,"passive",{get:function(){$e=!0}}),window.addEventListener("test",Be,Be),window.removeEventListener("test",Be,Be)}catch(ge){$e=!1}function He(e,t,n,r,o,a,i,l,s){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this.onError(e)}}var qe=!1,We=null,Ve=!1,Ge=null,Ke={onError:function(e){qe=!0,We=e}};function Qe(e,t,n,r,o,a,i,l,s){qe=!1,We=null,He.apply(Ke,arguments)}function Ye(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Ze(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 Xe(e){if(Ye(e)!==e)throw Error(l(188))}function Je(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ye(e)))throw Error(l(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var a=o.alternate;if(null===a){if(null!==(r=o.return)){n=r;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===n)return Xe(o),e;if(a===r)return Xe(o),t;a=a.sibling}throw Error(l(188))}if(n.return!==r.return)n=o,r=a;else{for(var i=!1,s=o.child;s;){if(s===n){i=!0,n=o,r=a;break}if(s===r){i=!0,r=o,n=a;break}s=s.sibling}if(!i){for(s=a.child;s;){if(s===n){i=!0,n=a,r=o;break}if(s===r){i=!0,r=a,n=o;break}s=s.sibling}if(!i)throw Error(l(189))}}if(n.alternate!==r)throw Error(l(190))}if(3!==n.tag)throw Error(l(188));return n.stateNode.current===n?e:t}(e),!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,ot,at=!1,it=[],lt=null,st=null,ct=null,ut=new Map,dt=new Map,pt=[],ft="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,o){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:o,targetContainers:[r]}}function mt(e,t){switch(e){case"focusin":case"focusout":lt=null;break;case"dragenter":case"dragleave":st=null;break;case"mouseover":case"mouseout":ct=null;break;case"pointerover":case"pointerout":ut.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":dt.delete(t.pointerId)}}function gt(e,t,n,r,o,a){return null===e||e.nativeEvent!==a?(e=ht(t,n,r,o,a),null!==t&&null!==(t=ro(t))&&nt(t),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function yt(e){var t=no(e.target);if(null!==t){var n=Ye(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Ze(n)))return e.blockedOn=t,void ot(e.lanePriority,function(){i.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 vt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Jt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ro(n))&&nt(t),e.blockedOn=n,!1;t.shift()}return!0}function bt(e,t,n){vt(e)&&n.delete(t)}function kt(){for(at=!1;0<it.length;){var e=it[0];if(null!==e.blockedOn){null!==(e=ro(e.blockedOn))&&tt(e);break}for(var t=e.targetContainers;0<t.length;){var n=Jt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&it.shift()}null!==lt&&vt(lt)&&(lt=null),null!==st&&vt(st)&&(st=null),null!==ct&&vt(ct)&&(ct=null),ut.forEach(bt),dt.forEach(bt)}function wt(e,t){e.blockedOn===t&&(e.blockedOn=null,at||(at=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,kt)))}function xt(e){function t(t){return wt(t,e)}if(0<it.length){wt(it[0],e);for(var n=1;n<it.length;n++){var r=it[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==lt&&wt(lt,e),null!==st&&wt(st,e),null!==ct&&wt(ct,e),ut.forEach(t),dt.forEach(t),n=0;n<pt.length;n++)(r=pt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<pt.length&&null===(n=pt[0]).blockedOn;)yt(n),null===n.blockedOn&&pt.shift()}function St(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ct={animationend:St("Animation","AnimationEnd"),animationiteration:St("Animation","AnimationIteration"),animationstart:St("Animation","AnimationStart"),transitionend:St("Transition","TransitionEnd")},Et={},It={};function Tt(e){if(Et[e])return Et[e];if(!Ct[e])return e;var t,n=Ct[e];for(t in n)if(n.hasOwnProperty(t)&&t in It)return Et[e]=n[t];return e}p&&(It=document.createElement("div").style,"AnimationEvent"in window||(delete Ct.animationend.animation,delete Ct.animationiteration.animation,delete Ct.animationstart.animation),"TransitionEvent"in window||delete Ct.transitionend.transition);var jt=Tt("animationend"),Nt=Tt("animationiteration"),At=Tt("animationstart"),Pt=Tt("transitionend"),Ot=new Map,_t=new Map,Rt=["abort","abort",jt,"animationEnd",Nt,"animationIteration",At,"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",Pt,"transitionEnd","waiting","waiting"];function Mt(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],o=e[n+1];o="on"+(o[0].toUpperCase()+o.slice(1)),_t.set(r,t),Ot.set(r,o),u(o,[r])}}(0,i.unstable_now)();var Lt=8;function Ut(e){if(1&e)return Lt=15,1;if(2&e)return Lt=14,2;if(4&e)return Lt=13,4;var t=24&e;return 0!==t?(Lt=12,t):32&e?(Lt=11,32):0!=(t=192&e)?(Lt=10,t):256&e?(Lt=9,256):0!=(t=3584&e)?(Lt=8,t):4096&e?(Lt=7,4096):0!=(t=4186112&e)?(Lt=6,t):0!=(t=62914560&e)?(Lt=5,t):67108864&e?(Lt=4,67108864):134217728&e?(Lt=3,134217728):0!=(t=805306368&e)?(Lt=2,t):1073741824&e?(Lt=1,1073741824):(Lt=8,e)}function Dt(e,t){var n=e.pendingLanes;if(0===n)return Lt=0;var r=0,o=0,a=e.expiredLanes,i=e.suspendedLanes,l=e.pingedLanes;if(0!==a)r=a,o=Lt=15;else if(0!=(a=134217727&n)){var s=a&~i;0!==s?(r=Ut(s),o=Lt):0!==(l&=a)&&(r=Ut(l),o=Lt)}else 0!==(a=n&~i)?(r=Ut(a),o=Lt):0!==l&&(r=Ut(l),o=Lt);if(0===r)return 0;if(r=n&((0>(r=31-qt(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0===(t&i)){if(Ut(t),o<=Lt)return t;Lt=o}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)o=1<<(n=31-qt(t)),r|=e[n],t&=~o;return r}function Ft(e){return 0!=(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function zt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=$t(24&~t))?zt(10,t):e;case 10:return 0===(e=$t(192&~t))?zt(8,t):e;case 8:return 0===(e=$t(3584&~t))&&0===(e=$t(4186112&~t))&&(e=512),e;case 2:return 0===(t=$t(805306368&~t))&&(t=268435456),t}throw Error(l(358,e))}function $t(e){return e&-e}function Bt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ht(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-qt(t)]=n}var qt=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Wt(e)/Vt|0)|0},Wt=Math.log,Vt=Math.LN2,Gt=i.unstable_UserBlockingPriority,Kt=i.unstable_runWithPriority,Qt=!0;function Yt(e,t,n,r){Ue||Me();var o=Xt,a=Ue;Ue=!0;try{Re(o,e,t,n,r)}finally{(Ue=a)||Fe()}}function Zt(e,t,n,r){Kt(Gt,Xt.bind(null,e,t,n,r))}function Xt(e,t,n,r){var o;if(Qt)if((o=!(4&t))&&0<it.length&&-1<ft.indexOf(e))e=ht(null,e,t,n,r),it.push(e);else{var a=Jt(e,t,n,r);if(null===a)o&&mt(e,r);else{if(o){if(-1<ft.indexOf(e))return e=ht(a,e,t,n,r),void it.push(e);if(function(e,t,n,r,o){switch(t){case"focusin":return lt=gt(lt,e,t,n,r,o),!0;case"dragenter":return st=gt(st,e,t,n,r,o),!0;case"mouseover":return ct=gt(ct,e,t,n,r,o),!0;case"pointerover":var a=o.pointerId;return ut.set(a,gt(ut.get(a)||null,e,t,n,r,o)),!0;case"gotpointercapture":return a=o.pointerId,dt.set(a,gt(dt.get(a)||null,e,t,n,r,o)),!0}return!1}(a,e,t,n,r))return;mt(e,r)}Mr(e,t,r,null,n)}}}function Jt(e,t,n,r){var o=Ie(r);if(null!==(o=no(o))){var a=Ye(o);if(null===a)o=null;else{var i=a.tag;if(13===i){if(null!==(o=Ze(a)))return o;o=null}else if(3===i){if(a.stateNode.hydrate)return 3===a.tag?a.stateNode.containerInfo:null;o=null}else a!==o&&(o=null)}}return Mr(e,t,r,o,n),null}var en=null,tn=null,nn=null;function rn(){if(nn)return nn;var e,t,n=tn,r=n.length,o="value"in en?en.value:en.textContent,a=o.length;for(e=0;e<r&&n[e]===o[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===o[a-t];t++);return nn=o.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 ln(){return!1}function sn(e){function t(t,n,r,o,a){for(var i in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(i)&&(t=e[i],this[i]=t?t(o):o[i]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?an:ln,this.isPropagationStopped=ln,this}return a(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 cn,un,dn,pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fn=sn(pn),hn=a({},pn,{view:0,detail:0}),mn=sn(hn),gn=a({},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?(cn=e.screenX-dn.screenX,un=e.screenY-dn.screenY):un=cn=0,dn=e),cn)},movementY:function(e){return"movementY"in e?e.movementY:un}}),yn=sn(gn),vn=sn(a({},gn,{dataTransfer:0})),bn=sn(a({},hn,{relatedTarget:0})),kn=sn(a({},pn,{animationName:0,elapsedTime:0,pseudoElement:0})),wn=a({},pn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xn=sn(wn),Sn=sn(a({},pn,{data:0})),Cn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},En={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"},In={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=In[e])&&!!t[e]}function jn(){return Tn}var Nn=a({},hn,{key:function(e){if(e.key){var t=Cn[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?En[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}}),An=sn(Nn),Pn=sn(a({},gn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),On=sn(a({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jn})),_n=sn(a({},pn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Rn=a({},gn,{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}),Mn=sn(Rn),Ln=[9,13,27,32],Un=p&&"CompositionEvent"in window,Dn=null;p&&"documentMode"in document&&(Dn=document.documentMode);var Fn=p&&"TextEvent"in window&&!Dn,zn=p&&(!Un||Dn&&8<Dn&&11>=Dn),$n=String.fromCharCode(32),Bn=!1;function Hn(e,t){switch(e){case"keyup":return-1!==Ln.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Wn=!1,Vn={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 Gn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Vn[e.type]:"textarea"===t}function Kn(e,t,n,r){Pe(r),0<(t=Ur(t,"onChange")).length&&(n=new fn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Qn=null,Yn=null;function Zn(e){Nr(e,0)}function Xn(e){if(X(oo(e)))return e}function Jn(e,t){if("change"===e)return t}var er=!1;if(p){var tr;if(p){var nr="oninput"in document;if(!nr){var rr=document.createElement("div");rr.setAttribute("oninput","return;"),nr="function"==typeof rr.oninput}tr=nr}else tr=!1;er=tr&&(!document.documentMode||9<document.documentMode)}function or(){Qn&&(Qn.detachEvent("onpropertychange",ar),Yn=Qn=null)}function ar(e){if("value"===e.propertyName&&Xn(Yn)){var t=[];if(Kn(t,Yn,e,Ie(e)),e=Zn,Ue)e(t);else{Ue=!0;try{_e(e,t)}finally{Ue=!1,Fe()}}}}function ir(e,t,n){"focusin"===e?(or(),Yn=n,(Qn=t).attachEvent("onpropertychange",ar)):"focusout"===e&&or()}function lr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Xn(Yn)}function sr(e,t){if("click"===e)return Xn(t)}function cr(e,t){if("input"===e||"change"===e)return Xn(t)}var ur="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},dr=Object.prototype.hasOwnProperty;function pr(e,t){if(ur(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(!dr.call(t,n[r])||!ur(e[n[r]],t[n[r]]))return!1;return!0}function fr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hr(e,t){var n,r=fr(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=fr(r)}}function mr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?mr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function gr(){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 yr(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 vr=p&&"documentMode"in document&&11>=document.documentMode,br=null,kr=null,wr=null,xr=!1;function Sr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;xr||null==br||br!==J(r)||(r="selectionStart"in(r=br)&&yr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},wr&&pr(wr,r)||(wr=r,0<(r=Ur(kr,"onSelect")).length&&(t=new fn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=br)))}Mt("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),Mt("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),Mt(Rt,2);for(var Cr="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Er=0;Er<Cr.length;Er++)_t.set(Cr[Er],0);d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("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 Ir="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Tr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ir));function jr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,o,a,i,s,c){if(Qe.apply(this,arguments),qe){if(!qe)throw Error(l(198));var u=We;qe=!1,We=null,Ve||(Ve=!0,Ge=u)}}(r,t,void 0,e),e.currentTarget=null}function Nr(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],s=l.instance,c=l.currentTarget;if(l=l.listener,s!==a&&o.isPropagationStopped())break e;jr(o,l,c),a=s}else for(i=0;i<r.length;i++){if(s=(l=r[i]).instance,c=l.currentTarget,l=l.listener,s!==a&&o.isPropagationStopped())break e;jr(o,l,c),a=s}}}if(Ve)throw e=Ge,Ve=!1,Ge=null,e}function Ar(e,t){var n=io(t),r=e+"__bubble";n.has(r)||(Rr(t,e,2,!1),n.add(r))}var Pr="_reactListening"+Math.random().toString(36).slice(2);function Or(e){e[Pr]||(e[Pr]=!0,s.forEach(function(t){Tr.has(t)||_r(t,!1,e,null),_r(t,!0,e,null)}))}function _r(e,t,n,r){var o=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,a=n;if("selectionchange"===e&&9!==n.nodeType&&(a=n.ownerDocument),null!==r&&!t&&Tr.has(e)){if("scroll"!==e)return;o|=2,a=r}var i=io(a),l=e+"__"+(t?"capture":"bubble");i.has(l)||(t&&(o|=4),Rr(a,e,o,t),i.add(l))}function Rr(e,t,n,r){var o=_t.get(t);switch(void 0===o?2:o){case 0:o=Yt;break;case 1:o=Zt;break;default:o=Xt}n=o.bind(null,t,n,e),o=void 0,!$e||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Mr(e,t,n,r,o){var a=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var i=r.tag;if(3===i||4===i){var l=r.stateNode.containerInfo;if(l===o||8===l.nodeType&&l.parentNode===o)break;if(4===i)for(i=r.return;null!==i;){var s=i.tag;if((3===s||4===s)&&((s=i.stateNode.containerInfo)===o||8===s.nodeType&&s.parentNode===o))return;i=i.return}for(;null!==l;){if(null===(i=no(l)))return;if(5===(s=i.tag)||6===s){r=a=i;continue e}l=l.parentNode}}r=r.return}!function(e,t,n){if(De)return e();De=!0;try{return Le(e,t,n)}finally{De=!1,Fe()}}(function(){var r=a,o=Ie(n),i=[];e:{var l=Ot.get(e);if(void 0!==l){var s=fn,c=e;switch(e){case"keypress":if(0===on(n))break e;case"keydown":case"keyup":s=An;break;case"focusin":c="focus",s=bn;break;case"focusout":c="blur",s=bn;break;case"beforeblur":case"afterblur":s=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":s=yn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":s=vn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":s=On;break;case jt:case Nt:case At:s=kn;break;case Pt:s=_n;break;case"scroll":s=mn;break;case"wheel":s=Mn;break;case"copy":case"cut":case"paste":s=xn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":s=Pn}var u=!!(4&t),d=!u&&"scroll"===e,p=u?null!==l?l+"Capture":null:l;u=[];for(var f,h=r;null!==h;){var m=(f=h).stateNode;if(5===f.tag&&null!==m&&(f=m,null!==p&&null!=(m=ze(h,p))&&u.push(Lr(h,m,f))),d)break;h=h.return}0<u.length&&(l=new s(l,c,null,n,o),i.push({event:l,listeners:u}))}}if(!(7&t)){if(s="mouseout"===e||"pointerout"===e,(!(l="mouseover"===e||"pointerover"===e)||16&t||!(c=n.relatedTarget||n.fromElement)||!no(c)&&!c[eo])&&(s||l)&&(l=o.window===o?o:(l=o.ownerDocument)?l.defaultView||l.parentWindow:window,s?(s=r,null!==(c=(c=n.relatedTarget||n.toElement)?no(c):null)&&(c!==(d=Ye(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(s=null,c=r),s!==c)){if(u=yn,m="onMouseLeave",p="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(u=Pn,m="onPointerLeave",p="onPointerEnter",h="pointer"),d=null==s?l:oo(s),f=null==c?l:oo(c),(l=new u(m,h+"leave",s,n,o)).target=d,l.relatedTarget=f,m=null,no(o)===r&&((u=new u(p,h+"enter",c,n,o)).target=f,u.relatedTarget=d,m=u),d=m,s&&c)e:{for(p=c,h=0,f=u=s;f;f=Dr(f))h++;for(f=0,m=p;m;m=Dr(m))f++;for(;0<h-f;)u=Dr(u),h--;for(;0<f-h;)p=Dr(p),f--;for(;h--;){if(u===p||null!==p&&u===p.alternate)break e;u=Dr(u),p=Dr(p)}u=null}else u=null;null!==s&&Fr(i,l,s,u,!1),null!==c&&null!==d&&Fr(i,d,c,u,!0)}if("select"===(s=(l=r?oo(r):window).nodeName&&l.nodeName.toLowerCase())||"input"===s&&"file"===l.type)var g=Jn;else if(Gn(l))if(er)g=cr;else{g=lr;var y=ir}else(s=l.nodeName)&&"input"===s.toLowerCase()&&("checkbox"===l.type||"radio"===l.type)&&(g=sr);switch(g&&(g=g(e,r))?Kn(i,g,n,o):(y&&y(e,l,r),"focusout"===e&&(y=l._wrapperState)&&y.controlled&&"number"===l.type&&ae(l,"number",l.value)),y=r?oo(r):window,e){case"focusin":(Gn(y)||"true"===y.contentEditable)&&(br=y,kr=r,wr=null);break;case"focusout":wr=kr=br=null;break;case"mousedown":xr=!0;break;case"contextmenu":case"mouseup":case"dragend":xr=!1,Sr(i,n,o);break;case"selectionchange":if(vr)break;case"keydown":case"keyup":Sr(i,n,o)}var v;if(Un)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?Hn(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(zn&&"ko"!==n.locale&&(Wn||"onCompositionStart"!==b?"onCompositionEnd"===b&&Wn&&(v=rn()):(tn="value"in(en=o)?en.value:en.textContent,Wn=!0)),0<(y=Ur(r,b)).length&&(b=new Sn(b,e,null,n,o),i.push({event:b,listeners:y}),(v||null!==(v=qn(n)))&&(b.data=v))),(v=Fn?function(e,t){switch(e){case"compositionend":return qn(t);case"keypress":return 32!==t.which?null:(Bn=!0,$n);case"textInput":return(e=t.data)===$n&&Bn?null:e;default:return null}}(e,n):function(e,t){if(Wn)return"compositionend"===e||!Un&&Hn(e,t)?(e=rn(),nn=tn=en=null,Wn=!1,e):null;switch(e){case"paste":default: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 zn&&"ko"!==t.locale?null:t.data}}(e,n))&&0<(r=Ur(r,"onBeforeInput")).length&&(o=new Sn("onBeforeInput","beforeinput",null,n,o),i.push({event:o,listeners:r}),o.data=v)}Nr(i,t)})}function Lr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ur(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,a=o.stateNode;5===o.tag&&null!==a&&(o=a,null!=(a=ze(e,n))&&r.unshift(Lr(e,a,o)),null!=(a=ze(e,t))&&r.push(Lr(e,a,o))),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 Fr(e,t,n,r,o){for(var a=t._reactName,i=[];null!==n&&n!==r;){var l=n,s=l.alternate,c=l.stateNode;if(null!==s&&s===r)break;5===l.tag&&null!==c&&(l=c,o?null!=(s=ze(n,a))&&i.unshift(Lr(n,s,l)):o||null!=(s=ze(n,a))&&i.push(Lr(n,s,l))),n=n.return}0!==i.length&&e.push({event:t,listeners:i})}function zr(){}var $r=null,Br=null;function Hr(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function qr(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,Vr="function"==typeof clearTimeout?clearTimeout:void 0;function Gr(e){(1===e.nodeType||9===e.nodeType&&null!=(e=e.body))&&(e.textContent="")}function Kr(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 Yr=0,Zr=Math.random().toString(36).slice(2),Xr="__reactFiber$"+Zr,Jr="__reactProps$"+Zr,eo="__reactContainer$"+Zr,to="__reactEvents$"+Zr;function no(e){var t=e[Xr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[eo]||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 ro(e){return!(e=e[Xr]||e[eo])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function oo(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(l(33))}function ao(e){return e[Jr]||null}function io(e){var t=e[to];return void 0===t&&(t=e[to]=new Set),t}var lo=[],so=-1;function co(e){return{current:e}}function uo(e){0>so||(e.current=lo[so],lo[so]=null,so--)}function po(e,t){so++,lo[so]=e.current,e.current=t}var fo={},ho=co(fo),mo=co(!1),go=fo;function yo(e,t){var n=e.type.contextTypes;if(!n)return fo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,a={};for(o in n)a[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function vo(e){return null!==(e=e.childContextTypes)&&void 0!==e}function bo(){uo(mo),uo(ho)}function ko(e,t,n){if(ho.current!==fo)throw Error(l(168));po(ho,t),po(mo,n)}function wo(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(l(108,K(t)||"Unknown",o));return a({},n,r)}function xo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fo,go=ho.current,po(ho,e),po(mo,mo.current),!0}function So(e,t,n){var r=e.stateNode;if(!r)throw Error(l(169));n?(e=wo(e,t,go),r.__reactInternalMemoizedMergedChildContext=e,uo(mo),uo(ho),po(ho,e)):uo(mo),po(mo,n)}var Co=null,Eo=null,Io=i.unstable_runWithPriority,To=i.unstable_scheduleCallback,jo=i.unstable_cancelCallback,No=i.unstable_shouldYield,Ao=i.unstable_requestPaint,Po=i.unstable_now,Oo=i.unstable_getCurrentPriorityLevel,_o=i.unstable_ImmediatePriority,Ro=i.unstable_UserBlockingPriority,Mo=i.unstable_NormalPriority,Lo=i.unstable_LowPriority,Uo=i.unstable_IdlePriority,Do={},Fo=void 0!==Ao?Ao:function(){},zo=null,$o=null,Bo=!1,Ho=Po(),qo=1e4>Ho?Po:function(){return Po()-Ho};function Wo(){switch(Oo()){case _o:return 99;case Ro:return 98;case Mo:return 97;case Lo:return 96;case Uo:return 95;default:throw Error(l(332))}}function Vo(e){switch(e){case 99:return _o;case 98:return Ro;case 97:return Mo;case 96:return Lo;case 95:return Uo;default:throw Error(l(332))}}function Go(e,t){return e=Vo(e),Io(e,t)}function Ko(e,t,n){return e=Vo(e),To(e,t,n)}function Qo(){if(null!==$o){var e=$o;$o=null,jo(e)}Yo()}function Yo(){if(!Bo&&null!==zo){Bo=!0;var e=0;try{var t=zo;Go(99,function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}}),zo=null}catch(t){throw null!==zo&&(zo=zo.slice(e+1)),To(_o,Qo),t}finally{Bo=!1}}}var Zo=x.ReactCurrentBatchConfig;function Xo(e,t){if(e&&e.defaultProps){for(var n in t=a({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var Jo=co(null),ea=null,ta=null,na=null;function ra(){na=ta=ea=null}function oa(e){var t=Jo.current;uo(Jo),e.type._context._currentValue=t}function aa(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 ia(e,t){ea=e,na=ta=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(Ui=!0),e.firstContext=null)}function la(e,t){if(na!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(na=e,t=1073741823),t={context:e,observedBits:t,next:null},null===ta){if(null===ea)throw Error(l(308));ta=t,ea.dependencies={lanes:0,firstContext:t,responders:null}}else ta=ta.next=t;return e._currentValue}var sa=!1;function ca(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function ua(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 da(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function pa(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 fa(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?o=a=i:a=a.next=i,n=n.next}while(null!==n);null===a?o=a=t:a=a.next=t}else o=a=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:a,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ha(e,t,n,r){var o=e.updateQueue;sa=!1;var i=o.firstBaseUpdate,l=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var c=s,u=c.next;c.next=null,null===l?i=u:l.next=u,l=c;var d=e.alternate;if(null!==d){var p=(d=d.updateQueue).lastBaseUpdate;p!==l&&(null===p?d.firstBaseUpdate=u:p.next=u,d.lastBaseUpdate=c)}}if(null!==i){for(p=o.baseState,l=0,d=u=c=null;;){s=i.lane;var f=i.eventTime;if((r&s)===s){null!==d&&(d=d.next={eventTime:f,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var h=e,m=i;switch(s=t,f=n,m.tag){case 1:if("function"==typeof(h=m.payload)){p=h.call(f,p,s);break e}p=h;break e;case 3:h.flags=-4097&h.flags|64;case 0:if(null===(s="function"==typeof(h=m.payload)?h.call(f,p,s):h)||void 0===s)break e;p=a({},p,s);break e;case 2:sa=!0}}null!==i.callback&&(e.flags|=32,null===(s=o.effects)?o.effects=[i]:s.push(i))}else f={eventTime:f,lane:s,tag:i.tag,payload:i.payload,callback:i.callback,next:null},null===d?(u=d=f,c=p):d=d.next=f,l|=s;if(null===(i=i.next)){if(null===(s=o.shared.pending))break;i=s.next,s.next=null,o.lastBaseUpdate=s,o.shared.pending=null}}null===d&&(c=p),o.baseState=c,o.firstBaseUpdate=u,o.lastBaseUpdate=d,Fl|=l,e.lanes=l,e.memoizedState=p}}function ma(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(null!==o){if(r.callback=null,r=n,"function"!=typeof o)throw Error(l(191,o));o.call(r)}}}var ga=(new o.Component).refs;function ya(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:a({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var va={isMounted:function(e){return!!(e=e._reactInternals)&&Ye(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=us(),o=ds(e),a=da(r,o);a.payload=t,null!=n&&(a.callback=n),pa(e,a),ps(e,o,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=us(),o=ds(e),a=da(r,o);a.tag=1,a.payload=t,null!=n&&(a.callback=n),pa(e,a),ps(e,o,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=us(),r=ds(e),o=da(n,r);o.tag=2,null!=t&&(o.callback=t),pa(e,o),ps(e,r,n)}};function ba(e,t,n,r,o,a,i){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,i):!(t.prototype&&t.prototype.isPureReactComponent&&pr(n,r)&&pr(o,a))}function ka(e,t,n){var r=!1,o=fo,a=t.contextType;return"object"==typeof a&&null!==a?a=la(a):(o=vo(t)?go:ho.current,a=(r=null!==(r=t.contextTypes)&&void 0!==r)?yo(e,o):fo),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=va,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=a),t}function wa(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&&va.enqueueReplaceState(t,t.state,null)}function xa(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=ga,ca(e);var a=t.contextType;"object"==typeof a&&null!==a?o.context=la(a):(a=vo(t)?go:ho.current,o.context=yo(e,a)),ha(e,n,o,r),o.state=e.memoizedState,"function"==typeof(a=t.getDerivedStateFromProps)&&(ya(e,t,a,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&va.enqueueReplaceState(o,o.state,null),ha(e,n,o,r),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.flags|=4)}var Sa=Array.isArray;function Ca(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(l(309));var r=n.stateNode}if(!r)throw Error(l(147,e));var o=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===o?t.ref:(t=function(e){var t=r.refs;t===ga&&(t=r.refs={}),null===e?delete t[o]:t[o]=e},t._stringRef=o,t)}if("string"!=typeof e)throw Error(l(284));if(!n._owner)throw Error(l(290,e))}return e}function Ea(e,t){if("textarea"!==e.type)throw Error(l(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function Ia(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 o(e,t){return(e=qs(e,t)).index=0,e.sibling=null,e}function a(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 i(t){return e&&null===t.alternate&&(t.flags=2),t}function s(e,t,n,r){return null===t||6!==t.tag?((t=Ks(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function c(e,t,n,r){return null!==t&&t.elementType===n.type?((r=o(t,n.props)).ref=Ca(e,t,n),r.return=e,r):((r=Ws(n.type,n.key,n.props,null,e.mode,r)).ref=Ca(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Qs(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function d(e,t,n,r,a){return null===t||7!==t.tag?((t=Vs(n,e.mode,r,a)).return=e,t):((t=o(t,n)).return=e,t)}function p(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Ks(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case S:return(n=Ws(t.type,t.key,t.props,null,e.mode,n)).ref=Ca(e,null,t),n.return=e,n;case C:return(t=Qs(t,e.mode,n)).return=e,t}if(Sa(t)||H(t))return(t=Vs(t,e.mode,n,null)).return=e,t;Ea(e,t)}return null}function f(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==o?null:s(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case S:return n.key===o?n.type===E?d(e,t,n.props.children,r,o):c(e,t,n,r):null;case C:return n.key===o?u(e,t,n,r):null}if(Sa(n)||H(n))return null!==o?null:d(e,t,n,r,null);Ea(e,n)}return null}function h(e,t,n,r,o){if("string"==typeof r||"number"==typeof r)return s(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case S:return e=e.get(null===r.key?n:r.key)||null,r.type===E?d(t,e,r.props.children,o,r.key):c(t,e,r,o);case C:return u(t,e=e.get(null===r.key?n:r.key)||null,r,o)}if(Sa(r)||H(r))return d(t,e=e.get(n)||null,r,o,null);Ea(t,r)}return null}function m(o,i,l,s){for(var c=null,u=null,d=i,m=i=0,g=null;null!==d&&m<l.length;m++){d.index>m?(g=d,d=null):g=d.sibling;var y=f(o,d,l[m],s);if(null===y){null===d&&(d=g);break}e&&d&&null===y.alternate&&t(o,d),i=a(y,i,m),null===u?c=y:u.sibling=y,u=y,d=g}if(m===l.length)return n(o,d),c;if(null===d){for(;m<l.length;m++)null!==(d=p(o,l[m],s))&&(i=a(d,i,m),null===u?c=d:u.sibling=d,u=d);return c}for(d=r(o,d);m<l.length;m++)null!==(g=h(d,o,m,l[m],s))&&(e&&null!==g.alternate&&d.delete(null===g.key?m:g.key),i=a(g,i,m),null===u?c=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(o,e)}),c}function g(o,i,s,c){var u=H(s);if("function"!=typeof u)throw Error(l(150));if(null==(s=u.call(s)))throw Error(l(151));for(var d=u=null,m=i,g=i=0,y=null,v=s.next();null!==m&&!v.done;g++,v=s.next()){m.index>g?(y=m,m=null):y=m.sibling;var b=f(o,m,v.value,c);if(null===b){null===m&&(m=y);break}e&&m&&null===b.alternate&&t(o,m),i=a(b,i,g),null===d?u=b:d.sibling=b,d=b,m=y}if(v.done)return n(o,m),u;if(null===m){for(;!v.done;g++,v=s.next())null!==(v=p(o,v.value,c))&&(i=a(v,i,g),null===d?u=v:d.sibling=v,d=v);return u}for(m=r(o,m);!v.done;g++,v=s.next())null!==(v=h(m,o,g,v.value,c))&&(e&&null!==v.alternate&&m.delete(null===v.key?g:v.key),i=a(v,i,g),null===d?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(o,e)}),u}return function(e,r,a,s){var c="object"==typeof a&&null!==a&&a.type===E&&null===a.key;c&&(a=a.props.children);var u="object"==typeof a&&null!==a;if(u)switch(a.$$typeof){case S:e:{for(u=a.key,c=r;null!==c;){if(c.key===u){if(7===c.tag){if(a.type===E){n(e,c.sibling),(r=o(c,a.props.children)).return=e,e=r;break e}}else if(c.elementType===a.type){n(e,c.sibling),(r=o(c,a.props)).ref=Ca(e,c,a),r.return=e,e=r;break e}n(e,c);break}t(e,c),c=c.sibling}a.type===E?((r=Vs(a.props.children,e.mode,s,a.key)).return=e,e=r):((s=Ws(a.type,a.key,a.props,null,e.mode,s)).ref=Ca(e,r,a),s.return=e,e=s)}return i(e);case C:e:{for(c=a.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),(r=o(r,a.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Qs(a,e.mode,s)).return=e,e=r}return i(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==r&&6===r.tag?(n(e,r.sibling),(r=o(r,a)).return=e,e=r):(n(e,r),(r=Ks(a,e.mode,s)).return=e,e=r),i(e);if(Sa(a))return m(e,r,a,s);if(H(a))return g(e,r,a,s);if(u&&Ea(e,a),void 0===a&&!c)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(l(152,K(e.type)||"Component"))}return n(e,r)}}var Ta=Ia(!0),ja=Ia(!1),Na={},Aa=co(Na),Pa=co(Na),Oa=co(Na);function _a(e){if(e===Na)throw Error(l(174));return e}function Ra(e,t){switch(po(Oa,t),po(Pa,e),po(Aa,Na),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)}uo(Aa),po(Aa,t)}function Ma(){uo(Aa),uo(Pa),uo(Oa)}function La(e){_a(Oa.current);var t=_a(Aa.current),n=he(t,e.type);t!==n&&(po(Pa,e),po(Aa,n))}function Ua(e){Pa.current===e&&(uo(Aa),uo(Pa))}var Da=co(0);function Fa(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(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 za=null,$a=null,Ba=!1;function Ha(e,t){var n=Bs(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 qa(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);default:return!1}}function Wa(e){if(Ba){var t=$a;if(t){var n=t;if(!qa(e,t)){if(!(t=Kr(n.nextSibling))||!qa(e,t))return e.flags=-1025&e.flags|2,Ba=!1,void(za=e);Ha(za,n)}za=e,$a=Kr(t.firstChild)}else e.flags=-1025&e.flags|2,Ba=!1,za=e}}function Va(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;za=e}function Ga(e){if(e!==za)return!1;if(!Ba)return Va(e),Ba=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!qr(t,e.memoizedProps))for(t=$a;t;)Ha(e,t),t=Kr(t.nextSibling);if(Va(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(l(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){$a=Kr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}$a=null}}else $a=za?Kr(e.stateNode.nextSibling):null;return!0}function Ka(){$a=za=null,Ba=!1}var Qa=[];function Ya(){for(var e=0;e<Qa.length;e++)Qa[e]._workInProgressVersionPrimary=null;Qa.length=0}var Za=x.ReactCurrentDispatcher,Xa=x.ReactCurrentBatchConfig,Ja=0,ei=null,ti=null,ni=null,ri=!1,oi=!1;function ai(){throw Error(l(321))}function ii(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ur(e[n],t[n]))return!1;return!0}function li(e,t,n,r,o,a){if(Ja=a,ei=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Za.current=null===e||null===e.memoizedState?_i:Ri,e=n(r,o),oi){a=0;do{if(oi=!1,!(25>a))throw Error(l(301));a+=1,ni=ti=null,t.updateQueue=null,Za.current=Mi,e=n(r,o)}while(oi)}if(Za.current=Oi,t=null!==ti&&null!==ti.next,Ja=0,ni=ti=ei=null,ri=!1,t)throw Error(l(300));return e}function si(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ni?ei.memoizedState=ni=e:ni=ni.next=e,ni}function ci(){if(null===ti){var e=ei.alternate;e=null!==e?e.memoizedState:null}else e=ti.next;var t=null===ni?ei.memoizedState:ni.next;if(null!==t)ni=t,ti=e;else{if(null===e)throw Error(l(310));e={memoizedState:(ti=e).memoizedState,baseState:ti.baseState,baseQueue:ti.baseQueue,queue:ti.queue,next:null},null===ni?ei.memoizedState=ni=e:ni=ni.next=e}return ni}function ui(e,t){return"function"==typeof t?t(e):t}function di(e){var t=ci(),n=t.queue;if(null===n)throw Error(l(311));n.lastRenderedReducer=e;var r=ti,o=r.baseQueue,a=n.pending;if(null!==a){if(null!==o){var i=o.next;o.next=a.next,a.next=i}r.baseQueue=o=a,n.pending=null}if(null!==o){o=o.next,r=r.baseState;var s=i=a=null,c=o;do{var u=c.lane;if((Ja&u)===u)null!==s&&(s=s.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),r=c.eagerReducer===e?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===s?(i=s=d,a=r):s=s.next=d,ei.lanes|=u,Fl|=u}c=c.next}while(null!==c&&c!==o);null===s?a=r:s.next=i,ur(r,t.memoizedState)||(Ui=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=s,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function pi(e){var t=ci(),n=t.queue;if(null===n)throw Error(l(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,a=t.memoizedState;if(null!==o){n.pending=null;var i=o=o.next;do{a=e(a,i.action),i=i.next}while(i!==o);ur(a,t.memoizedState)||(Ui=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function fi(e,t,n){var r=t._getVersion;r=r(t._source);var o=t._workInProgressVersionPrimary;if(null!==o?e=o===r:(e=e.mutableReadLanes,(e=(Ja&e)===e)&&(t._workInProgressVersionPrimary=r,Qa.push(t))),e)return n(t._source);throw Qa.push(t),Error(l(350))}function hi(e,t,n,r){var o=Pl;if(null===o)throw Error(l(349));var a=t._getVersion,i=a(t._source),s=Za.current,c=s.useState(function(){return fi(o,t,n)}),u=c[1],d=c[0];c=ni;var p=e.memoizedState,f=p.refs,h=f.getSnapshot,m=p.source;p=p.subscribe;var g=ei;return e.memoizedState={refs:f,source:t,subscribe:r},s.useEffect(function(){f.getSnapshot=n,f.setSnapshot=u;var e=a(t._source);if(!ur(i,e)){e=n(t._source),ur(d,e)||(u(e),e=ds(g),o.mutableReadLanes|=e&o.pendingLanes),e=o.mutableReadLanes,o.entangledLanes|=e;for(var r=o.entanglements,l=e;0<l;){var s=31-qt(l),c=1<<s;r[s]|=e,l&=~c}}},[n,t,r]),s.useEffect(function(){return r(t._source,function(){var e=f.getSnapshot,n=f.setSnapshot;try{n(e(t._source));var r=ds(g);o.mutableReadLanes|=r&o.pendingLanes}catch(e){n(function(){throw e})}})},[t,r]),ur(h,n)&&ur(m,t)&&ur(p,r)||((e={pending:null,dispatch:null,lastRenderedReducer:ui,lastRenderedState:d}).dispatch=u=Pi.bind(null,ei,e),c.queue=e,c.baseQueue=null,d=fi(o,t,n),c.memoizedState=c.baseState=d),d}function mi(e,t,n){return hi(ci(),e,t,n)}function gi(e){var t=si();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:ui,lastRenderedState:e}).dispatch=Pi.bind(null,ei,e),[t.memoizedState,e]}function yi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ei.updateQueue)?(t={lastEffect:null},ei.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 vi(e){return e={current:e},si().memoizedState=e}function bi(){return ci().memoizedState}function ki(e,t,n,r){var o=si();ei.flags|=e,o.memoizedState=yi(1|t,n,void 0,void 0===r?null:r)}function wi(e,t,n,r){var o=ci();r=void 0===r?null:r;var a=void 0;if(null!==ti){var i=ti.memoizedState;if(a=i.destroy,null!==r&&ii(r,i.deps))return void yi(t,n,a,r)}ei.flags|=e,o.memoizedState=yi(1|t,n,a,r)}function xi(e,t){return ki(516,4,e,t)}function Si(e,t){return wi(516,4,e,t)}function Ci(e,t){return wi(4,2,e,t)}function Ei(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 Ii(e,t,n){return n=null!=n?n.concat([e]):null,wi(4,2,Ei.bind(null,t,e),n)}function Ti(){}function ji(e,t){var n=ci();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ii(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ni(e,t){var n=ci();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ii(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ai(e,t){var n=Wo();Go(98>n?98:n,function(){e(!0)}),Go(97<n?97:n,function(){var n=Xa.transition;Xa.transition=1;try{e(!1),t()}finally{Xa.transition=n}})}function Pi(e,t,n){var r=us(),o=ds(e),a={lane:o,action:n,eagerReducer:null,eagerState:null,next:null},i=t.pending;if(null===i?a.next=a:(a.next=i.next,i.next=a),t.pending=a,i=e.alternate,e===ei||null!==i&&i===ei)oi=ri=!0;else{if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var l=t.lastRenderedState,s=i(l,n);if(a.eagerReducer=i,a.eagerState=s,ur(s,l))return}catch(e){}ps(e,o,r)}}var Oi={readContext:la,useCallback:ai,useContext:ai,useEffect:ai,useImperativeHandle:ai,useLayoutEffect:ai,useMemo:ai,useReducer:ai,useRef:ai,useState:ai,useDebugValue:ai,useDeferredValue:ai,useTransition:ai,useMutableSource:ai,useOpaqueIdentifier:ai,unstable_isNewReconciler:!1},_i={readContext:la,useCallback:function(e,t){return si().memoizedState=[e,void 0===t?null:t],e},useContext:la,useEffect:xi,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,ki(4,2,Ei.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ki(4,2,e,t)},useMemo:function(e,t){var n=si();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=si();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=Pi.bind(null,ei,e),[r.memoizedState,e]},useRef:vi,useState:gi,useDebugValue:Ti,useDeferredValue:function(e){var t=gi(e),n=t[0],r=t[1];return xi(function(){var t=Xa.transition;Xa.transition=1;try{r(e)}finally{Xa.transition=t}},[e]),n},useTransition:function(){var e=gi(!1),t=e[0];return vi(e=Ai.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=si();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},hi(r,e,t,n)},useOpaqueIdentifier:function(){if(Ba){var e=!1,t=function(e){return{$$typeof:L,toString:e,valueOf:e}}(function(){throw e||(e=!0,n("r:"+(Yr++).toString(36))),Error(l(355))}),n=gi(t)[1];return!(2&ei.mode)&&(ei.flags|=516,yi(5,function(){n("r:"+(Yr++).toString(36))},void 0,null)),t}return gi(t="r:"+(Yr++).toString(36)),t},unstable_isNewReconciler:!1},Ri={readContext:la,useCallback:ji,useContext:la,useEffect:Si,useImperativeHandle:Ii,useLayoutEffect:Ci,useMemo:Ni,useReducer:di,useRef:bi,useState:function(){return di(ui)},useDebugValue:Ti,useDeferredValue:function(e){var t=di(ui),n=t[0],r=t[1];return Si(function(){var t=Xa.transition;Xa.transition=1;try{r(e)}finally{Xa.transition=t}},[e]),n},useTransition:function(){var e=di(ui)[0];return[bi().current,e]},useMutableSource:mi,useOpaqueIdentifier:function(){return di(ui)[0]},unstable_isNewReconciler:!1},Mi={readContext:la,useCallback:ji,useContext:la,useEffect:Si,useImperativeHandle:Ii,useLayoutEffect:Ci,useMemo:Ni,useReducer:pi,useRef:bi,useState:function(){return pi(ui)},useDebugValue:Ti,useDeferredValue:function(e){var t=pi(ui),n=t[0],r=t[1];return Si(function(){var t=Xa.transition;Xa.transition=1;try{r(e)}finally{Xa.transition=t}},[e]),n},useTransition:function(){var e=pi(ui)[0];return[bi().current,e]},useMutableSource:mi,useOpaqueIdentifier:function(){return pi(ui)[0]},unstable_isNewReconciler:!1},Li=x.ReactCurrentOwner,Ui=!1;function Di(e,t,n,r){t.child=null===e?ja(t,null,n,r):Ta(t,e.child,n,r)}function Fi(e,t,n,r,o){n=n.render;var a=t.ref;return ia(t,o),r=li(e,t,n,r,a,o),null===e||Ui?(t.flags|=1,Di(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~o,rl(e,t,o))}function zi(e,t,n,r,o,a){if(null===e){var i=n.type;return"function"!=typeof i||Hs(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Ws(n.type,null,r,t,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,$i(e,t,i,r,o,a))}return i=e.child,0===(o&a)&&(o=i.memoizedProps,(n=null!==(n=n.compare)?n:pr)(o,r)&&e.ref===t.ref)?rl(e,t,a):(t.flags|=1,(e=qs(i,r)).ref=t.ref,e.return=t,t.child=e)}function $i(e,t,n,r,o,a){if(null!==e&&pr(e.memoizedProps,r)&&e.ref===t.ref){if(Ui=!1,0===(a&o))return t.lanes=e.lanes,rl(e,t,a);16384&e.flags&&(Ui=!0)}return qi(e,t,n,r,a)}function Bi(e,t,n){var r=t.pendingProps,o=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(4&t.mode){if(!(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},ks(t,e),null;t.memoizedState={baseLanes:0},ks(t,null!==a?a.baseLanes:n)}else t.memoizedState={baseLanes:0},ks(t,n);else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,ks(t,r);return Di(e,t,o,n),t.child}function Hi(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function qi(e,t,n,r,o){var a=vo(n)?go:ho.current;return a=yo(t,a),ia(t,o),n=li(e,t,n,r,a,o),null===e||Ui?(t.flags|=1,Di(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~o,rl(e,t,o))}function Wi(e,t,n,r,o){if(vo(n)){var a=!0;xo(t)}else a=!1;if(ia(t,o),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),ka(t,n,r),xa(t,n,r,o),r=!0;else if(null===e){var i=t.stateNode,l=t.memoizedProps;i.props=l;var s=i.context,c=n.contextType;c="object"==typeof c&&null!==c?la(c):yo(t,c=vo(n)?go:ho.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof i.getSnapshotBeforeUpdate;d||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(l!==r||s!==c)&&wa(t,i,r,c),sa=!1;var p=t.memoizedState;i.state=p,ha(t,r,i,o),s=t.memoizedState,l!==r||p!==s||mo.current||sa?("function"==typeof u&&(ya(t,n,u,r),s=t.memoizedState),(l=sa||ba(t,n,l,r,p,s,c))?(d||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||("function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"==typeof i.componentDidMount&&(t.flags|=4)):("function"==typeof i.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=s),i.props=r,i.state=s,i.context=c,r=l):("function"==typeof i.componentDidMount&&(t.flags|=4),r=!1)}else{i=t.stateNode,ua(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:Xo(t.type,l),i.props=c,d=t.pendingProps,p=i.context,s="object"==typeof(s=n.contextType)&&null!==s?la(s):yo(t,s=vo(n)?go:ho.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(l!==d||p!==s)&&wa(t,i,r,s),sa=!1,p=t.memoizedState,i.state=p,ha(t,r,i,o);var h=t.memoizedState;l!==d||p!==h||mo.current||sa?("function"==typeof f&&(ya(t,n,f,r),h=t.memoizedState),(c=sa||ba(t,n,c,r,p,h,s))?(u||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(r,h,s),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(r,h,s)),"function"==typeof i.componentDidUpdate&&(t.flags|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof i.componentDidUpdate||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=h),i.props=r,i.state=h,i.context=s,r=c):("function"!=typeof i.componentDidUpdate||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=256),r=!1)}return Vi(e,t,n,r,a,o)}function Vi(e,t,n,r,o,a){Hi(e,t);var i=!!(64&t.flags);if(!r&&!i)return o&&So(t,n,!1),rl(e,t,a);r=t.stateNode,Li.current=t;var l=i&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&i?(t.child=Ta(t,e.child,null,a),t.child=Ta(t,null,l,a)):Di(e,t,l,a),t.memoizedState=r.state,o&&So(t,n,!0),t.child}function Gi(e){var t=e.stateNode;t.pendingContext?ko(0,t.pendingContext,t.pendingContext!==t.context):t.context&&ko(0,t.context,!1),Ra(e,t.containerInfo)}var Ki,Qi,Yi,Zi={dehydrated:null,retryLane:0};function Xi(e,t,n){var r,o=t.pendingProps,a=Da.current,i=!1;return(r=!!(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&!!(2&a)),r?(i=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===o.fallback||!0===o.unstable_avoidThisFallback||(a|=1),po(Da,1&a),null===e?(void 0!==o.fallback&&Wa(t),e=o.children,a=o.fallback,i?(e=Ji(t,e,a,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Zi,e):"number"==typeof o.unstable_expectedLoadTime?(e=Ji(t,e,a,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Zi,t.lanes=33554432,e):((n=Gs({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,i?(o=function(e,t,n,r,o){var a=t.mode,i=e.child;e=i.sibling;var l={mode:"hidden",children:n};return 2&a||t.child===i?n=qs(i,l):((n=t.child).childLanes=0,n.pendingProps=l,null!==(i=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=i,i.nextEffect=null):t.firstEffect=t.lastEffect=null),null!==e?r=qs(e,r):(r=Vs(r,a,o,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}(e,t,o.children,o.fallback,n),i=t.child,a=e.child.memoizedState,i.memoizedState=null===a?{baseLanes:n}:{baseLanes:a.baseLanes|n},i.childLanes=e.childLanes&~n,t.memoizedState=Zi,o):(n=function(e,t,n,r){var o=e.child;return e=o.sibling,n=qs(o,{mode:"visible",children:n}),!(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}(e,t,o.children,n),t.memoizedState=null,n))}function Ji(e,t,n,r){var o=e.mode,a=e.child;return t={mode:"hidden",children:t},2&o||null===a?a=Gs(t,o,0,null):(a.childLanes=0,a.pendingProps=t),n=Vs(n,o,r,null),a.return=e,n.return=e,a.sibling=n,e.child=a,n}function el(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),aa(e.return,t)}function tl(e,t,n,r,o,a){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o,lastEffect:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o,i.lastEffect=a)}function nl(e,t,n){var r=t.pendingProps,o=r.revealOrder,a=r.tail;if(Di(e,t,r.children,n),2&(r=Da.current))r=1&r|2,t.flags|=64;else{if(null!==e&&64&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&el(e,n);else if(19===e.tag)el(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(po(Da,r),2&t.mode)switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===Fa(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),tl(t,!1,o,n,a,t.lastEffect);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===Fa(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}tl(t,!0,n,null,a,t.lastEffect);break;case"together":tl(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function rl(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Fl|=t.lanes,0!==(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(l(153));if(null!==t.child){for(n=qs(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=qs(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function ol(e,t){if(!Ba)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 al(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:case 17:return vo(t.type)&&bo(),null;case 3:return Ma(),uo(mo),uo(ho),Ya(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Ga(t)?t.flags|=4:r.hydrate||(t.flags|=256)),null;case 5:Ua(t);var o=_a(Oa.current);if(n=t.type,null!==e&&null!=t.stateNode)Qi(e,t,n,r),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(l(166));return null}if(e=_a(Aa.current),Ga(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Xr]=t,r[Jr]=i,n){case"dialog":Ar("cancel",r),Ar("close",r);break;case"iframe":case"object":case"embed":Ar("load",r);break;case"video":case"audio":for(e=0;e<Ir.length;e++)Ar(Ir[e],r);break;case"source":Ar("error",r);break;case"img":case"image":case"link":Ar("error",r),Ar("load",r);break;case"details":Ar("toggle",r);break;case"input":te(r,i),Ar("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Ar("invalid",r);break;case"textarea":ce(r,i),Ar("invalid",r)}for(var s in Ce(n,i),e=null,i)i.hasOwnProperty(s)&&(o=i[s],"children"===s?"string"==typeof o?r.textContent!==o&&(e=["children",o]):"number"==typeof o&&r.textContent!==""+o&&(e=["children",""+o]):c.hasOwnProperty(s)&&null!=o&&"onScroll"===s&&Ar("scroll",r));switch(n){case"input":Z(r),oe(r,i,!0);break;case"textarea":Z(r),de(r);break;case"select":case"option":break;default:"function"==typeof i.onClick&&(r.onclick=zr)}r=e,t.updateQueue=r,null!==r&&(t.flags|=4)}else{switch(s=9===o.nodeType?o:o.ownerDocument,e===pe&&(e=fe(n)),e===pe?"script"===n?((e=s.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),"select"===n&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Xr]=t,e[Jr]=r,Ki(e,t),t.stateNode=e,s=Ee(n,r),n){case"dialog":Ar("cancel",e),Ar("close",e),o=r;break;case"iframe":case"object":case"embed":Ar("load",e),o=r;break;case"video":case"audio":for(o=0;o<Ir.length;o++)Ar(Ir[o],e);o=r;break;case"source":Ar("error",e),o=r;break;case"img":case"image":case"link":Ar("error",e),Ar("load",e),o=r;break;case"details":Ar("toggle",e),o=r;break;case"input":te(e,r),o=ee(e,r),Ar("invalid",e);break;case"option":o=ie(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=a({},r,{value:void 0}),Ar("invalid",e);break;case"textarea":ce(e,r),o=se(e,r),Ar("invalid",e);break;default:o=r}Ce(n,o);var u=o;for(i in u)if(u.hasOwnProperty(i)){var d=u[i];"style"===i?xe(e,d):"dangerouslySetInnerHTML"===i?null!=(d=d?d.__html:void 0)&&ye(e,d):"children"===i?"string"==typeof d?("textarea"!==n||""!==d)&&ve(e,d):"number"==typeof d&&ve(e,""+d):"suppressContentEditableWarning"!==i&&"suppressHydrationWarning"!==i&&"autoFocus"!==i&&(c.hasOwnProperty(i)?null!=d&&"onScroll"===i&&Ar("scroll",e):null!=d&&w(e,i,d,s))}switch(n){case"input":Z(e),oe(e,r,!1);break;case"textarea":Z(e),de(e);break;case"option":null!=r.value&&e.setAttribute("value",""+Q(r.value));break;case"select":e.multiple=!!r.multiple,null!=(i=r.value)?le(e,!!r.multiple,i,!1):null!=r.defaultValue&&le(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof o.onClick&&(e.onclick=zr)}Hr(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)Yi(0,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(l(166));n=_a(Oa.current),_a(Aa.current),Ga(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 uo(Da),r=t.memoizedState,64&t.flags?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&Ga(t):n=null!==e.memoizedState,r&&!n&&!!(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||1&Da.current?0===Ll&&(Ll=3):(0!==Ll&&3!==Ll||(Ll=4),null===Pl||!(134217727&Fl)&&!(134217727&zl)||gs(Pl,_l))),(r||n)&&(t.flags|=4),null);case 4:return Ma(),null===e&&Or(t.stateNode.containerInfo),null;case 10:return oa(t),null;case 19:if(uo(Da),null===(r=t.memoizedState))return null;if(i=!!(64&t.flags),null===(s=r.rendering))if(i)ol(r,!1);else{if(0!==Ll||null!==e&&64&e.flags)for(e=t.child;null!==e;){if(null!==(s=Fa(e))){for(t.flags|=64,ol(r,!1),null!==(i=s.updateQueue)&&(t.updateQueue=i,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=n,n=t.child;null!==n;)e=r,(i=n).flags&=2,i.nextEffect=null,i.firstEffect=null,i.lastEffect=null,null===(s=i.alternate)?(i.childLanes=0,i.lanes=e,i.child=null,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return po(Da,1&Da.current|2),t.child}e=e.sibling}null!==r.tail&&qo()>ql&&(t.flags|=64,i=!0,ol(r,!1),t.lanes=33554432)}else{if(!i)if(null!==(e=Fa(s))){if(t.flags|=64,i=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),ol(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!Ba)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*qo()-r.renderingStartTime>ql&&1073741824!==n&&(t.flags|=64,i=!0,ol(r,!1),t.lanes=33554432);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(n=r.last)?n.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=qo(),n.sibling=null,t=Da.current,po(Da,i?1&t|2:1&t),n):null;case 23:case 24:return ws(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(l(156,t.tag))}function il(e){switch(e.tag){case 1:vo(e.type)&&bo();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Ma(),uo(mo),uo(ho),Ya(),64&(t=e.flags))throw Error(l(285));return e.flags=-4097&t|64,e;case 5:return Ua(e),null;case 13:return uo(Da),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return uo(Da),null;case 4:return Ma(),null;case 10:return oa(e),null;case 23:case 24:return ws(),null;default:return null}}function ll(e,t){try{var n="",r=t;do{n+=G(r),r=r.return}while(r);var o=n}catch(e){o="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:o}}function sl(e,t){try{r.error(t.value)}catch(e){setTimeout(function(){throw e})}}Ki=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}},Qi=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,_a(Aa.current);var i,l=null;switch(n){case"input":o=ee(e,o),r=ee(e,r),l=[];break;case"option":o=ie(e,o),r=ie(e,r),l=[];break;case"select":o=a({},o,{value:void 0}),r=a({},r,{value:void 0}),l=[];break;case"textarea":o=se(e,o),r=se(e,r),l=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=zr)}for(d in Ce(n,r),n=null,o)if(!r.hasOwnProperty(d)&&o.hasOwnProperty(d)&&null!=o[d])if("style"===d){var s=o[d];for(i in s)s.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else"dangerouslySetInnerHTML"!==d&&"children"!==d&&"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&"autoFocus"!==d&&(c.hasOwnProperty(d)?l||(l=[]):(l=l||[]).push(d,null));for(d in r){var u=r[d];if(s=null!=o?o[d]:void 0,r.hasOwnProperty(d)&&u!==s&&(null!=u||null!=s))if("style"===d)if(s){for(i in s)!s.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&s[i]!==u[i]&&(n||(n={}),n[i]=u[i])}else n||(l||(l=[]),l.push(d,n)),n=u;else"dangerouslySetInnerHTML"===d?(u=u?u.__html:void 0,s=s?s.__html:void 0,null!=u&&s!==u&&(l=l||[]).push(d,u)):"children"===d?"string"!=typeof u&&"number"!=typeof u||(l=l||[]).push(d,""+u):"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&(c.hasOwnProperty(d)?(null!=u&&"onScroll"===d&&Ar("scroll",e),l||s===u||(l=[])):"object"==typeof u&&null!==u&&u.$$typeof===L?u.toString():(l=l||[]).push(d,u))}n&&(l=l||[]).push("style",n);var d=l;(t.updateQueue=d)&&(t.flags|=4)}},Yi=function(e,t,n,r){n!==r&&(t.flags|=4)};var cl="function"==typeof WeakMap?WeakMap:Map;function ul(e,t,n){(n=da(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Kl||(Kl=!0,Ql=r),sl(0,t)},n}function dl(e,t,n){(n=da(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return sl(0,t),r(o)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Yl?Yl=new Set([this]):Yl.add(this),sl(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var pl="function"==typeof WeakSet?WeakSet:Set;function fl(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){Ds(e,t)}else t.current=null}function hl(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17: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:Xo(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&Gr(t.stateNode.containerInfo))}throw Error(l(163))}function ml(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&~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 o=e;r=o.next,!!(4&(o=o.tag))&&!!(1&o)&&(Ms(n,e),Rs(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:Xo(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&ma(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:case 1:e=n.child.stateNode}ma(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&Hr(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&xt(n)))))}throw Error(l(163))}function gl(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 o=n.memoizedProps.style;o=null!=o&&o.hasOwnProperty("display")?o.display:null,r.style.display=we("display",o)}}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 yl(e,t){if(Eo&&"function"==typeof Eo.onCommitFiberUnmount)try{Eo.onCommitFiberUnmount(Co,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,o=r.destroy;if(r=r.tag,void 0!==o)if(4&r)Ms(t,n);else{r=t;try{o()}catch(e){Ds(r,e)}}n=n.next}while(n!==e)}break;case 1:if(fl(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(e){Ds(t,e)}break;case 5:fl(t);break;case 4:Sl(e,t)}}function vl(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 bl(e){return 5===e.tag||3===e.tag||4===e.tag}function kl(e){e:{for(var t=e.return;null!==t;){if(bl(t))break e;t=t.return}throw Error(l(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(l(161))}16&n.flags&&(ve(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||bl(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?wl(e,n,t):xl(e,n,t)}function wl(e,t,n){var r=e.tag,o=5===r||6===r;if(o)e=o?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)&&void 0!==n||null!==t.onclick||(t.onclick=zr));else if(4!==r&&null!==(e=e.child))for(wl(e,t,n),e=e.sibling;null!==e;)wl(e,t,n),e=e.sibling}function xl(e,t,n){var r=e.tag,o=5===r||6===r;if(o)e=o?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(xl(e,t,n),e=e.sibling;null!==e;)xl(e,t,n),e=e.sibling}function Sl(e,t){for(var n,r,o=t,a=!1;;){if(!a){a=o.return;e:for(;;){if(null===a)throw Error(l(160));switch(n=a.stateNode,a.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}a=a.return}a=!0}if(5===o.tag||6===o.tag){e:for(var i=e,s=o,c=s;;)if(yl(i,c),null!==c.child&&4!==c.tag)c.child.return=c,c=c.child;else{if(c===s)break e;for(;null===c.sibling;){if(null===c.return||c.return===s)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}r?(i=n,s=o.stateNode,8===i.nodeType?i.parentNode.removeChild(s):i.removeChild(s)):n.removeChild(o.stateNode)}else if(4===o.tag){if(null!==o.child){n=o.stateNode.containerInfo,r=!0,o.child.return=o,o=o.child;continue}}else if(yl(e,o),null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;4===(o=o.return).tag&&(a=!1)}o.sibling.return=o.return,o=o.sibling}}function Cl(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&~r.tag)&&(e=r.destroy,r.destroy=void 0,void 0!==e&&e()),r=r.next}while(r!==n)}return;case 1:case 12:case 17:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var o=null!==e?e.memoizedProps:r;e=t.type;var a=t.updateQueue;if(t.updateQueue=null,null!==a){for(n[Jr]=r,"input"===e&&"radio"===r.type&&null!=r.name&&ne(n,r),Ee(e,o),t=Ee(e,r),o=0;o<a.length;o+=2){var i=a[o],s=a[o+1];"style"===i?xe(n,s):"dangerouslySetInnerHTML"===i?ye(n,s):"children"===i?ve(n,s):w(n,i,s,t)}switch(e){case"input":re(n,r);break;case"textarea":ue(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(a=r.value)?le(n,!!r.multiple,a,!1):e!==!!r.multiple&&(null!=r.defaultValue?le(n,!!r.multiple,r.defaultValue,!0):le(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(l(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,xt(n.containerInfo)));case 13:return null!==t.memoizedState&&(Hl=qo(),gl(t.child,!0)),void El(t);case 19:return void El(t);case 23:case 24:return void gl(t,null!==t.memoizedState)}throw Error(l(163))}function El(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new pl),t.forEach(function(t){var r=zs.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Il(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&null!==(t=t.memoizedState)&&null===t.dehydrated}var Tl=Math.ceil,jl=x.ReactCurrentDispatcher,Nl=x.ReactCurrentOwner,Al=0,Pl=null,Ol=null,_l=0,Rl=0,Ml=co(0),Ll=0,Ul=null,Dl=0,Fl=0,zl=0,$l=0,Bl=null,Hl=0,ql=1/0;function Wl(){ql=qo()+500}var Vl,Gl=null,Kl=!1,Ql=null,Yl=null,Zl=!1,Xl=null,Jl=90,es=[],ts=[],ns=null,rs=0,os=null,as=-1,is=0,ls=0,ss=null,cs=!1;function us(){return 48&Al?qo():-1!==as?as:as=qo()}function ds(e){if(!(2&(e=e.mode)))return 1;if(!(4&e))return 99===Wo()?1:2;if(0===is&&(is=Dl),0!==Zo.transition){0!==ls&&(ls=null!==Bl?Bl.pendingLanes:0),e=is;var t=4186112&~ls;return 0===(t&=-t)&&0==(t=(e=4186112&~e)&-e)&&(t=8192),t}return e=Wo(),e=zt(4&Al&&98===e?12: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),is)}function ps(e,t,n){if(50<rs)throw rs=0,os=null,Error(l(185));if(null===(e=fs(e,t)))return null;Ht(e,t,n),e===Pl&&(zl|=t,4===Ll&&gs(e,_l));var r=Wo();1===t?8&Al&&!(48&Al)?ys(e):(hs(e,n),0===Al&&(Wl(),Qo())):(!(4&Al)||98!==r&&99!==r||(null===ns?ns=new Set([e]):ns.add(e)),hs(e,n)),Bl=e}function fs(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 hs(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,o=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-qt(i),c=1<<s,u=a[s];if(-1===u){if(0===(c&r)||0!==(c&o)){u=t,Ut(c);var d=Lt;a[s]=10<=d?u+250:6<=d?u+5e3:-1}}else u<=t&&(e.expiredLanes|=c);i&=~c}if(r=Dt(e,e===Pl?_l:0),t=Lt,0===r)null!==n&&(n!==Do&&jo(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Do&&jo(n)}15===t?(n=ys.bind(null,e),null===zo?(zo=[n],$o=To(_o,Yo)):zo.push(n),n=Do):14===t?n=Ko(99,ys.bind(null,e)):(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(l(358,e))}}(t),n=Ko(n,ms.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function ms(e){if(as=-1,ls=is=0,48&Al)throw Error(l(327));var t=e.callbackNode;if(_s()&&e.callbackNode!==t)return null;var n=Dt(e,e===Pl?_l:0);if(0===n)return null;var r=n,o=Al;Al|=16;var a=Cs();for(Pl===e&&_l===r||(Wl(),xs(e,r));;)try{Ts();break}catch(t){Ss(e,t)}if(ra(),jl.current=a,Al=o,null!==Ol?r=0:(Pl=null,_l=0,r=Ll),0!==(Dl&zl))xs(e,0);else if(0!==r){if(2===r&&(Al|=64,e.hydrate&&(e.hydrate=!1,Gr(e.containerInfo)),0!==(n=Ft(e))&&(r=Es(e,n))),1===r)throw t=Ul,xs(e,0),gs(e,n),hs(e,qo()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(l(345));case 2:case 5:As(e);break;case 3:if(gs(e,n),(62914560&n)===n&&10<(r=Hl+500-qo())){if(0!==Dt(e,0))break;if(((o=e.suspendedLanes)&n)!==n){us(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Wr(As.bind(null,e),r);break}As(e);break;case 4:if(gs(e,n),(4186112&n)===n)break;for(r=e.eventTimes,o=-1;0<n;){var i=31-qt(n);a=1<<i,(i=r[i])>o&&(o=i),n&=~a}if(n=o,10<(n=(120>(n=qo()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Tl(n/1960))-n)){e.timeoutHandle=Wr(As.bind(null,e),n);break}As(e);break;default:throw Error(l(329))}}return hs(e,qo()),e.callbackNode===t?ms.bind(null,e):null}function gs(e,t){for(t&=~$l,t&=~zl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-qt(t),r=1<<n;e[n]=-1,t&=~r}}function ys(e){if(48&Al)throw Error(l(327));if(_s(),e===Pl&&0!==(e.expiredLanes&_l)){var t=_l,n=Es(e,t);0!==(Dl&zl)&&(n=Es(e,t=Dt(e,t)))}else n=Es(e,t=Dt(e,0));if(0!==e.tag&&2===n&&(Al|=64,e.hydrate&&(e.hydrate=!1,Gr(e.containerInfo)),0!==(t=Ft(e))&&(n=Es(e,t))),1===n)throw n=Ul,xs(e,0),gs(e,t),hs(e,qo()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,As(e),hs(e,qo()),null}function vs(e,t){var n=Al;Al|=1;try{return e(t)}finally{0===(Al=n)&&(Wl(),Qo())}}function bs(e,t){var n=Al;Al&=-2,Al|=8;try{return e(t)}finally{0===(Al=n)&&(Wl(),Qo())}}function ks(e,t){po(Ml,Rl),Rl|=t,Dl|=t}function ws(){Rl=Ml.current,uo(Ml)}function xs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Vr(n)),null!==Ol)for(n=Ol.return;null!==n;){var r=n;switch(r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&bo();break;case 3:Ma(),uo(mo),uo(ho),Ya();break;case 5:Ua(r);break;case 4:Ma();break;case 13:case 19:uo(Da);break;case 10:oa(r);break;case 23:case 24:ws()}n=n.return}Pl=e,Ol=qs(e.current,null),_l=Rl=Dl=t,Ll=0,Ul=null,$l=zl=Fl=0}function Ss(e,t){for(;;){var n=Ol;try{if(ra(),Za.current=Oi,ri){for(var r=ei.memoizedState;null!==r;){var o=r.queue;null!==o&&(o.pending=null),r=r.next}ri=!1}if(Ja=0,ni=ti=ei=null,oi=!1,Nl.current=null,null===n||null===n.return){Ll=1,Ul=t,Ol=null;break}e:{var a=e,i=n.return,l=n,s=t;if(t=_l,l.flags|=2048,l.firstEffect=l.lastEffect=null,null!==s&&"object"==typeof s&&"function"==typeof s.then){var c=s;if(!(2&l.mode)){var u=l.alternate;u?(l.updateQueue=u.updateQueue,l.memoizedState=u.memoizedState,l.lanes=u.lanes):(l.updateQueue=null,l.memoizedState=null)}var d=!!(1&Da.current),p=i;do{var f;if(f=13===p.tag){var h=p.memoizedState;if(null!==h)f=null!==h.dehydrated;else{var m=p.memoizedProps;f=void 0!==m.fallback&&(!0!==m.unstable_avoidThisFallback||!d)}}if(f){var g=p.updateQueue;if(null===g){var y=new Set;y.add(c),p.updateQueue=y}else g.add(c);if(!(2&p.mode)){if(p.flags|=64,l.flags|=16384,l.flags&=-2981,1===l.tag)if(null===l.alternate)l.tag=17;else{var v=da(-1,1);v.tag=2,pa(l,v)}l.lanes|=1;break e}s=void 0,l=t;var b=a.pingCache;if(null===b?(b=a.pingCache=new cl,s=new Set,b.set(c,s)):void 0===(s=b.get(c))&&(s=new Set,b.set(c,s)),!s.has(l)){s.add(l);var k=Fs.bind(null,a,c,l);c.then(k,k)}p.flags|=4096,p.lanes=t;break e}p=p.return}while(null!==p);s=Error((K(l.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!==Ll&&(Ll=2),s=ll(s,l),p=i;do{switch(p.tag){case 3:a=s,p.flags|=4096,t&=-t,p.lanes|=t,fa(p,ul(0,a,t));break e;case 1:a=s;var w=p.type,x=p.stateNode;if(!(64&p.flags||"function"!=typeof w.getDerivedStateFromError&&(null===x||"function"!=typeof x.componentDidCatch||null!==Yl&&Yl.has(x)))){p.flags|=4096,t&=-t,p.lanes|=t,fa(p,dl(p,a,t));break e}}p=p.return}while(null!==p)}Ns(n)}catch(e){t=e,Ol===n&&null!==n&&(Ol=n=n.return);continue}break}}function Cs(){var e=jl.current;return jl.current=Oi,null===e?Oi:e}function Es(e,t){var n=Al;Al|=16;var r=Cs();for(Pl===e&&_l===t||xs(e,t);;)try{Is();break}catch(t){Ss(e,t)}if(ra(),Al=n,jl.current=r,null!==Ol)throw Error(l(261));return Pl=null,_l=0,Ll}function Is(){for(;null!==Ol;)js(Ol)}function Ts(){for(;null!==Ol&&!No();)js(Ol)}function js(e){var t=Vl(e.alternate,e,Rl);e.memoizedProps=e.pendingProps,null===t?Ns(e):Ol=t,Nl.current=null}function Ns(e){var t=e;do{var n=t.alternate;if(e=t.return,2048&t.flags){if(null!==(n=il(t)))return n.flags&=2047,void(Ol=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(null!==(n=al(n,t,Rl)))return void(Ol=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||1073741824&Rl||!(4&n.mode)){for(var r=0,o=n.child;null!==o;)r|=o.lanes|o.childLanes,o=o.sibling;n.childLanes=r}null!==e&&!(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))}if(null!==(t=t.sibling))return void(Ol=t);Ol=t=e}while(null!==t);0===Ll&&(Ll=5)}function As(e){var t=Wo();return Go(99,Ps.bind(null,e,t)),null}function Ps(e,t){do{_s()}while(null!==Xl);if(48&Al)throw Error(l(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(l(177));e.callbackNode=null;var r=n.lanes|n.childLanes,o=r,a=e.pendingLanes&~o;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=o,e.mutableReadLanes&=o,e.entangledLanes&=o,o=e.entanglements;for(var i=e.eventTimes,s=e.expirationTimes;0<a;){var c=31-qt(a),u=1<<c;o[c]=0,i[c]=-1,s[c]=-1,a&=~u}if(null!==ns&&!(24&r)&&ns.has(e)&&ns.delete(e),e===Pl&&(Ol=Pl=null,_l=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(o=Al,Al|=32,Nl.current=null,$r=Qt,yr(i=gr())){if("selectionStart"in i)s={start:i.selectionStart,end:i.selectionEnd};else e:if(s=(s=i.ownerDocument)&&s.defaultView||window,(u=s.getSelection&&s.getSelection())&&0!==u.rangeCount){s=u.anchorNode,a=u.anchorOffset,c=u.focusNode,u=u.focusOffset;try{s.nodeType,c.nodeType}catch(e){s=null;break e}var d=0,p=-1,f=-1,h=0,m=0,g=i,y=null;t:for(;;){for(var v;g!==s||0!==a&&3!==g.nodeType||(p=d+a),g!==c||0!==u&&3!==g.nodeType||(f=d+u),3===g.nodeType&&(d+=g.nodeValue.length),null!==(v=g.firstChild);)y=g,g=v;for(;;){if(g===i)break t;if(y===s&&++h===a&&(p=d),y===c&&++m===u&&(f=d),null!==(v=g.nextSibling))break;y=(g=y).parentNode}g=v}s=-1===p||-1===f?null:{start:p,end:f}}else s=null;s=s||{start:0,end:0}}else s=null;Br={focusedElem:i,selectionRange:s},Qt=!1,ss=null,cs=!1,Gl=r;do{try{Os()}catch(e){if(null===Gl)throw Error(l(330));Ds(Gl,e),Gl=Gl.nextEffect}}while(null!==Gl);ss=null,Gl=r;do{try{for(i=e;null!==Gl;){var b=Gl.flags;if(16&b&&ve(Gl.stateNode,""),128&b){var k=Gl.alternate;if(null!==k){var w=k.ref;null!==w&&("function"==typeof w?w(null):w.current=null)}}switch(1038&b){case 2:kl(Gl),Gl.flags&=-3;break;case 6:kl(Gl),Gl.flags&=-3,Cl(Gl.alternate,Gl);break;case 1024:Gl.flags&=-1025;break;case 1028:Gl.flags&=-1025,Cl(Gl.alternate,Gl);break;case 4:Cl(Gl.alternate,Gl);break;case 8:Sl(i,s=Gl);var x=s.alternate;vl(s),null!==x&&vl(x)}Gl=Gl.nextEffect}}catch(e){if(null===Gl)throw Error(l(330));Ds(Gl,e),Gl=Gl.nextEffect}}while(null!==Gl);if(w=Br,k=gr(),b=w.focusedElem,i=w.selectionRange,k!==b&&b&&b.ownerDocument&&mr(b.ownerDocument.documentElement,b)){null!==i&&yr(b)&&(k=i.start,void 0===(w=i.end)&&(w=k),"selectionStart"in b?(b.selectionStart=k,b.selectionEnd=Math.min(w,b.value.length)):(w=(k=b.ownerDocument||document)&&k.defaultView||window).getSelection&&(w=w.getSelection(),s=b.textContent.length,x=Math.min(i.start,s),i=void 0===i.end?x:Math.min(i.end,s),!w.extend&&x>i&&(s=i,i=x,x=s),s=hr(b,x),a=hr(b,i),s&&a&&(1!==w.rangeCount||w.anchorNode!==s.node||w.anchorOffset!==s.offset||w.focusNode!==a.node||w.focusOffset!==a.offset)&&((k=k.createRange()).setStart(s.node,s.offset),w.removeAllRanges(),x>i?(w.addRange(k),w.extend(a.node,a.offset)):(k.setEnd(a.node,a.offset),w.addRange(k))))),k=[];for(w=b;w=w.parentNode;)1===w.nodeType&&k.push({element:w,left:w.scrollLeft,top:w.scrollTop});for("function"==typeof b.focus&&b.focus(),b=0;b<k.length;b++)(w=k[b]).element.scrollLeft=w.left,w.element.scrollTop=w.top}Qt=!!$r,Br=$r=null,e.current=n,Gl=r;do{try{for(b=e;null!==Gl;){var S=Gl.flags;if(36&S&&ml(b,Gl.alternate,Gl),128&S){k=void 0;var C=Gl.ref;if(null!==C){var E=Gl.stateNode;Gl.tag,k=E,"function"==typeof C?C(k):C.current=k}}Gl=Gl.nextEffect}}catch(e){if(null===Gl)throw Error(l(330));Ds(Gl,e),Gl=Gl.nextEffect}}while(null!==Gl);Gl=null,Fo(),Al=o}else e.current=n;if(Zl)Zl=!1,Xl=e,Jl=t;else for(Gl=r;null!==Gl;)t=Gl.nextEffect,Gl.nextEffect=null,8&Gl.flags&&((S=Gl).sibling=null,S.stateNode=null),Gl=t;if(0===(r=e.pendingLanes)&&(Yl=null),1===r?e===os?rs++:(rs=0,os=e):rs=0,n=n.stateNode,Eo&&"function"==typeof Eo.onCommitFiberRoot)try{Eo.onCommitFiberRoot(Co,n,void 0,!(64&~n.current.flags))}catch(e){}if(hs(e,qo()),Kl)throw Kl=!1,e=Ql,Ql=null,e;return!!(8&Al)||Qo(),null}function Os(){for(;null!==Gl;){var e=Gl.alternate;cs||null===ss||(8&Gl.flags?et(Gl,ss)&&(cs=!0):13===Gl.tag&&Il(e,Gl)&&et(Gl,ss)&&(cs=!0));var t=Gl.flags;!!(256&t)&&hl(e,Gl),!(512&t)||Zl||(Zl=!0,Ko(97,function(){return _s(),null})),Gl=Gl.nextEffect}}function _s(){if(90!==Jl){var e=97<Jl?97:Jl;return Jl=90,Go(e,Ls)}return!1}function Rs(e,t){es.push(t,e),Zl||(Zl=!0,Ko(97,function(){return _s(),null}))}function Ms(e,t){ts.push(t,e),Zl||(Zl=!0,Ko(97,function(){return _s(),null}))}function Ls(){if(null===Xl)return!1;var e=Xl;if(Xl=null,48&Al)throw Error(l(331));var t=Al;Al|=32;var n=ts;ts=[];for(var r=0;r<n.length;r+=2){var o=n[r],a=n[r+1],i=o.destroy;if(o.destroy=void 0,"function"==typeof i)try{i()}catch(e){if(null===a)throw Error(l(330));Ds(a,e)}}for(n=es,es=[],r=0;r<n.length;r+=2){o=n[r],a=n[r+1];try{var s=o.create;o.destroy=s()}catch(e){if(null===a)throw Error(l(330));Ds(a,e)}}for(s=e.current.firstEffect;null!==s;)e=s.nextEffect,s.nextEffect=null,8&s.flags&&(s.sibling=null,s.stateNode=null),s=e;return Al=t,Qo(),!0}function Us(e,t,n){pa(e,t=ul(0,t=ll(n,t),1)),t=us(),null!==(e=fs(e,1))&&(Ht(e,1,t),hs(e,t))}function Ds(e,t){if(3===e.tag)Us(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){Us(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Yl||!Yl.has(r))){var o=dl(n,e=ll(t,e),1);if(pa(n,o),o=us(),null!==(n=fs(n,1)))Ht(n,1,o),hs(n,o);else if("function"==typeof r.componentDidCatch&&(null===Yl||!Yl.has(r)))try{r.componentDidCatch(t,e)}catch(e){}break}}n=n.return}}function Fs(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=us(),e.pingedLanes|=e.suspendedLanes&n,Pl===e&&(_l&n)===n&&(4===Ll||3===Ll&&(62914560&_l)===_l&&500>qo()-Hl?xs(e,0):$l|=n),hs(e,t)}function zs(e,t){var n=e.stateNode;null!==n&&n.delete(t),0==(t=0)&&(2&(t=e.mode)?4&t?(0===is&&(is=Dl),0===(t=$t(62914560&~is))&&(t=4194304)):t=99===Wo()?1:2:t=1),n=us(),null!==(e=fs(e,t))&&(Ht(e,t,n),hs(e,n))}function $s(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 Bs(e,t,n,r){return new $s(e,t,n,r)}function Hs(e){return!(!(e=e.prototype)||!e.isReactComponent)}function qs(e,t){var n=e.alternate;return null===n?((n=Bs(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 Ws(e,t,n,r,o,a){var i=2;if(r=e,"function"==typeof e)Hs(e)&&(i=1);else if("string"==typeof e)i=5;else e:switch(e){case E:return Vs(n.children,o,a,t);case U:i=8,o|=16;break;case I:i=8,o|=1;break;case T:return(e=Bs(12,n,t,8|o)).elementType=T,e.type=T,e.lanes=a,e;case P:return(e=Bs(13,n,t,o)).type=P,e.elementType=P,e.lanes=a,e;case O:return(e=Bs(19,n,t,o)).elementType=O,e.lanes=a,e;case D:return Gs(n,o,a,t);case F:return(e=Bs(24,n,t,o)).elementType=F,e.lanes=a,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case j:i=10;break e;case N:i=9;break e;case A:i=11;break e;case _:i=14;break e;case R:i=16,r=null;break e;case M:i=22;break e}throw Error(l(130,null==e?e:typeof e,""))}return(t=Bs(i,n,t,o)).elementType=e,t.type=r,t.lanes=a,t}function Vs(e,t,n,r){return(e=Bs(7,e,r,t)).lanes=n,e}function Gs(e,t,n,r){return(e=Bs(23,e,r,t)).elementType=D,e.lanes=n,e}function Ks(e,t,n){return(e=Bs(6,e,null,t)).lanes=n,e}function Qs(e,t,n){return(t=Bs(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ys(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=Bt(0),this.expirationTimes=Bt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bt(0),this.mutableSourceEagerHydrationData=null}function Zs(e,t,n,r){var o=t.current,a=us(),i=ds(o);e:if(n){t:{if(Ye(n=n._reactInternals)!==n||1!==n.tag)throw Error(l(170));var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(vo(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(null!==s);throw Error(l(171))}if(1===n.tag){var c=n.type;if(vo(c)){n=wo(n,c,s);break e}}n=s}else n=fo;return null===t.context?t.context=n:t.pendingContext=n,(t=da(a,i)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),pa(o,t),ps(o,i,a),i}function Xs(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Js(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function ec(e,t){Js(e,t),(e=e.alternate)&&Js(e,t)}function tc(e,t,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new Ys(e,t,null!=n&&!0===n.hydrate),t=Bs(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,ca(t),e[eo]=n.current,Or(8===e.nodeType?e.parentNode:e),r)for(e=0;e<r.length;e++){var o=(t=r[e])._getVersion;o=o(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,o]:n.mutableSourceEagerHydrationData.push(t,o)}this._internalRoot=n}function nc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function rc(e,t,n,r,o){var a=n._reactRootContainer;if(a){var i=a._internalRoot;if("function"==typeof o){var l=o;o=function(){var e=Xs(i);l.call(e)}}Zs(t,i,e,o)}else{if(a=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 tc(e,0,t?{hydrate:!0}:void 0)}(n,r),i=a._internalRoot,"function"==typeof o){var s=o;o=function(){var e=Xs(i);s.call(e)}}bs(function(){Zs(t,i,e,o)})}return Xs(i)}function oc(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!nc(t))throw Error(l(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:C,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)}Vl=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||mo.current)Ui=!0;else{if(0===(n&r)){switch(Ui=!1,t.tag){case 3:Gi(t),Ka();break;case 5:La(t);break;case 1:vo(t.type)&&xo(t);break;case 4:Ra(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var o=t.type._context;po(Jo,o._currentValue),o._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!==(n&t.child.childLanes)?Xi(e,t,n):(po(Da,1&Da.current),null!==(t=rl(e,t,n))?t.sibling:null);po(Da,1&Da.current);break;case 19:if(r=0!==(n&t.childLanes),64&e.flags){if(r)return nl(e,t,n);t.flags|=64}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),po(Da,Da.current),r)break;return null;case 23:case 24:return t.lanes=0,Bi(e,t,n)}return rl(e,t,n)}Ui=!!(16384&e.flags)}else Ui=!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,o=yo(t,ho.current),ia(t,n),o=li(null,t,r,e,o,n),t.flags|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,vo(r)){var a=!0;xo(t)}else a=!1;t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,ca(t);var i=r.getDerivedStateFromProps;"function"==typeof i&&ya(t,r,i,e),o.updater=va,t.stateNode=o,o._reactInternals=t,xa(t,r,e,n),t=Vi(null,t,r,!0,a,n)}else t.tag=0,Di(null,t,o,n),t=t.child;return t;case 16:o=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,o=(a=o._init)(o._payload),t.type=o,a=t.tag=function(e){if("function"==typeof e)return Hs(e)?1:0;if(null!=e){if((e=e.$$typeof)===A)return 11;if(e===_)return 14}return 2}(o),e=Xo(o,e),a){case 0:t=qi(null,t,o,e,n);break e;case 1:t=Wi(null,t,o,e,n);break e;case 11:t=Fi(null,t,o,e,n);break e;case 14:t=zi(null,t,o,Xo(o.type,e),r,n);break e}throw Error(l(306,o,""))}return t;case 0:return r=t.type,o=t.pendingProps,qi(e,t,r,o=t.elementType===r?o:Xo(r,o),n);case 1:return r=t.type,o=t.pendingProps,Wi(e,t,r,o=t.elementType===r?o:Xo(r,o),n);case 3:if(Gi(t),r=t.updateQueue,null===e||null===r)throw Error(l(282));if(r=t.pendingProps,o=null!==(o=t.memoizedState)?o.element:null,ua(e,t),ha(t,r,null,n),(r=t.memoizedState.element)===o)Ka(),t=rl(e,t,n);else{if((a=(o=t.stateNode).hydrate)&&($a=Kr(t.stateNode.containerInfo.firstChild),za=t,a=Ba=!0),a){if(null!=(e=o.mutableSourceEagerHydrationData))for(o=0;o<e.length;o+=2)(a=e[o])._workInProgressVersionPrimary=e[o+1],Qa.push(a);for(n=ja(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Di(e,t,r,n),Ka();t=t.child}return t;case 5:return La(t),null===e&&Wa(t),r=t.type,o=t.pendingProps,a=null!==e?e.memoizedProps:null,i=o.children,qr(r,o)?i=null:null!==a&&qr(r,a)&&(t.flags|=16),Hi(e,t),Di(e,t,i,n),t.child;case 6:return null===e&&Wa(t),null;case 13:return Xi(e,t,n);case 4:return Ra(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Ta(t,null,r,n):Di(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,Fi(e,t,r,o=t.elementType===r?o:Xo(r,o),n);case 7:return Di(e,t,t.pendingProps,n),t.child;case 8:case 12:return Di(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value;var s=t.type._context;if(po(Jo,s._currentValue),s._currentValue=a,null!==i)if(s=i.value,0==(a=ur(s,a)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(s,a):1073741823))){if(i.children===o.children&&!mo.current){t=rl(e,t,n);break e}}else for(null!==(s=t.child)&&(s.return=t);null!==s;){var c=s.dependencies;if(null!==c){i=s.child;for(var u=c.firstContext;null!==u;){if(u.context===r&&0!==(u.observedBits&a)){1===s.tag&&((u=da(-1,n&-n)).tag=2,pa(s,u)),s.lanes|=n,null!==(u=s.alternate)&&(u.lanes|=n),aa(s.return,n),c.lanes|=n;break}u=u.next}}else i=10===s.tag&&s.type===t.type?null:s.child;if(null!==i)i.return=s;else for(i=s;null!==i;){if(i===t){i=null;break}if(null!==(s=i.sibling)){s.return=i.return,i=s;break}i=i.return}s=i}Di(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=(a=t.pendingProps).children,ia(t,n),r=r(o=la(o,a.unstable_observedBits)),t.flags|=1,Di(e,t,r,n),t.child;case 14:return a=Xo(o=t.type,t.pendingProps),zi(e,t,o,a=Xo(o.type,a),r,n);case 15:return $i(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Xo(r,o),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,vo(r)?(e=!0,xo(t)):e=!1,ia(t,n),ka(t,r,o),xa(t,r,o,n),Vi(null,t,r,!0,e,n);case 19:return nl(e,t,n);case 23:case 24:return Bi(e,t,n)}throw Error(l(156,t.tag))},tc.prototype.render=function(e){Zs(e,this._internalRoot,null,null)},tc.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Zs(null,e,null,function(){t[eo]=null})},tt=function(e){13===e.tag&&(ps(e,4,us()),ec(e,4))},nt=function(e){13===e.tag&&(ps(e,67108864,us()),ec(e,67108864))},rt=function(e){if(13===e.tag){var t=us(),n=ds(e);ps(e,n,t),ec(e,n)}},ot=function(e,t){return t()},Te=function(e,t,n){switch(t){case"input":if(re(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 o=ao(r);if(!o)throw Error(l(90));X(r),re(r,o)}}}break;case"textarea":ue(e,n);break;case"select":null!=(t=n.value)&&le(e,!!n.multiple,t,!1)}},_e=vs,Re=function(e,t,n,r,o){var a=Al;Al|=4;try{return Go(98,e.bind(null,t,n,r,o))}finally{0===(Al=a)&&(Wl(),Qo())}},Me=function(){!(49&Al)&&(function(){if(null!==ns){var e=ns;ns=null,e.forEach(function(e){e.expiredLanes|=24&e.pendingLanes,hs(e,qo())})}Qo()}(),_s())},Le=function(e,t){var n=Al;Al|=2;try{return e(t)}finally{0===(Al=n)&&(Wl(),Qo())}};var ac={Events:[ro,oo,ao,Pe,Oe,_s,{current:!1}]},ic={findFiberByHostInstance:no,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},lc={bundleType:ic.bundleType,version:ic.version,rendererPackageName:ic.rendererPackageName,rendererConfig:ic.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=Je(e))?null:e.stateNode},findFiberByHostInstance:ic.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var sc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sc.isDisabled&&sc.supportsFiber)try{Co=sc.inject(lc),Eo=sc}catch(ge){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ac,t.createPortal=oc,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(l(188));throw Error(l(268,Object.keys(e)))}return null===(e=Je(t))?null:e.stateNode},t.flushSync=function(e,t){var n=Al;if(48&n)return e(t);Al|=1;try{if(e)return Go(99,e.bind(null,t))}finally{Al=n,Qo()}},t.hydrate=function(e,t,n){if(!nc(t))throw Error(l(200));return rc(null,e,t,!0,n)},t.render=function(e,t,n){if(!nc(t))throw Error(l(200));return rc(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!nc(e))throw Error(l(40));return!!e._reactRootContainer&&(bs(function(){rc(null,null,e,!1,function(){e._reactRootContainer=null,e[eo]=null})}),!0)},t.unstable_batchedUpdates=vs,t.unstable_createPortal=function(e,t){return oc(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!nc(n))throw Error(l(200));if(null==e||void 0===e._reactInternals)throw Error(l(38));return rc(e,t,n,!1,r)},t.version="17.0.2"},3575(e,t,n){var r=n(5224),o=n(3705),a=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},i=/%[sdj%]/g;t.format=function(e){if(!k(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(u(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,o=r.length,a=String(e).replace(i,function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),l=r[n];n<o;l=r[++n])v(l)||!S(l)?a+=" "+l:a+=" "+u(l);return a},t.deprecate=function(e,n){if(void 0!==r&&!0===r.noDeprecation)return e;if(void 0===r)return function(){return t.deprecate(e,n).apply(this,arguments)};var a=!1;return function(){if(!a){if(r.throwDeprecation)throw new Error(n);r.traceDeprecation?o.trace(n):o.error(n),a=!0}return e.apply(this,arguments)}};var l={},s=/^$/;if({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG){var c={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG;c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+c+"$","i")}function u(e,n){var r={seen:[],stylize:p};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(n)?r.showHidden=n:n&&t._extend(r,n),w(r.showHidden)&&(r.showHidden=!1),w(r.depth)&&(r.depth=2),w(r.colors)&&(r.colors=!1),w(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=d),f(r,e,r.depth)}function d(e,t){var n=u.styles[t];return n?"["+u.colors[n][0]+"m"+e+"["+u.colors[n][1]+"m":e}function p(e,t){return e}function f(e,n,r){if(e.customInspect&&n&&I(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,e);return k(o)||(o=f(e,o,r)),o}var a=function(e,t){if(w(t))return e.stylize("undefined","undefined");if(k(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return b(t)?e.stylize(""+t,"number"):y(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}(e,n);if(a)return a;var i=Object.keys(n),l=function(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(n)),E(n)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return h(n);if(0===i.length){if(I(n)){var s=n.name?": "+n.name:"";return e.stylize("[Function"+s+"]","special")}if(x(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(C(n))return e.stylize(Date.prototype.toString.call(n),"date");if(E(n))return h(n)}var c,u="",d=!1,p=["{","}"];return g(n)&&(d=!0,p=["[","]"]),I(n)&&(u=" [Function"+(n.name?": "+n.name:"")+"]"),x(n)&&(u=" "+RegExp.prototype.toString.call(n)),C(n)&&(u=" "+Date.prototype.toUTCString.call(n)),E(n)&&(u=" "+h(n)),0!==i.length||d&&0!=n.length?r<0?x(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),c=d?function(e,t,n,r,o){for(var a=[],i=0,l=t.length;i<l;++i)A(t,String(i))?a.push(m(e,t,n,r,String(i),!0)):a.push("");return o.forEach(function(o){o.match(/^\d+$/)||a.push(m(e,t,n,r,o,!0))}),a}(e,n,r,l,i):i.map(function(t){return m(e,n,r,l,t,d)}),e.seen.pop(),function(e,t,n){var r=e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return r>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(c,u,p)):p[0]+u+p[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function m(e,t,n,r,o,a){var i,l,s;if((s=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?l=s.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):s.set&&(l=e.stylize("[Setter]","special")),A(r,o)||(i="["+o+"]"),l||(e.seen.indexOf(s.value)<0?(l=v(n)?f(e,s.value,null):f(e,s.value,n-1)).indexOf("\n")>-1&&(l=a?l.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+l.split("\n").map(function(e){return" "+e}).join("\n")):l=e.stylize("[Circular]","special")),w(i)){if(a&&o.match(/^\d+$/))return l;(i=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.slice(1,-1),i=e.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=e.stylize(i,"string"))}return i+": "+l}function g(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function v(e){return null===e}function b(e){return"number"==typeof e}function k(e){return"string"==typeof e}function w(e){return void 0===e}function x(e){return S(e)&&"[object RegExp]"===T(e)}function S(e){return"object"==typeof e&&null!==e}function C(e){return S(e)&&"[object Date]"===T(e)}function E(e){return S(e)&&("[object Error]"===T(e)||e instanceof Error)}function I(e){return"function"==typeof e}function T(e){return Object.prototype.toString.call(e)}function j(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!l[e])if(s.test(e)){var n=r.pid;l[e]=function(){var r=t.format.apply(t,arguments);o.error("%s %d: %s",e,n,r)}}else l[e]=function(){};return l[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=n(8534),t.isArray=g,t.isBoolean=y,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=k,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=w,t.isRegExp=x,t.types.isRegExp=x,t.isObject=S,t.isDate=C,t.types.isDate=C,t.isError=E,t.types.isNativeError=E,t.isFunction=I,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(6925);var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){o.log("%s - %s",function(){var e=new Date,t=[j(e.getHours()),j(e.getMinutes()),j(e.getSeconds())].join(":");return[e.getDate(),N[e.getMonth()],t].join(" ")}(),t.format.apply(t,arguments))},t.inherits=n(1596),t._extend=function(e,t){if(!t||!S(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var P="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!=typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise(function(e,r){t=e,n=r}),o=[],a=0;a<arguments.length;a++)o.push(arguments[a]);o.push(function(e,r){e?n(e):t(r)});try{e.apply(this,o)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),P&&Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,a(e))},t.promisify.custom=P,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var o=t.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var a=this,i=function(){return o.apply(a,arguments)};e.apply(this,t).then(function(e){r.nextTick(i.bind(null,null,e))},function(e){r.nextTick(O.bind(null,e,i))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,a(e)),t}},3629(e,t,n){"use strict";var r=n(6989),o=n(7375),a=o("%Function.prototype.apply%"),i=o("%Function.prototype.call%"),l=o("%Reflect.apply%",!0)||r.call(i,a),s=o("%Object.getOwnPropertyDescriptor%",!0),c=o("%Object.defineProperty%",!0),u=o("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=l(r,i,arguments);return s&&c&&s(t,"length").configurable&&c(t,"length",{value:1+u(0,e.length-(arguments.length-1))}),t};var d=function(){return l(r,a,arguments)};c?c(e.exports,"apply",{value:d}):e.exports.apply=d},3705(e,t,n){var r=n(3575),o=n(6362);function a(){return(new Date).getTime()}var i,l=Array.prototype.slice,s={};i="undefined"!=typeof globalThis&&globalThis.console?globalThis.console:"undefined"!=typeof window&&window.console?window.console:{};for(var c=[[function(){},"log"],[function(){i.log.apply(i,arguments)},"info"],[function(){i.log.apply(i,arguments)},"warn"],[function(){i.warn.apply(i,arguments)},"error"],[function(e){s[e]=a()},"time"],[function(e){var t=s[e];if(!t)throw new Error("No such label: "+e);delete s[e];var n=a()-t;i.log(e+": "+n+"ms")},"timeEnd"],[function(){var e=new Error;e.name="Trace",e.message=r.format.apply(null,arguments),i.error(e.stack)},"trace"],[function(e){i.log(r.inspect(e)+"\n")},"dir"],[function(e){if(!e){var t=l.call(arguments,1);o.ok(!1,r.format.apply(null,t))}},"assert"]],u=0;u<c.length;u++){var d=c[u],p=d[0],f=d[1];i[f]||(i[f]=p)}e.exports=i},3780(e){"use strict";e.exports=RangeError},3862(e,t,n){"use strict";var r=n(8726),o=n(7308);e.exports=function(){var e=o();return r(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},3876(e,t,n){"use strict";var r=n(630),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||o}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=f(n);o&&o!==h&&e(t,o,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var l=s(t),m=s(n),g=0;g<i.length;++g){var y=i[g];if(!(a[y]||r&&r[y]||m&&m[y]||l&&l[y])){var v=p(n,y);try{c(t,y,v)}catch(e){}}}}return t}},3887(e,t,n){"use strict";var r=n(6989),o=n(1264),a=n(3110);e.exports=function(){return a(r,o,arguments)}},4553(e,t,n){"use strict";var r=n(1555);if(r)try{r([],"length")}catch(e){r=null}e.exports=r},4960(e){"use strict";e.exports=Math.abs},4961(e,t,n){"use strict";var r=n(1e3),o=n(6405),a=n(8795),i=n(690),l=n(4553),s=n(6054),c=i("Object.prototype.toString"),u=n(5550)(),d=globalThis,p=o(),f=i("String.prototype.slice"),h=i("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},m={__proto__:null};r(p,u&&l&&s?function(e){var t=new d[e];if(Symbol.toStringTag in t&&s){var n=s(t),r=l(n,Symbol.toStringTag);if(!r&&n){var o=s(n);r=l(o,Symbol.toStringTag)}if(r&&r.get){var i=a(r.get);m["$"+e]=i}}}:function(e){var t=new d[e],n=t.slice||t.set;if(n){var r=a(n);m["$"+e]=r}}),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!u){var t=f(c(e),8,-1);return function(e){return h(p,e)>-1}(t)?t:"Object"===t&&function(e){var t=!1;return r(m,function(n,r){if(!t)try{n(e),t=f(r,1)}catch(e){}}),t}(e)}return l?function(e){var t=!1;return r(m,function(n,r){if(!t)try{"$"+n(e)===r&&(t=f(r,1))}catch(e){}}),t}(e):null}},5158(e){"use strict";e.exports=Math.pow},5224(e){var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var l,s=[],c=!1,u=-1;function d(){c&&l&&(c=!1,l.length?s=l.concat(s):u=-1,s.length&&p())}function p(){if(!c){var e=i(d);c=!0;for(var t=s.length;t;){for(l=s,s=[];++u<t;)l&&l[u].run();u=-1,t=s.length}l=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function h(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new f(e,t)),1!==s.length||c||i(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=h,r.addListener=h,r.once=h,r.off=h,r.removeListener=h,r.removeAllListeners=h,r.emit=h,r.prependListener=h,r.prependOnceListener=h,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},5266(e,t,n){"use strict";var r=n(6954);e.exports=r.getPrototypeOf||null},5550(e,t,n){"use strict";var r=n(3175);e.exports=function(){return r()&&!!Symbol.toStringTag}},5636(e,t,n){"use strict";var r=n(8898),o=60103,a=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var i=60109,l=60110,s=60112;t.Suspense=60113;var c=60115,u=60116;if("function"==typeof Symbol&&Symbol.for){var d=Symbol.for;o=d("react.element"),a=d("react.portal"),t.Fragment=d("react.fragment"),t.StrictMode=d("react.strict_mode"),t.Profiler=d("react.profiler"),i=d("react.provider"),l=d("react.context"),s=d("react.forward_ref"),t.Suspense=d("react.suspense"),c=d("react.memo"),u=d("react.lazy")}var p="function"==typeof Symbol&&Symbol.iterator;function f(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 g(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||h}function y(){}function v(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||h}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(f(85));this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=g.prototype;var b=v.prototype=new y;b.constructor=v,r(b,g.prototype),b.isPureReactComponent=!0;var k={current:null},w=Object.prototype.hasOwnProperty,x={key:!0,ref:!0,__self:!0,__source:!0};function S(e,t,n){var r,a={},i=null,l=null;if(null!=t)for(r in void 0!==t.ref&&(l=t.ref),void 0!==t.key&&(i=""+t.key),t)w.call(t,r)&&!x.hasOwnProperty(r)&&(a[r]=t[r]);var s=arguments.length-2;if(1===s)a.children=n;else if(1<s){for(var c=Array(s),u=0;u<s;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===a[r]&&(a[r]=s[r]);return{$$typeof:o,type:e,key:i,ref:l,props:a,_owner:k.current}}function C(e){return"object"==typeof e&&null!==e&&e.$$typeof===o}var E=/\/+/g;function I(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 T(e,t,n,r,i){var l=typeof e;"undefined"!==l&&"boolean"!==l||(e=null);var s=!1;if(null===e)s=!0;else switch(l){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case o:case a:s=!0}}if(s)return i=i(s=e),e=""===r?"."+I(s,0):r,Array.isArray(i)?(n="",null!=e&&(n=e.replace(E,"$&/")+"/"),T(i,t,n,"",function(e){return e})):null!=i&&(C(i)&&(i=function(e,t){return{$$typeof:o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(E,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=""===r?".":r+":",Array.isArray(e))for(var c=0;c<e.length;c++){var u=r+I(l=e[c],c);s+=T(l,t,n,u,i)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),c=0;!(l=e.next()).done;)s+=T(l=l.value,t,n,u=r+I(l,c++),i);else if("object"===l)throw t=""+e,Error(f(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return s}function j(e,t,n){if(null==e)return e;var r=[],o=0;return T(e,r,"","",function(e){return t.call(n,e,o++)}),r}function N(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 A={current:null};function P(){var e=A.current;if(null===e)throw Error(f(321));return e}var O={ReactCurrentDispatcher:A,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:k,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!C(e))throw Error(f(143));return e}},t.Component=g,t.PureComponent=v,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=O,t.cloneElement=function(e,t,n){if(null==e)throw Error(f(267,e));var a=r({},e.props),i=e.key,l=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(l=t.ref,s=k.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(u in t)w.call(t,u)&&!x.hasOwnProperty(u)&&(a[u]=void 0===t[u]&&void 0!==c?c[u]:t[u])}var u=arguments.length-2;if(1===u)a.children=n;else if(1<u){c=Array(u);for(var d=0;d<u;d++)c[d]=arguments[d+2];a.children=c}return{$$typeof:o,type:e.type,key:i,ref:l,props:a,_owner:s}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:l,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:i,_context:e},e.Consumer=e},t.createElement=S,t.createFactory=function(e){var t=S.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:s,render:e}},t.isValidElement=C,t.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:N}},t.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return P().useCallback(e,t)},t.useContext=function(e,t){return P().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return P().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return P().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return P().useLayoutEffect(e,t)},t.useMemo=function(e,t){return P().useMemo(e,t)},t.useReducer=function(e,t,n){return P().useReducer(e,t,n)},t.useRef=function(e){return P().useRef(e)},t.useState=function(e){return P().useState(e)},t.version="17.0.2"},5664(e,t,n){"use strict";e.exports=n(1253)},5944(e,t,n){"use strict";var r=n(7837);e.exports=function(){return"function"==typeof Object.is?Object.is:r}},6054(e,t,n){"use strict";var r=n(6298),o=n(5266),a=n(7042);e.exports=r?function(e){return r(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return o(e)}:a?function(e){return a(e)}:null},6265(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},6298(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},6362(e,t,n){"use strict";var r=n(5224),o=n(3705);function a(e){return a="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},a(e)}var i,l,s=n(71).codes,c=s.ERR_AMBIGUOUS_ARGUMENT,u=s.ERR_INVALID_ARG_TYPE,d=s.ERR_INVALID_ARG_VALUE,p=s.ERR_INVALID_RETURN_VALUE,f=s.ERR_MISSING_ARGS,h=n(8292),m=n(3575).inspect,g=n(3575).types,y=g.isPromise,v=g.isRegExp,b=Object.assign?Object.assign:n(8957).assign,k=Object.is?Object.is:n(8619);function w(){var e=n(6825);i=e.isDeepEqual,l=e.isDeepStrictEqual}new Map;var x=!1,S=e.exports=T,C={};function E(e){if(e.message instanceof Error)throw e.message;throw new h(e)}function I(e,t,n,r){if(!n){var o=!1;if(0===t)o=!0,r="No value argument passed to `assert.ok()`";else if(r instanceof Error)throw r;var a=new h({actual:n,expected:!0,message:r,operator:"==",stackStartFn:e});throw a.generatedMessage=o,a}}function T(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];I.apply(void 0,[T,t.length].concat(t))}S.fail=function e(t,n,a,i,l){var s,c=arguments.length;if(0===c?s="Failed":1===c?(a=t,t=void 0):(!1===x&&(x=!0,(r.emitWarning?r.emitWarning:o.warn.bind(o))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===c&&(i="!=")),a instanceof Error)throw a;var u={actual:t,expected:n,operator:void 0===i?"fail":i,stackStartFn:l||e};void 0!==a&&(u.message=a);var d=new h(u);throw s&&(d.message=s,d.generatedMessage=!0),d},S.AssertionError=h,S.ok=T,S.equal=function e(t,n,r){if(arguments.length<2)throw new f("actual","expected");t!=n&&E({actual:t,expected:n,message:r,operator:"==",stackStartFn:e})},S.notEqual=function e(t,n,r){if(arguments.length<2)throw new f("actual","expected");t==n&&E({actual:t,expected:n,message:r,operator:"!=",stackStartFn:e})},S.deepEqual=function e(t,n,r){if(arguments.length<2)throw new f("actual","expected");void 0===i&&w(),i(t,n)||E({actual:t,expected:n,message:r,operator:"deepEqual",stackStartFn:e})},S.notDeepEqual=function e(t,n,r){if(arguments.length<2)throw new f("actual","expected");void 0===i&&w(),i(t,n)&&E({actual:t,expected:n,message:r,operator:"notDeepEqual",stackStartFn:e})},S.deepStrictEqual=function e(t,n,r){if(arguments.length<2)throw new f("actual","expected");void 0===i&&w(),l(t,n)||E({actual:t,expected:n,message:r,operator:"deepStrictEqual",stackStartFn:e})},S.notDeepStrictEqual=function e(t,n,r){if(arguments.length<2)throw new f("actual","expected");void 0===i&&w(),l(t,n)&&E({actual:t,expected:n,message:r,operator:"notDeepStrictEqual",stackStartFn:e})},S.strictEqual=function e(t,n,r){if(arguments.length<2)throw new f("actual","expected");k(t,n)||E({actual:t,expected:n,message:r,operator:"strictEqual",stackStartFn:e})},S.notStrictEqual=function e(t,n,r){if(arguments.length<2)throw new f("actual","expected");k(t,n)&&E({actual:t,expected:n,message:r,operator:"notStrictEqual",stackStartFn:e})};var j=function e(t,n,r){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n.forEach(function(e){e in t&&(void 0!==r&&"string"==typeof r[e]&&v(t[e])&&t[e].test(r[e])?o[e]=r[e]:o[e]=t[e])})};function N(e,t,n,r){if("function"!=typeof t){if(v(t))return t.test(e);if(2===arguments.length)throw new u("expected",["Function","RegExp"],t);if("object"!==a(e)||null===e){var o=new h({actual:e,expected:t,message:n,operator:"deepStrictEqual",stackStartFn:r});throw o.operator=r.name,o}var s=Object.keys(t);if(t instanceof Error)s.push("name","message");else if(0===s.length)throw new d("error",t,"may not be an empty object");return void 0===i&&w(),s.forEach(function(o){"string"==typeof e[o]&&v(t[o])&&t[o].test(e[o])||function(e,t,n,r,o,a){if(!(n in e)||!l(e[n],t[n])){if(!r){var i=new j(e,o),s=new j(t,o,e),c=new h({actual:i,expected:s,operator:"deepStrictEqual",stackStartFn:a});throw c.actual=e,c.expected=t,c.operator=a.name,c}E({actual:e,expected:t,message:r,operator:a.name,stackStartFn:a})}}(e,t,o,n,s,r)}),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function A(e){if("function"!=typeof e)throw new u("fn","Function",e);try{e()}catch(e){return e}return C}function P(e){return y(e)||null!==e&&"object"===a(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function O(e){return Promise.resolve().then(function(){var t;if("function"==typeof e){if(!P(t=e()))throw new p("instance of Promise","promiseFn",t)}else{if(!P(e))throw new u("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then(function(){return t}).then(function(){return C}).catch(function(e){return e})})}function _(e,t,n,r){if("string"==typeof n){if(4===arguments.length)throw new u("error",["Object","Error","Function","RegExp"],n);if("object"===a(t)&&null!==t){if(t.message===n)throw new c("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===n)throw new c("error/message",'The error "'.concat(t,'" is identical to the message.'));r=n,n=void 0}else if(null!=n&&"object"!==a(n)&&"function"!=typeof n)throw new u("error",["Object","Error","Function","RegExp"],n);if(t===C){var o="";n&&n.name&&(o+=" (".concat(n.name,")")),o+=r?": ".concat(r):".";var i="rejects"===e.name?"rejection":"exception";E({actual:void 0,expected:n,operator:e.name,message:"Missing expected ".concat(i).concat(o),stackStartFn:e})}if(n&&!N(t,n,r,e))throw t}function R(e,t,n,r){if(t!==C){if("string"==typeof n&&(r=n,n=void 0),!n||N(t,n)){var o=r?": ".concat(r):".",a="doesNotReject"===e.name?"rejection":"exception";E({actual:t,expected:n,operator:e.name,message:"Got unwanted ".concat(a).concat(o,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function M(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];I.apply(void 0,[M,t.length].concat(t))}S.throws=function e(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];_.apply(void 0,[e,A(t)].concat(r))},S.rejects=function e(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return O(t).then(function(t){return _.apply(void 0,[e,t].concat(r))})},S.doesNotThrow=function e(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];R.apply(void 0,[e,A(t)].concat(r))},S.doesNotReject=function e(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return O(t).then(function(t){return R.apply(void 0,[e,t].concat(r))})},S.ifError=function e(t){if(null!=t){var n="ifError got unwanted exception: ";"object"===a(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?n+=t.constructor.name:n+=t.message:n+=m(t);var r=new h({actual:t,expected:null,operator:"ifError",message:n,stackStartFn:e}),o=t.stack;if("string"==typeof o){var i=o.split("\n");i.shift();for(var l=r.stack.split("\n"),s=0;s<i.length;s++){var c=l.indexOf(i[s]);if(-1!==c){l=l.slice(0,c);break}}r.stack="".concat(l.join("\n"),"\n").concat(i.join("\n"))}throw r}},S.strict=b(M,S,{equal:S.strictEqual,deepEqual:S.deepStrictEqual,notEqual:S.notStrictEqual,notDeepEqual:S.notDeepStrictEqual}),S.strict.strict=S.strict},6405(e,t,n){"use strict";var r=n(1016),o=globalThis;e.exports=function(){for(var e=[],t=0;t<r.length;t++)"function"==typeof o[r[t]]&&(e[e.length]=r[t]);return e}},6429(e,t,n){"use strict";e.exports=n(8577)},6516(e){"use strict";e.exports=Math.min},6709(e){"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},6806(e){"use strict";var t,n,r=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw n}}),n={},o(function(){throw 42},null,t)}catch(e){e!==n&&(o=null)}else o=null;var a=/^\s*class\b/,i=function(e){try{var t=r.call(e);return a.test(t)}catch(e){return!1}},l=function(e){try{return!i(e)&&(r.call(e),!0)}catch(e){return!1}},s=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),d=function(){return!1};if("object"==typeof document){var p=document.all;s.call(p)===s.call(document.all)&&(d=function(e){if((u||!e)&&(void 0===e||"object"==typeof e))try{var t=s.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=o?function(e){if(d(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{o(e,null,t)}catch(e){if(e!==n)return!1}return!i(e)&&l(e)}:function(e){if(d(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return l(e);if(i(e))return!1;var t=s.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&l(e)}},6825(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(e){return o="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},o(e)}var a=void 0!==/a/g.flags,i=function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t},l=function(e){var t=[];return e.forEach(function(e,n){return t.push([n,e])}),t},s=Object.is?Object.is:n(8619),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},u=Number.isNaN?Number.isNaN:n(7863);function d(e){return e.call.bind(e)}var p=d(Object.prototype.hasOwnProperty),f=d(Object.prototype.propertyIsEnumerable),h=d(Object.prototype.toString),m=n(3575).types,g=m.isAnyArrayBuffer,y=m.isArrayBufferView,v=m.isDate,b=m.isMap,k=m.isRegExp,w=m.isSet,x=m.isNativeError,S=m.isBoxedPrimitive,C=m.isNumberObject,E=m.isStringObject,I=m.isBooleanObject,T=m.isBigIntObject,j=m.isSymbolObject,N=m.isFloat32Array,A=m.isFloat64Array;function P(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var n=e.charCodeAt(t);if(n<48||n>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function O(e){return Object.keys(e).filter(P).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function _(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,o=0,a=Math.min(n,r);o<a;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0}function R(e,t,n,r){if(e===t)return 0!==e||!n||s(e,t);if(n){if("object"!==o(e))return"number"==typeof e&&u(e)&&u(t);if("object"!==o(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==o(e))return(null===t||"object"!==o(t))&&e==t;if(null===t||"object"!==o(t))return!1}var i,l,c,d,p=h(e);if(p!==h(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var f=O(e),m=O(t);return f.length===m.length&&L(e,t,n,r,1,f)}if("[object Object]"===p&&(!b(e)&&b(t)||!w(e)&&w(t)))return!1;if(v(e)){if(!v(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(k(e)){if(!k(t)||(c=e,d=t,!(a?c.source===d.source&&c.flags===d.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(d))))return!1}else if(x(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(y(e)){if(n||!N(e)&&!A(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===_(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}(e,t))return!1;var P=O(e),R=O(t);return P.length===R.length&&L(e,t,n,r,0,P)}if(w(e))return!(!w(t)||e.size!==t.size)&&L(e,t,n,r,2);if(b(e))return!(!b(t)||e.size!==t.size)&&L(e,t,n,r,3);if(g(e)){if(l=t,(i=e).byteLength!==l.byteLength||0!==_(new Uint8Array(i),new Uint8Array(l)))return!1}else if(S(e)&&!function(e,t){return C(e)?C(t)&&s(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):E(e)?E(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):I(e)?I(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):T(e)?T(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):j(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return L(e,t,n,r,0)}function M(e,t){return t.filter(function(t){return f(e,t)})}function L(e,t,n,a,s,u){if(5===arguments.length){u=Object.keys(e);var d=Object.keys(t);if(u.length!==d.length)return!1}for(var h=0;h<u.length;h++)if(!p(t,u[h]))return!1;if(n&&5===arguments.length){var m=c(e);if(0!==m.length){var g=0;for(h=0;h<m.length;h++){var y=m[h];if(f(e,y)){if(!f(t,y))return!1;u.push(y),g++}else if(f(t,y))return!1}var v=c(t);if(m.length!==v.length&&M(t,v).length!==g)return!1}else{var b=c(t);if(0!==b.length&&0!==M(t,b).length)return!1}}if(0===u.length&&(0===s||1===s&&0===e.length||0===e.size))return!0;if(void 0===a)a={val1:new Map,val2:new Map,position:0};else{var k=a.val1.get(e);if(void 0!==k){var w=a.val2.get(t);if(void 0!==w)return k===w}a.position++}a.val1.set(e,a.position),a.val2.set(t,a.position);var x=function(e,t,n,a,s,c){var u=0;if(2===c){if(!function(e,t,n,r){for(var a=null,l=i(e),s=0;s<l.length;s++){var c=l[s];if("object"===o(c)&&null!==c)null===a&&(a=new Set),a.add(c);else if(!t.has(c)){if(n)return!1;if(!F(e,t,c))return!1;null===a&&(a=new Set),a.add(c)}}if(null!==a){for(var u=i(t),d=0;d<u.length;d++){var p=u[d];if("object"===o(p)&&null!==p){if(!U(a,p,n,r))return!1}else if(!n&&!e.has(p)&&!U(a,p,n,r))return!1}return 0===a.size}return!0}(e,t,n,s))return!1}else if(3===c){if(!function(e,t,n,a){for(var i=null,s=l(e),c=0;c<s.length;c++){var u=r(s[c],2),d=u[0],p=u[1];if("object"===o(d)&&null!==d)null===i&&(i=new Set),i.add(d);else{var f=t.get(d);if(void 0===f&&!t.has(d)||!R(p,f,n,a)){if(n)return!1;if(!z(e,t,d,p,a))return!1;null===i&&(i=new Set),i.add(d)}}}if(null!==i){for(var h=l(t),m=0;m<h.length;m++){var g=r(h[m],2),y=(d=g[0],g[1]);if("object"===o(d)&&null!==d){if(!$(i,e,d,y,n,a))return!1}else if(!(n||e.has(d)&&R(e.get(d),y,!1,a)||$(i,e,d,y,!1,a)))return!1}return 0===i.size}return!0}(e,t,n,s))return!1}else if(1===c)for(;u<e.length;u++){if(!p(e,u)){if(p(t,u))return!1;for(var d=Object.keys(e);u<d.length;u++){var f=d[u];if(!p(t,f)||!R(e[f],t[f],n,s))return!1}return d.length===Object.keys(t).length}if(!p(t,u)||!R(e[u],t[u],n,s))return!1}for(u=0;u<a.length;u++){var h=a[u];if(!R(e[h],t[h],n,s))return!1}return!0}(e,t,n,u,a,s);return a.val1.delete(e),a.val2.delete(t),x}function U(e,t,n,r){for(var o=i(e),a=0;a<o.length;a++){var l=o[a];if(R(t,l,n,r))return e.delete(l),!0}return!1}function D(e){switch(o(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(u(e))return!1}return!0}function F(e,t,n){var r=D(n);return null!=r?r:t.has(r)&&!e.has(r)}function z(e,t,n,r,o){var a=D(n);if(null!=a)return a;var i=t.get(a);return!(void 0===i&&!t.has(a)||!R(r,i,!1,o))&&!e.has(a)&&R(r,i,!1,o)}function $(e,t,n,r,o,a){for(var l=i(e),s=0;s<l.length;s++){var c=l[s];if(R(n,c,o,a)&&R(r,t.get(c),o,a))return e.delete(c),!0}return!1}e.exports={isDeepEqual:function(e,t){return R(e,t,!1)},isDeepStrictEqual:function(e,t){return R(e,t,!0)}}},6925(e){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},6953(e){"use strict";e.exports=Error},6954(e){"use strict";e.exports=Object},6989(e,t,n){"use strict";var r=n(8307);e.exports=Function.prototype.bind||r},7042(e,t,n){"use strict";var r,o=n(9460),a=n(4553);try{r=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var i=!!r&&a&&a(Object.prototype,"__proto__"),l=Object,s=l.getPrototypeOf;e.exports=i&&"function"==typeof i.get?o([i.get]):"function"==typeof s&&function(e){return s(null==e?e:l(e))}},7198(e,t,n){"use strict";var r,o=Object.prototype.toString,a=Function.prototype.toString,i=/^\s*(?:function)?\*/,l=n(5550)(),s=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(i.test(a.call(e)))return!0;if(!l)return"[object GeneratorFunction]"===o.call(e);if(!s)return!1;if(void 0===r){var t=function(){if(!l)return!1;try{return Function("return function*() {}")()}catch(e){}}();r=!!t&&s(t)}return s(e)===r}},7277(e){"use strict";e.exports=TypeError},7308(e,t,n){"use strict";var r=n(7433);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:r}},7375(e,t,n){"use strict";var r,o=n(6954),a=n(6953),i=n(3123),l=n(3780),s=n(8768),c=n(7430),u=n(7277),d=n(1619),p=n(4960),f=n(8974),h=n(2938),m=n(6516),g=n(5158),y=n(7856),v=n(8707),b=Function,k=function(e){try{return b('"use strict"; return ('+e+").constructor;")()}catch(e){}},w=n(4553),x=n(6709),S=function(){throw new u},C=w?function(){try{return S}catch(e){try{return w(arguments,"callee").get}catch(e){return S}}}():S,E=n(757)(),I=n(6054),T=n(5266),j=n(6298),N=n(1264),A=n(7858),P={},O="undefined"!=typeof Uint8Array&&I?I(Uint8Array):r,_={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":E&&I?I([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":i,"%Float16Array%":"undefined"==typeof Float16Array?r:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":P,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&I?I(I([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&E&&I?I((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":l,"%ReferenceError%":s,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&E&&I?I((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&I?I(""[Symbol.iterator]()):r,"%Symbol%":E?Symbol:r,"%SyntaxError%":c,"%ThrowTypeError%":C,"%TypedArray%":O,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":d,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet,"%Function.prototype.call%":A,"%Function.prototype.apply%":N,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":T,"%Math.abs%":p,"%Math.floor%":f,"%Math.max%":h,"%Math.min%":m,"%Math.pow%":g,"%Math.round%":y,"%Math.sign%":v,"%Reflect.getPrototypeOf%":j};if(I)try{null.error}catch(e){var R=I(I(e));_["%Error.prototype%"]=R}var M=function e(t){var n;if("%AsyncFunction%"===t)n=k("async function () {}");else if("%GeneratorFunction%"===t)n=k("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=k("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&I&&(n=I(o.prototype))}return _[t]=n,n},L={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},U=n(6989),D=n(2155),F=U.call(A,Array.prototype.concat),z=U.call(N,Array.prototype.splice),$=U.call(A,String.prototype.replace),B=U.call(A,String.prototype.slice),H=U.call(A,RegExp.prototype.exec),q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W=/\\(\\)?/g,V=function(e,t){var n,r=e;if(D(L,r)&&(r="%"+(n=L[r])[0]+"%"),D(_,r)){var o=_[r];if(o===P&&(o=M(r)),void 0===o&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=B(e,0,1),n=B(e,-1);if("%"===t&&"%"!==n)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return $(e,q,function(e,t,n,o){r[r.length]=n?$(o,W,"$1"):t||e}),r}(e),r=n.length>0?n[0]:"",o=V("%"+r+"%",t),a=o.name,i=o.value,l=!1,s=o.alias;s&&(r=s[0],z(n,F([0,1],s)));for(var d=1,p=!0;d<n.length;d+=1){var f=n[d],h=B(f,0,1),m=B(f,-1);if(('"'===h||"'"===h||"`"===h||'"'===m||"'"===m||"`"===m)&&h!==m)throw new c("property names with quotes must have matching quotes");if("constructor"!==f&&p||(l=!0),D(_,a="%"+(r+="."+f)+"%"))i=_[a];else if(null!=i){if(!(f in i)){if(!t)throw new u("base intrinsic for "+e+" exists, but the property is not available.");return}if(w&&d+1>=n.length){var g=w(i,f);i=(p=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:i[f]}else p=D(i,f),i=i[f];p&&!l&&(_[a]=i)}}return i}},7430(e){"use strict";e.exports=SyntaxError},7433(e){"use strict";e.exports=function(e){return e!=e}},7734(e,t,n){"use strict";var r=n(7375)("%Object.defineProperty%",!0),o=function(){if(r)try{return r({},"a",{value:1}),!0}catch(e){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==r([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},7837(e){"use strict";var t=function(e){return e!=e};e.exports=function(e,n){return 0===e&&0===n?1/e==1/n:e===n||!(!t(e)||!t(n))}},7839(e,t,n){"use strict";var r=Array.prototype.slice,o=n(543),a=Object.keys,i=a?function(e){return a(e)}:n(225),l=Object.keys;i.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return o(e)?l(r.call(e)):l(e)})}else Object.keys=i;return Object.keys||i},e.exports=i},7856(e){"use strict";e.exports=Math.round},7858(e){"use strict";e.exports=Function.prototype.call},7863(e,t,n){"use strict";var r=n(3629),o=n(8726),a=n(7433),i=n(7308),l=n(3862),s=r(i(),Number);o(s,{getPolyfill:i,implementation:a,shim:l}),e.exports=s},8259(e,t,n){"use strict";var r=n(7375),o=n(9411),a=n(8562)(),i=n(4553),l=n(7277),s=r("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new l("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||s(t)!==t)throw new l("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],r=!0,c=!0;if("length"in e&&i){var u=i(e,"length");u&&!u.configurable&&(r=!1),u&&!u.writable&&(c=!1)}return(r||c||!n)&&(a?o(e,"length",t,!0,!0):o(e,"length",t)),e}},8292(e,t,n){"use strict";var r=n(5224);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?l(e):t}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e){var t="function"==typeof Map?new Map:void 0;return s=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return c(e,arguments,d(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,e)},s(e)}function c(e,t,n){return c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&u(o,n.prototype),o},c.apply(null,arguments)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function p(e){return p="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},p(e)}var f=n(3575).inspect,h=n(71).codes.ERR_INVALID_ARG_TYPE;function m(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}var g="",y="",v="",b="",k={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(e){var t=Object.keys(e),n=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){n[t]=e[t]}),Object.defineProperty(n,"message",{value:e.message}),n}function x(e){return f(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function S(e,t,n){var o="",a="",i=0,l="",s=!1,c=x(e),u=c.split("\n"),d=x(t).split("\n"),f=0,h="";if("strictEqual"===n&&"object"===p(e)&&"object"===p(t)&&null!==e&&null!==t&&(n="strictEqualObject"),1===u.length&&1===d.length&&u[0]!==d[0]){var w=u[0].length+d[0].length;if(w<=10){if(!("object"===p(e)&&null!==e||"object"===p(t)&&null!==t||0===e&&0===t))return"".concat(k[n],"\n\n")+"".concat(u[0]," !== ").concat(d[0],"\n")}else if("strictEqualObject"!==n&&w<(r.stderr&&r.stderr.isTTY?r.stderr.columns:80)){for(;u[0][f]===d[0][f];)f++;f>2&&(h="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var n=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,n-e.length)}(" ",f),"^"),f=0)}}for(var S=u[u.length-1],C=d[d.length-1];S===C&&(f++<2?l="\n ".concat(S).concat(l):o=S,u.pop(),d.pop(),0!==u.length&&0!==d.length);)S=u[u.length-1],C=d[d.length-1];var E=Math.max(u.length,d.length);if(0===E){var I=c.split("\n");if(I.length>30)for(I[26]="".concat(g,"...").concat(b);I.length>27;)I.pop();return"".concat(k.notIdentical,"\n\n").concat(I.join("\n"),"\n")}f>3&&(l="\n".concat(g,"...").concat(b).concat(l),s=!0),""!==o&&(l="\n ".concat(o).concat(l),o="");var T=0,j=k[n]+"\n".concat(y,"+ actual").concat(b," ").concat(v,"- expected").concat(b),N=" ".concat(g,"...").concat(b," Lines skipped");for(f=0;f<E;f++){var A=f-i;if(u.length<f+1)A>1&&f>2&&(A>4?(a+="\n".concat(g,"...").concat(b),s=!0):A>3&&(a+="\n ".concat(d[f-2]),T++),a+="\n ".concat(d[f-1]),T++),i=f,o+="\n".concat(v,"-").concat(b," ").concat(d[f]),T++;else if(d.length<f+1)A>1&&f>2&&(A>4?(a+="\n".concat(g,"...").concat(b),s=!0):A>3&&(a+="\n ".concat(u[f-2]),T++),a+="\n ".concat(u[f-1]),T++),i=f,a+="\n".concat(y,"+").concat(b," ").concat(u[f]),T++;else{var P=d[f],O=u[f],_=O!==P&&(!m(O,",")||O.slice(0,-1)!==P);_&&m(P,",")&&P.slice(0,-1)===O&&(_=!1,O+=","),_?(A>1&&f>2&&(A>4?(a+="\n".concat(g,"...").concat(b),s=!0):A>3&&(a+="\n ".concat(u[f-2]),T++),a+="\n ".concat(u[f-1]),T++),i=f,a+="\n".concat(y,"+").concat(b," ").concat(O),o+="\n".concat(v,"-").concat(b," ").concat(P),T+=2):(a+=o,o="",1!==A&&0!==f||(a+="\n ".concat(O),T++))}if(T>20&&f<E-2)return"".concat(j).concat(N,"\n").concat(a,"\n").concat(g,"...").concat(b).concat(o,"\n")+"".concat(g,"...").concat(b)}return"".concat(j).concat(s?N:"","\n").concat(a).concat(o).concat(l).concat(h)}var C=function(e){function t(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"object"!==p(e)||null===e)throw new h("options","Object",e);var o=e.message,a=e.operator,s=e.stackStartFn,c=e.actual,u=e.expected,f=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=o)n=i(this,d(t).call(this,String(o)));else if(r.stderr&&r.stderr.isTTY&&(r.stderr&&r.stderr.getColorDepth&&1!==r.stderr.getColorDepth()?(g="[34m",y="[32m",b="[39m",v="[31m"):(g="",y="",b="",v="")),"object"===p(c)&&null!==c&&"object"===p(u)&&null!==u&&"stack"in c&&c instanceof Error&&"stack"in u&&u instanceof Error&&(c=w(c),u=w(u)),"deepStrictEqual"===a||"strictEqual"===a)n=i(this,d(t).call(this,S(c,u,a)));else if("notDeepStrictEqual"===a||"notStrictEqual"===a){var m=k[a],C=x(c).split("\n");if("notStrictEqual"===a&&"object"===p(c)&&null!==c&&(m=k.notStrictEqualObject),C.length>30)for(C[26]="".concat(g,"...").concat(b);C.length>27;)C.pop();n=1===C.length?i(this,d(t).call(this,"".concat(m," ").concat(C[0]))):i(this,d(t).call(this,"".concat(m,"\n\n").concat(C.join("\n"),"\n")))}else{var E=x(c),I="",T=k[a];"notDeepEqual"===a||"notEqual"===a?(E="".concat(k[a],"\n\n").concat(E)).length>1024&&(E="".concat(E.slice(0,1021),"...")):(I="".concat(x(u)),E.length>512&&(E="".concat(E.slice(0,509),"...")),I.length>512&&(I="".concat(I.slice(0,509),"...")),"deepEqual"===a||"equal"===a?E="".concat(T,"\n\n").concat(E,"\n\nshould equal\n\n"):I=" ".concat(a," ").concat(I)),n=i(this,d(t).call(this,"".concat(E).concat(I)))}return Error.stackTraceLimit=f,n.generatedMessage=!o,Object.defineProperty(l(n),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),n.code="ERR_ASSERTION",n.actual=c,n.expected=u,n.operator=a,Error.captureStackTrace&&Error.captureStackTrace(l(n),s),n.stack,n.name="AssertionError",i(n)}var n,s;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,e),n=t,s=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:f.custom,value:function(e,t){return f(this,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){o(e,t,n[t])})}return e}({},t,{customInspect:!1,depth:0}))}}],s&&a(n.prototype,s),t}(s(Error));e.exports=C},8307(e){"use strict";var t=Object.prototype.toString,n=Math.max,r=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var o=0;o<t.length;o+=1)n[o+e.length]=t[o];return n};e.exports=function(e){var o=this;if("function"!=typeof o||"[object Function]"!==t.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var a,i=function(e){for(var t=[],n=1,r=0;n<e.length;n+=1,r+=1)t[r]=e[n];return t}(arguments),l=n(0,o.length-i.length),s=[],c=0;c<l;c++)s[c]="$"+c;if(a=Function("binder","return function ("+function(e){for(var t="",n=0;n<e.length;n+=1)t+=e[n],n+1<e.length&&(t+=",");return t}(s)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof a){var t=o.apply(this,r(i,arguments));return Object(t)===t?t:this}return o.apply(e,r(i,arguments))}),o.prototype){var u=function(){};u.prototype=o.prototype,a.prototype=new u,u.prototype=null}return a}},8534(e,t,n){"use strict";var r=n(46),o=n(7198),a=n(4961),i=n(1338);function l(e){return e.call.bind(e)}var s="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=l(Object.prototype.toString),d=l(Number.prototype.valueOf),p=l(String.prototype.valueOf),f=l(Boolean.prototype.valueOf);if(s)var h=l(BigInt.prototype.valueOf);if(c)var m=l(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function y(e){return"[object Map]"===u(e)}function v(e){return"[object Set]"===u(e)}function b(e){return"[object WeakMap]"===u(e)}function k(e){return"[object WeakSet]"===u(e)}function w(e){return"[object ArrayBuffer]"===u(e)}function x(e){return"undefined"!=typeof ArrayBuffer&&(w.working?w(e):e instanceof ArrayBuffer)}function S(e){return"[object DataView]"===u(e)}function C(e){return"undefined"!=typeof DataView&&(S.working?S(e):e instanceof DataView)}t.isArgumentsObject=r,t.isGeneratorFunction=o,t.isTypedArray=i,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):i(e)||C(e)},t.isUint8Array=function(e){return"Uint8Array"===a(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===a(e)},t.isUint16Array=function(e){return"Uint16Array"===a(e)},t.isUint32Array=function(e){return"Uint32Array"===a(e)},t.isInt8Array=function(e){return"Int8Array"===a(e)},t.isInt16Array=function(e){return"Int16Array"===a(e)},t.isInt32Array=function(e){return"Int32Array"===a(e)},t.isFloat32Array=function(e){return"Float32Array"===a(e)},t.isFloat64Array=function(e){return"Float64Array"===a(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===a(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===a(e)},y.working="undefined"!=typeof Map&&y(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(y.working?y(e):e instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(v.working?v(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},k.working="undefined"!=typeof WeakSet&&k(new WeakSet),t.isWeakSet=function(e){return k(e)},w.working="undefined"!=typeof ArrayBuffer&&w(new ArrayBuffer),t.isArrayBuffer=x,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=C;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function I(e){return"[object SharedArrayBuffer]"===u(e)}function T(e){return void 0!==E&&(void 0===I.working&&(I.working=I(new E)),I.working?I(e):e instanceof E)}function j(e){return g(e,d)}function N(e){return g(e,p)}function A(e){return g(e,f)}function P(e){return s&&g(e,h)}function O(e){return c&&g(e,m)}t.isSharedArrayBuffer=T,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},t.isGeneratorObject=function(e){return"[object Generator]"===u(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},t.isNumberObject=j,t.isStringObject=N,t.isBooleanObject=A,t.isBigIntObject=P,t.isSymbolObject=O,t.isBoxedPrimitive=function(e){return j(e)||N(e)||A(e)||P(e)||O(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(x(e)||T(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})})},8562(e,t,n){"use strict";var r=n(6709),o=function(){return!!r};o.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},8577(e,t){"use strict";var n=60103,r=60106,o=60107,a=60108,i=60114,l=60109,s=60110,c=60112,u=60113,d=60120,p=60115,f=60116;if("function"==typeof Symbol&&Symbol.for){var h=Symbol.for;n=h("react.element"),r=h("react.portal"),o=h("react.fragment"),a=h("react.strict_mode"),i=h("react.profiler"),l=h("react.provider"),s=h("react.context"),c=h("react.forward_ref"),u=h("react.suspense"),d=h("react.suspense_list"),p=h("react.memo"),f=h("react.lazy"),h("react.block"),h("react.server.block"),h("react.fundamental"),h("react.debug_trace_mode"),h("react.legacy_hidden")}t.isContextConsumer=function(e){return function(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case o:case i:case a:case u:case d:return e;default:switch(e=e&&e.$$typeof){case s:case c:case f:case p:case l:return e;default:return t}}case r:return t}}}(e)===s}},8619(e,t,n){"use strict";var r=n(8726),o=n(3629),a=n(7837),i=n(5944),l=n(9394),s=o(i(),Object);r(s,{getPolyfill:i,implementation:a,shim:l}),e.exports=s},8707(e,t,n){"use strict";var r=n(1581);e.exports=function(e){return r(e)||0===e?e:e<0?-1:1}},8726(e,t,n){"use strict";var r=n(7839),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),a=Object.prototype.toString,i=Array.prototype.concat,l=Object.defineProperty,s=n(7734)(),c=l&&s,u=function(e,t,n,r){var o;(!(t in e)||"function"==typeof(o=r)&&"[object Function]"===a.call(o)&&r())&&(c?l(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n)},d=function(e,t){var n=arguments.length>2?arguments[2]:{},a=r(t);o&&(a=i.call(a,Object.getOwnPropertySymbols(t)));for(var l=0;l<a.length;l+=1)u(e,a[l],t[a[l]],n[a[l]])};d.supportsDescriptors=!!c,e.exports=d},8768(e){"use strict";e.exports=ReferenceError},8795(e,t,n){"use strict";var r=n(8259),o=n(6709),a=n(9460),i=n(3887);e.exports=function(e){var t=a(arguments),n=1+e.length-(arguments.length-1);return r(t,n>0?n:0,!0)},o?o(e.exports,"apply",{value:i}):e.exports.apply=i},8898(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;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,i,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var c in a=Object(arguments[s]))n.call(a,c)&&(l[c]=a[c]);if(t){i=t(a);for(var u=0;u<i.length;u++)r.call(a,i[u])&&(l[i[u]]=a[i[u]])}}return l}},8932(e,t,n){"use strict";var r=n(3705);!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){r.error(e)}}(),e.exports=n(3500)},8957(e){"use strict";function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var n=Object(e),r=1;r<arguments.length;r++){var o=arguments[r];if(null!=o)for(var a=Object.keys(Object(o)),i=0,l=a.length;i<l;i++){var s=a[i],c=Object.getOwnPropertyDescriptor(o,s);void 0!==c&&c.enumerable&&(n[s]=o[s])}}return n}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}}},8974(e){"use strict";e.exports=Math.floor},9394(e,t,n){"use strict";var r=n(5944),o=n(8726);e.exports=function(){var e=r();return o(Object,{is:e},{is:function(){return Object.is!==e}}),e}},9411(e,t,n){"use strict";var r=n(6709),o=n(7430),a=n(7277),i=n(4553);e.exports=function(e,t,n){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new a("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],d=!!i&&i(e,t);if(r)r(e,t,{configurable:null===c&&d?d.configurable:!c,enumerable:null===l&&d?d.enumerable:!l,value:n,writable:null===s&&d?d.writable:!s});else{if(!u&&(l||s||c))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=n}}},9460(e,t,n){"use strict";var r=n(6989),o=n(7277),a=n(7858),i=n(3110);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return i(r,a,e)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.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.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(1173),t=n(8932),r=e.createContext(null),o=function(e){e()},a=function(){return o},i={notify:function(){},get:function(){return[]}};function l(e,t){var n,r=i;function o(){s.onStateChange&&s.onStateChange()}function l(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){var e=a(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e(function(){for(var e=t;e;)e.callback(),e=e.next})},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}var s={addNestedSub:function(e){return l(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:l,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=i)},getListeners:function(){return r}};return s}var s="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(null,arguments)}function u(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}var d=n(3876),p=n.n(d),f=n(6429),h=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],m=["reactReduxForwardedRef"],g=[],y=[null,null];function v(e,t){var n=e[1];return[t.payload,n+1]}function b(e,t,n){s(function(){return e.apply(void 0,t)},n)}function k(e,t,n,r,o,a,i){e.current=r,t.current=o,n.current=!1,a.current&&(a.current=null,i())}function w(e,t,n,r,o,a,i,l,s,c){if(e){var u=!1,d=null,p=function(){if(!u){var e,n,p=t.getState();try{e=r(p,o.current)}catch(e){n=e,d=e}n||(d=null),e===a.current?i.current||s():(a.current=e,l.current=e,i.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};return n.onStateChange=p,n.trySubscribe(),p(),function(){if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var x=function(){return[null,0]};function S(t,n){void 0===n&&(n={});var o=n,a=o.getDisplayName,i=void 0===a?function(e){return"ConnectAdvanced("+e+")"}:a,s=o.methodName,d=void 0===s?"connectAdvanced":s,S=o.renderCountProp,C=void 0===S?void 0:S,E=o.shouldHandleStateChanges,I=void 0===E||E,T=o.storeKey,j=void 0===T?"store":T,N=(o.withRef,o.forwardRef),A=void 0!==N&&N,P=o.context,O=void 0===P?r:P,_=u(o,h),R=O;return function(n){var r=n.displayName||n.name||"Component",o=i(r),a=c({},_,{getDisplayName:i,methodName:d,renderCountProp:C,shouldHandleStateChanges:I,storeKey:j,displayName:o,wrappedComponentName:r,WrappedComponent:n}),s=_.pure,h=s?e.useMemo:function(e){return e()};function S(r){var o=(0,e.useMemo)(function(){var e=r.reactReduxForwardedRef,t=u(r,m);return[r.context,e,t]},[r]),i=o[0],s=o[1],d=o[2],p=(0,e.useMemo)(function(){return i&&i.Consumer&&(0,f.isContextConsumer)(e.createElement(i.Consumer,null))?i:R},[i,R]),S=(0,e.useContext)(p),C=Boolean(r.store)&&Boolean(r.store.getState)&&Boolean(r.store.dispatch);Boolean(S)&&Boolean(S.store);var E=C?r.store:S.store,T=(0,e.useMemo)(function(){return function(e){return t(e.dispatch,a)}(E)},[E]),j=(0,e.useMemo)(function(){if(!I)return y;var e=l(E,C?null:S.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[E,C,S]),N=j[0],A=j[1],P=(0,e.useMemo)(function(){return C?S:c({},S,{subscription:N})},[C,S,N]),O=(0,e.useReducer)(v,g,x),_=O[0][0],M=O[1];if(_&&_.error)throw _.error;var L=(0,e.useRef)(),U=(0,e.useRef)(d),D=(0,e.useRef)(),F=(0,e.useRef)(!1),z=h(function(){return D.current&&d===U.current?D.current:T(E.getState(),d)},[E,_,d]);b(k,[U,L,F,d,z,D,A]),b(w,[I,E,N,T,U,L,F,D,A,M],[E,N,T]);var $=(0,e.useMemo)(function(){return e.createElement(n,c({},z,{ref:s}))},[s,n,z]);return(0,e.useMemo)(function(){return I?e.createElement(p.Provider,{value:P},$):$},[p,$,P])}var E=s?e.memo(S):S;if(E.WrappedComponent=n,E.displayName=S.displayName=o,A){var T=e.forwardRef(function(t,n){return e.createElement(E,c({},t,{reactReduxForwardedRef:n}))});return T.displayName=o,T.WrappedComponent=n,p()(T,n)}return p()(E,n)}}function C(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function E(e,t){if(C(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(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!C(e[n[o]],t[n[o]]))return!1;return!0}function I(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function T(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function j(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=T(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=T(o),o=r(t,n)),o},r}}n(3705);const N=[function(e){return"function"==typeof e?j(e):void 0},function(e){return e?void 0:I(function(e){return{dispatch:e}})},function(e){return e&&"object"==typeof e?I(function(t){return function(e,t){var n={},r=function(r){var o=e[r];"function"==typeof o&&(n[r]=function(){return t(o.apply(void 0,arguments))})};for(var o in e)r(o);return n}(e,t)}):void 0}],A=[function(e){return"function"==typeof e?j(e):void 0},function(e){return e?void 0:I(function(){return{}})}];function P(e,t,n){return c({},n,e,t)}const O=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,o=n.pure,a=n.areMergedPropsEqual,i=!1;return function(t,n,l){var s=e(t,n,l);return i?o&&a(s,r)||(r=s):(i=!0,r=s),r}}}(e):void 0},function(e){return e?void 0:function(){return P}}];var _=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function R(e,t,n,r){return function(o,a){return n(e(o,a),t(r,a),a)}}function M(e,t,n,r,o){var a,i,l,s,c,u=o.areStatesEqual,d=o.areOwnPropsEqual,p=o.areStatePropsEqual,f=!1;function h(o,f){var h=!d(f,i),m=!u(o,a,f,i);return a=o,i=f,h&&m?(l=e(a,i),t.dependsOnOwnProps&&(s=t(r,i)),c=n(l,s,i)):h?(e.dependsOnOwnProps&&(l=e(a,i)),t.dependsOnOwnProps&&(s=t(r,i)),c=n(l,s,i)):m?function(){var t=e(a,i),r=!p(t,l);return l=t,r&&(c=n(l,s,i)),c}():c}return function(o,u){return f?h(o,u):(l=e(a=o,i=u),s=t(r,i),c=n(l,s,i),f=!0,c)}}function L(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,a=u(t,_),i=n(e,a),l=r(e,a),s=o(e,a);return(a.pure?M:R)(i,l,s,e,a)}var U=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function D(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function F(e,t){return e===t}const z=function(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?S:n,o=t.mapStateToPropsFactories,a=void 0===o?A:o,i=t.mapDispatchToPropsFactories,l=void 0===i?N:i,s=t.mergePropsFactories,d=void 0===s?O:s,p=t.selectorFactory,f=void 0===p?L:p;return function(e,t,n,o){void 0===o&&(o={});var i=o,s=i.pure,p=void 0===s||s,h=i.areStatesEqual,m=void 0===h?F:h,g=i.areOwnPropsEqual,y=void 0===g?E:g,v=i.areStatePropsEqual,b=void 0===v?E:v,k=i.areMergedPropsEqual,w=void 0===k?E:k,x=u(i,U),S=D(e,a,"mapStateToProps"),C=D(t,l,"mapDispatchToProps"),I=D(n,d,"mergeProps");return r(f,c({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:S,initMapDispatchToProps:C,initMergeProps:I,pure:p,areStatesEqual:m,areOwnPropsEqual:y,areStatePropsEqual:b,areMergedPropsEqual:w},x))}}();var $;function B(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}$=t.unstable_batchedUpdates,o=$,n(3705);var H="function"==typeof Symbol&&Symbol.observable||"@@observable",q=function(){return Math.random().toString(36).substring(7).split("").join(".")},W={INIT:"@@redux/INIT"+q(),REPLACE:"@@redux/REPLACE"+q(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+q()}};const V="ADD_SKILL_MAP",G="CLEAR_SKILL_MAPS",K="CLEAR_METADATA",Q="CHANGE_SELECTED_ITEM",Y="SET_SKILL_MAP_COMPLETED",Z="SET_HEADERID_FOR_ACTIVITY",X="OPEN_ACTIVITY",J="CLOSE_ACTIVITY",ee="SAVE_AND_CLOSE_ACTIVITY",te="RESTART_ACTIVITY",ne="SET_USER",re="UPDATE_USER_COMPLETED_TAGS",oe="RESET_USER",ae="SET_PAGE_TITLE",ie="SET_PAGE_DESCRIPTION",le="SET_PAGE_INFO_URL",se="SET_PAGE_BACKGROUND_IMAGE_URL",ce="SET_PAGE_BANNER_IMAGE_URL",ue="SET_PAGE_THEME",de="SET_PAGE_SOURCE_URL",pe="SET_PAGE_ALTERNATE_URLS",fe="SET_MODAL",he="NEXT_MODAL",me="HIDE_MODAL",ge="SHOW_COMPLETION_MODAL",ye="SET_USER_PROFILE",ve="SET_USER_PREFERENCES",be="USER_LOG_OUT",ke="SHOW_USER_PROFILE",we="HIDE_USER_PROFILE",xe="SET_SHARE_STATUS",Se="SET_CLOUD_STATUS",Ce="SET_READY_RESOURCES",Ee="SHOW_SELECT_LANGUAGE",Ie="HIDE_SELECT_LANGUAGE",Te="SHOW_SELECT_THEME",je="HIDE_SELECT_THEME",Ne="SHOW_FEEDBACK",Ae="HIDE_FEEDBACK",Pe="-SHOWN-LOGIN-PROMPT";function Oe(e){let t={cmd:"",arg:""},n=/^(\w+)(:([:./\-+=\w]+))?/.exec((e||window.location.hash).replace(/^#/,""));return n&&(t={cmd:n[1],arg:n[3]||""}),t}function _e(e){return e.trim().replace(/^[\\/]/i,"").replace(/\.md$/i,"")}function Re(e){var t;e=_e(e);return`https://www.makecode.com/api/md/${(null===(t=window.pxtTargetBundle)||void 0===t?void 0:t.name)||"arcade"}/${e}`}function Me(e){let t=function(e){return e=(e=(e=e.replace(/^\/?blob\/main\//,"")).replace(/^\/?blob\/master\//,"")).replace(/\.md$/,"")}(e.fileName||"skillmap");return{identifier:e.fullName+"#"+t,fileName:t}}function Le(e){return new Promise((t,n)=>{const r=new XMLHttpRequest;r.addEventListener("error",e=>{n(e)}),r.addEventListener("load",()=>{try{t(r.responseText)}catch(e){n(e)}}),r.open("GET",e),r.send()})}function Ue(){function e(){return(65536|function(){let e=new Uint8Array(4);return function(e){if(window.crypto)window.crypto.getRandomValues(e);else for(let t=0;t<e.length;++t)e[t]=Math.floor(255*Math.random())}(e),new Uint32Array(e.buffer)[0]}()).toString(16).slice(-4)}return e()+e()+"-"+e()+"-4"+e().slice(-3)+"-"+e()+"-"+e()+e()+e()}function De(){return"localhost"===window.location.hostname}function Fe(e){return`${De()?"":"/static/skillmap"}/${e.replace(/^\//,"")}`}let ze,$e;function Be(e,t){var n,r;(t=t||{}).page=$e,t.pageTitle=ze,null===(n=(r=window).pxtTickEvent)||void 0===n||n.call(r,e,t)}function He(e,t,n,r){return!Object.keys(null==n?void 0:n.activities).some(o=>{var a,i;return!(null!==(a=Ke(e,t,n.mapId))&&void 0!==a&&null!==(i=a.activityState[o])&&void 0!==i&&i.isCompleted)&&o!==r})}function qe(e,t,n,r){var o;return!(null===(o=Qe(e,t,n,r))||void 0===o||!o.isCompleted)}function We(e,t,n,r){let o,a,i,l=e&&n&&Ge(e,t,n,r)?"notstarted":"locked";if(e)if(n&&t&&!function(e,t,n){for(const r of t.prerequisites)if("tag"===r.type){if(!e.completedTags[n])return!1;const t=e.completedTags[n][r.tag];if(void 0===t||t<r.numberCompleted)return!1}else if("map"===r.type&&!He(e,n,t))return!1;return!0}(e,n,t))l="locked";else{const s=Qe(e,t,n.mapId,r);s&&(s.isCompleted?(l=s.currentStep&&s.maxSteps&&s.currentStep<s.maxSteps?"restarted":"completed",i=s.headerId):s.headerId&&(l="inprogress"),o=null==s?void 0:s.currentStep,a=null==s?void 0:s.maxSteps)}return{status:l,currentStep:o,maxSteps:a,completedHeadedId:i}}function Ve(e,t,n){const r={};for(const o of n)for(const n of Object.keys(o.activities)){const a=o.activities[n];if(qe(e,t,o.mapId,a.activityId)&&"activity"===a.kind)for(const e of a.tags)r[e]||(r[e]=0),r[e]++}return r}function Ge(e,t,n,r){return n.root.activityId===r||function o(a){if(qe(e,t,n.mapId,a.activityId)){if(a.next.some(e=>e.activityId===r))return!0;for(const e of a.next)if(o(e))return!0}return!1}(n.root)}function Ke(e,t,n){return e.mapProgress[t]?e.mapProgress[t][n]:void 0}function Qe(e,t,n,r){var o;return null===(o=Ke(e,t,n))||void 0===o?void 0:o.activityState[r]}function Ye(e,t){return!!(e.mapProgress&&e.mapProgress[t]&&0!=Object.keys(e.mapProgress[t]).length&&Object.keys(e.mapProgress[t]).some(n=>0!=Object.keys(e.mapProgress[t][n].activityState).length))}function Ze(e,t){return Object.keys(e.activities).filter(t=>!nt(e.activities[t])).filter(n=>tt(e.activities[n],nt(e.activities[t])).map(e=>e.activityId).some(e=>e===t)).map(t=>e.activities[t])}function Xe(e,t,n,r){return Ze(n,r).map(r=>Qe(e,t,n.mapId,r.activityId)).filter(e=>!!e)}function Je(e,t,n,r){const o=Xe(e,t,n,r).filter(e=>(null==e?void 0:e.isCompleted)&&e.maxSteps===e.currentStep).sort((e,t)=>(t.completedTime||0)-(e.completedTime||0));return null==o?void 0:o[0]}function et(e,t,n,r){if(!e||!n||!r||"activity"!==r.kind)return!1;const o=Xe(e,t,n,r.activityId),a=null==o?void 0:o.some(e=>(null==e?void 0:e.isCompleted)&&e.maxSteps===e.currentStep);return r.allowCodeCarryover&&o.length>0&&a&&Ge(e,t,n,r.activityId)}function tt(e,t=!1){let n=[];return e.next.forEach(e=>{t||!nt(e)?n.push(e):n=n.concat(tt(e))}),n}function nt(e){return"reward"===e.kind||"completion"===e.kind}function rt(e,t,n){const r=[];for(const o of Object.keys(n.activities))if(nt(n.activities[o])&&Ge(e,t,n,o)){const e=n.activities[o];for(const o of e.rewards)"completion-badge"===o.type&&r.push(ot(t,n,e))}return r}function ot(e,t,n){const r=n.rewards.filter(e=>"completion-badge"===e.type)[0];return{id:`skillmap-completion-${t.mapId}`,image:null==r?void 0:r.imageUrl,sourceURL:e,type:"skillmap-completion",title:(null==r?void 0:r.displayName)||t.displayName}}function at(e,t,n){var r;return Object.values(null!==(r=e.mapProgress[t])&&void 0!==r?r:[]).filter(e=>{var r;return!n||!(null!==(r=n.mapProgress[t])&&void 0!==r&&r[e.mapId])||0===Object.keys(n.mapProgress[t][e.mapId].activityState).length}).map(e=>Object.values(e.activityState)).reduce((e,t)=>e.concat(t,[]),[]).map(e=>e.headerId).filter(e=>!!e)}const it={title:lf("Game Maker Guide"),description:lf("Level up your game making skills by completing the tutorials in this guide."),pageSourceStatus:"unknown",pageSourceUrl:"default",user:{version:pxt.skillmap.USER_VERSION,isDebug:!0,id:Ue(),mapProgress:{},completedTags:{}},theme:{backgroundColor:"var(--pxt-target-background1)",pathColor:"var(--pxt-neutral-background1)",strokeColor:"var(--pxt-target-foreground1)",rewardNodeColor:"var(--pxt-primary-background)",rewardNodeForeground:"var(--pxt-primary-foreground)",unlockedNodeColor:"var(--pxt-secondary-background)",unlockedNodeForeground:"var(--pxt-secondary-foreground)",lockedNodeColor:"var(--pxt-neutral-background1)",lockedNodeForeground:"var(--pxt-neutral-foreground1)",completedNodeColor:"var(--pxt-secondary-background)",completedNodeForeground:"var(--pxt-secondary-foreground)",selectedStrokeColor:"var(--pxt-secondary-background)",pathOpacity:.5},maps:{},auth:{signedIn:!1},cloudState:{}};function lt(e,t,n,r,o,a,i,l=!1){var s,c;const u=n.mapId;let d=Qe(e,t,u,r);d||(d={isCompleted:!1,activityId:r,currentStep:a,maxSteps:i,headerId:o});const p=(null===(s=e.mapProgress)||void 0===s?void 0:s[t])||{};return{...e,mapProgress:{...e.mapProgress,[t]:{...p,[u]:{...(null==p?void 0:p[u])||{mapId:u},activityState:{...(null==p||null===(c=p[u])||void 0===c?void 0:c.activityState)||{},[r]:{...d,headerId:o,currentStep:a,maxSteps:i,isCompleted:d.isCompleted||l}}}}}}}function st(e,t,n,r){var o,a,i;const l=n.mapId;let s=!1;const c={};r.forEach(r=>{let o=Qe(e,t,l,r);s=s||nt(n.activities[r])&&!(null!=o&&o.isCompleted),c[r]=o||{isCompleted:!0,activityId:r,headerId:"",currentStep:0},c[r].isCompleted=!0,c[r].completedTime=Date.now()});const u=(null===(o=e.mapProgress)||void 0===o?void 0:o[t])||{};return{...e,mapProgress:{...e.mapProgress,[t]:{...u,[l]:{...(null==u?void 0:u[l])||{mapId:l},activityState:{...(null==u||null===(a=u[l])||void 0===a?void 0:a.activityState)||{},...c},completionState:s?"transitioning":null==u||null===(i=u[l])||void 0===i?void 0:i.completionState}}}}}function ct(e,t){const n=[{type:"completion",currentMapId:e.mapId,currentActivityId:t}],r=e.activities[t];if(1===r.rewards.length&&"certificate"===r.rewards[0].type)return n[0].currentReward=r.rewards[0],n;for(const o of r.rewards)n.push({type:"reward",currentMapId:e.mapId,currentActivityId:t,currentReward:o});return n}const ut=function e(t,n,r){var o;if("function"==typeof n&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(B(0));if("function"==typeof n&&void 0===r&&(r=n,n=void 0),void 0!==r){if("function"!=typeof r)throw new Error(B(1));return r(e)(t,n)}if("function"!=typeof t)throw new Error(B(2));var a=t,i=n,l=[],s=l,c=!1;function u(){s===l&&(s=l.slice())}function d(){if(c)throw new Error(B(3));return i}function p(e){if("function"!=typeof e)throw new Error(B(4));if(c)throw new Error(B(5));var t=!0;return u(),s.push(e),function(){if(t){if(c)throw new Error(B(6));t=!1,u();var n=s.indexOf(e);s.splice(n,1),l=null}}}function f(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(B(7));if(void 0===e.type)throw new Error(B(8));if(c)throw new Error(B(9));try{c=!0,i=a(i,e)}finally{c=!1}for(var t=l=s,n=0;n<t.length;n++)(0,t[n])();return e}return f({type:W.INIT}),(o={dispatch:f,subscribe:p,getState:d,replaceReducer:function(e){if("function"!=typeof e)throw new Error(B(10));a=e,f({type:W.REPLACE})}})[H]=function(){var e,t=p;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(B(11));function n(){e.next&&e.next(d())}return n(),{unsubscribe:t(n)}}})[H]=function(){return this},e},o}((e=it,t)=>{var n,r,o,a,i,l,s,c,u,d,p,f,h,m;switch(t.type){case V:return{...e,maps:{...e.maps,[t.map.mapId]:t.map}};case G:return{...e,maps:{}};case K:return{...e,title:it.title,description:it.description,infoUrl:it.infoUrl,backgroundImageUrl:void 0,pixelatedBackground:void 0,bannerImageUrl:void 0,alternateSourceUrls:void 0,theme:{...it.theme}};case Q:return{...e,selectedItem:{mapId:t.mapId,activityId:t.activityId}};case Y:return{...e,user:{...e.user,mapProgress:{...e.user.mapProgress,[e.pageSourceUrl]:{...null===(n=e.user.mapProgress)||void 0===n?void 0:n[e.pageSourceUrl],[t.mapId]:{...null===(r=e.user.mapProgress)||void 0===r||null===(o=r[e.pageSourceUrl])||void 0===o?void 0:o[t.mapId],completionState:"completed"}}}}};case X:return{...e,editorView:{currentMapId:t.mapId,currentActivityId:t.activityId,state:"active",allowCodeCarryover:!!t.carryoverCode,previousHeaderId:t.previousHeaderId,currentHeaderId:null===(a=Qe(e.user,e.pageSourceUrl,t.mapId,t.activityId))||void 0===a?void 0:a.headerId}};case ee:return{...e,editorView:{...e.editorView,state:"saving"}};case J:const g=e.maps[e.editorView.currentMapId],y=e.editorView.currentActivityId,v=t.finished?function(e,t){const n=[e.activities[t]],r=e.activities[t].next.filter(e=>nt(e));return n.concat(r)}(g,y):[],b=v.find(e=>nt(e)),k=b&&(null===(i=e.user.mapProgress[e.pageSourceUrl])||void 0===i||null===(l=i[g.mapId])||void 0===l?void 0:l.activityState[b.activityId]);return{...e,selectedItem:b&&!k?{mapId:g.mapId,activityId:b.activityId}:e.selectedItem,editorView:void 0,user:t.finished?st(e.user,e.pageSourceUrl,g,v.map(e=>e.activityId)):e.user};case te:return{...e,modalQueue:[],editorView:{state:"active",currentMapId:t.mapId,currentActivityId:t.activityId,allowCodeCarryover:!!t.carryoverCode,previousHeaderId:t.previousHeaderId},user:lt(e.user,e.pageSourceUrl,e.maps[t.mapId],t.activityId)};case Z:const w=(null===(s=e.editorView)||void 0===s?void 0:s.currentActivityId)===t.activityId&&(null===(c=e.editorView)||void 0===c?void 0:c.currentMapId)===t.mapId;return{...e,editorView:w?{...e.editorView,currentHeaderId:t.id}:e.editorView,user:lt(e.user,e.pageSourceUrl,e.maps[t.mapId],t.activityId,t.id,t.currentStep,t.maxSteps,t.isCompleted)};case ne:const x=e.pageSourceUrl;let S=function(e,t,n,r){const o=pxt.semver.parse(e.version||"0.0.0"),a=pxt.semver.parse(t);let i=e;if(0===pxt.semver.cmp(o,a))return i;if(0===pxt.semver.cmp(o,pxt.semver.parse("0.0.0"))){let t=(null==e?void 0:e.mapProgress)&&Object.keys(null==e?void 0:e.mapProgress);if((null==t?void 0:t.length)>0&&e.mapProgress[t[0]].activityState){const t=e,o={};Object.keys(r).forEach(e=>{t.mapProgress[e]&&(o[e]=t.mapProgress[e])}),i={...t,mapProgress:{[n]:o}}}}return i}(t.user,pxt.skillmap.USER_VERSION,x,e.maps);return e.alternateSourceUrls&&(S=function(e,t,n){if(0===n.length)return e;const r=e.mapProgress[t]||{};return n.forEach(t=>{const{cmd:n,arg:o}=Oe(t);let a=o;switch(n){case"github":const e=pxt.github.parseRepoId(o),t=e&&Me(e);a=(null==t?void 0:t.identifier)||o;break;case"docs":a=Re(o)}let i=e.mapProgress[a];i&&Object.keys(i).forEach(e=>{if(r[e]){const t=i[e].activityState;Object.keys(t).forEach(n=>{r[e].activityState[n]||(r[e].activityState[n]=t[n])})}else r[e]=i[e]})}),{...e,mapProgress:{...e.mapProgress,[t]:r}}}(S,x,e.alternateSourceUrls)),S.mapProgress[x]||(S.mapProgress[x]={}),Object.keys(e.maps).forEach(e=>{S.mapProgress[x][e]||(S.mapProgress[x][e]={completionState:"incomplete",mapId:e,activityState:{}})}),{...e,user:S};case oe:return pxt.storage.removeLocal(e.pageSourceUrl+Pe),{...e,user:{...e.user,completedTags:{...e.user.completedTags,[e.pageSourceUrl]:{}},mapProgress:{...e.user.mapProgress,[e.pageSourceUrl]:{}}}};case re:return e.pageSourceUrl?{...e,user:{...e.user,completedTags:{...e.user.completedTags,[e.pageSourceUrl]:Ve(e.user,e.pageSourceUrl,Object.keys(e.maps).map(t=>e.maps[t]))}}}:e;case xe:return{...e,shareState:t.headerId||t.url?{headerId:t.headerId,projectName:t.projectName,data:t.data,rewardsShare:null===(u=e.shareState)||void 0===u?void 0:u.rewardsShare}:void 0};case Se:return{...e,cloudState:{...e.cloudState,[t.headerId]:t.status}};case ae:return{...e,title:t.title};case ie:return{...e,description:t.description};case le:return{...e,infoUrl:t.infoUrl};case se:return{...e,backgroundImageUrl:t.backgroundImageUrl,pixelatedBackground:t.pixelatedBackground};case ce:return{...e,bannerImageUrl:t.bannerImageUrl};case ue:return{...e,theme:t.theme};case de:return{...e,pageSourceUrl:t.url,pageSourceStatus:t.status};case pe:return{...e,alternateSourceUrls:t.urls};case fe:return{...e,shareState:void 0!==t.rewardsShare?{headerId:(null===(d=e.shareState)||void 0===d?void 0:d.headerId)||"",projectName:(null===(p=e.shareState)||void 0===p?void 0:p.projectName)||"",data:null===(f=e.shareState)||void 0===f?void 0:f.data,rewardsShare:t.rewardsShare}:e.shareState,modalQueue:[t.modal]};case"ENQUEUE_MODALS":return{...e,modalQueue:t.modals};case he:return{...e,modalQueue:null===(h=e.modalQueue)||void 0===h?void 0:h.slice(1)};case me:return{...e,modalQueue:[]};case ge:return{...e,modalQueue:ct(e.maps[t.mapId],t.activityId)};case ke:return{...e,showProfile:!0};case we:return{...e,showProfile:!1};case ye:return{...e,auth:{...e.auth,profile:t.profile,signedIn:!(null===(m=t.profile)||void 0===m||!m.id)}};case Ee:return{...e,showSelectLanguage:!0};case Ie:return{...e,showSelectLanguage:!1};case Te:return{...e,showSelectTheme:!0};case je:return{...e,showSelectTheme:!1};case ve:return{...e,auth:{...e.auth,preferences:t.preferences}};case be:return{...e,auth:{...e.auth,signedIn:!1}};case Ce:return{...e,readyResources:t.resources};case"GRANT_SKILLMAP_BADGE":return{...e};case Ne:return{...e,showFeedback:!0};case Ae:return{...e,showFeedback:!1};default:return e}}),dt=(e,t)=>({type:Q,mapId:e,activityId:t}),pt=(e,t,n,r)=>({type:X,mapId:e,activityId:t,previousHeaderId:n,carryoverCode:r}),ft=()=>({type:ee}),ht=(e,t,n,r)=>({type:te,mapId:e,activityId:t,previousHeaderId:n,carryoverCode:r}),mt=e=>({type:ve,preferences:e}),gt=()=>({type:ke}),yt=()=>({type:we}),vt=()=>({type:Ne}),bt=(e,t,n)=>({type:xe,headerId:e,projectName:t,data:n}),kt=(e,t)=>({type:ge,mapId:e,activityId:t}),wt=(e,t,n)=>St({type:"share",currentMapId:e,currentActivityId:t},n),xt=()=>St({type:"login"}),St=(e,t)=>({type:fe,modal:e,rewardsShare:t});let Ct,Et,It;function Tt(){return Et||(Ct=new pxt.skillmap.IndexedDBWorkspace,Et=Ct.initAsync().then(e=>Ct)),Et}async function jt(){const e=await Tt();let t=await e.getUserStateAsync();return t||(t={id:Ue(),completedTags:{},mapProgress:{},version:pxt.skillmap.USER_VERSION}),t}async function Nt(){let e=await jt();if(await _t()){const t=await async function(){const e=await Ot();if(e){const t=await e.userPreferencesAsync();return null==t?void 0:t.skillmap}}();e={...e,mapProgress:(null==t?void 0:t.mapProgress)||{},completedTags:(null==t?void 0:t.completedTags)||{}}}return e}async function At(e){var t;if(e.isDebug)return;const n=await Tt();await(null===(t=pxt.auth.client())||void 0===t?void 0:t.loggedInAsync())||await n.saveUserStateAsync(e),await async function(e){const t=await Ot(),n=ut.getState().pageSourceUrl;await(null==t?void 0:t.patchUserPreferencesAsync({op:"replace",path:["skillmap"],value:e},{filter:e=>e.path.includes(n)}))}({mapProgress:e.mapProgress,completedTags:e.completedTags})}class Pt extends pxt.auth.AuthClient{onSignedIn(){return Promise.resolve()}onSignedOut(){return ut.dispatch({type:be}),Promise.resolve()}onSignInFailed(){return Promise.resolve()}async onUserProfileChanged(){const e=await pxt.auth.getUserStateAsync();var t;null!=e&&e.profile&&pxt.auth.generateUserProfilePicDataUrl(e.profile),ut.dispatch((t=e.profile,{type:ye,profile:t}))}async onUserPreferencesChanged(e){if(e.some(e=>"simulatorThemes"===e.path[0])){const e=await pxt.auth.getUserStateAsync();ut.dispatch(mt(e.preferences))}return Promise.resolve()}onStateCleared(){return Promise.resolve()}async onProfileDeleted(e){var t;const n=ut.getState();await(null===(t=n.readyResources)||void 0===t?void 0:t.exportCloudProjectsToLocal(e))}onApiError(e){return Promise.resolve()}async logoutAsync(e){const t=ut.getState().user;await At(t),super.logoutAsync(e)}}async function Ot(){if(pxt.auth.hasIdentity())return It||(It=new Promise(async(e,t)=>{const n=new Pt;await n.initAsync(),await n.authCheckAsync(),await n.initialUserPreferencesAsync(),e(n)}),It)}async function _t(){const e=await Ot();return await(null==e?void 0:e.loggedInAsync())}async function Rt(e){const t=await Ot();return await(null==t?void 0:t.logoutAsync(e))}async function Mt(){const e=await Ft();var t;if(e)return null==e||null===(t=e.colorThemeIds)||void 0===t?void 0:t[pxt.appTarget.id]}async function Lt(){const e=await Ft();return null==e?void 0:e.highContrast}async function Ut(){const e=await Ft();if(e){var t;const n=null===(t=e.simulatorThemes)||void 0===t?void 0:t[pxt.appTarget.id];return pxt.auth.isValidSimulatorThemePreference(n)?n:void 0}const n=pxt.U.jsonTryParse(pxt.storage.getLocal(pxt.auth.SIMULATOR_THEMES_LOCAL_STORAGE_KEY)),r=null==n?void 0:n[pxt.appTarget.id];return pxt.auth.isValidSimulatorThemePreference(r)?r:void 0}async function Dt(e){if(e&&!pxt.auth.isValidSimulatorThemePreference(e))return;const t=await Ot(),n=pxt.appTarget.id;if(t){const r=await t.userPreferencesAsync(),o={...null==r?void 0:r.simulatorThemes};e?o[n]=e:delete o[n],await t.patchUserPreferencesAsync({op:"replace",path:["simulatorThemes"],value:o},{immediate:!0})}else{var r;const t=null!==(r=pxt.U.jsonTryParse(pxt.storage.getLocal(pxt.auth.SIMULATOR_THEMES_LOCAL_STORAGE_KEY)))&&void 0!==r?r:{};e?t[n]=e:delete t[n],pxt.storage.setLocal(pxt.auth.SIMULATOR_THEMES_LOCAL_STORAGE_KEY,JSON.stringify(t))}}async function Ft(){const e=await Ot();if(e)return await e.userPreferencesAsync()}async function zt(e,t={}){const n=await Ot();return await(null==n?void 0:n.patchUserPreferencesAsync(e,t))}var $t=n(465);function Bt(e,...t){const n=[];e.replace(/\{\d\}/g,e=>(n.push(parseInt(e.substr(1,1))),e));const r=[];let o,a=0;for(const i of n)o=e.split(`{${i}}`),pxt.U.assert(2===o.length),r.push((0,$t.jsx)("span",{children:o[0]},a++)),r.push((0,$t.jsx)("span",{children:t[i]},a++)),e=o[1];return r.push((0,$t.jsx)("span",{children:e},a++)),r}function Ht(e){const t="number"==typeof e.which?e.which:e.keyCode;13!==t&&32!==t||(e.preventDefault(),e.stopPropagation(),e.currentTarget.click())}function qt(...e){return e.filter(e=>"string"==typeof e).reduce((e,t)=>e.concat(t.split(" ")),[]).map(e=>e.trim()).filter(e=>!!e).join(" ")}let Wt=function(e){return e[e.Selected=0]="Selected",e[e.Unselected=1]="Unselected",e[e.Waiting=2]="Waiting",e}({});function Vt(e,t,n,r,o,a=!0){const i=r?1:-1,l=e[n=Math.max(0,Math.min(e.length-1,n))];if(t===n)return l;if(o?o(l):Kt(l))return l;if(n+i>=e.length){if(!a)return l;n=0}else if(n+i<0){if(!a)return l;n=e.length-1}else n+=i;return Vt(e,t,n,r,o,a)}function Gt(e,t){if(!Kt(e))return[];const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,e=>Kt(e,!1)?t(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP:NodeFilter.FILTER_REJECT),r=[];let o=n.nextNode();for(;o;)r.push(o),o=n.nextNode();return r}function Kt(e,t=!0){if(e.checkVisibility)return e.checkVisibility({visibilityProperty:!0});const n=getComputedStyle(e);return"none"!==n.display&&"hidden"!==n.visibility&&(!t||!e.parentElement||Kt(e.parentElement,t))}function Qt(e){return!function(e){return!(!e||!e.hasAttribute("disabled"))}(e)&&!!(e.hasAttribute("tabindex")||"A"===e.tagName&&(e.hasAttribute("href")||e.hasAttributeNS("xlink","href"))||"BUTTON"===e.tagName||"INPUT"===e.tagName||"SELECT"===e.tagName||"TEXTAREA"===e.tagName||"IFRAME"===e.tagName||"EMBED"===e.tagName||"OBJECT"===e.tagName||"DIV"===e.tagName&&e.hasAttribute("contenteditable")&&"false"!==e.getAttribute("contenteditable")||("AUDIO"===e.tagName||"VIDEO"===e.tagName)&&e.hasAttribute("controls"))}function Yt(e){return!!Qt(e)&&(!e.hasAttribute("tabindex")||parseInt(e.getAttribute("tabindex"))>=0)}const Zt=e=>{const t=Jt(e);return(0,$t.jsx)("button",{...t,children:(0,$t.jsx)(Xt,{...e})})},Xt=e=>{const{label:t,labelClassName:n,leftIcon:r,rightIcon:o,children:a}=e;return(0,$t.jsxs)($t.Fragment,{children:[(r||o||t)&&(0,$t.jsxs)("span",{className:"common-button-flex",children:[r&&(0,$t.jsx)("i",{className:r,"aria-hidden":!0}),(0,$t.jsx)("span",{className:qt("common-button-label",n),children:t}),o&&(0,$t.jsx)("i",{className:"right "+o,"aria-hidden":!0})]}),a]})};function Jt(e){const{onClick:t,onClickEvent:n,onRightClick:r,onKeydown:o,onBlur:a,onFocus:i,onMouseDown:l,buttonRef:s,target:c,href:u,hardDisabled:d}=e;let{disabled:p}=e;return p=p||d,{...en(e),ref:s,onClick:p?void 0:e=>{n&&n(e),t&&t(),u&&window.open(u,c||"_blank","noopener,noreferrer"),e.stopPropagation(),e.preventDefault()},onContextMenu:e=>{r&&(r(),e.stopPropagation(),e.preventDefault())},onKeyDown:o||Ht,onBlur:a,onFocus:i,onMouseDown:l}}function en(e){const{id:t,className:n,style:r,ariaLabel:o,ariaHidden:a,ariaDescribedBy:i,ariaControls:l,ariaExpanded:s,ariaHasPopup:c,ariaPosInSet:u,ariaSetSize:d,ariaSelected:p,ariaPressed:f,role:h,title:m,type:g,hardDisabled:y,tabIndex:v,autoFocus:b}=e;let{disabled:k}=e;return k=k||y,{id:t,className:qt("common-button",n,k&&"disabled"),style:r,title:m,type:g,role:h||"button",tabIndex:v||(k?-1:0),autoFocus:b,disabled:y,"aria-label":o,"aria-hidden":a,"aria-controls":l,"aria-expanded":s,"aria-haspopup":c,"aria-posinset":u,"aria-setsize":d,"aria-describedby":i,"aria-selected":p,"aria-pressed":f}}const tn=e=>{const{id:t,className:n,role:r,ariaHidden:o,ariaLabel:a,ariaLabelledby:i,ariaDescribedBy:l,childTabStopId:s,children:c,focusSelectsItem:u,onItemReceivedFocus:d,useUpAndDownArrowKeys:p,title:f,onClose:h}=e;let m,g;const y=e=>"true"===e.getAttribute("data-isfocusable")&&null!==e.offsetParent;return(0,$t.jsx)("div",{id:t,className:n,role:r,tabIndex:s?void 0:0,onKeyDown:e=>{var t;if(null===(t=m)||void 0===t||!t.length)return;const n=document.activeElement,r=m.indexOf(n),o=e=>{e.click?e.click():e.dispatchEvent(new Event("click"))},a=e=>{e.focus(),d&&d(e),u&&o(e)};if(-1===r&&n!==g)return;let i,l;p?(i="ArrowUp",l="ArrowDown"):pxt.Util.isUserLanguageRtl()?(i="ArrowRight",l="ArrowLeft"):(i="ArrowLeft",l="ArrowRight"),u||"Enter"!==e.key&&" "!==e.key?e.key===l?(r===m.length-1||n===g?a(Vt(m,r,0,!0,y)):a(Vt(m,r,r+1,!0,y)),e.preventDefault(),e.stopPropagation()):e.key===i?(a(Vt(m,r,0===r||n===g?m.length-1:r-1,!1,y)),e.preventDefault(),e.stopPropagation()):"Home"===e.key?(a(Vt(m,r,0,!0,y)),e.preventDefault(),e.stopPropagation()):"End"===e.key?(a(Vt(m,r,m.length-1,!0,y)),e.preventDefault(),e.stopPropagation()):"Escape"===e.key&&h&&(h(),e.preventDefault(),e.stopPropagation()):(e.preventDefault(),e.stopPropagation(),o(n))},ref:e=>{if(!e||g)return;g=e;const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]),[data-isfocusable]');m=[];for(const e of t.values())m.push(e),e.setAttribute("tabindex","-1"),e.setAttribute("data-isfocusable","true");if(s){const e=g.querySelector("#"+s);e&&e.setAttribute("tabindex","0")}},"aria-hidden":o,"aria-label":a,"aria-labelledby":i,"aria-describedby":l,title:f,children:c})},nn=e=>(0,$t.jsx)(tn,{...e,role:"menubar",className:qt("common-menubar",e.className)}),rn=e.createContext(null),on=e.createContext(null),an=({children:t})=>{const[n,r]=e.useReducer(ln,{regions:[]});return(0,$t.jsx)(rn.Provider,{value:n,children:(0,$t.jsx)(on.Provider,{value:r,children:t})})};function ln(e,t){let n=e.regions.slice();switch(t.type){case"ADD_REGION":const r={id:t.id,enabled:t.enabled,order:t.order,onEscape:t.onEscape},o=n.findIndex(e=>e.id===t.id);-1!==o?n.splice(o,1,r):n.push(r);break;case"REMOVE_REGION":const a=e.regions.findIndex(e=>e.id===t.id);-1!==a&&n.splice(a,1)}return{regions:n}}const sn=e=>(0,$t.jsx)(an,{children:(0,$t.jsx)(cn,{...e})}),cn=t=>{const{children:n,id:r,className:o,onEscape:a,arrowKeyNavigation:i,dontStealFocus:l,includeOutsideTabOrder:s,dontRestoreFocus:c,dontTrapFocus:u,focusFirstItem:d,tagName:p,role:f,ariaLabelledby:h,ariaLabel:m,ariaHidden:g,ariaModal:y}=t,v=e.useRef(null),b=e.useRef(document.activeElement),[k,w]=e.useState(!1),x=e.useRef(null),{regions:S}=e.useContext(rn);e.useEffect(()=>()=>{!c&&b.current&&function(e){for(;e&&(!Qt(t=e)||!Kt(t));){const t=e.parentElement;if(!t)break;e=t}var t;e.focus()}(b.current)},[]);const C=e.useCallback(()=>{let e=s?Gt(v.current,Qt):function(e){return Gt(e,Yt)}(v.current);if(S.length){const n={};for(const e of S){var t;const r=null===(t=v.current)||void 0===t?void 0:t.querySelector(`[data-focus-trap-region="${e.id}"]`);r&&(n[e.id]=r)}for(const t of S){const r=n[t.id];!t.enabled&&r&&(e=e.filter(e=>!r.contains(e)))}const r=e.slice();e.sort((e,t)=>{const o=S.find(t=>{var r;return t.enabled&&(null===(r=n[t.id])||void 0===r?void 0:r.contains(e))}),a=S.find(e=>{var r;return e.enabled&&(null===(r=n[e.id])||void 0===r?void 0:r.contains(t))});return(null==o?void 0:o.order)===(null==a?void 0:a.order)?r.indexOf(e)-r.indexOf(t):o?a?o.order-a.order:-1:1})}return e},[S,s]),E=e.useCallback(e=>{if(!e)return;v.current=e;const t=C();l||k||e.contains(document.activeElement)||!t.length||(v.current.focus(),d&&Vt(t,-1,0,!0).focus(),w(!0))},[C,l,k,d]),I=e.useCallback(e=>{if(!v.current)return;const t=(t,n)=>{const r=C();if(!r.length)return;let o,a=r.indexOf(e.target);a<0&&(a=r.indexOf(x.current)),o=t?n?Vt(r,a,r.length-1,t):a===r.length-1?Vt(r,a,0,t):Vt(r,a,a+1,t):Vt(r,a,n?0:0===a?r.length-1:Math.max(a-1,0),t),x.current=o,o.focus(),e.preventDefault(),e.stopPropagation()};if("Escape"===e.key){let t=!1;if(S.length)for(const e of S){var n;if(!e.onEscape)continue;const r=null===(n=v.current)||void 0===n?void 0:n.querySelector(`[data-focus-trap-region="${e.id}"]`);if(null!=r&&r.contains(document.activeElement)){t=!0,e.onEscape();break}}t||a(),e.preventDefault(),e.stopPropagation()}else"Tab"===e.key?u?a():e.shiftKey?t(!1,!1):t(!0,!1):i&&("ArrowDown"===e.key?t(!0,!1):"ArrowUp"===e.key?t(!1,!1):"Home"===e.key?t(!1,!0):"End"===e.key&&t(!0,!0))},[C,a,i,S,u]);return e.createElement(p||"div",{id:r,className:qt("common-focus-trap",o),ref:E,onKeyDown:I,role:f,tabIndex:-1,"aria-labelledby":h,"aria-label":m,"aria-hidden":g,"aria-modal":y},n)},un=e=>{const{id:t,className:n,ariaHidden:r,ariaLabel:o,role:a,isChecked:i,onChange:l,label:s,style:c,tabIndex:u}=e;return(0,$t.jsxs)("div",{className:qt("common-checkbox",n,"toggle"===c&&"toggle"),children:[(0,$t.jsx)("input",{id:t,tabIndex:null!=u?u:0,type:"checkbox",checked:i,onChange:()=>{l(!i)},onKeyDown:Ht,role:a,"aria-hidden":r,"aria-label":o}),s&&(0,$t.jsx)("label",{htmlFor:t,children:s})]})},dn=e=>{const{isChecked:t}=e;return(0,$t.jsx)("span",{className:qt("common-checkbox-icon",t&&"checked"),children:t&&(0,$t.jsx)("i",{className:"fas fa-check"})})},pn=t=>{const{id:n,className:r,ariaHidden:o,ariaLabel:a,role:i,items:l,label:s,title:c,icon:u,showChevron:d,tabIndex:p,disabled:f,keepOpenOnCheckboxChange:h}=t,[m,g]=e.useState(!1),y=e.useRef(!1);let v,b;e.useEffect(()=>{if(m&&v&&y.current){const e=v.querySelector("[role=menu]");if(!e)return;const t=e.querySelectorAll("[role=menuitem], [role=menuitemcheckbox], [role=menuitemradio]");for(const e of t){const t=e;if(null!==t.offsetParent){t.focus();break}}}},[m]);const k=()=>{g(!1),b&&b.focus()},w=qt("common-menu-dropdown",r),x=n+"-menu",S=function(e){const t=[];let n={items:[]};for(const r of e)"separator"===r.role?(n.className=r.className,n.items.length>0&&(t.push(n),n={items:[]})):n.items.push(r);return n.items.length>0&&t.push(n),t}(l);return(0,$t.jsxs)("div",{className:w,ref:e=>{e&&(v=e)},onBlur:e=>{v&&m&&!v.contains(e.relatedTarget)&&g(!1)},children:[(0,$t.jsx)(Zt,{id:n,label:s,tabIndex:p,buttonRef:e=>{e&&(b=e)},title:c,leftIcon:u,rightIcon:d?m?"fas fa-chevron-up":"fas fa-chevron-down":void 0,role:i||"button",className:qt("menu-button",m&&"expanded"),onClick:null,onClickEvent:e=>{y.current=0===e.detail,g(!m)},ariaHasPopup:"true",ariaExpanded:m,ariaControls:m?x:void 0,ariaLabel:a,ariaHidden:o,disabled:f,onKeydown:e=>{"ArrowDown"!==e.key||m||(y.current=!0,g(!0))}}),m&&(0,$t.jsx)(sn,{role:"menu",className:"common-menu-dropdown-pane",id:x,arrowKeyNavigation:!0,onEscape:()=>{g(!1),b&&b.focus()},includeOutsideTabOrder:!0,dontTrapFocus:!0,dontRestoreFocus:!0,focusFirstItem:!1,ariaLabelledby:n,tagName:"ul",children:S.map((t,n)=>(0,$t.jsxs)(e.Fragment,{children:[t.items.map((t,r)=>{const o=`${n}-${r}`;return"menuitem"===t.role?(0,e.createElement)(fn,{...t,key:o,onClick:()=>{var e;k(),null===(e=t.onClick)||void 0===e||e.call(t)}}):"link"===t.role?(0,e.createElement)(mn,{...t,key:o,onClick:()=>{var e;k(),null===(e=t.onClick)||void 0===e||e.call(t)}}):(0,e.createElement)(hn,{...t,key:o,onChange:e=>{var n;h||k(),null===(n=t.onChange)||void 0===n||n.call(t,e)}})}),n<S.length-1&&(0,$t.jsx)("li",{role:"separator",className:qt("common-menu-dropdown-separator",t.className)})]},n))})]})},fn=e=>{const t=Jt(e);return(0,$t.jsx)("li",{...t,className:qt("common-menu-dropdown-item",t.className),role:"menuitem",tabIndex:-1,children:(0,$t.jsx)(Xt,{...e})})},hn=e=>{const{label:t,isChecked:n,onChange:r,id:o,className:a,ariaLabel:i,ariaHidden:l,ariaDescribedBy:s}=e;return(0,$t.jsxs)("li",{role:"menuitemcheckbox",tabIndex:-1,className:qt("common-menu-dropdown-item","common-menu-dropdown-checkbox-item",a),"aria-label":i,"aria-hidden":l,"aria-describedby":s,"aria-checked":n?"true":"false",onClick:()=>r(!n),onKeyDown:Ht,id:o,children:[(0,$t.jsx)(dn,{isChecked:n}),(0,$t.jsx)("span",{children:t})]})},mn=e=>{const{href:t,label:n,id:r,className:o,ariaLabel:a,ariaHidden:i,ariaDescribedBy:l,onClick:s}=e;return(0,$t.jsx)("li",{role:"none",children:(0,$t.jsx)("a",{role:"menuitem",className:qt("common-menu-dropdown-item","common-menu-dropdown-link-item",o),"aria-label":a,"aria-hidden":i,"aria-describedby":l,id:r,tabIndex:-1,href:t,target:"_blank",rel:"noopener noreferrer",onClick:s,onKeyDown:Ht,children:n})})};class gn extends e.Component{constructor(...e){super(...e),this.reportAbuseUrl="https://github.com/contact/report-content",this.avatarPicUrl=()=>{var e,t,n,r;const{profile:o}=this.props;return null!==(e=null==o||null===(t=o.idp)||void 0===t?void 0:t.pictureUrl)&&void 0!==e?e:null==o||null===(n=o.idp)||void 0===n||null===(r=n.picture)||void 0===r?void 0:r.dataUrl},this.onBackClicked=()=>{const{currentMapId:e,currentActivityId:t}=this.props;Be("skillmap.activity.back",{path:e||"",activity:t||""}),this.props.dispatchSaveAndCloseActivity()},this.onHomeClicked=()=>{Be("skillmap.home");const e=pxt.U.getHomeUrl();e&&window.open(e)},this.onFeedbackClicked=()=>{Be("skillmap.feedbackclicked"),this.props.dispatchShowFeedback()},this.onLogoutClicked=async()=>{pxt.tickEvent("skillmap.usermenu.signout"),await Rt(location.hash)},this.onProfileClicked=()=>{pxt.tickEvent("skillmap.profile"),this.props.dispatchShowUserProfile()}}getSettingItems(){const e=[];return this.props.preferences&&e.push({role:"menuitem",id:"theme",title:lf("Theme"),label:lf("Theme"),onClick:()=>{Be("skillmap.theme"),this.props.dispatchShowSelectTheme()}}),this.props.activityOpen||e.push({role:"menuitem",id:"language",title:lf("Language"),label:lf("Language"),onClick:()=>{Be("skillmap.language"),this.props.dispatchShowSelectLanguage()}}),this.props.showReportAbuse&&e.push({role:"link",id:"report",label:lf("Report Abuse"),href:this.reportAbuseUrl,onClick:()=>Be("skillmap.reportabuse")}),pxt.U.ocvEnabled()&&e.push({role:"menuitem",id:"feedback",title:lf("Feedback"),label:lf("Feedback"),onClick:this.onFeedbackClicked}),this.props.activityOpen||e.push({role:"menuitem",id:"reset",title:lf("Reset All"),label:lf("Reset All"),onClick:()=>{Be("skillmap.reset.warning"),this.props.dispatchShowResetUserModal()}}),e}getOrganizationLogo(e){const t=e.organizationWideLogo;return(0,$t.jsx)("div",{className:"header-logo","aria-hidden":"true",children:t?(0,$t.jsx)("img",{src:De()?`./assets/${t}`:t,alt:lf("{0} Logo",e.organization)}):(0,$t.jsx)("span",{className:"name",children:e.organization})})}getTargetLogo(e){const{activityOpen:t}=this.props,n=t&&e.useTextLogo;return(0,$t.jsx)("div",{className:"ui item logo brand "+(t?"":"noclick"),"aria-hidden":!n,children:e.useTextLogo?t?[(0,$t.jsx)(Zt,{className:"name menu-button",onClick:this.onBackClicked,title:lf("MakeCode logo, return to activity selection"),ariaLabel:lf("MakeCode logo, return to activity selection"),label:e.organizationText},"org-name"),(0,$t.jsx)(Zt,{className:"name-short menu-button",onClick:this.onBackClicked,title:lf("MakeCode logo, return to activity selection"),ariaLabel:lf("MakeCode logo, return to activity selection"),label:e.organizationShortText||e.organizationText},"org-name-short")]:[(0,$t.jsx)("span",{className:"name",children:e.organizationText},"org-name"),(0,$t.jsx)("span",{className:"name-short",children:e.organizationShortText||e.organizationText},"org-name-short")]:e.logo||e.portraitLogo?(0,$t.jsx)("img",{className:"logo",src:e.logo||e.portraitLogo,alt:lf("{0} Logo",e.boardName)}):(0,$t.jsxs)("span",{className:"name",children:[" ",e.boardName]})})}getHelpItems(){return[]}getUserMenu(){const{signedIn:e,profile:t}=this.props,n=[];e&&(n.push({role:"menuitem",id:"profile",title:lf("My Profile"),label:lf("My Profile"),onClick:this.onProfileClicked}),n.push({role:"menuitem",id:"signout",title:lf("Sign Out"),label:lf("Sign Out"),onClick:this.onLogoutClicked}));const r=this.avatarPicUrl()?(0,$t.jsx)("div",{className:"avatar",children:(0,$t.jsx)("img",{src:this.avatarPicUrl(),alt:lf("Profile Image"),referrerPolicy:"no-referrer","aria-hidden":"true"})}):void 0,o=(0,$t.jsx)("span",{children:(0,$t.jsx)("div",{className:"avatar-initials","aria-hidden":"true",children:pxt.auth.userInitials(t)})});return(0,$t.jsx)("div",{className:"user-menu",children:e?(0,$t.jsx)(pn,{id:"profile-dropdown",items:n,label:r||o,title:lf("Profile Settings")}):(0,$t.jsx)(Zt,{className:"menu-button",role:"menuitem",rightIcon:"xicon cloud-user",title:lf("Sign In"),label:lf("Sign In"),onClick:()=>{pxt.tickEvent("skillmap.usermenu.signin"),this.props.dispatchShowLoginModal()}})})}render(){var e;const{activityOpen:t}=this.props,n=pxt.auth.hasIdentity(),r=null===(e=pxt.appTarget)||void 0===e?void 0:e.appTheme,o=this.getSettingItems(),a=this.getHelpItems();return(0,$t.jsxs)(nn,{className:"header",ariaLabel:lf("Header"),children:[(0,$t.jsxs)("div",{className:"header-left",children:[this.getOrganizationLogo(r),this.getTargetLogo(r)]}),(0,$t.jsx)("div",{className:"spacer"}),(0,$t.jsxs)("div",{className:"header-right",children:[t&&(0,$t.jsx)(Zt,{className:"menu-button",role:"menuitem",leftIcon:"fas fa-arrow-left large",title:lf("Return to activity selection"),onClick:this.onBackClicked}),(0,$t.jsx)(Zt,{className:"menu-button",role:"menuitem",leftIcon:"fas fa-home large",title:lf("Return to the editor homepage"),onClick:this.onHomeClicked}),(null==a?void 0:a.length)>0&&(0,$t.jsx)(pn,{id:"skillmap-help",title:lf("Help menu"),icon:"fas fa-question-circle large",items:a}),(null==o?void 0:o.length)>0&&(0,$t.jsx)(pn,{id:"settings-help",title:lf("Settings menu"),icon:"fas fa-cog large",items:o}),n&&this.getUserMenu()]})]})}}const yn=z(function(e,t){var n,r,o,a;if(!e)return{};let i;null!==(n=e.editorView)&&void 0!==n&&n.currentHeaderId&&qe(e.user,e.pageSourceUrl,e.editorView.currentMapId,e.editorView.currentActivityId)&&(i=e.editorView.currentHeaderId);const l=!!e.editorView;var s;return null!==(r=e.editorView)&&void 0!==r&&r.currentActivityId&&(null===(s=e.maps[e.editorView.currentMapId])||void 0===s||s.activities[e.editorView.currentActivityId]),{activityOpen:l,currentMapId:l&&(null===(o=e.editorView)||void 0===o?void 0:o.currentMapId),currentActivityId:l&&(null===(a=e.editorView)||void 0===a?void 0:a.currentActivityId),showReportAbuse:"unknown"===e.pageSourceStatus,signedIn:e.auth.signedIn,profile:e.auth.profile,preferences:e.auth.preferences}},{dispatchSaveAndCloseActivity:ft,dispatchShowResetUserModal:()=>St({type:"reset"}),dispatchShowLoginModal:xt,dispatchShowUserProfile:gt,dispatchSetUserPreferences:mt,dispatchShowSelectLanguage:()=>({type:Ee}),dispatchShowSelectTheme:()=>({type:Te}),dispatchShowFeedback:vt})(gn),vn=e=>{const{value:t,max:n,id:r,className:o,title:a,label:i,role:l,ariaHidden:s,ariaLabel:c,ariaDescribedBy:u,ariaValueText:d}=e;return(0,$t.jsxs)("div",{className:qt("common-progressbar-wrapper",o),children:[i&&(0,$t.jsx)("label",{className:"common-progressbar-label",children:i}),(0,$t.jsx)("progress",{className:"common-progressbar",value:t,"aria-valuetext":d,max:n||100,id:r,role:l||"progressbar",title:a,"aria-label":c,"aria-describedby":u,"aria-hidden":s})]})};class bn{constructor(e){this.currentTheme=void 0,this.subscribers=void 0,this.document=void 0,this.document=e}static getInstance(e=document){return bn.instances.has(e)||bn.instances.set(e,new bn(e)),bn.instances.get(e)}static isCurrentThemeHighContrast(e=document){var t;const n=bn.getInstance(e);return n.isHighContrast(null===(t=n.getCurrentColorTheme())||void 0===t?void 0:t.id)}getCurrentColorTheme(){return this.currentTheme}isKnownTheme(e){var t,n;return!(null===(t=pxt.appTarget)||void 0===t||null===(n=t.colorThemeMap)||void 0===n||!n[e])}getAllColorThemes(){var e;return(null!==(e=pxt.appTarget)&&void 0!==e&&e.colorThemeMap?Object.values(pxt.appTarget.colorThemeMap):[]).sort((e,t)=>{var n,r;return e.weight!==t.weight?(null!==(n=e.weight)&&void 0!==n?n:1/0)-(null!==(r=t.weight)&&void 0!==r?r:1/0):e.id.localeCompare(t.id)})}isHighContrast(e){var t,n;return e&&e===(null===(t=pxt.appTarget)||void 0===t||null===(n=t.appTheme)||void 0===n?void 0:n.highContrastColorTheme)}performHighContrastWorkaround(e){this.isHighContrast(e)?(this.document.body.classList.add("high-contrast"),this.document.body.classList.add("hc")):(this.document.body.classList.remove("high-contrast"),this.document.body.classList.remove("hc"))}switchColorTheme(e){var t,n,r;if(e===(null===(t=this.getCurrentColorTheme())||void 0===t?void 0:t.id))return;const o=null===(n=pxt.appTarget)||void 0===n||null===(r=n.colorThemeMap)||void 0===r?void 0:r[e];if(o){const t=kn(o),n="theme-override";let r=this.document.getElementById(n);r||(r=this.document.createElement("style"),r.id=n,this.document.head.appendChild(r)),r.textContent=`.pxt-theme-root { ${t} }`,this.performHighContrastWorkaround(e),this.currentTheme=o,this.notifySubscribers()}}subscribe(e,t){var n;null!==(n=this.subscribers)&&void 0!==n&&n.some(t=>t.subscriberId===e)||(this.subscribers||(this.subscribers=[]),this.subscribers.push({subscriberId:e,onColorThemeChange:t}))}unsubscribe(e){this.subscribers=this.subscribers.filter(t=>t.subscriberId!==e)}notifySubscribers(){var e;null===(e=this.subscribers)||void 0===e||e.forEach(e=>e.onColorThemeChange())}}function kn(e){let t="";for(const[n,r]of Object.entries(e.colors))t+=`--${n}: ${r};\n`;return e.overrideCss&&(t+=`${e.overrideCss}\n`),t=DOMPurify.sanitize(t),t}bn.instances=new Map;const wn=De()?"http://localhost:3232/index.html":function(e){var t,n;if(!pxt.webConfig&&window.pxtConfig&&pxt.setupWebConfig(window.pxtConfig),null!==(t=pxt.webConfig)&&void 0!==t&&t.targetUrl&&null!==(n=pxt.webConfig)&&void 0!==n&&n.relprefix)return pxt.webConfig.targetUrl+pxt.webConfig.relprefix.substr(0,pxt.webConfig.relprefix.length-3);const r=/\/([\da-zA-Z\.]+)(?:--)?/i.exec(window.location.pathname);return`${e.replace(/\/$/,"")}/${(null==r?void 0:r[1])||""}`}(window.pxtTargetBundle.appTheme.embedUrl);class xn extends e.Component{constructor(e){super(e),this.ref=void 0,this.messageQueue=[],this.finishedActivityState=void 0,this.nextId=0,this.pendingMessages={},this.isNewActivity=!1,this.handleFrameRef=e=>{if(e&&e.contentWindow){window.addEventListener("message",this.onMessageReceived),this.ref=e,Sn(".usabilla_live_button_container",!1),Sn("footer",!1);const t=document.getElementById("root");t&&pxt.BrowserUtils.addClass(t,"editor")}},this.onMessageReceived=e=>{const t=e.data;if("opening-project"===this.state.frameState&&this.setState({loadPercent:Math.min((this.state.loadPercent||0)+7,95)}),"pxteditor"===t.type&&t.id&&this.pendingMessages[t.id])return this.pendingMessages[t.id].handler(t),void delete this.pendingMessages[t.id];switch(t.action){case"newproject":this.state.workspaceReady||(this.setState({workspaceReady:!0}),this.sendMessageAsync(),this.props.onWorkspaceReady(e=>this.sendMessageAsync(e))),"loading"===this.state.frameState&&this.setState({frameState:"no-project"});break;case"tutorialevent":this.handleTutorialEvent(t);break;case"projectcloudstatus":{const e=t;this.props.dispatchSetCloudStatus(e.headerId,e.status);break}}},this.state={frameState:"loading",workspaceReady:!1,loadPercent:0,pendingShare:!1},this.updateTheme=this.updateTheme.bind(this)}componentDidMount(){bn.getInstance(document).subscribe("skillmapframe",this.updateTheme)}async componentDidUpdate(){const{shareHeaderId:e}=this.props,{frameState:t,pendingShare:n}=this.state;"project-open"===t&&this.props.save?this.setState({frameState:"closing-project"},async()=>{await this.closeActivityAsync()}):"no-project"===t&&this.props.activityId&&this.setState({frameState:"opening-project",loadPercent:0},async()=>{await this.startActivityAsync()}),e&&!n&&this.setState({pendingShare:!0},async()=>{await this.shareProjectAsync()})}componentWillUnmount(){window.removeEventListener("message",this.onMessageReceived),Sn(".usabilla_live_button_container",!0),Sn("footer",!0);const e=document.getElementById("root");e&&pxt.BrowserUtils.removeClass(e,"editor")}render(){const{title:e,activityId:t,forcelang:n}=this.props,{frameState:r,loadPercent:o}=this.state,a=lf("Loading..."),i="opening-project"===r,l=i||"closing-project"===r;let s=wn;return"/"!==wn.charAt(wn.length-1)||De()||(s=wn.substr(0,wn.length-1)),s+="?controller=1&skillmap=1&noproject=1&nocookiebanner=1&ws=browser"+(n?`?forcelang=${n}`:""),(0,$t.jsxs)("div",{className:"makecode-frame-outer",style:{display:t?"block":"none"},children:[(0,$t.jsxs)("div",{className:"makecode-frame-loader "+(l?"":"hidden"),children:[(0,$t.jsx)("img",{src:Fe("assets/logo.svg"),alt:"MakeCode Logo"}),i&&(0,$t.jsx)(vn,{className:"makecode-frame-loader-bar",value:o}),(0,$t.jsx)("div",{className:"makecode-frame-loader-text",children:a})]}),(0,$t.jsx)("iframe",{className:"makecode-frame",src:s,title:e,ref:this.handleFrameRef})]})}updateTheme(){var e;const t=null===(e=bn.getInstance(document).getCurrentColorTheme())||void 0===e?void 0:e.id;this.sendMessageAsync({type:"pxteditor",action:"setcolorthemebyid",colorThemeId:t,savePreference:!0})}sendMessageAsync(e){return new Promise(t=>{const n=e=>{e.response=!0,e.id=this.nextId+++"",this.pendingMessages[e.id]={original:e,handler:t},this.ref.contentWindow.postMessage(e,"*")};if(this.ref)if(this.state.workspaceReady){for(;this.messageQueue.length;)n(this.messageQueue.shift());e&&n(e)}else this.messageQueue.push(e)})}async startActivityAsync(){this.props.activityHeaderId?await this.sendMessageAsync({type:"pxteditor",action:"openheader",headerId:this.props.activityHeaderId}):(this.isNewActivity=!0,await this.sendMessageAsync({type:"pxteditor",action:"startactivity",path:this.props.tutorialPath,title:this.props.title,activityType:"tutorial",carryoverPreviousCode:this.props.carryoverCode,previousProjectHeaderId:this.props.previousHeaderId}))}async closeActivityAsync(){await this.sendMessageAsync({type:"pxteditor",action:"saveproject"}),this.props.dispatchCloseActivity("finished"===this.finishedActivityState),this.props.dispatchUpdateUserCompletedTags(),this.finishedActivityState=void 0,await this.sendMessageAsync({type:"pxteditor",action:"unloadproject"}),this.setState({frameState:"no-project"})}async shareProjectAsync(){const{shareHeaderId:e,shareProjectName:t,dispatchSetShareStatus:n}=this.props;n(e,t,(await this.sendMessageAsync({type:"pxteditor",action:"shareproject",headerId:e,projectName:t})).resp),this.setState({pendingShare:!1})}handleTutorialEvent(e){const{dispatchSetHeaderIdForActivity:t,dispatchSaveAndCloseActivity:n,mapId:r,activityId:o,progress:a}=this.props;switch(e.tutorialEvent){case"progress":o&&t(r,o,e.projectHeaderId,e.currentStep+1,e.totalSteps,e.isCompleted||!(null==a||!a.isCompleted));break;case"loaded":this.onEditorLoaded();break;case"completed":this.onTutorialFinished();break;case"exit":n()}}onEditorLoaded(){const{mapId:e,activityId:t}=this.props;e&&t&&(Be("skillmap.activity.loaded",{path:e,activity:t}),this.setState({frameState:"project-open"}),this.isNewActivity&&(this.isNewActivity=!1))}onTutorialFinished(){const{mapId:e,activityId:t,signedIn:n,pageSourceUrl:r}=this.props;Be("skillmap.activity.complete",{path:e,activity:t}),this.finishedActivityState="finished",this.props.dispatchSaveAndCloseActivity();const o=pxt.storage.getLocal(r+Pe);n||o||(this.props.dispatchShowLoginPrompt(),pxt.storage.setLocal(r+Pe,"true"))}}function Sn(e,t){const n=document.querySelector(e);null!=n&&n.style&&(n.style.display=t?"":"none")}const Cn=z(function(e,t){var n,r,o;const a=null!==(n=e.shareState)&&void 0!==n&&n.data||null===(r=e.shareState)||void 0===r?void 0:r.headerId,i=null===(o=e.shareState)||void 0===o?void 0:o.projectName;if(!e||!e.editorView)return{shareHeaderId:a,shareProjectName:i};const{currentActivityId:l,currentMapId:s,currentHeaderId:c,state:u,allowCodeCarryover:d,previousHeaderId:p}=e.editorView;let f;const h=e.maps[s],m=null==h?void 0:h.activities[l];f=null==m?void 0:m.displayName;const g=Qe(e.user,e.pageSourceUrl,s,l);return{tutorialPath:m.url,title:f,mapId:s,activityId:l,activityHeaderId:c,activityType:m.type,carryoverCode:d,previousHeaderId:p,progress:g,save:"saving"===u,shareHeaderId:a,shareProjectName:i,signedIn:e.auth.signedIn,pageSourceUrl:e.pageSourceUrl}},{dispatchSetHeaderIdForActivity:(e,t,n,r,o,a)=>({type:Z,mapId:e,activityId:t,id:n,currentStep:r,maxSteps:o,isCompleted:a}),dispatchCloseActivity:(e=!1)=>({type:J,finished:e}),dispatchSaveAndCloseActivity:ft,dispatchUpdateUserCompletedTags:()=>({type:re}),dispatchSetShareStatus:bt,dispatchShowLoginPrompt:()=>St({type:"login-prompt"}),dispatchSetCloudStatus:(e,t)=>({type:Se,headerId:e,status:t})})(xn),En=n=>{const{children:r,id:o,className:a,ariaLabel:i,ariaHidden:l,ariaDescribedBy:s,role:c,title:u,hideTitle:d,leftIcon:p,actions:f,onClose:h,parentElement:m,fullscreen:g,hideDismissButton:y,rightHeader:v}=n,b=e=>{h&&h()},k=qt("common-modal-container",g&&"fullscreen",a),w=e.useRef(null);return e.useEffect(()=>{var e;const t=m||document.body,n=null===(e=w.current)||void 0===e?void 0:e.parentElement,r=[];for(const e of t.children)e!==n&&(e.hasAttribute("aria-hidden")&&"false"!==e.getAttribute("aria-hidden")||(e.setAttribute("aria-hidden","true"),r.push(e)));return()=>{for(const e of r)e.removeAttribute("aria-hidden")}},[m]),t.createPortal((0,$t.jsx)(sn,{className:k,onEscape:b,children:(0,$t.jsxs)("div",{id:o,className:"common-modal",ref:w,role:c||"dialog","aria-hidden":l,"aria-label":i,"aria-describedby":s,"aria-labelledby":"modal-title",children:[(0,$t.jsxs)("div",{className:"common-modal-header",children:[g&&!y&&(0,$t.jsx)("div",{className:"common-modal-back",children:(0,$t.jsx)(Zt,{className:"menu-button",onClick:b,title:lf("Go Back"),label:lf("Go Back"),leftIcon:"fas fa-arrow-left"})}),(0,$t.jsxs)("div",{id:"modal-title",className:qt("common-modal-title",d&&"sr-only"),children:[p&&(0,$t.jsx)("i",{className:p,"aria-hidden":!0}),u]}),v&&(0,$t.jsx)("div",{className:"common-modal-right-menu",children:v}),!g&&!y&&(0,$t.jsx)("div",{className:"common-modal-close",children:(0,$t.jsx)(Zt,{className:"menu-button",onClick:b,title:lf("Close"),rightIcon:"fas fa-times-circle"})})]}),(0,$t.jsx)("div",{className:"common-modal-body",children:r}),(null==f?void 0:f.length)&&(0,$t.jsx)("div",{className:"common-modal-footer",children:f.map((e,t)=>{var n;return(0,$t.jsx)(Zt,{className:null!==(n=e.className)&&void 0!==n?n:"primary inverted",disabled:e.disabled,onClick:e.onClick,href:e.url,label:e.label,title:e.label,rightIcon:(e.xicon?"xicon ":"")+e.icon,leftIcon:e.leftIcon},t)})})]})}),m||document.body)},In=e=>{const{badge:t,disabled:n,isNew:r,onClick:o}=e,a=o&&(()=>{o(t)}),i=n&&t.lockedImage||t.image,l=n?pxt.U.lf("Locked '{0}' badge",t.title):t.title;return(0,$t.jsxs)("div",{className:"profile-badge "+(o?"clickable":""),role:o?"button":void 0,tabIndex:o?0:void 0,title:lf("{0} Badge",t.title),onClick:a,onKeyDown:Ht,children:[r&&(0,$t.jsx)("div",{className:"profile-badge-notification",children:pxt.U.lf("New!")}),(0,$t.jsx)("img",{src:i,alt:l})]})},Tn=e=>{const{children:t}=e;return(0,$t.jsxs)("div",{className:"confetti-container",children:[t,Array(100).fill(0).map((e,t)=>{const n={animationDelay:t%100*.1+"s",left:1*Math.floor(100*Math.random())+"%"};return(0,$t.jsx)("div",{style:n,className:`confetti ${Math.random()>.5?"reverse":""} color-${Math.floor(9*Math.random())}`},t)})]})},jn=e.forwardRef((e,t)=>{const{id:n,className:r,ariaLabel:o,href:a,target:i,children:l,tabIndex:s,title:c}=e,u=qt("common-link",r);return(0,$t.jsx)("a",{id:n,className:u,ref:t,"aria-label":o,href:a,target:i,rel:"_blank"===i?"noopener noreferrer":"",tabIndex:null!=s?s:0,title:c,children:l})}),Nn=t=>{var n,r;const{onSignIn:o,onClose:a,appMessage:i,dialogMessages:l,hideDismissButton:s,lastUsedIdentityProvider:c}=t,{signInMessage:u,signUpMessage:d}=l||{signInMessage:lf("Sign in to save your progress and access your work anytime, anywhere."),signUpMessage:lf("Join now to save your progress and access your work anytime, anywhere.")},p=null!==(n=t.resolvePath)&&void 0!==n?n:e=>e,[f,h]=e.useState(!1),[m,g]=e.useState(null!==(r=t.mode)&&void 0!==r?r:"signin"),y=e.useMemo(()=>"signin"===m?lf("Sign in"):lf("Sign up"),[m]),v=e.useMemo(()=>"signin"===m?u:d,[m,u,d]),b=e.useMemo(()=>"signin"===m?(0,$t.jsxs)("div",{className:"switch",children:[(0,$t.jsx)("span",{children:lf("Don't have an account?")}),(0,$t.jsx)(Zt,{className:"link-button",onClick:()=>g("signup"),title:lf("Sign up"),label:lf("Sign up")})]}):(0,$t.jsxs)("div",{className:"switch",children:[(0,$t.jsx)("span",{children:lf("Have an account?")}),(0,$t.jsx)(Zt,{className:"link-button",onClick:()=>g("signin"),title:lf("Sign in"),label:lf("Sign in")})]}),[m]);return(0,$t.jsx)(En,{title:y,onClose:a,hideDismissButton:s,children:(0,$t.jsxs)("div",{className:"signin-form",children:[(0,$t.jsxs)("div",{className:"signin-header",children:[i||void 0," ",v]}),(0,$t.jsx)("div",{className:"signin-body",children:(0,$t.jsxs)("div",{className:"providers",children:[pxt.auth.identityProviders().map((e,t)=>{const n=e.id===c,r="signin"===m?lf("Continue with {0}",e.name):lf("Sign up with {0}",e.name),a=n?lf("{0}. You last used this option.",r):r;return(0,$t.jsx)(Zt,{className:"provider",onClick:()=>o(e,f),title:r,ariaLabel:a,label:(0,$t.jsxs)("div",{className:"label",children:[n&&(0,$t.jsx)("div",{className:"ui orange right ribbon label last-used-ribbon","aria-hidden":"true",children:lf("Last used")}),(0,$t.jsx)("div",{children:(0,$t.jsx)("img",{className:"logo",src:p(e.icon)})}),(0,$t.jsx)("div",{className:"title",children:r})]})},t)}),(0,$t.jsx)("div",{className:"rememberme",children:(0,$t.jsx)(un,{id:"rememberme",label:lf("Remember me"),isChecked:f,onChange:h})})]})}),(0,$t.jsxs)("div",{className:"signin-footer",children:[b,(0,$t.jsx)("div",{className:"learn",children:(0,$t.jsx)(jn,{href:"/identity/sign-in",target:"_blank",children:lf("Learn more")})})]})]})})},An=t=>{const{id:n,className:r,ariaHidden:o,ariaLabel:a,role:i,items:l,selected:s}=t,[c,u]=(0,e.useState)(!1),d=l.some(e=>_n(e)),p=e=>{},f=qt("common-editor-toggle",d&&"has-dropdown",c&&"focused",r);return(0,$t.jsxs)("div",{className:"common-editor-toggle-outer",children:[(0,$t.jsx)(On,{setIsFocused:u,...t}),(0,$t.jsxs)("div",{id:n,className:f,role:i||"tablist","aria-hidden":!0,"aria-label":a,children:[l.map((e,t)=>{const n=s===t;return(0,$t.jsxs)("div",{className:qt("common-editor-toggle-item",n&&"selected",_n(e)&&"common-editor-toggle-item-dropdown"),children:[(0,$t.jsx)(Pn,{item:e,isSelected:n,onKeydown:p}),_n(e)&&(0,$t.jsx)(pn,{id:"toggle-dropdown",className:"toggle-dropdown",icon:"fas fa-chevron-down",title:lf("More options"),tabIndex:-1,ariaHidden:!0,items:e.items.map(e=>({role:"menuitem",title:e.title,label:e.label,onClick:e.onClick,leftIcon:e.icon}))})]},t)}),(0,$t.jsx)("div",{className:"common-editor-toggle-handle","aria-hidden":!0})]})]})},Pn=e=>{const{item:t,isSelected:n,onKeydown:r}=e,{label:o,title:a,onClick:i,icon:l,focusable:s}=t;return(0,$t.jsx)(Zt,{className:l?void 0:"no-icon",role:s?"tab":void 0,tabIndex:-1,onKeydown:r,label:o,title:a,onClick:i,leftIcon:l,ariaHidden:!0})},On=e=>{const{items:t,id:n,selected:r,ariaHidden:o,setIsFocused:a}=e;let i;const l=t.reduce((e,t,n)=>{const o=[...e];return o.push({...t}),r===n?(o[o.length-1].selected=!0,i=n):o[o.length-1].selected=!1,_n(t)&&o.push(...t.items.filter(e=>e.focusable)),o},[]),s=`${n}-option-`;return(0,$t.jsx)(tn,{id:n,role:"tablist",className:"common-toggle-accessibility",childTabStopId:`${s}${i}`,focusSelectsItem:!0,children:l.map((e,t)=>(0,$t.jsx)(Zt,{className:e.selected?"selected":void 0,id:`${s}${t}`,role:"tab",title:e.title,label:e.label,onClick:e.onClick,onFocus:()=>a(!0),onBlur:()=>a(!1),ariaSelected:e.selected,ariaHidden:o},t))})};function _n(e){var t;return!(null===(t=e.items)||void 0===t||!t.length)}const Rn=t=>{var n;const{id:r,className:o,inputClassName:a,groupClassName:i,role:l,ariaHidden:s,ariaLabel:c,initialValue:u,label:d,title:p,placeholder:f,icon:h,iconTitle:m,disabled:g,type:y,readOnly:v,autoFocus:b,autoComplete:k,selectOnClick:w,onChange:x,onEnterKey:S,onIconClick:C,onFocus:E,onBlur:I,onOptionSelected:T,handleInputRef:j,preserveValueOnBlur:N=!0,options:A,validator:P}=t,[O,_]=e.useState(u||""),[R,M]=e.useState(!1),[L]=e.useState(t.filter?new RegExp(t.filter):void 0),U=e.useMemo(()=>A?Object.values(A):[],[A]);let D;e.useEffect(()=>{_(u||"")},[u]);const F=()=>{A&&M(!R)},z=e=>{if(!U.length)return;const t=U.indexOf(e);var n;return-1!==t?`dropdown-item-${t}-${(n=e)?n.replace(/[^a-zA-Z0-9_-]/g,"-")||"option":""}`:void 0};return(0,$t.jsxs)("div",{className:qt("common-input-wrapper",g&&"disabled",o),onBlur:e=>{R&&!D.contains(e.relatedTarget)&&M(!1)},ref:e=>{e&&(D=e)},children:[d&&(0,$t.jsx)("label",{className:"common-input-label",htmlFor:r,children:d}),(0,$t.jsxs)("div",{className:qt("common-input-group",i),children:[(0,$t.jsx)("input",{id:r,className:qt("common-input",h&&"has-icon",a),title:p,role:l||"textbox",tabIndex:g?-1:0,"aria-label":c,"aria-hidden":s,type:y||"text",placeholder:f,value:O,readOnly:!!v,autoFocus:b,onClick:e=>{w&&e.target.select(),A&&!R&&M(!0)},onChange:e=>{let t=e.target.value;var n;t&&L&&(t=(null===(n=t.match(L))||void 0===n?void 0:n.join(""))||""),v||O===t||_(t),x&&x(t)},onKeyDown:e=>{const n="number"==typeof e.which?e.which:e.keyCode;if(13===n||t.treatSpaceAsEnter&&32===n){let t=O;P&&(t=P(O,u||""),_(t)),S&&(e.preventDefault(),S(t))}else if(A&&"ArrowDown"===e.key){var r;R?null===(r=document.getElementById(z(U[0])))||void 0===r||r.focus():(F(),setTimeout(()=>{var e;null===(e=document.getElementById(z(U[0])))||void 0===e||e.focus()},0)),e.preventDefault(),e.stopPropagation()}else if(A&&R&&"ArrowUp"===e.key){var o;null===(o=document.getElementById(z(U[U.length-1])))||void 0===o||o.focus(),e.preventDefault(),e.stopPropagation()}},onBlur:()=>{let e=O;P&&(e=P(O,u||""),_(e)),I&&I(e),N||_("")},onFocus:()=>{E&&E(O)},autoComplete:k?"":"off",autoCorrect:k?"":"off",autoCapitalize:k?"":"off",spellCheck:k,disabled:g,ref:j}),h&&(C?(0,$t.jsx)(Zt,{leftIcon:h,title:m,disabled:g,onClick:()=>{C&&C(O)}}):(0,$t.jsx)("i",{className:h,"aria-hidden":!0})),A&&(0,$t.jsx)(Zt,{leftIcon:R?"fas fa-chevron-up":"fas fa-chevron-down",title:m,disabled:g,ariaHasPopup:"listbox",ariaExpanded:R,ariaLabel:c,tabIndex:-1,onClick:F})]}),R&&(0,$t.jsx)(tn,{role:"listbox",className:"common-menu-dropdown-pane common-dropdown-shadow",childTabStopId:null!==(n=z(O))&&void 0!==n?n:z(U[0]),"aria-labelledby":r,useUpAndDownArrowKeys:!0,children:(0,$t.jsx)("ul",{role:"presentation",onKeyDown:e=>{var t;"Escape"===e.code&&(e.target.blur(),F(),null===(t=document.getElementById(r))||void 0===t||t.focus(),e.stopPropagation(),e.preventDefault())},children:Object.keys(A).map(e=>(0,$t.jsx)("li",{role:"presentation",children:(0,$t.jsx)(Zt,{title:e,label:e,id:z(A[e]),className:qt("common-dropdown-item"),onClick:()=>(e=>{var t;M(!1);const n=A[e];_(n),T&&T(n),null===(t=document.getElementById(r))||void 0===t||t.focus()})(e),ariaSelected:z(A[e])===z(null!=O?O:u),role:"option"})},e))})})]})},Mn=t=>{const{id:n,className:r,role:o,ariaHidden:a,ariaLabel:i,initialValue:l,label:s,title:c,placeholder:u,autoComplete:d,cols:p,rows:f,disabled:h,minLength:m,maxLength:g,readOnly:y,resize:v,wrap:b,autoResize:k,onChange:w,onEnterKey:x,showRemainingCharacterCount:S}=t,[C,E]=e.useState(l||""),I=e.useRef(null),T=e.useRef(0),j=()=>{I.current&&(I.current.style.height="1px",I.current.style.height=`${I.current.scrollHeight}px`)};e.useEffect(()=>{E(l),k&&I.current&&j()},[l]),e.useEffect(()=>{if(!k)return()=>{};const e=new ResizeObserver(e=>{const t=e[0].contentRect.width;T.current!=t&&(requestAnimationFrame(()=>j()),T.current=t)});return I.current&&e.observe(I.current),()=>{e.disconnect()}},[k]);let N=void 0!==g&&!!S;return N&&"number"==typeof S&&(N=C.length>=g-S),(0,$t.jsxs)("div",{className:qt("common-textarea-wrapper",h&&"disabled",v&&`resize-${v}`,r),children:[s&&(0,$t.jsx)("label",{className:"common-textarea-label",children:s}),(0,$t.jsxs)("div",{className:"common-textarea-group",children:[(0,$t.jsx)("textarea",{id:n,className:"common-textarea",title:c,role:o||"textbox",tabIndex:h?-1:0,"aria-label":i,"aria-hidden":a,placeholder:u,value:C||"",cols:p,rows:f,minLength:m,maxLength:g,wrap:b,readOnly:!!y,ref:I,onChange:e=>{const t=e.target.value;y||C===t||E(t),w&&w(t),k&&I.current&&j()},onKeyDown:e=>{const t="number"==typeof e.which?e.which:e.keyCode;13!==t&&32!==t||x&&(e.preventDefault(),x(C))},autoComplete:d?"":"off",autoCorrect:d?"":"off",autoCapitalize:d?"":"off",spellCheck:d,disabled:h}),N&&(0,$t.jsx)("div",{className:"common-textarea-character-count",role:"presentation","aria-hidden":"true",children:g-C.length})]})]})},Ln=t=>{const{initialUri:n,onApply:r,onCancel:o,simRecorder:a}=t,[i,l]=e.useState(void 0),[s,c]=e.useState(void 0),[u,d]=e.useState(void 0),[p,f]=e.useState("default");let h;e.useEffect(()=>{if(u)return u.addStateChangeListener(f),u.addThumbnailListener(l),u.addErrorListener(c),()=>{u.removeStateChangeListener(f),u.removeThumbnailListener(l),u.removeErrorListener(c)}},[u]);const m=pxt.appTarget.appTheme,g=m.simScreenshotKey?lf("Screenshot ({0})",m.simScreenshotKey):lf("Screenshot"),y=m.simGifKey?lf("Record ({0})",m.simGifKey):lf("Record"),v=m.simGifKey?lf("Stop recording ({0})",m.simGifKey):lf("Stop recording"),b=lf("Rendering...");let k;switch(p){case"default":k=y;break;case"recording":k=v;break;case"rendering":k=b}const w=i?lf("New Thumbnail"):lf("Current Thumbnail"),x=qt("gif-recorder-content",i&&"has-uri");return(0,$t.jsx)($t.Fragment,{children:(0,$t.jsxs)("div",{className:x,children:[(0,$t.jsxs)("div",{className:"gif-recorder-sim",children:[(0,$t.jsx)("div",{className:"gif-recorder-sim-embed",ref:e=>{e&&(h=e)},children:e.createElement(a,{onSimRecorderInit:e=>{d(e)}})}),(0,$t.jsx)("div",{className:"gif-recorder",children:(0,$t.jsxs)("div",{className:"gif-recorder-actions",children:["default"===p&&(0,$t.jsx)(Zt,{className:"teal inverted",title:g,label:g,leftIcon:"fas fa-camera",onClick:async()=>{c(void 0),u&&u.screenshotAsync()}}),(0,$t.jsx)(Zt,{className:"teal inverted",disabled:"rendering"===p,title:k,label:k,leftIcon:"fas fa-"+("recording"===p?"square":"circle"),onClick:async()=>{if(c(void 0),u)if("recording"===u.state)u.stopRecordingAsync();else if("default"===u.state&&(u.startRecordingAsync(),h)){const e=h.querySelector("iframe");e&&e.focus()}}}),(0,$t.jsx)("div",{className:"spacer mobile-only"}),(0,$t.jsx)(Zt,{className:"mobile-only",title:lf("Cancel"),label:lf("Cancel"),onClick:o})]})})]}),(0,$t.jsxs)("div",{className:"thumbnail-controls",children:[(0,$t.jsx)("div",{className:"thumbnail-preview",children:(0,$t.jsxs)("div",{children:[(0,$t.jsxs)("div",{className:"thumbnail-header",children:[(0,$t.jsx)("span",{className:"project-share-label",children:w}),(0,$t.jsx)(Zt,{className:"link-button mobile-only",title:lf("Try again?"),label:lf("Try again?"),onClick:()=>l(void 0)})]}),(0,$t.jsxs)("div",{className:"project-share-thumbnail",children:["default"!==p&&(0,$t.jsxs)("div",{className:"project-thumbnail-placeholder",children:[(0,$t.jsx)("div",{className:"common-spinner"}),(0,$t.jsx)("div",{className:"project-thumbnail-label",children:"recording"===p?lf("Recording..."):lf("Rendering GIF...")})]}),"default"===p&&(i||n?(0,$t.jsx)("img",{src:i||n}):(0,$t.jsx)("div",{className:"thumbnail-placeholder"}))]})]})}),(0,$t.jsxs)("div",{className:"thumbnail-actions",children:[(0,$t.jsx)(Zt,{title:lf("Cancel"),label:lf("Cancel"),onClick:o}),i&&"default"===p&&(0,$t.jsx)(Zt,{className:"primary",title:lf("Apply"),label:lf("Apply"),onClick:e=>{r(i)}})]})]})]})})},Un=e=>{const{className:t,url:n,type:r,heading:o}=e,a=qt(t,"social-button","type"),i=pxt.appTarget.appTheme.socialOptions||{};let l="";switch(r){case"facebook":l=`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(n)}`;break;case"twitter":{let e=lf("Check out what I made!");i.twitterHandle&&i.orgTwitterHandle?e=lf("Check out what I made with @{0} and @{1}!",i.twitterHandle,i.orgTwitterHandle):i.twitterHandle?e=lf("Check out what I made with @{0}!",i.twitterHandle):i.orgTwitterHandle&&(e=lf("Check out what I made with @{0}!",i.orgTwitterHandle)),l=`https://twitter.com/intent/tweet?url=${encodeURIComponent(n)}&text=${encodeURIComponent(e)}`+(i.hashtags?`&hashtags=${encodeURIComponent(i.hashtags)}`:"")+(i.related?`&related=${encodeURIComponent(i.related)}`:"");break}case"discourse":l=`${i.discourse||"https://forum.makecode.com/"}new-topic?title=${encodeURIComponent(n)}`,i.discourseCategory&&(l+=`&category=${encodeURIComponent(i.discourseCategory)}`);break;case"google-classroom":l=`https://classroom.google.com/share?url=${encodeURIComponent(n)}`;break;case"microsoft-teams":l=`https://teams.microsoft.com/share?href=${encodeURIComponent(n)}`;break;case"whatsapp":l=`https://api.whatsapp.com/send?text=${encodeURIComponent(n)}`}const s=()=>{pxt.tickEvent(`share.social.${r}`)};switch(r){case"facebook":case"twitter":case"discourse":case"whatsapp":return(0,$t.jsx)(Dn,{className:qt(a,"social-icon"),ariaLabel:r,title:o,href:l,leftIcon:`icon ${r}`,heading:o,onClick:s});case"google-classroom":case"microsoft-teams":return(0,$t.jsx)(Dn,{className:a,ariaLabel:r,title:o,href:l,label:(0,$t.jsx)("img",{src:`/static/logo/social-buttons/${r}.png`,alt:o||pxt.U.rlf(r)}),heading:o,onClick:s})}return(0,$t.jsx)($t.Fragment,{})},Dn=e=>{const t=Jt(e);return(0,$t.jsx)("a",{className:t.className,title:t.title,href:e.href,target:"_blank",rel:"noopener,noreferrer",onClick:t=>{e.onClick&&e.onClick(),t.stopPropagation(),pxt.BrowserUtils.isInGame()||(t.preventDefault(),pxt.BrowserUtils.popupWindow(e.href,e.heading,600,600))},children:(0,$t.jsx)(Xt,{...e})})},Fn=e=>{const{onCancelClicked:t,onConfirmClicked:n}=e,r=[{label:lf("Cancel"),onClick:t},{label:lf("Share and Host"),onClick:n,className:"primary"}];return(0,$t.jsx)(En,{title:lf("Host a multiplayer game"),actions:r,onClose:t,children:lf("This will share the code of your game publicly. Is that okay?")})};class zn extends e.Component{constructor(e){super(e),this.state={notifications:{}}}push(e){const t=this.state.notifications,n=ts.pxtc.Util.guidGen();Object.keys(t).filter(n=>t[n].kind==e.kind).forEach(e=>this.remove(e)),t[n]=e;const r=this;setTimeout(()=>{r.remove(n)},3e3),this.setState({notifications:t})}remove(e){const t=this.state.notifications;t[e]&&(delete t[e],this.setState({notifications:t}))}render(){const{notifications:e}=this.state;return(0,$t.jsx)("div",{id:"msg","aria-live":"polite",children:Object.keys(e).map(t=>function(e,t){const{kind:n,text:r,hc:o}=t;let a="ignored info message";switch(n){case"err":a="red inverted segment";break;case"warn":a="orange inverted segment";break;case"info":a="blue inverted segment";break;case"compile":a="ignored info message"}return(0,$t.jsx)("div",{id:`${n}msg`,className:`ui ${o} ${a}`,children:r},`${e}`)}(t,e[t]))})}}let $n,Bn=!1;function Hn(n){if(Bn)$n&&$n.push(n);else{Bn=!0;const r=document.body.appendChild(document.createElement("div"));$n=t.render(e.createElement(zn,n),r),$n.push(n)}}const qn="https://vscode.dev/edu/makecode/",Wn=t=>{var n,r,o,a,i,l,s;const{projectName:c,projectDescription:u,screenshotUri:d,isLoggedIn:p,simRecorder:f,publishAsync:h,hasProjectBeenPersistentShared:m,anonymousShareByDefault:g,setAnonymousSharePreference:y,isMultiplayerGame:v,simulatorTheme:b,kind:k="share",onClose:w}=t,[x,S]=e.useState(c),[C,E]=e.useState(u),[I,T]=e.useState(d),[j,N]=e.useState("share"),[A,P]=e.useState(),[O,_]=e.useState(void 0),[R,M]=e.useState("none"),[L,U]=e.useState(!1),[D,F]=e.useState(!1),[z,$]=e.useState(!1),[B,H]=e.useState(!1),[q,W]=e.useState(!p||g),[V,G]=e.useState(!1),[K,Q]=e.useState(!1),{simScreenshot:Y,simGif:Z}=pxt.appTarget.appTheme,X=(Y||Z)&&!!f,J="share"===j||"publishing"===j,ee="publish"===j||"publish-vscode"===j,te=!ee;let ne,re,oe;e.useEffect(()=>{T(d)},[d]),e.useEffect(()=>{p?pxt.tickEvent("share.open.loggedIn",{state:j,anonymous:null==q?void 0:q.toString(),persistent:null==m?void 0:m.toString()}):pxt.tickEvent("share.open",{state:j})},[j,q,m]);const ae=()=>{N("share")},ie=[{name:"code",label:lf("Code"),title:lf("Code"),focusable:!0,onClick:()=>M("code")},{name:"editor",label:lf("Editor"),title:lf("Editor"),focusable:!0,onClick:()=>M("editor")},{name:"simulator",label:lf("Simulator"),title:lf("Simulator"),focusable:!0,onClick:()=>M("simulator")}],le=J?lf("Project Name"):"publish-vscode"===j?lf("Share Successful"):lf("Project Link"),se=void 0===O?q:O,ce=!(null===(n=pxt.appTarget)||void 0===n||null===(r=n.cloud)||void 0===r||null===(o=r.cloudProviders)||void 0===o||!o.github),ue=(()=>{if(null!=A&&A.error)return 413!==A.error.statusCode?lf("Oops! There was an error. Please ensure you are connected to the Internet and try again."):se&&ce?lf("Oops! Your project is too big to share anonymously. Sign in and create a persistent link for higher limits, or publish to GitHub instead."):se?lf("Oops! Your project is too big to share anonymously. Sign in and create a persistent link to unlock a higher size limit."):ce?lf("Oops! Your project is too big. You can create a GitHub repository to share it."):lf("Oops! Your project is too big to share.")})();return(0,$t.jsx)($t.Fragment,{children:(0,$t.jsxs)("div",{className:"project-share-info",children:[X&&"gifrecord"!==j&&(0,$t.jsxs)("div",{className:"project-share-thumbnail",children:[I?(0,$t.jsx)("img",{src:I,alt:lf("Preview of your code running on the simulator"),"aria-label":lf("Simulator preview")}):(0,$t.jsx)("div",{className:"project-thumbnail-placeholder",children:(0,$t.jsx)("div",{className:"common-spinner"})}),!ee&&(0,$t.jsx)(Zt,{className:"link-button",title:lf("Update project thumbnail"),label:lf("Update project thumbnail"),onClick:()=>N("gifrecord")})]}),(0,$t.jsxs)("div",{className:"project-share-content",children:[(J||ee)&&(0,$t.jsxs)($t.Fragment,{children:[(0,$t.jsx)("div",{className:"project-share-title project-share-label",id:"share-input-title",children:le}),te&&(0,$t.jsxs)($t.Fragment,{children:[(0,$t.jsx)(Rn,{ariaDescribedBy:"share-input-title",className:"name-input",initialValue:x,placeholder:lf("Name your project"),onChange:S,onBlur:S,onEnterKey:S,preserveValueOnBlur:!0}),pxt.appTarget.appTheme.showProjectDescription&&(0,$t.jsxs)($t.Fragment,{children:[(0,$t.jsx)("div",{className:"project-share-title project-share-label",id:"share-description-title",children:lf("Project Description")}),(0,$t.jsx)(Mn,{ariaDescribedBy:"share-description-title",ariaLabel:lf("Type a description for your project"),initialValue:void 0!==C?C:u||"",onChange:E,id:"projectDescriptionTextareaShare",maxLength:pxt.MAX_DESCRIPTION_LENGTH,showRemainingCharacterCount:500,resize:"vertical"})]}),p&&m&&(0,$t.jsx)(un,{id:"persistent-share-checkbox",label:lf("Update existing share link for this project"),isChecked:!q,onChange:e=>{pxt.tickEvent("share.persistentCheckbox",{checked:e.toString()}),W(!e),y&&y(!e)}}),b&&(0,$t.jsx)(un,{id:"share-simulator-theme-checkbox",label:lf("Share with your simulator theme"),isChecked:K,onChange:e=>{pxt.tickEvent("share.simulatorTheme",{checked:e.toString()}),Q(e)}})]}),J&&(0,$t.jsxs)($t.Fragment,{children:[(null==A?void 0:A.error)&&ue&&(0,$t.jsx)("div",{className:"project-share-error",children:ue}),(0,$t.jsxs)("div",{className:"project-share-publish-actions",children:["share"===j&&(0,$t.jsxs)($t.Fragment,{children:[(null===(a=pxt.appTarget)||void 0===a||null===(i=a.appTheme)||void 0===i?void 0:i.multiplayer)&&(v||"multiplayer"===k)&&(0,$t.jsx)(Zt,{className:qt("primary share-host-button","share"===k&&"primary inverted text-only","multiplayer"===k&&"share-publish-button"),title:lf("Host a multiplayer game"),label:lf("Host a multiplayer game"),leftIcon:"xicon multiplayer",onClick:async()=>{G(!0),pxt.tickEvent("share.hostMultiplayer")}}),"share"===k&&(0,$t.jsx)(Zt,{className:"primary share-publish-button",title:lf("Share Project"),label:lf("Share Project"),onClick:async()=>{N("publishing"),_(q);let e=await h(x,C,I,q,K?b:void 0);P(e),null!=e&&e.error?N("share"):N("publish")}}),"vscode"===k&&(0,$t.jsx)(Zt,{className:"primary share-publish-button",title:lf("Open in VS Code"),label:lf("Open in VS Code"),onClick:async()=>{N("publishing"),_(q);let e=await h(x,C,I,q,K?b:void 0);P(e),null!=e&&e.error?N("share"):(N("publish-vscode"),pxt.tickEvent("share.openInVscode"),window.open(qn+e.url.split("/").pop(),"_blank"))}})]}),"publishing"===j&&(0,$t.jsx)(Zt,{className:"primary share-publish-button",title:lf("Publishing..."),label:(0,$t.jsx)("div",{className:"common-spinner"}),onClick:()=>{}})]})]}),"publish-vscode"===j&&(0,$t.jsxs)("div",{className:"project-share-vscode",children:[(0,$t.jsx)("div",{children:lf("🎉 All set! Your project is launching in VS Code. If it doesn't open soon, just click the button below!")}),(0,$t.jsx)(jn,{className:"common-button secondary",href:qn+A.url.split("/").pop(),target:"_blank",children:lf("Open vscode.dev")})]}),"publish"===j&&(0,$t.jsxs)("div",{className:"project-share-data",children:[(0,$t.jsxs)("div",{className:"common-input-attached-button",children:[(0,$t.jsx)(Rn,{ariaDescribedBy:"share-input-title",ariaLabel:lf("Your shareable project link"),handleInputRef:e=>{e&&(re=e)},initialValue:A.url,readOnly:!0,onChange:S}),(0,$t.jsx)(Zt,{className:D?"green":"primary",title:lf("Copy link"),label:D?lf("Copied!"):lf("Copy"),leftIcon:"fas fa-link",onClick:()=>{pxt.BrowserUtils.isIpcRenderer()?F(pxt.BrowserUtils.legacyCopyText(re)):(navigator.clipboard.writeText(A.url),F(!0))},onBlur:()=>{F(!1)}})]}),(0,$t.jsxs)("div",{className:"project-share-actions",children:[(0,$t.jsxs)("div",{className:"project-share-social",children:[(0,$t.jsx)(Zt,{className:"square-button neutral embed mobile-portrait-hidden",title:lf("Show embed code"),leftIcon:"fas fa-code",onClick:()=>{"none"===R?(pxt.tickEvent("share.embed"),U(!1),H(!1),M("code")):M("none")}}),(0,$t.jsx)(Un,{className:"square-button facebook",url:null==A?void 0:A.url,type:"facebook",heading:lf("Share on Facebook")}),(0,$t.jsx)(Un,{className:"square-button twitter",url:null==A?void 0:A.url,type:"twitter",heading:lf("Share on Twitter")}),(0,$t.jsx)(Un,{className:"square-button google-classroom",url:null==A?void 0:A.url,type:"google-classroom",heading:lf("Share on Google Classroom")}),(0,$t.jsx)(Un,{className:"square-button microsoft-teams",url:null==A?void 0:A.url,type:"microsoft-teams",heading:lf("Share on Microsoft Teams")}),(0,$t.jsx)(Un,{className:"square-button whatsapp",url:null==A?void 0:A.url,type:"whatsapp",heading:lf("Share on WhatsApp")}),(null===(l=pxt.appTarget)||void 0===l||null===(s=l.appTheme)||void 0===s?void 0:s.shareToKiosk)&&(0,$t.jsx)(Zt,{className:"square-button neutral mobile-portrait-hidden social-button",title:lf("Share to MakeCode Arcade Kiosk"),leftIcon:"xicon kiosk",onClick:()=>{B?H(!1):(pxt.tickEvent("share.kiosk"),M("none"),U(!1),H(!0))}}),navigator.share&&(0,$t.jsx)(Zt,{className:"square-button device-share social-button",title:lf("Show device share options"),ariaLabel:lf("Show device share options"),leftIcon:"icon share",onClick:async()=>{var e,t;pxt.tickEvent("share.device");const n={title:document.title,url:A.url,text:lf("Check out my new MakeCode project!")};if(null!==(e=navigator)&&void 0!==e&&null!==(t=e.canShare)&&void 0!==t&&t.call(e,n))return navigator.share(n)}})]}),(0,$t.jsx)(Zt,{className:"menu-button project-qrcode",buttonRef:e=>{e&&(ne=e)},title:lf("Show QR Code"),label:(0,$t.jsx)("img",{className:"qrcode-image",src:null==A?void 0:A.qr,alt:lf("QR code to access your project"),"aria-label":lf("Project share link QR code")}),onClick:()=>{pxt.tickEvent("share.qrtoggle"),L?U(!1):(M("none"),U(!0),H(!1))}})]})]}),"none"!==R&&(0,$t.jsxs)("div",{className:"project-embed",children:[(0,$t.jsx)(An,{id:"project-embed-toggle",className:"slim tablet-compact",items:ie,selected:ie.findIndex(e=>e.name===R)}),(0,$t.jsx)(Mn,{readOnly:!0,rows:5,initialValue:null==A?void 0:A.embed[R],ariaLabel:lf("Embed code textarea")})]}),B&&(0,$t.jsxs)("div",{children:[(0,$t.jsxs)("div",{className:"project-share-label",children:[lf("Enter Kiosk Code"),(0,$t.jsx)(Zt,{className:"link-button kiosk",title:lf("Learn more about Kiosk"),leftIcon:"far fa-question-circle",onClick:()=>{window.open("https://arcade.makecode.com/hardware/kiosk","_blank")}})]}),(0,$t.jsxs)("div",{className:"common-input-attached-button",children:[(0,$t.jsx)(Rn,{handleInputRef:e=>{e&&(oe=e)},ariaDescribedBy:"share-input-title",preserveValueOnBlur:!0,placeholder:"A12B3C"}),(0,$t.jsx)(Zt,{className:z?"green":"primary",title:lf("Submit Kiosk Code"),label:z?lf("Submitted!"):lf("Submit"),onClick:async()=>{var e;pxt.tickEvent("share.kiosk.submitClicked");const t=pxt.Cloud.parseScriptId(A.url);if(null!==(e=oe)&&void 0!==e&&e.value){var n;let e=null===(n=/^[a-zA-Z0-9]{6}$/.exec(oe.value))||void 0===n?void 0:n[0];if(e){e=e.toUpperCase(),$(!0);try{await(async(e,t)=>{const n=await fetch("https://makecode.com/api/kiosk/updatecode",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({kioskCode:e,shareId:t})});if(!n.ok)throw new Error(n.statusText)})(e,t),pxt.tickEvent("share.kiosk.submitSuccessful"),Hn({kind:"info",text:lf("Game submitted to kiosk {0} successfully!",e),hc:!1})}catch(t){pxt.tickEvent("share.kiosk.submitServerError"),"Not Found"===t.message?Hn({kind:"err",text:lf("Kiosk Code not found"),hc:!1}):Hn({kind:"err",text:lf("Something went wrong submitting game to kiosk {0}",e),hc:!1})}}else Hn({kind:"err",text:lf("Invalid format for Kiosk Code"),hc:!1})}else Hn({kind:"err",text:lf("Input a six-character kiosk Code"),hc:!1})},onBlur:()=>{$(!1)}})]})]})]}),"gifrecord"===j&&(0,$t.jsx)(Ln,{initialUri:I,onApply:e=>{T(e),ae()},onCancel:ae,simRecorder:f})]}),L&&(0,$t.jsx)(En,{title:lf("QR Code"),onClose:()=>{U(!1),ne&&ne.focus()},ariaLabel:lf("QR Code modal"),children:(0,$t.jsx)("div",{className:"qrcode-modal-body",children:(0,$t.jsx)("img",{className:"qrcode-image",src:null==A?void 0:A.qr,alt:lf("QR code to access your project"),"aria-label":lf("Project share link QR code enlarged")})})}),V&&(0,$t.jsx)(Fn,{onCancelClicked:async()=>{G(!1),pxt.tickEvent("share.hostMultiplayerCancel")},onConfirmClicked:async()=>{N("publishing"),G(!1),_(q);const e=await h(x,C,I,q,K?b:void 0),t=pxt.Cloud.parseScriptId(e.url);if(!t)return void pxt.tickEvent("share.hostMultiplayerError");const n=pxt.multiplayer.makeHostLink(t,!1);pxt.tickEvent("share.hostMultiplayerShared",{shareId:t}),window.open(n,"_blank"),P(e),null!=e&&e.error?N("share"):N("publish"),"multiplayer"===k&&w()}})]})})},Vn=e=>{const{projectName:t,projectDescription:n,screenshotUri:r,isLoggedIn:o,simRecorder:a,publishAsync:i,hasProjectBeenPersistentShared:l,anonymousShareByDefault:s,setAnonymousSharePreference:c,isMultiplayerGame:u,simulatorTheme:d,kind:p,onClose:f}=e;return(0,$t.jsx)("div",{className:"project-share",children:(0,$t.jsx)(Wn,{projectName:t,projectDescription:n,isLoggedIn:o,screenshotUri:r,simRecorder:a,publishAsync:i,isMultiplayerGame:u,simulatorTheme:d,kind:p,hasProjectBeenPersistentShared:l,anonymousShareByDefault:s,setAnonymousSharePreference:c,onClose:f})})};let Gn;function Kn(){return Gn||(Gn=pxt.BrowserUtils.loadScriptAsync("pdf-lib/pdf-lib.min.js").then(()=>"undefined"!=typeof PDFLib).catch(e=>!1)),Gn}var Qn=n(3705);var Yn={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Zn(e){Yn=e}var Xn={exec:()=>null};function Jn(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(tr.caret,"$1"),n=n.replace(e,o),r},getRegex:()=>new RegExp(n,t)};return r}var er=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),tr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},nr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,rr=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,or=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ar=Jn(or).replace(/bull/g,rr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ir=Jn(or).replace(/bull/g,rr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),lr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,sr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,cr=Jn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",sr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ur=Jn(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,rr).getRegex(),dr="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",pr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,fr=Jn("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",pr).replace("tag",dr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),hr=Jn(lr).replace("hr",nr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dr).getRegex(),mr={blockquote:Jn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",hr).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:cr,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:nr,html:fr,lheading:ar,list:ur,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:hr,table:Xn,text:/^[^\n]+/},gr=Jn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",nr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dr).getRegex(),yr={...mr,lheading:ir,table:gr,paragraph:Jn(lr).replace("hr",nr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gr).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dr).getRegex()},vr={...mr,html:Jn("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",pr).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Xn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Jn(lr).replace("hr",nr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ar).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},br=/^( {2,}|\\)\n(?!\s*$)/,kr=/[\p{P}\p{S}]/u,wr=/[\s\p{P}\p{S}]/u,xr=/[^\s\p{P}\p{S}]/u,Sr=Jn(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,wr).getRegex(),Cr=/(?!~)[\p{P}\p{S}]/u,Er=Jn(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",er?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ir=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Tr=Jn(Ir,"u").replace(/punct/g,kr).getRegex(),jr=Jn(Ir,"u").replace(/punct/g,Cr).getRegex(),Nr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ar=Jn(Nr,"gu").replace(/notPunctSpace/g,xr).replace(/punctSpace/g,wr).replace(/punct/g,kr).getRegex(),Pr=Jn(Nr,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,Cr).getRegex(),Or=Jn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,xr).replace(/punctSpace/g,wr).replace(/punct/g,kr).getRegex(),_r=Jn(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,kr).getRegex(),Rr=Jn("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,xr).replace(/punctSpace/g,wr).replace(/punct/g,kr).getRegex(),Mr=Jn(/\\(punct)/,"gu").replace(/punct/g,kr).getRegex(),Lr=Jn(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ur=Jn(pr).replace("(?:--\x3e|$)","--\x3e").getRegex(),Dr=Jn("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ur).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Fr=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,zr=Jn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Fr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),$r=Jn(/^!?\[(label)\]\[(ref)\]/).replace("label",Fr).replace("ref",sr).getRegex(),Br=Jn(/^!?\[(ref)\](?:\[\])?/).replace("ref",sr).getRegex(),Hr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,qr={_backpedal:Xn,anyPunctuation:Mr,autolink:Lr,blockSkip:Er,br:br,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:Xn,delLDelim:Xn,delRDelim:Xn,emStrongLDelim:Tr,emStrongRDelimAst:Ar,emStrongRDelimUnd:Or,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:zr,nolink:Br,punctuation:Sr,reflink:$r,reflinkSearch:Jn("reflink|nolink(?!\\()","g").replace("reflink",$r).replace("nolink",Br).getRegex(),tag:Dr,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:Xn},Wr={...qr,link:Jn(/^!?\[(label)\]\((.*?)\)/).replace("label",Fr).getRegex(),reflink:Jn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Fr).getRegex()},Vr={...qr,emStrongRDelimAst:Pr,emStrongLDelim:jr,delLDelim:_r,delRDelim:Rr,url:Jn(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Hr).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Jn(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Hr).getRegex()},Gr={...Vr,br:Jn(br).replace("{2,}","*").getRegex(),text:Jn(Vr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Kr={normal:mr,gfm:yr,pedantic:vr},Qr={normal:qr,gfm:Vr,breaks:Gr,pedantic:Wr},Yr={"&":"&","<":"<",">":">",'"':""","'":"'"},Zr=e=>Yr[e];function Xr(e,t){if(t){if(tr.escapeTest.test(e))return e.replace(tr.escapeReplace,Zr)}else if(tr.escapeTestNoEncode.test(e))return e.replace(tr.escapeReplaceNoEncode,Zr);return e}function Jr(e){try{e=encodeURI(e).replace(tr.percentDecode,"%")}catch{return null}return e}function eo(e,t){let n=e.replace(tr.findPipe,(e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}).split(tr.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(tr.slashPipe,"|");return n}function to(e,t,n){let r=e.length;if(0===r)return"";let o=0;for(;o<r;){let a=e.charAt(r-o-1);if(a!==t||n){if(a===t||!n)break;o++}else o++}return e.slice(0,r-o)}function no(e,t=0){let n=t,r="";for(let t of e)if("\t"===t){let e=4-n%4;r+=" ".repeat(e),n+=e}else r+=t,n++;return r}function ro(e,t,n,r,o){let a=t.href,i=t.title||null,l=e[1].replace(o.other.outputLinkReplace,"$1");r.state.inLink=!0;let s={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:a,title:i,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,s}var oo=class{options;rules;lexer;constructor(e){this.options=e||Yn}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:to(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let o=r[1];return t.split("\n").map(e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return r.length>=o.length?e.slice(o.length):e}).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=to(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:to(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=to(t[0],"\n").split("\n"),n="",r="",o=[];for(;e.length>0;){let t,a=!1,i=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))i.push(e[t]),a=!0;else{if(a)break;i.push(e[t])}e=e.slice(t);let l=i.join("\n"),s=l.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${l}`:l,r=r?`${r}\n${s}`:s;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(s,o,!0),this.lexer.state.top=c,0===e.length)break;let u=o.at(-1);if("code"===u?.type)break;if("blockquote"===u?.type){let t=u,a=t.raw+"\n"+e.join("\n"),i=this.blockquote(a);o[o.length-1]=i,n=n.substring(0,n.length-t.raw.length)+i.raw,r=r.substring(0,r.length-t.text.length)+i.text;break}if("list"!==u?.type);else{let t=u,a=t.raw+"\n"+e.join("\n"),i=this.list(a);o[o.length-1]=i,n=n.substring(0,n.length-u.raw.length)+i.raw,r=r.substring(0,r.length-t.raw.length)+i.raw,e=a.substring(o.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:o,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let a=this.rules.other.listItemRegex(n),i=!1;for(;e;){let n=!1,r="",l="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let s=no(t[2].split("\n",1)[0],t[1].length),c=e.split("\n",1)[0],u=!s.trim(),d=0;if(this.options.pedantic?(d=2,l=s.trimStart()):u?d=t[1].length+1:(d=s.search(this.rules.other.nonSpaceChar),d=d>4?1:d,l=s.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),o=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),i=this.rules.other.htmlBeginRegex(d),p=this.rules.other.blockquoteBeginRegex(d);for(;e;){let f,h=e.split("\n",1)[0];if(c=h,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),f=c):f=c.replace(this.rules.other.tabCharGlobal," "),o.test(c)||a.test(c)||i.test(c)||p.test(c)||t.test(c)||n.test(c))break;if(f.search(this.rules.other.nonSpaceChar)>=d||!c.trim())l+="\n"+f.slice(d);else{if(u||s.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||o.test(s)||a.test(s)||n.test(s))break;l+="\n"+c}u=!c.trim(),r+=h+"\n",e=e.substring(h.length+1),s=f.slice(d)}}o.loose||(i?o.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(i=!0)),o.items.push({type:"list_item",raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(l),loose:!1,text:l,tokens:[]}),o.raw+=r}let l=o.items.at(-1);if(!l)return;l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd(),o.raw=o.raw.trimEnd();for(let e of o.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,""),"text"===e.tokens[0]?.type||"paragraph"===e.tokens[0]?.type){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,"");break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:"checkbox",raw:t[0]+" ",checked:"[ ]"!==t[0]};e.checked=n.checked,o.loose?e.tokens[0]&&["paragraph","text"].includes(e.tokens[0].type)&&"tokens"in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:"paragraph",raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!o.loose){let t=e.tokens.filter(e=>"space"===e.type),n=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw));o.loose=n}}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)"text"===t.type&&(t.type="paragraph")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=eo(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push("right"):this.rules.other.tableAlignCenter.test(e)?a.align.push("center"):this.rules.other.tableAlignLeft.test(e)?a.align.push("left"):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of o)a.rows.push(eo(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=to(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){let n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),ro(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return ro(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&(r[1]||r[2]||r[3]||r[4])&&(!r[4]||!n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[3]||!n||this.rules.inline.punctuation.exec(n))){let n,o,a=[...r[0]].length-1,i=a,l=0,s="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(s.lastIndex=0,t=t.slice(-1*e.length+a);null!==(r=s.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(o=[...n].length,r[3]||r[4]){i+=o;continue}if((r[5]||r[6])&&a%3&&!((a+o)%3)){l+=o;continue}if(i-=o,i>0)continue;o=Math.min(o,o+i+l);let t=[...r[0]][0].length,s=e.slice(0,a+r.index+t+o);if(Math.min(a,o)%2){let e=s.slice(1,-1);return{type:"em",raw:s,text:e,tokens:this.lexer.inlineTokens(e)}}let c=s.slice(2,-2);return{type:"strong",raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n,o,a=[...r[0]].length-1,i=a,l=this.rules.inline.delRDelim;for(l.lastIndex=0,t=t.slice(-1*e.length+a);null!==(r=l.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n||(o=[...n].length,o!==a))continue;if(r[3]||r[4]){i+=o;continue}if(i-=o,i>0)continue;o=Math.min(o,o+i);let t=[...r[0]][0].length,l=e.slice(0,a+r.index+t+o),s=l.slice(a,-a);return{type:"del",raw:l,text:s,tokens:this.lexer.inlineTokens(s)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},ao=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Yn,this.options.tokenizer=this.options.tokenizer||new oo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:tr,block:Kr.normal,inline:Qr.normal};this.options.pedantic?(t.block=Kr.pedantic,t.inline=Qr.pedantic):this.options.gfm&&(t.block=Kr.gfm,this.options.breaks?t.inline=Qr.breaks:t.inline=Qr.gfm),this.tokenizer.rules=t}static get rules(){return{block:Kr,inline:Qr}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(tr.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(tr.tabCharGlobal," ").replace(tr.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(o=e.substring(0,n+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){let a=t.at(-1);n&&"paragraph"===a?.type?(a.raw+=(a.raw.endsWith("\n")?"":"\n")+r.raw,a.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=o.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){Qn.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n,r=e,o=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!==(o=this.tokenizer.rules.inline.reflinkSearch.exec(r));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!==(o=this.tokenizer.rules.inline.anyPunctuation.exec(r));)r=r.slice(0,o.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!==(o=this.tokenizer.rules.inline.blockSkip.exec(r));)n=o[2]?o[2].length:0,r=r.slice(0,o.index+n)+"["+"a".repeat(o[0].length-n-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let a=!1,i="";for(;e;){let n;if(a||(i=""),a=!1,this.options.extensions?.inline?.some(r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))continue;if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length);let r=t.at(-1);"text"===n.type&&"text"===r?.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,r,i)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e,r,i)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}let o=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach(e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(o=e.substring(0,n+1))}if(n=this.tokenizer.inlineText(o)){e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(i=n.raw.slice(-1)),a=!0;let r=t.at(-1);"text"===r?.type?(r.raw+=n.raw,r.text+=n.text):t.push(n)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){Qn.error(t);break}throw new Error(t)}}return t}},io=class{options;parser;constructor(e){this.options=e||Yn}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(tr.notSpaceStart)?.[0],o=e.replace(tr.endingNewline,"")+"\n";return r?'<pre><code class="language-'+Xr(r)+'">'+(n?o:Xr(o,!0))+"</code></pre>\n":"<pre><code>"+(n?o:Xr(o,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let o=t?"ol":"ul";return"<"+o+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+o+">\n"}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let o=e.rows[t];n="";for(let e=0;e<o.length;e++)n+=this.tablecell(o[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Xr(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),o=Jr(e);if(null===o)return r;let a='<a href="'+(e=o)+'"';return t&&(a+=' title="'+Xr(t)+'"'),a+=">"+r+"</a>",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let o=Jr(e);if(null===o)return Xr(n);let a=`<img src="${e=o}" alt="${Xr(n)}"`;return t&&(a+=` title="${Xr(t)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Xr(e.text)}},lo=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},so=class e{options;renderer;textRenderer;constructor(e){this.options=e||Yn,this.options.renderer=this.options.renderer||new io,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new lo}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t="";for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==n||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(e.type)){t+=n||"";continue}}let o=r;switch(o.type){case"space":t+=this.renderer.space(o);break;case"hr":t+=this.renderer.hr(o);break;case"heading":t+=this.renderer.heading(o);break;case"code":t+=this.renderer.code(o);break;case"table":t+=this.renderer.table(o);break;case"blockquote":t+=this.renderer.blockquote(o);break;case"list":t+=this.renderer.list(o);break;case"checkbox":t+=this.renderer.checkbox(o);break;case"html":t+=this.renderer.html(o);break;case"def":t+=this.renderer.def(o);break;case"paragraph":t+=this.renderer.paragraph(o);break;case"text":t+=this.renderer.text(o);break;default:{let e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return Qn.error(e),"";throw new Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let o=e[r];if(this.options.extensions?.renderers?.[o.type]){let e=this.options.extensions.renderers[o.type].call({parser:this},o);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=e||"";continue}}let a=o;switch(a.type){case"escape":case"text":n+=t.text(a);break;case"html":n+=t.html(a);break;case"link":n+=t.link(a);break;case"image":n+=t.image(a);break;case"checkbox":n+=t.checkbox(a);break;case"strong":n+=t.strong(a);break;case"em":n+=t.em(a);break;case"codespan":n+=t.codespan(a);break;case"br":n+=t.br(a);break;case"del":n+=t.del(a);break;default:{let e='Token with "'+a.type+'" type was not found.';if(this.options.silent)return Qn.error(e),"";throw new Error(e)}}}return n}},co=class{options;block;constructor(e){this.options=e||Yn}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?ao.lex:ao.lexInline}provideParser(e=this.block){return e?so.parse:so.parseInline}},uo=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=so;Renderer=io;TextRenderer=lo;Lexer=ao;Tokenizer=oo;Hooks=co;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let o=e[r].flat(1/0);n=n.concat(this.walkTokens(o,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new io(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,o=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=a.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new oo(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,o=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new co;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,o=e.hooks[r],a=t[r];co.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&co.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await o.call(t,e);return a.call(t,n)})();let r=o.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await o.apply(t,e);return!1===n&&(n=await a.apply(t,e)),n})();let n=o.apply(t,e);return!1===n&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ao.lex(e,t??this.defaults)}parser(e,t){return so.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},o={...this.defaults,...r},a=this.onError(!!o.silent,!!o.async);if(!0===this.defaults.async&&!1===r.async)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let n=o.hooks?await o.hooks.preprocess(t):t,r=await(o.hooks?await o.hooks.provideLexer(e):e?ao.lex:ao.lexInline)(n,o),a=o.hooks?await o.hooks.processAllTokens(r):r;o.walkTokens&&await Promise.all(this.walkTokens(a,o.walkTokens));let i=await(o.hooks?await o.hooks.provideParser(e):e?so.parse:so.parseInline)(a,o);return o.hooks?await o.hooks.postprocess(i):i})().catch(a);try{o.hooks&&(t=o.hooks.preprocess(t));let n=(o.hooks?o.hooks.provideLexer(e):e?ao.lex:ao.lexInline)(t,o);o.hooks&&(n=o.hooks.processAllTokens(n)),o.walkTokens&&this.walkTokens(n,o.walkTokens);let r=(o.hooks?o.hooks.provideParser(e):e?so.parse:so.parseInline)(n,o);return o.hooks&&(r=o.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+Xr(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function po(e,t){return uo.parse(e,t)}po.options=po.setOptions=function(e){return uo.setOptions(e),po.defaults=uo.defaults,Zn(po.defaults),po},po.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},po.defaults=Yn,po.use=function(...e){return uo.use(...e),po.defaults=uo.defaults,Zn(po.defaults),po},po.walkTokens=function(e,t){return uo.walkTokens(e,t)},po.parseInline=uo.parseInline,po.Parser=so,po.parser=so.parse,po.Renderer=io,po.TextRenderer=lo,po.Lexer=ao,po.lexer=ao.lex,po.Tokenizer=oo,po.Hooks=co,po.parse=po,po.options,po.setOptions,po.use,po.walkTokens,po.parseInline;var fo=po,ho=(so.parse,ao.lex,n(3705));function mo(e,t){this.v=e,this.k=t}function go(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return go(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?go(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vo(e){var t,n;function r(t,n){try{var a=e[t](n),i=a.value,l=i instanceof mo;Promise.resolve(l?i.v:i).then(function(n){if(l){var s="return"===t&&i.k?t:"next";if(!i.k||n.done)return r(s,n);n=e[s](n).value}o(!!a.done,n)},function(e){r("throw",e)})}catch(e){o(2,e)}}function o(e,o){2===e?t.reject(o):t.resolve({value:o,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise(function(a,i){var l={key:e,arg:o,resolve:a,reject:i,next:null};n?n=n.next=l:(t=n=l,r(e,o))})},"function"!=typeof e.return&&(this.return=void 0)}vo.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},vo.prototype.next=function(e){return this._invoke("next",e)},vo.prototype.throw=function(e){return this._invoke("throw",e)},vo.prototype.return=function(e){return this._invoke("return",e)};const bo=Object.entries,ko=Object.setPrototypeOf,wo=Object.isFrozen,xo=Object.getPrototypeOf,So=Object.getOwnPropertyDescriptor;let Co=Object.freeze,Eo=Object.seal,Io=Object.create,To="undefined"!=typeof Reflect&&Reflect,jo=To.apply,No=To.construct;Co||(Co=function(e){return e}),Eo||(Eo=function(e){return e}),jo||(jo=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return e.apply(t,r)}),No||(No=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const Ao=ea(Array.prototype.forEach);Array.prototype.indexOf;const Po=ea(Array.prototype.lastIndexOf),Oo=ea(Array.prototype.pop),_o=ea(Array.prototype.push),Ro=ea(Array.prototype.slice),Mo=ea(Array.prototype.splice),Lo=Array.isArray,Uo=ta(Set),Do=ea(Set.prototype.add),Fo=ea(Set.prototype.has),zo=ea(String.prototype.toLowerCase),$o=ea(String.prototype.toString),Bo=ea(String.prototype.match),Ho=ea(String.prototype.replace),qo=ea(String.prototype.indexOf),Wo=ea(String.prototype.trim),Vo=ea(Number.prototype.toString),Go=ea(Boolean.prototype.toString),Ko="undefined"==typeof BigInt?null:ea(BigInt.prototype.toString),Qo="undefined"==typeof Symbol?null:ea(Symbol.prototype.toString),Yo=ea(Object.prototype.hasOwnProperty),Zo=ea(Object.prototype.toString),Xo=ea(RegExp.prototype.test),Jo=ta(TypeError);function ea(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return jo(e,t,r)}}function ta(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return No(e,n)}}function na(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:zo;if(ko&&ko(e,null),!Lo(t))return e;let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(wo(t)||(t[r]=e),o=e)}e[o]=!0}return e}function ra(e){for(let t=0;t<e.length;t++)Yo(e,t)||(e[t]=null);return e}function oa(e){const t=Io(null);for(const r of bo(e)){var n=yo(r,2);const o=n[0],a=n[1];Yo(e,o)&&(Lo(a)?t[o]=ra(a):a&&"object"==typeof a&&a.constructor===Object?t[o]=oa(a):t[o]=a)}return t}function aa(e,t){for(;null!==e;){const n=So(e,t);if(n){if(n.get)return ea(n.get);if("function"==typeof n.value)return ea(n.value)}e=xo(e)}return function(){return null}}const ia=Co(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),la=Co(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),sa=Co(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ca=Co(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ua=Co(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),da=Co(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pa=Co(["#text"]),fa=Co(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),ha=Co(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ma=Co(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ga=Co(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ya=Eo(/{{[\w\W]*|^[\w\W]*}}/g),va=Eo(/<%[\w\W]*|^[\w\W]*%>/g),ba=Eo(/\${[\w\W]*/g),ka=Eo(/^data-[\-\w.\u00B7-\uFFFF]+$/),wa=Eo(/^aria-[\-\w]+$/),xa=Eo(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Sa=Eo(/^(?:\w+script|data):/i),Ca=Eo(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ea=Eo(/^html$/i),Ia=Eo(/^[a-z][.\w]*(-[.\w]+)+$/i),Ta=Eo(/<[/\w!]/g),ja=Eo(/<[/\w]/g),Na=Eo(/<\/no(script|embed|frames)/i),Aa=Eo(/\/>/i),Pa=Co(na({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),Oa=function(e,t,n,r){return Yo(e,t)&&Lo(e[t])?na(r.base?oa(r.base):{},e[t],r.transform):n},_a=function(e,t,n){const r=Yo(e,t)?e[t]:void 0;return r&&"object"==typeof r?oa(r):n()};var Ra=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window;const n=t=>e(t);if(n.version="3.4.17",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let r=t.document;const o=r,a=o.currentScript;t.DocumentFragment;const i=t.HTMLTemplateElement,l=t.Node,s=t.Element,c=t.NodeFilter;void 0===t.NamedNodeMap&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const u=t.DOMParser,d=t.trustedTypes,p=s.prototype,f=aa(p,"cloneNode"),h=aa(p,"remove"),m=aa(p,"removeAttributeNode"),g=aa(p,"nextSibling"),y=aa(p,"childNodes"),v=aa(p,"parentNode"),b=aa(p,"shadowRoot"),k=aa(p,"attributes"),w=l&&l.prototype?aa(l.prototype,"nodeType"):null,x=l&&l.prototype?aa(l.prototype,"nodeName"):null,S=l&&l.prototype?aa(l.prototype,"ownerDocument"):null,C=function(e){return w?w(e):e.nodeType},E=function(e){return x?x(e):e.nodeName},I=function(e){for(;null!==e;){const t=So(e,"namespaceURI");if(t)return t.get?ea(t.get):null;e=xo(e)}return null}(p),T=function(e){return I?I(e):e.namespaceURI};if("function"==typeof i){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let j,N,A="",P=!1,O=0;const _=function(){if(O>0)throw Jo('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},R=function(e){_(),O++;try{return j.createHTML(e)}finally{O--}},M=r,L=M.implementation,U=M.createNodeIterator,D=M.createDocumentFragment,F=M.getElementsByTagName,z=o.importNode;let $={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof bo&&"function"==typeof v&&L&&void 0!==L.createHTMLDocument;const B=ya,H=va,q=ba,W=ka,V=wa,G=Sa,K=Ca,Q=Ia;let Y=xa,Z=null;const X=na({},[...ia,...la,...sa,...ua,...pa]);let J=null;const ee=na({},[...fa,...ha,...ma,...ga]);let te=Object.seal(Io(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ne=null,re=null;const oe=Object.seal(Io(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ae=!0,ie=!0,le=!1,se=!0,ce=!1,ue=!0,de=!1,pe=!1,fe=null,he=null,me=!1,ge=!1,ye=!1,ve=!1,be=!0,ke=!1;const we="user-content-";let xe=!0,Se=!1,Ce=null,Ee={},Ie=null;const Te=na({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let je=null;const Ne=na({},["audio","video","img","source","image","track"]);let Ae=null;const Pe=na({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Oe="http://www.w3.org/1998/Math/MathML",_e="http://www.w3.org/2000/svg",Re="http://www.w3.org/1999/xhtml";let Me=Re,Le=!1,Ue=null;const De=na({},[Oe,_e,Re],$o),Fe=Co(["mi","mo","mn","ms","mtext"]);let ze=na({},Fe);const $e=Co(["annotation-xml"]);let Be=na({},$e);const He=na({},["title","style","font","a","script"]);let qe=null;const We=["application/xhtml+xml","text/html"];let Ve=null,Ge=null;const Ke=r.createElement("form"),Qe=function(e){return e instanceof RegExp||e instanceof Function},Ye=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Ge&&Ge===e)return;e&&"object"==typeof e||(e={}),e=oa(e),qe=-1===We.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ve="application/xhtml+xml"===qe?$o:zo,Z=Oa(e,"ALLOWED_TAGS",X,{transform:Ve}),J=Oa(e,"ALLOWED_ATTR",ee,{transform:Ve}),Ue=Oa(e,"ALLOWED_NAMESPACES",De,{transform:$o}),Ae=Oa(e,"ADD_URI_SAFE_ATTR",Pe,{transform:Ve,base:Pe}),je=Oa(e,"ADD_DATA_URI_TAGS",Ne,{transform:Ve,base:Ne}),Ie=Oa(e,"FORBID_CONTENTS",Te,{transform:Ve}),ne=Oa(e,"FORBID_TAGS",oa({}),{transform:Ve}),re=Oa(e,"FORBID_ATTR",oa({}),{transform:Ve}),Ee=!!Yo(e,"USE_PROFILES")&&(e.USE_PROFILES&&"object"==typeof e.USE_PROFILES?oa(e.USE_PROFILES):e.USE_PROFILES),ae=!1!==e.ALLOW_ARIA_ATTR,ie=!1!==e.ALLOW_DATA_ATTR,le=e.ALLOW_UNKNOWN_PROTOCOLS||!1,se=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ce=e.SAFE_FOR_TEMPLATES||!1,ue=!1!==e.SAFE_FOR_XML,de=e.WHOLE_DOCUMENT||!1,ge=e.RETURN_DOM||!1,ye=e.RETURN_DOM_FRAGMENT||!1,ve=e.RETURN_TRUSTED_TYPE||!1,me=e.FORCE_BODY||!1,be=!1!==e.SANITIZE_DOM,ke=e.SANITIZE_NAMED_PROPS||!1,xe=!1!==e.KEEP_CONTENT,Se=e.IN_PLACE||!1,Y=function(e){try{return Xo(e,""),!0}catch(e){return!1}}(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:xa,Me="string"==typeof e.NAMESPACE?e.NAMESPACE:Re,ze=_a(e,"MATHML_TEXT_INTEGRATION_POINTS",()=>na({},Fe)),Be=_a(e,"HTML_INTEGRATION_POINTS",()=>na({},$e));const t=_a(e,"CUSTOM_ELEMENT_HANDLING",()=>Io(null));if(te=Io(null),Yo(t,"tagNameCheck")&&Qe(t.tagNameCheck)&&(te.tagNameCheck=t.tagNameCheck),Yo(t,"attributeNameCheck")&&Qe(t.attributeNameCheck)&&(te.attributeNameCheck=t.attributeNameCheck),Yo(t,"allowCustomizedBuiltInElements")&&"boolean"==typeof t.allowCustomizedBuiltInElements&&(te.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),Eo(te),ce&&(ie=!1),ye&&(ge=!0),Ee&&(Z=na({},pa),J=Io(null),!0===Ee.html&&(na(Z,ia),na(J,fa)),!0===Ee.svg&&(na(Z,la),na(J,ha),na(J,ga)),!0===Ee.svgFilters&&(na(Z,sa),na(J,ha),na(J,ga)),!0===Ee.mathMl&&(na(Z,ua),na(J,ma),na(J,ga))),oe.tagCheck=null,oe.attributeCheck=null,Yo(e,"ADD_TAGS")&&("function"==typeof e.ADD_TAGS?oe.tagCheck=e.ADD_TAGS:Lo(e.ADD_TAGS)&&(Z===X&&(Z=oa(Z)),na(Z,e.ADD_TAGS,Ve))),Yo(e,"ADD_ATTR")&&("function"==typeof e.ADD_ATTR?oe.attributeCheck=e.ADD_ATTR:Lo(e.ADD_ATTR)&&(J===ee&&(J=oa(J)),na(J,e.ADD_ATTR,Ve))),Yo(e,"ADD_FORBID_CONTENTS")&&Lo(e.ADD_FORBID_CONTENTS)&&(Ie===Te&&(Ie=oa(Ie)),na(Ie,e.ADD_FORBID_CONTENTS,Ve)),xe&&(Z["#text"]=!0),de&&na(Z,["html","head","body"]),Z.table&&(na(Z,["tbody"]),delete ne.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Jo('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Jo('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const t=j;j=e.TRUSTED_TYPES_POLICY;try{A=R("")}catch(e){throw j=t,e}}else null===e.TRUSTED_TYPES_POLICY?(j=void 0,A=""):(void 0===j&&(P||(N=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return ho.warn("TrustedTypes policy "+o+" could not be created."),null}}(d,a),P=!0),j=N),j&&"string"==typeof A&&(A=R("")));Co&&Co(e),Ge=e},Ze=na({},[...la,...sa,...ca]),Xe=na({},[...ua,...da]),Je=function(e){_o(n.removed,{element:e});try{v(e).removeChild(e)}catch(t){if(h(e),!v(e))throw Jo("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},et=function(e,t,n){try{m(e,t)}catch(t){try{e.removeAttribute(n)}catch(e){}}},tt=function(e){at(e);const t=y(e);t&&Ao(Ro(t),e=>{try{h(e)}catch(e){}});const n=1===C(e)?k(e):null;if(n)for(let t=n.length-1;t>=0;--t){const r=n[t],o=r&&r.name;"string"==typeof o&&et(e,r,o)}},nt=function(e,t,r){if(!r)try{r=t.getAttributeNode(e)}catch(e){r=null}_o(n.removed,{attribute:r||null,from:t});try{r?m(t,r):t.removeAttribute(e)}catch(n){try{t.removeAttribute(e)}catch(e){}}if("is"===e)if(ge||ye)try{Je(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},rt=function(e){const t=k(e);if(t)for(let n=t.length-1;n>=0;--n){const r=t[n],o=r&&r.name;"string"!=typeof o||J[Ve(o)]||et(e,r,o)}},ot=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[e];for(;r.length>0;){const e=r.pop();if(!1===t(e))continue;if(n&&1===C(e)){const t=b(e);gt(t)&&r.push(t)}const o=y(e);if(o)for(let e=o.length-1;e>=0;--e)r.push(o[e])}},at=function(e){ot(e,e=>{1===C(e)&&rt(e)})},it=function(e){const t=[];return ot(e,e=>{t.push(e)},!0),t},lt=function(e,t){let r=!1;return Ao(n.removed,t=>{t.element&&(r=r||t.element===e,at(t.element))}),function(e,t){const n=Uo();Ao(it(e),e=>{1===C(e)&&Do(n,e)}),Ao(t,e=>{1!==C(e)||Fo(n,e)||rt(e)})}(e,t),r},st=function(e,t,n,r){const o=dt(e);let a;for(;a=o.nextNode();)Fo(r,a)&&!Fo(Ce,a)&&(t&&vt($.uponSanitizeShadowNode,a,null),xt(a,n),Nt(a,n),gt(a.content)&&At(a.content))},ct=function(e,t){return!!ue&&("patchsrc"===e||"for"===e&&"label"!==t&&"output"!==t)},ut=function(e){let t=null,n=null;if(me)e="<remove></remove>"+e;else{const t=Bo(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===qe&&Me===Re&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=j?R(e):e;if(Me===Re)try{t=(new u).parseFromString(o,qe)}catch(e){}if(!t||!t.documentElement){t=L.createDocument(Me,"template",null);try{t.documentElement.innerHTML=Le?A:o}catch(e){}}const a=t.body||t.documentElement;return e&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),Me===Re?F.call(t,de?"html":"body")[0]:de?t.documentElement:a},dt=function(e){const t=S?S(e):e.ownerDocument;return U.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},pt=function(e){return e=Ho(e,B," "),e=Ho(e,H," "),Ho(e,q," ")},ft=function(e){var t;ht(e);const n=null===(t=e.querySelectorAll)||void 0===t?void 0:t.call(e,"template");n&&Ao(n,e=>{gt(e.content)&&ft(e.content)})},ht=function(e){e.normalize();const t=S?S(e):e.ownerDocument,n=U.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let r=n.nextNode();for(;r;)r.data=pt(r.data),r=n.nextNode()},mt=function(e){const t=x?x(e):null;return"string"==typeof t&&"form"===Ve(t)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||e.attributes!==k(e)||"function"!=typeof e.removeAttribute||"function"!=typeof e.removeAttributeNode||"function"!=typeof e.getAttributeNode||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes||e.nodeType!==w(e)||e.childNodes!==y(e))},gt=function(e){if(!w||"object"!=typeof e||null===e)return!1;try{return 11===w(e)}catch(e){return!1}},yt=function(e){if(!w||"object"!=typeof e||null===e)return!1;try{return"number"==typeof w(e)}catch(e){return!1}};function vt(e,t,r){0!==e.length&&Ao(e,e=>{e.call(n,t,r,Ge)})}const bt=function(e,t){if(e instanceof RegExp)return Xo(e,t);if(e instanceof Function){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return Boolean(e(t,...r))}return!1},kt=function(e,t,n,r){return 0===e.length?t:t===n||t===r?oa(t):t},wt=function(e,t){return e!==t&&null===v(e)&&(Se&&at(e),!0)},xt=function(e,t){if(Ce&&Do(Ce,e),vt($.beforeSanitizeElements,e,null),wt(e,t))return!0;if(mt(e))return Je(e),!0;const r=Ve(E(e));if(Z=kt($.uponSanitizeElement,Z,X,fe),vt($.uponSanitizeElement,e,{tagName:r,allowedTags:Z}),wt(e,t))return!0;if(function(e,t){return!!(ue&&e.hasChildNodes()&&!yt(e.firstElementChild)&&Xo(Ta,e.textContent)&&Xo(Ta,e.innerHTML))||!!(ue&&Pa[t]&&1===C(e)&&T(e)===Re&&(yt(e.firstElementChild)||"string"==typeof e.textContent&&Xo(Ta,e.textContent)))||7===e.nodeType||!(!ue||8!==e.nodeType||!Xo(ja,e.data))}(e,r))return Je(e),!0;if(ne[r]||!(oe.tagCheck instanceof Function&&oe.tagCheck(r))&&!Z[r]){const n=function(e,t,n){if(!ne[t]&&Et(t)&&bt(te.tagNameCheck,t))return!1;if(xe&&!Ie[t]&&!Ie[zo(t)]){const t=v(e),r=y(e);if(r&&t)for(let o=r.length-1;o>=0;--o){const a=e===n?f(r[o],!0):r[o];t.insertBefore(a,g(e))}}return Je(e),!0}(e,r,t);return!(!1!==n||(vt($.afterSanitizeElements,e,null),!wt(e,t)))||n}if(1===C(e)&&!function(e){const t=T(e),n=zo(E(e)),r=v(e);let o,a;return r&&1===C(r)?(o={namespaceURI:T(r)},a=zo(E(r))):(o={namespaceURI:Me},a="template"),!!Ue[t]&&(t===_e?function(e,t,n){return t.namespaceURI===Re?"svg"===e:t.namespaceURI===Oe?"svg"===e&&("annotation-xml"===n||ze[n]):Boolean(Ze[e])}(n,o,a):t===Oe?function(e,t,n){return t.namespaceURI===Re?"math"===e:t.namespaceURI===_e?"math"===e&&Be[n]:Boolean(Xe[e])}(n,o,a):t===Re?function(e,t,n){return!(t.namespaceURI===_e&&!Be[n])&&!(t.namespaceURI===Oe&&!ze[n])&&!Xe[e]&&(He[e]||!Ze[e])}(n,o,a):!("application/xhtml+xml"!==qe||!Ue[t]))}(e))return Je(e),!0;if(("noscript"===r||"noembed"===r||"noframes"===r)&&Xo(Na,e.innerHTML))return Je(e),!0;if(ce&&3===e.nodeType){const t=pt(e.textContent);e.textContent!==t&&(_o(n.removed,{element:e.cloneNode()}),e.textContent=t)}return vt($.afterSanitizeElements,e,null),wt(e,t)},St=function(e,t,n){if(re[t])return!1;if(ct(t,e))return!1;if(be&&("id"===t||"name"===t)&&(n in r||n in Ke))return!1;const o=J[t]||oe.attributeCheck instanceof Function&&oe.attributeCheck(t,e);return!(!ie||!Xo(W,t))||!(!ae||!Xo(V,t))||(o?!(!Ae[t]&&!Xo(Y,Ho(n,K,""))&&("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==qo(n,"data:")||!je[e])&&(!le||Xo(G,Ho(n,K,"")))&&n):Et(e)&&bt(te.tagNameCheck,e)&&bt(te.attributeNameCheck,t,e)||"is"===t&&te.allowCustomizedBuiltInElements&&bt(te.tagNameCheck,n))},Ct=na({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Et=function(e){return!Ct[zo(e)]&&Xo(Q,e)},It=function(e,t,n,r){if(j&&"object"==typeof d&&"function"==typeof d.getAttributeType&&!n)switch(d.getAttributeType(e,t)){case"TrustedHTML":return R(r);case"TrustedScriptURL":return function(e){_(),O++;try{return j.createScriptURL(e)}finally{O--}}(r)}return r},Tt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!mt(e)||(Je(e),!1)}catch(n){return nt(t,e),!1}},jt=function(e,t){return!(!ue||!Xo(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t))||"attributename"===zo(e)&&null!==Bo(t,"href")},Nt=function(e,t){if(vt($.beforeSanitizeAttributes,e,null),wt(e,t))return;const r=e.attributes;if(!r||mt(e))return;J=kt($.uponSanitizeAttribute,J,ee,he);const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0};let a=r.length;const i=Ve(e.nodeName);for(;a--;){const t=r[a],l=t.name,s=t.namespaceURI,c=t.value,u=Ve(l),d=c;let p="value"===l?d:Wo(d),f=!1;o.attrName=u,o.attrValue=p,o.keepAttr=!0,o.forceKeepAttr=void 0,vt($.uponSanitizeAttribute,e,o),p=o.attrValue,!ke||"id"!==u&&"name"!==u||0===qo(p,we)||(nt(l,e,t),p=we+p,f=!0),jt(l,p)?nt(l,e,t):o.forceKeepAttr||(!o.keepAttr||!se&&Xo(Aa,p)?nt(l,e,t):(ce&&(p=pt(p)),St(i,u,p)?(p=It(i,u,s,p),p!==d&&Tt(e,l,s,p)&&f&&Oo(n.removed)):nt(l,e,t)))}vt($.afterSanitizeAttributes,e,null),wt(e,t)},At=function(e){let t=null;const n=dt(e);for(vt($.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(vt($.uponSanitizeShadowNode,t,null),xt(t,e),Nt(t,e),gt(t.content)&&At(t.content),1===C(t)){const e=b(t);gt(e)&&(Pt(e),At(e))}ce&&ht(e),vt($.afterSanitizeShadowDOM,e,null)},Pt=function(e){const t=[{node:e,shadow:null}];for(;t.length>0;){const e=t.pop();if(e.shadow){At(e.shadow);continue}const n=e.node,r=1===C(n),o=y(n);if(o)for(let e=o.length-1;e>=0;--e)t.push({node:o[e],shadow:null});if(r){const e=x?x(n):null;if("string"==typeof e&&"template"===Ve(e)){const e=n.content;gt(e)&&t.push({node:e,shadow:null})}}if(r){const e=b(n);gt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,a=null,i=null,l=null;if(Le=!e,Le&&(e="\x3c!--\x3e"),"string"!=typeof e&&!yt(e)&&"string"!=typeof(e=function(e){switch(typeof e){case"string":return e;case"number":return Vo(e);case"boolean":return Go(e);case"bigint":return Ko?Ko(e):"0";case"symbol":return Qo?Qo(e):"Symbol()";case"undefined":default:return Zo(e);case"function":case"object":{if(null===e)return Zo(e);const t=e,n=aa(t,"toString");if("function"==typeof n){const e=n(t);return"string"==typeof e?e:Zo(e)}return Zo(e)}}}(e)))throw Jo("dirty is not a string, aborting");if(!n.isSupported)return e;pe?(Z=fe,J=he):Ye(t),($.uponSanitizeElement.length>0||$.uponSanitizeAttribute.length>0)&&(Z=oa(Z)),$.uponSanitizeAttribute.length>0&&(J=oa(J)),n.removed=[];const s=Se&&"string"!=typeof e&&yt(e);let c=[];const u=Ce;if(s){ue&&ot(e,e=>{const t=C(e);if(7===t||8===t&&Xo(ja,e.data)){try{h(e)}catch(e){}return!1}if(1===t){const t=e,n=Ve(E(e));try{t.hasAttribute&&t.hasAttribute("patchsrc")&&t.removeAttribute("patchsrc"),t.hasAttribute&&t.hasAttribute("for")&&ct("for",n)&&t.removeAttribute("for")}catch(e){}}return!0});const t=E(e);if("string"==typeof t){const n=Ve(t);if(!Z[n]||ne[n])throw tt(e),Jo("root node is forbidden and cannot be sanitized in-place")}if(mt(e))throw tt(e),Jo("root node is clobbered and cannot be sanitized in-place");c=it(e),Ce=Uo()}else if(yt(e))r=ut("\x3c!----\x3e"),a=r.ownerDocument.importNode(e,!0),1===a.nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?r=a:r.appendChild(a),Pt(r);else{if(!ge&&!ce&&!de&&-1===e.indexOf("<"))return j&&ve?R(e):e;if(r=ut(e),!r)return ge?null:ve?A:""}r&&me&&Je(r.firstChild);const d=s?e:r;try{s&&Pt(e);const t=dt(d);for(;i=t.nextNode();)xt(i,d),Nt(i,d),gt(i.content)&&At(i.content);s&&function(e,t){const n=Ce;let r=null;const o=()=>(r||(r=Uo(),Ao(t,e=>{Do(r,e)})),r);for(let t=0;;t++){const r=it(e),a=[e];let i=!1;if(Ao(r,e=>{11===C(e)?_o(a,e):i||Fo(n,e)||(i=Fo(o(),e))}),!i)return;if(t>=8)throw Jo("the tree kept changing during in-place sanitization; refusing to return it");Ao(a,(t,n)=>{st(t,n>0,e,o())})}}(e,c)}catch(t){throw s&&(tt(e),lt(e,c)),t}finally{Ce=u}if(s){if(lt(e,c))throw Jo("a node selected for removal could not be safely returned; refusing to sanitize in place");return ce&&ft(e),e}if(ge){if(ce&&ft(r),ye)for(l=D.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(J.shadowroot||J.shadowrootmode)&&(l=z.call(o,l,!0)),l}let p=de?r.outerHTML:r.innerHTML;return de&&Z["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&Xo(Ea,r.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+p),ce&&(p=pt(p)),j&&ve?R(p):p},n.setConfig=function(){Ye(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),pe=!0,fe=Z,he=J},n.clearConfig=function(){Ge=null,pe=!1,fe=null,he=null,j=N,A=""},n.isValidAttribute=function(e,t,n){Ge||Ye({});const r=Ve(e),o=Ve(t);return("string"!=typeof n||!(jt(t,n)||!se&&Xo(Aa,n)))&&St(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&Yo($,e)&&_o($[e],t)},n.removeHook=function(e,t){if(Yo($,e)){if(void 0!==t){const n=Po($[e],t);return-1===n?void 0:Mo($[e],n,1)[0]}return Oo($[e])}},n.removeHooks=function(e){Yo($,e)&&($[e]=[])},n.removeAllHooks=function(){$={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const Ma=t=>{const n=function(t){const[n,r]=e.useState();return e.useEffect(()=>{Ra.isSupported?(async()=>{const e=await fo(t);r(Ra.sanitize(e))})():r("<div></div>")},[t]),n}(t.markdown);let r=null;return e.useEffect(()=>{n&&r&&(r.innerHTML=n)},[r,n]),n?(0,$t.jsx)("div",{ref:e=>{e&&(r=e)}}):(0,$t.jsx)("div",{className:"common-spinner"})};class La extends e.Component{constructor(e){super(e),this.textInput=void 0,this.handleOnClose=()=>{this.setState({loading:!1,resolvePublish:void 0,checkboxSelected:!1}),this.props.dispatchHideModal(),this.props.dispatchSetShareStatus()},this.handleRewardShareClick=()=>{const{mapId:e,userState:t,pageSourceUrl:n,skillMap:r,activity:o,shareState:a}=this.props,i=Je(t,n,r,o.activityId);i&&this.props.dispatchShowShareModal(e,i.activityId,!0)},this.handleMultiplayerShareClick=async()=>{const{mapId:e,userState:t,pageSourceUrl:n,skillMap:r,activity:o}=this.props,a=Je(t,n,r,o.activityId),i=null==r?void 0:r.activities[a.activityId],l=await this.publishAsync(null==i?void 0:i.displayName,t,n,e,i),s=`${pxt.BrowserUtils.isLocalHostDev()?"http://localhost:3000/--":pxt.webConfig.relprefix}multiplayer?host=${l.url.split("/").slice(-1)[0]}`;window.open(s,"_blank")},this.handleShareCopyClick=()=>{const{mapId:e,activity:t}=this.props;Be("skillmap.share.copy",{path:e,activity:t.activityId});const n=document.querySelector(".share-input input");n&&(n.select(),document.execCommand("copy"))},this.publishAsync=async(e,t,n,r,o)=>{const{dispatchSetShareStatus:a}=this.props;Be("skillmap.share",{path:r,activity:o.activityId});const i=Qe(t,n,r,o.activityId);return a(null==i?void 0:i.headerId,e),new Promise(e=>{this.setState({resolvePublish:e})})},this.state={}}componentDidUpdate(e,t,n){var r;if(this.state.resolvePublish&&null!==(r=this.props.shareState)&&void 0!==r&&r.data){const e=this.state.resolvePublish;this.setState({resolvePublish:void 0}),e(this.props.shareState.data)}}render(){const{activity:e,type:t}=this.props;switch(t){case"completion":return e?this.renderCompletionModal():(0,$t.jsx)("div",{});case"restart-warning":return e?this.renderRestartWarning():(0,$t.jsx)("div",{});case"report-abuse":return this.renderReportAbuse();case"reset":return this.renderResetWarning();case"carryover":return this.renderCodeCarryoverModal();case"share":return this.renderShareModal();case"login":return this.renderLoginModal(!1);case"login-prompt":return this.renderLoginModal(!0);case"delete-account":return this.renderDeleteAccountModal();case"reward":return this.renderRewardModal();case"markdown-intro":return this.renderMarkdownIntroModal();default:return(0,$t.jsx)("div",{})}}getCompletionActionText(e){switch(e.kind){case"activity":return lf("Start Activity");case"map":return lf("Start Skillmap");case"editor":return lf("Keep Building");case"tutorial":return lf("Start Tutorial");default:return lf("Learn More")}}getCompletionActions(e){const{userState:t,pageSourceUrl:n,mapId:r,skillMap:o,activity:a,dispatchOpenActivity:i,dispatchShowCarryoverModal:l}=this.props,s=a,c=[];return null==e||e.forEach(e=>{const u={label:e.label||this.getCompletionActionText(e),url:e.url};switch(e.kind){case"activity":const d=null==o?void 0:o.activities[e.activityId||""];d&&(u.onClick=()=>{Be("skillmap.reward.action.activity",{path:r,activity:s.activityId,nextActivityId:d.activityId}),this.handleOnClose(),et(t,n,o,d)?l(o.mapId,d.activityId):i(r,d.activityId)},c.push(u));break;case"editor":const p=Je(t,n,o,a.activityId);null!=p&&p.headerId&&(u.onClick=()=>{Be("skillmap.reward.action.editor",{path:r,activity:s.activityId}),window.open(`${wn}#skillmapimport:${p.headerId}`)},c.push(u));break;default:u.onClick=()=>Be(`skillmap.reward.action.${e.kind}`,{path:r,activity:s.activityId,url:u.url||""}),c.push(u)}}),c}renderCompletionModal(){const{skillMap:e,type:t,activity:n,userState:r,pageSourceUrl:o,dispatchNextModal:a,reward:i,mapId:l}=this.props;if(!t||!e)return(0,$t.jsx)("div",{});const s=n,c=lf("You Did It!"),u=lf("Congratulations on completing {0}. Take some time to explore any activities you missed, or reset your progress to try again. But first, be sure to claim your reward using the button below.","{0}").split("{0}"),d=Je(r,o,e,n.activityId),p=i?()=>{Be("skillmap.openCertificate",{path:l,activity:n.activityId}),window.open(i.url||e.completionUrl)}:a,f=d&&d.headerId,h=f&&n.showMultiplayerShare;return(0,$t.jsx)(Tn,{children:(0,$t.jsxs)(En,{title:c,actions:this.getCompletionActions(s.actions),className:"completion",onClose:this.handleOnClose,children:[u[0],(0,$t.jsx)("strong",{children:e.displayName}),u[1],(0,$t.jsx)(Zt,{className:"primary completion-reward",title:lf("Claim your reward!"),label:lf("Claim your reward!"),leftIcon:"fas fa-gift",onClick:p}),f&&!h&&(0,$t.jsx)(Zt,{className:"primary completion-reward",title:lf("Share your game!"),label:lf("Share your game!"),leftIcon:"fas fa-share",onClick:this.handleRewardShareClick}),h&&(0,$t.jsx)(Zt,{className:"primary completion-reward",title:lf("Play online with friends!"),label:lf("Play online with friends!"),leftIcon:"fas fa-share",onClick:this.handleMultiplayerShareClick})]})})}renderRestartWarning(){const{userState:e,pageSourceUrl:t,skillMap:n,mapId:r,activity:o,dispatchRestartActivity:a,showCodeCarryoverModal:i,dispatchShowCarryoverModal:l}=this.props,s=lf("Restart Activity?"),c=lf("Are you sure you want to restart {0}? You won't lose your path progress but the code you have written for this activity will be deleted.","{0}").split("{0}"),u=[{label:lf("CANCEL"),onClick:this.handleOnClose},{label:lf("RESTART"),onClick:()=>{if(Be("skillmap.activity.restart",{path:r,activity:o.activityId}),i){const i=Je(e,t,n,o.activityId);a(r,o.activityId,i.headerId,!!i.headerId)}else a(r,o.activityId)}}];return(0,$t.jsxs)(En,{title:s,actions:u,onClose:this.handleOnClose,children:[c[0],(0,$t.jsx)("strong",{children:o.displayName}),c[1]]})}renderResetWarning(){const{dispatchResetUser:e,dispatchHideModal:t}=this.props,n=lf("Reset All Activities?"),r=lf("Are you sure you want to reset? This will permanently erase all progress and delete the project created for each tutorial. This action cannot be undone."),o=[{label:lf("CANCEL"),onClick:this.handleOnClose},{label:lf("RESET"),onClick:()=>{Be("skillmap.reset"),e(),t()}}];return(0,$t.jsx)(En,{title:n,actions:o,onClose:this.handleOnClose,children:r})}renderReportAbuse(){const{pageSourceUrl:e,dispatchHideModal:t}=this.props,n=[{label:"REPORT",onClick:()=>{Be("skillmap.reportabuse"),async function(e,t){e&&await function(e,t){return new Promise((n,r)=>{const o=new XMLHttpRequest;o.addEventListener("error",e=>{r(e)}),o.addEventListener("load",()=>{try{n(o.responseText)}catch(e){r(e)}}),o.open("POST",e,!0),o.setRequestHeader("Content-type","application/json"),o.send(JSON.stringify(t))})}(`/api/${encodeURIComponent(e)}/abusereports`,t)}(e||"",{text:document.querySelector(".report-abuse-text").value}),t()}}];return(0,$t.jsx)(En,{title:"Report Abuse",actions:n,onClose:this.handleOnClose,children:(0,$t.jsx)("textarea",{className:"report-abuse-text",placeholder:"Describe the content and explain why you are reporting it for abuse. Provide as much detail as possible!"})})}renderCodeCarryoverModal(){const{skillMap:e,activity:t,pageSourceUrl:n,userState:r,dispatchHideModal:o,dispatchRestartActivity:a}=this.props,i=lf("Keep code from previous activity?"),l=lf("Do you want to start with your code from {0} or start fresh with starter code? Your images, tilemaps, tiles, and animations will stick around either way.").split("{0}"),s=Je(r,n,e,t.activityId),c=e.activities[null==s?void 0:s.activityId];if(!c)return(0,$t.jsx)("div",{});const u=[{label:lf("START FRESH"),onClick:async()=>{Be("skillmap.startfresh",{path:e.mapId,activity:t.activityId,previousActivity:c.activityId}),a(e.mapId,t.activityId,s.headerId,!1),o()}},{label:lf("KEEP CODE"),onClick:async()=>{Be("skillmap.keepcode",{path:e.mapId,activity:t.activityId,previousActivity:c.activityId}),a(e.mapId,t.activityId,s.headerId,!0),o()}}];return(0,$t.jsxs)(En,{title:i,actions:u,onClose:this.handleOnClose,children:[l[0],(0,$t.jsx)("strong",{children:c.displayName}),l[1]]})}renderShareModal(){const{activity:e,userState:t,pageSourceUrl:n,mapId:r}=this.props;return(0,$t.jsx)(En,{title:lf("Share Project"),className:"sharedialog",parentElement:document.getElementById("root")||void 0,onClose:this.handleOnClose,children:(0,$t.jsx)(Vn,{projectName:e.displayName,isLoggedIn:!1,publishAsync:o=>this.publishAsync(o,t,n,r,e),simRecorder:void 0,onClose:this.handleOnClose})})}renderLoginModal(e){const t=async(e,t)=>{pxt.tickEvent("identity.loginClick",{provider:e.name,rememberMe:t.toString()}),await pxt.auth.client().loginAsync(e.id,t,{hash:location.hash})};return(0,$t.jsxs)($t.Fragment,{children:[e&&(0,$t.jsx)(Nn,{appMessage:lf("Nice work! You've completed this activity."),onSignIn:t,onClose:this.handleOnClose}),!e&&(0,$t.jsx)(Nn,{onSignIn:t,onClose:this.handleOnClose})]})}renderDeleteAccountModal(){const{checkboxSelected:e}=this.state,t=[];return t.push({label:lf("Confirm"),disabled:!e,onClick:async()=>{e&&(Be("skillmap.profile.delete"),this.props.dispatchHideModal(),this.props.dispatchCloseUserProfile(),await pxt.auth.client().deleteProfileAsync(),location.reload())}}),t.push({label:lf("Back to safety"),onClick:this.props.dispatchHideModal}),(0,$t.jsxs)(En,{title:lf("Delete Profile"),className:"delete",actions:t,onClose:this.handleOnClose,children:[(0,$t.jsxs)("div",{children:[" ",lf("Are you sure? This cannot be reversed! Your cloud-saved projects will be converted to local projects on this device.")]}),(0,$t.jsxs)("div",{className:"confirm-delete checkbox",onClick:()=>{this.setState({checkboxSelected:!e})},children:[(0,$t.jsx)("i",{className:"far "+(e?"fa-check-square":"fa-square")}),lf("I understand this is permanent. No undo.")]})]})}renderRewardModal(){const{reward:e}=this.props;let t;return"certificate"===(null==e?void 0:e.type)?t=this.renderCertificateModal(e):"completion-badge"===(null==e?void 0:e.type)&&(t=this.renderBadgeModal(e)),(0,$t.jsx)(Tn,{children:t})}renderCertificateModal(e){var t;const n=lf("Rewards"),{mapId:r,skillMap:o,activity:a,hasPendingModals:i,dispatchNextModal:l,profile:s,signedIn:c,pageSourceState:u}=this.props,d="approved"===u&&(null===(t=e.url)||void 0===t?void 0:t.toLowerCase().endsWith(".pdf"));d&&Kn();const p=async()=>{const t=await fetch(e.url).then(e=>e.arrayBuffer());let n;try{var r;n=await async function(e,t){if(!await Kn())return e;if(null==t||!t.trim())return e;const{PDFDocument:n,StandardFonts:r,TextAlignment:o,rgb:a}=PDFLib,i=await n.load(e),l=await i.embedFont(r.Helvetica),s=i.getPages()[0];if(!s)return e;const{width:c,height:u}=s.getSize(),d=i.getForm();let p;try{p=d.getTextField("name-entry")}catch(e){}if(p){p.setText(t),p.enableReadOnly(),p.setAlignment(o.Center),p.disableScrolling(),p.updateAppearances(l);const[e]=p.acroField.getWidgets(),{width:n,height:r}=e.getRectangle(),a=l.widthOfTextAtSize(t,10),i=0|Math.min(l.sizeAtHeight(.8*r),n/a*10);p.setFontSize(i)}else{const e=(.5*c|0)/l.widthOfTextAtSize(t,10);let n=15;const r=Math.min(70,10*e|0);s.drawText(t,{x:c/2-l.widthOfTextAtSize(t,r)/2,y:u/2-r/2+n,size:r,font:l,color:a(.1,.1,.1)})}return await i.save()}(t,null===(r=this.textInput)||void 0===r?void 0:r.value)}catch(e){}const o=new Blob([n||t],{type:"application/pdf"}),a=URL.createObjectURL(o);window.open(a,"_blank","noopener noreferrer")},f=[],h=()=>{var t,n;Be("skillmap.openCertificate",{path:r,activity:a.activityId,addedName:null!==(t=this.textInput)&&void 0!==t&&null!==(n=t.value)&&void 0!==n&&n.trim()?1:0}),d?p():window.open(e.url||o.completionUrl),i?l():this.handleOnClose()};if(f.push({label:lf("Open Certificate"),className:"completion-reward inverted",icon:"file outline",onClick:h}),i){const t=()=>{Be("skillmap.nextReward",{path:r,activity:a.activityId,currentReward:e.type}),l()};f.push({label:lf("Next Reward"),className:"completion-reward",icon:"right circle arrow",onClick:t})}const m=c&&s&&pxt.auth.firstName(s);return(0,$t.jsxs)(En,{title:n,onClose:this.handleOnClose,actions:f,children:[lf("Use the button below to get your completion certificate!"),e.previewUrl&&(0,$t.jsx)("div",{className:"certificate-reward",children:(0,$t.jsx)("img",{src:e.previewUrl,alt:lf("certificate Preview")})}),d&&(0,$t.jsx)(Rn,{className:"cert-name-input",placeholder:"Put your name on it!",label:lf("Enter your name"),type:"text",initialValue:m||void 0,handleInputRef:e=>{e&&(this.textInput=e)},preserveValueOnBlur:!0,onEnterKey:h,title:lf("Enter your name to customize the certificate"),ariaLabel:lf("Enter your name to customize the certificate")})]})}renderBadgeModal(e){const t=lf("Rewards"),{mapId:n,skillMap:r,activity:o,hasPendingModals:a,badge:i,dispatchNextModal:l,dispatchShowUserProfile:s,dispatchHideModal:c,signedIn:u,dispatchShowLoginModal:d}=this.props,p=()=>{Be("skillmap.goToBadges",{path:n,activity:o.activityId}),c(),s()},f=()=>{Be("skillmap.badgeSignIn",{path:n,activity:o.activityId}),c(),d()},h=[];let m;if(u?(m=Bt(lf("You’ve received the {0} Badge! Find it in the badges section of your {1}."),(0,$t.jsx)("span",{children:pxt.U.rlf(i.title)}),(0,$t.jsx)("a",{onClick:p,children:lf("User Profile")})),h.push({label:lf("Go to Badges"),className:"completion-reward inverted",icon:"trophy",onClick:p})):(m=Bt(lf("You’ve received the {0} Badge! {1} to save your progress"),(0,$t.jsx)("span",{children:pxt.U.rlf(r.displayName)}),(0,$t.jsx)("a",{onClick:f,children:lf("Sign In")})),h.push({label:lf("Sign In"),className:"completion-reward inverted",xicon:!0,icon:"cloud-user",onClick:f})),a){const t=()=>{Be("skillmap.nextReward",{path:n,activity:o.activityId,currentReward:e.type}),l()};h.push({label:lf("Next Reward"),className:"completion-reward",icon:"right circle arrow",onClick:t})}return(0,$t.jsxs)(En,{title:t,onClose:this.handleOnClose,actions:h,children:[m,(0,$t.jsx)("div",{className:"badge-modal-image",children:(0,$t.jsx)(In,{badge:i})})]})}renderMarkdownIntroModal(){const{skillMap:e,markdownIntroContent:t}=this.props;return(0,$t.jsx)(En,{title:(null==e?void 0:e.displayName)||lf("Introduction"),onClose:this.handleOnClose,actions:[{label:lf("Okay"),onClick:this.handleOnClose}],children:(0,$t.jsx)(Ma,{markdown:t})})}}const Ua=z(function(e,t){var n,r,o;if(!e)return{};const{pageSourceUrl:a,shareState:i}=e,[l]=e.modalQueue||[],{currentMapId:s,currentActivityId:c,type:u,currentReward:d,markdownContent:p}=l||{},f=e.editorView?e.maps[e.editorView.currentMapId]:s&&e.maps[s],h=s&&c?null===(n=e.maps[s])||void 0===n?void 0:n.activities[c]:void 0;let m;return f&&h&&nt(h)&&"completion-badge"===(null==d?void 0:d.type)&&(m=ot(a,f,h)),{type:u,pageSourceUrl:a,skillMap:f,userState:e.user,showCodeCarryoverModal:f&&h&&et(e.user,e.pageSourceUrl,f,h),mapId:s,activity:s&&c?e.maps[s].activities[c]:void 0,shareState:i,reward:d,hasPendingModals:(null===(r=e.modalQueue)||void 0===r?void 0:r.length)&&(null===(o=e.modalQueue)||void 0===o?void 0:o.length)>1,badge:m,signedIn:e.auth.signedIn,profile:e.auth.profile,pageSourceState:e.pageSourceStatus,markdownIntroContent:p}},{dispatchHideModal:()=>({type:me}),dispatchRestartActivity:ht,dispatchOpenActivity:pt,dispatchResetUser:()=>({type:oe}),dispatchShowCarryoverModal:(e,t)=>St({type:"carryover",currentMapId:e,currentActivityId:t}),dispatchCloseUserProfile:yt,dispatchSetShareStatus:bt,dispatchShowShareModal:wt,dispatchNextModal:()=>({type:he}),dispatchShowUserProfile:gt,dispatchShowLoginModal:xt})(La);class Da extends e.Component{constructor(e){super(e),this.handleClick=()=>{this.props.onItemSelect&&this.props.onItemSelect(this.props.node.activityId,this.props.kind)},this.handleDoubleClick=()=>{this.props.onItemDoubleClick&&this.props.onItemDoubleClick(this.props.node.activityId,this.props.kind)},this.handleKeyDown=e=>{const t="number"==typeof e.which?e.which:e.keyCode;13!==t&&32!==t||(e.preventDefault(),e.stopPropagation(),this.props.onItemSelect&&this.props.onItemSelect(this.props.node.activityId,this.props.kind))},this.handleRef=e=>{e&&(e.addEventListener("mouseenter",()=>{this.setState({hover:!0})}),e.addEventListener("mouseleave",()=>{this.setState({hover:!1})}))},this.state={hover:!1}}getIcon(e,t){switch(t){case"reward":return"";case"completion":return"";default:switch(e){case"locked":return"";case"completed":return"";default:return""}}}getIconClass(e,t){switch(t){case"reward":case"completion":return"fas graph-icon";default:switch(e){case"locked":case"completed":return"fas graph-icon";default:return"graph-icon-x"}}}getAccessibilityStatusText(){const{status:e}=this.props;switch(e){case"completed":return lf("Completed activity.");case"inprogress":return lf("Activity in progress.");case"locked":return lf("This activity is locked. Complete the previous activity to unlock it.");case"notstarted":case"restarted":return lf("Unstarted activity.")}}getNodeMarker(e,t,n,r){const o=t/50,a=t/576;return"notstarted"===e?(0,$t.jsxs)("g",{transform:`translate(${t/2-12*o} ${-t/2-9*o})`,children:[(0,$t.jsx)("title",{children:lf("Not Started")}),(0,$t.jsx)("g",{transform:`scale(${a/2})`,children:(i=n,l=r,(0,$t.jsx)("path",{fill:i,stroke:l,strokeWidth:"50",d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"}))})]}):(0,$t.jsx)("g",{});var i,l}render(){const{hover:e}=this.state,{width:t,position:n,selected:r,status:o,kind:a,theme:i,node:l}=this.props;let s=e?i.unlockedNodeColor:i.unlockedNodeForeground,c=e?i.unlockedNodeForeground:i.unlockedNodeColor;"locked"===o?(c=e?i.lockedNodeForeground:i.lockedNodeColor,s=e?i.lockedNodeColor:i.lockedNodeForeground):"activity"!==a?(c=e?i.rewardNodeForeground:i.rewardNodeColor,s=e?i.rewardNodeColor:i.rewardNodeForeground):"completed"===o&&(c=e?i.completedNodeForeground:i.completedNodeColor,s=e?i.completedNodeColor:i.completedNodeForeground);const u=t/8,d=t/12.5,p="graph-node-"+l.activityId;let f;switch(l.kind){case"activity":f=l.description||l.displayName;break;case"completion":f=lf("A reward for completing this skillmap.")}return(0,$t.jsxs)("g",{ref:this.handleRef,className:`graph-activity ${r?"selected":""} ${e?"hover":""}`,transform:`translate(${n.x} ${n.y})`,onKeyDown:this.handleKeyDown,onClick:this.handleClick,onDoubleClick:this.handleDoubleClick,"data-activity":l.activityId,children:[(0,$t.jsxs)("foreignObject",{width:t,height:t,x:-t/2,y:-t/2,children:[(0,$t.jsx)(Zt,{className:"graph-node-button",title:l.displayName,onClick:this.handleClick,onKeydown:this.handleKeyDown,role:"menuitem",ariaHasPopup:"locked"!==o?"true":"false",ariaExpanded:r,ariaControls:r?"info-panel-actions":void 0,ariaDescribedBy:p}),(0,$t.jsxs)("div",{id:p,style:{display:"none"},children:[(0,$t.jsx)("p",{children:this.getAccessibilityStatusText()}),f&&(0,$t.jsx)("p",{children:f})]})]}),r&&("activity"!==a?(0,$t.jsx)("circle",{className:"highlight",cx:0,cy:0,r:t/2+u,stroke:i.selectedStrokeColor}):(0,$t.jsx)("rect",{className:"highlight",x:-t/2-u,y:-t/2-u,width:t+2*u,height:t+2*u,rx:t/6,stroke:i.selectedStrokeColor})),"activity"!==a?(0,$t.jsx)("circle",{className:"focus-outline",cx:0,cy:0,r:t/2+2*u,stroke:"none",fill:"none"}):(0,$t.jsx)("rect",{className:"focus-outline",x:-t/2-2*u,y:-t/2-2*u,width:t+4*u,height:t+4*u,rx:t/6,stroke:"none",fill:"none"}),"activity"!==a?(0,$t.jsx)("circle",{cx:0,cy:0,r:t/2,fill:c,stroke:s,strokeWidth:"2"}):(0,$t.jsx)("rect",{x:-t/2,y:-t/2,width:t,height:t,rx:t/10,fill:c,stroke:s,strokeWidth:"2"}),"activity"===a&&this.getNodeMarker(o,t,i.selectedStrokeColor,i.strokeColor),(0,$t.jsx)("text",{dy:d,textAnchor:"middle",alignmentBaseline:"middle",dominantBaseline:"middle",fill:s,className:this.getIconClass(o,a),children:this.getIcon(o,a)})]})}}class Fa extends e.Component{render(){const{className:e,points:t,strokeWidth:n,color:r}=this.props;let o,a,i="M 0 0",l="";return t.forEach(e=>{var t,n,r,s;o=e,a&&(i+=` l ${((null===(t=o)||void 0===t?void 0:t.x)||0)-a.x} ${((null===(n=o)||void 0===n?void 0:n.y)||0)-a.y}`,l=` l ${a.x-((null===(r=o)||void 0===r?void 0:r.x)||0)} ${a.y-((null===(s=o)||void 0===s?void 0:s.y)||0)} ${l}`),a=o}),(0,$t.jsx)("g",{transform:`translate(${t[0].x||0} ${t[0].y||0})`,children:(0,$t.jsx)("path",{className:e,stroke:r,strokeWidth:n,d:`${i} ${l}`})})}}class za extends e.Component{constructor(e){super(e),this.onItemSelect=(e,t)=>{const{user:n,pageSourceUrl:r,map:o,completionState:a,selectedActivityId:i,dispatchChangeSelectedItem:l,dispatchShowCompletionModal:s}=this.props,{status:c}=We(n,r,o,e);"completion"===t&&"completed"===c?(Be("skillmap.graph.reward.select",{path:o.mapId,activity:e}),l(o.mapId,e),s(o.mapId,e)):e!==i?(Be("skillmap.graph.item.select",{path:o.mapId,activity:e}),l(o.mapId,e)):(Be("skillmap.graph.item.deselect",{path:o.mapId,activity:e}),l(void 0))},this.onItemDoubleClick=(e,t)=>{const{user:n,pageSourceUrl:r,map:o,dispatchOpenActivity:a,dispatchRestartActivity:i}=this.props,{status:l}=We(n,r,o,e),s=o.activities[e];Be("skillmap.activity.open.doubleclick",{path:o.mapId,activity:e,status:l||""});const c=Qe(n,r,o.mapId,s.activityId),u=Je(n,r,o,s.activityId);!et(n,r,o,s)||null!=c&&c.headerId?"activity"==t&&"locked"!==l&&a(o.mapId,e):i(o.mapId,e,u.headerId,!!u.headerId)}}componentDidUpdate(e){"transitioning"===e.completionState&&setTimeout(()=>{Be("skillmap.graph.reward.auto",{path:e.map.mapId,activity:e.selectedActivityId||""}),e.dispatchSetSkillMapCompleted(e.map.mapId),e.dispatchShowCompletionModal(e.map.mapId,e.selectedActivityId)},400)}render(){const{unit:e,items:t,paths:n,map:r,user:o,selectedActivityId:a,pageSourceUrl:i,theme:l}=this.props;return(0,$t.jsxs)("g",{className:"skill-graph",children:[(0,$t.jsxs)("g",{opacity:l.pathOpacity,children:[n.map((t,n)=>(0,$t.jsx)(Fa,{className:"skill-graph-path-border",strokeWidth:3*e,color:l.strokeColor,points:t.points},`graph-activity-${n}`)),n.map((t,n)=>(0,$t.jsx)(Fa,{className:"skill-graph-path",strokeWidth:3*e-4,color:l.pathColor,points:t.points},`graph-activity-${n}`))]}),t.map((t,n)=>(0,$t.jsx)(Da,{node:t.activity,theme:l,kind:t.activity.kind,position:t.position,width:5*e,selected:t.activity.activityId===a,onItemSelect:this.onItemSelect,onItemDoubleClick:this.onItemDoubleClick,status:We(o,i,r,t.activity.activityId).status},`graph-activity-${n}`))]})}}const $a=z(function(e,t){var n,r,o,a;if(!e)return{};const i=null===(n=e.user)||void 0===n||null===(r=n.mapProgress)||void 0===r?void 0:r[e.pageSourceUrl];return{user:e.user,pageSourceUrl:e.pageSourceUrl,theme:e.theme,selectedActivityId:e.selectedItem&&(null===(o=t.map)||void 0===o?void 0:o.mapId)==e.selectedItem.mapId?e.selectedItem.activityId:void 0,completionState:null==i||null===(a=i[t.map.mapId])||void 0===a?void 0:a.completionState}},{dispatchChangeSelectedItem:dt,dispatchShowCompletionModal:kt,dispatchSetSkillMapCompleted:e=>({type:Y,mapId:e}),dispatchOpenActivity:pt,dispatchRestartActivity:ht})(za),Ba=10;function Ha(e,t){return{x:qa(e),y:Wa(t)}}function qa(e){return(12*e+4)*Ba}function Wa(e){return(9*e+4)*Ba}function Va(e,t){if(!e.parents||!t.parents)return!1;let n;return e.parents.forEach(e=>{t.parents.indexOf(e)>=0&&(n=e)}),!!n&&1==Math.abs(n.nextIds.indexOf(e.activityId)-n.nextIds.indexOf(t.activityId))&&e.depth==t.depth}function Ga(e){let t=[],n=[e],r={};for(;n.length>0;){let e=n.shift();e&&!r[e.activityId]&&(r[e.activityId]=!0,t.push(e),n=e.next.concat(n))}return t}function Ka(e){const t=function(e){let t=[],n=[e],r={};for(;n.length>0;){let e=n.shift();e&&!r[e.activityId]&&(r[e.activityId]=!0,t.push(e),n=n.concat(e.next))}return t}(e),n={};return t.forEach(e=>{let t=e.next.slice();e.next.length=0,n[e.activityId]=JSON.parse(JSON.stringify(e)),e.next=t}),Object.keys(n).forEach(e=>n[e].next=n[e].nextIds.map(e=>n[e])),n[e.activityId]}class Qa extends e.Component{constructor(e){super(e),this.onImageLoad=e=>{this.setState({backgroundSize:{width:e.target.naturalWidth,height:e.target.naturalHeight}})},this.state={backgroundSize:{width:0,height:0},backgroundColor:this.props.backgroundColor,strokeColor:this.props.strokeColor}}render(){var e;const{maps:t,graphs:n,graphSize:r,backgroundImageUrl:o,pixelatedBackground:a,backgroundColor:i,strokeColor:l}=this.props,{backgroundSize:s}=this.state;let c="black",u=lf("Background image for {0}",(null===(e=t[0])||void 0===e?void 0:e.displayName)||lf("skillmap")),d=0;const p=r.width/r.height,f=s.width/s.height,h=o&&s.width>0&&s.height>0;let m=Math.max(400,r.height),g=Math.max(600,r.width);h&&(p-f>.05?m=g*(1/f):p-f<-.05&&(g=m*f)),i===l&&(c="white"),t.length>1&&(u=lf("Background image for {0} connected skillmaps",(null==t?void 0:t.length)||0));const y=Math.max(m-r.height,0)/2,v=Math.max(g-r.width,0)/2;return(0,$t.jsx)("div",{className:"skill-graph-wrapper",children:(0,$t.jsxs)("div",{className:"skill-graph-content "+(h?"has-background":""),children:[(0,$t.jsx)(nn,{className:"skill-graph-activities",ariaLabel:lf("Skillmap"),children:(0,$t.jsx)("svg",{viewBox:`-${v+40} -${y+40} ${g+80} ${m+80}`,preserveAspectRatio:"xMidYMid meet",children:n.map((e,t)=>(d+=e.height,(0,$t.jsx)("g",{transform:`translate(0, ${d-e.height})`,children:(0,$t.jsx)($a,{unit:Ba,...e})},t)))})}),o&&(0,$t.jsx)("div",{className:"skill-graph-background",children:(0,$t.jsx)("img",{src:o,className:a?"pixelated":void 0,alt:u,onLoad:this.onImageLoad,style:{color:c}})})]})})}}const Ya=z(function(e,t){if(!e)return{};const n=t.maps.map(e=>function(e){let t=[];t="manual"===e.layout?t.concat(function(e){const t=[],n=Ga(Ka(e)).filter(e=>"layout"!==e.kind);return n.forEach(e=>{if(t.indexOf(e.activityId)<0){var n,r;t.push(e.activityId),e.depth=(null===(n=e.position)||void 0===n?void 0:n.depth)||0,e.offset=(null===(r=e.position)||void 0===r?void 0:r.offset)||0;const o=[];e.next.forEach((t,n)=>{var r,a,i;const l=(null===(r=t.position)||void 0===r?void 0:r.depth)||0,s=(null===(a=t.position)||void 0===a?void 0:a.offset)||0,c=[{depth:e.depth,offset:e.offset}];null!==(i=e.edges)&&void 0!==i&&i[n]&&e.edges[n].forEach(e=>{const t=c[c.length-1];e.depth!==t.depth&&e.offset!==t.offset&&c.push({depth:t.depth,offset:e.offset}),c.push(e)});const u=c[c.length-1];l!==u.depth&&s!==u.offset&&c.push({depth:u.depth,offset:s}),c.push({depth:l,offset:s}),o.push(c)}),e.edges=o}}),n}(e.root)):t.concat(function(e){const t=Ka(e);let n=[t];const r={},o={};let a=0;for(;n.length>0;){let e=n.shift();if(e&&!o[e.activityId]){var i;o[e.activityId]=!0;const t=null===(i=e.parents)||void 0===i?void 0:i[0];if(t){const n=r[t.activityId]||{depth:0,offset:0};0==n.depth?(n.depth=1,e.offset=t.offset+n.offset):(a+=1,n.offset=a,e.offset=a),e.depth=t.depth+n.depth,r[t.activityId]=n}else e.depth=0,e.offset=0;const l=e.next.map(t=>{let n=t;return n.parents?n.parents.push(e):n.parents=[e],n});l.filter(e=>o[e.activityId]).forEach(t=>{Va(t,e)||(t.offset+=1,a=Math.max(a,t.offset),t.depth=Math.max(t.depth,e.depth+1))}),n=l.concat(n)}}const l=Ga(t).filter(e=>"layout"!==e.kind),s={};return l.forEach(e=>{null==s[e.depth]&&(s[e.depth]=[]),s[e.depth].push(e.offset)}),l.forEach(e=>{var t;if((!e.next||0==e.next.length)&&1==(null===(t=e.parents)||void 0===t?void 0:t.length)){const t=e.parents[0],n=s[e.depth],r=n[n.indexOf(e.offset)-1];(r?e.offset-r:Math.abs(e.depth-t.depth)+Math.abs(e.offset-t.offset))>2&&(e.depth=t.depth,e.offset=(r||t.offset)+1)}}),l.forEach(e=>{if(e.parents){e.edges=[];const t=e.parents.some(t=>t.offset==e.offset)||e.parents.length>2;e.parents.forEach(n=>{var r;const o=[{depth:n.depth,offset:n.offset}];if(t){const t=s[e.depth],r=t.indexOf(e.offset),a=e.offset>n.offset&&!(t[r+1]-t[r]<e.offset-n.offset),i=e.offset<n.offset&&!(t[r]-t[r-1]<n.offset-e.offset);a||i?o.push({depth:e.depth,offset:n.offset}):o.push({depth:n.depth,offset:e.offset})}else o.push({depth:n.depth,offset:e.offset});o.push({depth:e.depth,offset:e.offset}),null===(r=e.edges)||void 0===r||r.push(o)})}}),l}(e.root));let n=0,r=0;const o=[],a=[];for(let e of t){const{depth:t,offset:i}=e;o.push({activity:e,position:Ha(t,i)}),e.edges&&e.edges.forEach(e=>{const t=[];e.forEach(e=>t.push(Ha(e.depth,e.offset))),a.push({points:t})}),n=Math.max(n,e.depth),r=Math.max(r,e.offset)}const i=qa(n)+40,l=Wa(r)+40;return{map:e,items:o,paths:a,width:i,height:l}}(e)),r=null!=n&&n.length?n.map(e=>e.width).reduce((e,t)=>Math.max(e,t)):0,o=null!=n&&n.length?n.map(e=>e.height).reduce((e,t)=>e+t):0;return{graphs:n,graphSize:{width:r,height:o}}})(Qa);class Za extends e.Component{constructor(...e){super(...e),this.handleActionButtonClick=()=>{const{status:e,mapId:t,activityId:n,previousHeaderId:r,dispatchOpenActivity:o,dispatchRestartActivity:a,showCodeCarryoverModal:i}=this.props;"locked"!==e&&(Be("skillmap.activity.open",{path:t,activity:n,status:e||""}),"notstarted"===e&&i?a(t,n,r,!!r):o(t,n))},this.handleRestartButtonClick=()=>{const{mapId:e,activityId:t,status:n,dispatchShowRestartActivityWarning:r}=this.props;Be("skillmap.sidebar.restart",{path:e,activity:t,status:n||""}),r(e,t)},this.handleShareButtonClick=()=>{const{mapId:e,activityId:t,status:n,dispatchShowShareModal:r}=this.props;Be("skillmap.sidebar.share",{path:e,activity:t,status:n||""}),r(e,t)},this.handleSaveToProjectsClick=()=>{const{completedHeaderId:e,mapId:t,activityId:n}=this.props;Be("skillmap.export",{path:t||"",activity:n||""}),window.open(`${wn}#skillmapimport:${e}`)}}getActivityActionText(){switch(this.props.status){case"locked":return lf("Locked");case"completed":return lf("View Code");case"inprogress":case"restarted":return lf("Continue");default:return lf("Start")}}isCompleted(e){return"completed"===e||"restarted"===e}render(){const{status:e,completedHeaderId:t,signedIn:n,dispatchShowLoginModal:r}=this.props,o=e&&"notstarted"!==e&&"locked"!==e;if("locked"===e)return(0,$t.jsx)("div",{});const a=pxt.auth.hasIdentity()&&!n;return(0,$t.jsxs)("div",{className:"actions "+(t?"grid":""),children:[(0,$t.jsx)(Zt,{className:"tertiary",tabIndex:-1,title:this.getActivityActionText(),label:this.getActivityActionText(),onClick:this.handleActionButtonClick}),o&&(0,$t.jsxs)($t.Fragment,{children:[(0,$t.jsx)(Zt,{className:"primary inverted",tabIndex:-1,title:lf("Restart"),label:lf("Restart"),onClick:this.handleRestartButtonClick}),(0,$t.jsx)(Zt,{className:"primary inverted",tabIndex:-1,title:lf("Share"),label:lf("Share"),onClick:this.handleShareButtonClick})]}),t&&(0,$t.jsx)(Zt,{tabIndex:-1,className:"primary inverted",title:lf("Save to My Projects"),label:lf("Save to My Projects"),onClick:this.handleSaveToProjectsClick}),a&&(0,$t.jsx)(Zt,{tabIndex:-1,className:"primary inverted",onClick:r,label:lf("Sign in to Save"),title:lf("Sign in to Save")})]})}}const Xa=z(function(e,t){if(!e)return{};const n=t,r=e.maps[n.mapId],o=r.activities[n.activityId],a=Je(e.user,e.pageSourceUrl,r,n.activityId);return{previousHeaderId:null==a?void 0:a.headerId,showCodeCarryoverModal:et(e.user,e.pageSourceUrl,r,o),signedIn:e.auth.signedIn}},{dispatchOpenActivity:pt,dispatchShowRestartActivityWarning:(e,t)=>St({type:"restart-warning",currentMapId:e,currentActivityId:t}),dispatchShowShareModal:wt,dispatchRestartActivity:ht,dispatchShowLoginModal:xt})(Za);class Ja extends e.Component{constructor(...e){super(...e),this.handleActionButtonClick=()=>{const{status:e,mapId:t,activityId:n,dispatchShowCompletionModal:r}=this.props;if("locked"!==e)return Be("skillmap.sidebar.reward",{path:t,activity:n}),r(t,n)},this.handlePlayGameClick=()=>{const{previousHeaderId:e,mapId:t,activityId:n}=this.props;Be("skillmap.play",{path:t||"",activity:n||""}),window.open(`${wn}#skillmapimport:${e}`)}}render(){const{status:e,signedIn:t,dispatchShowLoginModal:n}=this.props;if("locked"===e)return(0,$t.jsx)("div",{});const r=pxt.auth.hasIdentity()&&!t;return(0,$t.jsxs)("div",{className:"actions",children:[(0,$t.jsx)(Zt,{tabIndex:-1,className:"primary inverted",title:lf("Claim Reward"),label:lf("Claim Reward"),onClick:this.handleActionButtonClick}),(0,$t.jsx)(Zt,{tabIndex:-1,className:"primary inverted",title:lf("Play your game"),label:lf("Play your game"),onClick:this.handlePlayGameClick}),r&&(0,$t.jsx)(Zt,{tabIndex:-1,className:"tertiary",onClick:n,label:lf("Sign in to Save"),title:lf("Sign in to Save")})]})}}const ei=z(function(e,t){if(!e)return{};const n=t,r=e.maps[n.mapId],o=Je(e.user,e.pageSourceUrl,r,n.activityId);return{signedIn:e.auth.signedIn,previousHeaderId:null==o?void 0:o.headerId}},{dispatchOpenActivity:pt,dispatchShowCompletionModal:kt,dispatchShowLoginModal:xt})(Ja);class ti extends e.Component{render(){const{cloudStatus:e,signedIn:t}=this.props,n=pxt.cloud.cloudStatus[e];return(0,$t.jsx)("div",{className:"cloud-action",children:t?(0,$t.jsxs)("div",{className:"cloud-indicator",children:[(0,$t.jsx)("div",{className:`ui tiny cloudicon xicon ${n.icon}`,title:n.tooltip}),n.longStatus]}):(0,$t.jsx)("div",{})})}}const ni=z(function(e,t){const{user:n,pageSourceUrl:r,selectedItem:o}=e;let a="none";if(null!=o&&o.activityId){var i;const t=null===(i=Qe(n,r,o.mapId,o.activityId))||void 0===i?void 0:i.headerId;t&&(a=e.cloudState&&e.cloudState[t]||a)}else a="synced";return{signedIn:e.auth.signedIn,cloudStatus:a}},{})(ti);class ri extends e.Component{constructor(...e){super(...e),this.container=void 0,this.handleRef=e=>{e&&(this.container=e)}}getStatusLabel(e){switch(e){case"locked":return lf("Locked");case"completed":return lf("Completed");default:return null}}getStatusIcon(e){switch(e){case"locked":return"fas fa-lock";case"completed":return"fas fa-check-circle";default:return""}}componentDidUpdate(e){var t,n,r;if(this.container&&null!==(t=this.props.node)&&void 0!==t&&t.activityId&&(null===(n=e.node)||void 0===n?void 0:n.activityId)!==(null===(r=this.props.node)||void 0===r?void 0:r.activityId)&&!this.container.contains(document.activeElement)){const e=this.container.querySelectorAll("button[tabindex]");e.length&&e.item(0).focus()}}render(){const{mapId:e,title:t,subtitle:n,description:r,infoUrl:o,imageUrl:a,details:i,node:l,status:s,completedHeaderId:c,onFocusEscape:u,dispatchShowLoginModal:d,signedIn:p}=this.props,f=this.getStatusLabel(s),h=!l,m=l&&!nt(l),g=m&&l.tags||void 0,y=lf("Thumbnail for {0} activity in skillmap {1}",n?t:lf("starting"),n||t),v=pxt.auth.hasIdentity();return(0,$t.jsxs)("div",{className:"info-panel",ref:this.handleRef,children:[(0,$t.jsx)("div",{className:"info-panel-image",children:a?(0,$t.jsx)("img",{src:a,alt:y}):(0,$t.jsx)("i",{className:"fas fa-image"})}),(0,$t.jsxs)("div",{className:"info-panel-content",children:[n&&(0,$t.jsx)("div",{className:"info-panel-subtitle",children:n}),(0,$t.jsx)("div",{className:"info-panel-title",children:t}),f&&(0,$t.jsxs)("div",{className:"info-panel-label",children:[(0,$t.jsx)("i",{className:this.getStatusIcon(s)}),(0,$t.jsx)("span",{children:f})]}),(0,$t.jsx)("div",{className:"info-panel-description",children:r}),h&&o&&(0,$t.jsx)("a",{className:"info-panel-link",href:o,target:"_blank",rel:"noopener noreferrer",children:lf("Learning Outcomes")}),g&&g.length>0&&(0,$t.jsx)("div",{className:"info-panel-tags",children:g.map((e,t)=>(0,$t.jsx)("div",{children:e},t))}),(0,$t.jsx)("div",{className:"info-panel-detail",children:null==i?void 0:i.map((e,t)=>(0,$t.jsx)("div",{children:e},`detail_${t}`))}),(0,$t.jsx)("div",{className:"tablet-spacer"}),(0,$t.jsxs)(sn,{id:"info-panel-actions",onEscape:u,dontStealFocus:!0,arrowKeyNavigation:!0,includeOutsideTabOrder:!0,children:[!h&&(m?(0,$t.jsx)(Xa,{mapId:e,activityId:l.activityId,status:s,completedHeaderId:c}):(0,$t.jsx)(ei,{mapId:e,activityId:l.activityId,status:s})),v&&(0,$t.jsx)(ni,{})]}),v&&h&&!p&&(0,$t.jsx)(Zt,{className:"primary inverted sign-in-button",onClick:d,label:lf("Sign in to Save"),title:lf("Sign in to Save")})]})]})}}const oi=z(function(e,t){var n;const{user:r,pageSourceUrl:o,maps:a,selectedItem:i,infoUrl:l}=e,s=i&&(null===(n=e.maps[i.mapId])||void 0===n?void 0:n.activities[i.activityId]),c="activity"===(null==s?void 0:s.kind),u=[];let d,p,f;if(a)if(null!=i&&i.activityId&&a[i.mapId]){const t=a[i.mapId],{status:n,currentStep:r,maxSteps:o,completedHeadedId:l}=We(e.user,e.pageSourceUrl,t,i.activityId);d=n,f=l,c&&(u.push(o?`${r}/${o} ${lf("Steps")}`:lf("Not Started")),u.push(c?s.type:"")),t&&(p=t.displayName)}else if(r){const e=Object.keys(a);let t=0,n=0,i=0,l=0;e.forEach(e=>{const s=a[e].activities;Object.keys(s).filter(e=>"activity"==s[e].kind).forEach(a=>++n&&qe(r,o,e,a)&&++t),Object.keys(s).filter(e=>nt(s[e])).forEach(t=>++l&&qe(r,o,e,t)&&++i)}),u.push(`${t}/${n} ${lf("Complete")}`),u.push(l?`${i}/${l} ${lf("Reward(s)")}`:"")}return{mapId:null==i?void 0:i.mapId,title:(null==s?void 0:s.displayName)||e.title,subtitle:p,description:c?s.description:e.description,infoUrl:l,imageUrl:s?null==s?void 0:s.imageUrl:e.bannerImageUrl,node:s,status:d,details:u,completedHeaderId:f,signedIn:e.auth.signedIn}},{dispatchShowLoginModal:xt})(ri);var ai=n(3705);function ii(e,t){const n=function(e){const t={mapId:e.header.toLowerCase(),displayName:e.attributes.name||di(e,"name")||e.header,description:e.attributes.description||di(e,"description"),completionUrl:e.attributes.completionurl,prerequisites:[],activities:{},allowCodeCarryover:!e.attributes.allowcodecarryover||!ci(e.attributes.allowcodecarryover)};if("manual"===e.attributes.layout&&(t.layout="manual"),e.attributes.required){const n=e.attributes.required.split(",");for(const e of n){const n=/^\s*(?:(\d+) +)?(.+)$/.exec(e);n[1]?t.prerequisites.push({type:"tag",tag:n[2].trim(),numberCompleted:parseInt(n[1])}):t.prerequisites.push({type:"map",mapId:n[2].trim()})}}return t}(e),r=t.map(li),o=r.filter(e=>"activity"===e.kind);n.allowCodeCarryover&&o.forEach(e=>{void 0===e.allowCodeCarryover&&(e.allowCodeCarryover=!0)}),n.root=r[0];for(const e of r)n.activities[e.activityId]&&yi(`Duplicate activity id '${e.activityId}' in map '${n.mapId}'`),n.activities[e.activityId]=e;for(const e of r)for(const t of e.nextIds)n.activities[t]||yi(`Unknown activity id '${t}' in map '${n.mapId}'`),e.next.push(n.activities[t]);const a={};!function e(t,r={}){if(r[t.activityId])ai.warn(`Loop in map '${n.mapId}' detected`);else{r[t.activityId]=!0,a[t.activityId]=!0;for(const n of t.next)e(n,{...r})}}(n.root);for(const e of r)a[e.activityId]||ai.warn(`Unreachable activity detected '${e.activityId}' in map '${n.mapId}'`);return n}function li(e){const t={activityId:e.header.toLowerCase(),imageUrl:e.attributes.imageurl,next:[],displayName:e.attributes.name||di(e,"name")||e.header,nextIds:gi(e.attributes.next)};if(e.attributes.position){const n=e.attributes.position.split(" ");t.position={depth:parseInt(n[0])||0,offset:parseInt(n[1])||0}}if(e.attributes.edges){var n;t.edges=[];const r=gi(e.attributes.edges,!1,";");null===(n=t.nextIds)||void 0===n||n.forEach((e,n)=>{var o;const a=gi(r[n])||[];null===(o=t.edges)||void 0===o||o.push(a.map(e=>{const t=e.split(" ");return{depth:parseInt(t[0])||0,offset:parseInt(t[1])||0}}))})}return"reward"===e.attributes.kind||"completion"===e.attributes.kind?function(e,t){var n,r,o;const a={...t,kind:e.attributes.kind||"reward"};if(e.attributes.type&&"certificate"===e.attributes.type.toLowerCase()&&(a.rewards||(a.rewards=[]),null===(n=a.rewards)||void 0===n||n.push({type:"certificate",url:e.attributes.url})),null!==(r=e.listAttributes)&&void 0!==r&&r.actions){const t=[],n=e.listAttributes.actions.items.filter(e=>"string"==typeof e);for(const e of n){let[n,...r]=e.split(":");const o=/\s*\[\s*(.*)\s*\](?:\(([^\s]+)\))?/gi.exec(r.join(":")),a=null==o?void 0:o[1],i=null==o?void 0:o[2];switch(n){case"activity":t.push({kind:"activity",label:a,activityId:i});break;case"map":if(i){let e=fi(i)?"github":hi(i)?"docs":void 0;e||yi(`URL: ${i} must be to Github or MakeCode documentation`),t.push({kind:"map",label:a,url:`#${e}:${i}`})}break;case"tutorial":i&&(fi(i)||hi(i)||yi(`URL: ${i} must be to Github or MakeCode documentation`),t.push({kind:"tutorial",label:a,url:`/#tutorial:${i}`}));break;case"docs":if(i){let e=(i.startsWith("/")?"":"/")+i;hi(e)||yi(`URL: ${e} must be to MakeCode documentation`),t.push({kind:"docs",label:a,url:e})}break;case"editor":t.push({kind:"editor",label:a})}}t.length&&(a.actions=t)}if(null!==(o=e.listAttributes)&&void 0!==o&&o.rewards){const t=[],n=e.listAttributes.rewards;for(const r of n.items)if("string"==typeof r){let[e,...n]=r.split(":");switch(e){case"certificate":t.push({type:"certificate",url:n.join(":").trim()});break;case"completion-badge":t.push({type:"completion-badge",imageUrl:n.join(":").trim()})}}else if("certificate"===r.key){const n=r.items.filter(e=>"string"==typeof e),o={type:"certificate"};for(const e of n){let[t,...n]=e.split(":");"url"===t&&(o.url=n.join(":").trim()),"previewurl"!==t&&"preview"!==t||(o.previewUrl=n.join(":").trim())}o.url||yi(`Certificate in activity ${e.header} is missing url attribute`),t.push(o)}else if("completion-badge"===r.key){const n=r.items.filter(e=>"string"==typeof e),o={type:"completion-badge"};for(const e of n){let[t,...n]=e.split(":");"imageurl"!==t&&"image"!==t||(o.imageUrl=n.join(":").trim()),"displayname"!==t&&"name"!==t||(o.displayName=n.join(":").trim())}o.imageUrl||yi(`completion-badge in activity ${e.header} is missing imageurl attribute`),t.push(o)}const r=["completion-badge","certificate"];t.sort((e,t)=>r.indexOf(e.type)-r.indexOf(t.type)),t.length&&(a.rewards=t)}return"completion"===a.kind&&(a.showMultiplayerShare=si(e.attributes.showmultiplayershare)),a}(e,t):"layout"===e.attributes.kind?function(e,t){return{...t,kind:"layout",next:[]}}(0,t):function(e,t){const n={...t,kind:"activity",description:e.attributes.description||di(e,"description"),url:e.attributes.url,tags:gi(e.attributes.tags),allowCodeCarryover:!e.attributes.allowcodecarryover||!ci(e.attributes.allowcodecarryover)};if(e.attributes.type){const t=e.attributes.type.toLowerCase();"tutorial"===t&&(n.type=t)}if(e.attributes.editor){const t=e.attributes.editor.toLowerCase();switch(t){case"py":case"blocks":case"js":n.editor=t;break;default:n.editor="blocks"}}return n.url||yi(`Activity '${n.activityId}' is missing attribute 'url'`),n.type||yi(`Activity '${n.activityId}' is missing attribute 'type'`),n}(e,t)}function si(e){if(!e)return!1;switch(e.toLowerCase().trim()){case"1":case"yes":case"y":case"on":case"true":return!0;default:return!1}}function ci(e){if(!e)return!1;switch(e.toLowerCase().trim()){case"0":case"no":case"n":case"off":case"false":return!0;default:return!1}}function ui(e){const t=e.attributes.primarycolor,n=e.attributes.secondarycolor,r=e.attributes.tertiarycolor,o=e.attributes.highlightcolor,a=e.attributes.unlockednodecolor,i=e.attributes.lockednodecolor,l=e.attributes.completednodecolor,s=di(e,"intro");return{title:e.attributes.name||di(e,"name")||e.header,description:e.attributes.description||di(e,"description"),infoUrl:mi(e.attributes.infourl),backgroundImageUrl:e.attributes.backgroundurl,pixelatedBackground:si(e.attributes.pixelatedbackground),bannerImageUrl:e.attributes.bannerurl,alternateSources:gi(e.attributes.alternatesources),theme:{backgroundColor:r||"var(--pxt-target-background1)",pathColor:t||"#BFBFBF",strokeColor:"#000000",rewardNodeColor:o||"var(--pxt-primary-background)",rewardNodeForeground:o?pi(o):"#000000",unlockedNodeColor:a||n||"var(--pxt-secondary-background)",unlockedNodeForeground:a||n?pi(a||n):"#000000",lockedNodeColor:i||t||"#BFBFBF",lockedNodeForeground:i||t?pi(i||t):"#000000",completedNodeColor:l||n||"var(--pxt-secondary-background)",completedNodeForeground:l||n?pi(l||n):"#000000",selectedStrokeColor:o||"var(--pxt-primary-background)",pathOpacity:.5},introductoryModal:s}}function di(e,t){var n,r,o;return null===(n=e.codeBlocks)||void 0===n||null===(r=n.find(e=>e.languageCode===t))||void 0===r||null===(o=r.content)||void 0===o?void 0:o.trim()}function pi(e){return e=e.replace("#",""),Number.parseInt(e.slice(0,2),16)+Number.parseInt(e.slice(2,4),16)+Number.parseInt(e.slice(4),16)>382.5?"#000000":"#ffffff"}function fi(e){return e.match(/^(https?:\/\/)?(www\.)?github\.com\//gi)}function hi(e){return e.indexOf(".")<0}function mi(e){if(e)return fi(e)?e.replace(/\?[\s\S]+$/gi,""):hi(e)?`${e.startsWith("/")?"":"/"}${e}`:void yi(`URL: ${e} must be to Github or MakeCode documentation`)}function gi(e,t=!1,n=","){if(!e)return[];const r=e.split(n).map(e=>e.trim().toLowerCase()).filter(e=>!!e);if(!t){let e={};return r.forEach(t=>e[t]=t),Object.keys(e)}return r}function yi(e){throw e}function vi(e,t){Hn({kind:e,text:t,hc:!1})}const bi=e=>{const{onBadgeClick:t,availableBadges:n,userState:r}=e,o=n.slice();let a={};for(const e of r.badges){a[e.id]=!0;const t=o.findIndex(t=>t.id===e.id);t>-1?o[t]={...o[t],timestamp:o[t].timestamp||e.timestamp}:o.push(e)}const i=[];for(let e=0;e<Math.max(o.length+10,20);e++)i.push((0,$t.jsx)("div",{className:"placeholder-badge"},e));return(0,$t.jsxs)("div",{className:"profile-badge-list",children:[(0,$t.jsxs)("div",{className:"profile-badge-header",id:"profile-badge-header",children:[(0,$t.jsx)("span",{className:"profile-badge-title",children:lf("Badges")}),(0,$t.jsx)("span",{className:"profile-badge-subtitle",children:lf("Click each badge to see details")})]}),(0,$t.jsx)("div",{className:"profile-badges-scroller",children:(0,$t.jsxs)("div",{className:"profile-badges",role:"list","aria-labelledby":"profile-badge-header",children:[(0,$t.jsx)("div",{className:"profile-badges-background-container","aria-hidden":"true",children:(0,$t.jsx)("div",{className:"profile-badges-background",children:i})}),o.map(e=>(0,$t.jsxs)("div",{className:"profile-badge-and-title",role:"listitem",children:[(0,$t.jsx)(In,{onClick:t,badge:e,disabled:!a[e.id]}),(0,$t.jsx)("div",{className:"profile-badge-name",children:e.title})]},e.id))]})})]})},ki=e=>{const{message:t,icon:n,actionText:r,link:o,xicon:a,title:i}=e.notification;return(0,$t.jsxs)("div",{className:"profile-notification",children:[(0,$t.jsx)("div",{className:"profile-notification-icon",children:(0,$t.jsx)("i",{className:`${a?"xicon":"ui large circular icon "} ${n}`})}),(0,$t.jsx)("div",{className:"profile-notification-title",children:i}),(0,$t.jsx)("div",{className:"profile-notification-message",children:t}),(0,$t.jsxs)("button",{className:"ui icon button profile-notification-button",onClick:()=>{window.open(o,"_blank")},role:"link",children:[(0,$t.jsx)("i",{className:"icon external alternate"}),r]})]})},wi=e=>{const{profile:t,onSignOutClick:n,onDeleteProfileClick:r,onEmailCheckClick:o,notification:a,emailChecked:i}=e,{username:l,displayName:s,picture:c,pictureUrl:u}=t.idp,d=null!=u?u:null==c?void 0:c.dataUrl,p=(0,$t.jsxs)($t.Fragment,{children:[i===Wt.Waiting?(0,$t.jsx)("div",{className:"common-spinner"}):void 0,lf("I would like to receive the MakeCode newsletter. "),(0,$t.jsx)("a",{href:"https://makecode.com/privacy",target:"_blank",rel:"noopener noreferrer",tabIndex:0,children:lf("View Privacy Statement")})]});return(0,$t.jsxs)("div",{className:"profile-user-pane",children:[(0,$t.jsx)("div",{className:"profile-portrait",children:d?(0,$t.jsx)("div",{children:(0,$t.jsx)("img",{src:d,alt:pxt.U.lf("Profile Picture"),referrerPolicy:"no-referrer"})}):(0,$t.jsx)("div",{className:"profile-initials-portrait",children:pxt.auth.userInitials(t)})}),(0,$t.jsxs)("div",{className:"profile-user-details",children:[(0,$t.jsx)("div",{className:"profile-display-name",children:s}),l&&(0,$t.jsx)("div",{className:"profile-username",children:l})]}),a&&(0,$t.jsx)(ki,{notification:a}),(0,$t.jsx)("div",{className:"profile-spacer"}),(0,$t.jsx)("div",{className:"profile-email",children:(0,$t.jsx)(un,{id:"profile-email-checkbox",className:i===Wt.Waiting?"loading":"",isChecked:i===Wt.Selected,onChange:o,label:p})}),(0,$t.jsxs)("div",{className:"profile-actions",children:[(0,$t.jsx)(Zt,{className:"link-button",title:lf("Delete Profile"),label:lf("Delete Profile"),onClick:r}),(0,$t.jsx)(Zt,{className:"sign-out",leftIcon:"fas fa-sign-out-alt",title:lf("Sign Out"),label:lf("Sign Out"),onClick:n})]})]})},xi=e=>{const{badge:t}=e,n=new Date(t.timestamp);return(0,$t.jsxs)("div",{className:"profile-badge-info",children:[(0,$t.jsx)("div",{className:"profile-badge-info-image",children:(0,$t.jsx)(In,{badge:t,disabled:!t.timestamp})}),(0,$t.jsxs)("div",{className:"profile-badge-info-item",id:"profile-badge-info-"+t.id,children:[(0,$t.jsx)("div",{className:"profile-badge-info-header",children:lf("Awarded For:")}),(0,$t.jsx)("div",{className:"profile-badge-info-text",children:Si(t)})]}),t.timestamp?(0,$t.jsxs)("div",{className:"profile-badge-info-item",children:[(0,$t.jsx)("div",{className:"profile-badge-info-header",children:lf("Awarded On:")}),(0,$t.jsx)("div",{className:"profile-badge-info-text",children:n.toLocaleDateString(pxt.U.userLanguage())})]}):void 0]})},Si=e=>{if("skillmap-completion"===e.type)return(0,$t.jsx)("span",{children:Bt(lf("Completing {0}"),(0,$t.jsx)("a",{tabIndex:0,"aria-labelledby":"profile-badge-info-"+e.id,target:"_blank",rel:"noopener noreferrer",href:Ci(e.sourceURL),children:pxt.U.rlf(e.title)}))})};function Ci(e){if(-1!==e.indexOf("/api/md/")){var t;const n=e.split("/api/md/")[1].split("/").slice(1).join("/");return(null===(t=pxt.webConfig)||void 0===t?void 0:t.skillmapUrl)+"#docs:"+n}{const t=e.split("#");if(2==t.length)return pxt.webConfig.skillmapUrl+"#github:https://github.com/"+t[0]+"/"+t[1]}return pxt.BrowserUtils.isLocalHostDev()?"http://localhost:3000#local:"+e:e}const Ei=e=>{var t,n,r,o,a;const{user:i,signOut:l,deleteProfile:s,onClickedEmail:c,notification:u,checkedEmail:d,showModalAsync:p}=e,f=(null==i?void 0:i.profile)||{idp:{}},h=(null==i||null===(t=i.preferences)||void 0===t?void 0:t.badges)||{badges:[]},m=(null===(n=pxt.appTarget)||void 0===n||null===(r=n.cloud)||void 0===r?void 0:r.showBadges)||!1,g=null===(o=pxt.appTarget.appTheme)||void 0===o?void 0:o.condenseProfile,y=null===(a=pxt.appTarget.appTheme)||void 0===a?void 0:a.cloudProfileIcon;return(0,$t.jsxs)("div",{className:"user-profile",children:[(0,$t.jsx)(wi,{profile:f,onSignOutClick:l,onDeleteProfileClick:s,notification:u,emailChecked:d,onEmailCheckClick:c}),m&&(0,$t.jsx)(bi,{availableBadges:pxt.appTarget.defaultBadges||[],userState:h,onBadgeClick:e=>{p({header:lf("{0} Badge",e.title),size:"tiny",hasCloseIcon:!0,onClose:()=>{const e=document.body.querySelector(".common-modal-container.fullscreen [tabindex]");e&&e.focus()},jsx:(0,$t.jsx)(xi,{badge:e})})}}),g&&(0,$t.jsxs)("div",{className:"profile-info-container",children:[(0,$t.jsx)("p",{className:"profile-info",children:lf("Now that you're logged in, your projects will be automatically saved to the cloud so you can access them from any device!")}),y&&(0,$t.jsx)("img",{className:"ui image centered medium",src:y,alt:""})]})]})};class Ii extends e.Component{constructor(e){super(e),this.renderUserProfile=()=>{const{profile:e,preferences:t}=this.props,{notification:n,modal:r,emailSelected:o}=this.state;return(0,$t.jsxs)(En,{title:lf("My Profile"),fullscreen:!0,onClose:this.handleOnClose,parentElement:document.querySelector(".app-container")||void 0,children:[(0,$t.jsx)(Ei,{user:{profile:e,preferences:t},signOut:this.handleSignout,deleteProfile:this.handleDeleteAccountClick,notification:n,showModalAsync:this.showModalAsync,checkedEmail:o,onClickedEmail:this.handleEmailClick}),r&&(0,$t.jsx)(En,{title:r.header,onClose:this.closeModal,className:r.className,children:r.jsx})]})},this.avatarPicUrl=()=>{var e,t,n,r;const{profile:o}=this.props;return null!==(e=null==o||null===(t=o.idp)||void 0===t?void 0:t.pictureUrl)&&void 0!==e?e:null==o||null===(n=o.idp)||void 0===n||null===(r=n.picture)||void 0===r?void 0:r.dataUrl},this.handleOnClose=()=>{this.props.dispatchCloseUserProfile()},this.handleSignout=async()=>{pxt.tickEvent("skillmap.userprofile.signout"),Rt(location.hash)},this.handleDeleteAccountClick=async()=>{this.props.dispatchShowDeleteAccountModal()},this.handleEmailClick=e=>{this.setState({emailSelected:Wt.Waiting}),async function(e){return await zt({op:"replace",path:["email"],value:e},{immediate:!0})}(e).then(t=>{var n,r;null!=t&&t.success?(r=lf("Settings saved"),pxt.debug(r),vi("info",r),this.setState({emailSelected:null!==(n=t.res)&&void 0!==n&&n.email?Wt.Selected:Wt.Unselected})):(function(e){pxt.tickEvent("notification.error",{message:e}),vi("err",e)}(lf("Oops, something went wrong")),this.setState({emailSelected:e?Wt.Unselected:Wt.Selected}))})},this.showModalAsync=async e=>{this.setState({modal:e})},this.closeModal=()=>{var e;const t=null===(e=this.state.modal)||void 0===e?void 0:e.onClose;this.setState({modal:void 0}),t&&t()},Ft().then(e=>this.setState({emailSelected:null!=e&&e.email?Wt.Selected:Wt.Unselected})),pxt.targetConfigAsync().then(e=>this.setState({notification:e.profileNotification}))}render(){const{showProfile:e}=this.props;return e?this.renderUserProfile():(0,$t.jsx)("div",{})}}const Ti=z(function(e,t){return e?{signedIn:e.auth.signedIn,profile:e.auth.profile,showProfile:e.showProfile,preferences:e.auth.preferences}:{}},{dispatchCloseUserProfile:yt,dispatchShowDeleteAccountModal:()=>St({type:"delete-account"})})(Ii);class ji{constructor(){this.sendMessageAsync=void 0}exportCloudProjectsToLocal(e){return this.sendMessageAsync({type:"pxteditor",action:"convertcloudprojectstolocal",userId:e})}}class Ni{constructor(){this.promise_=void 0,this.resources=void 0,this.appMounted=void 0,this.resolve=void 0,this.promise=()=>this.promise_,this.resources=new ji,this.promise_=new Promise(e=>{this.resolve=e,this.checkComplete()})}setSendMessageAsync(e){this.resources.sendMessageAsync=e,this.checkComplete()}setAppMounted(){this.appMounted=!0,this.checkComplete()}checkComplete(){var e;this.resolve&&this.appMounted&&this.resources.sendMessageAsync&&(ut.dispatch((e=this.resources,{type:Ce,resources:e})),this.resolve(this.resources))}}class Ai extends e.Component{constructor(e){super(e),this.handleClick=this.handleClick.bind(this)}handleClick(){this.props.onClick(this.props.langId)}render(){const{name:e,ariaLabel:t,description:n}=this.props;return(0,$t.jsx)(Zt,{className:"ui card link card-selected language-card",onClick:this.handleClick,role:"listitem",ariaLabel:t,title:e,label:(0,$t.jsxs)("div",{className:"language-card-container",children:[(0,$t.jsx)("div",{className:"language-card-header",children:e}),(0,$t.jsx)("div",{className:"language-card-description ui desktop only",children:n})]})})}}const Pi=["en"];class Oi extends e.Component{constructor(e){super(e),this.changeLanguage=this.changeLanguage.bind(this)}languageList(){var e;return pxt.appTarget.appTheme.selectLanguage&&null!==(e=pxt.appTarget.appTheme.availableLocales)&&void 0!==e&&e.length?pxt.appTarget.appTheme.availableLocales:Pi}changeLanguage(e){pxt.Util.allLanguages[e]&&(this.props.onLanguageChanged(e),this.props.onClose())}render(){const e=pxt.appTarget.appTheme,t=this.languageList();return(0,$t.jsxs)(En,{onClose:this.props.onClose,title:lf("Select Language"),className:"language-selector-modal",children:[(0,$t.jsx)("div",{className:"ui cards centered language-selector",role:"list","aria-label":lf("List of available languages"),children:t.map(e=>{const t=pxt.Util.allLanguages[e];return(0,$t.jsx)(Ai,{langId:e,name:t.localizedName,ariaLabel:t.englishName,description:t.englishName,onClick:this.changeLanguage},e)})}),e.crowdinProject?(0,$t.jsx)(jn,{"aria-label":lf("How do I add a new language?"),href:"/translate",target:"_blank",children:lf("How do I add a new language?")}):void 0]})}}const _i=t=>{const{theme:n}=t,r=e.useRef(null),o=`theme-preview-container-${n.id}`,a=`theme-preview-${n.id}`,i=(0,$t.jsx)("img",{className:"logo",src:"/static/logo/Microsoft_logo_rgb_W-white_D-square.png",alt:"Microsoft MakeCode Logo"});return e.useEffect(()=>{if(null!=r&&r.current){const e=kn(n);r.current.textContent=`.${o} { ${e} }`}},[n]),(0,$t.jsxs)("div",{className:qt("theme-preview-container",o),"aria-hidden":"true",children:[(0,$t.jsx)("style",{ref:r}),(0,$t.jsxs)("div",{className:qt("theme-preview",a),children:[(0,$t.jsxs)("div",{className:"theme-preview-header",children:[i,(0,$t.jsx)("i",{className:"fas fa-user-circle"})]}),(0,$t.jsxs)("div",{className:"theme-preview-workspace",children:[(0,$t.jsxs)("div",{className:"theme-preview-sim-sidebar",children:[(0,$t.jsx)("div",{className:"theme-preview-sim"}),(0,$t.jsxs)("div",{className:"theme-preview-sim-buttons",children:[(0,$t.jsx)("div",{className:"theme-preview-sim-button"}),(0,$t.jsx)("div",{className:"theme-preview-sim-button"}),(0,$t.jsx)("div",{className:"theme-preview-sim-button"})]})]}),(0,$t.jsxs)("div",{className:"theme-preview-toolbox",children:[(0,$t.jsx)("hr",{className:"toolbox-divider"}),(0,$t.jsx)("hr",{className:"toolbox-divider"}),(0,$t.jsx)("hr",{className:"toolbox-divider"})]}),(0,$t.jsx)("div",{className:"theme-preview-workspace-content"})]}),(0,$t.jsxs)("div",{className:"theme-preview-footer",children:[(0,$t.jsx)("div",{className:"theme-preview-download-button"}),(0,$t.jsxs)("div",{className:"theme-preview-editor-tools",children:[(0,$t.jsx)("div",{className:"theme-preview-editor-tool-button"}),(0,$t.jsx)("div",{className:"theme-preview-editor-tool-button"})]})]})]})]})},Ri=e=>{const{id:t,className:n,role:r,children:o,ariaDescribedBy:a,ariaLabelledBy:i,ariaPressed:l,ariaHidden:s,ariaLabel:c,onClick:u,label:d,labelClass:p,tabIndex:f}=e;return(0,$t.jsxs)("div",{id:t,className:qt("common-card",n),role:r,"aria-hidden":s,"aria-label":c,children:[(0,$t.jsxs)("div",{className:"common-card-body",children:[u&&(0,$t.jsx)("button",{className:"common-card-action",tabIndex:f,"aria-describedby":a,"aria-labelledby":i,"aria-pressed":l,onClick:u}),o]}),d&&(0,$t.jsx)("label",{className:qt("common-card-label",p),children:d})]})},Mi=e=>{const{onClick:t,selected:n,theme:r}=e,o=pxt.Util.rlf(`{id:color-theme-name}${r.name}`);return(0,$t.jsx)(Ri,{className:"theme-card"+(n?" selected":""),role:"listitem",ariaLabelledBy:r.id+"-title",ariaPressed:n,onClick:()=>t(r),tabIndex:0,children:(0,$t.jsxs)("div",{className:"theme-info-box",children:[(0,$t.jsx)(_i,{theme:r}),(0,$t.jsx)("div",{id:r.id+"-title",className:"theme-picker-item-name",children:o})]})},r.id)};function Li(t,n){const[r,o]=e.useState(!1),[a,i]=e.useState(!1),[l,s]=e.useState(!1),c=e.useRef(!1),u=e.useRef(!1);e.useEffect(()=>{var e,n;!r&&u.current&&(null===(e=document.getElementById(t))||void 0===e||null===(n=e.querySelector(".theme-reset-button"))||void 0===n||n.focus(),u.current=!1)},[r,t]);const d=()=>{c.current||(u.current=!0,o(!1))},p=n?{label:lf("Reset"),className:"primary inverted theme-reset-button",onClick:()=>{s(!1),o(!0)}}:void 0,f=r&&(0,$t.jsxs)(En,{title:lf("Reset all themes?"),ariaDescribedBy:"theme-reset-description",onClose:d,hideDismissButton:a,actions:[{label:lf("Cancel"),onClick:d,disabled:a},{label:a?lf("Resetting..."):lf("Reset"),className:"primary",onClick:async()=>{if(n&&!c.current){c.current=!0,i(!0),s(!1);try{await n()}catch(e){pxt.reportException(e),s(!0)}finally{c.current=!1,i(!1)}}},disabled:a}],children:[(0,$t.jsx)("p",{id:"theme-reset-description",children:lf("Are you sure you want to reset the editor and simulator themes to their defaults? This will remove your editor-wide theme customizations. Themes set directly on projects will not be changed. This action cannot be undone.")}),l&&(0,$t.jsx)("p",{role:"alert",children:lf("Unable to reset themes. Please try again.")})]},"theme-reset-confirmation");return{resetAction:p,confirmation:f}}const Ui=e=>{const{selected:t,onModeChanged:n}=e,r=e=>{e!==t&&n(e)};return(0,$t.jsx)("div",{className:"theme-picker-toggle",children:(0,$t.jsx)(An,{id:"theme-picker-toggle",ariaLabel:lf("Theme type"),selected:"editor"===t?0:1,items:[{label:lf("Editor"),title:lf("Editor theme"),icon:"fas fa-paint-brush",focusable:!0,onClick:()=>r("editor")},{label:lf("Simulator"),title:lf("Simulator theme"),icon:"fas fa-gamepad",focusable:!0,onClick:()=>r("simulator")}]})})},Di=t=>{var n;const[r,o]=e.useState(t.selectedThemeId||(null===(n=t.themes[0])||void 0===n?void 0:n.id)),a=t.themes.find(e=>e.id===r),{resetAction:i,confirmation:l}=Li("theme-picker-modal",t.onReset);return l||(0,$t.jsx)(En,{id:"theme-picker-modal",title:lf("Choose a Theme"),hideTitle:!!t.onSimulatorThemeClicked,onClose:t.onClose,className:t.onSimulatorThemeClicked?"theme-picker-modal":"theme-picker-modal standalone",rightHeader:t.onSimulatorThemeClicked&&(0,$t.jsx)(Ui,{selected:"editor",onModeChanged:t.onSimulatorThemeClicked}),actions:[...i?[i]:[],{label:lf("Apply"),className:"primary",disabled:!a,onClick:()=>a&&t.onSave(a)}],children:(0,$t.jsx)("div",{className:"theme-picker",role:"list","aria-label":lf("List of available themes"),children:t.themes.map(e=>(0,$t.jsx)(Mi,{theme:e,selected:e.id===r,onClick:e=>{o(e.id),t.onThemeChanged(e)}},e.id))})})};function Fi(e,t,n,r){if(null==r||!r.length||(null==t?void 0:t.id)===(null==n?void 0:n.id))return e;const o=zi(n,r);if(!o)return e;if(e){if(e.presetId!==o.presetId)return e;if(pxt.auth.simulatorThemeColorsEqual(e.theme,o.theme)&&e.theme.layout===o.theme.layout)return e}else if(null==n||!n.defaultSimulatorTheme)return e;return o}function zi(e,t){const n=(null==t?void 0:t.find(e=>"default"===e.id))||(null==t?void 0:t[0]);if(!n)return;const r=null==e?void 0:e.defaultSimulatorTheme,o="string"==typeof r?null==t?void 0:t.find(e=>e.id===r):void 0,a="object"==typeof r?{...n.theme,...r}:(null==o?void 0:o.theme)||n.theme;return{presetId:n.id,theme:$i(a)}}function $i(e){const t={layout:e.layout||pxt.auth.DEFAULT_SIMULATOR_LAYOUT};for(const n of Object.keys(e))pxt.auth.isSimulatorThemeColorProperty(n)&&pxt.auth.isSimulatorThemeColor(e[n])&&(t[n]=e[n]);return t}function Bi(e,t,n=[]){const r=$i(e);r.layout=t;for(const e of n)pxt.auth.isSimulatorThemeColor(r[e.property])||(r[e.property]=e.defaultValue);return r}let Hi,qi,Wi,Vi={baseTheme:"PublisherLightTheme"};const Gi=e=>{var t,n;if(e.data.Event){const r=e.data;switch(r.Event){case"InAppFeedbackInitOptions":Ki();break;case"InAppFeedbackOnError":pxt.warn("Error Message: ",r.EventArgs);break;case"InAppFeedbackInitializationComplete":pxt.debug("InAppFeedbackInitializationComplete: ",r.EventArgs);break;case"InAppFeedbackOnSuccess":pxt.debug("InAppFeedbackOnSuccess: ",r.EventArgs);break;case"InAppFeedbackDismissWithResult":pxt.debug("InAppFeedbackDismissWithResult: ",r.EventArgs),null===(t=qi)||void 0===t||null===(n=t.onDismiss)||void 0===n||n.call(t)}}},Ki=()=>{(e=>{const t=document.getElementById(Wi);var n,r;t&&t.contentWindow.postMessage(e,null===(n=pxt.webConfig)||void 0===n||null===(r=n.ocv)||void 0===r?void 0:r.iframeEndpoint)})({event:"InAppFeedbackInitOptions",data:Hi})},Qi=e=>{const{kind:t,onClose:n}=e,r="rating"===t?lf("Rate this activity"):lf("Leave Feedback for Microsoft");return(0,$t.jsx)(En,{className:"feedback-modal",title:r,onClose:n,children:(0,$t.jsx)(Yi,{kind:t,onClose:n})})},Yi=t=>{var n,r,o,a;const{kind:i,onClose:l}=t,s="rating"===i?{feedbackUiType:"NoSurface",hostPlatform:"IFrame",isDisplayed:!0,isEmailCollectionEnabled:!1,isFileUploadEnabled:!1,isScreenshotEnabled:!1,isScreenRecordingEnabled:!1,invokeOnDismissOnEsc:!1,isFeedbackForumEnabled:!1,isMyFeedbackEnabled:!1,isThankYouPageDisabled:!1,initialFeedbackType:"Unclassified",scenarioConfig:{isScenarioEnabled:!0,scenarioType:"Custom",questionDetails:{questionUiType:"Rating",questionInstruction:{displayedStringInEnglish:"What did you think of this activity?",displayedString:lf("What did you think of this activity?")},questionOptions:[{displayedStringInEnglish:"Boring",displayedString:lf("Boring")},{displayedStringInEnglish:"Not fun",displayedString:lf("Not fun")},{displayedStringInEnglish:"Kinda fun",displayedString:lf("Kinda fun")},{displayedStringInEnglish:"Fun",displayedString:lf("Fun")},{displayedStringInEnglish:"Super fun",displayedString:lf("Super fun")}],questionUiBehaviour:["CommentNotRequired"]}}}:{feedbackUiType:"NoSurface",hostPlatform:"IFrame",isDisplayed:!0,isEmailCollectionEnabled:!1,isFileUploadEnabled:!1,isScreenshotEnabled:!1,isScreenRecordingEnabled:!1,invokeOnDismissOnEsc:!1,isFeedbackForumEnabled:!1,isMyFeedbackEnabled:!1,isThankYouPageDisabled:!1},c="rating"===i?"activity-feedback-frame":"menu-feedback-frame";let u={onDismiss:()=>{l&&l()}};return(0,e.useEffect)(()=>(((e,t,n)=>{var r,o;window.addEventListener("message",Gi),qi=n,Hi={appId:null===(r=pxt.webConfig)||void 0===r||null===(o=r.ocv)||void 0===o?void 0:o.appId,ageGroup:"Undefined",authenticationType:"Unauthenticated",clientName:"MakeCode",feedbackConfig:e,isProduction:!1,themeOptions:Vi,telemetry:{featureArea:pxt.appTarget.id,browser:pxt.BrowserUtils.browser(),browserVersion:pxt.BrowserUtils.browserVersion(),platform:pxt.BrowserUtils.os(),feedbackOrigin:t}},Wi=t})(s,c,u),()=>{window.removeEventListener("message",Gi)}),[]),(0,$t.jsx)($t.Fragment,{children:pxt.U.ocvEnabled()&&(0,$t.jsx)("iframe",{title:"feedback",id:c,src:`${null===(n=pxt.webConfig)||void 0===n||null===(r=n.ocv)||void 0===r?void 0:r.iframeEndpoint}/centrohost?appname=ocvfeedback&feature=host-ocv-inapp-feedback&platform=web&appId=${null===(o=pxt.webConfig)||void 0===o||null===(a=o.ocv)||void 0===a?void 0:a.appId}#/hostedpage`,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups"})})},Zi="custom",Xi="account";function Ji(e){const t=e.startsWith("#")?e:`#${e}`;return/^#[0-9a-f]{6}$/i.test(t)?t.toUpperCase():void 0}const el=t=>{var n;const{presets:r,layouts:o,initialPreference:a,defaultTheme:i,accountTheme:l,renderPreview:s,onEditorThemeClicked:c,onUseAccountTheme:u,onThemeChanged:d,onSave:p,onReset:f,onClose:h}=t,m=(null===(n=pxt.appTarget.simulator)||void 0===n?void 0:n.aspectRatio)||1.22,g={"--simulator-theme-aspect-ratio":m,"--simulator-theme-padding-bottom":100/m+"%"},y=function(e){const t={"background-color":lf("Console"),"button-stroke":lf("Button outline"),"text-color":lf("Button labels"),"button-fill":lf("Buttons"),"dpad-fill":lf("D-pad"),"joystick-handle-stroke":lf("Joystick handle outline")};return pxt.auth.DEFAULT_SIMULATOR_THEME_COLOR_PROPERTIES.map(n=>({property:n,label:t[n],defaultValue:e[n]}))}(r[0].theme),v=e=>{var t;const n=null==o||null===(t=o.find(t=>t.id===e))||void 0===t?void 0:t.colorFields;return(null==n?void 0:n.map(e=>({...e,label:pxt.Util.rlf(`{id:simulator-theme-field}${e.label}`)})))||y},b=r.find(e=>e.id===(null==a?void 0:a.presetId)),k=b?b.id:a?function(e,t){var n;return null===(n=t.find(t=>pxt.auth.simulatorThemeColorsEqual(t.theme,e)))||void 0===n?void 0:n.id}(a.theme,r)||Zi:u?Xi:r[0].id,w="default"===k?i||(null==a?void 0:a.theme)||(null==b?void 0:b.theme)||r[0].theme:(null==a?void 0:a.theme)||(null==b?void 0:b.theme)||l||r[0].theme,x=(null==a?void 0:a.theme.layout)||w.layout||pxt.auth.DEFAULT_SIMULATOR_LAYOUT,S=Bi(w,x,v(x)),[C,E]=e.useState(k),[I,T]=e.useState(S),j=I.layout,N=j===pxt.auth.DEFAULT_SIMULATOR_LAYOUT||(null==o?void 0:o.some(e=>e.id===j)),A=v(j),{resetAction:P,confirmation:O}=Li("simulator-theme-picker-modal",f),_=(e,t)=>{const n=Ji(t);if(!n)return;const r={...I,[e]:n};E(Zi),T(r),null==d||d({presetId:Zi,theme:r})};return O||(0,$t.jsx)(En,{id:"simulator-theme-picker-modal",title:lf("Simulator Theme"),hideTitle:!!c,className:"simulator-theme-picker-modal"+(c?"":" standalone"),onClose:h,rightHeader:c&&(0,$t.jsx)(Ui,{selected:"simulator",onModeChanged:c}),actions:[...P?[P]:[],{label:lf("Apply"),className:"primary",onClick:()=>C===Xi?null==u?void 0:u():p({presetId:C,theme:I})}],children:(0,$t.jsxs)("div",{className:"simulator-theme-picker",style:g,children:[s(I),(0,$t.jsxs)("div",{className:"simulator-theme-controls",children:[(0,$t.jsxs)("div",{className:"simulator-theme-select-field",children:[(0,$t.jsx)("label",{htmlFor:"simulator-theme-preset",children:u?lf("Theme"):lf("Built-in theme")}),(0,$t.jsxs)("select",{id:"simulator-theme-preset","aria-label":u?lf("Project simulator theme"):lf("Built-in simulator theme"),className:"simulator-theme-select",value:C,onChange:e=>(e=>{if(e===Xi&&u){E(e);const t=$i(l||r[0].theme);return void T(Bi(t,t.layout,v(t.layout)))}const t=r.find(t=>t.id===e);if(!t)return;const n=$i("default"===e&&i||t.theme),o=Bi(n,n.layout,v(n.layout));E(e),T(o),null==d||d({presetId:e,theme:o})})(e.target.value),children:[u&&(0,$t.jsx)("option",{value:Xi,children:lf("Use account theme")}),C===Zi&&(0,$t.jsx)("option",{value:Zi,disabled:!0,children:lf("Custom")}),r.map(e=>(0,$t.jsx)("option",{value:e.id,children:pxt.Util.rlf(`{id:simulator-theme-name}${e.name}`)},e.id))]})]}),!(null==o||!o.length)&&(0,$t.jsxs)("div",{className:"simulator-theme-select-field",children:[(0,$t.jsx)("label",{htmlFor:"simulator-theme-layout",children:lf("Layout")}),(0,$t.jsxs)("select",{id:"simulator-theme-layout","aria-label":lf("Simulator layout"),className:"simulator-theme-select",value:j,onChange:e=>(e=>{const t=Bi(I,e,v(e));E(Zi),T(t),null==d||d({presetId:Zi,theme:t})})(e.target.value),children:[(0,$t.jsx)("option",{value:pxt.auth.DEFAULT_SIMULATOR_LAYOUT,children:lf("Default")}),!N&&(0,$t.jsx)("option",{value:j,disabled:!0,children:lf("Custom ({0})",j)}),o.map(e=>(0,$t.jsx)("option",{value:e.id,children:pxt.Util.rlf(`{id:simulator-layout-name}${e.name}`)},e.id))]})]}),(0,$t.jsx)("div",{className:"simulator-theme-color-list",children:A.map(e=>(0,$t.jsxs)("div",{className:"simulator-theme-color",children:[(0,$t.jsx)("span",{children:e.label}),(0,$t.jsx)("input",{type:"color","aria-label":lf("{0} color",e.label),value:I[e.property],onChange:t=>_(e.property,t.target.value)}),(0,$t.jsx)(Rn,{ariaLabel:lf("{0} hex color",e.label),initialValue:I[e.property],onChange:t=>_(e.property,t),validator:(e,t)=>Ji(e)||t})]},e.property))})]})]})})},tl=e=>(0,$t.jsx)(el,{...e,renderPreview:e=>(0,$t.jsx)(nl,{theme:e})}),nl=t=>{const{theme:n}=t,r=e.useRef(null),o=function(){var e,t;if(De())return"http://localhost:3232/sim/simulator.html";const n=(null===(e=pxt.webConfig)||void 0===e?void 0:e.simUrl)||(null===(t=window.pxtConfig)||void 0===t?void 0:t.simUrl);return new URL(n||"/sim/simulator.html",window.location.origin).toString()}(),a=e.useRef(),i=()=>{var e;if(a.current!==o||null===(e=r.current)||void 0===e||!e.contentWindow)return;const t={type:"setsimtheme",theme:n};r.current.contentWindow.postMessage(t,new URL(o).origin)};return e.useEffect(i,[n,o]),(0,$t.jsx)("div",{className:"simulator-theme-preview",role:"group","aria-label":lf("Simulator theme preview"),children:(0,$t.jsx)("div",{className:"simframe ui embed",children:(0,$t.jsx)("iframe",{ref:r,src:o,title:lf("Simulator theme preview"),sandbox:"allow-same-origin allow-scripts",onLoad:()=>{a.current=o,i()}})})})};var rl=n(3705);class ol extends e.Component{constructor(e){super(e),this.queryFlags={},this.unsubscribeChangeListener=void 0,this.loadedUser=void 0,this.readyPromise=void 0,this.themeManager=void 0,this.themePickerInitialColorThemeId=void 0,this.ready=()=>this.readyPromise.promise(),this.handleHashChange=async e=>{await this.parseHashAsync(),e.stopPropagation(),e.preventDefault()},this.handleError=e=>{const t=e||lf("Oops! Couldn't load content, please check the URL and markdown file.");rl.error(t),this.setState({error:t})},this.onMakeCodeFrameLoaded=async e=>{this.readyPromise.setSendMessageAsync(e);const t=await Ut();t&&await e({type:"pxteditor",action:"setsimulatortheme",preference:t,savePreference:!1})},this.focusCurrentActivity=()=>{document.querySelector("[data-activity="+this.props.activityId+"] button").focus(),this.props.dispatchChangeSelectedItem(void 0)},this.onStoreChange=async()=>{const{user:e}=ut.getState();e===this.loadedUser||this.loadedUser&&e.id!==this.loadedUser.id||(!this.props.signedIn||this.props.signedIn&&this.state.cloudSyncCheckHasFinished)&&(await At(e),this.loadedUser=e),await this.syncBadgesAsync()},this.changeLanguage=this.changeLanguage.bind(this),this.changeTheme=this.changeTheme.bind(this),this.previewColorTheme=this.previewColorTheme.bind(this),this.showSimulatorThemePicker=this.showSimulatorThemePicker.bind(this),this.showEditorThemePicker=this.showEditorThemePicker.bind(this),this.closeThemePicker=this.closeThemePicker.bind(this),this.saveSimulatorTheme=this.saveSimulatorTheme.bind(this),this.resetEditorThemes=this.resetEditorThemes.bind(this),this.state={cloudSyncCheckHasFinished:!1,badgeSyncLock:!1},this.readyPromise=new Ni,window.addEventListener("hashchange",this.handleHashChange),this.cloudSyncCheckAsync(),this.themeManager=bn.getInstance(document)}async parseHashAsync(){var e,t;let n,r=await pxt.targetConfigAsync();const o=window.location.hash.replace("#","");var a;n=o&&null!==(e=r.skillMap)&&void 0!==e&&null!==(t=e.pathAliases)&&void 0!==t&&t[o]?Oe(r.skillMap.pathAliases[o]):Oe(window.location.hash||(null===(a=r.skillMap)||void 0===a?void 0:a.defaultPath)),await this.fetchAndParseSkillMaps(n.cmd,n.arg)}async initLocalizationAsync(){var e;const t=pxt.appTarget.appTheme,n=window.location.href;let r,o=!1;if(/[&?]translate=1/.test(n)&&!pxt.BrowserUtils.isIE())r=ts.pxtc.Util.TRANSLATION_LOCALE;else{const e=/(live)?(force)?lang=([a-z]{2,}(-[A-Z]+)?)/i.exec(window.location.href);e&&window.location.hash.indexOf(e[0])>=0&&pxt.BrowserUtils.changeHash(window.location.hash.replace(e[0],"")),r=e?e[3]:pxt.BrowserUtils.getCookieLang()||t.defaultLocale||navigator.userLanguage||navigator.language,o=!!e&&!!e[2]}const a=pxt.appTarget.appTheme.defaultLocale;o||pxt.Util.isLocaleEnabled(r)||(r=a);const i=pxt.appTarget.id,l=null===(e=r)||void 0===e?void 0:e.toLocaleLowerCase(),s=pxt.BrowserUtils.isLocalHostDev()&&(!l||(a?a.toLocaleLowerCase()===l:"en"===l||"en-us"===l));var c;pxt.BrowserUtils.isPxtElectron()||s||pxt.Util.enableLiveLocalizationUpdates(),await async function(e){const{targetId:t,baseUrl:n,force:r}=e;let{code:o}=e;const a=await pxt.Util.downloadTranslationsAsync(t,n,o,pxt.Util.liveLocalizationEnabled(),ts.pxtc.Util.TranslationsKind.SkillMap);a&&pxt.Util.setLocalizedStrings(a)}({targetId:i,baseUrl:"",code:r,force:o}),pxt.Util.isLocaleEnabled(r)&&(pxt.BrowserUtils.setCookieLang(r),pxt.Util.setUserLanguage(r),null===(c=pxt.analytics)||void 0===c||c.addDefaultProperties({lang:r})),o&&r&&this.setState({forcelang:r})}async fetchAndParseSkillMaps(e,t){const n=await async function(e,t,n){if(!e||!t)return;let r,o;switch(e){case"docs":return async function(e,t){const n=await pxt.Cloud.markdownAsync(_e(e),t);if(n)return{text:n,identifier:Re(e),status:"approved"}}(t,n);case"github":return await async function(e){const t=pxt.github.parseRepoId(e),n=await pxt.packagesConfigAsync()||{},r=pxt.github.parseRepoId(t.slug);let o,a="unknown";switch(pxt.github.repoStatus(r,n)){case pxt.github.GitRepoStatus.Banned:a="banned",o="https://github.com/"+t.fullName;break;case pxt.github.GitRepoStatus.Approved:a="approved",o=void 0;break;default:o="https://github.com/"+t.fullName}const i=t.tag||await pxt.github.latestVersionAsync(t.slug,n,!0);if(!i)return void pxt.log(`skillmap github tag not found at ${t.fullName}`);t.tag=i;const l=await pxt.github.downloadPackageAsync(`${t.slug}#${t.tag}`,n);if(l){const{identifier:e,fileName:n}=Me(t);return{text:pxt.tutorial.resolveLocalizedMarkdown(t,l.files,n),identifier:e,reportId:o,status:a}}}(t);case"local":return await async function(e){if(De()){e=e.replace(/^\//,"").replace(/\.md$/,"");let t=await fetch("docs/"+e+".md");return{text:await t.text(),identifier:e,status:"approved"}}}(t);default:r=t}if(pxt.BrowserUtils.isSafari())try{o=await Le(r)}catch(e){o=await Le(r)}else o=await Le(r);return{text:o,identifier:r,status:"unknown"}}(e,t,this.state.forcelang),r=null==n?void 0:n.text,o=null==n?void 0:n.identifier,a=null==n?void 0:n.status;let i;if(r&&o&&a)try{"banned"===a?this.handleError(lf("This GitHub repository has been banned.")):(function(e){$e=e}(o),this.props.dispatchSetPageSourceUrl(o,a),this.props.dispatchClearMetadata());const{maps:e,metadata:t}=function(e){const t=pxt.getSectionsFromMarkdownMetadata(e);null!=t&&t.length||yi(`Cannot parse content: ${e}`);const n=[];let r,o=-1;for(let e=0;e<t.length;e++)"single"===t[e].headerKind?r=ui(t[e]):"double"===t[e].headerKind&&(o>=0&&n.push(ii(t[o],t.slice(o+1,e))),o=e);return(o>0||0===n.length)&&n.push(ii(t[o],t.slice(o+1,t.length))),{maps:n,metadata:r}}(r);if((null==e?void 0:e.length)>0&&(i=e,this.props.dispatchClearSkillMaps(),e.forEach(e=>{this.props.dispatchAddSkillMap(e)})),t){const{title:e,description:n,infoUrl:r,backgroundImageUrl:o,pixelatedBackground:a,bannerImageUrl:i,theme:l,alternateSources:s,introductoryModal:c}=t;!function(e){ze=e}(e),this.props.dispatchSetPageTitle(e),n&&this.props.dispatchSetPageDescription(n),r&&this.props.dispatchSetPageInfoUrl(r),o&&this.props.dispatchSetPageBackgroundImageUrl(o,a),i&&this.props.dispatchSetPageBannerImageUrl(i),s&&this.props.dispatchSetPageAlternateUrls(s),l&&this.props.dispatchSetPageTheme(l),c&&this.props.dispatchSetModal({type:"markdown-intro",markdownContent:c})}this.setState({error:void 0})}catch(e){this.handleError(e)}else this.setState({error:lf("No content loaded.")});let l=await Nt();o&&!l.completedTags[o]&&(l.completedTags[o]={}),this.applyQueryFlags(l,i,o),this.loadedUser=l,this.props.dispatchSetUser(l);const s=await Ft();s&&this.props.dispatchSetUserPreferences(s)}async cloudSyncCheckAsync(){const e=await this.ready();if(await _t()){const t=async()=>{const t=ut.getState(),n=await jt();let r=await Nt(),o=at(n,t.pageSourceUrl,r);const a=(await e.sendMessageAsync({type:"pxteditor",action:"savelocalprojectstocloud",headerIds:o})).resp.headerIdMap;if(a){const e={...r,mapProgress:{}},o=Object.keys(n.mapProgress);for(const i of o){e.mapProgress[i]={...n.mapProgress[i]};const o=Object.keys(n.mapProgress[i]);for(const l of o)if(!Ye(r,i)){e.mapProgress[i][l]={...n.mapProgress[i][l]},e.completedTags[i]=n.completedTags[i];const r={};e.mapProgress[i][l].activityState=r;const o=n.mapProgress[i][l].activityState;for(const e of Object.keys(o)){const n=o[e];n.headerId?r[e]={...n,headerId:a[n.headerId]||n.headerId}:nt(t.maps[l].activities[e])&&(r[e]={...n})}}}const i=Object.keys(r.mapProgress);for(const t of i)Ye(r,t)&&(e.mapProgress[t]={...r.mapProgress[t]},e.completedTags[t]=r.completedTags[t]);this.props.dispatchSetUser(e),await At(e),r=e;const l=await Ft();l&&this.props.dispatchSetUserPreferences(l),await this.syncBadgesAsync()}await e.sendMessageAsync({type:"pxteditor",action:"requestprojectcloudstatus",headerIds:at(r,t.pageSourceUrl)}),this.setState({cloudSyncCheckHasFinished:!0,showingSyncLoader:!1})},n=1e4;await Promise.race([pxt.U.delay(n).then(()=>{this.state.cloudSyncCheckHasFinished||this.setState({cloudSyncCheckHasFinished:!0,showingSyncLoader:!1})}),t()])}else this.setState({cloudSyncCheckHasFinished:!0})}async initColorThemeAsync(){var e,t,n,r,o;const[a,i]=await Promise.all([Mt(),Lt()]);let l=a&&this.themeManager.isKnownTheme(a)?a:null===(e=pxt.appTarget)||void 0===e||null===(t=e.appTheme)||void 0===t?void 0:t.defaultColorTheme;const s=null===(n=pxt.appTarget)||void 0===n||null===(r=n.appTheme)||void 0===r?void 0:r.highContrastColorTheme;i&&s&&(l=s),l&&l!==(null===(o=this.themeManager.getCurrentColorTheme())||void 0===o?void 0:o.id)&&this.themeManager.switchColorTheme(l)}async componentDidMount(){this.unsubscribeChangeListener=ut.subscribe(this.onStoreChange),this.queryFlags=function(){const e={},t=window.location.search;return t&&new URLSearchParams(t).forEach((t,n)=>{"true"!==t.toLowerCase()&&"1"!==t||(t="true"),e[n]=t}),e}(),this.queryFlags.authcallback&&await async function(e){return await pxt.auth.loginCallbackAsync(e)}(this.queryFlags),await async function(){const e=await Ot();return await(null==e?void 0:e.authCheckAsync())}(),await this.initLocalizationAsync(),await this.initColorThemeAsync(),await this.parseHashAsync(),this.readyPromise.setAppMounted(),await _t()&&!this.state.cloudSyncCheckHasFinished&&this.setState({showingSyncLoader:!0})}componentDidUpdate(e){e.activityOpen&&!this.props.activityOpen&&this.initColorThemeAsync()}componentWillUnmount(){window.removeEventListener("hashchange",this.handleHashChange),this.unsubscribeChangeListener&&this.unsubscribeChangeListener()}changeLanguage(e){pxt.tickEvent("skillmap.menu.lang.changelang",{lang:e}),pxt.BrowserUtils.setCookieLang(e),async function(e){return await zt({op:"replace",path:["language"],value:e},{immediate:!0})}(e).then(()=>location.reload())}async changeTheme(e){var t;await this.persistColorTheme(e);const n=null===(t=pxt.appTarget.simulator)||void 0===t?void 0:t.themePresets;if(null!=n&&n.length){let t=this.state.simulatorThemePreference;var r;if(!t)t=Fi(await Ut(),this.themePickerInitialColorThemeId?null===(r=pxt.appTarget.colorThemeMap)||void 0===r?void 0:r[this.themePickerInitialColorThemeId]:void 0,e,n);t&&await this.persistSimulatorTheme(t)}this.closeThemePicker(!1)}previewColorTheme(e){var t,n,r;const o=null===(t=pxt.appTarget.colorThemeMap)||void 0===t?void 0:t[this.state.editorThemeId||(null===(n=this.themeManager.getCurrentColorTheme())||void 0===n?void 0:n.id)];this.themePickerInitialColorThemeId||(this.themePickerInitialColorThemeId=null==o?void 0:o.id),this.themeManager.switchColorTheme(e.id);const a=null===(r=pxt.appTarget.simulator)||void 0===r?void 0:r.themePresets,i=null!=a&&a.length&&this.state.simulatorThemePreference?Fi(this.state.simulatorThemePreference,o,e,a):void 0;this.setState({editorThemeId:e.id,simulatorThemePreference:i})}async showSimulatorThemePicker(){var e,t,n,r,o;const a=null===(e=pxt.appTarget.simulator)||void 0===e?void 0:e.themePresets;if(null==a||!a.length)return;const i=null===(t=pxt.appTarget.colorThemeMap)||void 0===t?void 0:t[this.state.editorThemeId||(null===(n=this.themeManager.getCurrentColorTheme())||void 0===n?void 0:n.id)];var l;this.themePickerInitialColorThemeId||(this.themePickerInitialColorThemeId=null===(l=this.themeManager.getCurrentColorTheme())||void 0===l?void 0:l.id);const s=Fi(this.state.simulatorThemePreference||await Ut(),this.themePickerInitialColorThemeId?null===(r=pxt.appTarget.colorThemeMap)||void 0===r?void 0:r[this.themePickerInitialColorThemeId]:void 0,i,a)||zi(i,a);this.setState({simulatorThemePickerOpen:!0,editorThemeId:this.state.editorThemeId||(null===(o=this.themeManager.getCurrentColorTheme())||void 0===o?void 0:o.id),simulatorThemePreference:s})}showEditorThemePicker(){this.setState({simulatorThemePickerOpen:!1})}closeThemePicker(e=!0){var t;e&&this.themePickerInitialColorThemeId&&(null===(t=this.themeManager.getCurrentColorTheme())||void 0===t?void 0:t.id)!==this.themePickerInitialColorThemeId&&this.themeManager.switchColorTheme(this.themePickerInitialColorThemeId),this.themePickerInitialColorThemeId=void 0,this.setState({simulatorThemePickerOpen:!1,editorThemeId:void 0,simulatorThemePreference:void 0}),this.props.dispatchCloseSelectTheme()}async saveSimulatorTheme(e){var t;pxt.tickEvent("skillmap.simulator.theme.save",{preset:e.presetId},{interactiveConsent:!0});const n=this.state.editorThemeId||(null===(t=this.themeManager.getCurrentColorTheme())||void 0===t?void 0:t.id),r=this.themeManager.getAllColorThemes().find(e=>e.id===n);r&&await this.persistColorTheme(r),await this.persistSimulatorTheme(e),this.closeThemePicker(!1)}async resetEditorThemes(){pxt.tickEvent("skillmap.theme.reset",void 0,{interactiveConsent:!0});const e=await async function(e,t){var n,r,o;const a=null===(n=e.appTheme)||void 0===n?void 0:n.defaultColorTheme,i=a?null===(r=e.colorThemeMap)||void 0===r?void 0:r[a]:void 0;if(!i)throw new Error("No default editor theme configured");return await t(i),await Dt(void 0),zi(i,null===(o=e.simulator)||void 0===o?void 0:o.themePresets)}(pxt.appTarget,e=>this.persistColorTheme(e));if(e){var t;const n=await this.ready();await(null===(t=n.sendMessageAsync)||void 0===t?void 0:t.call(n,{type:"pxteditor",action:"setsimulatortheme",preference:e,savePreference:!1}))}this.closeThemePicker(!1)}async persistColorTheme(e){pxt.tickEvent("skillmap.menu.theme.changetheme",{theme:e.id}),this.themeManager.switchColorTheme(e.id),await async function(e){const t=await Ot();if(t){const n=await t.userPreferencesAsync(),r={...null==n?void 0:n.colorThemeIds,[pxt.appTarget.id]:e};await t.patchUserPreferencesAsync({op:"replace",path:["colorThemeIds"],value:r},{immediate:!0})}}(e.id),!this.themeManager.isHighContrast(e.id)&&await Lt()&&await async function(){return await zt({op:"replace",path:["highContrast"],value:!1},{immediate:!0})}()}async persistSimulatorTheme(e){var t,n;const r=function(e,t){const n=(null==t?void 0:t.find(e=>"default"===e.id))||(null==t?void 0:t[0]);return e.presetId===(null==n?void 0:n.id)&&e.theme.layout===pxt.auth.DEFAULT_SIMULATOR_LAYOUT}(e,null===(t=pxt.appTarget.simulator)||void 0===t?void 0:t.themePresets)?void 0:e;await Dt(r);const o=await this.ready();await(null===(n=o.sendMessageAsync)||void 0===n?void 0:n.call(o,{type:"pxteditor",action:"setsimulatortheme",preference:e,savePreference:!1}))}render(){var e,t,n,r,o,a;const{skillMaps:i,activityOpen:l,backgroundImageUrl:s,theme:c,pixelatedBackground:u}=this.props,{error:d,showingSyncLoader:p,forcelang:f}=this.state,h=Object.keys(i).map(e=>i[e]),m=pxt.U.ocvEnabled(),g=(null===(e=pxt.appTarget.simulator)||void 0===e?void 0:e.themePresets)||[],y=this.state.editorThemeId?null===(t=pxt.appTarget.colorThemeMap)||void 0===t?void 0:t[this.state.editorThemeId]:null===(n=this.themeManager)||void 0===n?void 0:n.getCurrentColorTheme();return(0,$t.jsxs)("div",{className:`app-container ${pxt.appTarget.id}`,children:[(0,$t.jsx)(yn,{}),p&&(0,$t.jsxs)("div",{className:"makecode-frame-loader",children:[(0,$t.jsx)("img",{src:Fe("assets/logo.svg"),alt:lf("MakeCode Logo")}),(0,$t.jsx)("div",{className:"makecode-frame-loader-text",children:lf("Saving to cloud...")})]}),(0,$t.jsxs)("div",{className:"skill-map-container "+(l?"hidden":""),style:{backgroundColor:c.backgroundColor},children:[d?(0,$t.jsx)("div",{className:"skill-map-error",children:d}):(0,$t.jsx)(Ya,{maps:h,backgroundImageUrl:s,backgroundColor:c.backgroundColor,pixelatedBackground:u,strokeColor:c.strokeColor}),!d&&(0,$t.jsx)(oi,{onFocusEscape:this.focusCurrentActivity})]}),(0,$t.jsx)(Cn,{forcelang:f,onWorkspaceReady:this.onMakeCodeFrameLoaded}),(0,$t.jsx)(Ua,{}),(0,$t.jsx)(Ti,{}),this.props.showSelectLanguage&&(0,$t.jsx)(Oi,{onLanguageChanged:this.changeLanguage,onClose:this.props.dispatchCloseSelectLanguage}),this.props.showSelectTheme&&this.themeManager&&!this.state.simulatorThemePickerOpen&&(0,$t.jsx)(Di,{themes:this.themeManager.getAllColorThemes(),selectedThemeId:this.state.editorThemeId||(null===(r=this.themeManager.getCurrentColorTheme())||void 0===r?void 0:r.id),onThemeChanged:this.previewColorTheme,onSave:this.changeTheme,onReset:this.resetEditorThemes,onSimulatorThemeClicked:g.length?this.showSimulatorThemePicker:void 0,onClose:this.closeThemePicker}),this.props.showSelectTheme&&this.state.simulatorThemePickerOpen&&!!g.length&&(0,$t.jsx)(tl,{presets:g,layouts:null===(o=pxt.appTarget.simulator)||void 0===o?void 0:o.themeLayouts,initialPreference:this.state.simulatorThemePreference,defaultTheme:null===(a=zi(y,g))||void 0===a?void 0:a.theme,onThemeChanged:e=>this.setState({simulatorThemePreference:e}),onEditorThemeClicked:this.showEditorThemePicker,onSave:this.saveSimulatorTheme,onReset:this.resetEditorThemes,onClose:this.closeThemePicker}),m&&this.props.showFeedback&&(0,$t.jsx)(Qi,{kind:"rating",onClose:this.props.dispatchCloseFeedback})]})}applyQueryFlags(e,t,n){const r=n||"default";if("true"===this.queryFlags.debugNewUser&&(e.isDebug=!0,e.mapProgress={[r]:{}},e.completedTags={}),"true"===this.queryFlags.debugCompleted&&(e.isDebug=!0,e.mapProgress={[r]:{}},t))for(const a of t){e.mapProgress[r][a.mapId]={completionState:"completed",mapId:a.mapId,activityState:{}};for(const t of Object.keys(a.activities)){var o;const i=a.activities[t];if(e.mapProgress[r][a.mapId].activityState[i.activityId]?e.mapProgress[r][a.mapId].activityState[i.activityId].isCompleted=!0:e.mapProgress[r][a.mapId].activityState[i.activityId]={activityId:i.activityId,isCompleted:!0},"activity"===i.kind&&null!==(o=i.tags)&&void 0!==o&&o.length&&n)for(const t of i.tags)e.completedTags[n][t]||(e.completedTags[n][t]=0),e.completedTags[n][t]++}}}async syncBadgesAsync(){const{user:e,maps:t,pageSourceUrl:n,pageSourceStatus:r}=ut.getState();if(this.props.signedIn&&this.state.cloudSyncCheckHasFinished&&"approved"===r){let r=[];for(const o of Object.keys(t))r.push(...rt(e,n,t[o]));if(r.length){const e=await async function(){const e=await Ot();if(e){const t=await e.userPreferencesAsync();if(t)return t.badges}}()||{badges:[]};if(r=r.filter(t=>!pxt.auth.hasBadge(e,t)),r.length&&!this.state.badgeSyncLock){this.setState({badgeSyncLock:!0});try{await async function(e,t){const n=await Ot();t=t.filter(t=>!e.some(e=>pxt.auth.badgeEquals(e,t))),e=e.map(e=>({...e,timestamp:Date.now()})),await(null==n?void 0:n.patchUserPreferencesAsync({op:"replace",path:["badges"],value:{badges:[...t,...e]}}))}(r,e.badges);const t=await Ft();t&&this.props.dispatchSetUserPreferences(t)}finally{this.setState({badgeSyncLock:!1})}}}}}}const al=z(function(e,t){var n;return e?{skillMaps:e.maps,activityOpen:!!e.editorView,backgroundImageUrl:e.backgroundImageUrl,pixelatedBackground:e.pixelatedBackground,theme:e.theme,signedIn:e.auth.signedIn,activityId:null===(n=e.selectedItem)||void 0===n?void 0:n.activityId,showSelectLanguage:e.showSelectLanguage,showSelectTheme:e.showSelectTheme,colorThemeId:e.colorThemeId,showFeedback:e.showFeedback}:{}},{dispatchAddSkillMap:e=>({type:V,map:e}),dispatchClearSkillMaps:()=>({type:G}),dispatchClearMetadata:()=>({type:K}),dispatchSetPageTitle:e=>({type:ae,title:e}),dispatchSetPageDescription:e=>({type:ie,description:e}),dispatchSetPageInfoUrl:e=>({type:le,infoUrl:e}),dispatchSetUser:e=>({type:ne,user:e}),dispatchSetPageSourceUrl:(e,t)=>({type:de,url:e,status:t}),dispatchSetPageAlternateUrls:e=>({type:pe,urls:e}),dispatchSetPageBackgroundImageUrl:(e,t)=>({type:se,backgroundImageUrl:e,pixelatedBackground:t}),dispatchSetPageBannerImageUrl:e=>({type:ce,bannerImageUrl:e}),dispatchSetPageTheme:e=>({type:ue,theme:e}),dispatchSetUserPreferences:mt,dispatchChangeSelectedItem:dt,dispatchCloseSelectLanguage:()=>({type:Ie}),dispatchCloseSelectTheme:()=>({type:je}),dispatchShowFeedback:vt,dispatchCloseFeedback:()=>({type:Ae}),dispatchSetModal:St})(ol),il=window.pxtTargetBundle;il.bundledpkgs={},pxt.setAppTarget(il),pxt.Cloud.apiRoot="https://www.makecode.com/api/",De()||pxt.setupWebConfig(window.pxtConfig),t.render((0,$t.jsx)(function(t){var n=t.store,o=t.context,a=t.children,i=(0,e.useMemo)(function(){var e=l(n);return{store:n,subscription:e}},[n]),c=(0,e.useMemo)(function(){return n.getState()},[n]);s(function(){var e=i.subscription;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),c!==n.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}},[i,c]);var u=o||r;return e.createElement(u.Provider,{value:i},a)},{store:ut,children:(0,$t.jsx)(al,{})}),document.getElementById("root"))})()})();
|