polotno-node 2.15.17 → 2.15.18

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.
@@ -1,330 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./jspdf.es.min-DQ47o5Bu.js","./chunk-DECur_0Z.js","./preload-helper-xBbMyY7u.js","./typeof-B5P0Path.js","./lib-DjVS41Qk.js","./id3-D55z-fRR.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t,t as n}from"./chunk-DECur_0Z.js";import{Ct as r,St as i,bt as a,i as o,n as s,o as c,r as l,u,vt as d,xt as f,yt as p}from"./id3-D55z-fRR.js";import{t as m}from"./preload-helper-xBbMyY7u.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var h=n((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=j(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=j(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ee(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var N={current:null},P={transition:null},te={ReactCurrentDispatcher:N,ReactCurrentBatchConfig:P,ReactCurrentOwner:C};function ne(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,e.act=ne,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ee}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=P.transition;P.transition={};try{e()}finally{P.transition=t}},e.unstable_act=ne,e.useCallback=function(e,t){return N.current.useCallback(e,t)},e.useContext=function(e){return N.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return N.current.useDeferredValue(e)},e.useEffect=function(e,t){return N.current.useEffect(e,t)},e.useId=function(){return N.current.useId()},e.useImperativeHandle=function(e,t,n){return N.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return N.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return N.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return N.current.useMemo(e,t)},e.useReducer=function(e,t,n){return N.current.useReducer(e,t,n)},e.useRef=function(e){return N.current.useRef(e)},e.useState=function(e){return N.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return N.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return N.current.useTransition()},e.version=`18.3.1`})),g=n(((e,t)=>{t.exports=h()})),_=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&ee(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&ee(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function M(e){C=e,S||(S=!0,k())}function ee(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,M(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){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 s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,ee(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),v=n(((e,t)=>{t.exports=_()})),y=n((e=>{var t=g(),n=v();function r(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 i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,u=/^[: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]*$/,d={},f={};function p(e){return l.call(f,e)?!0:l.call(d,e)?!1:u.test(e)?f[e]=!0:(d[e]=!0,!1)}function m(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function h(e,t,n,r){if(t==null||m(e,t,n,r))return!0;if(r)return!1;if(n!==null)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}function _(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new _(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new _(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new _(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new _(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){y[e]=new _(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new _(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new _(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new _(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new _(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`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,x);y[t]=new _(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,x);y[t]=new _(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,x);y[t]=new _(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new _(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new _(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new _(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(h(t,n,i,r)&&(n=null),r||i===null?p(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for(`react.element`),T=Symbol.for(`react.portal`),E=Symbol.for(`react.fragment`),D=Symbol.for(`react.strict_mode`),O=Symbol.for(`react.profiler`),k=Symbol.for(`react.provider`),A=Symbol.for(`react.context`),j=Symbol.for(`react.forward_ref`),M=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),N=Symbol.for(`react.memo`),P=Symbol.for(`react.lazy`),te=Symbol.for(`react.offscreen`),ne=Symbol.iterator;function re(e){return typeof e!=`object`||!e?null:(e=ne&&e[ne]||e[`@@iterator`],typeof e==`function`?e:null)}var F=Object.assign,I;function L(e){if(I===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);I=t&&t[1]||``}return`
3
- `+I+e}var ie=!1;function ae(e,t){if(!e||ie)return``;ie=!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()}}),typeof Reflect==`object`&&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(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
4
- `),a=r.stack.split(`
5
- `),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
6
- `+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{ie=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?L(e):``}function oe(e){switch(e.tag){case 5:return L(e.type);case 16:return L(`Lazy`);case 13:return L(`Suspense`);case 19:return L(`SuspenseList`);case 0:case 2:case 15:return e=ae(e.type,!1),e;case 11:return e=ae(e.type.render,!1),e;case 1:return e=ae(e.type,!0),e;default:return``}}function se(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case ee:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case N:return t=e.displayName||null,t===null?se(e.type)||`Memo`:t;case P:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}function ce(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return se(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function le(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function ue(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function de(e){var t=ue(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.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]}}}}function fe(e){e._valueTracker||=de(e)}function pe(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=ue(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function me(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function he(e,t){var n=t.checked;return F({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ge(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=le(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function _e(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function ve(e,t){_e(e,t);var n=le(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?be(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&be(e,t.type,le(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ye(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function be(e,t,n){(t!==`number`||me(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var xe=Array.isArray;function Se(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+le(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ce(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return F({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function we(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(xe(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:le(n)}}function Te(e,t){var n=le(t.value),r=le(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function Ee(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function De(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 Oe(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?De(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var ke,Ae=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(ke||=document.createElement(`div`),ke.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=ke.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function je(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Me={animationIterationCount:!0,aspectRatio:!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},Ne=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Me).forEach(function(e){Ne.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Me[t]=Me[e]})});function R(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Me.hasOwnProperty(e)&&Me[e]?(``+t).trim():t+`px`}function Pe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=R(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Fe=F({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 Ie(e,t){if(t){if(Fe[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function Le(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;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}}var Re=null;function ze(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Be=null,Ve=null,He=null;function Ue(e){if(e=Bi(e)){if(typeof Be!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Hi(t),Be(e.stateNode,e.type,t))}}function We(e){Ve?He?He.push(e):He=[e]:Ve=e}function Ge(){if(Ve){var e=Ve,t=He;if(He=Ve=null,Ue(e),t)for(e=0;e<t.length;e++)Ue(t[e])}}function Ke(e,t){return e(t)}function qe(){}var Je=!1;function Ye(e,t,n){if(Je)return e(t,n);Je=!0;try{return Ke(e,t,n)}finally{Je=!1,(Ve!==null||He!==null)&&(qe(),Ge())}}function Xe(e,t){var n=e.stateNode;if(n===null)return null;var i=Hi(n);if(i===null)return null;n=i[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(i=!i.disabled)||(e=e.type,i=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!i;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var Ze=!1;if(c)try{var Qe={};Object.defineProperty(Qe,`passive`,{get:function(){Ze=!0}}),window.addEventListener(`test`,Qe,Qe),window.removeEventListener(`test`,Qe,Qe)}catch{Ze=!1}function $e(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var et=!1,tt=null,nt=!1,rt=null,it={onError:function(e){et=!0,tt=e}};function at(e,t,n,r,i,a,o,s,c){et=!1,tt=null,$e.apply(it,arguments)}function ot(e,t,n,i,a,o,s,c,l){if(at.apply(this,arguments),et){if(et){var u=tt;et=!1,tt=null}else throw Error(r(198));nt||(nt=!0,rt=u)}}function st(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function ct(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function lt(e){if(st(e)!==e)throw Error(r(188))}function ut(e){var t=e.alternate;if(!t){if(t=st(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return lt(a),e;if(o===i)return lt(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function dt(e){return e=ut(e),e===null?null:ft(e)}function ft(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ft(e);if(t!==null)return t;e=e.sibling}return null}var pt=n.unstable_scheduleCallback,mt=n.unstable_cancelCallback,ht=n.unstable_shouldYield,gt=n.unstable_requestPaint,_t=n.unstable_now,vt=n.unstable_getCurrentPriorityLevel,yt=n.unstable_ImmediatePriority,bt=n.unstable_UserBlockingPriority,xt=n.unstable_NormalPriority,St=n.unstable_LowPriority,Ct=n.unstable_IdlePriority,wt=null,Tt=null;function Et(e){if(Tt&&typeof Tt.onCommitFiberRoot==`function`)try{Tt.onCommitFiberRoot(wt,e,void 0,(e.current.flags&128)==128)}catch{}}var Dt=Math.clz32?Math.clz32:At,Ot=Math.log,kt=Math.LN2;function At(e){return e>>>=0,e===0?32:31-(Ot(e)/kt|0)|0}var jt=64,Mt=4194304;function Nt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Pt(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=Nt(a))):r=Nt(s)}else o=n&~i,o===0?a!==0&&(r=Nt(a)):r=Nt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Dt(t),i=1<<n,r|=e[n],t&=~i;return r}function Ft(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function It(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Dt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ft(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function z(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Lt(){var e=jt;return jt<<=1,!(jt&4194240)&&(jt=64),e}function Rt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function zt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Dt(t),e[t]=n}function Bt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Dt(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Dt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Ht=0;function Ut(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Wt,Gt,Kt,qt,Jt,Yt=!1,Xt=[],Zt=null,B=null,Qt=null,$t=new Map,en=new Map,tn=[],nn=`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 rn(e,t){switch(e){case`focusin`:case`focusout`:Zt=null;break;case`dragenter`:case`dragleave`:B=null;break;case`mouseover`:case`mouseout`:Qt=null;break;case`pointerover`:case`pointerout`:$t.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:en.delete(t.pointerId)}}function an(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Bi(t),t!==null&&Gt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function on(e,t,n,r,i){switch(t){case`focusin`:return Zt=an(Zt,e,t,n,r,i),!0;case`dragenter`:return B=an(B,e,t,n,r,i),!0;case`mouseover`:return Qt=an(Qt,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return $t.set(a,an($t.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,en.set(a,an(en.get(a)||null,e,t,n,r,i)),!0}return!1}function sn(e){var t=zi(e.target);if(t!==null){var n=st(t);if(n!==null){if(t=n.tag,t===13){if(t=ct(n),t!==null){e.blockedOn=t,Jt(e.priority,function(){Kt(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function cn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=yn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Re=r,n.target.dispatchEvent(r),Re=null}else return t=Bi(n),t!==null&&Gt(t),e.blockedOn=n,!1;t.shift()}return!0}function ln(e,t,n){cn(e)&&n.delete(t)}function un(){Yt=!1,Zt!==null&&cn(Zt)&&(Zt=null),B!==null&&cn(B)&&(B=null),Qt!==null&&cn(Qt)&&(Qt=null),$t.forEach(ln),en.forEach(ln)}function dn(e,t){e.blockedOn===t&&(e.blockedOn=null,Yt||(Yt=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,un)))}function fn(e){function t(t){return dn(t,e)}if(0<Xt.length){dn(Xt[0],e);for(var n=1;n<Xt.length;n++){var r=Xt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Zt!==null&&dn(Zt,e),B!==null&&dn(B,e),Qt!==null&&dn(Qt,e),$t.forEach(t),en.forEach(t),n=0;n<tn.length;n++)r=tn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<tn.length&&(n=tn[0],n.blockedOn===null);)sn(n),n.blockedOn===null&&tn.shift()}var pn=C.ReactCurrentBatchConfig,mn=!0;function hn(e,t,n,r){var i=Ht,a=pn.transition;pn.transition=null;try{Ht=1,_n(e,t,n,r)}finally{Ht=i,pn.transition=a}}function gn(e,t,n,r){var i=Ht,a=pn.transition;pn.transition=null;try{Ht=4,_n(e,t,n,r)}finally{Ht=i,pn.transition=a}}function _n(e,t,n,r){if(mn){var i=yn(e,t,n,r);if(i===null)di(e,t,r,vn,n),rn(e,r);else if(on(i,e,t,n,r))r.stopPropagation();else if(rn(e,r),t&4&&-1<nn.indexOf(e)){for(;i!==null;){var a=Bi(i);if(a!==null&&Wt(a),a=yn(e,t,n,r),a===null&&di(e,t,r,vn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else di(e,t,r,null,n)}}var vn=null;function yn(e,t,n,r){if(vn=null,e=ze(r),e=zi(e),e!==null)if(t=st(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ct(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return vn=e,null}function V(e){switch(e){case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 1;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`toggle`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 4;case`message`:switch(vt()){case yt:return 1;case bt:return 4;case xt:case St:return 16;case Ct:return 536870912;default:return 16}default:return 16}}var bn=null,xn=null,Sn=null;function Cn(){if(Sn)return Sn;var e,t=xn,n=t.length,r,i=`value`in bn?bn.value:bn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Sn=i.slice(e,1<r?1-r:void 0)}function wn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Tn(){return!0}function En(){return!1}function Dn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Tn:En,this.isPropagationStopped=En,this}return F(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Tn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Tn)},persist:function(){},isPersistent:Tn}),t}var On={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kn=Dn(On),An=F({},On,{view:0,detail:0}),jn=Dn(An),Mn,Nn,Pn,Fn=F({},An,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Pn&&(Pn&&e.type===`mousemove`?(Mn=e.screenX-Pn.screenX,Nn=e.screenY-Pn.screenY):Nn=Mn=0,Pn=e),Mn)},movementY:function(e){return`movementY`in e?e.movementY:Nn}}),In=Dn(Fn),Ln=Dn(F({},Fn,{dataTransfer:0})),Rn=Dn(F({},An,{relatedTarget:0})),zn=Dn(F({},On,{animationName:0,elapsedTime:0,pseudoElement:0})),Bn=Dn(F({},On,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Vn=Dn(F({},On,{data:0})),Hn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Un={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`},Wn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Gn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Wn[e])?!!t[e]:!1}function Kn(){return Gn}var qn=Dn(F({},An,{key:function(e){if(e.key){var t=Hn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=wn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Un[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kn,charCode:function(e){return e.type===`keypress`?wn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?wn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Jn=Dn(F({},Fn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Yn=Dn(F({},An,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kn})),H=Dn(F({},On,{propertyName:0,elapsedTime:0,pseudoElement:0})),Xn=Dn(F({},Fn,{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})),Zn=[9,13,27,32],Qn=c&&`CompositionEvent`in window,$n=null;c&&`documentMode`in document&&($n=document.documentMode);var er=c&&`TextEvent`in window&&!$n,tr=c&&(!Qn||$n&&8<$n&&11>=$n),nr=` `,rr=!1;function ir(e,t){switch(e){case`keyup`:return Zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ar(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var or=!1;function sr(e,t){switch(e){case`compositionend`:return ar(t);case`keypress`:return t.which===32?(rr=!0,nr):null;case`textInput`:return e=t.data,e===nr&&rr?null:e;default:return null}}function cr(e,t){if(or)return e===`compositionend`||!Qn&&ir(e,t)?(e=Cn(),Sn=xn=bn=null,or=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return tr&&t.locale!==`ko`?null:t.data;default:return null}}var lr={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 ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!lr[e.type]:t===`textarea`}function dr(e,t,n,r){We(r),t=pi(t,`onChange`),0<t.length&&(n=new kn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var fr=null,pr=null;function mr(e){ai(e,0)}function hr(e){if(pe(Vi(e)))return e}function gr(e,t){if(e===`change`)return t}var _r=!1;if(c){var vr;if(c){var yr=`oninput`in document;if(!yr){var br=document.createElement(`div`);br.setAttribute(`oninput`,`return;`),yr=typeof br.oninput==`function`}vr=yr}else vr=!1;_r=vr&&(!document.documentMode||9<document.documentMode)}function xr(){fr&&(fr.detachEvent(`onpropertychange`,Sr),pr=fr=null)}function Sr(e){if(e.propertyName===`value`&&hr(pr)){var t=[];dr(t,pr,e,ze(e)),Ye(mr,t)}}function Cr(e,t,n){e===`focusin`?(xr(),fr=t,pr=n,fr.attachEvent(`onpropertychange`,Sr)):e===`focusout`&&xr()}function wr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return hr(pr)}function Tr(e,t){if(e===`click`)return hr(t)}function Er(e,t){if(e===`input`||e===`change`)return hr(t)}function Dr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Or=typeof Object.is==`function`?Object.is:Dr;function kr(e,t){if(Or(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!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++){var i=n[r];if(!l.call(t,i)||!Or(e[i],t[i]))return!1}return!0}function Ar(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jr(e,t){var n=Ar(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Ar(n)}}function Mr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nr(){for(var e=window,t=me();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=me(e.document)}return t}function Pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Fr(e){var t=Nr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Mr(n.ownerDocument.documentElement,n)){if(r!==null&&Pr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=jr(n,a);var o=jr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Ir=c&&`documentMode`in document&&11>=document.documentMode,Lr=null,Rr=null,zr=null,Br=!1;function Vr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Br||Lr==null||Lr!==me(r)||(r=Lr,`selectionStart`in r&&Pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),zr&&kr(zr,r)||(zr=r,r=pi(Rr,`onSelect`),0<r.length&&(t=new kn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Lr)))}function Hr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ur={animationend:Hr(`Animation`,`AnimationEnd`),animationiteration:Hr(`Animation`,`AnimationIteration`),animationstart:Hr(`Animation`,`AnimationStart`),transitionend:Hr(`Transition`,`TransitionEnd`)},Wr={},Gr={};c&&(Gr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ur.animationend.animation,delete Ur.animationiteration.animation,delete Ur.animationstart.animation),`TransitionEvent`in window||delete Ur.transitionend.transition);function Kr(e){if(Wr[e])return Wr[e];if(!Ur[e])return e;var t=Ur[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Gr)return Wr[e]=t[n];return e}var qr=Kr(`animationend`),Jr=Kr(`animationiteration`),Yr=Kr(`animationstart`),Xr=Kr(`transitionend`),Zr=new Map,Qr=`abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);function $r(e,t){Zr.set(e,t),o(t,[e])}for(var ei=0;ei<Qr.length;ei++){var ti=Qr[ei];$r(ti.toLowerCase(),`on`+(ti[0].toUpperCase()+ti.slice(1)))}$r(qr,`onAnimationEnd`),$r(Jr,`onAnimationIteration`),$r(Yr,`onAnimationStart`),$r(`dblclick`,`onDoubleClick`),$r(`focusin`,`onFocus`),$r(`focusout`,`onBlur`),$r(Xr,`onTransitionEnd`),s(`onMouseEnter`,[`mouseout`,`mouseover`]),s(`onMouseLeave`,[`mouseout`,`mouseover`]),s(`onPointerEnter`,[`pointerout`,`pointerover`]),s(`onPointerLeave`,[`pointerout`,`pointerover`]),o(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),o(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),o(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),o(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var ni=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),ri=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(ni));function ii(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,ot(r,t,void 0,e),e.currentTarget=null}function ai(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;ii(i,s,l),a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;ii(i,s,l),a=c}}}if(nt)throw e=rt,nt=!1,rt=null,e}function oi(e,t){var n=t[Ii];n===void 0&&(n=t[Ii]=new Set);var r=e+`__bubble`;n.has(r)||(ui(t,e,2,!1),n.add(r))}function si(e,t,n){var r=0;t&&(r|=4),ui(n,e,r,t)}var ci=`_reactListening`+Math.random().toString(36).slice(2);function li(e){if(!e[ci]){e[ci]=!0,i.forEach(function(t){t!==`selectionchange`&&(ri.has(t)||si(t,!1,e),si(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ci]||(t[ci]=!0,si(`selectionchange`,!1,t))}}function ui(e,t,n,r){switch(V(t)){case 1:var i=hn;break;case 4:i=gn;break;default:i=_n}n=i.bind(null,t,n,e),i=void 0,!Ze||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function di(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=zi(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}Ye(function(){var r=a,i=ze(n),o=[];a:{var s=Zr.get(e);if(s!==void 0){var c=kn,l=e;switch(e){case`keypress`:if(wn(n)===0)break a;case`keydown`:case`keyup`:c=qn;break;case`focusin`:l=`focus`,c=Rn;break;case`focusout`:l=`blur`,c=Rn;break;case`beforeblur`:case`afterblur`:c=Rn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=In;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Ln;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Yn;break;case qr:case Jr:case Yr:c=zn;break;case Xr:c=H;break;case`scroll`:c=jn;break;case`wheel`:c=Xn;break;case`copy`:case`cut`:case`paste`:c=Bn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=Jn}var u=(t&4)!=0,d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=Xe(p,f),h!=null&&u.push(fi(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==Re&&(l=n.relatedTarget||n.fromElement)&&(zi(l)||l[Fi]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?zi(l):null,l!==null&&(d=st(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=In,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=Jn,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Vi(c),m=l==null?s:Vi(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,zi(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=mi(m))p++;for(m=0,h=f;h;h=mi(h))m++;for(;0<p-m;)u=mi(u),p--;for(;0<m-p;)f=mi(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=mi(u),f=mi(f)}u=null}else u=null;c!==null&&hi(o,s,c,u,!1),l!==null&&d!==null&&hi(o,d,l,u,!0)}}a:{if(s=r?Vi(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=gr;else if(ur(s))if(_r)g=Er;else{g=wr;var _=Cr}else (c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=Tr);if(g&&=g(e,r)){dr(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&be(s,`number`,s.value)}switch(_=r?Vi(r):window,e){case`focusin`:(ur(_)||_.contentEditable===`true`)&&(Lr=_,Rr=r,zr=null);break;case`focusout`:zr=Rr=Lr=null;break;case`mousedown`:Br=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Br=!1,Vr(o,n,i);break;case`selectionchange`:if(Ir)break;case`keydown`:case`keyup`:Vr(o,n,i)}var v;if(Qn)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else or?ir(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(tr&&n.locale!==`ko`&&(or||y!==`onCompositionStart`?y===`onCompositionEnd`&&or&&(v=Cn()):(bn=i,xn=`value`in bn?bn.value:bn.textContent,or=!0)),_=pi(r,y),0<_.length&&(y=new Vn(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=ar(n),v!==null&&(y.data=v)))),(v=er?sr(e,n):cr(e,n))&&(r=pi(r,`onBeforeInput`),0<r.length&&(i=new Vn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}ai(o,t)})}function fi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function pi(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Xe(e,n),a!=null&&r.unshift(fi(e,a,i)),a=Xe(e,t),a!=null&&r.push(fi(e,a,i))),e=e.return}return r}function mi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function hi(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=Xe(n,a),c!=null&&o.unshift(fi(n,c,s))):i||(c=Xe(n,a),c!=null&&o.push(fi(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var gi=/\r\n?/g,_i=/\u0000|\uFFFD/g;function vi(e){return(typeof e==`string`?e:``+e).replace(gi,`
7
- `).replace(_i,``)}function yi(e,t,n){if(t=vi(t),vi(e)!==t&&n)throw Error(r(425))}function bi(){}var xi=null,Si=null;function Ci(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var wi=typeof setTimeout==`function`?setTimeout:void 0,Ti=typeof clearTimeout==`function`?clearTimeout:void 0,Ei=typeof Promise==`function`?Promise:void 0,Di=typeof queueMicrotask==`function`?queueMicrotask:Ei===void 0?wi:function(e){return Ei.resolve(null).then(e).catch(Oi)};function Oi(e){setTimeout(function(){throw e})}function ki(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),fn(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++;n=i}while(n);fn(t)}function Ai(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`)break;if(t===`/$`)return null}}return e}function ji(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var Mi=Math.random().toString(36).slice(2),Ni=`__reactFiber$`+Mi,Pi=`__reactProps$`+Mi,Fi=`__reactContainer$`+Mi,Ii=`__reactEvents$`+Mi,Li=`__reactListeners$`+Mi,Ri=`__reactHandles$`+Mi;function zi(e){var t=e[Ni];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Fi]||n[Ni]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ji(e);e!==null;){if(n=e[Ni])return n;e=ji(e)}return t}e=n,n=e.parentNode}return null}function Bi(e){return e=e[Ni]||e[Fi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Vi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Hi(e){return e[Pi]||null}var Ui=[],Wi=-1;function Gi(e){return{current:e}}function Ki(e){0>Wi||(e.current=Ui[Wi],Ui[Wi]=null,Wi--)}function qi(e,t){Wi++,Ui[Wi]=e.current,e.current=t}var Ji={},Yi=Gi(Ji),Xi=Gi(!1),Zi=Ji;function Qi(e,t){var n=e.type.contextTypes;if(!n)return Ji;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function $i(e){return e=e.childContextTypes,e!=null}function ea(){Ki(Xi),Ki(Yi)}function ta(e,t,n){if(Yi.current!==Ji)throw Error(r(168));qi(Yi,t),qi(Xi,n)}function na(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,ce(e)||`Unknown`,a));return F({},n,i)}function ra(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ji,Zi=Yi.current,qi(Yi,e),qi(Xi,Xi.current),!0}function ia(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=na(e,t,Zi),i.__reactInternalMemoizedMergedChildContext=e,Ki(Xi),Ki(Yi),qi(Yi,e)):Ki(Xi),qi(Xi,n)}var aa=null,oa=!1,sa=!1;function ca(e){aa===null?aa=[e]:aa.push(e)}function la(e){oa=!0,ca(e)}function ua(){if(!sa&&aa!==null){sa=!0;var e=0,t=Ht;try{var n=aa;for(Ht=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}aa=null,oa=!1}catch(t){throw aa!==null&&(aa=aa.slice(e+1)),pt(yt,ua),t}finally{Ht=t,sa=!1}}return null}var da=[],fa=0,pa=null,ma=0,U=[],ha=0,ga=null,_a=1,va=``;function ya(e,t){da[fa++]=ma,da[fa++]=pa,pa=e,ma=t}function ba(e,t,n){U[ha++]=_a,U[ha++]=va,U[ha++]=ga,ga=e;var r=_a;e=va;var i=32-Dt(r)-1;r&=~(1<<i),n+=1;var a=32-Dt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,_a=1<<32-Dt(t)+i|n<<i|r,va=a+e}else _a=1<<a|n<<i|r,va=e}function xa(e){e.return!==null&&(ya(e,1),ba(e,1,0))}function Sa(e){for(;e===pa;)pa=da[--fa],da[fa]=null,ma=da[--fa],da[fa]=null;for(;e===ga;)ga=U[--ha],U[ha]=null,va=U[--ha],U[ha]=null,_a=U[--ha],U[ha]=null}var Ca=null,wa=null,Ta=!1,Ea=null;function Da(e,t){var n=Zl(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Oa(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t===null?!1:(e.stateNode=t,Ca=e,wa=Ai(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t===null?!1:(e.stateNode=t,Ca=e,wa=null,!0);case 13:return t=t.nodeType===8?t:null,t===null?!1:(n=ga===null?null:{id:_a,overflow:va},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Zl(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ca=e,wa=null,!0);default:return!1}}function ka(e){return(e.mode&1)!=0&&(e.flags&128)==0}function Aa(e){if(Ta){var t=wa;if(t){var n=t;if(!Oa(e,t)){if(ka(e))throw Error(r(418));t=Ai(n.nextSibling);var i=Ca;t&&Oa(e,t)?Da(i,n):(e.flags=e.flags&-4097|2,Ta=!1,Ca=e)}}else{if(ka(e))throw Error(r(418));e.flags=e.flags&-4097|2,Ta=!1,Ca=e}}}function ja(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ca=e}function Ma(e){if(e!==Ca)return!1;if(!Ta)return ja(e),Ta=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!Ci(e.type,e.memoizedProps)),t&&=wa){if(ka(e))throw Na(),Error(r(418));for(;t;)Da(e,t),t=Ai(t.nextSibling)}if(ja(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){wa=Ai(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}wa=null}}else wa=Ca?Ai(e.stateNode.nextSibling):null;return!0}function Na(){for(var e=wa;e;)e=Ai(e.nextSibling)}function W(){wa=Ca=null,Ta=!1}function Pa(e){Ea===null?Ea=[e]:Ea.push(e)}var Fa=C.ReactCurrentBatchConfig;function Ia(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function La(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function Ra(e){var t=e._init;return t(e._payload)}function za(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=eu(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=iu(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===E?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===P&&Ra(i)===t.type)?(r=a(t,n.props),r.ref=Ia(e,t,n),r.return=e,r):(r=tu(n.type,n.key,n.props,null,e.mode,r),r.ref=Ia(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=au(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=nu(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=iu(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case w:return n=tu(t.type,t.key,t.props,null,e.mode,n),n.ref=Ia(e,null,t),n.return=e,n;case T:return t=au(t,e.mode,n),t.return=e,t;case P:var r=t._init;return f(e,r(t._payload),n)}if(xe(t)||re(t))return t=nu(t,e.mode,n,null),t.return=e,t;La(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case w:return n.key===i?l(e,t,n,r):null;case T:return n.key===i?u(e,t,n,r):null;case P:return i=n._init,p(e,t,i(n._payload),r)}if(xe(n)||re(n))return i===null?d(e,t,n,r,null):null;La(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case w:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case T:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case P:var a=r._init;return m(e,t,n,a(r._payload),i)}if(xe(r)||re(r))return e=e.get(n)||null,d(t,e,r,i,null);La(t,r)}return null}function h(r,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),Ta&&ya(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Ta&&ya(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),Ta&&ya(r,h),l}function g(a,s,c,l){var u=re(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Ta&&ya(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Ta&&ya(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Ta&&ya(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===P&&Ra(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Ia(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===E?(r=nu(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=tu(i.type,i.key,i.props,null,e.mode,o),o.ref=Ia(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=au(i,e.mode,o),r.return=e,e=r}return s(e);case P:return l=i._init,_(e,r,l(i._payload),o)}if(xe(i))return h(e,r,i,o);if(re(i))return g(e,r,i,o);La(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=iu(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Ba=za(!0),Va=za(!1),Ha=Gi(null),Ua=null,Wa=null,Ga=null;function Ka(){Ga=Wa=Ua=null}function qa(e){var t=Ha.current;Ki(Ha),e._currentValue=t}function Ja(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ya(e,t){Ua=e,Ga=Wa=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Is=!0),e.firstContext=null)}function Xa(e){var t=e._currentValue;if(Ga!==e)if(e={context:e,memoizedValue:t,next:null},Wa===null){if(Ua===null)throw Error(r(308));Wa=e,Ua.dependencies={lanes:0,firstContext:e}}else Wa=Wa.next=e;return t}var Za=null;function Qa(e){Za===null?Za=[e]:Za.push(e)}function $a(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Qa(t)):(n.next=i.next,i.next=n),t.interleaved=n,eo(e,r)}function eo(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var to=!1;function no(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ro(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 io(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ao(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Gc&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,eo(e,n)}return i=r.interleaved,i===null?(t.next=t,Qa(r)):(t.next=i.next,i.next=t),r.interleaved=t,eo(e,n)}function oo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Vt(e,n)}}function so(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function co(e,t,n,r){var i=e.updateQueue;to=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=F({},d,f);break a;case 2:to=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);$c|=o,e.lanes=o,e.memoizedState=d}}function lo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var uo={},fo=Gi(uo),po=Gi(uo),mo=Gi(uo);function ho(e){if(e===uo)throw Error(r(174));return e}function go(e,t){switch(qi(mo,t),qi(po,e),qi(fo,uo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Oe(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Oe(t,e)}Ki(fo),qi(fo,t)}function _o(){Ki(fo),Ki(po),Ki(mo)}function vo(e){ho(mo.current);var t=ho(fo.current),n=Oe(t,e.type);t!==n&&(qi(po,e),qi(fo,n))}function yo(e){po.current===e&&(Ki(fo),Ki(po))}var G=Gi(0);function K(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var bo=[];function xo(){for(var e=0;e<bo.length;e++)bo[e]._workInProgressVersionPrimary=null;bo.length=0}var So=C.ReactCurrentDispatcher,Co=C.ReactCurrentBatchConfig,wo=0,q=null,To=null,Eo=null,Do=!1,Oo=!1,ko=0,Ao=0;function jo(){throw Error(r(321))}function Mo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Or(e[n],t[n]))return!1;return!0}function No(e,t,n,i,a,o){if(wo=o,q=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,So.current=e===null||e.memoizedState===null?gs:_s,e=n(i,a),Oo){o=0;do{if(Oo=!1,ko=0,25<=o)throw Error(r(301));o+=1,Eo=To=null,t.updateQueue=null,So.current=vs,e=n(i,a)}while(Oo)}if(So.current=hs,t=To!==null&&To.next!==null,wo=0,Eo=To=q=null,Do=!1,t)throw Error(r(300));return e}function Po(){var e=ko!==0;return ko=0,e}function Fo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Eo===null?q.memoizedState=Eo=e:Eo=Eo.next=e,Eo}function Io(){if(To===null){var e=q.alternate;e=e===null?null:e.memoizedState}else e=To.next;var t=Eo===null?q.memoizedState:Eo.next;if(t!==null)Eo=t,To=e;else{if(e===null)throw Error(r(310));To=e,e={memoizedState:To.memoizedState,baseState:To.baseState,baseQueue:To.baseQueue,queue:To.queue,next:null},Eo===null?q.memoizedState=Eo=e:Eo=Eo.next=e}return Eo}function Lo(e,t){return typeof t==`function`?t(e):t}function Ro(e){var t=Io(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=To,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((wo&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,q.lanes|=d,$c|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Or(i,t.memoizedState)||(Is=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,q.lanes|=o,$c|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function zo(e){var t=Io(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Or(o,t.memoizedState)||(Is=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Bo(){}function Vo(e,t){var n=q,i=Io(),a=t(),o=!Or(i.memoizedState,a);if(o&&(i.memoizedState=a,Is=!0),i=i.queue,$o(Wo.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||Eo!==null&&Eo.memoizedState.tag&1){if(n.flags|=2048,Jo(9,Uo.bind(null,n,i,a,t),void 0,null),Kc===null)throw Error(r(349));wo&30||Ho(n,t,a)}return a}function Ho(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=q.updateQueue,t===null?(t={lastEffect:null,stores:null},q.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Uo(e,t,n,r){t.value=n,t.getSnapshot=r,Go(t)&&Ko(e)}function Wo(e,t,n){return n(function(){Go(t)&&Ko(e)})}function Go(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Or(e,n)}catch{return!0}}function Ko(e){var t=eo(e,1);t!==null&&yl(t,e,1,-1)}function qo(e){var t=Fo();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:e},t.queue=e,e=e.dispatch=ds.bind(null,q,e),[t.memoizedState,e]}function Jo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=q.updateQueue,t===null?(t={lastEffect:null,stores:null},q.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Yo(){return Io().memoizedState}function Xo(e,t,n,r){var i=Fo();q.flags|=e,i.memoizedState=Jo(1|t,n,void 0,r===void 0?null:r)}function Zo(e,t,n,r){var i=Io();r=r===void 0?null:r;var a=void 0;if(To!==null){var o=To.memoizedState;if(a=o.destroy,r!==null&&Mo(r,o.deps)){i.memoizedState=Jo(t,n,a,r);return}}q.flags|=e,i.memoizedState=Jo(1|t,n,a,r)}function Qo(e,t){return Xo(8390656,8,e,t)}function $o(e,t){return Zo(2048,8,e,t)}function es(e,t){return Zo(4,2,e,t)}function ts(e,t){return Zo(4,4,e,t)}function ns(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function rs(e,t,n){return n=n==null?null:n.concat([e]),Zo(4,4,ns.bind(null,t,e),n)}function is(){}function as(e,t){var n=Io();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Mo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function os(e,t){var n=Io();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Mo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ss(e,t,n){return wo&21?(Or(n,t)||(n=Lt(),q.lanes|=n,$c|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Is=!0),e.memoizedState=n)}function cs(e,t){var n=Ht;Ht=n!==0&&4>n?n:4,e(!0);var r=Co.transition;Co.transition={};try{e(!1),t()}finally{Ht=n,Co.transition=r}}function ls(){return Io().memoizedState}function us(e,t,n){var r=vl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},fs(e))ps(t,n);else if(n=$a(e,t,n,r),n!==null){var i=_l();yl(n,e,r,i),ms(n,t,r)}}function ds(e,t,n){var r=vl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(fs(e))ps(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Or(s,o)){var c=t.interleaved;c===null?(i.next=i,Qa(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=$a(e,t,i,r),n!==null&&(i=_l(),yl(n,e,r,i),ms(n,t,r))}}function fs(e){var t=e.alternate;return e===q||t!==null&&t===q}function ps(e,t){Oo=Do=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ms(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Vt(e,n)}}var hs={readContext:Xa,useCallback:jo,useContext:jo,useEffect:jo,useImperativeHandle:jo,useInsertionEffect:jo,useLayoutEffect:jo,useMemo:jo,useReducer:jo,useRef:jo,useState:jo,useDebugValue:jo,useDeferredValue:jo,useTransition:jo,useMutableSource:jo,useSyncExternalStore:jo,useId:jo,unstable_isNewReconciler:!1},gs={readContext:Xa,useCallback:function(e,t){return Fo().memoizedState=[e,t===void 0?null:t],e},useContext:Xa,useEffect:Qo,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Xo(4194308,4,ns.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xo(4,2,e,t)},useMemo:function(e,t){var n=Fo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Fo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=us.bind(null,q,e),[r.memoizedState,e]},useRef:function(e){var t=Fo();return e={current:e},t.memoizedState=e},useState:qo,useDebugValue:is,useDeferredValue:function(e){return Fo().memoizedState=e},useTransition:function(){var e=qo(!1),t=e[0];return e=cs.bind(null,e[1]),Fo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=q,a=Fo();if(Ta){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Kc===null)throw Error(r(349));wo&30||Ho(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Qo(Wo.bind(null,i,o,e),[e]),i.flags|=2048,Jo(9,Uo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Fo(),t=Kc.identifierPrefix;if(Ta){var n=va,r=_a;n=(r&~(1<<32-Dt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=ko++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Ao++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},_s={readContext:Xa,useCallback:as,useContext:Xa,useEffect:$o,useImperativeHandle:rs,useInsertionEffect:es,useLayoutEffect:ts,useMemo:os,useReducer:Ro,useRef:Yo,useState:function(){return Ro(Lo)},useDebugValue:is,useDeferredValue:function(e){return ss(Io(),To.memoizedState,e)},useTransition:function(){return[Ro(Lo)[0],Io().memoizedState]},useMutableSource:Bo,useSyncExternalStore:Vo,useId:ls,unstable_isNewReconciler:!1},vs={readContext:Xa,useCallback:as,useContext:Xa,useEffect:$o,useImperativeHandle:rs,useInsertionEffect:es,useLayoutEffect:ts,useMemo:os,useReducer:zo,useRef:Yo,useState:function(){return zo(Lo)},useDebugValue:is,useDeferredValue:function(e){var t=Io();return To===null?t.memoizedState=e:ss(t,To.memoizedState,e)},useTransition:function(){return[zo(Lo)[0],Io().memoizedState]},useMutableSource:Bo,useSyncExternalStore:Vo,useId:ls,unstable_isNewReconciler:!1};function ys(e,t){if(e&&e.defaultProps){for(var n in t=F({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function bs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:F({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var xs={isMounted:function(e){return(e=e._reactInternals)?st(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_l(),i=vl(e),a=io(r,i);a.payload=t,n!=null&&(a.callback=n),t=ao(e,a,i),t!==null&&(yl(t,e,i,r),oo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_l(),i=vl(e),a=io(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=ao(e,a,i),t!==null&&(yl(t,e,i,r),oo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_l(),r=vl(e),i=io(n,r);i.tag=2,t!=null&&(i.callback=t),t=ao(e,i,r),t!==null&&(yl(t,e,r,n),oo(t,e,r))}};function Ss(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!kr(n,r)||!kr(i,a):!0}function Cs(e,t,n){var r=!1,i=Ji,a=t.contextType;return typeof a==`object`&&a?a=Xa(a):(i=$i(t)?Zi:Yi.current,r=t.contextTypes,a=(r=r!=null)?Qi(e,i):Ji),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=xs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function ws(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&xs.enqueueReplaceState(t,t.state,null)}function Ts(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},no(e);var a=t.contextType;typeof a==`object`&&a?i.context=Xa(a):(a=$i(t)?Zi:Yi.current,i.context=Qi(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(bs(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&xs.enqueueReplaceState(i,i.state,null),co(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Es(e,t){try{var n=``,r=t;do n+=oe(r),r=r.return;while(r);var i=n}catch(e){i=`
8
- Error generating stack: `+e.message+`
9
- `+e.stack}return{value:e,source:t,stack:i,digest:null}}function Ds(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Os(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var ks=typeof WeakMap==`function`?WeakMap:Map;function As(e,t,n){n=io(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){sl||(sl=!0,cl=r),Os(e,t)},n}function js(e,t,n){n=io(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Os(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Os(e,t),typeof r!=`function`&&(ll===null?ll=new Set([this]):ll.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Ms(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ks;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Wl.bind(null,e,t,n),t.then(e,e))}function Ns(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null?!0:t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Ps(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=io(-1,1),t.tag=2,ao(n,t,1))),n.lanes|=1),e)}var Fs=C.ReactCurrentOwner,Is=!1;function Ls(e,t,n,r){t.child=e===null?Va(t,null,n,r):Ba(t,e.child,n,r)}function Rs(e,t,n,r,i){n=n.render;var a=t.ref;return Ya(t,i),r=No(e,t,n,r,a,i),n=Po(),e!==null&&!Is?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ic(e,t,i)):(Ta&&n&&xa(t),t.flags|=1,Ls(e,t,r,i),t.child)}function zs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ql(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Bs(e,t,a,r,i)):(e=tu(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?kr:n,n(o,r)&&e.ref===t.ref)return ic(e,t,i)}return t.flags|=1,e=eu(a,r),e.ref=t.ref,e.return=t,t.child=e}function Bs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(kr(a,r)&&e.ref===t.ref)if(Is=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Is=!0);else return t.lanes=e.lanes,ic(e,t,i)}return Us(e,t,n,r,i)}function Vs(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},qi(Xc,Yc),Yc|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,qi(Xc,Yc),Yc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,qi(Xc,Yc),Yc|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),qi(Xc,Yc),Yc|=r;return Ls(e,t,i,n),t.child}function Hs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Us(e,t,n,r,i){var a=$i(n)?Zi:Yi.current;return a=Qi(t,a),Ya(t,i),n=No(e,t,n,r,a,i),r=Po(),e!==null&&!Is?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ic(e,t,i)):(Ta&&r&&xa(t),t.flags|=1,Ls(e,t,n,i),t.child)}function Ws(e,t,n,r,i){if($i(n)){var a=!0;ra(t)}else a=!1;if(Ya(t,i),t.stateNode===null)rc(e,t),Cs(t,n,r),Ts(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Xa(l):(l=$i(n)?Zi:Yi.current,l=Qi(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&ws(t,o,r,l),to=!1;var f=t.memoizedState;o.state=f,co(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Xi.current||to?(typeof u==`function`&&(bs(t,n,u,r),c=t.memoizedState),(s=to||Ss(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,ro(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:ys(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Xa(c):(c=$i(n)?Zi:Yi.current,c=Qi(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&ws(t,o,r,c),to=!1,f=t.memoizedState,o.state=f,co(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Xi.current||to?(typeof p==`function`&&(bs(t,n,p,r),m=t.memoizedState),(l=to||Ss(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Gs(e,t,n,r,a,i)}function Gs(e,t,n,r,i,a){Hs(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&ia(t,n,!1),ic(e,t,a);r=t.stateNode,Fs.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ba(t,e.child,null,a),t.child=Ba(t,null,s,a)):Ls(e,t,s,a),t.memoizedState=r.state,i&&ia(t,n,!0),t.child}function Ks(e){var t=e.stateNode;t.pendingContext?ta(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ta(e,t.context,!1),go(e,t.containerInfo)}function qs(e,t,n,r,i){return W(),Pa(i),t.flags|=256,Ls(e,t,n,r),t.child}var Js={dehydrated:null,treeContext:null,retryLane:0};function Ys(e){return{baseLanes:e,cachePool:null,transitions:null}}function Xs(e,t,n){var r=t.pendingProps,i=G.current,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!=0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),qi(G,i&1),e===null)return Aa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data===`$!`?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=ru(o,r,0,null),e=nu(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Ys(n),t.memoizedState=Js,e):Zs(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return $s(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=eu(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=nu(a,o,n,null),a.flags|=2):a=eu(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?Ys(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Js,r}return a=e.child,e=a.sibling,r=eu(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Zs(e,t){return t=ru({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function Qs(e,t,n,r){return r!==null&&Pa(r),Ba(t,e.child,null,n),e=Zs(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $s(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=Ds(Error(r(422))),Qs(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=ru({mode:`visible`,children:i.children},a,0,null),o=nu(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Ba(t,e.child,null,s),t.child.memoizedState=Ys(s),t.memoizedState=Js,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return Qs(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=Ds(o,i,void 0),Qs(e,t,s,i)}if(c=(s&e.childLanes)!==0,Is||c){if(i=Kc,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,eo(e,a),yl(i,e,a,-1))}return Nl(),i=Ds(Error(r(421))),Qs(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Kl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,wa=Ai(a.nextSibling),Ca=t,Ta=!0,Ea=null,e!==null&&(U[ha++]=_a,U[ha++]=va,U[ha++]=ga,_a=e.id,va=e.overflow,ga=t),t=Zs(t,i.children),t.flags|=4096,t)}function ec(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ja(e.return,t,n)}function tc(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function nc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Ls(e,t,r.children,n),r=G.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ec(e,n,t);else if(e.tag===19)ec(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(qi(G,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&K(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),tc(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&K(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}tc(t,!0,n,null,a);break;case`together`:tc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function rc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ic(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),$c|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=eu(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=eu(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ac(e,t,n){switch(t.tag){case 3:Ks(t),W();break;case 5:vo(t);break;case 1:$i(t.type)&&ra(t);break;case 4:go(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;qi(Ha,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(qi(G,G.current&1),e=ic(e,t,n),e===null?null:e.sibling):Xs(e,t,n):(qi(G,G.current&1),t.flags|=128,null);qi(G,G.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return nc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),qi(G,G.current),r)break;return null;case 22:case 23:return t.lanes=0,Vs(e,t,n)}return ic(e,t,n)}var oc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},sc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,ho(fo.current);var o=null;switch(n){case`input`:i=he(e,i),r=he(e,r),o=[];break;case`select`:i=F({},i,{value:void 0}),r=F({},r,{value:void 0}),o=[];break;case`textarea`:i=Ce(e,i),r=Ce(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=bi)}Ie(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null));for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null))if(u===`style`)if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l;else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&oi(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},cc=function(e,t,n,r){n!==r&&(t.flags|=4)};function lc(e,t){if(!Ta)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function uc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function dc(e,t,n){var i=t.pendingProps;switch(Sa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return uc(t),null;case 1:return $i(t.type)&&ea(),uc(t),null;case 3:return i=t.stateNode,_o(),Ki(Xi),Ki(Yi),xo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Ma(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ea!==null&&(Cl(Ea),Ea=null))),uc(t),null;case 5:yo(t);var o=ho(mo.current);if(n=t.type,e!==null&&t.stateNode!=null)sc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return uc(t),null}if(e=ho(fo.current),Ma(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[Ni]=t,i[Pi]=s,e=(t.mode&1)!=0,n){case`dialog`:oi(`cancel`,i),oi(`close`,i);break;case`iframe`:case`object`:case`embed`:oi(`load`,i);break;case`video`:case`audio`:for(o=0;o<ni.length;o++)oi(ni[o],i);break;case`source`:oi(`error`,i);break;case`img`:case`image`:case`link`:oi(`error`,i),oi(`load`,i);break;case`details`:oi(`toggle`,i);break;case`input`:ge(i,s),oi(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},oi(`invalid`,i);break;case`textarea`:we(i,s),oi(`invalid`,i)}for(var c in Ie(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&yi(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&yi(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&oi(`scroll`,i)}switch(n){case`input`:fe(i),ye(i,s,!0);break;case`textarea`:fe(i),Ee(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=bi)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=De(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Ni]=t,e[Pi]=i,oc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Le(n,i),n){case`dialog`:oi(`cancel`,e),oi(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:oi(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<ni.length;o++)oi(ni[o],e);o=i;break;case`source`:oi(`error`,e),o=i;break;case`img`:case`image`:case`link`:oi(`error`,e),oi(`load`,e),o=i;break;case`details`:oi(`toggle`,e),o=i;break;case`input`:ge(e,i),o=he(e,i),oi(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=F({},i,{value:void 0}),oi(`invalid`,e);break;case`textarea`:we(e,i),o=Ce(e,i),oi(`invalid`,e);break;default:o=i}for(s in Ie(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?Pe(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Ae(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&je(e,u):typeof u==`number`&&je(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&oi(`scroll`,e):u!=null&&S(e,s,u,c))}switch(n){case`input`:fe(e),ye(e,i,!1);break;case`textarea`:fe(e),Ee(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+le(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&Se(e,!!i.multiple,i.defaultValue,!0):Se(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=bi)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return uc(t),null;case 6:if(e&&t.stateNode!=null)cc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=ho(mo.current),ho(fo.current),Ma(t)){if(i=t.stateNode,n=t.memoizedProps,i[Ni]=t,(s=i.nodeValue!==n)&&(e=Ca,e!==null))switch(e.tag){case 3:yi(i.nodeValue,n,(e.mode&1)!=0);break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&yi(i.nodeValue,n,(e.mode&1)!=0)}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Ni]=t,t.stateNode=i}return uc(t),null;case 13:if(Ki(G),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ta&&wa!==null&&t.mode&1&&!(t.flags&128))Na(),W(),t.flags|=98560,s=!1;else if(s=Ma(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[Ni]=t}else W(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;uc(t),s=!1}else Ea!==null&&(Cl(Ea),Ea=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||G.current&1?Zc===0&&(Zc=3):Nl())),t.updateQueue!==null&&(t.flags|=4),uc(t),null);case 4:return _o(),e===null&&li(t.stateNode.containerInfo),uc(t),null;case 10:return qa(t.type._context),uc(t),null;case 17:return $i(t.type)&&ea(),uc(t),null;case 19:if(Ki(G),s=t.memoizedState,s===null)return uc(t),null;if(i=(t.flags&128)!=0,c=s.rendering,c===null)if(i)lc(s,!1);else{if(Zc!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=K(e),c!==null){for(t.flags|=128,lc(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return qi(G,G.current&1|2),t.child}e=e.sibling}s.tail!==null&&_t()>al&&(t.flags|=128,i=!0,lc(s,!1),t.lanes=4194304)}else{if(!i)if(e=K(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),lc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!Ta)return uc(t),null}else 2*_t()-s.renderingStartTime>al&&n!==1073741824&&(t.flags|=128,i=!0,lc(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(uc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=_t(),t.sibling=null,n=G.current,qi(G,i?n&1|2:n&1),t);case 22:case 23:return kl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Yc&1073741824&&(uc(t),t.subtreeFlags&6&&(t.flags|=8192)):uc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function fc(e,t){switch(Sa(t),t.tag){case 1:return $i(t.type)&&ea(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _o(),Ki(Xi),Ki(Yi),xo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yo(t),null;case 13:if(Ki(G),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));W()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ki(G),null;case 4:return _o(),null;case 10:return qa(t.type._context),null;case 22:case 23:return kl(),null;case 24:return null;default:return null}}var pc=!1,mc=!1,hc=typeof WeakSet==`function`?WeakSet:Set,J=null;function gc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Ul(e,t,n)}else n.current=null}function _c(e,t,n){try{n()}catch(n){Ul(e,t,n)}}var vc=!1;function yc(e,t){if(xi=mn,e=Nr(),Pr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Si={focusedElem:e,selectionRange:n},mn=!1,J=t;J!==null;)if(t=J,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,J=e;else for(;J!==null;){t=J;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:ys(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Ul(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,J=e;break}J=t.return}return h=vc,vc=!1,h}function bc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&_c(t,n,a)}i=i.next}while(i!==r)}}function xc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Sc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Cc(e){var t=e.alternate;t!==null&&(e.alternate=null,Cc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ni],delete t[Pi],delete t[Ii],delete t[Li],delete t[Ri])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function wc(e){return e.tag===5||e.tag===3||e.tag===4}function Tc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||wc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ec(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=bi));else if(r!==4&&(e=e.child,e!==null))for(Ec(e,t,n),e=e.sibling;e!==null;)Ec(e,t,n),e=e.sibling}function Dc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Dc(e,t,n),e=e.sibling;e!==null;)Dc(e,t,n),e=e.sibling}var Oc=null,kc=!1;function Ac(e,t,n){for(n=n.child;n!==null;)jc(e,t,n),n=n.sibling}function jc(e,t,n){if(Tt&&typeof Tt.onCommitFiberUnmount==`function`)try{Tt.onCommitFiberUnmount(wt,n)}catch{}switch(n.tag){case 5:mc||gc(n,t);case 6:var r=Oc,i=kc;Oc=null,Ac(e,t,n),Oc=r,kc=i,Oc!==null&&(kc?(e=Oc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Oc.removeChild(n.stateNode));break;case 18:Oc!==null&&(kc?(e=Oc,n=n.stateNode,e.nodeType===8?ki(e.parentNode,n):e.nodeType===1&&ki(e,n),fn(e)):ki(Oc,n.stateNode));break;case 4:r=Oc,i=kc,Oc=n.stateNode.containerInfo,kc=!0,Ac(e,t,n),Oc=r,kc=i;break;case 0:case 11:case 14:case 15:if(!mc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&_c(n,t,o),i=i.next}while(i!==r)}Ac(e,t,n);break;case 1:if(!mc&&(gc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Ul(n,t,e)}Ac(e,t,n);break;case 21:Ac(e,t,n);break;case 22:n.mode&1?(mc=(r=mc)||n.memoizedState!==null,Ac(e,t,n),mc=r):Ac(e,t,n);break;default:Ac(e,t,n)}}function Mc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new hc),t.forEach(function(t){var r=ql.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Nc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:Oc=c.stateNode,kc=!1;break a;case 3:Oc=c.stateNode.containerInfo,kc=!0;break a;case 4:Oc=c.stateNode.containerInfo,kc=!0;break a}c=c.return}if(Oc===null)throw Error(r(160));jc(o,s,a),Oc=null,kc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Ul(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Pc(t,e),t=t.sibling}function Pc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Nc(t,e),Fc(e),i&4){try{bc(3,e,e.return),xc(3,e)}catch(t){Ul(e,e.return,t)}try{bc(5,e,e.return)}catch(t){Ul(e,e.return,t)}}break;case 1:Nc(t,e),Fc(e),i&512&&n!==null&&gc(n,n.return);break;case 5:if(Nc(t,e),Fc(e),i&512&&n!==null&&gc(n,n.return),e.flags&32){var a=e.stateNode;try{je(a,``)}catch(t){Ul(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&_e(a,o),Le(c,s);var u=Le(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?Pe(a,f):d===`dangerouslySetInnerHTML`?Ae(a,f):d===`children`?je(a,f):S(a,d,f,u)}switch(c){case`input`:ve(a,o);break;case`textarea`:Te(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?Se(a,!!o.multiple,o.multiple?[]:``,!1):Se(a,!!o.multiple,o.defaultValue,!0)):Se(a,!!o.multiple,m,!1)}a[Pi]=o}catch(t){Ul(e,e.return,t)}}break;case 6:if(Nc(t,e),Fc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Ul(e,e.return,t)}}break;case 3:if(Nc(t,e),Fc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{fn(t.containerInfo)}catch(t){Ul(e,e.return,t)}break;case 4:Nc(t,e),Fc(e);break;case 13:Nc(t,e),Fc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(il=_t())),i&4&&Mc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(mc=(u=mc)||d,Nc(t,e),mc=u):Nc(t,e),Fc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(J=e,d=e.child;d!==null;){for(f=J=d;J!==null;){switch(p=J,m=p.child,p.tag){case 0:case 11:case 14:case 15:bc(4,p,p.return);break;case 1:gc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Ul(i,n,e)}}break;case 5:gc(p,p.return);break;case 22:if(p.memoizedState!==null){zc(f);continue}}m===null?zc(f):(m.return=p,J=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=R(`display`,s))}catch(t){Ul(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Ul(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Nc(t,e),Fc(e),i&4&&Mc(e);break;case 21:break;default:Nc(t,e),Fc(e)}}function Fc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(wc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(je(a,``),i.flags&=-33),Dc(e,Tc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Ec(e,Tc(e),o);break;default:throw Error(r(161))}}catch(t){Ul(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ic(e,t,n){J=e,Lc(e,t,n)}function Lc(e,t,n){for(var r=(e.mode&1)!=0;J!==null;){var i=J,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||pc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||mc;s=pc;var l=mc;if(pc=o,(mc=c)&&!l)for(J=i;J!==null;)o=J,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?Bc(i):(c.return=o,J=c);for(;a!==null;)J=a,Lc(a,t,n),a=a.sibling;J=i,pc=s,mc=l}Rc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,J=a):Rc(e,t,n)}}function Rc(e){for(;J!==null;){var t=J;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:mc||xc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!mc)if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:ys(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&lo(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}lo(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&fn(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}mc||t.flags&512&&Sc(t)}catch(e){Ul(t,t.return,e)}}if(t===e){J=null;break}if(n=t.sibling,n!==null){n.return=t.return,J=n;break}J=t.return}}function zc(e){for(;J!==null;){var t=J;if(t===e){J=null;break}var n=t.sibling;if(n!==null){n.return=t.return,J=n;break}J=t.return}}function Bc(e){for(;J!==null;){var t=J;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{xc(4,t)}catch(e){Ul(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Ul(t,i,e)}}var a=t.return;try{Sc(t)}catch(e){Ul(t,a,e)}break;case 5:var o=t.return;try{Sc(t)}catch(e){Ul(t,o,e)}}}catch(e){Ul(t,t.return,e)}if(t===e){J=null;break}var s=t.sibling;if(s!==null){s.return=t.return,J=s;break}J=t.return}}var Vc=Math.ceil,Hc=C.ReactCurrentDispatcher,Uc=C.ReactCurrentOwner,Wc=C.ReactCurrentBatchConfig,Gc=0,Kc=null,qc=null,Jc=0,Yc=0,Xc=Gi(0),Zc=0,Qc=null,$c=0,el=0,tl=0,nl=null,rl=null,il=0,al=1/0,ol=null,sl=!1,cl=null,ll=null,ul=!1,dl=null,fl=0,pl=0,ml=null,hl=-1,gl=0;function _l(){return Gc&6?_t():hl===-1?hl=_t():hl}function vl(e){return e.mode&1?Gc&2&&Jc!==0?Jc&-Jc:Fa.transition===null?(e=Ht,e===0?(e=window.event,e=e===void 0?16:V(e.type),e):e):(gl===0&&(gl=Lt()),gl):1}function yl(e,t,n,i){if(50<pl)throw pl=0,ml=null,Error(r(185));zt(e,n,i),(!(Gc&2)||e!==Kc)&&(e===Kc&&(!(Gc&2)&&(el|=n),Zc===4&&Tl(e,Jc)),bl(e,i),n===1&&Gc===0&&!(t.mode&1)&&(al=_t()+500,oa&&ua()))}function bl(e,t){var n=e.callbackNode;It(e,t);var r=Pt(e,e===Kc?Jc:0);if(r===0)n!==null&&mt(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&mt(n),t===1)e.tag===0?la(El.bind(null,e)):ca(El.bind(null,e)),Di(function(){!(Gc&6)&&ua()}),n=null;else{switch(Ut(r)){case 1:n=yt;break;case 4:n=bt;break;case 16:n=xt;break;case 536870912:n=Ct;break;default:n=xt}n=Yl(n,xl.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function xl(e,t){if(hl=-1,gl=0,Gc&6)throw Error(r(327));var n=e.callbackNode;if(Vl()&&e.callbackNode!==n)return null;var i=Pt(e,e===Kc?Jc:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Pl(e,i);else{t=i;var a=Gc;Gc|=2;var o=Ml();(Kc!==e||Jc!==t)&&(ol=null,al=_t()+500,Al(e,t));do try{Il();break}catch(t){jl(e,t)}while(1);Ka(),Hc.current=o,Gc=a,qc===null?(Kc=null,Jc=0,t=Zc):t=0}if(t!==0){if(t===2&&(a=z(e),a!==0&&(i=a,t=Sl(e,a))),t===1)throw n=Qc,Al(e,0),Tl(e,i),bl(e,_t()),n;if(t===6)Tl(e,i);else{if(a=e.current.alternate,!(i&30)&&!wl(a)&&(t=Pl(e,i),t===2&&(o=z(e),o!==0&&(i=o,t=Sl(e,o))),t===1))throw n=Qc,Al(e,0),Tl(e,i),bl(e,_t()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:zl(e,rl,ol);break;case 3:if(Tl(e,i),(i&130023424)===i&&(t=il+500-_t(),10<t)){if(Pt(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){_l(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=wi(zl.bind(null,e,rl,ol),t);break}zl(e,rl,ol);break;case 4:if(Tl(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-Dt(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=_t()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Vc(i/1960))-i,10<i){e.timeoutHandle=wi(zl.bind(null,e,rl,ol),i);break}zl(e,rl,ol);break;case 5:zl(e,rl,ol);break;default:throw Error(r(329))}}}return bl(e,_t()),e.callbackNode===n?xl.bind(null,e):null}function Sl(e,t){var n=nl;return e.current.memoizedState.isDehydrated&&(Al(e,t).flags|=256),e=Pl(e,t),e!==2&&(t=rl,rl=n,t!==null&&Cl(t)),e}function Cl(e){rl===null?rl=e:rl.push.apply(rl,e)}function wl(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Or(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Tl(e,t){for(t&=~tl,t&=~el,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Dt(t),r=1<<n;e[n]=-1,t&=~r}}function El(e){if(Gc&6)throw Error(r(327));Vl();var t=Pt(e,0);if(!(t&1))return bl(e,_t()),null;var n=Pl(e,t);if(e.tag!==0&&n===2){var i=z(e);i!==0&&(t=i,n=Sl(e,i))}if(n===1)throw n=Qc,Al(e,0),Tl(e,t),bl(e,_t()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,zl(e,rl,ol),bl(e,_t()),null}function Dl(e,t){var n=Gc;Gc|=1;try{return e(t)}finally{Gc=n,Gc===0&&(al=_t()+500,oa&&ua())}}function Ol(e){dl!==null&&dl.tag===0&&!(Gc&6)&&Vl();var t=Gc;Gc|=1;var n=Wc.transition,r=Ht;try{if(Wc.transition=null,Ht=1,e)return e()}finally{Ht=r,Wc.transition=n,Gc=t,!(Gc&6)&&ua()}}function kl(){Yc=Xc.current,Ki(Xc)}function Al(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ti(n)),qc!==null)for(n=qc.return;n!==null;){var r=n;switch(Sa(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ea();break;case 3:_o(),Ki(Xi),Ki(Yi),xo();break;case 5:yo(r);break;case 4:_o();break;case 13:Ki(G);break;case 19:Ki(G);break;case 10:qa(r.type._context);break;case 22:case 23:kl()}n=n.return}if(Kc=e,qc=e=eu(e.current,null),Jc=Yc=t,Zc=0,Qc=null,tl=el=$c=0,rl=nl=null,Za!==null){for(t=0;t<Za.length;t++)if(n=Za[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}Za=null}return e}function jl(e,t){do{var n=qc;try{if(Ka(),So.current=hs,Do){for(var i=q.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Do=!1}if(wo=0,Eo=To=q=null,Oo=!1,ko=0,Uc.current=null,n===null||n.return===null){Zc=1,Qc=t,qc=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=Jc,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Ns(s);if(m!==null){m.flags&=-257,Ps(m,s,c,o,t),m.mode&1&&Ms(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}else{if(!(t&1)){Ms(o,u,t),Nl();break a}l=Error(r(426))}}else if(Ta&&c.mode&1){var _=Ns(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Ps(_,s,c,o,t),Pa(Es(l,c));break a}}o=l=Es(l,c),Zc!==4&&(Zc=2),nl===null?nl=[o]:nl.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=As(o,l,t);so(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(ll===null||!ll.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=js(o,c,t);so(o,x);break a}}o=o.return}while(o!==null)}Rl(n)}catch(e){t=e,qc===n&&n!==null&&(qc=n=n.return);continue}break}while(1)}function Ml(){var e=Hc.current;return Hc.current=hs,e===null?hs:e}function Nl(){(Zc===0||Zc===3||Zc===2)&&(Zc=4),Kc===null||!($c&268435455)&&!(el&268435455)||Tl(Kc,Jc)}function Pl(e,t){var n=Gc;Gc|=2;var i=Ml();(Kc!==e||Jc!==t)&&(ol=null,Al(e,t));do try{Fl();break}catch(t){jl(e,t)}while(1);if(Ka(),Gc=n,Hc.current=i,qc!==null)throw Error(r(261));return Kc=null,Jc=0,Zc}function Fl(){for(;qc!==null;)Ll(qc)}function Il(){for(;qc!==null&&!ht();)Ll(qc)}function Ll(e){var t=Jl(e.alternate,e,Yc);e.memoizedProps=e.pendingProps,t===null?Rl(e):qc=t,Uc.current=null}function Rl(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=fc(n,t),n!==null){n.flags&=32767,qc=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Zc=6,qc=null;return}}else if(n=dc(n,t,Yc),n!==null){qc=n;return}if(t=t.sibling,t!==null){qc=t;return}qc=t=e}while(t!==null);Zc===0&&(Zc=5)}function zl(e,t,n){var r=Ht,i=Wc.transition;try{Wc.transition=null,Ht=1,Bl(e,t,n,r)}finally{Wc.transition=i,Ht=r}return null}function Bl(e,t,n,i){do Vl();while(dl!==null);if(Gc&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Bt(e,o),e===Kc&&(qc=Kc=null,Jc=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ul||(ul=!0,Yl(xt,function(){return Vl(),null})),o=(n.flags&15990)!=0,n.subtreeFlags&15990||o){o=Wc.transition,Wc.transition=null;var s=Ht;Ht=1;var c=Gc;Gc|=4,Uc.current=null,yc(e,n),Pc(n,e),Fr(Si),mn=!!xi,Si=xi=null,e.current=n,Ic(n,e,a),gt(),Gc=c,Ht=s,Wc.transition=o}else e.current=n;if(ul&&(ul=!1,dl=e,fl=a),o=e.pendingLanes,o===0&&(ll=null),Et(n.stateNode,i),bl(e,_t()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(sl)throw sl=!1,e=cl,cl=null,e;return fl&1&&e.tag!==0&&Vl(),o=e.pendingLanes,o&1?e===ml?pl++:(pl=0,ml=e):pl=0,ua(),null}function Vl(){if(dl!==null){var e=Ut(fl),t=Wc.transition,n=Ht;try{if(Wc.transition=null,Ht=16>e?16:e,dl===null)var i=!1;else{if(e=dl,dl=null,fl=0,Gc&6)throw Error(r(331));var a=Gc;for(Gc|=4,J=e.current;J!==null;){var o=J,s=o.child;if(J.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(J=u;J!==null;){var d=J;switch(d.tag){case 0:case 11:case 15:bc(8,d,o)}var f=d.child;if(f!==null)f.return=d,J=f;else for(;J!==null;){d=J;var p=d.sibling,m=d.return;if(Cc(d),d===u){J=null;break}if(p!==null){p.return=m,J=p;break}J=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}J=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,J=s;else b:for(;J!==null;){if(o=J,o.flags&2048)switch(o.tag){case 0:case 11:case 15:bc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,J=v;break b}J=o.return}}var y=e.current;for(J=y;J!==null;){s=J;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,J=b;else b:for(s=y;J!==null;){if(c=J,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:xc(9,c)}}catch(e){Ul(c,c.return,e)}if(c===s){J=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,J=x;break b}J=c.return}}if(Gc=a,ua(),Tt&&typeof Tt.onPostCommitFiberRoot==`function`)try{Tt.onPostCommitFiberRoot(wt,e)}catch{}i=!0}return i}finally{Ht=n,Wc.transition=t}}return!1}function Hl(e,t,n){t=Es(n,t),t=As(e,t,1),e=ao(e,t,1),t=_l(),e!==null&&(zt(e,1,t),bl(e,t))}function Ul(e,t,n){if(e.tag===3)Hl(e,e,n);else for(;t!==null;){if(t.tag===3){Hl(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ll===null||!ll.has(r))){e=Es(n,e),e=js(t,e,1),t=ao(t,e,1),e=_l(),t!==null&&(zt(t,1,e),bl(t,e));break}}t=t.return}}function Wl(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=_l(),e.pingedLanes|=e.suspendedLanes&n,Kc===e&&(Jc&n)===n&&(Zc===4||Zc===3&&(Jc&130023424)===Jc&&500>_t()-il?Al(e,0):tl|=n),bl(e,t)}function Gl(e,t){t===0&&(e.mode&1?(t=Mt,Mt<<=1,!(Mt&130023424)&&(Mt=4194304)):t=1);var n=_l();e=eo(e,t),e!==null&&(zt(e,t,n),bl(e,n))}function Kl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gl(e,n)}function ql(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Gl(e,n)}var Jl=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Xi.current)Is=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Is=!1,ac(e,t,n);Is=!!(e.flags&131072)}else Is=!1,Ta&&t.flags&1048576&&ba(t,ma,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;rc(e,t),e=t.pendingProps;var a=Qi(t,Yi.current);Ya(t,n),a=No(null,t,i,e,a,n);var o=Po();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,$i(i)?(o=!0,ra(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,no(t),a.updater=xs,t.stateNode=a,a._reactInternals=t,Ts(t,i,e,n),t=Gs(null,t,i,!0,o,n)):(t.tag=0,Ta&&o&&xa(t),Ls(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(rc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=$l(i),e=ys(i,e),a){case 0:t=Us(null,t,i,e,n);break a;case 1:t=Ws(null,t,i,e,n);break a;case 11:t=Rs(null,t,i,e,n);break a;case 14:t=zs(null,t,i,ys(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:ys(i,a),Us(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:ys(i,a),Ws(e,t,i,a,n);case 3:a:{if(Ks(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,ro(e,t),co(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Es(Error(r(423)),t),t=qs(e,t,i,n,a);break a}else if(i!==a){a=Es(Error(r(424)),t),t=qs(e,t,i,n,a);break a}else for(wa=Ai(t.stateNode.containerInfo.firstChild),Ca=t,Ta=!0,Ea=null,n=Va(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(W(),i===a){t=ic(e,t,n);break a}Ls(e,t,i,n)}t=t.child}return t;case 5:return vo(t),e===null&&Aa(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,Ci(i,a)?s=null:o!==null&&Ci(i,o)&&(t.flags|=32),Hs(e,t),Ls(e,t,s,n),t.child;case 6:return e===null&&Aa(t),null;case 13:return Xs(e,t,n);case 4:return go(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ba(t,null,i,n):Ls(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:ys(i,a),Rs(e,t,i,a,n);case 7:return Ls(e,t,t.pendingProps,n),t.child;case 8:return Ls(e,t,t.pendingProps.children,n),t.child;case 12:return Ls(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,qi(Ha,i._currentValue),i._currentValue=s,o!==null)if(Or(o.value,s)){if(o.children===a.children&&!Xi.current){t=ic(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=io(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Ja(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Ja(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ls(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Ya(t,n),a=Xa(a),i=i(a),t.flags|=1,Ls(e,t,i,n),t.child;case 14:return i=t.type,a=ys(i,t.pendingProps),a=ys(i.type,a),zs(e,t,i,a,n);case 15:return Bs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:ys(i,a),rc(e,t),t.tag=1,$i(i)?(e=!0,ra(t)):e=!1,Ya(t,n),Cs(t,i,a),Ts(t,i,a,n),Gs(null,t,i,!0,e,n);case 19:return nc(e,t,n);case 22:return Vs(e,t,n)}throw Error(r(156,t.tag))};function Yl(e,t){return pt(e,t)}function Xl(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.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zl(e,t,n,r){return new Xl(e,t,n,r)}function Ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $l(e){if(typeof e==`function`)return+!!Ql(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===N)return 14}return 2}function eu(e,t){var n=e.alternate;return n===null?(n=Zl(e.tag,t,e.key,e.mode),n.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.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,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=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function tu(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)Ql(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return nu(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=Zl(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=Zl(13,n,t,a),e.elementType=M,e.lanes=o,e;case ee:return e=Zl(19,n,t,a),e.elementType=ee,e.lanes=o,e;case te:return ru(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case N:s=14;break a;case P:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Zl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function nu(e,t,n,r){return e=Zl(7,e,r,t),e.lanes=n,e}function ru(e,t,n,r){return e=Zl(22,e,r,t),e.elementType=te,e.lanes=n,e.stateNode={isHidden:!1},e}function iu(e,t,n){return e=Zl(6,e,null,t),e.lanes=n,e}function au(e,t,n){return t=Zl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ou(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rt(0),this.expirationTimes=Rt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function su(e,t,n,r,i,a,o,s,c){return e=new ou(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Zl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},no(a),e}function cu(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function lu(e){if(!e)return Ji;e=e._reactInternals;a:{if(st(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if($i(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if($i(n))return na(e,n,t)}return t}function uu(e,t,n,r,i,a,o,s,c){return e=su(n,r,!0,e,i,a,o,s,c),e.context=lu(null),n=e.current,r=_l(),i=vl(n),a=io(r,i),a.callback=t??null,ao(n,a,i),e.current.lanes=i,zt(e,i,r),bl(e,r),e}function du(e,t,n,r){var i=t.current,a=_l(),o=vl(i);return n=lu(n),t.context===null?t.context=n:t.pendingContext=n,t=io(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ao(i,t,o),e!==null&&(yl(e,i,o,a),oo(e,i,o)),o}function fu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function pu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mu(e,t){pu(e,t),(e=e.alternate)&&pu(e,t)}function hu(){return null}var gu=typeof reportError==`function`?reportError:function(e){console.error(e)};function _u(e){this._internalRoot=e}vu.prototype.render=_u.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));du(e,t,null,null)},vu.prototype.unmount=_u.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ol(function(){du(null,e,null,null)}),t[Fi]=null}};function vu(e){this._internalRoot=e}vu.prototype.unstable_scheduleHydration=function(e){if(e){var t=qt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<tn.length&&t!==0&&t<tn[n].priority;n++);tn.splice(n,0,e),n===0&&sn(e)}};function yu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function bu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function xu(){}function Y(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=fu(o);a.call(e)}}var o=uu(t,r,e,0,null,!1,!1,``,xu);return e._reactRootContainer=o,e[Fi]=o.current,li(e.nodeType===8?e.parentNode:e),Ol(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=fu(c);s.call(e)}}var c=su(e,0,!1,null,null,!1,!1,``,xu);return e._reactRootContainer=c,e[Fi]=c.current,li(e.nodeType===8?e.parentNode:e),Ol(function(){du(t,c,n,r)}),c}function Su(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=fu(o);s.call(e)}}du(t,o,e,i)}else o=Y(n,t,e,i,r);return fu(o)}Wt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Nt(t.pendingLanes);n!==0&&(Vt(t,n|1),bl(t,_t()),!(Gc&6)&&(al=_t()+500,ua()))}break;case 13:Ol(function(){var t=eo(e,1);t!==null&&yl(t,e,1,_l())}),mu(e,1)}},Gt=function(e){if(e.tag===13){var t=eo(e,134217728);t!==null&&yl(t,e,134217728,_l()),mu(e,134217728)}},Kt=function(e){if(e.tag===13){var t=vl(e),n=eo(e,t);n!==null&&yl(n,e,t,_l()),mu(e,t)}},qt=function(){return Ht},Jt=function(e,t){var n=Ht;try{return Ht=e,t()}finally{Ht=n}},Be=function(e,t,n){switch(t){case`input`:if(ve(e,n),t=n.name,n.type===`radio`&&t!=null){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 i=n[t];if(i!==e&&i.form===e.form){var a=Hi(i);if(!a)throw Error(r(90));pe(i),ve(i,a)}}}break;case`textarea`:Te(e,n);break;case`select`:t=n.value,t!=null&&Se(e,!!n.multiple,t,!1)}},Ke=Dl,qe=Ol;var Cu={usingClientEntryPoint:!1,Events:[Bi,Vi,Hi,We,Ge,Dl]},wu={findFiberByHostInstance:zi,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},Tu={bundleType:wu.bundleType,version:wu.version,rendererPackageName:wu.rendererPackageName,rendererConfig:wu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=dt(e),e===null?null:e.stateNode},findFiberByHostInstance:wu.findFiberByHostInstance||hu,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.3.1-next-f1338f8080-20240426`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Eu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Eu.isDisabled&&Eu.supportsFiber)try{wt=Eu.inject(Tu),Tt=Eu}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Cu,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!yu(t))throw Error(r(200));return cu(e,t,null,n)},e.createRoot=function(e,t){if(!yu(e))throw Error(r(299));var n=!1,i=``,a=gu;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=su(e,1,!1,null,null,n,!1,i,a),e[Fi]=t.current,li(e.nodeType===8?e.parentNode:e),new _u(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=dt(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Ol(e)},e.hydrate=function(e,t,n){if(!bu(t))throw Error(r(200));return Su(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!yu(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=gu;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=uu(t,null,e,1,n??null,a,!1,o,s),e[Fi]=t.current,li(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new vu(t)},e.render=function(e,t,n){if(!bu(t))throw Error(r(200));return Su(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!bu(e))throw Error(r(40));return e._reactRootContainer?(Ol(function(){Su(null,null,e,!1,function(){e._reactRootContainer=null,e[Fi]=null})}),!0):!1},e.unstable_batchedUpdates=Dl,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!bu(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Su(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),b=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=y()})),x=n((e=>{var t=b();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),S=t(g()),C=t(x());function w(e){var t=[...arguments].slice(1);throw Error(typeof e==`number`?`[MobX] minified error nr: `+e+(t.length?` `+t.map(String).join(`,`):``)+`. Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts`:`[MobX] `+e)}var T={};function E(){return typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:T}var D=Object.assign,O=Object.getOwnPropertyDescriptor,k=Object.defineProperty,A=Object.prototype,j=[];Object.freeze(j);var M={};Object.freeze(M);var ee=typeof Proxy<`u`,N=Object.toString();function P(){ee||w(`Proxy not available`)}function te(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var ne=function(){};function re(e){return typeof e==`function`}function F(e){switch(typeof e){case`string`:case`symbol`:case`number`:return!0}return!1}function I(e){return typeof e==`object`&&!!e}function L(e){if(!I(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var n=Object.hasOwnProperty.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n.toString()===N}function ie(e){var t=e?.constructor;return t?t.name===`GeneratorFunction`||t.displayName===`GeneratorFunction`:!1}function ae(e,t,n){k(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function oe(e,t,n){k(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function se(e,t){var n=`isMobX`+e;return t.prototype[n]=!0,function(e){return I(e)&&e[n]===!0}}function ce(e){return e!=null&&Object.prototype.toString.call(e)===`[object Map]`}function le(e){return Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(e)))===null}function ue(e){return e!=null&&Object.prototype.toString.call(e)===`[object Set]`}var de=Object.getOwnPropertySymbols!==void 0;function fe(e){var t=Object.keys(e);if(!de)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter(function(t){return A.propertyIsEnumerable.call(e,t)})):t}var pe=typeof Reflect<`u`&&Reflect.ownKeys?Reflect.ownKeys:de?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function me(e){return e===null?null:typeof e==`object`?``+e:e}function he(e,t){return A.hasOwnProperty.call(e,t)}var ge=Object.getOwnPropertyDescriptors||function(e){var t={};return pe(e).forEach(function(n){t[n]=O(e,n)}),t};function _e(e,t){return!!(e&t)}function ve(e,t,n){return n?e|=t:e&=~t,e}function ye(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function be(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,De(r.key),r)}}function xe(e,t,n){return t&&be(e.prototype,t),n&&be(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Se(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=Oe(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
10
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ce(){return Ce=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},Ce.apply(null,arguments)}function we(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Te(e,t)}function Te(e,t){return Te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Te(e,t)}function Ee(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function De(e){var t=Ee(e,`string`);return typeof t==`symbol`?t:t+``}function Oe(e,t){if(e){if(typeof e==`string`)return ye(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ye(e,t):void 0}}var ke=Symbol(`mobx-stored-annotations`);function Ae(e){function t(t,n){if(Ne(n))return e.decorate_20223_(t,n);je(t,n,e)}return Object.assign(t,e)}function je(e,t,n){he(e,ke)||ae(e,ke,Ce({},e[ke])),qe(n)||(e[ke][t]=n)}function Me(e){return he(e,ke)||ae(e,ke,Ce({},e[ke])),e[ke]}function Ne(e){return typeof e==`object`&&typeof e.kind==`string`}var R=Symbol(`mobx administration`),Pe=function(){function e(e){e===void 0&&(e=`Atom`),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=nn.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=e}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(e){return e()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(e){return e()})},t.reportObserved=function(){return Dn(this)},t.reportChanged=function(){Tn(),On(this),En()},t.toString=function(){return this.name_},xe(e,[{key:`isBeingObserved`,get:function(){return _e(this.flags_,e.isBeingObservedMask_)},set:function(t){this.flags_=ve(this.flags_,e.isBeingObservedMask_,t)}},{key:`isPendingUnobservation`,get:function(){return _e(this.flags_,e.isPendingUnobservationMask_)},set:function(t){this.flags_=ve(this.flags_,e.isPendingUnobservationMask_,t)}},{key:`diffValue`,get:function(){return+!!_e(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=ve(this.flags_,e.diffValueMask_,t===1)}}])}();Pe.isBeingObservedMask_=1,Pe.isPendingUnobservationMask_=2,Pe.diffValueMask_=4;var Fe=se(`Atom`,Pe);function Ie(e,t,n){t===void 0&&(t=ne),n===void 0&&(n=ne);var r=new Pe(e);return t!==ne&&or(r,t),n!==ne&&sr(r,n),r}function Le(e,t){return e===t}function Re(e,t){return Gi(e,t)}function ze(e,t){return Gi(e,t,1)}function Be(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e==1/t:e!==e&&t!==t}var Ve={identity:Le,structural:Re,default:Be,shallow:ze};function He(e,t,n){return kr(e)?e:Array.isArray(e)?z.array(e,{name:n}):L(e)?z.object(e,void 0,{name:n}):ce(e)?z.map(e,{name:n}):ue(e)?z.set(e,{name:n}):typeof e==`function`&&!Qn(e)&&!Cr(e)?ie(e)?xr(e):Xn(n,e):e}function Ue(e,t,n){if(e==null||Oi(e)||ui(e)||hi(e)||bi(e))return e;if(Array.isArray(e))return z.array(e,{name:n,deep:!1});if(L(e))return z.object(e,void 0,{name:n,deep:!1});if(ce(e))return z.map(e,{name:n,deep:!1});if(ue(e))return z.set(e,{name:n,deep:!1})}function We(e){return e}function Ge(e,t){return Gi(e,t)?t:e}var Ke=`override`;function qe(e){return e.annotationType_===Ke}function Je(e,t){return{annotationType_:e,options_:t,make_:Ye,extend_:Xe,decorate_20223_:Ze}}function Ye(e,t,n,r){var i;return(i=this.options_)!=null&&i.bound?this.extend_(e,t,n,!1)===null?0:1:r===e.target_?this.extend_(e,t,n,!1)===null?0:2:Qn(n.value)?1:(k(r,t,$e(e,this,t,n,!1)),2)}function Xe(e,t,n,r){var i=$e(e,this,t,n);return e.defineProperty_(t,i,r)}function Ze(e,t){var n=t.kind,r=t.name,i=t.addInitializer,a=this,o=function(e){return Kt(a.options_?.name??r.toString(),e,a.options_?.autoAction??!1)};if(n==`field`)return function(e){var t,n=e;return Qn(n)||(n=o(n)),(t=a.options_)!=null&&t.bound&&(n=n.bind(this),n.isMobxAction=!0),n};if(n==`method`){var s;return Qn(e)||(e=o(e)),(s=this.options_)!=null&&s.bound&&i(function(){var e=this,t=e[r].bind(e);t.isMobxAction=!0,e[r]=t}),e}w(`Cannot apply '`+a.annotationType_+`' to '`+String(r)+`' (kind: `+n+`):`+(`
11
- '`+a.annotationType_+`' can only be used on properties with a function value.`))}function Qe(e,t,n,r){t.annotationType_,r.value}function $e(e,t,n,r,i){var a,o;i===void 0&&(i=V.safeDescriptors),Qe(e,t,n,r);var s=r.value;return(a=t.options_)!=null&&a.bound&&(s=s.bind(e.proxy_??e.target_)),{value:Kt(t.options_?.name??n.toString(),s,t.options_?.autoAction??!1,(o=t.options_)!=null&&o.bound?e.proxy_??e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function et(e,t){return{annotationType_:e,options_:t,make_:tt,extend_:nt,decorate_20223_:rt}}function tt(e,t,n,r){var i;return r===e.target_?this.extend_(e,t,n,!1)===null?0:2:(i=this.options_)!=null&&i.bound&&(!he(e.target_,t)||!Cr(e.target_[t]))&&this.extend_(e,t,n,!1)===null?0:Cr(n.value)?1:(k(r,t,at(e,this,t,n,!1,!1)),2)}function nt(e,t,n,r){var i=at(e,this,t,n,this.options_?.bound);return e.defineProperty_(t,i,r)}function rt(e,t){var n,r=t.name,i=t.addInitializer;return Cr(e)||(e=xr(e)),(n=this.options_)!=null&&n.bound&&i(function(){var e=this,t=e[r].bind(e);t.isMobXFlow=!0,e[r]=t}),e}function it(e,t,n,r){t.annotationType_,r.value}function at(e,t,n,r,i,a){a===void 0&&(a=V.safeDescriptors),it(e,t,n,r);var o=r.value;return Cr(o)||(o=xr(o)),i&&(o=o.bind(e.proxy_??e.target_),o.isMobXFlow=!0),{value:o,configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function ot(e,t){return{annotationType_:e,options_:t,make_:st,extend_:ct,decorate_20223_:lt}}function st(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function ct(e,t,n,r){return ut(e,this,t,n),e.defineComputedProperty_(t,Ce({},this.options_,{get:n.get,set:n.set}),r)}function lt(e,t){var n=this,r=t.name,i=t.addInitializer;return i(function(){var t=Ti(this)[R],i=Ce({},n.options_,{get:e,context:this});i.name||=`ObservableObject.`+r.toString(),t.values_.set(r,new en(i))}),function(){return this[R].getObservablePropValue_(r)}}function ut(e,t,n,r){t.annotationType_,r.get}function dt(e,t){return{annotationType_:e,options_:t,make_:ft,extend_:pt,decorate_20223_:mt}}function ft(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function pt(e,t,n,r){return ht(e,this,t,n),e.defineObservableProperty_(t,n.value,this.options_?.enhancer??He,r)}function mt(e,t){var n=this,r=t.kind,i=t.name,a=new WeakSet;function o(e,t){var r=Ti(e)[R],o=new Qt(t,n.options_?.enhancer??He,`ObservableObject.`+i.toString(),!1);r.values_.set(i,o),a.add(e)}if(r==`accessor`)return{get:function(){return a.has(this)||o(this,e.get.call(this)),this[R].getObservablePropValue_(i)},set:function(e){return a.has(this)||o(this,e),this[R].setObservablePropValue_(i,e)},init:function(e){return a.has(this)||o(this,e),e}}}function ht(e,t,n,r){t.annotationType_}var gt=`true`,_t=vt();function vt(e){return{annotationType_:gt,options_:e,make_:yt,extend_:bt,decorate_20223_:xt}}function yt(e,t,n,r){var i;if(n.get)return Vt.make_(e,t,n,r);if(n.set){var a=Qn(n.set)?n.set:Kt(t.toString(),n.set);return r===e.target_?e.defineProperty_(t,{configurable:V.safeDescriptors?e.isPlainObject_:!0,set:a})===null?0:2:(k(r,t,{configurable:!0,set:a}),2)}if(r!==e.target_&&typeof n.value==`function`){var o;if(ie(n.value)){var s;return((s=this.options_)!=null&&s.autoBind?xr.bound:xr).make_(e,t,n,r)}return((o=this.options_)!=null&&o.autoBind?Xn.bound:Xn).make_(e,t,n,r)}var c=this.options_?.deep===!1?z.ref:z;return typeof n.value==`function`&&(i=this.options_)!=null&&i.autoBind&&(n.value=n.value.bind(e.proxy_??e.target_)),c.make_(e,t,n,r)}function bt(e,t,n,r){var i;return n.get?Vt.extend_(e,t,n,r):n.set?e.defineProperty_(t,{configurable:V.safeDescriptors?e.isPlainObject_:!0,set:Kt(t.toString(),n.set)},r):(typeof n.value==`function`&&(i=this.options_)!=null&&i.autoBind&&(n.value=n.value.bind(e.proxy_??e.target_)),(this.options_?.deep===!1?z.ref:z).extend_(e,t,n,r))}function xt(e,t){w(`'`+this.annotationType_+`' cannot be used as a decorator`)}var St=`observable`,Ct=`observable.ref`,wt=`observable.shallow`,Tt=`observable.struct`,Et={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Et);function Dt(e){return e||Et}var Ot=dt(St),kt=dt(Ct,{enhancer:We}),At=dt(wt,{enhancer:Ue}),jt=dt(Tt,{enhancer:Ge}),Mt=Ae(Ot);function Nt(e){return e.deep===!0?He:e.deep===!1?We:Ft(e.defaultDecorator)}function Pt(e){return e?e.defaultDecorator??vt(e):void 0}function Ft(e){return e?e.options_?.enhancer??He:He}function It(e,t,n){if(Ne(t))return Ot.decorate_20223_(e,t);if(F(t)){je(e,t,Ot);return}return kr(e)?e:L(e)?z.object(e,t,n):Array.isArray(e)?z.array(e,t):ce(e)?z.map(e,t):ue(e)?z.set(e,t):typeof e==`object`&&e?e:z.box(e,t)}D(It,Mt);var z=D(It,{box:function(e,t){var n=Dt(t);return new Qt(e,Nt(n),n.name,!0,n.equals)},array:function(e,t){var n=Dt(t);return(V.useProxies===!1||n.proxy===!1?zi:ri)(e,Nt(n),n.name)},map:function(e,t){var n=Dt(t);return new mi(e,Nt(n),n.name)},set:function(e,t){var n=Dt(t);return new yi(e,Nt(n),n.name)},object:function(e,t,n){return Ui(function(){return pr(V.useProxies===!1||n?.proxy===!1?Ti({},n):Wr({},n),e,t)})},ref:Ae(kt),shallow:Ae(At),deep:Mt,struct:Ae(jt)}),Lt=`computed`,Rt=`computed.struct`,zt=ot(Lt),Bt=ot(Rt,{equals:Ve.structural}),Vt=function(e,t){if(Ne(t))return zt.decorate_20223_(e,t);if(F(t))return je(e,t,zt);if(L(e))return Ae(ot(Lt,e));var n=L(t)?t:{};return n.get=e,n.name||=e.name||``,new en(n)};Object.assign(Vt,zt),Vt.struct=Ae(Bt);var Ht=0,Ut=1,Wt=O(function(){},`name`)?.configurable??!1,Gt={value:`action`,configurable:!0,writable:!1,enumerable:!1};function Kt(e,t,n,r){n===void 0&&(n=!1);function i(){return qt(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},Wt&&(Gt.value=e,k(i,`name`,Gt)),i}function qt(e,t,n,r,i){var a=Jt(e,t,r,i);try{return n.apply(r,i)}catch(e){throw a.error_=e,e}finally{Yt(a)}}function Jt(e,t,n,r){var i=!1,a=0,o=V.trackingDerivation,s=!t||!o;Tn();var c=V.allowStateChanges;s&&(fn(),c=Zt(!0));var l=mn(!0),u={runAsAction_:s,prevDerivation_:o,prevAllowStateChanges_:c,prevAllowStateReads_:l,notifySpy_:i,startTime_:a,actionId_:Ut++,parentActionId_:Ht};return Ht=u.actionId_,u}function Yt(e){Ht!==e.actionId_&&w(30),Ht=e.parentActionId_,e.error_!==void 0&&(V.suppressReactionErrors=!0),B(e.prevAllowStateChanges_),hn(e.prevAllowStateReads_),En(),e.runAsAction_&&pn(e.prevDerivation_),V.suppressReactionErrors=!1}function Xt(e,t){var n=Zt(e);try{return t()}finally{B(n)}}function Zt(e){var t=V.allowStateChanges;return V.allowStateChanges=e,t}function B(e){V.allowStateChanges=e}var Qt=function(e){function t(t,n,r,i,a){var o;return r===void 0&&(r=`ObservableValue`),i===void 0&&(i=!0),a===void 0&&(a=Ve.default),o=e.call(this,r)||this,o.enhancer=void 0,o.name_=void 0,o.equals=void 0,o.hasUnreportedChange_=!1,o.interceptors_=void 0,o.changeListeners_=void 0,o.value_=void 0,o.dehancer=void 0,o.enhancer=n,o.name_=r,o.equals=a,o.value_=n(t,void 0,r),o}we(t,e);var n=t.prototype;return n.dehanceValue=function(e){return this.dehancer===void 0?e:this.dehancer(e)},n.set=function(e){this.value_,e=this.prepareNewValue_(e),e!==V.UNCHANGED&&this.setNewValue_(e)},n.prepareNewValue_=function(e){if(Gr(this)){var t=qr(this,{object:this,type:$r,newValue:e});if(!t)return V.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value_,this.name_),this.equals(this.value_,e)?V.UNCHANGED:e},n.setNewValue_=function(e){var t=this.value_;this.value_=e,this.reportChanged(),Jr(this)&&Xr(this,{type:$r,object:this,newValue:e,oldValue:t})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(e){return Kr(this,e)},n.observe_=function(e,t){return t&&e({observableKind:`value`,debugObjectName:this.name_,object:this,type:$r,newValue:this.value_,oldValue:void 0}),Yr(this,e)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+`[`+this.value_+`]`},n.valueOf=function(){return me(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t}(Pe),$t=se(`ObservableValue`,Qt),en=function(){function e(e){this.dependenciesState_=nn.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=nn.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new an(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=rn.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,e.get||w(31),this.derivation=e.get,this.name_=e.name||`ComputedValue`,e.set&&(this.setter_=Kt(`ComputedValue-setter`,e.set)),this.equals_=e.equals||(e.compareStructural||e.struct?Ve.structural:Ve.default),this.scope_=e.context,this.requiresReaction_=e.requiresReaction,this.keepAlive_=!!e.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){An(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(e){return e()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(e){return e()})},t.get=function(){if(this.isComputing&&w(32,this.name_,this.derivation),V.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)sn(this)&&(this.warnAboutUntrackedRead_(),Tn(),this.value_=this.computeValue_(!1),En());else if(Dn(this),sn(this)){var e=V.trackingContext;this.keepAlive_&&!e&&(V.trackingContext=this),this.trackAndCompute()&&kn(this),V.trackingContext=e}var t=this.value_;if(on(t))throw t.cause;return t},t.set=function(e){if(this.setter_){this.isRunningSetter&&w(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,e)}finally{this.isRunningSetter=!1}}else w(34,this.name_)},t.trackAndCompute=function(){var e=this.value_,t=this.dependenciesState_===nn.NOT_TRACKING_,n=this.computeValue_(!0),r=t||on(e)||on(n)||!this.equals_(e,n);return r&&(this.value_=n),r},t.computeValue_=function(e){this.isComputing=!0;var t=Zt(!1),n;if(e)n=cn(this,this.derivation,this.scope_);else if(V.disableErrorBoundaries===!0)n=this.derivation.call(this.scope_);else try{n=this.derivation.call(this.scope_)}catch(e){n=new an(e)}return B(t),this.isComputing=!1,n},t.suspend_=function(){this.keepAlive_||(un(this),this.value_=void 0)},t.observe_=function(e,t){var n=this,r=!0,i=void 0;return $n(function(){var a=n.get();if(!r||t){var o=fn();e({observableKind:`computed`,debugObjectName:n.name_,type:$r,object:n,newValue:a,oldValue:i}),pn(o)}r=!1,i=a})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+`[`+this.derivation.toString()+`]`},t.valueOf=function(){return me(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},xe(e,[{key:`isComputing`,get:function(){return _e(this.flags_,e.isComputingMask_)},set:function(t){this.flags_=ve(this.flags_,e.isComputingMask_,t)}},{key:`isRunningSetter`,get:function(){return _e(this.flags_,e.isRunningSetterMask_)},set:function(t){this.flags_=ve(this.flags_,e.isRunningSetterMask_,t)}},{key:`isBeingObserved`,get:function(){return _e(this.flags_,e.isBeingObservedMask_)},set:function(t){this.flags_=ve(this.flags_,e.isBeingObservedMask_,t)}},{key:`isPendingUnobservation`,get:function(){return _e(this.flags_,e.isPendingUnobservationMask_)},set:function(t){this.flags_=ve(this.flags_,e.isPendingUnobservationMask_,t)}},{key:`diffValue`,get:function(){return+!!_e(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=ve(this.flags_,e.diffValueMask_,t===1)}}])}();en.isComputingMask_=1,en.isRunningSetterMask_=2,en.isBeingObservedMask_=4,en.isPendingUnobservationMask_=8,en.diffValueMask_=16;var tn=se(`ComputedValue`,en),nn;(function(e){e[e.NOT_TRACKING_=-1]=`NOT_TRACKING_`,e[e.UP_TO_DATE_=0]=`UP_TO_DATE_`,e[e.POSSIBLY_STALE_=1]=`POSSIBLY_STALE_`,e[e.STALE_=2]=`STALE_`})(nn||={});var rn;(function(e){e[e.NONE=0]=`NONE`,e[e.LOG=1]=`LOG`,e[e.BREAK=2]=`BREAK`})(rn||={});var an=function(e){this.cause=void 0,this.cause=e};function on(e){return e instanceof an}function sn(e){switch(e.dependenciesState_){case nn.UP_TO_DATE_:return!1;case nn.NOT_TRACKING_:case nn.STALE_:return!0;case nn.POSSIBLY_STALE_:for(var t=mn(!0),n=fn(),r=e.observing_,i=r.length,a=0;a<i;a++){var o=r[a];if(tn(o)){if(V.disableErrorBoundaries)o.get();else try{o.get()}catch{return pn(n),hn(t),!0}if(e.dependenciesState_===nn.STALE_)return pn(n),hn(t),!0}}return gn(e),pn(n),hn(t),!1}}function cn(e,t,n){var r=mn(!0);gn(e),e.newObserving_=Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++V.runId;var i=V.trackingDerivation;V.trackingDerivation=e,V.inBatch++;var a;if(V.disableErrorBoundaries===!0)a=t.call(n);else try{a=t.call(n)}catch(e){a=new an(e)}return V.inBatch--,V.trackingDerivation=i,ln(e),hn(r),a}function ln(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=nn.UP_TO_DATE_,i=0,a=e.unboundDepsCount_,o=0;o<a;o++){var s=n[o];s.diffValue===0&&(s.diffValue=1,i!==o&&(n[i]=s),i++),s.dependenciesState_>r&&(r=s.dependenciesState_)}for(n.length=i,e.newObserving_=null,a=t.length;a--;){var c=t[a];c.diffValue===0&&Cn(c,e),c.diffValue=0}for(;i--;){var l=n[i];l.diffValue===1&&(l.diffValue=0,Sn(l,e))}r!==nn.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function un(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)Cn(t[n],e);e.dependenciesState_=nn.NOT_TRACKING_}function dn(e){var t=fn();try{return e()}finally{pn(t)}}function fn(){var e=V.trackingDerivation;return V.trackingDerivation=null,e}function pn(e){V.trackingDerivation=e}function mn(e){var t=V.allowStateReads;return V.allowStateReads=e,t}function hn(e){V.allowStateReads=e}function gn(e){if(e.dependenciesState_!==nn.UP_TO_DATE_){e.dependenciesState_=nn.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=nn.UP_TO_DATE_}}var _n=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},vn=!0,yn=!1,V=function(){var e=E();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(vn=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new _n().version&&(vn=!1),vn?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new _n):(setTimeout(function(){yn||w(35)},1),new _n)}();function bn(){if((V.pendingReactions.length||V.inBatch||V.isRunningReactions)&&w(36),yn=!0,vn){var e=E();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),V=new _n}}function xn(){return V}function Sn(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Cn(e,t){e.observers_.delete(t),e.observers_.size===0&&wn(e)}function wn(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,V.pendingUnobservations.push(e))}function Tn(){V.inBatch++}function En(){if(--V.inBatch===0){Pn();for(var e=V.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof en&&n.suspend_())}V.pendingUnobservations=[]}}function Dn(e){var t=V.trackingDerivation;return t===null?(e.observers_.size===0&&V.inBatch>0&&wn(e),!1):(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&V.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved)}function On(e){e.lowestObserverState_!==nn.STALE_&&(e.lowestObserverState_=nn.STALE_,e.observers_.forEach(function(e){e.dependenciesState_===nn.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=nn.STALE_}))}function kn(e){e.lowestObserverState_!==nn.STALE_&&(e.lowestObserverState_=nn.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===nn.POSSIBLY_STALE_?t.dependenciesState_=nn.STALE_:t.dependenciesState_===nn.UP_TO_DATE_&&(e.lowestObserverState_=nn.UP_TO_DATE_)}))}function An(e){e.lowestObserverState_===nn.UP_TO_DATE_&&(e.lowestObserverState_=nn.POSSIBLY_STALE_,e.observers_.forEach(function(e){e.dependenciesState_===nn.UP_TO_DATE_&&(e.dependenciesState_=nn.POSSIBLY_STALE_,e.onBecomeStale_())}))}var jn=function(){function e(e,t,n,r){e===void 0&&(e=`Reaction`),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=nn.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=rn.NONE,this.name_=e,this.onInvalidate_=t,this.errorHandler_=n,this.requiresObservable_=r}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,V.pendingReactions.push(this),Pn())},t.runReaction_=function(){if(!this.isDisposed){Tn(),this.isScheduled=!1;var e=V.trackingContext;if(V.trackingContext=this,sn(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(e){this.reportExceptionInDerivation_(e)}}V.trackingContext=e,En()}},t.track=function(e){if(!this.isDisposed){Tn(),this.isRunning=!0;var t=V.trackingContext;V.trackingContext=this;var n=cn(this,e,void 0);V.trackingContext=t,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&un(this),on(n)&&this.reportExceptionInDerivation_(n.cause),En()}},t.reportExceptionInDerivation_=function(e){var t=this;if(this.errorHandler_){this.errorHandler_(e,this);return}if(V.disableErrorBoundaries)throw e;var n=`[mobx] uncaught error in '`+this+`'`;V.suppressReactionErrors||console.error(n,e),V.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Tn(),un(this),En()))},t.getDisposer_=function(e){var t=this,n=function n(){t.dispose(),e==null||e.removeEventListener==null||e.removeEventListener(`abort`,n)};return e==null||e.addEventListener==null||e.addEventListener(`abort`,n),n[R]=this,`dispose`in Symbol&&typeof Symbol.dispose==`symbol`&&(n[Symbol.dispose]=n),n},t.toString=function(){return`Reaction[`+this.name_+`]`},t.trace=function(e){e===void 0&&(e=!1)},xe(e,[{key:`isDisposed`,get:function(){return _e(this.flags_,e.isDisposedMask_)},set:function(t){this.flags_=ve(this.flags_,e.isDisposedMask_,t)}},{key:`isScheduled`,get:function(){return _e(this.flags_,e.isScheduledMask_)},set:function(t){this.flags_=ve(this.flags_,e.isScheduledMask_,t)}},{key:`isTrackPending`,get:function(){return _e(this.flags_,e.isTrackPendingMask_)},set:function(t){this.flags_=ve(this.flags_,e.isTrackPendingMask_,t)}},{key:`isRunning`,get:function(){return _e(this.flags_,e.isRunningMask_)},set:function(t){this.flags_=ve(this.flags_,e.isRunningMask_,t)}},{key:`diffValue`,get:function(){return+!!_e(this.flags_,e.diffValueMask_)},set:function(t){this.flags_=ve(this.flags_,e.diffValueMask_,t===1)}}])}();jn.isDisposedMask_=1,jn.isScheduledMask_=2,jn.isTrackPendingMask_=4,jn.isRunningMask_=8,jn.diffValueMask_=16;var Mn=100,Nn=function(e){return e()};function Pn(){V.inBatch>0||V.isRunningReactions||Nn(Fn)}function Fn(){V.isRunningReactions=!0;for(var e=V.pendingReactions,t=0;e.length>0;){++t===Mn&&(console.error(`[mobx] cycle in reaction: `+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}V.isRunningReactions=!1}var In=se(`Reaction`,jn);function Ln(e){var t=Nn;Nn=function(n){return e(function(){return t(n)})}}function Rn(){return!1}function zn(e){return console.warn(`[mobx.spy] Is a no-op in production builds`),function(){}}var Bn=`action`,Vn=`action.bound`,Hn=`autoAction`,Un=`autoAction.bound`,Wn=`<unnamed action>`,Gn=Je(Bn),Kn=Je(Vn,{bound:!0}),qn=Je(Hn,{autoAction:!0}),Jn=Je(Un,{autoAction:!0,bound:!0});function Yn(e){return function(t,n){if(re(t))return Kt(t.name||Wn,t,e);if(re(n))return Kt(t,n,e);if(Ne(n))return(e?qn:Gn).decorate_20223_(t,n);if(F(n))return je(t,n,e?qn:Gn);if(F(t))return Ae(Je(e?Hn:Bn,{name:t,autoAction:e}))}}var H=Yn(!1);Object.assign(H,Gn);var Xn=Yn(!0);Object.assign(Xn,qn),H.bound=Ae(Kn),Xn.bound=Ae(Jn);function Zn(e){return qt(e.name||Wn,!1,e,this,void 0)}function Qn(e){return re(e)&&e.isMobxAction===!0}function $n(e,t){var n;t===void 0&&(t=M);var r=t?.name??`Autorun`,i=!t.scheduler&&!t.delay,a;if(i)a=new jn(r,function(){this.track(c)},t.onError,t.requiresObservable);else{var o=tr(t),s=!1;a=new jn(r,function(){s||(s=!0,o(function(){s=!1,a.isDisposed||a.track(c)}))},t.onError,t.requiresObservable)}function c(){e(a)}return(n=t)!=null&&(n=n.signal)!=null&&n.aborted||a.schedule_(),a.getDisposer_(t?.signal)}var er=function(e){return e()};function tr(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:er}function nr(e,t,n){var r;n===void 0&&(n=M);var i=n.name??`Reaction`,a=H(i,n.onError?rr(n.onError,t):t),o=!n.scheduler&&!n.delay,s=tr(n),c=!0,l=!1,u,d=n.compareStructural?Ve.structural:n.equals||Ve.default,f=new jn(i,function(){c||o?p():l||(l=!0,s(p))},n.onError,n.requiresObservable);function p(){if(l=!1,!f.isDisposed){var t=!1,r=u;f.track(function(){var n=Xt(!1,function(){return e(f)});t=c||!d(u,n),u=n}),(c&&n.fireImmediately||!c&&t)&&a(u,r,f),c=!1}}return(r=n)!=null&&(r=r.signal)!=null&&r.aborted||f.schedule_(),f.getDisposer_(n?.signal)}function rr(e,t){return function(){try{return t.apply(this,arguments)}catch(t){e.call(this,t)}}}var ir=`onBO`,ar=`onBUO`;function or(e,t,n){return cr(ir,e,t,n)}function sr(e,t,n){return cr(ar,e,t,n)}function cr(e,t,n,r){var i=typeof r==`function`?Bi(t,n):Bi(t),a=re(r)?r:n,o=e+`L`;return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var e=i[o];e&&(e.delete(a),e.size===0&&delete i[o])}}var lr=`never`,ur=`always`,dr=`observed`;function fr(e){e.isolateGlobalState===!0&&bn();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(V.useProxies=t===ur?!0:t===lr?!1:typeof Proxy<`u`),t===`ifavailable`&&(V.verifyProxies=!0),n!==void 0){var r=n===ur?ur:n===dr;V.enforceActions=r,V.allowStateChanges=!(r===!0||r===ur)}[`computedRequiresReaction`,`reactionRequiresObservable`,`observableRequiresReaction`,`disableErrorBoundaries`,`safeDescriptors`].forEach(function(t){t in e&&(V[t]=!!e[t])}),V.allowStateReads=!V.observableRequiresReaction,e.reactionScheduler&&Ln(e.reactionScheduler)}function pr(e,t,n,r){var i=ge(t);return Ui(function(){var t=Ti(e,r)[R];pe(i).forEach(function(e){t.extend_(e,i[e],n&&e in n?n[e]:!0)})}),e}function mr(e,t){return hr(Bi(e,t))}function hr(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=gr(e.observing_).map(hr)),t}function gr(e){return Array.from(new Set(e))}var _r=0;function vr(){this.message=`FLOW_CANCELLED`}vr.prototype=Object.create(Error.prototype);var yr=et(`flow`),br=et(`flow.bound`,{bound:!0}),xr=Object.assign(function(e,t){if(Ne(t))return yr.decorate_20223_(e,t);if(F(t))return je(e,t,yr);var n=e,r=n.name||`<unnamed flow>`,i=function(){var e=this,t=arguments,i=++_r,a=H(r+` - runid: `+i+` - init`,n).apply(e,t),o,s=void 0,c=new Promise(function(e,t){var n=0;o=t;function c(e){s=void 0;var o;try{o=H(r+` - runid: `+i+` - yield `+ n++,a.next).call(a,e)}catch(e){return t(e)}u(o)}function l(e){s=void 0;var o;try{o=H(r+` - runid: `+i+` - yield `+ n++,a.throw).call(a,e)}catch(e){return t(e)}u(o)}function u(n){if(re(n?.then)){n.then(u,t);return}return n.done?e(n.value):(s=Promise.resolve(n.value),s.then(c,l))}c(void 0)});return c.cancel=H(r+` - runid: `+i+` - cancel`,function(){try{s&&Sr(s);var e=a.return(void 0),t=Promise.resolve(e.value);t.then(ne,ne),Sr(t),o(new vr)}catch(e){o(e)}}),c};return i.isMobXFlow=!0,i},yr);xr.bound=Ae(br);function Sr(e){re(e.cancel)&&e.cancel()}function Cr(e){return e?.isMobXFlow===!0}function wr(e,t,n){var r;return hi(e)||ui(e)||$t(e)?r=Vi(e):Oi(e)&&(r=Vi(e,t)),r.dehancer=typeof t==`function`?t:n,function(){r.dehancer=void 0}}function Tr(e,t,n){return re(n)?Dr(e,t,n):Er(e,t)}function Er(e,t){return Vi(e).intercept_(t)}function Dr(e,t,n){return Vi(e,t).intercept_(n)}function Or(e,t){return e?t===void 0?Oi(e)||!!e[R]||Fe(e)||In(e)||tn(e):Oi(e)?e[R].values_.has(t):!1:!1}function kr(e){return Or(e)}function Ar(e){if(Oi(e))return e[R].keys_();if(hi(e)||bi(e))return Array.from(e.keys());if(ui(e))return e.map(function(e,t){return t});w(5)}function jr(e){if(Oi(e))return Ar(e).map(function(t){return e[t]});if(hi(e))return Ar(e).map(function(t){return e.get(t)});if(bi(e))return Array.from(e.values());if(ui(e))return e.slice();w(6)}function Mr(e){if(Oi(e))return Ar(e).map(function(t){return[t,e[t]]});if(hi(e))return Ar(e).map(function(t){return[t,e.get(t)]});if(bi(e))return Array.from(e.entries());if(ui(e))return e.map(function(e,t){return[t,e]});w(7)}function Nr(e,t,n){if(arguments.length===2&&!bi(e)){Tn();var r=t;try{for(var i in r)Nr(e,i,r[i])}finally{En()}return}Oi(e)?e[R].set_(t,n):hi(e)?e.set(t,n):bi(e)?e.add(t):ui(e)?(typeof t!=`number`&&(t=parseInt(t,10)),t<0&&w(`Invalid index: '`+t+`'`),Tn(),t>=e.length&&(e.length=t+1),e[t]=n,En()):w(8)}function Pr(e,t,n){if(Oi(e))return e[R].defineProperty_(t,n);w(39)}function Fr(e,t,n,r){return re(n)?Lr(e,t,n,r):Ir(e,t,n)}function Ir(e,t,n){return Vi(e).observe_(t,n)}function Lr(e,t,n,r){return Vi(e,t).observe_(n,r)}function Rr(e,t){t===void 0&&(t=void 0),Tn();try{return e.apply(t)}finally{En()}}function zr(e,t,n){return arguments.length===1||t&&typeof t==`object`?Vr(e,t):Br(e,t,n||{})}function Br(e,t,n){var r;if(typeof n.timeout==`number`){var i=Error(`WHEN_TIMEOUT`);r=setTimeout(function(){if(!o[R].isDisposed)if(o(),n.onError)n.onError(i);else throw i},n.timeout)}n.name=`When`;var a=Kt(`When-effect`,t),o=$n(function(t){Xt(!1,e)&&(t.dispose(),r&&clearTimeout(r),a())},n);return o}function Vr(e,t){var n;if(t!=null&&(n=t.signal)!=null&&n.aborted)return Object.assign(Promise.reject(Error(`WHEN_ABORTED`)),{cancel:function(){return null}});var r,i,a=new Promise(function(n,a){var o,s=Br(e,n,Ce({},t,{onError:a}));r=function(){s(),a(Error(`WHEN_CANCELLED`))},i=function(){s(),a(Error(`WHEN_ABORTED`))},t==null||(o=t.signal)==null||o.addEventListener==null||o.addEventListener(`abort`,i)}).finally(function(){var e;return t==null||(e=t.signal)==null||e.removeEventListener==null?void 0:e.removeEventListener(`abort`,i)});return a.cancel=r,a}function Hr(e){return e[R]}var Ur={has:function(e,t){return Hr(e).has_(t)},get:function(e,t){return Hr(e).get_(t)},set:function(e,t,n){return F(t)?Hr(e).set_(t,n,!0)??!0:!1},deleteProperty:function(e,t){return F(t)?Hr(e).delete_(t,!0)??!0:!1},defineProperty:function(e,t,n){return Hr(e).defineProperty_(t,n)??!0},ownKeys:function(e){return Hr(e).ownKeys_()},preventExtensions:function(e){w(13)}};function Wr(e,t){var n;return P(),e=Ti(e,t),(n=e[R]).proxy_??(n.proxy_=new Proxy(e,Ur))}function Gr(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Kr(e,t){var n=e.interceptors_||=[];return n.push(t),te(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function qr(e,t){var n=fn();try{for(var r=[].concat(e.interceptors_||[]),i=0,a=r.length;i<a&&(t=r[i](t),t&&!t.type&&w(14),t);i++);return t}finally{pn(n)}}function Jr(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function Yr(e,t){var n=e.changeListeners_||=[];return n.push(t),te(function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)})}function Xr(e,t){var n=fn(),r=e.changeListeners_;if(r){r=r.slice();for(var i=0,a=r.length;i<a;i++)r[i](t);pn(n)}}function Zr(e,t,n){return Ui(function(){var r=Ti(e,n)[R];t??=Me(e),pe(t).forEach(function(e){return r.make_(e,t[e])})}),e}var Qr=`splice`,$r=`update`,ei=1e4,ti={get:function(e,t){var n=e[R];return t===R?n:t===`length`?n.getArrayLength_():typeof t==`string`&&!isNaN(t)?n.get_(parseInt(t)):he(ii,t)?ii[t]:e[t]},set:function(e,t,n){var r=e[R];return t===`length`&&r.setArrayLength_(n),typeof t==`symbol`||isNaN(t)?e[t]=n:r.set_(parseInt(t),n),!0},preventExtensions:function(){w(15)}},ni=function(){function e(e,t,n,r){e===void 0&&(e=`ObservableArray`),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=n,this.legacyMode_=r,this.atom_=new Pe(e),this.enhancer_=function(e,n){return t(e,n,`ObservableArray[..]`)}}var t=e.prototype;return t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.dehanceValues_=function(e){return this.dehancer!==void 0&&e.length>0?e.map(this.dehancer):e},t.intercept_=function(e){return Kr(this,e)},t.observe_=function(e,t){return t===void 0&&(t=!1),t&&e({observableKind:`array`,object:this.proxy_,debugObjectName:this.atom_.name_,type:`splice`,index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Yr(this,e)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(e){(typeof e!=`number`||isNaN(e)||e<0)&&w(`Out of range: `+e);var t=this.values_.length;if(e!==t)if(e>t){for(var n=Array(e-t),r=0;r<e-t;r++)n[r]=void 0;this.spliceWithArray_(t,0,n)}else this.spliceWithArray_(e,t-e)},t.updateArrayLength_=function(e,t){e!==this.lastKnownLength_&&w(16),this.lastKnownLength_+=t,this.legacyMode_&&t>0&&Ri(e+t+1)},t.spliceWithArray_=function(e,t,n){var r=this;this.atom_;var i=this.values_.length;if(e===void 0?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=arguments.length===1?i-e:t==null?0:Math.max(0,Math.min(t,i-e)),n===void 0&&(n=j),Gr(this)){var a=qr(this,{object:this.proxy_,type:Qr,index:e,removedCount:t,added:n});if(!a)return j;t=a.removedCount,n=a.added}if(n=n.length===0?n:n.map(function(e){return r.enhancer_(e,void 0)}),this.legacyMode_){var o=n.length-t;this.updateArrayLength_(i,o)}var s=this.spliceItemsIntoValues_(e,t,n);return(t!==0||n.length!==0)&&this.notifyArraySplice_(e,n,s),this.dehanceValues_(s)},t.spliceItemsIntoValues_=function(e,t,n){if(n.length<ei){var r;return(r=this.values_).splice.apply(r,[e,t].concat(n))}else{var i=this.values_.slice(e,e+t),a=this.values_.slice(e+t);this.values_.length+=n.length-t;for(var o=0;o<n.length;o++)this.values_[e+o]=n[o];for(var s=0;s<a.length;s++)this.values_[e+n.length+s]=a[s];return i}},t.notifyArrayChildUpdate_=function(e,t,n){var r=!this.owned_&&Rn(),i=Jr(this),a=i||r?{observableKind:`array`,object:this.proxy_,type:$r,debugObjectName:this.atom_.name_,index:e,newValue:t,oldValue:n}:null;this.atom_.reportChanged(),i&&Xr(this,a)},t.notifyArraySplice_=function(e,t,n){var r=!this.owned_&&Rn(),i=Jr(this),a=i||r?{observableKind:`array`,object:this.proxy_,debugObjectName:this.atom_.name_,type:Qr,index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;this.atom_.reportChanged(),i&&Xr(this,a)},t.get_=function(e){if(this.legacyMode_&&e>=this.values_.length){console.warn(`[mobx] Out of bounds read: `+e);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[e])},t.set_=function(e,t){var n=this.values_;if(this.legacyMode_&&e>n.length&&w(17,e,n.length),e<n.length){this.atom_;var r=n[e];if(Gr(this)){var i=qr(this,{type:$r,object:this.proxy_,index:e,newValue:t});if(!i)return;t=i.newValue}t=this.enhancer_(t,r),t!==r&&(n[e]=t,this.notifyArrayChildUpdate_(e,t,r))}else{for(var a=Array(e+1-n.length),o=0;o<a.length-1;o++)a[o]=void 0;a[a.length-1]=t,this.spliceWithArray_(n.length,0,a)}},e}();function ri(e,t,n,r){return n===void 0&&(n=`ObservableArray`),r===void 0&&(r=!1),P(),Ui(function(){var i=new ni(n,t,r,!1);oe(i.values_,R,i);var a=new Proxy(i.values_,ti);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var ii={clear:function(){return this.splice(0)},replace:function(e){var t=this[R];return t.spliceWithArray_(0,t.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,t){var n=[...arguments].slice(2),r=this[R];switch(arguments.length){case 0:return[];case 1:return r.spliceWithArray_(e);case 2:return r.spliceWithArray_(e,t)}return r.spliceWithArray_(e,t,n)},spliceWithArray:function(e,t,n){return this[R].spliceWithArray_(e,t,n)},push:function(){var e=this[R],t=[...arguments];return e.spliceWithArray_(e.values_.length,0,t),e.values_.length},pop:function(){return this.splice(Math.max(this[R].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){var e=this[R],t=[...arguments];return e.spliceWithArray_(0,0,t),e.values_.length},reverse:function(){return V.trackingDerivation&&w(37,`reverse`),this.replace(this.slice().reverse()),this},sort:function(){V.trackingDerivation&&w(37,`sort`);var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var t=this[R],n=t.dehanceValues_(t.values_).indexOf(e);return n>-1?(this.splice(n,1),!0):!1}};ai(`at`,oi),ai(`concat`,oi),ai(`flat`,oi),ai(`includes`,oi),ai(`indexOf`,oi),ai(`join`,oi),ai(`lastIndexOf`,oi),ai(`slice`,oi),ai(`toString`,oi),ai(`toLocaleString`,oi),ai(`toSorted`,oi),ai(`toSpliced`,oi),ai(`with`,oi),ai(`every`,si),ai(`filter`,si),ai(`find`,si),ai(`findIndex`,si),ai(`findLast`,si),ai(`findLastIndex`,si),ai(`flatMap`,si),ai(`forEach`,si),ai(`map`,si),ai(`some`,si),ai(`toReversed`,si),ai(`reduce`,ci),ai(`reduceRight`,ci);function ai(e,t){typeof Array.prototype[e]==`function`&&(ii[e]=t(e))}function oi(e){return function(){var t=this[R];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function si(e){return function(t,n){var r=this,i=this[R];return i.atom_.reportObserved(),i.dehanceValues_(i.values_)[e](function(e,i){return t.call(n,e,i,r)})}}function ci(e){return function(){var t=this,n=this[R];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(e,n,r){return i(e,n,r,t)},r[e].apply(r,arguments)}}var li=se(`ObservableArrayAdministration`,ni);function ui(e){return I(e)&&li(e[R])}var di={},fi=`add`,pi=`delete`,mi=function(){function e(e,t,n){var r=this;t===void 0&&(t=He),n===void 0&&(n=`ObservableMap`),this.enhancer_=void 0,this.name_=void 0,this[R]=di,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=t,this.name_=n,re(Map)||w(18),Ui(function(){r.keysAtom_=Ie(`ObservableMap.keys()`),r.data_=new Map,r.hasMap_=new Map,e&&r.merge(e)})}var t=e.prototype;return t.has_=function(e){return this.data_.has(e)},t.has=function(e){var t=this;if(!V.trackingDerivation)return this.has_(e);var n=this.hasMap_.get(e);if(!n){var r=n=new Qt(this.has_(e),We,`ObservableMap.key?`,!1);this.hasMap_.set(e,r),sr(r,function(){return t.hasMap_.delete(e)})}return n.get()},t.set=function(e,t){var n=this.has_(e);if(Gr(this)){var r=qr(this,{type:n?$r:fi,object:this,newValue:t,name:e});if(!r)return this;t=r.newValue}return n?this.updateValue_(e,t):this.addValue_(e,t),this},t.delete=function(e){var t=this;if(this.keysAtom_,Gr(this)&&!qr(this,{type:pi,object:this,name:e}))return!1;if(this.has_(e)){var n=Rn(),r=Jr(this),i=r||n?{observableKind:`map`,debugObjectName:this.name_,type:pi,object:this,oldValue:this.data_.get(e).value_,name:e}:null;return Rr(function(){var n;t.keysAtom_.reportChanged(),(n=t.hasMap_.get(e))==null||n.setNewValue_(!1),t.data_.get(e).setNewValue_(void 0),t.data_.delete(e)}),r&&Xr(this,i),!0}return!1},t.updateValue_=function(e,t){var n=this.data_.get(e);if(t=n.prepareNewValue_(t),t!==V.UNCHANGED){var r=Rn(),i=Jr(this),a=i||r?{observableKind:`map`,debugObjectName:this.name_,type:$r,object:this,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),i&&Xr(this,a)}},t.addValue_=function(e,t){var n=this;this.keysAtom_,Rr(function(){var r,i=new Qt(t,n.enhancer_,`ObservableMap.key`,!1);n.data_.set(e,i),t=i.value_,(r=n.hasMap_.get(e))==null||r.setNewValue_(!0),n.keysAtom_.reportChanged()});var r=Rn(),i=Jr(this),a=i||r?{observableKind:`map`,debugObjectName:this.name_,type:fi,object:this,name:e,newValue:t}:null;i&&Xr(this,a)},t.get=function(e){return this.has(e)?this.dehanceValue_(this.data_.get(e).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var e=this,t=this.keys();return gi({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:e.get(i)}}})},t.entries=function(){var e=this,t=this.keys();return gi({next:function(){var n=t.next(),r=n.done,i=n.value;return{done:r,value:r?void 0:[i,e.get(i)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(e,t){for(var n=Se(this),r;!(r=n()).done;){var i=r.value,a=i[0],o=i[1];e.call(t,o,a,this)}},t.merge=function(e){var t=this;return hi(e)&&(e=new Map(e)),Rr(function(){L(e)?fe(e).forEach(function(n){return t.set(n,e[n])}):Array.isArray(e)?e.forEach(function(e){var n=e[0],r=e[1];return t.set(n,r)}):ce(e)?(le(e)||w(19,e),e.forEach(function(e,n){return t.set(n,e)})):e!=null&&w(20,e)}),this},t.clear=function(){var e=this;Rr(function(){dn(function(){for(var t=Se(e.keys()),n;!(n=t()).done;){var r=n.value;e.delete(r)}})})},t.replace=function(e){var t=this;return Rr(function(){for(var n=_i(e),r=new Map,i=!1,a=Se(t.data_.keys()),o;!(o=a()).done;){var s=o.value;if(!n.has(s))if(t.delete(s))i=!0;else{var c=t.data_.get(s);r.set(s,c)}}for(var l=Se(n.entries()),u;!(u=l()).done;){var d=u.value,f=d[0],p=d[1],m=t.data_.has(f);if(t.set(f,p),t.data_.has(f)){var h=t.data_.get(f);r.set(f,h),m||(i=!0)}}if(!i)if(t.data_.size!==r.size)t.keysAtom_.reportChanged();else for(var g=t.data_.keys(),_=r.keys(),v=g.next(),y=_.next();!v.done;){if(v.value!==y.value){t.keysAtom_.reportChanged();break}v=g.next(),y=_.next()}t.data_=r}),this},t.toString=function(){return`[object ObservableMap]`},t.toJSON=function(){return Array.from(this)},t.observe_=function(e,t){return Yr(this,e)},t.intercept_=function(e){return Kr(this,e)},xe(e,[{key:`size`,get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return`Map`}}])}(),hi=se(`ObservableMap`,mi);function gi(e){return e[Symbol.toStringTag]=`MapIterator`,Yi(e)}function _i(e){if(ce(e)||hi(e))return e;if(Array.isArray(e))return new Map(e);if(L(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return w(21,e)}var vi={},yi=function(){function e(e,t,n){var r=this;t===void 0&&(t=He),n===void 0&&(n=`ObservableSet`),this.name_=void 0,this[R]=vi,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=n,re(Set)||w(22),this.enhancer_=function(e,r){return t(e,r,n)},Ui(function(){r.atom_=Ie(r.name_),e&&r.replace(e)})}var t=e.prototype;return t.dehanceValue_=function(e){return this.dehancer===void 0?e:this.dehancer(e)},t.clear=function(){var e=this;Rr(function(){dn(function(){for(var t=Se(e.data_.values()),n;!(n=t()).done;){var r=n.value;e.delete(r)}})})},t.forEach=function(e,t){for(var n=Se(this),r;!(r=n()).done;){var i=r.value;e.call(t,i,i,this)}},t.add=function(e){var t=this;if(this.atom_,Gr(this)){var n=qr(this,{type:fi,object:this,newValue:e});if(!n)return this;e=n.newValue}if(!this.has(e)){Rr(function(){t.data_.add(t.enhancer_(e,void 0)),t.atom_.reportChanged()});var r=!1,i=Jr(this),a=i||r?{observableKind:`set`,debugObjectName:this.name_,type:fi,object:this,newValue:e}:null;i&&Xr(this,a)}return this},t.delete=function(e){var t=this;if(Gr(this)&&!qr(this,{type:pi,object:this,oldValue:e}))return!1;if(this.has(e)){var n=!1,r=Jr(this),i=r||n?{observableKind:`set`,debugObjectName:this.name_,type:pi,object:this,oldValue:e}:null;return Rr(function(){t.atom_.reportChanged(),t.data_.delete(e)}),r&&Xr(this,i),!0}return!1},t.has=function(e){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(e))},t.entries=function(){var e=this.values();return xi({next:function(){var t=e.next(),n=t.value,r=t.done;return r?{value:void 0,done:r}:{value:[n,n],done:r}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var e=this,t=this.data_.values();return xi({next:function(){var n=t.next(),r=n.value,i=n.done;return i?{value:void 0,done:i}:{value:e.dehanceValue_(r),done:i}}})},t.intersection=function(e){return ue(e)&&!bi(e)?e.intersection(this):new Set(this).intersection(e)},t.union=function(e){return ue(e)&&!bi(e)?e.union(this):new Set(this).union(e)},t.difference=function(e){return new Set(this).difference(e)},t.symmetricDifference=function(e){return ue(e)&&!bi(e)?e.symmetricDifference(this):new Set(this).symmetricDifference(e)},t.isSubsetOf=function(e){return new Set(this).isSubsetOf(e)},t.isSupersetOf=function(e){return new Set(this).isSupersetOf(e)},t.isDisjointFrom=function(e){return ue(e)&&!bi(e)?e.isDisjointFrom(this):new Set(this).isDisjointFrom(e)},t.replace=function(e){var t=this;return bi(e)&&(e=new Set(e)),Rr(function(){Array.isArray(e)||ue(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):e!=null&&w(`Cannot initialize set from `+e)}),this},t.observe_=function(e,t){return Yr(this,e)},t.intercept_=function(e){return Kr(this,e)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return`[object ObservableSet]`},t[Symbol.iterator]=function(){return this.values()},xe(e,[{key:`size`,get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return`Set`}}])}(),bi=se(`ObservableSet`,yi);function xi(e){return e[Symbol.toStringTag]=`SetIterator`,Yi(e)}var Si=Object.create(null),Ci=`remove`,wi=function(){function e(e,t,n,r){t===void 0&&(t=new Map),r===void 0&&(r=_t),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=e,this.values_=t,this.name_=n,this.defaultAnnotation_=r,this.keysAtom_=new Pe(`ObservableObject.keys`),this.isPlainObject_=L(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(e){return this.values_.get(e).get()},t.setObservablePropValue_=function(e,t){var n=this.values_.get(e);if(n instanceof en)return n.set(t),!0;if(Gr(this)){var r=qr(this,{type:$r,object:this.proxy_||this.target_,name:e,newValue:t});if(!r)return null;t=r.newValue}if(t=n.prepareNewValue_(t),t!==V.UNCHANGED){var i=Jr(this),a=i?{type:$r,observableKind:`object`,debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:n.value_,name:e,newValue:t}:null;n.setNewValue_(t),i&&Xr(this,a)}return!0},t.get_=function(e){return V.trackingDerivation&&!he(this.target_,e)&&this.has_(e),this.target_[e]},t.set_=function(e,t,n){return n===void 0&&(n=!1),he(this.target_,e)?this.values_.has(e)?this.setObservablePropValue_(e,t):n?Reflect.set(this.target_,e,t):(this.target_[e]=t,!0):this.extend_(e,{value:t,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,n)},t.has_=function(e){if(!V.trackingDerivation)return e in this.target_;this.pendingKeys_||=new Map;var t=this.pendingKeys_.get(e);return t||(t=new Qt(e in this.target_,We,`ObservableObject.key?`,!1),this.pendingKeys_.set(e,t)),t.get()},t.make_=function(e,t){if(t===!0&&(t=this.defaultAnnotation_),t!==!1){if(!(e in this.target_)){var n;if((n=this.target_[ke])!=null&&n[e])return;w(1,t.annotationType_,this.name_+`.`+e.toString())}for(var r=this.target_;r&&r!==A;){var i=O(r,e);if(i){var a=t.make_(this,e,i,r);if(a===0)return;if(a===1)break}r=Object.getPrototypeOf(r)}ki(this,t,e)}},t.extend_=function(e,t,n,r){if(r===void 0&&(r=!1),n===!0&&(n=this.defaultAnnotation_),n===!1)return this.defineProperty_(e,t,r);var i=n.extend_(this,e,t,r);return i&&ki(this,n,e),i},t.defineProperty_=function(e,t,n){n===void 0&&(n=!1),this.keysAtom_;try{Tn();var r=this.delete_(e);if(!r)return r;if(Gr(this)){var i=qr(this,{object:this.proxy_||this.target_,name:e,type:fi,newValue:t.value});if(!i)return null;var a=i.newValue;t.value!==a&&(t=Ce({},t,{value:a}))}if(n){if(!Reflect.defineProperty(this.target_,e,t))return!1}else k(this.target_,e,t);this.notifyPropertyAddition_(e,t.value)}finally{En()}return!0},t.defineObservableProperty_=function(e,t,n,r){r===void 0&&(r=!1),this.keysAtom_;try{Tn();var i=this.delete_(e);if(!i)return i;if(Gr(this)){var a=qr(this,{object:this.proxy_||this.target_,name:e,type:fi,newValue:t});if(!a)return null;t=a.newValue}var o=Di(e),s={configurable:V.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:o.get,set:o.set};if(r){if(!Reflect.defineProperty(this.target_,e,s))return!1}else k(this.target_,e,s);var c=new Qt(t,n,`ObservableObject.key`,!1);this.values_.set(e,c),this.notifyPropertyAddition_(e,c.value_)}finally{En()}return!0},t.defineComputedProperty_=function(e,t,n){n===void 0&&(n=!1),this.keysAtom_;try{Tn();var r=this.delete_(e);if(!r)return r;if(Gr(this)&&!qr(this,{object:this.proxy_||this.target_,name:e,type:fi,newValue:void 0}))return null;t.name||=`ObservableObject.key`,t.context=this.proxy_||this.target_;var i=Di(e),a={configurable:V.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:i.get,set:i.set};if(n){if(!Reflect.defineProperty(this.target_,e,a))return!1}else k(this.target_,e,a);this.values_.set(e,new en(t)),this.notifyPropertyAddition_(e,void 0)}finally{En()}return!0},t.delete_=function(e,t){if(t===void 0&&(t=!1),this.keysAtom_,!he(this.target_,e))return!0;if(Gr(this)&&!qr(this,{object:this.proxy_||this.target_,name:e,type:Ci}))return null;try{var n;Tn();var r=Jr(this),i=!1,a=this.values_.get(e),o=void 0;if(!a&&(r||i)&&(o=O(this.target_,e)?.value),t){if(!Reflect.deleteProperty(this.target_,e))return!1}else delete this.target_[e];if(a&&(this.values_.delete(e),a instanceof Qt&&(o=a.value_),On(a)),this.keysAtom_.reportChanged(),(n=this.pendingKeys_)==null||(n=n.get(e))==null||n.set(e in this.target_),r||i){var s={type:Ci,observableKind:`object`,object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:o,name:e};r&&Xr(this,s)}}finally{En()}return!0},t.observe_=function(e,t){return Yr(this,e)},t.intercept_=function(e){return Kr(this,e)},t.notifyPropertyAddition_=function(e,t){var n,r=Jr(this),i=!1;if(r||i){var a=r||i?{type:fi,observableKind:`object`,debugObjectName:this.name_,object:this.proxy_||this.target_,name:e,newValue:t}:null;r&&Xr(this,a)}(n=this.pendingKeys_)==null||(n=n.get(e))==null||n.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),pe(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Ti(e,t){if(he(e,R))return e;var n=t?.name??`ObservableObject`;return ae(e,R,new wi(e,new Map,String(n),Pt(t))),e}var Ei=se(`ObservableObjectAdministration`,wi);function Di(e){return Si[e]||(Si[e]={get:function(){return this[R].getObservablePropValue_(e)},set:function(t){return this[R].setObservablePropValue_(e,t)}})}function Oi(e){return I(e)?Ei(e[R]):!1}function ki(e,t,n){var r;(r=e.target_[ke])==null||delete r[n]}var Ai=Ii(0),ji=function(){var e=!1,t={};return Object.defineProperty(t,`0`,{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),Mi=0,Ni=function(){};function Pi(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__===void 0?e.prototype=t:e.prototype.__proto__=t}Pi(Ni,Array.prototype);var Fi=function(e){function t(t,n,r,i){var a;return r===void 0&&(r=`ObservableArray`),i===void 0&&(i=!1),a=e.call(this)||this,Ui(function(){var e=new ni(r,n,i,!0);e.proxy_=a,oe(a,R,e),t&&t.length&&a.spliceWithArray(0,0,t),ji&&Object.defineProperty(a,`0`,Ai)}),a}we(t,e);var n=t.prototype;return n.concat=function(){this[R].atom_.reportObserved();var e=[...arguments];return Array.prototype.concat.apply(this.slice(),e.map(function(e){return ui(e)?e.slice():e}))},n[Symbol.iterator]=function(){var e=this,t=0;return Yi({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})},xe(t,[{key:`length`,get:function(){return this[R].getArrayLength_()},set:function(e){this[R].setArrayLength_(e)}},{key:Symbol.toStringTag,get:function(){return`Array`}}])}(Ni);Object.entries(ii).forEach(function(e){var t=e[0],n=e[1];t!==`concat`&&ae(Fi.prototype,t,n)});function Ii(e){return{enumerable:!1,configurable:!0,get:function(){return this[R].get_(e)},set:function(t){this[R].set_(e,t)}}}function Li(e){k(Fi.prototype,``+e,Ii(e))}function Ri(e){if(e>Mi){for(var t=Mi;t<e+100;t++)Li(t);Mi=e}}Ri(1e3);function zi(e,t,n){return new Fi(e,t,n)}function Bi(e,t){if(typeof e==`object`&&e){if(ui(e))return t!==void 0&&w(23),e[R].atom_;if(bi(e))return e.atom_;if(hi(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||w(25,t,Hi(e)),n}if(Oi(e)){if(!t)return w(26);var r=e[R].values_.get(t);return r||w(27,t,Hi(e)),r}if(Fe(e)||tn(e)||In(e))return e}else if(re(e)&&In(e[R]))return e[R];w(28)}function Vi(e,t){if(e||w(29),t!==void 0)return Vi(Bi(e,t));if(Fe(e)||tn(e)||In(e)||hi(e)||bi(e))return e;if(e[R])return e[R];w(24,e)}function Hi(e,t){var n;if(t!==void 0)n=Bi(e,t);else if(Qn(e))return e.name;else n=Oi(e)||hi(e)||bi(e)?Vi(e):Bi(e);return n.name_}function Ui(e){var t=fn(),n=Zt(!0);Tn();try{return e()}finally{En(),B(n),pn(t)}}var Wi=A.toString;function Gi(e,t,n){return n===void 0&&(n=-1),Ki(e,t,n)}function Ki(e,t,n,r,i){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var a=typeof e;if(a!==`function`&&a!==`object`&&typeof t!=`object`)return!1;var o=Wi.call(e);if(o!==Wi.call(t))return!1;switch(o){case`[object RegExp]`:case`[object String]`:return``+e==``+t;case`[object Number]`:return+e==+e?+e==0?1/e==1/t:+e==+t:+t!=+t;case`[object Date]`:case`[object Boolean]`:return+e==+t;case`[object Symbol]`:return typeof Symbol<`u`&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case`[object Map]`:case`[object Set]`:n>=0&&n++;break}e=qi(e),t=qi(t);var s=o===`[object Array]`;if(!s){if(typeof e!=`object`||typeof t!=`object`)return!1;var c=e.constructor,l=t.constructor;if(c!==l&&!(re(c)&&c instanceof c&&re(l)&&l instanceof l)&&`constructor`in e&&`constructor`in t)return!1}if(n===0)return!1;n<0&&(n=-1),r||=[],i||=[];for(var u=r.length;u--;)if(r[u]===e)return i[u]===t;if(r.push(e),i.push(t),s){if(u=e.length,u!==t.length)return!1;for(;u--;)if(!Ki(e[u],t[u],n-1,r,i))return!1}else{var d=Object.keys(e),f=d.length;if(Object.keys(t).length!==f)return!1;for(var p=0;p<f;p++){var m=d[p];if(!(he(t,m)&&Ki(e[m],t[m],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function qi(e){return ui(e)?e.slice():ce(e)||hi(e)||ue(e)||bi(e)?Array.from(e.entries()):e}var Ji=E().Iterator?.prototype||{};function Yi(e){return e[Symbol.iterator]=Xi,Object.assign(Object.create(Ji),e)}function Xi(){return this}if([`Symbol`,`Map`,`Set`].forEach(function(e){E()[e]===void 0&&w(`MobX requires global '`+e+`' to be available or polyfilled`)}),typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__==`object`&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:zn,extras:{getDebugName:Hi},$mobx:R}),!S.useState)throw Error(`mobx-react-lite requires React with Hooks support`);if(!Zr)throw Error(`mobx-react-lite@3 requires mobx at least version 6 to be available`);var Zi=b();function Qi(e){e()}function $i(e){e||=Qi,fr({reactionScheduler:e})}function ea(e){return mr(e)}var ta=!1;function na(){return ta}var ra=1e4,ia=1e4,aa=function(){function e(e){var t=this;Object.defineProperty(this,`finalize`,{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,`registrations`,{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,`sweepTimeout`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`sweep`,{enumerable:!0,configurable:!0,writable:!0,value:function(e){e===void 0&&(e=ra),clearTimeout(t.sweepTimeout),t.sweepTimeout=void 0;var n=Date.now();t.registrations.forEach(function(r,i){n-r.registeredAt>=e&&(t.finalize(r.value),t.registrations.delete(i))}),t.registrations.size>0&&t.scheduleSweep()}}),Object.defineProperty(this,`finalizeAllImmediately`,{enumerable:!0,configurable:!0,writable:!0,value:function(){t.sweep(0)}})}return Object.defineProperty(e.prototype,`register`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){this.registrations.set(n,{value:t,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,`unregister`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(e.prototype,`scheduleSweep`,{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,ia))}}),e}(),oa=new(typeof FinalizationRegistry<`u`?FinalizationRegistry:aa)(function(e){var t;(t=e.reaction)==null||t.dispose(),e.reaction=null}),sa=n((e=>{var t=g();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),ca=n(((e,t)=>{t.exports=sa()}))();function la(e){e.reaction=new jn(`observer${e.name}`,function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)==null||t.call(e)})}function ua(e,t){if(t===void 0&&(t=`observed`),na())return e();var n=S.useRef(null);if(!n.current){var r={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(e){return oa.unregister(r),r.onStoreChange=e,r.reaction||(la(r),r.stateVersion=Symbol()),function(){var e;r.onStoreChange=null,(e=r.reaction)==null||e.dispose(),r.reaction=null}},getSnapshot:function(){return r.stateVersion}};n.current=r}var i=n.current;i.reaction||(la(i),oa.register(n,i,i)),S.useDebugValue(i.reaction,ea),(0,ca.useSyncExternalStore)(i.subscribe,i.getSnapshot,i.getSnapshot);var a,o;if(i.reaction.track(function(){try{a=e()}catch(e){o=e}}),o)throw o;return a}var da=typeof Symbol==`function`&&Symbol.for,fa=Object.getOwnPropertyDescriptor(function(){},`name`)?.configurable??!1,pa=da?Symbol.for(`react.forward_ref`):typeof S.forwardRef==`function`&&(0,S.forwardRef)(function(e){return null}).$$typeof,ma=da?Symbol.for(`react.memo`):typeof S.memo==`function`&&(0,S.memo)(function(e){return null}).$$typeof;function U(e,t){if(ma&&e.$$typeof===ma)throw Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");if(na())return e;var n=t?.forwardRef??!1,r=e,i=e.displayName||e.name;if(pa&&e.$$typeof===pa&&(n=!0,r=e.render,typeof r!=`function`))throw Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var a=function(e,t){return ua(function(){return r(e,t)},i)};return a.displayName=e.displayName,fa&&Object.defineProperty(a,`name`,{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(a.contextTypes=e.contextTypes),n&&(a=(0,S.forwardRef)(a)),a=(0,S.memo)(a),ga(e,a),a}var ha={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function ga(e,t){Object.keys(e).forEach(function(n){ha[n]||Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}function _a(e){var t=e.children,n=e.render;t&&n&&console.error("MobX Observer: Do not use children and render in the same time in `Observer`");var r=t||n;return typeof r==`function`?ua(r):null}_a.displayName=`Observer`;function va(e,t){return(0,S.useState)(function(){return z(e(),t,{autoBind:!0})})[0]}$i(Zi.unstable_batchedUpdates),oa.finalizeAllImmediately;var ya=f,ba=n(((e,t)=>{t.exports=function(e){var t={},n=g(),r=v(),i=Object.assign;function a(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,s=Symbol.for(`react.element`),c=Symbol.for(`react.portal`),l=Symbol.for(`react.fragment`),u=Symbol.for(`react.strict_mode`),d=Symbol.for(`react.profiler`),f=Symbol.for(`react.provider`),p=Symbol.for(`react.context`),m=Symbol.for(`react.forward_ref`),h=Symbol.for(`react.suspense`),_=Symbol.for(`react.suspense_list`),y=Symbol.for(`react.memo`),b=Symbol.for(`react.lazy`),x=Symbol.for(`react.offscreen`),S=Symbol.iterator;function C(e){return typeof e!=`object`||!e?null:(e=S&&e[S]||e[`@@iterator`],typeof e==`function`?e:null)}function w(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case l:return`Fragment`;case c:return`Portal`;case d:return`Profiler`;case u:return`StrictMode`;case h:return`Suspense`;case _:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case p:return(e.displayName||`Context`)+`.Consumer`;case f:return(e._context.displayName||`Context`)+`.Provider`;case m:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case y:return t=e.displayName||null,t===null?w(e.type)||`Memo`:t;case b:t=e._payload,e=e._init;try{return w(e(t))}catch{}}return null}function T(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return w(t);case 8:return t===u?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function E(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function D(e){if(E(e)!==e)throw Error(a(188))}function O(e){var t=e.alternate;if(!t){if(t=E(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return D(i),e;if(o===r)return D(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=o;break}if(c===r){s=!0,r=i,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,r=i;break}if(c===r){s=!0,r=o,n=i;break}c=c.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function k(e){return e=O(e),e===null?null:A(e)}function A(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=A(e);if(t!==null)return t;e=e.sibling}return null}function j(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){if(e.tag!==4){var t=j(e);if(t!==null)return t}e=e.sibling}return null}var M=Array.isArray,ee=e.getPublicInstance,N=e.getRootHostContext,P=e.getChildHostContext,te=e.prepareForCommit,ne=e.resetAfterCommit,re=e.createInstance,F=e.appendInitialChild,I=e.finalizeInitialChildren,L=e.prepareUpdate,ie=e.shouldSetTextContent,ae=e.createTextInstance,oe=e.scheduleTimeout,se=e.cancelTimeout,ce=e.noTimeout,le=e.isPrimaryRenderer,ue=e.supportsMutation,de=e.supportsPersistence,fe=e.supportsHydration,pe=e.getInstanceFromNode,me=e.preparePortalMount,he=e.getCurrentEventPriority,ge=e.detachDeletedInstance,_e=e.supportsMicrotasks,ve=e.scheduleMicrotask,ye=e.supportsTestSelectors,be=e.findFiberRoot,xe=e.getBoundingRect,Se=e.getTextContent,Ce=e.isHiddenSubtree,we=e.matchAccessibilityRole,Te=e.setFocusIfFocusable,Ee=e.setupIntersectionObserver,De=e.appendChild,Oe=e.appendChildToContainer,ke=e.commitTextUpdate,Ae=e.commitMount,je=e.commitUpdate,Me=e.insertBefore,Ne=e.insertInContainerBefore,R=e.removeChild,Pe=e.removeChildFromContainer,Fe=e.resetTextContent,Ie=e.hideInstance,Le=e.hideTextInstance,Re=e.unhideInstance,ze=e.unhideTextInstance,Be=e.clearContainer,Ve=e.cloneInstance,He=e.createContainerChildSet,Ue=e.appendChildToContainerChildSet,We=e.finalizeContainerChildren,Ge=e.replaceContainerChildren,Ke=e.cloneHiddenInstance,qe=e.cloneHiddenTextInstance,Je=e.canHydrateInstance,Ye=e.canHydrateTextInstance,Xe=e.canHydrateSuspenseInstance,Ze=e.isSuspenseInstancePending,Qe=e.isSuspenseInstanceFallback,$e=e.getSuspenseInstanceFallbackErrorDetails,et=e.registerSuspenseInstanceRetry,tt=e.getNextHydratableSibling,nt=e.getFirstHydratableChild,rt=e.getFirstHydratableChildWithinContainer,it=e.getFirstHydratableChildWithinSuspenseInstance,at=e.hydrateInstance,ot=e.hydrateTextInstance,st=e.hydrateSuspenseInstance,ct=e.getNextHydratableInstanceAfterSuspenseInstance,lt=e.commitHydratedContainer,ut=e.commitHydratedSuspenseInstance,dt=e.clearSuspenseBoundary,ft=e.clearSuspenseBoundaryFromContainer,pt=e.shouldDeleteUnhydratedTailInstances,mt=e.didNotMatchHydratedContainerTextInstance,ht=e.didNotMatchHydratedTextInstance,gt;function _t(e){if(gt===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);gt=t&&t[1]||``}return`
12
- `+gt+e}var vt=!1;function yt(e,t){if(!e||vt)return``;vt=!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()}}),typeof Reflect==`object`&&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(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
13
- `),a=r.stack.split(`
14
- `),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
15
- `+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{vt=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?_t(e):``}var bt=Object.prototype.hasOwnProperty,xt=[],St=-1;function Ct(e){return{current:e}}function wt(e){0>St||(e.current=xt[St],xt[St]=null,St--)}function Tt(e,t){St++,xt[St]=e.current,e.current=t}var Et={},Dt=Ct(Et),Ot=Ct(!1),kt=Et;function At(e,t){var n=e.type.contextTypes;if(!n)return Et;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function jt(e){return e=e.childContextTypes,e!=null}function Mt(){wt(Ot),wt(Dt)}function Nt(e,t,n){if(Dt.current!==Et)throw Error(a(168));Tt(Dt,t),Tt(Ot,n)}function Pt(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!=`function`)return n;for(var o in r=r.getChildContext(),r)if(!(o in t))throw Error(a(108,T(e)||`Unknown`,o));return i({},n,r)}function Ft(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Et,kt=Dt.current,Tt(Dt,e),Tt(Ot,Ot.current),!0}function It(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=Pt(e,t,kt),r.__reactInternalMemoizedMergedChildContext=e,wt(Ot),wt(Dt),Tt(Dt,e)):wt(Ot),Tt(Ot,n)}var z=Math.clz32?Math.clz32:zt,Lt=Math.log,Rt=Math.LN2;function zt(e){return e>>>=0,e===0?32:31-(Lt(e)/Rt|0)|0}var Bt=64,Vt=4194304;function Ht(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ut(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=Ht(a))):r=Ht(s)}else o=n&~i,o===0?a!==0&&(r=Ht(a)):r=Ht(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-z(t),i=1<<n,r|=e[n],t&=~i;return r}function Wt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Gt(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-z(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Wt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Kt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function qt(){var e=Bt;return Bt<<=1,!(Bt&4194240)&&(Bt=64),e}function Jt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Yt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-z(t),e[t]=n}function Xt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-z(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Zt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-z(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var B=0;function Qt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var $t=r.unstable_scheduleCallback,en=r.unstable_cancelCallback,tn=r.unstable_shouldYield,nn=r.unstable_requestPaint,rn=r.unstable_now,an=r.unstable_ImmediatePriority,on=r.unstable_UserBlockingPriority,sn=r.unstable_NormalPriority,cn=r.unstable_IdlePriority,ln=null,un=null;function dn(e){if(un&&typeof un.onCommitFiberRoot==`function`)try{un.onCommitFiberRoot(ln,e,void 0,(e.current.flags&128)==128)}catch{}}function fn(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var pn=typeof Object.is==`function`?Object.is:fn,mn=null,hn=!1,gn=!1;function _n(e){mn===null?mn=[e]:mn.push(e)}function vn(e){hn=!0,_n(e)}function yn(){if(!gn&&mn!==null){gn=!0;var e=0,t=B;try{var n=mn;for(B=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}mn=null,hn=!1}catch(t){throw mn!==null&&(mn=mn.slice(e+1)),$t(an,yn),t}finally{B=t,gn=!1}}return null}var V=[],bn=0,xn=null,Sn=0,Cn=[],wn=0,Tn=null,En=1,Dn=``;function On(e,t){V[bn++]=Sn,V[bn++]=xn,xn=e,Sn=t}function kn(e,t,n){Cn[wn++]=En,Cn[wn++]=Dn,Cn[wn++]=Tn,Tn=e;var r=En;e=Dn;var i=32-z(r)-1;r&=~(1<<i),n+=1;var a=32-z(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,En=1<<32-z(t)+i|n<<i|r,Dn=a+e}else En=1<<a|n<<i|r,Dn=e}function An(e){e.return!==null&&(On(e,1),kn(e,1,0))}function jn(e){for(;e===xn;)xn=V[--bn],V[bn]=null,Sn=V[--bn],V[bn]=null;for(;e===Tn;)Tn=Cn[--wn],Cn[wn]=null,Dn=Cn[--wn],Cn[wn]=null,En=Cn[--wn],Cn[wn]=null}var Mn=null,Nn=null,Pn=!1,Fn=!1,In=null;function Ln(e,t){var n=ws(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Rn(e,t){switch(e.tag){case 5:return t=Je(t,e.type,e.pendingProps),t===null?!1:(e.stateNode=t,Mn=e,Nn=nt(t),!0);case 6:return t=Ye(t,e.pendingProps),t===null?!1:(e.stateNode=t,Mn=e,Nn=null,!0);case 13:if(t=Xe(t),t!==null){var n=Tn===null?null:{id:En,overflow:Dn};return e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ws(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Mn=e,Nn=null,!0}return!1;default:return!1}}function zn(e){return(e.mode&1)!=0&&(e.flags&128)==0}function Bn(e){if(Pn){var t=Nn;if(t){var n=t;if(!Rn(e,t)){if(zn(e))throw Error(a(418));t=tt(n);var r=Mn;t&&Rn(e,t)?Ln(r,n):(e.flags=e.flags&-4097|2,Pn=!1,Mn=e)}}else{if(zn(e))throw Error(a(418));e.flags=e.flags&-4097|2,Pn=!1,Mn=e}}}function Vn(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Mn=e}function Hn(e){if(!fe||e!==Mn)return!1;if(!Pn)return Vn(e),Pn=!0,!1;if(e.tag!==3&&(e.tag!==5||pt(e.type)&&!ie(e.type,e.memoizedProps))){var t=Nn;if(t){if(zn(e))throw Un(),Error(a(418));for(;t;)Ln(e,t),t=tt(t)}}if(Vn(e),e.tag===13){if(!fe)throw Error(a(316));if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Nn=ct(e)}else Nn=Mn?tt(e.stateNode):null;return!0}function Un(){for(var e=Nn;e;)e=tt(e)}function Wn(){fe&&(Nn=Mn=null,Fn=Pn=!1)}function Gn(e){In===null?In=[e]:In.push(e)}var Kn=o.ReactCurrentBatchConfig;function qn(e,t){if(pn(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!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++){var i=n[r];if(!bt.call(t,i)||!pn(e[i],t[i]))return!1}return!0}function Jn(e){switch(e.tag){case 5:return _t(e.type);case 16:return _t(`Lazy`);case 13:return _t(`Suspense`);case 19:return _t(`SuspenseList`);case 0:case 2:case 15:return e=yt(e.type,!1),e;case 11:return e=yt(e.type.render,!1),e;case 1:return e=yt(e.type,!0),e;default:return``}}function Yn(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(a(309));var r=n.stateNode}if(!r)throw Error(a(147,e));var i=r,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=i.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function H(e,t){throw e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function Xn(e){var t=e._init;return t(e._payload)}function Zn(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function i(e,t){return e=Ds(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function u(t){return e&&t.alternate===null&&(t.flags|=2),t}function d(e,t,n,r){return t===null||t.tag!==6?(t=js(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n,r){var a=n.type;return a===l?m(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===b&&Xn(a)===t.type)?(r=i(t,n.props),r.ref=Yn(e,t,n),r.return=e,r):(r=Os(n.type,n.key,n.props,null,e.mode,r),r.ref=Yn(e,t,n),r.return=e,r)}function p(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ms(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function m(e,t,n,r,a){return t===null||t.tag!==7?(t=ks(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function h(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=js(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case s:return n=Os(t.type,t.key,t.props,null,e.mode,n),n.ref=Yn(e,null,t),n.return=e,n;case c:return t=Ms(t,e.mode,n),t.return=e,t;case b:var r=t._init;return h(e,r(t._payload),n)}if(M(t)||C(t))return t=ks(t,e.mode,n,null),t.return=e,t;H(e,t)}return null}function g(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?d(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case s:return n.key===i?f(e,t,n,r):null;case c:return n.key===i?p(e,t,n,r):null;case b:return i=n._init,g(e,t,i(n._payload),r)}if(M(n)||C(n))return i===null?m(e,t,n,r,null):null;H(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,d(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case s:return e=e.get(r.key===null?n:r.key)||null,f(t,e,r,i);case c:return e=e.get(r.key===null?n:r.key)||null,p(t,e,r,i);case b:var a=r._init;return _(e,t,n,a(r._payload),i)}if(M(r)||C(r))return e=e.get(n)||null,m(t,e,r,i,null);H(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,f=a=0,p=null;d!==null&&f<s.length;f++){d.index>f?(p=d,d=null):p=d.sibling;var m=g(i,d,s[f],c);if(m===null){d===null&&(d=p);break}e&&d&&m.alternate===null&&t(i,d),a=o(m,a,f),u===null?l=m:u.sibling=m,u=m,d=p}if(f===s.length)return n(i,d),Pn&&On(i,f),l;if(d===null){for(;f<s.length;f++)d=h(i,s[f],c),d!==null&&(a=o(d,a,f),u===null?l=d:u.sibling=d,u=d);return Pn&&On(i,f),l}for(d=r(i,d);f<s.length;f++)p=_(d,i,f,s[f],c),p!==null&&(e&&p.alternate!==null&&d.delete(p.key===null?f:p.key),a=o(p,a,f),u===null?l=p:u.sibling=p,u=p);return e&&d.forEach(function(e){return t(i,e)}),Pn&&On(i,f),l}function y(i,s,c,l){var u=C(c);if(typeof u!=`function`)throw Error(a(150));if(c=u.call(c),c==null)throw Error(a(151));for(var d=u=null,f=s,p=s=0,m=null,v=c.next();f!==null&&!v.done;p++,v=c.next()){f.index>p?(m=f,f=null):m=f.sibling;var y=g(i,f,v.value,l);if(y===null){f===null&&(f=m);break}e&&f&&y.alternate===null&&t(i,f),s=o(y,s,p),d===null?u=y:d.sibling=y,d=y,f=m}if(v.done)return n(i,f),Pn&&On(i,p),u;if(f===null){for(;!v.done;p++,v=c.next())v=h(i,v.value,l),v!==null&&(s=o(v,s,p),d===null?u=v:d.sibling=v,d=v);return Pn&&On(i,p),u}for(f=r(i,f);!v.done;p++,v=c.next())v=_(f,i,p,v.value,l),v!==null&&(e&&v.alternate!==null&&f.delete(v.key===null?p:v.key),s=o(v,s,p),d===null?u=v:d.sibling=v,d=v);return e&&f.forEach(function(e){return t(i,e)}),Pn&&On(i,p),u}function x(e,r,a,o){if(typeof a==`object`&&a&&a.type===l&&a.key===null&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case s:a:{for(var d=a.key,f=r;f!==null;){if(f.key===d){if(d=a.type,d===l){if(f.tag===7){n(e,f.sibling),r=i(f,a.props.children),r.return=e,e=r;break a}}else if(f.elementType===d||typeof d==`object`&&d&&d.$$typeof===b&&Xn(d)===f.type){n(e,f.sibling),r=i(f,a.props),r.ref=Yn(e,f,a),r.return=e,e=r;break a}n(e,f);break}else t(e,f);f=f.sibling}a.type===l?(r=ks(a.props.children,e.mode,o,a.key),r.return=e,e=r):(o=Os(a.type,a.key,a.props,null,e.mode,o),o.ref=Yn(e,r,a),o.return=e,e=o)}return u(e);case c:a:{for(f=a.key;r!==null;){if(r.key===f)if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),r=i(r,a.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=Ms(a,e.mode,o),r.return=e,e=r}return u(e);case b:return f=a._init,x(e,r,f(a._payload),o)}if(M(a))return v(e,r,a,o);if(C(a))return y(e,r,a,o);H(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),r=i(r,a),r.return=e,e=r):(n(e,r),r=js(a,e.mode,o),r.return=e,e=r),u(e)):n(e,r)}return x}var Qn=Zn(!0),$n=Zn(!1),er=Ct(null),tr=null,nr=null,rr=null;function ir(){rr=nr=tr=null}function ar(e,t,n){le?(Tt(er,t._currentValue),t._currentValue=n):(Tt(er,t._currentValue2),t._currentValue2=n)}function or(e){var t=er.current;wt(er),le?e._currentValue=t:e._currentValue2=t}function sr(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function cr(e,t){tr=e,rr=nr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Zi=!0),e.firstContext=null)}function lr(e){var t=le?e._currentValue:e._currentValue2;if(rr!==e)if(e={context:e,memoizedValue:t,next:null},nr===null){if(tr===null)throw Error(a(308));nr=e,tr.dependencies={lanes:0,firstContext:e}}else nr=nr.next=e;return t}var ur=null;function dr(e){ur===null?ur=[e]:ur.push(e)}function fr(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,dr(t)):(n.next=i.next,i.next=n),t.interleaved=n,pr(e,r)}function pr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var mr=!1;function hr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gr(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 _r(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function vr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,pr(e,n)}return i=r.interleaved,i===null?(t.next=t,dr(r)):(t.next=i.next,i.next=t),r.interleaved=t,pr(e,n)}function yr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Zt(e,n)}}function br(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function xr(e,t,n,r){var a=e.updateQueue;mr=!1;var o=a.firstBaseUpdate,s=a.lastBaseUpdate,c=a.shared.pending;if(c!==null){a.shared.pending=null;var l=c,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,c=d.lastBaseUpdate,c!==s&&(c===null?d.firstBaseUpdate=u:c.next=u,d.lastBaseUpdate=l))}if(o!==null){var f=a.baseState;s=0,d=u=l=null,c=o;do{var p=c.lane,m=c.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});a:{var h=e,g=c;switch(p=t,m=n,g.tag){case 1:if(h=g.payload,typeof h==`function`){f=h.call(m,f,p);break a}f=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(m,f,p):h,p==null)break a;f=i({},f,p);break a;case 2:mr=!0}}c.callback!==null&&c.lane!==0&&(e.flags|=64,p=a.effects,p===null?a.effects=[c]:p.push(c))}else m={eventTime:m,lane:p,tag:c.tag,payload:c.payload,callback:c.callback,next:null},d===null?(u=d=m,l=f):d=d.next=m,s|=p;if(c=c.next,c===null){if(c=a.shared.pending,c===null)break;p=c,c=p.next,p.next=null,a.lastBaseUpdate=p,a.shared.pending=null}}while(1);if(d===null&&(l=f),a.baseState=l,a.firstBaseUpdate=u,a.lastBaseUpdate=d,t=a.shared.interleaved,t!==null){a=t;do s|=a.lane,a=a.next;while(a!==t)}else o===null&&(a.shared.lanes=0);Eo|=s,e.lanes=s,e.memoizedState=f}}function Sr(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!=`function`)throw Error(a(191,i));i.call(r)}}}var Cr={},wr=Ct(Cr),Tr=Ct(Cr),Er=Ct(Cr);function Dr(e){if(e===Cr)throw Error(a(174));return e}function Or(e,t){Tt(Er,t),Tt(Tr,e),Tt(wr,Cr),e=N(t),wt(wr),Tt(wr,e)}function kr(){wt(wr),wt(Tr),wt(Er)}function Ar(e){var t=Dr(Er.current),n=Dr(wr.current);t=P(n,e.type,t),n!==t&&(Tt(Tr,e),Tt(wr,t))}function jr(e){Tr.current===e&&(wt(wr),wt(Tr))}var Mr=Ct(0);function Nr(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Ze(n)||Qe(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Pr=[];function Fr(){for(var e=0;e<Pr.length;e++){var t=Pr[e];le?t._workInProgressVersionPrimary=null:t._workInProgressVersionSecondary=null}Pr.length=0}var Ir=o.ReactCurrentDispatcher,Lr=o.ReactCurrentBatchConfig,Rr=0,zr=null,Br=null,Vr=null,Hr=!1,Ur=!1,Wr=0,Gr=0;function Kr(){throw Error(a(321))}function qr(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!pn(e[n],t[n]))return!1;return!0}function Jr(e,t,n,r,i,o){if(Rr=o,zr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ir.current=e===null||e.memoizedState===null?ji:Mi,e=n(r,i),Ur){o=0;do{if(Ur=!1,Wr=0,25<=o)throw Error(a(301));o+=1,Vr=Br=null,t.updateQueue=null,Ir.current=Ni,e=n(r,i)}while(Ur)}if(Ir.current=Ai,t=Br!==null&&Br.next!==null,Rr=0,Vr=Br=zr=null,Hr=!1,t)throw Error(a(300));return e}function Yr(){var e=Wr!==0;return Wr=0,e}function Xr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vr===null?zr.memoizedState=Vr=e:Vr=Vr.next=e,Vr}function Zr(){if(Br===null){var e=zr.alternate;e=e===null?null:e.memoizedState}else e=Br.next;var t=Vr===null?zr.memoizedState:Vr.next;if(t!==null)Vr=t,Br=e;else{if(e===null)throw Error(a(310));Br=e,e={memoizedState:Br.memoizedState,baseState:Br.baseState,baseQueue:Br.baseQueue,queue:Br.queue,next:null},Vr===null?zr.memoizedState=Vr=e:Vr=Vr.next=e}return Vr}function Qr(e,t){return typeof t==`function`?t(e):t}function $r(e){var t=Zr(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=Br,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((Rr&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=r):l=l.next=f,zr.lanes|=d,Eo|=d}u=u.next}while(u!==null&&u!==o);l===null?s=r:l.next=c,pn(r,t.memoizedState)||(Zi=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,zr.lanes|=o,Eo|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ei(e){var t=Zr(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);pn(o,t.memoizedState)||(Zi=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ti(){}function ni(e,t){var n=zr,r=Zr(),i=t(),o=!pn(r.memoizedState,i);if(o&&(r.memoizedState=i,Zi=!0),r=r.queue,mi(ai.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Vr!==null&&Vr.memoizedState.tag&1){if(n.flags|=2048,li(9,ii.bind(null,n,r,i,t),void 0,null),bo===null)throw Error(a(349));Rr&30||ri(n,t,i)}return i}function ri(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=zr.updateQueue,t===null?(t={lastEffect:null,stores:null},zr.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ii(e,t,n,r){t.value=n,t.getSnapshot=r,oi(t)&&si(e)}function ai(e,t,n){return n(function(){oi(t)&&si(e)})}function oi(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!pn(e,n)}catch{return!0}}function si(e){var t=pr(e,1);t!==null&&qo(t,e,1,-1)}function ci(e){var t=Xr();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Qr,lastRenderedState:e},t.queue=e,e=e.dispatch=Ei.bind(null,zr,e),[t.memoizedState,e]}function li(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=zr.updateQueue,t===null?(t={lastEffect:null,stores:null},zr.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function ui(){return Zr().memoizedState}function di(e,t,n,r){var i=Xr();zr.flags|=e,i.memoizedState=li(1|t,n,void 0,r===void 0?null:r)}function fi(e,t,n,r){var i=Zr();r=r===void 0?null:r;var a=void 0;if(Br!==null){var o=Br.memoizedState;if(a=o.destroy,r!==null&&qr(r,o.deps)){i.memoizedState=li(t,n,a,r);return}}zr.flags|=e,i.memoizedState=li(1|t,n,a,r)}function pi(e,t){return di(8390656,8,e,t)}function mi(e,t){return fi(2048,8,e,t)}function hi(e,t){return fi(4,2,e,t)}function gi(e,t){return fi(4,4,e,t)}function _i(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function vi(e,t,n){return n=n==null?null:n.concat([e]),fi(4,4,_i.bind(null,t,e),n)}function yi(){}function bi(e,t){var n=Zr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&qr(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function xi(e,t){var n=Zr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&qr(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Si(e,t,n){return Rr&21?(pn(n,t)||(n=qt(),zr.lanes|=n,Eo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Zi=!0),e.memoizedState=n)}function Ci(e,t){var n=B;B=n!==0&&4>n?n:4,e(!0);var r=Lr.transition;Lr.transition={};try{e(!1),t()}finally{B=n,Lr.transition=r}}function wi(){return Zr().memoizedState}function Ti(e,t,n){var r=Ko(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Di(e))Oi(t,n);else if(n=fr(e,t,n,r),n!==null){var i=Go();qo(n,e,r,i),ki(n,t,r)}}function Ei(e,t,n){var r=Ko(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Di(e))Oi(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,pn(s,o)){var c=t.interleaved;c===null?(i.next=i,dr(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=fr(e,t,i,r),n!==null&&(i=Go(),qo(n,e,r,i),ki(n,t,r))}}function Di(e){var t=e.alternate;return e===zr||t!==null&&t===zr}function Oi(e,t){Ur=Hr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ki(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Zt(e,n)}}var Ai={readContext:lr,useCallback:Kr,useContext:Kr,useEffect:Kr,useImperativeHandle:Kr,useInsertionEffect:Kr,useLayoutEffect:Kr,useMemo:Kr,useReducer:Kr,useRef:Kr,useState:Kr,useDebugValue:Kr,useDeferredValue:Kr,useTransition:Kr,useMutableSource:Kr,useSyncExternalStore:Kr,useId:Kr,unstable_isNewReconciler:!1},ji={readContext:lr,useCallback:function(e,t){return Xr().memoizedState=[e,t===void 0?null:t],e},useContext:lr,useEffect:pi,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),di(4194308,4,_i.bind(null,t,e),n)},useLayoutEffect:function(e,t){return di(4194308,4,e,t)},useInsertionEffect:function(e,t){return di(4,2,e,t)},useMemo:function(e,t){var n=Xr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Xr();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Ti.bind(null,zr,e),[r.memoizedState,e]},useRef:function(e){var t=Xr();return e={current:e},t.memoizedState=e},useState:ci,useDebugValue:yi,useDeferredValue:function(e){return Xr().memoizedState=e},useTransition:function(){var e=ci(!1),t=e[0];return e=Ci.bind(null,e[1]),Xr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=zr,i=Xr();if(Pn){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),bo===null)throw Error(a(349));Rr&30||ri(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,pi(ai.bind(null,r,o,e),[e]),r.flags|=2048,li(9,ii.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Xr(),t=bo.identifierPrefix;if(Pn){var n=Dn,r=En;n=(r&~(1<<32-z(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Wr++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Gr++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},Mi={readContext:lr,useCallback:bi,useContext:lr,useEffect:mi,useImperativeHandle:vi,useInsertionEffect:hi,useLayoutEffect:gi,useMemo:xi,useReducer:$r,useRef:ui,useState:function(){return $r(Qr)},useDebugValue:yi,useDeferredValue:function(e){return Si(Zr(),Br.memoizedState,e)},useTransition:function(){return[$r(Qr)[0],Zr().memoizedState]},useMutableSource:ti,useSyncExternalStore:ni,useId:wi,unstable_isNewReconciler:!1},Ni={readContext:lr,useCallback:bi,useContext:lr,useEffect:mi,useImperativeHandle:vi,useInsertionEffect:hi,useLayoutEffect:gi,useMemo:xi,useReducer:ei,useRef:ui,useState:function(){return ei(Qr)},useDebugValue:yi,useDeferredValue:function(e){var t=Zr();return Br===null?t.memoizedState=e:Si(t,Br.memoizedState,e)},useTransition:function(){return[ei(Qr)[0],Zr().memoizedState]},useMutableSource:ti,useSyncExternalStore:ni,useId:wi,unstable_isNewReconciler:!1};function Pi(e,t){if(e&&e.defaultProps){for(var n in t=i({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Fi(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:i({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ii={isMounted:function(e){return(e=e._reactInternals)?E(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Go(),i=Ko(e),a=_r(r,i);a.payload=t,n!=null&&(a.callback=n),t=vr(e,a,i),t!==null&&(qo(t,e,i,r),yr(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Go(),i=Ko(e),a=_r(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=vr(e,a,i),t!==null&&(qo(t,e,i,r),yr(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Go(),r=Ko(e),i=_r(n,r);i.tag=2,t!=null&&(i.callback=t),t=vr(e,i,r),t!==null&&(qo(t,e,r,n),yr(t,e,r))}};function Li(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!qn(n,r)||!qn(i,a):!0}function Ri(e,t,n){var r=!1,i=Et,a=t.contextType;return typeof a==`object`&&a?a=lr(a):(i=jt(t)?kt:Dt.current,r=t.contextTypes,a=(r=r!=null)?At(e,i):Et),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ii,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function zi(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ii.enqueueReplaceState(t,t.state,null)}function Bi(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},hr(e);var a=t.contextType;typeof a==`object`&&a?i.context=lr(a):(a=jt(t)?kt:Dt.current,i.context=At(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(Fi(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&Ii.enqueueReplaceState(i,i.state,null),xr(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Vi(e,t){try{var n=``,r=t;do n+=Jn(r),r=r.return;while(r);var i=n}catch(e){i=`
16
- Error generating stack: `+e.message+`
17
- `+e.stack}return{value:e,source:t,stack:i,digest:null}}function Hi(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ui(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Wi=typeof WeakMap==`function`?WeakMap:Map;function Gi(e,t,n){n=_r(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Fo||(Fo=!0,Io=r),Ui(e,t)},n}function Ki(e,t,n){n=_r(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Ui(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Ui(e,t),typeof r!=`function`&&(Lo===null?Lo=new Set([this]):Lo.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function qi(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Wi;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=_s.bind(null,e,t,n),t.then(e,e))}function Ji(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null?!0:t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Yi(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=_r(-1,1),t.tag=2,vr(n,t,1))),n.lanes|=1),e)}var Xi=o.ReactCurrentOwner,Zi=!1;function Qi(e,t,n,r){t.child=e===null?$n(t,null,n,r):Qn(t,e.child,n,r)}function $i(e,t,n,r,i){n=n.render;var a=t.ref;return cr(t,i),r=Jr(e,t,n,r,a,i),n=Yr(),e!==null&&!Zi?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,va(e,t,i)):(Pn&&n&&An(t),t.flags|=1,Qi(e,t,r,i),t.child)}function ea(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ts(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,ta(e,t,a,r,i)):(e=Os(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?qn:n,n(o,r)&&e.ref===t.ref)return va(e,t,i)}return t.flags|=1,e=Ds(a,r),e.ref=t.ref,e.return=t,t.child=e}function ta(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(qn(a,r)&&e.ref===t.ref)if(Zi=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Zi=!0);else return t.lanes=e.lanes,va(e,t,i)}return ia(e,t,n,r,i)}function na(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Tt(wo,Co),Co|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Tt(wo,Co),Co|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Tt(wo,Co),Co|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Tt(wo,Co),Co|=r;return Qi(e,t,i,n),t.child}function ra(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ia(e,t,n,r,i){var a=jt(n)?kt:Dt.current;return a=At(t,a),cr(t,i),n=Jr(e,t,n,r,a,i),r=Yr(),e!==null&&!Zi?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,va(e,t,i)):(Pn&&r&&An(t),t.flags|=1,Qi(e,t,n,i),t.child)}function aa(e,t,n,r,i){if(jt(n)){var a=!0;Ft(t)}else a=!1;if(cr(t,i),t.stateNode===null)_a(e,t),Ri(t,n,r),Bi(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=lr(l):(l=jt(n)?kt:Dt.current,l=At(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&zi(t,o,r,l),mr=!1;var f=t.memoizedState;o.state=f,xr(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Ot.current||mr?(typeof u==`function`&&(Fi(t,n,u,r),c=t.memoizedState),(s=mr||Li(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,gr(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:Pi(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=lr(c):(c=jt(n)?kt:Dt.current,c=At(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&zi(t,o,r,c),mr=!1,f=t.memoizedState,o.state=f,xr(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Ot.current||mr?(typeof p==`function`&&(Fi(t,n,p,r),m=t.memoizedState),(l=mr||Li(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return oa(e,t,n,r,a,i)}function oa(e,t,n,r,i,a){ra(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&It(t,n,!1),va(e,t,a);r=t.stateNode,Xi.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Qn(t,e.child,null,a),t.child=Qn(t,null,s,a)):Qi(e,t,s,a),t.memoizedState=r.state,i&&It(t,n,!0),t.child}function sa(e){var t=e.stateNode;t.pendingContext?Nt(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Nt(e,t.context,!1),Or(e,t.containerInfo)}function ca(e,t,n,r,i){return Wn(),Gn(i),t.flags|=256,Qi(e,t,n,r),t.child}var la={dehydrated:null,treeContext:null,retryLane:0};function ua(e){return{baseLanes:e,cachePool:null,transitions:null}}function da(e,t,n){var r=t.pendingProps,i=Mr.current,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!=0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Tt(Mr,i&1),e===null)return Bn(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?Qe(e)?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=As(o,r,0,null),e=ks(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=ua(n),t.memoizedState=la,e):fa(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return ma(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Ds(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=ks(a,o,n,null),a.flags|=2):a=Ds(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?ua(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=la,r}return a=e.child,e=a.sibling,r=Ds(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function fa(e,t){return t=As({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function pa(e,t,n,r){return r!==null&&Gn(r),Qn(t,e.child,null,n),e=fa(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ma(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=Hi(Error(a(422))),pa(e,t,s,r)):t.memoizedState===null?(o=r.fallback,i=t.mode,r=As({mode:`visible`,children:r.children},i,0,null),o=ks(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&Qn(t,e.child,null,s),t.child.memoizedState=ua(s),t.memoizedState=la,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return pa(e,t,s,null);if(Qe(i))return r=$e(i).digest,o=Error(a(419)),r=Hi(o,r,void 0),pa(e,t,s,r);if(n=(s&e.childLanes)!==0,Zi||n){if(r=bo,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=(i&(r.suspendedLanes|s))===0?i:0,i!==0&&i!==o.retryLane&&(o.retryLane=i,pr(e,i),qo(r,e,i,-1))}return os(),r=Hi(Error(a(421))),pa(e,t,s,r)}return Ze(i)?(t.flags|=128,t.child=e.child,t=ys.bind(null,e),et(i,t),null):(e=o.treeContext,fe&&(Nn=it(i),Mn=t,Pn=!0,In=null,Fn=!1,e!==null&&(Cn[wn++]=En,Cn[wn++]=Dn,Cn[wn++]=Tn,En=e.id,Dn=e.overflow,Tn=t)),t=fa(t,r.children),t.flags|=4096,t)}function U(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),sr(e.return,t,n)}function ha(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function ga(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Qi(e,t,r.children,n),r=Mr.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&U(e,n,t);else if(e.tag===19)U(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Tt(Mr,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Nr(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ha(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Nr(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ha(t,!0,n,null,a);break;case`together`:ha(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function _a(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function va(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Eo|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=Ds(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ds(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ya(e,t,n){switch(t.tag){case 3:sa(t),Wn();break;case 5:Ar(t);break;case 1:jt(t.type)&&Ft(t);break;case 4:Or(t,t.stateNode.containerInfo);break;case 10:ar(t,t.type._context,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Tt(Mr,Mr.current&1),e=va(e,t,n),e===null?null:e.sibling):da(e,t,n):(Tt(Mr,Mr.current&1),t.flags|=128,null);Tt(Mr,Mr.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ga(e,t,n);t.flags|=128}var i=t.memoizedState;if(i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Tt(Mr,Mr.current),r)break;return null;case 22:case 23:return t.lanes=0,na(e,t,n)}return va(e,t,n)}function ba(e){e.flags|=4}function xa(e,t){if(e!==null&&e.child===t.child)return!0;if(t.flags&16)return!1;for(e=t.child;e!==null;){if(e.flags&12854||e.subtreeFlags&12854)return!1;e=e.sibling}return!0}var Sa,Ca,wa,Ta;if(ue)Sa=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)F(e,n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ca=function(){},wa=function(e,t,n,r,i){if(e=e.memoizedProps,e!==r){var a=t.stateNode,o=Dr(wr.current);n=L(a,n,e,r,i,o),(t.updateQueue=n)&&ba(t)}},Ta=function(e,t,n,r){n!==r&&ba(t)};else if(de){Sa=function(e,t,n,r){for(var i=t.child;i!==null;){if(i.tag===5){var a=i.stateNode;n&&r&&(a=Ke(a,i.type,i.memoizedProps,i)),F(e,a)}else if(i.tag===6)a=i.stateNode,n&&r&&(a=qe(a,i.memoizedProps,i)),F(e,a);else if(i.tag!==4){if(i.tag===22&&i.memoizedState!==null)a=i.child,a!==null&&(a.return=i),Sa(e,i,!0,!0);else if(i.child!==null){i.child.return=i,i=i.child;continue}}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};var Ea=function(e,t,n,r){for(var i=t.child;i!==null;){if(i.tag===5){var a=i.stateNode;n&&r&&(a=Ke(a,i.type,i.memoizedProps,i)),Ue(e,a)}else if(i.tag===6)a=i.stateNode,n&&r&&(a=qe(a,i.memoizedProps,i)),Ue(e,a);else if(i.tag!==4){if(i.tag===22&&i.memoizedState!==null)a=i.child,a!==null&&(a.return=i),Ea(e,i,!0,!0);else if(i.child!==null){i.child.return=i,i=i.child;continue}}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};Ca=function(e,t){var n=t.stateNode;if(!xa(e,t)){e=n.containerInfo;var r=He(e);Ea(r,t,!1,!1),n.pendingChildren=r,ba(t),We(e,r)}},wa=function(e,t,n,r,i){var a=e.stateNode,o=e.memoizedProps;if((e=xa(e,t))&&o===r)t.stateNode=a;else{var s=t.stateNode,c=Dr(wr.current),l=null;o!==r&&(l=L(s,n,o,r,i,c)),e&&l===null?t.stateNode=a:(a=Ve(a,l,n,o,r,t,e,s),I(a,n,r,i,c)&&ba(t),t.stateNode=a,e?ba(t):Sa(a,t,!1,!1))}},Ta=function(e,t,n,r){n===r?t.stateNode=e.stateNode:(e=Dr(Er.current),n=Dr(wr.current),t.stateNode=ae(r,e,n,t),ba(t))}}else Ca=function(){},wa=function(){},Ta=function(){};function Da(e,t){if(!Pn)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Oa(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ka(e,t,n){var r=t.pendingProps;switch(jn(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Oa(t),null;case 1:return jt(t.type)&&Mt(),Oa(t),null;case 3:return n=t.stateNode,kr(),wt(Ot),wt(Dt),Fr(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Hn(t)?ba(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,In!==null&&(Zo(In),In=null))),Ca(e,t),Oa(t),null;case 5:jr(t),n=Dr(Er.current);var i=t.type;if(e!==null&&t.stateNode!=null)wa(e,t,i,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Oa(t),null}if(e=Dr(wr.current),Hn(t)){if(!fe)throw Error(a(175));e=at(t.stateNode,t.type,t.memoizedProps,n,e,t,!Fn),t.updateQueue=e,e!==null&&ba(t)}else{var o=re(i,r,n,e,t);Sa(o,t,!1,!1),t.stateNode=o,I(o,i,r,n,e)&&ba(t)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Oa(t),null;case 6:if(e&&t.stateNode!=null)Ta(e,t,e.memoizedProps,r);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=Dr(Er.current),n=Dr(wr.current),Hn(t)){if(!fe)throw Error(a(176));if(e=t.stateNode,n=t.memoizedProps,(r=ot(e,n,t,!Fn))&&(i=Mn,i!==null))switch(i.tag){case 3:mt(i.stateNode.containerInfo,e,n,(i.mode&1)!=0);break;case 5:ht(i.type,i.memoizedProps,i.stateNode,e,n,(i.mode&1)!=0)}r&&ba(t)}else t.stateNode=ae(r,e,n,t)}return Oa(t),null;case 13:if(wt(Mr),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Pn&&Nn!==null&&t.mode&1&&!(t.flags&128))Un(),Wn(),t.flags|=98560,i=!1;else if(i=Hn(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(!fe)throw Error(a(344));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));st(i,t)}else Wn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Oa(t),i=!1}else In!==null&&(Zo(In),In=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(n=r!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Mr.current&1?q===0&&(q=3):os())),t.updateQueue!==null&&(t.flags|=4),Oa(t),null);case 4:return kr(),Ca(e,t),e===null&&me(t.stateNode.containerInfo),Oa(t),null;case 10:return or(t.type._context),Oa(t),null;case 17:return jt(t.type)&&Mt(),Oa(t),null;case 19:if(wt(Mr),i=t.memoizedState,i===null)return Oa(t),null;if(r=(t.flags&128)!=0,o=i.rendering,o===null)if(r)Da(i,!1);else{if(q!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Nr(e),o!==null){for(t.flags|=128,Da(i,!1),e=o.updateQueue,e!==null&&(t.updateQueue=e,t.flags|=4),t.subtreeFlags=0,e=n,n=t.child;n!==null;)r=n,i=e,r.flags&=14680066,o=r.alternate,o===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=o.childLanes,r.lanes=o.lanes,r.child=o.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=o.memoizedProps,r.memoizedState=o.memoizedState,r.updateQueue=o.updateQueue,r.type=o.type,i=o.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n=n.sibling;return Tt(Mr,Mr.current&1|2),t.child}e=e.sibling}i.tail!==null&&rn()>Mo&&(t.flags|=128,r=!0,Da(i,!1),t.lanes=4194304)}else{if(!r)if(e=Nr(o),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,e!==null&&(t.updateQueue=e,t.flags|=4),Da(i,!0),i.tail===null&&i.tailMode===`hidden`&&!o.alternate&&!Pn)return Oa(t),null}else 2*rn()-i.renderingStartTime>Mo&&n!==1073741824&&(t.flags|=128,r=!0,Da(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(e=i.last,e===null?t.child=o:e.sibling=o,i.last=o)}return i.tail===null?(Oa(t),null):(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=rn(),t.sibling=null,e=Mr.current,Tt(Mr,r?e&1|2:e&1),t);case 22:case 23:return ns(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Co&1073741824&&(Oa(t),ue&&t.subtreeFlags&6&&(t.flags|=8192)):Oa(t),null;case 24:return null;case 25:return null}throw Error(a(156,t.tag))}function Aa(e,t){switch(jn(t),t.tag){case 1:return jt(t.type)&&Mt(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return kr(),wt(Ot),wt(Dt),Fr(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return jr(t),null;case 13:if(wt(Mr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Wn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return wt(Mr),null;case 4:return kr(),null;case 10:return or(t.type._context),null;case 22:case 23:return ns(),null;case 24:return null;default:return null}}var ja=!1,Ma=!1,Na=typeof WeakSet==`function`?WeakSet:Set,W=null;function Pa(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){gs(e,t,n)}else n.current=null}function Fa(e,t,n){try{n()}catch(n){gs(e,t,n)}}var Ia=!1;function La(e,t){for(te(e.containerInfo),W=t;W!==null;)if(e=W,t=e.child,e.subtreeFlags&1028&&t!==null)t.return=e,W=t;else for(;W!==null;){e=W;try{var n=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(n!==null){var r=n.memoizedProps,i=n.memoizedState,o=e.stateNode;o.__reactInternalSnapshotBeforeUpdate=o.getSnapshotBeforeUpdate(e.elementType===e.type?r:Pi(e.type,r),i)}break;case 3:ue&&Be(e.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(t){gs(e,e.return,t)}if(t=e.sibling,t!==null){t.return=e.return,W=t;break}W=e.return}return n=Ia,Ia=!1,n}function Ra(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Fa(t,n,a)}i=i.next}while(i!==r)}}function za(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ba(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=ee(n);break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Va(e){var t=e.alternate;t!==null&&(e.alternate=null,Va(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ge(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ha(e){return e.tag===5||e.tag===3||e.tag===4}function Ua(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ha(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Wa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?Ne(n,e,t):Oe(n,e);else if(r!==4&&(e=e.child,e!==null))for(Wa(e,t,n),e=e.sibling;e!==null;)Wa(e,t,n),e=e.sibling}function Ga(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?Me(n,e,t):De(n,e);else if(r!==4&&(e=e.child,e!==null))for(Ga(e,t,n),e=e.sibling;e!==null;)Ga(e,t,n),e=e.sibling}var Ka=null,qa=!1;function Ja(e,t,n){for(n=n.child;n!==null;)Ya(e,t,n),n=n.sibling}function Ya(e,t,n){if(un&&typeof un.onCommitFiberUnmount==`function`)try{un.onCommitFiberUnmount(ln,n)}catch{}switch(n.tag){case 5:Ma||Pa(n,t);case 6:if(ue){var r=Ka,i=qa;Ka=null,Ja(e,t,n),Ka=r,qa=i,Ka!==null&&(qa?Pe(Ka,n.stateNode):R(Ka,n.stateNode))}else Ja(e,t,n);break;case 18:ue&&Ka!==null&&(qa?ft(Ka,n.stateNode):dt(Ka,n.stateNode));break;case 4:ue?(r=Ka,i=qa,Ka=n.stateNode.containerInfo,qa=!0,Ja(e,t,n),Ka=r,qa=i):(de&&(r=n.stateNode.containerInfo,i=He(r),Ge(r,i)),Ja(e,t,n));break;case 0:case 11:case 14:case 15:if(!Ma&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Fa(n,t,o),i=i.next}while(i!==r)}Ja(e,t,n);break;case 1:if(!Ma&&(Pa(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){gs(n,t,e)}Ja(e,t,n);break;case 21:Ja(e,t,n);break;case 22:n.mode&1?(Ma=(r=Ma)||n.memoizedState!==null,Ja(e,t,n),Ma=r):Ja(e,t,n);break;default:Ja(e,t,n)}}function Xa(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Na),t.forEach(function(t){var r=bs.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Za(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,s=t;if(ue){var c=s;a:for(;c!==null;){switch(c.tag){case 5:Ka=c.stateNode,qa=!1;break a;case 3:Ka=c.stateNode.containerInfo,qa=!0;break a;case 4:Ka=c.stateNode.containerInfo,qa=!0;break a}c=c.return}if(Ka===null)throw Error(a(160));Ya(o,s,i),Ka=null,qa=!1}else Ya(o,s,i);var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(e){gs(i,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Qa(t,e),t=t.sibling}function Qa(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Za(t,e),$a(e),r&4){try{Ra(3,e,e.return),za(3,e)}catch(t){gs(e,e.return,t)}try{Ra(5,e,e.return)}catch(t){gs(e,e.return,t)}}break;case 1:Za(t,e),$a(e),r&512&&n!==null&&Pa(n,n.return);break;case 5:if(Za(t,e),$a(e),r&512&&n!==null&&Pa(n,n.return),ue){if(e.flags&32){var i=e.stateNode;try{Fe(i)}catch(t){gs(e,e.return,t)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps;if(n=n===null?o:n.memoizedProps,r=e.type,t=e.updateQueue,e.updateQueue=null,t!==null)try{je(i,t,r,n,o,e)}catch(t){gs(e,e.return,t)}}}break;case 6:if(Za(t,e),$a(e),r&4&&ue){if(e.stateNode===null)throw Error(a(162));i=e.stateNode,o=e.memoizedProps,n=n===null?o:n.memoizedProps;try{ke(i,n,o)}catch(t){gs(e,e.return,t)}}break;case 3:if(Za(t,e),$a(e),r&4){if(ue&&fe&&n!==null&&n.memoizedState.isDehydrated)try{lt(t.containerInfo)}catch(t){gs(e,e.return,t)}if(de){i=t.containerInfo,o=t.pendingChildren;try{Ge(i,o)}catch(t){gs(e,e.return,t)}}}break;case 4:if(Za(t,e),$a(e),r&4&&de){o=e.stateNode,i=o.containerInfo,o=o.pendingChildren;try{Ge(i,o)}catch(t){gs(e,e.return,t)}}break;case 13:Za(t,e),$a(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(jo=rn())),r&4&&Xa(e);break;case 22:var s=n!==null&&n.memoizedState!==null;if(e.mode&1?(Ma=(n=Ma)||s,Za(t,e),Ma=n):Za(t,e),$a(e),r&8192){if(n=e.memoizedState!==null,(e.stateNode.isHidden=n)&&!s&&e.mode&1)for(W=e,r=e.child;r!==null;){for(t=W=r;W!==null;){s=W;var c=s.child;switch(s.tag){case 0:case 11:case 14:case 15:Ra(4,s,s.return);break;case 1:Pa(s,s.return);var l=s.stateNode;if(typeof l.componentWillUnmount==`function`){var u=s,d=s.return;try{var f=u;l.props=f.memoizedProps,l.state=f.memoizedState,l.componentWillUnmount()}catch(e){gs(u,d,e)}}break;case 5:Pa(s,s.return);break;case 22:if(s.memoizedState!==null){ro(t);continue}}c===null?ro(t):(c.return=s,W=c)}r=r.sibling}if(ue){a:if(r=null,ue)for(t=e;;){if(t.tag===5){if(r===null){r=t;try{i=t.stateNode,n?Ie(i):Re(t.stateNode,t.memoizedProps)}catch(t){gs(e,e.return,t)}}}else if(t.tag===6){if(r===null)try{o=t.stateNode,n?Le(o):ze(o,t.memoizedProps)}catch(t){gs(e,e.return,t)}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}}}break;case 19:Za(t,e),$a(e),r&4&&Xa(e);break;case 21:break;default:Za(t,e),$a(e)}}function $a(e){var t=e.flags;if(t&2){try{if(ue){b:{for(var n=e.return;n!==null;){if(Ha(n)){var r=n;break b}n=n.return}throw Error(a(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Fe(i),r.flags&=-33),Ga(e,Ua(e),i);break;case 3:case 4:var o=r.stateNode.containerInfo;Wa(e,Ua(e),o);break;default:throw Error(a(161))}}}catch(t){gs(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function eo(e,t,n){W=e,to(e,t,n)}function to(e,t,n){for(var r=(e.mode&1)!=0;W!==null;){var i=W,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||ja;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||Ma;s=ja;var l=Ma;if(ja=o,(Ma=c)&&!l)for(W=i;W!==null;)o=W,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?io(i):(c.return=o,W=c);for(;a!==null;)W=a,to(a,t,n),a=a.sibling;W=i,ja=s,Ma=l}no(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,W=a):no(e,t,n)}}function no(e){for(;W!==null;){var t=W;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ma||za(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ma)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Pi(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&Sr(t,o,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=ee(t.child.stateNode);break;case 1:n=t.child.stateNode}Sr(t,s,n)}break;case 5:var c=t.stateNode;n===null&&t.flags&4&&Ae(c,t.type,t.memoizedProps,t);break;case 6:break;case 4:break;case 12:break;case 13:if(fe&&t.memoizedState===null){var l=t.alternate;if(l!==null){var u=l.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&ut(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(a(163))}Ma||t.flags&512&&Ba(t)}catch(e){gs(t,t.return,e)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function ro(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var n=t.sibling;if(n!==null){n.return=t.return,W=n;break}W=t.return}}function io(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{za(4,t)}catch(e){gs(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){gs(t,i,e)}}var a=t.return;try{Ba(t)}catch(e){gs(t,a,e)}break;case 5:var o=t.return;try{Ba(t)}catch(e){gs(t,o,e)}}}catch(e){gs(t,t.return,e)}if(t===e){W=null;break}var s=t.sibling;if(s!==null){s.return=t.return,W=s;break}W=t.return}}var ao=0,oo=1,so=2,co=3,lo=4;if(typeof Symbol==`function`&&Symbol.for){var uo=Symbol.for;ao=uo(`selector.component`),oo=uo(`selector.has_pseudo_class`),so=uo(`selector.role`),co=uo(`selector.test_id`),lo=uo(`selector.text`)}function fo(e){var t=pe(e);if(t!=null){if(typeof t.memoizedProps[`data-testname`]!=`string`)throw Error(a(364));return t}if(e=be(e),e===null)throw Error(a(362));return e.stateNode.current}function po(e,t){switch(t.$$typeof){case ao:if(e.type===t.value)return!0;break;case oo:a:{t=t.value,e=[e,0];for(var n=0;n<e.length;){var r=e[n++],i=e[n++],o=t[i];if(r.tag!==5||!Ce(r)){for(;o!=null&&po(r,o);)i++,o=t[i];if(i===t.length){t=!0;break a}else for(r=r.child;r!==null;)e.push(r,i),r=r.sibling}}t=!1}return t;case so:if(e.tag===5&&we(e.stateNode,t.value))return!0;break;case lo:if((e.tag===5||e.tag===6)&&(e=Se(e),e!==null&&0<=e.indexOf(t.value)))return!0;break;case co:if(e.tag===5&&(e=e.memoizedProps[`data-testname`],typeof e==`string`&&e.toLowerCase()===t.value.toLowerCase()))return!0;break;default:throw Error(a(365))}return!1}function mo(e){switch(e.$$typeof){case ao:return`<`+(w(e.value)||`Unknown`)+`>`;case oo:return`:has(`+(mo(e)||``)+`)`;case so:return`[role="`+e.value+`"]`;case lo:return`"`+e.value+`"`;case co:return`[data-testname="`+e.value+`"]`;default:throw Error(a(365))}}function ho(e,t){var n=[];e=[e,0];for(var r=0;r<e.length;){var i=e[r++],a=e[r++],o=t[a];if(i.tag!==5||!Ce(i)){for(;o!=null&&po(i,o);)a++,o=t[a];if(a===t.length)n.push(i);else for(i=i.child;i!==null;)e.push(i,a),i=i.sibling}}return n}function go(e,t){if(!ye)throw Error(a(363));e=fo(e),e=ho(e,t),t=[],e=Array.from(e);for(var n=0;n<e.length;){var r=e[n++];if(r.tag===5)Ce(r)||t.push(r.stateNode);else for(r=r.child;r!==null;)e.push(r),r=r.sibling}return t}var _o=Math.ceil,vo=o.ReactCurrentDispatcher,yo=o.ReactCurrentOwner,G=o.ReactCurrentBatchConfig,K=0,bo=null,xo=null,So=0,Co=0,wo=Ct(0),q=0,To=null,Eo=0,Do=0,Oo=0,ko=null,Ao=null,jo=0,Mo=1/0,No=null;function Po(){Mo=rn()+500}var Fo=!1,Io=null,Lo=null,Ro=!1,zo=null,Bo=0,Vo=0,Ho=null,Uo=-1,Wo=0;function Go(){return K&6?rn():Uo===-1?Uo=rn():Uo}function Ko(e){return e.mode&1?K&2&&So!==0?So&-So:Kn.transition===null?(e=B,e===0?he():e):(Wo===0&&(Wo=qt()),Wo):1}function qo(e,t,n,r){if(50<Vo)throw Vo=0,Ho=null,Error(a(185));Yt(e,n,r),(!(K&2)||e!==bo)&&(e===bo&&(!(K&2)&&(Do|=n),q===4&&$o(e,So)),Jo(e,r),n===1&&K===0&&!(t.mode&1)&&(Po(),hn&&yn()))}function Jo(e,t){var n=e.callbackNode;Gt(e,t);var r=Ut(e,e===bo?So:0);if(r===0)n!==null&&en(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&en(n),t===1)e.tag===0?vn(es.bind(null,e)):_n(es.bind(null,e)),_e?ve(function(){!(K&6)&&yn()}):$t(an,yn),n=null;else{switch(Qt(r)){case 1:n=an;break;case 4:n=on;break;case 16:n=sn;break;case 536870912:n=cn;break;default:n=sn}n=Ss(n,Yo.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Yo(e,t){if(Uo=-1,Wo=0,K&6)throw Error(a(327));var n=e.callbackNode;if(ms()&&e.callbackNode!==n)return null;var r=Ut(e,e===bo?So:0);if(r===0)return null;if(r&30||(r&e.expiredLanes)!==0||t)t=ss(e,r);else{t=r;var i=K;K|=2;var o=as();(bo!==e||So!==t)&&(No=null,Po(),rs(e,t));do try{ls();break}catch(t){is(e,t)}while(1);ir(),vo.current=o,K=i,xo===null?(bo=null,So=0,t=q):t=0}if(t!==0){if(t===2&&(i=Kt(e),i!==0&&(r=i,t=Xo(e,i))),t===1)throw n=To,rs(e,0),$o(e,r),Jo(e,rn()),n;if(t===6)$o(e,r);else{if(i=e.current.alternate,!(r&30)&&!Qo(i)&&(t=ss(e,r),t===2&&(o=Kt(e),o!==0&&(r=o,t=Xo(e,o))),t===1))throw n=To,rs(e,0),$o(e,r),Jo(e,rn()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(a(345));case 2:fs(e,Ao,No);break;case 3:if($o(e,r),(r&130023424)===r&&(t=jo+500-rn(),10<t)){if(Ut(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Go(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=oe(fs.bind(null,e,Ao,No),t);break}fs(e,Ao,No);break;case 4:if($o(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-z(r);o=1<<s,s=t[s],s>i&&(i=s),r&=~o}if(r=i,r=rn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*_o(r/1960))-r,10<r){e.timeoutHandle=oe(fs.bind(null,e,Ao,No),r);break}fs(e,Ao,No);break;case 5:fs(e,Ao,No);break;default:throw Error(a(329))}}}return Jo(e,rn()),e.callbackNode===n?Yo.bind(null,e):null}function Xo(e,t){var n=ko;return e.current.memoizedState.isDehydrated&&(rs(e,t).flags|=256),e=ss(e,t),e!==2&&(t=Ao,Ao=n,t!==null&&Zo(t)),e}function Zo(e){Ao===null?Ao=e:Ao.push.apply(Ao,e)}function Qo(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!pn(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function $o(e,t){for(t&=~Oo,t&=~Do,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-z(t),r=1<<n;e[n]=-1,t&=~r}}function es(e){if(K&6)throw Error(a(327));ms();var t=Ut(e,0);if(!(t&1))return Jo(e,rn()),null;var n=ss(e,t);if(e.tag!==0&&n===2){var r=Kt(e);r!==0&&(t=r,n=Xo(e,r))}if(n===1)throw n=To,rs(e,0),$o(e,t),Jo(e,rn()),n;if(n===6)throw Error(a(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,fs(e,Ao,No),Jo(e,rn()),null}function ts(e){zo!==null&&zo.tag===0&&!(K&6)&&ms();var t=K;K|=1;var n=G.transition,r=B;try{if(G.transition=null,B=1,e)return e()}finally{B=r,G.transition=n,K=t,!(K&6)&&yn()}}function ns(){Co=wo.current,wt(wo)}function rs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==ce&&(e.timeoutHandle=ce,se(n)),xo!==null)for(n=xo.return;n!==null;){var r=n;switch(jn(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Mt();break;case 3:kr(),wt(Ot),wt(Dt),Fr();break;case 5:jr(r);break;case 4:kr();break;case 13:wt(Mr);break;case 19:wt(Mr);break;case 10:or(r.type._context);break;case 22:case 23:ns()}n=n.return}if(bo=e,xo=e=Ds(e.current,null),So=Co=t,q=0,To=null,Oo=Do=Eo=0,Ao=ko=null,ur!==null){for(t=0;t<ur.length;t++)if(n=ur[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}ur=null}return e}function is(e,t){do{var n=xo;try{if(ir(),Ir.current=Ai,Hr){for(var r=zr.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Hr=!1}if(Rr=0,Vr=Br=zr=null,Ur=!1,Wr=0,yo.current=null,n===null||n.return===null){q=1,To=t,xo=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=So,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Ji(s);if(m!==null){m.flags&=-257,Yi(m,s,c,o,t),m.mode&1&&qi(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}else{if(!(t&1)){qi(o,u,t),os();break a}l=Error(a(426))}}else if(Pn&&c.mode&1){var _=Ji(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Yi(_,s,c,o,t),Gn(Vi(l,c));break a}}o=l=Vi(l,c),q!==4&&(q=2),ko===null?ko=[o]:ko.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Gi(o,l,t);br(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(Lo===null||!Lo.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Ki(o,c,t);br(o,x);break a}}o=o.return}while(o!==null)}ds(n)}catch(e){t=e,xo===n&&n!==null&&(xo=n=n.return);continue}break}while(1)}function as(){var e=vo.current;return vo.current=Ai,e===null?Ai:e}function os(){(q===0||q===3||q===2)&&(q=4),bo===null||!(Eo&268435455)&&!(Do&268435455)||$o(bo,So)}function ss(e,t){var n=K;K|=2;var r=as();(bo!==e||So!==t)&&(No=null,rs(e,t));do try{cs();break}catch(t){is(e,t)}while(1);if(ir(),K=n,vo.current=r,xo!==null)throw Error(a(261));return bo=null,So=0,q}function cs(){for(;xo!==null;)us(xo)}function ls(){for(;xo!==null&&!tn();)us(xo)}function us(e){var t=xs(e.alternate,e,Co);e.memoizedProps=e.pendingProps,t===null?ds(e):xo=t,yo.current=null}function ds(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Aa(n,t),n!==null){n.flags&=32767,xo=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{q=6,xo=null;return}}else if(n=ka(n,t,Co),n!==null){xo=n;return}if(t=t.sibling,t!==null){xo=t;return}xo=t=e}while(t!==null);q===0&&(q=5)}function fs(e,t,n){var r=B,i=G.transition;try{G.transition=null,B=1,ps(e,t,n,r)}finally{G.transition=i,B=r}return null}function ps(e,t,n,r){do ms();while(zo!==null);if(K&6)throw Error(a(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(a(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Xt(e,o),e===bo&&(xo=bo=null,So=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ro||(Ro=!0,Ss(sn,function(){return ms(),null})),o=(n.flags&15990)!=0,n.subtreeFlags&15990||o){o=G.transition,G.transition=null;var s=B;B=1;var c=K;K|=4,yo.current=null,La(e,n),Qa(n,e),ne(e.containerInfo),e.current=n,eo(n,e,i),nn(),K=c,B=s,G.transition=o}else e.current=n;if(Ro&&(Ro=!1,zo=e,Bo=i),o=e.pendingLanes,o===0&&(Lo=null),dn(n.stateNode,r),Jo(e,rn()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Fo)throw Fo=!1,e=Io,Io=null,e;return Bo&1&&e.tag!==0&&ms(),o=e.pendingLanes,o&1?e===Ho?Vo++:(Vo=0,Ho=e):Vo=0,yn(),null}function ms(){if(zo!==null){var e=Qt(Bo),t=G.transition,n=B;try{if(G.transition=null,B=16>e?16:e,zo===null)var r=!1;else{if(e=zo,zo=null,Bo=0,K&6)throw Error(a(331));var i=K;for(K|=4,W=e.current;W!==null;){var o=W,s=o.child;if(W.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(W=u;W!==null;){var d=W;switch(d.tag){case 0:case 11:case 15:Ra(8,d,o)}var f=d.child;if(f!==null)f.return=d,W=f;else for(;W!==null;){d=W;var p=d.sibling,m=d.return;if(Va(d),d===u){W=null;break}if(p!==null){p.return=m,W=p;break}W=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}W=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,W=s;else b:for(;W!==null;){if(o=W,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Ra(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,W=v;break b}W=o.return}}var y=e.current;for(W=y;W!==null;){s=W;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,W=b;else b:for(s=y;W!==null;){if(c=W,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:za(9,c)}}catch(e){gs(c,c.return,e)}if(c===s){W=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,W=x;break b}W=c.return}}if(K=i,yn(),un&&typeof un.onPostCommitFiberRoot==`function`)try{un.onPostCommitFiberRoot(ln,e)}catch{}r=!0}return r}finally{B=n,G.transition=t}}return!1}function hs(e,t,n){t=Vi(n,t),t=Gi(e,t,1),e=vr(e,t,1),t=Go(),e!==null&&(Yt(e,1,t),Jo(e,t))}function gs(e,t,n){if(e.tag===3)hs(e,e,n);else for(;t!==null;){if(t.tag===3){hs(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Lo===null||!Lo.has(r))){e=Vi(n,e),e=Ki(t,e,1),t=vr(t,e,1),e=Go(),t!==null&&(Yt(t,1,e),Jo(t,e));break}}t=t.return}}function _s(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Go(),e.pingedLanes|=e.suspendedLanes&n,bo===e&&(So&n)===n&&(q===4||q===3&&(So&130023424)===So&&500>rn()-jo?rs(e,0):Oo|=n),Jo(e,t)}function vs(e,t){t===0&&(e.mode&1?(t=Vt,Vt<<=1,!(Vt&130023424)&&(Vt=4194304)):t=1);var n=Go();e=pr(e,t),e!==null&&(Yt(e,t,n),Jo(e,n))}function ys(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),vs(e,n)}function bs(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(a(314))}r!==null&&r.delete(t),vs(e,n)}var xs=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ot.current)Zi=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Zi=!1,ya(e,t,n);Zi=!!(e.flags&131072)}else Zi=!1,Pn&&t.flags&1048576&&kn(t,Sn,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;_a(e,t),e=t.pendingProps;var i=At(t,Dt.current);cr(t,n),i=Jr(null,t,r,e,i,n);var o=Yr();return t.flags|=1,typeof i==`object`&&i&&typeof i.render==`function`&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,jt(r)?(o=!0,Ft(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,hr(t),i.updater=Ii,t.stateNode=i,i._reactInternals=t,Bi(t,r,e,n),t=oa(null,t,r,!0,o,n)):(t.tag=0,Pn&&o&&An(t),Qi(null,t,i,n),t=t.child),t;case 16:r=t.elementType;a:{switch(_a(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Es(r),e=Pi(r,e),i){case 0:t=ia(null,t,r,e,n);break a;case 1:t=aa(null,t,r,e,n);break a;case 11:t=$i(null,t,r,e,n);break a;case 14:t=ea(null,t,r,Pi(r.type,e),n);break a}throw Error(a(306,r,``))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pi(r,i),ia(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pi(r,i),aa(e,t,r,i,n);case 3:a:{if(sa(t),e===null)throw Error(a(387));r=t.pendingProps,o=t.memoizedState,i=o.element,gr(e,t),xr(t,r,null,n);var s=t.memoizedState;if(r=s.element,fe&&o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Vi(Error(a(423)),t),t=ca(e,t,r,n,i);break a}else if(r!==i){i=Vi(Error(a(424)),t),t=ca(e,t,r,n,i);break a}else for(fe&&(Nn=rt(t.stateNode.containerInfo),Mn=t,Pn=!0,In=null,Fn=!1),n=$n(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Wn(),r===i){t=va(e,t,n);break a}Qi(e,t,r,n)}t=t.child}return t;case 5:return Ar(t),e===null&&Bn(t),r=t.type,i=t.pendingProps,o=e===null?null:e.memoizedProps,s=i.children,ie(r,i)?s=null:o!==null&&ie(r,o)&&(t.flags|=32),ra(e,t),Qi(e,t,s,n),t.child;case 6:return e===null&&Bn(t),null;case 13:return da(e,t,n);case 4:return Or(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Qn(t,null,r,n):Qi(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pi(r,i),$i(e,t,r,i,n);case 7:return Qi(e,t,t.pendingProps,n),t.child;case 8:return Qi(e,t,t.pendingProps.children,n),t.child;case 12:return Qi(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,ar(t,r,s),o!==null)if(pn(o.value,s)){if(o.children===i.children&&!Ot.current){t=va(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=_r(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),sr(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(a(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),sr(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Qi(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,cr(t,n),i=lr(i),r=r(i),t.flags|=1,Qi(e,t,r,n),t.child;case 14:return r=t.type,i=Pi(r,t.pendingProps),i=Pi(r.type,i),ea(e,t,r,i,n);case 15:return ta(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pi(r,i),_a(e,t),t.tag=1,jt(r)?(e=!0,Ft(t)):e=!1,cr(t,n),Ri(t,r,i),Bi(t,r,i,n),oa(null,t,r,!0,e,n);case 19:return ga(e,t,n);case 22:return na(e,t,n)}throw Error(a(156,t.tag))};function Ss(e,t){return $t(e,t)}function Cs(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.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ws(e,t,n,r){return new Cs(e,t,n,r)}function Ts(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Es(e){if(typeof e==`function`)return+!!Ts(e);if(e!=null){if(e=e.$$typeof,e===m)return 11;if(e===y)return 14}return 2}function Ds(e,t){var n=e.alternate;return n===null?(n=ws(e.tag,t,e.key,e.mode),n.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.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,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=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Os(e,t,n,r,i,o){var s=2;if(r=e,typeof e==`function`)Ts(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case l:return ks(n.children,i,o,t);case u:s=8,i|=8;break;case d:return e=ws(12,n,t,i|2),e.elementType=d,e.lanes=o,e;case h:return e=ws(13,n,t,i),e.elementType=h,e.lanes=o,e;case _:return e=ws(19,n,t,i),e.elementType=_,e.lanes=o,e;case x:return As(n,i,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case f:s=10;break a;case p:s=9;break a;case m:s=11;break a;case y:s=14;break a;case b:s=16,r=null;break a}throw Error(a(130,e==null?e:typeof e,``))}return t=ws(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function ks(e,t,n,r){return e=ws(7,e,r,t),e.lanes=n,e}function As(e,t,n,r){return e=ws(22,e,r,t),e.elementType=x,e.lanes=n,e.stateNode={isHidden:!1},e}function js(e,t,n){return e=ws(6,e,null,t),e.lanes=n,e}function Ms(e,t,n){return t=ws(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ns(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ce,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Jt(0),this.expirationTimes=Jt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jt(0),this.identifierPrefix=r,this.onRecoverableError=i,fe&&(this.mutableSourceEagerHydrationData=null)}function Ps(e,t,n,r,i,a,o,s,c){return e=new Ns(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=ws(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},hr(a),e}function Fs(e){if(!e)return Et;e=e._reactInternals;a:{if(E(e)!==e||e.tag!==1)throw Error(a(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(jt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(a(171))}if(e.tag===1){var n=e.type;if(jt(n))return Pt(e,n,t)}return t}function Is(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=k(t),e===null?null:e.stateNode}function Ls(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Rs(e,t){Ls(e,t),(e=e.alternate)&&Ls(e,t)}function zs(e){return e=k(e),e===null?null:e.stateNode}function Bs(){return null}return t.attemptContinuousHydration=function(e){if(e.tag===13){var t=pr(e,134217728);t!==null&&qo(t,e,134217728,Go()),Rs(e,134217728)}},t.attemptDiscreteHydration=function(e){if(e.tag===13){var t=pr(e,1);t!==null&&qo(t,e,1,Go()),Rs(e,1)}},t.attemptHydrationAtCurrentPriority=function(e){if(e.tag===13){var t=Ko(e),n=pr(e,t);n!==null&&qo(n,e,t,Go()),Rs(e,t)}},t.attemptSynchronousHydration=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ht(t.pendingLanes);n!==0&&(Zt(t,n|1),Jo(t,rn()),!(K&6)&&(Po(),yn()))}break;case 13:ts(function(){var t=pr(e,1);t!==null&&qo(t,e,1,Go())}),Rs(e,1)}},t.batchedUpdates=function(e,t){var n=K;K|=1;try{return e(t)}finally{K=n,K===0&&(Po(),hn&&yn())}},t.createComponentSelector=function(e){return{$$typeof:ao,value:e}},t.createContainer=function(e,t,n,r,i,a,o){return Ps(e,t,!1,null,n,r,i,a,o)},t.createHasPseudoClassSelector=function(e){return{$$typeof:oo,value:e}},t.createHydrationContainer=function(e,t,n,r,i,a,o,s,c){return e=Ps(n,r,!0,e,i,a,o,s,c),e.context=Fs(null),n=e.current,r=Go(),i=Ko(n),a=_r(r,i),a.callback=t??null,vr(n,a,i),e.current.lanes=i,Yt(e,i,r),Jo(e,r),e},t.createPortal=function(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}},t.createRoleSelector=function(e){return{$$typeof:so,value:e}},t.createTestNameSelector=function(e){return{$$typeof:co,value:e}},t.createTextSelector=function(e){return{$$typeof:lo,value:e}},t.deferredUpdates=function(e){var t=B,n=G.transition;try{return G.transition=null,B=16,e()}finally{B=t,G.transition=n}},t.discreteUpdates=function(e,t,n,r,i){var a=B,o=G.transition;try{return G.transition=null,B=1,e(t,n,r,i)}finally{B=a,G.transition=o,K===0&&Po()}},t.findAllNodes=go,t.findBoundingRects=function(e,t){if(!ye)throw Error(a(363));t=go(e,t),e=[];for(var n=0;n<t.length;n++)e.push(xe(t[n]));for(t=e.length-1;0<t;t--){n=e[t];for(var r=n.x,i=r+n.width,o=n.y,s=o+n.height,c=t-1;0<=c;c--)if(t!==c){var l=e[c],u=l.x,d=u+l.width,f=l.y,p=f+l.height;if(r>=u&&o>=f&&i<=d&&s<=p){e.splice(t,1);break}else if(!(r!==u||n.width!==l.width||p<o||f>s)){f>o&&(l.height+=f-o,l.y=o),p<s&&(l.height=s-f),e.splice(t,1);break}else if(!(o!==f||n.height!==l.height||d<r||u>i)){u>r&&(l.width+=u-r,l.x=r),d<i&&(l.width=i-u),e.splice(t,1);break}}}return e},t.findHostInstance=Is,t.findHostInstanceWithNoPortals=function(e){return e=O(e),e=e===null?null:j(e),e===null?null:e.stateNode},t.findHostInstanceWithWarning=function(e){return Is(e)},t.flushControlled=function(e){var t=K;K|=1;var n=G.transition,r=B;try{G.transition=null,B=1,e()}finally{B=r,G.transition=n,K=t,K===0&&(Po(),yn())}},t.flushPassiveEffects=ms,t.flushSync=ts,t.focusWithin=function(e,t){if(!ye)throw Error(a(363));for(e=fo(e),t=ho(e,t),t=Array.from(t),e=0;e<t.length;){var n=t[e++];if(!Ce(n)){if(n.tag===5&&Te(n.stateNode))return!0;for(n=n.child;n!==null;)t.push(n),n=n.sibling}}return!1},t.getCurrentUpdatePriority=function(){return B},t.getFindAllNodesFailureDescription=function(e,t){if(!ye)throw Error(a(363));var n=0,r=[];e=[fo(e),0];for(var i=0;i<e.length;){var o=e[i++],s=e[i++],c=t[s];if((o.tag!==5||!Ce(o))&&(po(o,c)&&(r.push(mo(c)),s++,s>n&&(n=s)),s<t.length))for(o=o.child;o!==null;)e.push(o,s),o=o.sibling}if(n<t.length){for(e=[];n<t.length;n++)e.push(mo(t[n]));return`findAllNodes was able to match part of the selector:
18
- `+(r.join(` > `)+`
19
-
20
- No matching component was found for:
21
- `)+e.join(` > `)}return null},t.getPublicRootInstance=function(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return ee(e.child.stateNode);default:return e.child.stateNode}},t.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:o.ReactCurrentDispatcher,findHostInstanceByFiber:zs,findFiberByHostInstance:e.findFiberByHostInstance||Bs,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.3.1`},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{ln=t.inject(e),un=t}catch{}e=!!t.checkDCE}}return e},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(e,t,n,r){if(!ye)throw Error(a(363));e=go(e,t);var i=Ee(e,n,r).disconnect;return{disconnect:function(){i()}}},t.registerMutableSourceForHydration=function(e,t){var n=t._getVersion;n=n(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},t.runWithPriority=function(e,t){var n=B;try{return B=e,t()}finally{B=n}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(e,t,n,r){var i=t.current,a=Go(),o=Ko(i);return n=Fs(n),t.context===null?t.context=n:t.pendingContext=n,t=_r(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=vr(i,t,o),e!==null&&(qo(e,i,o,a),yr(e,i,o)),o},t}})),xa=n(((e,t)=>{t.exports=ba()})),Sa=n((e=>{e.DefaultEventPriority=16,e.LegacyRoot=0})),Ca=n(((e,t)=>{t.exports=Sa()})),wa=t(xa()),Ta=Ca(),Ea={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0},Da=!1,Oa=!1,ka=`.react-konva-event`,Aa=!1,ja=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
22
- Position of a node will be changed during drag&drop, so you should update state of the react app as well.
23
- Consider to add onDragMove or onDragEnd events.
24
- For more info see: https://github.com/konvajs/react-konva/issues/256
25
- `,Ma=`ReactKonva: You are using "zIndex" attribute for a Konva node.
26
- react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
27
- For more info see: https://github.com/konvajs/react-konva/issues/194
28
- `,Na={};function W(e,t,n=Na){if(!Da&&`zIndex`in t&&(console.warn(Ma),Da=!0),!Oa&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(ja),Oa=!0)}for(var a in n)if(!Ea[a]){var o=a.slice(0,2)===`on`,s=n[a]!==t[a];if(o&&s){var c=a.substr(2).toLowerCase();c.substr(0,7)===`content`&&(c=`content`+c.substr(7,1).toUpperCase()+c.substr(8)),e.off(c,n[a])}t.hasOwnProperty(a)||e.setAttr(a,void 0)}var l=Aa||t._useStrictMode,u={},d=!1;let f={};for(var a in t)if(!Ea[a]){var o=a.slice(0,2)===`on`,p=n[a]!==t[a];if(o&&p){var c=a.substr(2).toLowerCase();c.substr(0,7)===`content`&&(c=`content`+c.substr(7,1).toUpperCase()+c.substr(8)),t[a]&&(f[c]=t[a])}!o&&(t[a]!==n[a]||l&&t[a]!==e.getAttr(a))&&(d=!0,u[a]=t[a])}for(var c in d&&(e.setAttrs(u),Pa(e)),f)e.on(c+ka,f[c])}function Pa(e){if(!r.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}var Fa=e({appendChild:()=>to,appendChildToContainer:()=>no,appendInitialChild:()=>za,cancelTimeout:()=>$a,clearContainer:()=>ho,commitMount:()=>co,commitTextUpdate:()=>so,commitUpdate:()=>lo,createInstance:()=>Ba,createTextInstance:()=>Va,detachDeletedInstance:()=>go,finalizeInitialChildren:()=>Ha,getChildHostContext:()=>Za,getCurrentEventPriority:()=>_o,getPublicInstance:()=>Ua,getRootHostContext:()=>Xa,hideInstance:()=>uo,hideTextInstance:()=>fo,idlePriority:()=>Ia.unstable_IdlePriority,insertBefore:()=>ro,insertInContainerBefore:()=>io,isPrimaryRenderer:()=>!1,noTimeout:()=>-1,now:()=>Ia.unstable_now,prepareForCommit:()=>Wa,preparePortalMount:()=>Ga,prepareUpdate:()=>Ka,removeChild:()=>ao,removeChildFromContainer:()=>oo,resetAfterCommit:()=>qa,resetTextContent:()=>Ja,run:()=>Ia.unstable_runWithPriority,scheduleTimeout:()=>Qa,shouldDeprioritizeSubtree:()=>Ya,shouldSetTextContent:()=>eo,supportsMutation:()=>!0,unhideInstance:()=>po,unhideTextInstance:()=>mo,warnsIfNotActing:()=>!0}),Ia=v(),La={},Ra={};ya.Node.prototype._applyProps=W;function za(e,t){if(typeof t==`string`){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),Pa(e)}function Ba(e,t,n){let r=ya[e];r||=(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),ya.Group);let i={},a={};for(var o in t)o.slice(0,2)===`on`?a[o]=t[o]:i[o]=t[o];let s=new r(i);return W(s,a),s}function Va(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function Ha(e,t,n){return!1}function Ua(e){return e}function Wa(){return null}function Ga(){return null}function Ka(e,t,n,r){return Ra}function qa(){}function Ja(e){}function Ya(e,t){return!1}function Xa(){return La}function Za(){return La}var Qa=setTimeout,$a=clearTimeout;function eo(e,t){return!1}function to(e,t){t.parent===e?t.moveToTop():e.add(t),Pa(e)}function no(e,t){t.parent===e?t.moveToTop():e.add(t),Pa(e)}function ro(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),Pa(e)}function io(e,t,n){ro(e,t,n)}function ao(e,t){t.destroy(),t.off(ka),Pa(e)}function oo(e,t){t.destroy(),t.off(ka),Pa(e)}function so(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function co(e,t,n){}function lo(e,t,n,r,i){W(e,i,r)}function uo(e){e.hide(),Pa(e)}function fo(e){}function po(e,t){(t.visible==null||t.visible)&&e.show()}function mo(e,t){}function ho(e){}function go(){}var _o=()=>Ta.DefaultEventPriority,vo=Object.defineProperty,yo=Object.defineProperties,G=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertySymbols,bo=Object.prototype.hasOwnProperty,xo=Object.prototype.propertyIsEnumerable,So=(e,t,n)=>t in e?vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Co=(e,t)=>{for(var n in t||={})bo.call(t,n)&&So(e,n,t[n]);if(K)for(var n of K(t))xo.call(t,n)&&So(e,n,t[n]);return e},wo=(e,t)=>yo(e,G(t));typeof window<`u`&&(window.document?.createElement||window.navigator?.product===`ReactNative`)?S.useLayoutEffect:S.useEffect;function q(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){let e=q(r,t,n);if(e)return e;r=t?null:r.sibling}}function To(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}var Eo=console.error;console.error=function(){let e=[...arguments].join(``);if(e?.startsWith(`Warning:`)&&e.includes(`useContext`)){console.error=Eo;return}return Eo.apply(this,arguments)};var Do=To(S.createContext(null)),Oo=class extends S.Component{render(){return S.createElement(Do.Provider,{value:this._reactInternals},this.props.children)}};function ko(){let e=S.useContext(Do);if(e===null)throw Error(`its-fine: useFiber must be called within a <FiberProvider />!`);let t=S.useId();return S.useMemo(()=>{for(let n of[e,e?.alternate]){if(!n)continue;let e=q(n,!1,e=>{let n=e.memoizedState;for(;n;){if(n.memoizedState===t)return!0;n=n.next}});if(e)return e}},[e,t])}function Ao(){let e=ko(),[t]=S.useState(()=>new Map);t.clear();let n=e;for(;n;){if(n.type&&typeof n.type==`object`){let e=n.type._context===void 0&&n.type.Provider===n.type?n.type:n.type._context;e&&e!==Do&&!t.has(e)&&t.set(e,S.useContext(To(e)))}n=n.return}return t}function jo(){let e=Ao();return S.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>S.createElement(t,null,S.createElement(n.Provider,wo(Co({},r),{value:e.get(n)}))),e=>S.createElement(Oo,Co({},e))),[e])}function Mo(e){let t=S.useRef({});return S.useLayoutEffect(()=>{t.current=e}),S.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}var No=e=>{let t=S.useRef(null),n=S.useRef(null),r=S.useRef(null),i=Mo(e),a=jo(),o=t=>{let{forwardedRef:n}=e;n&&(typeof n==`function`?n(t):n.current=t)};return S.useLayoutEffect(()=>(n.current=new ya.Stage({width:e.width,height:e.height,container:t.current}),o(n.current),r.current=Wo.createContainer(n.current,Ta.LegacyRoot,!1,null),Wo.updateContainer(S.createElement(a,{},e.children),r.current),()=>{ya.isBrowser&&(o(null),Wo.updateContainer(null,r.current,null),n.current.destroy())}),[]),S.useLayoutEffect(()=>{o(n.current),W(n.current,e,i),Wo.updateContainer(S.createElement(a,{},e.children),r.current,null)}),S.createElement(`div`,{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},Po=`Layer`,Fo=`Group`,Io=`Label`,Lo=`Rect`,Ro=`Line`,zo=`Image`,Bo=`Text`,Vo=`TextPath`,Ho=`Path`,Uo=`Transformer`,Wo=(0,wa.default)(Fa);Wo.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:`18.3.1`,rendererPackageName:`react-konva`});var Go=S.forwardRef((e,t)=>S.createElement(Oo,{},S.createElement(No,{...e,forwardedRef:t}))),Ko=t(n(((e,t)=>{var n=g();t.exports=function(e,t,r){let i=n.useRef(`loading`),a=n.useRef(),[o,s]=n.useState(0),c=n.useRef(),l=n.useRef(),u=n.useRef();return(c.current!==e||l.current!==t||u.current!==r)&&(i.current=`loading`,a.current=void 0,c.current=e,l.current=t,u.current=r),n.useLayoutEffect(function(){if(!e)return;var n=document.createElement(`img`);function o(){n.decode().catch(()=>{}).finally(()=>{i.current=`loaded`,a.current=n,s(Math.random())})}function c(){i.current=`failed`,a.current=void 0,s(Math.random())}return n.addEventListener(`load`,o),n.addEventListener(`error`,c),t&&(n.crossOrigin=t),r&&(n.referrerPolicy=r),n.src=e,function(){n.removeEventListener(`load`,o),n.removeEventListener(`error`,c)}},[e,t,r]),[a.current,i.current]}}))()),qo=20,Jo=new a.Group;Jo.add(new a.Rect({width:qo,height:qo,fill:`white`})),Jo.add(new a.Path({scaleX:.8333333333333334,scaleY:.8333333333333334,data:`M4.98313549,11.0001422 C5.49589839,10.9914935 5.92501998,11.3703506 5.99116425,11.8666444 L5.99985778,11.9831355 L6.00348884,12.2068855 C6.11245031,15.4321748 8.76323537,17.9999971 11.9999971,17.9999971 C12.1869612,17.9999971 12.3726725,17.9914753 12.5567465,17.9745765 L12.2928932,17.7071068 C11.9023689,17.3165825 11.9023689,16.6834175 12.2928932,16.2928932 C12.6834175,15.9023689 13.3165825,15.9023689 13.7071068,16.2928932 L15.7071068,18.2928932 C16.0976311,18.6834175 16.0976311,19.3165825 15.7071068,19.7071068 L13.7071068,21.7071068 C13.3165825,22.0976311 12.6834175,22.0976311 12.2928932,21.7071068 C11.9023689,21.3165825 11.9023689,20.6834175 12.2928932,20.2928932 L12.6111505,19.9769552 C12.4086045,19.9922816 12.2047796,19.9999971 11.9999971,19.9999971 C7.7687005,19.9999971 4.28886152,16.7094374 4.01666425,12.5105203 L4.00420123,12.2575143 L4.00014222,12.0168645 C3.9908282,11.4646583 4.43092928,11.0094562 4.98313549,11.0001422 Z M11.7071068,2.29289322 C12.0675907,2.65337718 12.0953203,3.22060824 11.7902954,3.61289944 L11.7071068,3.70710678 L11.3891629,4.0230186 C11.5916051,4.00770767 11.7953244,4 12,4 C16.418278,4 20,7.581722 20,12 C20,12.5522847 19.5522847,13 19,13 C18.4477153,13 18,12.5522847 18,12 C18,8.6862915 15.3137085,6 12,6 C11.8129339,6 11.6271216,6.00853145 11.4429483,6.02544919 L11.7071068,6.29289322 C12.0976311,6.68341751 12.0976311,7.31658249 11.7071068,7.70710678 C11.3466228,8.06759074 10.7793918,8.09532028 10.3871006,7.79029539 L10.2928932,7.70710678 L8.29289322,5.70710678 C7.93240926,5.34662282 7.90467972,4.77939176 8.20970461,4.38710056 L8.29289322,4.29289322 L10.2928932,2.29289322 C10.6834175,1.90236893 11.3165825,1.90236893 11.7071068,2.29289322 Z`,fill:`black`}));var Yo=Jo.toCanvas({pixelRatio:2,width:qo,height:qo}),Xo={borderEnabled:!0,anchorSize:10,anchorCornerRadius:0,anchorFill:`white`,anchorStroke:`rgb(0, 161, 255)`,anchorStrokeWidth:2,borderStrokeWidth:2,rotateAnchorOffset:30,anchorStyleFunc:e=>{e.hasName(`rotater`)&&e.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:Yo,fillPatternScaleX:20/qo/2,fillPatternScaleY:20/qo/2,fillPriority:`pattern`,fillPatternRepeat:`no-repeat`})}},Zo={anchorFill:`rgb(240, 240, 240)`,anchorStrokeWidth:2,borderStrokeWidth:2},Qo={anchorSize:20,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2},$o={stroke:`rgb(0, 161, 255)`,strokeWidth:2},es={stroke:`rgb(0, 161, 255)`,strokeWidth:1,dash:[4,6]},ts={fill:`rgba(0, 161, 255, 0.3)`,stroke:`rgb(0, 161, 255)`,strokeWidth:1},ns={fill:`rgb(0, 161, 255)`,textFill:`white`},rs={stroke:`rgb(0, 161, 255)`,labelFill:`rgb(0, 161, 255)`,labelTextFill:`white`},is={fill:`rgba(124, 173, 212, 0.8)`,textFill:`white`},as={fill:`rgba(223, 102, 102, 0.8)`,textFill:`white`},os={stroke:`red`},ss={backgroundColor:`#e8e8e8`,textColor:`grey`,borderColor:`grey`,borderSize:1,tickColor:`grey`,tickSize:1},cs=`rgba(255, 0, 0, 0.1)`;function ls(e,t){if(!t)return Object.assign({},e);let n=Object.assign({},e);for(let e in t){let r=t[e];r!==void 0&&(n[e]=r)}return n}function us(e={}){return{editorAccentColor:`rgb(0, 161, 255)`,cropOverlayFill:e.cropOverlayFill??`rgba(0,0,0,0.3)`,workspaceBackgroundColor:e.workspaceBackgroundColor??`rgba(232, 232, 232, 0.9)`,pageBorderColor:e.pageBorderColor??`lightgrey`,activePageBorderColor:e.activePageBorderColor??`rgb(0, 161, 255)`,bleedColor:e.bleedColor??cs,transparencyBackgroundColor:e.transparencyBackgroundColor,transformerStyle:ls(Xo,e.transformerStyle),innerImageCropTransformerStyle:ls(Zo,e.innerImageCropTransformerStyle),outerImageCropTransformerStyle:ls(Qo,e.outerImageCropTransformerStyle),highlighterStyle:ls($o,e.highlighterStyle),snapGuideStyle:ls(es,{stroke:e.snapGuideStroke,strokeWidth:e.snapGuideStrokeWidth,dash:e.snapGuideDash}),selectionRectStyle:ls(ts,{fill:e.selectionRectFill,stroke:e.selectionRectStroke,strokeWidth:e.selectionRectStrokeWidth}),transformLabelStyle:ls(ns,{fill:e.transformLabelFill,textFill:e.transformLabelTextFill}),distanceGuideStyle:ls(rs,{stroke:e.distanceGuideStroke,labelFill:e.distanceLabelFill,labelTextFill:e.distanceLabelTextFill}),mediaLoadingStyle:ls(is,e.mediaLoadingStyle),mediaErrorStyle:ls(as,e.mediaErrorStyle),textOverflowIndicatorStyle:ls(os,e.textOverflowIndicatorStyle),rulerStyle:ls(ss,{backgroundColor:e.rulerBackgroundColor,textColor:e.rulerTextColor,borderColor:e.rulerBorderColor,borderSize:e.rulerBorderSize,tickColor:e.rulerTickColor,tickSize:e.rulerTickSize})}}var ds=S.createContext(null),fs=ds.Provider;function ps(){return S.useContext(ds)||us()}var ms=0,hs=new Set;function gs(e){return hs.add(e),()=>{hs.delete(e)}}function _s(){return ms}function vs(e){let t=S.useSyncExternalStore(gs,_s,_s),n=S.useRef(null);return n.current&&n.current.revision===t&&function(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}(n.current.overrides,e)||(n.current={overrides:e,revision:t,resolved:us(e)}),n.current.resolved}var ys=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},bs=e=>{let t=window.getComputedStyle(e).position;return!(t===`absolute`||t===`relative`)};function xs(e=()=>{}){let t=S.useRef(e);return t.current=e,S.useCallback((...e)=>t.current.apply(null,e),[])}var Ss=({children:e,groupProps:t,divProps:n,transform:r,transformFunc:i,parentNodeFunc:a})=>{let o=jo(),s=S.useRef(null),[c]=S.useState(()=>document.createElement(`div`)),l=S.useMemo(()=>C.createRoot(c),[c]),u=r??!0,d=xs(()=>{if(u&&s.current){let e=s.current.getAbsoluteTransform().decompose();i&&(e=i(e)),c.style.position=`absolute`,c.style.zIndex=`10`,c.style.top=`0px`,c.style.left=`0px`,c.style.transform=`translate(${e.x}px, ${e.y}px) rotate(${e.rotation}deg) scaleX(${e.scaleX}) scaleY(${e.scaleY})`,c.style.transformOrigin=`top left`}else c.style.position=``,c.style.zIndex=``,c.style.top=``,c.style.left=``,c.style.transform=``,c.style.transformOrigin=``;let e=n||{},{style:t}=e,r=ys(e,[`style`]);Object.assign(c.style,t),Object.assign(c,r)});return S.useLayoutEffect(()=>{let e=s.current;if(!e)return;let t=a?a({stage:e.getStage()}):e.getStage()?.container();if(t)return t.appendChild(c),u&&bs(t)&&(t.style.position=`relative`),e.on(`absoluteTransformChange`,d),d(),()=>{var t;e.off(`absoluteTransformChange`,d),(t=c.parentNode)==null||t.removeChild(c)}},[u,a]),S.useLayoutEffect(()=>{d()},[n,i]),S.useLayoutEffect(()=>{queueMicrotask(()=>{(0,Zi.flushSync)(()=>{l.render(S.createElement(o,null,e))})})}),S.useLayoutEffect(()=>()=>{setTimeout(()=>{l.unmount()})},[]),S.createElement(Fo,Object.assign({ref:s},t))},Cs=({selector:e,enabled:t,children:n})=>{let r=S.useRef(null),i=S.useRef(null),a=S.useRef(null),o=t??!0;return S.useLayoutEffect(()=>{if(!r.current||!i.current)return;a.current=i.current;let t=r.current.getStage().findOne(e);o&&t?i.current.moveTo(t):i.current.moveTo(r.current);let n=r.current.getLayer();if(n&&(n.batchDraw(),t)){let e=t.getLayer();if(!e)return;e.batchDraw()}},[e,o]),S.useEffect(()=>()=>{var e;(e=a.current)==null||e.destroy()},[]),S.createElement(Fo,{name:`_outer_portal`,ref:r},S.createElement(Fo,{name:`_inner_portal`,ref:i},n))};function ws(e,t){return Object.keys(e.values).forEach(n=>e.values[n]=e.values[n]&&parseFloat(e.values[n].toFixed(t))),e}function Ts(e,t,n){let r=t-1,i=n[ks(r,n.length)];return i.marker===`Z`?Ts(e,r,n):i}function Es(e,t,n){let r=t+1,i=n[ks(r,n.length)];return i.marker===`Z`?Es(e,r,n):i}function Ds(e,t,n){let r=n[t-1]||{values:{x:0,y:0}};if(e.marker===e.marker.toLowerCase())switch(e.marker=e.marker.toUpperCase(),e.marker){case`M`:e.values.x+=r.values.x,e.values.y+=r.values.y;break;case`L`:case`A`:e.values.x+=r.values.x,e.values.y+=r.values.y;break;case`H`:e.marker=`L`,e.values.x+=r.values.x,e.values.y=r.values.y;break;case`V`:e.marker=`L`,e.values.x=r.values.x,e.values.y+=r.values.y;break;case`C`:e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x1+=r.values.x,e.values.y1+=r.values.y,e.values.x2+=r.values.x,e.values.y2+=r.values.y;break;case`S`:e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x2+=r.values.x,e.values.y2+=r.values.y;break;case`Q`:e.values.x+=r.values.x,e.values.y+=r.values.y,e.values.x1+=r.values.x,e.values.y1+=r.values.y;break;case`T`:e.values.x+=r.values.x,e.values.y+=r.values.y;break;case`Z`:break}else if(e.marker===e.marker.toUpperCase())switch(e.marker){case`H`:e.marker=`L`,e.values.y=r.values.y;break;case`V`:e.marker=`L`,e.values.x=r.values.x;break}if(e.marker===`Z`){function r(e,t){return e[t].marker===`M`?e[t]:r(e,t-1)}let i=r(n,t);e.values.x=i.values.x,e.values.y=i.values.y}return e}function Os(e,t){let n=[];switch(e.toUpperCase()){case`M`:for(let r=0;r<t.length;r+=2){let i;i=e===e.toUpperCase()?r===0?`M`:`L`:r===0?`m`:`l`,n.push({marker:i,values:{x:t[r],y:t[r+1]}})}break;case`L`:for(let r=0;r<t.length;r+=2)n.push({marker:e,values:{x:t[r],y:t[r+1]}});break;case`H`:for(let r=0;r<t.length;r++)n.push({marker:e,values:{x:t[r],y:0}});break;case`V`:for(let r=0;r<t.length;r++)n.push({marker:e,values:{x:0,y:t[r]}});break;case`C`:for(let r=0;r<t.length;r+=6)n.push({marker:e,values:{x1:t[r],y1:t[r+1],x2:t[r+2],y2:t[r+3],x:t[r+4],y:t[r+5]}});break;case`S`:for(let r=0;r<t.length;r+=4)n.push({marker:e,values:{x2:t[r],y2:t[r+1],x:t[r+2],y:t[r+3]}});break;case`Q`:for(let r=0;r<t.length;r+=4)n.push({marker:e,values:{x1:t[r],y1:t[r+1],x:t[r+2],y:t[r+3]}});break;case`T`:for(let r=0;r<t.length;r+=2)n.push({marker:e,values:{x:t[r],y:t[r+1]}});break;case`A`:for(let r=0;r<t.length;r+=7)n.push({marker:e,values:{radiusX:t[r],radiusY:t[r+1],rotation:t[r+2],largeArc:t[r+3],sweep:t[r+4],x:t[r+5],y:t[r+6]}});break;case`Z`:n.push({marker:e,values:{x:0,y:0}});break}return n}function ks(e,t){return(e%t+t)%t}function As(e,t,n){if(t!==0&&e.marker===`L`){let r=n[t-1];[`x`,`y`].every(t=>Math.round(Math.abs(r.values[t]-e.values[t]))===0)&&(e.overlap=!0)}return e}function js(e,t){let n=[`x`,`y`].every(n=>Math.round(Math.abs(e[t].values[n]-e[0].values[n]))===0);e[t].marker===`L`&&n&&(e[t].overlap=!0,js(e,t-1)),e[t].marker===`Z`&&js(e,t-1)}function Ms(e,t,n){let r=Ps(e.values,n.values),i=Ps(t.values,e.values);return Math.min(i,r)}function Ns(e,t){return Math.atan2(t.x-e.x,t.y-e.y)}function Ps(e,t){let n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n**2+r**2)}function Fs(e,t){return Math.sin(e)*t}function Is(e,t){return Math.cos(e)*t}function Ls(e,t){let n=t/Math.tan(e);return n===1/0||n===-1/0||isNaN(n)?t:n}function Rs(e,t){return t*Math.tan(e)}function zs(e,t){let n,r=0,i=180/Math.PI*e;return i<0&&i>=-180||i>180&&i<360?n=Ls(e/2,-t):(n=Ls(e/2,t),r=1,n===1/0&&(n=t)),{offset:n,sweepFlag:r}}function Bs(e){let t=[`radiusX`,`radiusY`,`rotation`,`largeArc`,`sweep`,`x1`,`y1`,`x2`,`y2`,`x`,`y`];return e.map(e=>{let n=``;if(e.marker!==`Z`){let r=Object.keys(e.values);n=t.filter(e=>r.indexOf(e)!==-1).map(t=>e.values[t]).join()}return`${e.marker}${n}`}).join(``).trim()}function Vs(e){let t=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,n=/-?[0-9]*\.?\d+/g;return[...e.matchAll(t)].map(e=>({marker:e[0],index:e.index})).reduceRight((t,n)=>{let r=e.substring(n.index,t.length?t[t.length-1].index:e.length);return t.concat([{marker:n.marker,index:n.index,chunk:r.length>0?r.substr(1,r.length-1):r}])},[]).reverse().flatMap(e=>{let t=e.chunk.match(n),r=t?t.map(parseFloat):[];return Os(e.marker,r)}).map(Ds)}function Hs(e,t,n){let r=[],i=[];return n&&e.forEach(e=>ws(e,n)),e.forEach(e=>{e.marker===`M`&&r.push([]),r[r.length-1].push(e)}),r.forEach(e=>{e.map(As),js(e,e.length-1);let n=e[e.length-1].marker==`Z`;e.filter(e=>!e.overlap).map((e,r,a)=>{let o=Ts(e,r,a),s=Es(e,r,a),c=Ns(e.values,o.values),l=Ns(e.values,s.values),u=l-c,d=180/Math.PI*u,f=Ms(e,o,s),p=Math.abs(Rs(u/2,f/2)),m=Math.min(t,p),h=zs(u,m),g=h.offset,_=h.sweepFlag,v=(r==0||r==a.length-1)&&!n;switch(e.marker){case`M`:case`L`:let t=[e.values.x+Fs(c,g),e.values.y+Is(c,g)],n=[e.values.x+Fs(l,g),e.values.y+Is(l,g)];v?i.push({marker:e.marker,values:e.values}):i.push({marker:e.marker,values:{x:parseFloat(t[0].toFixed(3)),y:parseFloat(t[1].toFixed(3))}}),!v&&(s.marker===`L`||s.marker===`M`)&&i.push({marker:`A`,radius:m,values:{radiusX:parseFloat(m.toFixed(3)),radiusY:parseFloat(m.toFixed(3)),rotation:d,largeArc:0,sweep:_,x:parseFloat(n[0].toFixed(3)),y:parseFloat(n[1].toFixed(3))}});break;case`C`:case`S`:case`Q`:case`T`:case`A`:case`Z`:i.push({marker:e.marker,values:e.values});break}})}),{path:Bs(i),commands:i}}function Us({rects:e,padding:t=0,cornerRadius:n=0}){let r=function(e){if(e.length<2)return e;let t=[e[0]];for(let n=1;n<e.length;n++){let r=t[t.length-1],i=e[n];Math.abs(r.left-i.left)<.5&&Math.abs(r.right-i.right)<.5&&Math.abs(r.bottom-i.top)<.5?t[t.length-1]=Object.assign(Object.assign({},r),{bottom:i.bottom}):t.push(i)}return t}(function(e){if(e.length<2)return e;let t=[e[0]];for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n];if(i.top-r.bottom>.5*Math.max(r.bottom-r.top,i.bottom-i.top)){let e=Math.max(r.left,i.left),n=Math.min(r.right,i.right);n>e&&t.push({left:e,right:n,top:r.bottom,bottom:i.top})}t.push(i)}return t}(e)),i=r.length;if(i===0)return``;let a=e=>e.right-e.left,o=e=>{let t=r[e-1],n=r[e];return t?n?(t.bottom+n.top)/2:t.bottom:n.top},s=`M ${(r[0].left+r[0].right)/2} ${r[0].top-t}`;for(let e=0;e<i;e++){let n=r[e],i=r[e-1],c=r[e+1],l=n.right+t;s+=` L ${l} ${i?a(i)>a(n)?o(e)+t:o(e)-t:n.top-t}`,s+=` L ${l} ${c?a(c)>a(n)?o(e+1)-t:o(e+1)+t:n.bottom+t}`}for(let e=i-1;e>=0;e--){let n=r[e],i=r[e-1],c=r[e+1],l=n.left-t;s+=` L ${l} ${c?a(c)>a(n)?o(e+1)-t:o(e+1)+t:n.bottom+t}`,s+=` L ${l} ${i?a(i)>a(n)?o(e)+t:o(e)-t:n.top-t}`}return s+=` Z`,Hs(Vs(s),n).path}function Ws({lines:e,lineHeight:t,width:n,align:r}){return e.flatMap((e,i)=>{if(e.width<=0)return[];let a,o,s=e.width;return r!==`justify`||e.lastInParagraph||(s=n),r===`right`?(o=n,a=n-s):r===`center`?(a=(n-s)/2,o=a+s):(a=0,o=s),[{left:a,right:o,top:i*t,bottom:(i+1)*t}]})}var Gs=Gs||{};Gs.stringify=(function(){var e={"visit_linear-gradient":function(t){return e.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return e.visit_gradient(t)},"visit_radial-gradient":function(t){return e.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return e.visit_gradient(t)},"visit_conic-gradient":function(t){return e.visit_gradient(t)},"visit_repeating-conic-gradient":function(t){return e.visit_gradient(t)},visit_gradient:function(t){var n=e.visit(t.orientation);return n&&(n+=`, `),t.type+`(`+n+e.visit(t.colorStops)+`)`},visit_shape:function(t){var n=t.value,r=e.visit(t.at),i=e.visit(t.style);return i&&(n+=` `+i),r&&(n+=` at `+r),n},"visit_default-radial":function(t){var n=``,r=e.visit(t.at);return r&&(t.hasAtKeyword?n+=`at `+r:n+=r),n},"visit_extent-keyword":function(t){var n=t.value,r=e.visit(t.at);return r&&(n+=` at `+r),n},"visit_position-keyword":function(e){return e.value},visit_position:function(t){return e.visit(t.value.x)+` `+e.visit(t.value.y)},"visit_%":function(e){return e.value+`%`},visit_em:function(e){return e.value+`em`},visit_px:function(e){return e.value+`px`},visit_rem:function(e){return e.value+`rem`},visit_vw:function(e){return e.value+`vw`},visit_vh:function(e){return e.value+`vh`},visit_vmin:function(e){return e.value+`vmin`},visit_vmax:function(e){return e.value+`vmax`},visit_ch:function(e){return e.value+`ch`},visit_ex:function(e){return e.value+`ex`},visit_calc:function(e){return`calc(`+e.value+`)`},visit_literal:function(t){return e.visit_color(t.value,t)},visit_hex:function(t){return e.visit_color(`#`+t.value,t)},visit_rgb:function(t){return e.visit_color(`rgb(`+t.value.join(`, `)+`)`,t)},visit_rgba:function(t){return e.visit_color(`rgba(`+t.value.join(`, `)+`)`,t)},visit_hsl:function(t){return e.visit_color(`hsl(`+t.value[0]+`, `+t.value[1]+`%, `+t.value[2]+`%)`,t)},visit_hsla:function(t){return e.visit_color(`hsla(`+t.value[0]+`, `+t.value[1]+`%, `+t.value[2]+`%, `+t.value[3]+`)`,t)},visit_var:function(t){return e.visit_color(`var(`+t.value+`)`,t)},visit_color:function(t,n){var r=t,i=e.visit(n.length);i&&(r+=` `+i);var a=e.visit(n.length2);return a&&(r+=` `+a),r},visit_angular:function(e){return e.value+(e.unit||`deg`)},visit_directional:function(e){return`to `+e.value},visit_conic:function(t){var n=``;return t.angle&&(n+=`from `+e.visit(t.angle)),t.at&&(n&&(n+=` `),n+=`at `+e.visit(t.at)),n},visit_array:function(t){var n=``,r=t.length;return t.forEach(function(t,i){n+=e.visit(t),i<r-1&&(n+=`, `)}),n},visit_object:function(t){return t.width&&t.height?e.visit(t.width)+` `+e.visit(t.height):``},visit:function(t){if(!t)return``;if(t instanceof Array)return e.visit_array(t);if(typeof t==`object`&&!t.type)return e.visit_object(t);if(t.type){var n=e[`visit_`+t.type];if(n)return n(t);throw Error(`Missing visitor visit_`+t.type)}else throw Error(`Invalid node.`)}};return function(t){return e.visit(t)}})();var Gs=Gs||{};Gs.parse=(function(){var e={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,conicGradient:/^(\-(webkit|o|ms|moz)\-)?(conic\-gradient)/i,repeatingConicGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,remValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))rem/,vwValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))vw/,vhValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))vh/,vminValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))vmin/,vmaxValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))vmax/,chValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))ch/,exValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))ex/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,radianValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))rad/,gradianValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))grad/,turnValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))turn/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,slash:/^\//,hexColor:/^\#([0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{4}|[0-9a-fA-F]{3})(?![0-9a-fA-F])/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-zA-Z0-9-,\s\#]+)/,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i},t=``;function n(e){var n=Error(t+`: `+e);throw n.source=t,n}function r(){var e=i();return t.length>0&&n(`Invalid input not EOF`),e}function i(){return S(a)}function a(){return o(`linear-gradient`,e.linearGradient,c)||o(`repeating-linear-gradient`,e.repeatingLinearGradient,c)||o(`radial-gradient`,e.radialGradient,m)||o(`repeating-radial-gradient`,e.repeatingRadialGradient,m)||o(`conic-gradient`,e.conicGradient,l)||o(`repeating-conic-gradient`,e.repeatingConicGradient,l)}function o(t,r,i){return s(r,function(r){var a=i();return a&&(L(e.comma)||n(`Missing comma before color stops`)),{type:t,orientation:a,colorStops:S(C)}})}function s(t,r){var i=L(t);if(i){L(e.startCall)||n(`Missing (`);var a=r(i);return L(e.endCall)||n(`Missing )`),a}}function c(){var t=d();if(t)return t;var n=I(`position-keyword`,e.positionKeywords,1);return n?{type:`directional`,value:n.value}:f()}function l(){var e=u(),t=y();if(e||t)return{type:`conic`,angle:e||void 0,at:t||void 0}}function u(){if(I(`from`,/^from/,0)){var e=f();return e||n(`Missing angle after "from" in conic-gradient`),e}}function d(){return I(`directional`,e.sideOrCorner,1)}function f(){return p(`deg`,e.angleValue)||p(`rad`,e.radianValue)||p(`grad`,e.gradianValue)||p(`turn`,e.turnValue)}function p(e,t){var n=L(t);if(n)return{type:`angular`,value:n[1],unit:e}}function m(){var n,r=h(),i;return r&&(n=[],n.push(r),i=t,L(e.comma)&&(r=h(),r?n.push(r):t=i)),n}function h(){var e=g()||_();if(e)e.at=y();else{var t=v();if(t){e=t;var n=y();n&&(e.at=n)}else{var r=y();if(r)e={type:`default-radial`,at:r,hasAtKeyword:!0};else{var i=b();i&&(e={type:`default-radial`,at:i})}}}return e}function g(){var e=I(`shape`,/^(circle)/i,0);return e&&(e.style=F()||v()),e}function _(){var e=I(`shape`,/^(ellipse)/i,0);return e&&(e.style=b()||te()||v()),e}function v(){return I(`extent-keyword`,e.extentKeywords,1)}function y(){if(I(`position`,/^at/,0)){var e=b();return e||n(`Missing positioning value`),e}}function b(){var e=x();if(e.x||e.y)return{type:`position`,value:e}}function x(){return{x:te(),y:te()}}function S(t){var r=t(),i=[];if(r)for(i.push(r);L(e.comma);)r=t(),r?i.push(r):n(`One extra comma`);return i}function C(){var e=w();return e||n(`Expected color definition`),e.length=te(),e.length&&(e.length2=te()),e}function w(){return E()||M()||j()||O()||D()||A()||T()}function T(){return I(`literal`,e.literalColor,0)}function E(){return I(`hex`,e.hexColor,1)}function D(){return s(e.rgbColor,function(){return k(`rgb`)})}function O(){return s(e.rgbaColor,function(){return k(`rgba`)})}function k(t){var n=P();if(L(e.comma)){var r=P();L(e.comma);var i=P(),a=[n,r,i];return L(e.comma)?(a.push(P()),{type:`rgba`,value:a}):{type:t,value:a}}else{var r=P(),i=P(),a=[n,r,i];return L(e.slash)?(a.push(P()),{type:`rgba`,value:a}):{type:t,value:a}}}function A(){return s(e.varColor,function(){return{type:`var`,value:N()}})}function j(){return s(e.hslColor,function(){return ee(`hsl`)})}function M(){return s(e.hslaColor,function(){return ee(`hsla`)})}function ee(t){L(e.percentageValue)&&n(`HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage`);var r=P();if(L(e.comma)){var i=L(e.percentageValue),a=i?i[1]:null;L(e.comma),i=L(e.percentageValue);var o=i?i[1]:null;if((!a||!o)&&n(`Expected percentage value for saturation and lightness in HSL`),L(e.comma)){var s=P();return{type:`hsla`,value:[r,a,o,s]}}return{type:t,value:[r,a,o]}}else{var i=L(e.percentageValue),a=i?i[1]:null;i=L(e.percentageValue);var o=i?i[1]:null;if((!a||!o)&&n(`Expected percentage value for saturation and lightness in HSL`),L(e.slash)){var s=P();return{type:`hsla`,value:[r,a,o,s]}}return{type:t,value:[r,a,o]}}}function N(){return L(e.variableName)[1]}function P(){return L(e.number)[1]}function te(){return I(`%`,e.percentageValue,1)||ne()||re()||F()}function ne(){return I(`position-keyword`,e.positionKeywords,1)}function re(){return s(e.calcValue,function(){for(var e=1,r=0;e>0&&r<t.length;){var i=t.charAt(r);i===`(`?e++:i===`)`&&e--,r++}e>0&&n(`Missing closing parenthesis in calc() expression`);var a=t.substring(0,r-1);return ie(r-1),{type:`calc`,value:a}})}function F(){return I(`px`,e.pixelValue,1)||I(`em`,e.emValue,1)||I(`rem`,e.remValue,1)||I(`vw`,e.vwValue,1)||I(`vh`,e.vhValue,1)||I(`vmin`,e.vminValue,1)||I(`vmax`,e.vmaxValue,1)||I(`ch`,e.chValue,1)||I(`ex`,e.exValue,1)}function I(e,t,n){var r=L(t);if(r)return{type:e,value:r[n]}}function L(e){var n,r=/^[\n\r\t\s]+/.exec(t);return r&&ie(r[0].length),n=e.exec(t),n&&ie(n[0].length),n}function ie(e){t=t.substring(e)}return function(e){return t=e.toString().trim(),t.endsWith(`;`)&&(t=t.slice(0,-1)),r()}})(),Gs.parse,Gs.stringify;var Ks={parse:Gs.parse,stringify:Gs.stringify},qs=e=>e.indexOf(`linear-gradient`)>=0,Js=e=>e.type===`hex`?`#`+e.value:e.type===`literal`?e.value:`${e.type}(${e.value.join(`,`)})`,Ys=e=>{if(!qs(e))return{rotation:0,stops:[{offset:0,color:e},{offset:1,color:e}]};let t=Ks.parse(e)[0];return{rotation:t.orientation&&`value`in t.orientation?parseFloat(t.orientation.value):0,stops:t.colorStops.map((e,n)=>({color:Js(e),offset:e.length?parseFloat(e.length.value)/100:n/(t.colorStops.length-1)}))}},Xs=(e,t,n)=>(t===void 0&&(t=e.fill??``),n===void 0&&(n=`fill`),S.useMemo(()=>{if(!qs(t))return{[n]:t};let{stops:r,rotation:i}=Ys(t),o=e.a.width/2,s=e.a.height/2,c=(i%180+180)%180,l=c>45&&c<135?e.a.width:e.a.height,u=a.Util.degToRad(i)-Math.PI/2,d=[];return r.forEach(({offset:e,color:t})=>{d.push(e,t)}),n===`fill`?{fillLinearGradientStartPointX:o-l/2*Math.cos(u),fillLinearGradientStartPointY:s-l/2*Math.sin(u),fillLinearGradientColorStops:d,fillLinearGradientEndPointX:o+l/2*Math.cos(u),fillLinearGradientEndPointY:s+l/2*Math.sin(u),fill:r[1].color,fillPriority:`linear-gradient`}:{strokeLinearGradientStartPointX:o-l/2*Math.cos(u),strokeLinearGradientStartPointY:s-l/2*Math.sin(u),strokeLinearGradientColorStops:d,strokeLinearGradientEndPointX:o+l/2*Math.cos(u),strokeLinearGradientEndPointY:s+l/2*Math.sin(u)}},[t,e.width,e.height])),Zs=!1,Qs=(e=!Zs)=>{Zs=e},$s=()=>Zs;function ec(e,t){let n=S.useRef();S.useLayoutEffect(()=>{n.current&&n.current.destroy()},[t]),S.useLayoutEffect(()=>{if(!Zs)return;let t=e.current.opacity();return t?(e.current.opacity(0),n.current=new a.Tween({node:e.current,opacity:t,onFinish:()=>{var e;(e=n.current)==null||e.destroy()}}),n.current.play(),()=>{var e;(e=n.current)==null||e.destroy()}):void 0},[])}var tc=0,nc=[],rc=3e4,ic=e=>{rc=e},ac=6e3,oc=e=>{ac=e},sc=()=>ac;function cc(e){tc+=1;let t=!1,n=!1,r=setTimeout(()=>{t||(pc(`Timeout loading asset ${e}`),console.error(`Timeout triggered for loader. Some assets may not have loaded.`,e),t=!0,lc())},rc);return()=>{n?console.error(`Finish called twice! That is not expected. id: `,e):(n=!0,t||(clearTimeout(r),lc()))}}function lc(){--tc,tc===0&&(nc.forEach(e=>e()),nc=[])}function uc(){return new Promise(e=>{t=()=>{$s()?setTimeout(e,300):e(!0)},tc===0?t():nc.push(t);return;var t})}var dc=[];function fc(e){dc.push(e)}function pc(e){dc.forEach(t=>t(e))}function mc(e=``){return(e.match(/<\/p>/gi)||[]).length>1&&(e=e.replace(/<\/p>/gi,(e,t,n)=>(n.slice(t+e.length).match(/<\/p>/gi)||[]).length>0?`
29
- `:e)),e.replace(/(<([^>]+)>)/gi,``).replace(/&amp;/g,`&`).replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&quot;/g,`"`).replace(/&apos;/g,`'`).replace(/&nbsp;/g,` `)}function hc(e,t){return!!e.bold==!!t.bold&&!!e.italic==!!t.italic&&!!e.underline==!!t.underline&&!!e.strike==!!t.strike&&(e.color||``)===(t.color||``)}function J(e){if(!e)return[];let t=new DOMParser().parseFromString(e,`text/html`),n=[],r=t.body.querySelectorAll(`p`);function i(e,t){if(e.nodeType===Node.TEXT_NODE){let r=e.textContent||``;r&&n.push(function(e,t){let n={text:e};return t.bold&&(n.bold=!0),t.italic&&(n.italic=!0),t.underline&&(n.underline=!0),t.strike&&(n.strike=!0),t.color&&(n.color=t.color),n}(r,t));return}if(e.nodeType!==Node.ELEMENT_NODE)return;let r=e,a=r.tagName.toLowerCase(),o=Object.assign({},t);a!==`strong`&&a!==`b`||(o.bold=!0),a!==`em`&&a!==`i`||(o.italic=!0),a===`u`&&(o.underline=!0),a===`s`&&(o.strike=!0);let s=r.style;s.color&&(o.color=s.color),(s.fontWeight===`bold`||parseInt(s.fontWeight)>=700)&&(o.bold=!0),s.fontStyle===`italic`&&(o.italic=!0);let c=s.textDecoration||s.textDecorationLine||``;c.includes(`underline`)&&(o.underline=!0),c.includes(`line-through`)&&(o.strike=!0);for(let e of Array.from(r.childNodes))i(e,o)}r.length>0?r.forEach((e,t)=>{i(e,{}),t<r.length-1&&n.push({text:` `})}):i(t.body,{});let a=[];for(let e of n){if(!e.text)continue;let t=a[a.length-1];t&&hc(t,e)?t.text+=e.text:a.push(e)}return a}function gc(e){return e?/<[a-z][a-z0-9]*(\s[^>]*)?>[^<]*<\/[a-z][a-z0-9]*>/i.test(e)?e=(e=e.replace(/<(?![a-z/!])/gi,`&lt;`)).replace(/([^a-z0-9"'\s/])>/gi,`$1&gt;`):e.replace(/</g,`&lt;`).replace(/>/g,`&gt;`):``}z([`Roboto`,`Amatic SC`,`Press Start 2P`,`Marck Script`,`Rubik Mono One`]),z({value:!1});var _c=z([]);function vc(e){_c.push(e)}var yc=`BESbswy 0123456789 Il1Ww`,bc=[`sans-serif`,`serif`,`monospace`];function xc(e){let t=function(e=``){let t=mc(e).replace(/\s+/g,` `).trim();return t?Array.from(t).slice(0,10).join(``):``}(e);return t?`${yc} ${t}`:yc}var Sc;function Cc(e){return{width:e.width,actualBoundingBoxLeft:e.actualBoundingBoxLeft||0,actualBoundingBoxRight:e.actualBoundingBoxRight||0,actualBoundingBoxAscent:e.actualBoundingBoxAscent||0,actualBoundingBoxDescent:e.actualBoundingBoxDescent||0}}function wc(e=`sans-serif`,t=`normal`,n=`normal`,r=yc){Sc||=document.createElement(`canvas`);let i=Sc.getContext(`2d`);return i.font=`${t} ${n} 40px ${e}`,Cc(i.measureText(r))}function Tc(e,t,n,r,i){return bc.some(a=>function(e,t,n=.01){return Math.abs(e.width-t.width)>n||Math.abs(e.actualBoundingBoxLeft-t.actualBoundingBoxLeft)>n||Math.abs(e.actualBoundingBoxRight-t.actualBoundingBoxRight)>n||Math.abs(e.actualBoundingBoxAscent-t.actualBoundingBoxAscent)>n||Math.abs(e.actualBoundingBoxDescent-t.actualBoundingBoxDescent)>n}(function(e,t=`sans-serif`,n=`normal`,r=`normal`,i=yc){Sc||=document.createElement(`canvas`);let a=Sc.getContext(`2d`);return a.font=`${n} ${r} 40px '${e}', ${t}`,Cc(a.measureText(i))}(e,a,t,n,r),i[a]))}var Ec={Arial:!0},Dc=(e,t,n)=>t&&n?!!Ec[`${e}_${t}_${n}`]:Object.keys(Ec).some(t=>t.startsWith(e+`_`))||!!Ec[e];async function Oc(e,t,n,r){let i=`${e}_${t}_${n}`;if(Ec[i])return;let a=!!document.fonts?.load,o=xc(r),s={"sans-serif":wc(`sans-serif`,t,n,o),serif:wc(`serif`,t,n,o),monospace:wc(`monospace`,t,n,o)};if(a)try{if(await document.fonts.load(`${t} ${n} 16px '${e}'`,o),Tc(e,t,n,o,s)){Ec[i]=!0;return}}catch{}let c=Math.min(6e3,sc())/60;for(let r=0;r<c;r++){if(Tc(e,t,n,o,s)){Ec[i]=!0;return}await new Promise(e=>setTimeout(e,60))}console.warn(`Timeout for loading font "${e}". Looks like polotno can't load it. Is it a correct font family?`),pc(`Timeout for loading font "${e}"`)}var kc={},Ac=`400,400italic,700,700italic`;function jc(){return Ac}function Mc(e){return`https://fonts.googleapis.com/css?family=${e.replace(/ /g,`+`)}:${Ac}`}function Nc(e){if(kc[e])return;let t=Mc(e),n=document.createElement(`link`);n.type=`text/css`,n.href=t,n.rel=`stylesheet`,document.getElementsByTagName(`head`)[0].appendChild(n),kc[e]=!0}var Pc={},Fc;function Ic(e){let t=e.fontFamily;if(Pc[t]||!e.url&&!e.styles)return;let n=e.styles||(e.url?[{src:`url("${e.url}")`}]:[]),r=(Fc||(Fc=document.getElementById(`polotno-font-style`),Fc||(Fc=document.createElement(`style`),Fc.id=`polotno-font-style`,document.head.appendChild(Fc)),Fc)).sheet;n.forEach(e=>{r.insertRule(`\n @font-face{\n font-family:'${t}';\n src:${e.src};\n font-style:${e.fontStyle||`normal`};\n font-weight:${e.fontWeight||`normal`};\n font-display:swap; /* optional but recommended */\n }`,r.cssRules.length)}),Pc[e.fontFamily]=!0}var Lc=z({imageDownScalingEnabled:!0,removeBackgroundEnabled:!1,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:`resize`,textSplitAllowed:!1,animationsEnabled:!1,aiTextEnabled:!1,autoDeleteEmptyText:!0}),Rc=typeof window<`u`&&window.location.hostname===`localhost`||typeof process<`u`&&!1,zc=H(e=>{Lc.textVerticalResizeEnabled=e}),Bc=H(e=>{Lc.removeBackgroundEnabled=e});H(e=>{Rc&&console.warn(`useRemoveBackground is deprecated. Use setRemoveBackgroundEnabled instead.`),Bc(e)}),H(e=>{Lc.aiTextEnabled=e}),H(e=>{Rc&&console.warn(`useHtmlTextRender is deprecated. Use setRichTextEnabled instead.`),Lc.htmlRenderEnabled=e});var Vc=H(e=>{Lc.htmlRenderEnabled=e}),Hc=H(e=>{Lc.imageDownScalingEnabled=e});H(e=>{console.warn(`useDownScaling is deprecated. Use setDownScalingEnabled instead.`),Hc(e)}),H(e=>{console.warn(`setForceTextFit is deprecated. Use setTextOverflow instead.`),Lc.textOverflow=`change-font-size`});var Uc=H(e=>{Lc.textOverflow=e}),Wc=H(e=>{Lc.textSplitAllowed=e});H(e=>{Lc.animationsEnabled=e}),H(e=>{Lc.autoDeleteEmptyText=e});var Gc={fontSize:14,fontFamily:`Roboto`,fontWeight:`normal`,fontStyle:`normal`,lineHeight:1.2,letterSpacing:0,textTransform:`none`,textDecoration:``,align:`center`,fill:`black`,stroke:`black`,strokeWidth:0,curveEnabled:!1,curvePower:.5};function Kc(e){return Object.assign(Object.assign({},Gc),e)}function qc(e){var t=`֑-߿‏‫‮יִ-﷽ﹰ-ﻼ`;return RegExp(`^[^`+t+`]*?[`+t+`]`).test(e)}function Jc(e){return function(e){e=e.replace(/\s/g,``);let t=0;for(var n=0;n<e.length;n++)qc(e[n])&&(t+=1);return t>e.length/2}(e)?`rtl`:`ltr`}function Yc(e,t,n,r){let i=Math.max(-.9999,Math.min(.9999,n));if(Math.abs(i)<1e-4)return`M 0 ${t/2} L ${e} ${t/2}`;let a=5*r/(2*Math.abs(i))-r,o=e/2;if(i>0){let e=2*a+r/2;return[`M ${o} ${e}`,`A ${a} ${a} 0 1 1 ${o} ${e-2*a}`,`A ${a} ${a} 0 1 1 ${o} ${e}`].join(` `)}{let e=-(2*a-Math.round(t))-r/2;return[`M ${o} ${e}`,`A ${a} ${a} 0 1 0 ${o} ${e+2*a}`,`A ${a} ${a} 0 1 0 ${o} ${e}`].join(` `)}}function Xc(e,t,n,r){if(!qs(e))return``;let{stops:i,rotation:a}=Ys(e),o=a*Math.PI/180;return`<linearGradient id="${t}" x1="${100*(.5-.5*Math.sin(o))}%" y1="${100*(.5+.5*Math.cos(o))}%" x2="${100*(.5+.5*Math.sin(o))}%" y2="${100*(.5-.5*Math.cos(o))}%">${i.map(({offset:e,color:t})=>`<stop offset="${100*e}%" stop-color="${t}" />`).join(``)}</linearGradient>`}function Zc(e){let t=e.a?e.a:e,n=Kc(e),r=t.fontSize??n.fontSize,i=new a.TextPath({data:Yc(t.width??n.width,t.height??n.height??0,n.curvePower,r),align:`center`,textBaseline:`middle`,text:mc(n.text),fontSize:r,fontFamily:n.fontFamily,fontWeight:n.fontWeight,fontStyle:n.fontStyle,letterSpacing:n.letterSpacing*r,fill:n.fill}),o=i.getSelfRect().height||r;return i.destroy(),o}function Qc(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}function $c(e,t,n){return e.map(e=>{let r=[];e.bold&&t.fontWeight!==`bold`&&r.push(`font-weight="bold"`),e.italic&&t.fontStyle!==`italic`&&r.push(`font-style="italic"`),e.underline&&r.push(`text-decoration="underline"`),e.strike&&r.push(`text-decoration="line-through"`),!n?.omitColors&&e.color&&e.color!==t.fill&&r.push(`fill="${Qc(e.color)}"`);let i=Qc(e.text);return r.length===0?i:`<tspan ${r.join(` `)}>${i}</tspan>`}).join(``)}function el(e,{fontFamily:t=``,color:n=`black`,forEditor:r=!1}={}){let i=Kc(e),a=t||i.fontFamily,o=qs(i.fill),s=qs(i.stroke)&&!!i.strokeWidth,c=Lc.textOverflow===`ellipsis`&&!r&&!i.curveEnabled&&!!i.height,l=(()=>{if(!c)return[];let e=Math.max(1,Math.round(i.height)),t=typeof i.lineHeight==`number`?i.lineHeight:1.2,n=Math.max(1,t*i.fontSize),r=Math.max(1,Math.floor(e/n));return[`max-height: ${e}px`,`overflow: hidden`,`display: -webkit-box`,`-webkit-box-orient: vertical`,`-webkit-line-clamp: ${r}`,`line-clamp: ${r}`]})(),u=e=>`\n background-image: ${e};\n background-size: 100% 100%;\n background-repeat: repeat;\n -webkit-background-clip: text;\n -moz-background-clip: text;\n background-clip: text;\n -webkit-text-fill-color: transparent;\n color: transparent\n `.trim(),d=`color: ${n||i.fill}`,f=``;s&&i.strokeWidth?(d=`color: ${n||i.fill}; ${u(i.stroke)}`,f=`-webkit-text-stroke: ${i.strokeWidth}px transparent`):o&&(d=u(i.fill));let p=[`white-space: pre-wrap`,`word-break: break-word`,`width: ${Math.round(i.width||100)}px`,...l,d,`font-size: ${i.fontSize}px`,`font-family: '${a}'`,`text-align: ${i.align}`,`text-transform: ${i.textTransform}`,i.textDecoration?`text-decoration: ${i.textDecoration}; text-decoration-color: ${n||i.fill}; text-decoration-layer: over`:``,i.lineHeight?`line-height: ${i.lineHeight}`:``,i.letterSpacing?`letter-spacing: ${i.letterSpacing*i.fontSize}px`:``,i.fontStyle?`font-style: ${i.fontStyle}`:``,i.fontWeight?`font-weight: ${i.fontWeight}`:``,f||(i.strokeWidth?`-webkit-text-stroke: ${i.strokeWidth}px ${i.stroke}`:``),i.strokeWidth&&!s?`paint-order: stroke fill`:``].filter(Boolean).join(`; `);if(i.curveEnabled&&!r){let t=Zc(e),r=Math.round(i.width||100),c=Yc(r,t,i.curvePower,i.fontSize),l=J(i.text),u={fontWeight:i.fontWeight||`normal`,fontStyle:i.fontStyle||`normal`,fill:n||i.fill||`black`},d=$c(l,u),f=$c(l,u,{omitColors:!0}),p=`curve-${i.id||`temp`}`,m=i.strokeWidth&&(s||o&&!s),h=`<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${t}" overflow="visible">\n <defs>\n <path id="${p}" d="${c}" fill="none" />`;if(o){let e=`curve-fill-grad-${i.id||`temp`}`;h+=Xc(i.fill,e,r,t)}if(s&&i.strokeWidth){let e=`curve-stroke-grad-${i.id||`temp`}`;h+=Xc(i.stroke,e,r,t)}if(h+=`</defs>`,m){let e=`\n font-family="'${a}'"\n font-size="${i.fontSize}"\n font-weight="${i.fontWeight}"\n font-style="${i.fontStyle}"\n text-anchor="middle"\n dominant-baseline="central"\n letter-spacing="${i.letterSpacing*i.fontSize}px"${i.textDecoration?` text-decoration="${i.textDecoration}"`:``}`,t=s?`url(#curve-stroke-grad-${i.id||`temp`})`:i.stroke;h+=`\n <text ${e} fill="${t}" stroke="${t}" stroke-width="${i.strokeWidth}">\n <textPath href="#${p}" startOffset="50%">${f}</textPath>\n </text>`,h+=`\n <text ${e} fill="${o?`url(#curve-fill-grad-${i.id||`temp`})`:n}">\n <textPath href="#${p}" startOffset="50%">${d}</textPath>\n </text>`}else{let e=o?`url(#curve-fill-grad-${i.id||`temp`})`:n,t=s?`url(#curve-stroke-grad-${i.id||`temp`})`:i.stroke;h+=`\n <text\n font-family="'${a}'"\n font-size="${i.fontSize}"\n font-weight="${i.fontWeight}"\n font-style="${i.fontStyle}"\n fill="${e}"\n text-anchor="middle"\n dominant-baseline="central"\n letter-spacing="${i.letterSpacing*i.fontSize}px"${i.textDecoration?` text-decoration="${i.textDecoration}"`:``}${i.strokeWidth?` stroke="${t}" stroke-width="${i.strokeWidth}" paint-order="stroke fill"`:``}>\n <textPath href="#${p}" startOffset="50%">${d}</textPath>\n </text>`}return h+=`</svg>`,h}if(i.strokeWidth&&(s||o&&!s)&&!r){let e=gc(i.text).replace(/\n/g,`<br/>`),t=Math.round(i.width||100),r=[`white-space: pre-wrap`,`word-break: break-word`,`width: ${t}px`,...l,`font-size: ${i.fontSize}px`,`font-family: '${a}'`,`text-align: ${i.align}`,`text-transform: ${i.textTransform}`,i.textDecoration?`text-decoration: ${i.textDecoration}; text-decoration-color: ${n||i.fill}; text-decoration-layer: over`:``,i.lineHeight?`line-height: ${i.lineHeight}`:``,i.letterSpacing?`letter-spacing: ${i.letterSpacing*i.fontSize}px`:``,i.fontStyle?`font-style: ${i.fontStyle}`:``,i.fontWeight?`font-weight: ${i.fontWeight}`:``].filter(Boolean).join(`; `),c;c=s?`${r}; ${u(i.stroke)}; -webkit-text-stroke: ${i.strokeWidth}px transparent`:`${r}; color: transparent; -webkit-text-stroke: ${i.strokeWidth}px ${i.stroke}`;let d=`${r}; ${o?u(i.fill):`color: ${n||i.fill}`}`,f=``;if(o||s){let e=[];s&&i.strokeWidth&&e.push(`.stroke-layer li, .stroke-layer li::before { ${u(i.stroke)}; }`),o&&e.push(`.fill-layer li, .fill-layer li::before { ${u(i.fill)}; }`),e.length&&(f=`<style>${e.join(`
30
- `)}</style>`)}return`\n <div style="position: relative; width: ${t}px;">\n <div class="stroke-layer" style="${c}; position: absolute; top: 0; left: 0; pointer-events: none;" aria-hidden="true">${e}</div>\n <div class="fill-layer" style="${d}; position: relative;" contentEditable dir="${Jc(mc(i.text))}">${e}</div>\n </div>\n ${f}\n `}let m=``;return o&&!s&&(m=`<style>\n li, li::before {\n ${u(i.fill)};\n }\n </style>`),`<div style="${p}" contentEditable dir="${Jc(mc(i.text))}">${gc(i.text).replace(/\n/g,`</br>`)}</div>${m}`}function tl({fontFamily:e,fontSize:t,lineHeight:n}){if(typeof n==`number`)return n;let r=document.createElement(`div`);r.style.fontFamily=e,r.style.fontSize=t+`px`,r.style.lineHeight=n,r.innerText=`Test text`,document.body.appendChild(r);let i=r.offsetHeight;return document.body.removeChild(r),i/t}var nl={warm:e=>t=>{let n=t.data;e=Math.max(0,Math.min(1,e));for(let t=0;t<n.length;t+=4)n[t]=Math.min(n[t]+30*e,255),n[t+1]=Math.min(n[t+1]+15*e,255);return t},cold:e=>t=>{let n=t.data;e=Math.max(0,Math.min(1,e));for(let t=0;t<n.length;t+=4)n[t]=Math.min(n[t]-15*e,255),n[t+1]=Math.min(n[t+1]-10*e,255),n[t+2]=Math.min(n[t+2]+15*e,255);return t},natural:e=>t=>{let n=t.data;e=Math.max(0,Math.min(1,e));for(let t=0;t<n.length;t+=4){n[t]=Math.min(n[t]*(1+.1*e),255),n[t+1]=Math.min(n[t+1]*(1+.1*e),255),n[t+2]=Math.min(n[t+2]*(1+.1*e),255);let r=(n[t]+n[t+1]+n[t+2])/3;n[t]=Math.min((n[t]-r)*(1+.2*e)+r,255),n[t+1]=Math.min((n[t+1]-r)*(1+.2*e)+r,255),n[t+2]=Math.min((n[t+2]-r)*(1+.2*e)+r,255)}return t},temperature:e=>t=>{let n=t.data;e=Math.max(-1,Math.min(1,e));for(let t=0;t<n.length;t+=4){let r=n[t],i=(n[t+1],n[t+2]);n[t]=Math.min(Math.max(r+15*e,0),255),n[t+2]=Math.min(Math.max(i-15*e,0),255)}return t},contrast:e=>t=>{let n=t.data,r=100*(e=Math.max(-1,Math.min(1,e))),i=259*(r+255)/(255*(259-r));for(let e=0;e<n.length;e+=4)n[e]=Math.min(Math.max(i*(n[e]-128)+128,0),255),n[e+1]=Math.min(Math.max(i*(n[e+1]-128)+128,0),255),n[e+2]=Math.min(Math.max(i*(n[e+2]-128)+128,0),255);return t},shadows:e=>t=>{let n=t.data;e=Math.max(-1,Math.min(1,e));for(let t=0;t<n.length;t+=4){let r=(n[t]+n[t+1]+n[t+2])/3;if(r<128){let i=1+e*(1-r/128)*2;n[t]=Math.min(Math.max(n[t]*i,0),255),n[t+1]=Math.min(Math.max(n[t+1]*i,0),255),n[t+2]=Math.min(Math.max(n[t+2]*i,0),255)}}return t},white:e=>t=>{let n=t.data;e=Math.max(-1,Math.min(1,e));for(let t=0;t<n.length;t+=4){let r=n[t],i=n[t+1],a=n[t+2],o=(r+i+a)/3;if(o>128){let s=1+e*((o-128)/127);n[t]=Math.min(Math.max(r*s,0),255),n[t+1]=Math.min(Math.max(i*s,0),255),n[t+2]=Math.min(Math.max(a*s,0),255)}}return t},black:e=>t=>{let n=t.data;e=Math.max(-1,Math.min(1,e));for(let t=0;t<n.length;t+=4){let r=n[t],i=n[t+1],a=n[t+2],o=(r+i+a)/3;if(o<128){let s=1+e*((128-o)/128);n[t]=Math.min(Math.max(r*s,0),255),n[t+1]=Math.min(Math.max(i*s,0),255),n[t+2]=Math.min(Math.max(a*s,0),255)}}return t},vibrance:e=>t=>{let n=t.data;e=Math.max(-1,Math.min(1,e));for(let t=0;t<n.length;t+=4){let r=n[t],i=n[t+1],a=n[t+2],o=Math.max(r,i,a),s=e<0?(1-(o===0?0:(o-(r+i+a)/3)/o))*e*1.5:.5*e;n[t]=Math.min(Math.max(r-(o-r)*s,0),255),n[t+1]=Math.min(Math.max(i-(o-i)*s,0),255),n[t+2]=Math.min(Math.max(a-(o-a)*s,0),255)}return t},saturation:e=>t=>{let n=t.data;e=Math.max(-1,Math.min(1,e));for(let t=0;t<n.length;t+=4){let r=n[t],i=n[t+1],a=n[t+2],o=.2126*r+.7152*i+.0722*a;n[t]=Math.min(Math.max(o+(r-o)*(1+e),0),255),n[t+1]=Math.min(Math.max(o+(i-o)*(1+e),0),255),n[t+2]=Math.min(Math.max(o+(a-o)*(1+e),0),255)}return t}};function rl(e,t){var n;let r={filters:[]},i={};t.brightnessEnabled&&(r.filters.push(a.Filters.Brighten),r.brightness=t.brightness),t.blurEnabled&&(r.filters.push(a.Filters.Blur),r.blurRadius=t.blurRadius,t.type===`text`&&t.lineHeight<1&&(i.offset=t.fontSize)),t.sepiaEnabled&&r.filters.push(a.Filters.Sepia),t.grayscaleEnabled&&r.filters.push(a.Filters.Grayscale),t.filters.forEach((e,t)=>{let n=nl[t];n&&r.filters.push(n(e.intensity))}),e.setAttrs(r),r.filters.length?e.cache(Object.assign(Object.assign({},i),{pixelRatio:t.store._elementsPixelRatio})):e.clearCache(),(n=e.getLayer())==null||n.batchDraw()}var il=()=>`ontouchstart`in window||navigator.maxTouchPoints>0,al=`warn`;function ol(e){al=e}function sl(){return al}var cl;(function(e){e.afterCreate=`afterCreate`,e.afterAttach=`afterAttach`,e.afterCreationFinalization=`afterCreationFinalization`,e.beforeDetach=`beforeDetach`,e.beforeDestroy=`beforeDestroy`})(cl||={});var ll=function(e,t){return ll=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ll(e,t)};function ul(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);ll(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var dl=function(){return dl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},dl.apply(this,arguments)};function fl(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function pl(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function ml(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function hl(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function gl(e){return xu(e,1),Y(e).type}function _l(e,t){return xu(e,1),nd(t,2),Y(e).onSnapshot(t)}function vl(e,t){xu(e,1),td(t,function(e){return typeof e==`object`},`object or array`,2),Y(e).applyPatches(Iu(t))}function yl(e,t){return xu(e,1),Y(e).applySnapshot(t)}function bl(e,t){t===void 0&&(t=!0),xu(e,1);var n=Y(e);return t?n.snapshot:Vu(n.type.getSnapshot(n,!1))}function xl(e,t){t===void 0&&(t=1),xu(e,1),rd(t,2,0);for(var n=t,r=Y(e).parent;r;){if(--n===0)return r.storedValue;r=r.parent}throw new X(`Failed to find the parent of ${Y(e)} at depth ${t}`)}function Sl(e,t){xu(e,1),ql(t,2);for(var n=Y(e).parent;n;){if(t.is(n.storedValue))return!0;n=n.parent}return!1}function Cl(e,t){xu(e,1),ql(t,2);for(var n=Y(e).parent;n;){if(t.is(n.storedValue))return n.storedValue;n=n.parent}throw new X(`Failed to find the parent of ${Y(e)} of a given type`)}function wl(e){return xu(e,1),Y(e).root.storedValue}function Tl(e){return xu(e,1),Y(e).path}function El(e,t){xu(e,1),id(t,2);var n=wu(Y(e),t);return n?n.value:void 0}function Dl(e){return xu(e,1),Y(e).identifier}function Ol(e){return xu(e,1),Y(e).detach(),e}function kl(e){xu(e,1);var t=Y(e);t.isRoot?t.die():t.parent.removeChild(t.subpath)}function Al(e){return xu(e,1),Y(e).observableIsAlive}function jl(e){return e}var Ml=function(){function e(e,t,n,r){Object.defineProperty(this,`type`,{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,`environment`,{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,`_escapedSubpath`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`_subpath`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`_subpathUponDeath`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`_pathUponDeath`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`storedValue`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`aliveAtom`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`_state`,{enumerable:!0,configurable:!0,writable:!0,value:yu.INITIALIZING}),Object.defineProperty(this,`_hookSubscribers`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`_parent`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`pathAtom`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=r,this.baseSetParent(t,n)}return Object.defineProperty(e.prototype,`subpath`,{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`subpathUponDeath`,{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`pathUponDeath`,{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`value`,{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`state`,{get:function(){return this._state},set:function(e){var t=this.isAlive;this._state=e;var n=this.isAlive;this.aliveAtom&&t!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`fireInternalHook`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._hookSubscribers&&this._hookSubscribers.emit(e,this,e)}}),Object.defineProperty(e.prototype,`registerHook`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._hookSubscribers||=new Ju,this._hookSubscribers.register(e,t)}}),Object.defineProperty(e.prototype,`parent`,{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`getReconciliationType`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,`baseSetParent`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._parent=e,this._subpath=t,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,`path`,{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`getEscapedPath`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e&&(this.pathAtom||=Ie(`path`),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?ld(this._subpath):``),this.parent.getEscapedPath(e)+`/`+this._escapedSubpath):``}}),Object.defineProperty(e.prototype,`isRoot`,{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`isAlive`,{get:function(){return this.state!==yu.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`isDetaching`,{get:function(){return this.state===yu.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`observableIsAlive`,{get:function(){return this.aliveAtom||=Ie(`alive`),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`baseFinalizeCreation`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(ed()&&!this.isAlive)throw new X(`assertion failed: cannot finalize the creation of a node that is already dead`);if(this.state===yu.CREATED){if(this.parent){if(this.parent.state!==yu.FINALIZED)return;this.fireHook(cl.afterAttach)}this.state=yu.FINALIZED,e&&e()}}}),Object.defineProperty(e.prototype,`baseFinalizeDeath`,{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,``),this.state=yu.DEAD}}),Object.defineProperty(e.prototype,`baseAboutToDie`,{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(cl.beforeDestroy)}}),e}(),Nl=function(e){ul(t,e);function t(t,n,r,i,a){var o=e.call(this,t,n,r,i)||this;try{o.storedValue=t.createNewInstance(a)}catch(e){throw o.state=yu.DEAD,e}return o.state=yu.CREATED,o.finalizeCreation(),o}return Object.defineProperty(t.prototype,`root`,{get:function(){if(!this.parent)throw new X(`This scalar node is not part of a tree`);return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`setParent`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.parent!==e,r=this.subpath!==t;if(!(!n&&!r)){if(ed()){if(!t)throw new X(`assertion failed: subpath expected`);if(!e)throw new X(`assertion failed: parent expected`);if(n)throw new X(`assertion failed: scalar nodes cannot change their parent`)}this.environment=void 0,this.baseSetParent(this.parent,t)}}}),Object.defineProperty(t.prototype,`snapshot`,{get:function(){return Vu(this.getSnapshot())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`getSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,`toString`,{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=(this.isAlive?this.path:this.pathUponDeath)||`<root>`;return`${this.type.name}@${e}${this.isAlive?``:` [dead]`}`}}),Object.defineProperty(t.prototype,`die`,{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===yu.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,`finalizeCreation`,{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(t.prototype,`aboutToDie`,{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(t.prototype,`finalizeDeath`,{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,`fireHook`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.fireInternalHook(e)}}),t}(Ml);Nl.prototype.die=H(Nl.prototype.die);var Pl=1,Fl;(function(e){e[e.UNINITIALIZED=0]=`UNINITIALIZED`,e[e.CREATING=1]=`CREATING`,e[e.CREATED=2]=`CREATED`})(Fl||={});var Il;(function(e){e.Dispose=`dispose`,e.Patch=`patch`,e.Snapshot=`snapshot`})(Il||={});var Ll={onError:function(e){throw e}},Rl=function(e){ul(t,e);function t(t,n,r,i,a){var o=e.call(this,t,n,r,i)||this;if(Object.defineProperty(o,`nodeId`,{enumerable:!0,configurable:!0,writable:!0,value:++Pl}),Object.defineProperty(o,`identifierAttribute`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,`identifier`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,`unnormalizedIdentifier`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,`identifierCache`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,`isProtectionEnabled`,{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(o,`middlewares`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,`hasSnapshotPostProcessor`,{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,`_applyPatches`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,`_applySnapshot`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,`_autoUnbox`,{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(o,`_isRunningAction`,{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,`_hasSnapshotReaction`,{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,`_observableInstanceState`,{enumerable:!0,configurable:!0,writable:!0,value:Fl.UNINITIALIZED}),Object.defineProperty(o,`_childNodes`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,`_initialSnapshot`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,`_cachedInitialSnapshot`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,`_cachedInitialSnapshotCreated`,{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,`_snapshotComputed`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,`_snapshotUponDeath`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,`_internalEvents`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),o._snapshotComputed=Vt(function(){return Vu(o.getSnapshot())}),o.unbox=o.unbox.bind(o),o._initialSnapshot=Vu(a),o.identifierAttribute=t.identifierAttribute,n||(o.identifierCache=new hu),o._childNodes=t.initializeChildNodes(o,o._initialSnapshot),o.identifier=null,o.unnormalizedIdentifier=null,o.identifierAttribute&&o._initialSnapshot){var s=o._initialSnapshot[o.identifierAttribute];if(s===void 0){var c=o._childNodes[o.identifierAttribute];c&&(s=c.value)}if(typeof s!=`string`&&typeof s!=`number`)throw new X(`Instance identifier '${o.identifierAttribute}' for type '${o.type.name}' must be a string or a number`);o.identifier=Nf(s),o.unnormalizedIdentifier=s}return n?n.root.identifierCache.addNodeToCache(o):o.identifierCache.addNodeToCache(o),o}return Object.defineProperty(t.prototype,`applyPatches`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.createObservableInstanceIfNeeded(),this._applyPatches(e)}}),Object.defineProperty(t.prototype,`applySnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.createObservableInstanceIfNeeded(),this._applySnapshot(e)}}),Object.defineProperty(t.prototype,`createObservableInstanceIfNeeded`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){e===void 0&&(e=!0),this._observableInstanceState===Fl.UNINITIALIZED&&this.createObservableInstance(e)}}),Object.defineProperty(t.prototype,`createObservableInstance`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,n,r,i;if(e===void 0&&(e=!0),ed()&&this.state!==yu.INITIALIZING)throw new X(`assertion failed: the creation of the observable instance must be done on the initializing phase`);this._observableInstanceState=Fl.CREATING;for(var a=[],o=this.parent;o&&o._observableInstanceState===Fl.UNINITIALIZED;)a.unshift(o),o=o.parent;try{for(var s=pl(a),c=s.next();!c.done;c=s.next()){var l=c.value;l.createObservableInstanceIfNeeded(!1)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}var u=this.type;try{this.storedValue=u.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,u.finalizeNewInstance(this,this.storedValue)}catch(e){throw this.state=yu.DEAD,e}finally{this._isRunningAction=!1}if(this._observableInstanceState=Fl.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=ku,this.state=yu.CREATED,e){this.fireHook(cl.afterCreate),this.finalizeCreation();try{for(var d=pl(a.reverse()),f=d.next();!f.done;f=d.next()){var l=f.value;l.fireHook(cl.afterCreate),l.finalizeCreation()}}catch(e){r={error:e}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}}}}),Object.defineProperty(t.prototype,`root`,{get:function(){var e=this.parent;return e?e.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`clearParent`,{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(cl.beforeDetach);var e=this.state;this.state=yu.DETACHING;var t=this.root,n=t.environment,r=t.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,``),this.environment=n,this.identifierCache=r}finally{this.state=e}}}}),Object.defineProperty(t.prototype,`setParent`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=e!==this.parent,r=t!==this.subpath;if(!(!n&&!r)){if(ed()){if(!t)throw new X(`assertion failed: subpath expected`);if(!e)throw new X(`assertion failed: new parent expected`);if(this.parent&&n)throw new X(`A node cannot exists twice in the state tree. Failed to add ${this} to path '${e.path}/${t}'.`);if(!this.parent&&e.root===this)throw new X(`A state tree is not allowed to contain itself. Cannot assign ${this} to path '${e.path}/${t}'`);if(!this.parent&&this.environment&&this.environment!==e.root.environment)throw new X(`A state tree cannot be made part of another state tree as long as their environments are different.`)}n?(this.environment=void 0,e.root.identifierCache.mergeCache(this),this.baseSetParent(e,t),this.fireHook(cl.afterAttach)):r&&this.baseSetParent(this.parent,t)}}}),Object.defineProperty(t.prototype,`fireHook`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this.fireInternalHook(e);var n=this.storedValue&&typeof this.storedValue==`object`&&this.storedValue[e];typeof n==`function`&&(Zn?Zn(function(){n.apply(t.storedValue)}):n.apply(this.storedValue))}}),Object.defineProperty(t.prototype,`snapshot`,{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`getSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===Fl.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(t.prototype,`_getActualSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,`_getCachedInitialSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var e=this.type,t=this._childNodes,n=this._initialSnapshot;this._cachedInitialSnapshot=e.processInitialSnapshot(t,n),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(t.prototype,`isRunningAction`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(t.prototype,`assertAlive`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=sl();if(!this.isAlive&&t!==`ignore`){var n=this._getAssertAliveError(e);switch(t){case`error`:throw new X(n);case`warn`:Qu(n)}}}}),Object.defineProperty(t.prototype,`_getAssertAliveError`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getEscapedPath(!1)||this.pathUponDeath||``,n=e.subpath&&ld(e.subpath)||``,r=e.actionContext||Xl();r&&r.type!==`action`&&r.parentActionEvent&&(r=r.parentActionEvent);var i=``;return r&&r.name!=null&&(i=`${r&&r.context&&Tl(r.context)||t}.${r.name}()`),`You are trying to read or write to an object that is no longer part of a state tree. (Object type: '${this.type.name}', Path upon death: '${t}', Subpath: '${n}', Action: '${i}'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.`}}),Object.defineProperty(t.prototype,`getChildNode`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.assertAlive({subpath:e}),this._autoUnbox=!1;try{return this._observableInstanceState===Fl.CREATED?this.type.getChildNode(this,e):this._childNodes[e]}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,`getChildren`,{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(ku),this._autoUnbox=!1;try{return this._observableInstanceState===Fl.CREATED?this.type.getChildren(this):Eu(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,`getChildType`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.type.getChildType(e)}}),Object.defineProperty(t.prototype,`isProtected`,{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`assertWritable`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.assertAlive(e),!this.isRunningAction()&&this.isProtected)throw new X(`Cannot modify '${this}', the object is protected and can only be modified by using an action.`)}}),Object.defineProperty(t.prototype,`removeChild`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.type.removeChild(this,e)}}),Object.defineProperty(t.prototype,`unbox`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e&&(this.assertAlive({subpath:e.subpath||e.subpathUponDeath}),this._autoUnbox?e.value:e)}}),Object.defineProperty(t.prototype,`toString`,{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=(this.isAlive?this.path:this.pathUponDeath)||`<root>`,t=this.identifier?`(id: ${this.identifier})`:``;return`${this.type.name}@${e}${t}${this.isAlive?``:` [dead]`}`}}),Object.defineProperty(t.prototype,`finalizeCreation`,{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this.baseFinalizeCreation(function(){var t,n;try{for(var r=pl(e.getChildren()),i=r.next();!i.done;i=r.next())i.value.finalizeCreation()}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}e.fireInternalHook(cl.afterCreationFinalization)})}}),Object.defineProperty(t.prototype,`detach`,{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new X(`Error while detaching, node is not alive.`);this.clearParent()}}),Object.defineProperty(t.prototype,`preboot`,{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this._applyPatches=eu(this.storedValue,`@APPLY_PATCHES`,function(t){t.forEach(function(t){if(!t.path){e.type.applySnapshot(e,t.value);return}var n=fd(t.path);Tu(e,n.slice(0,-1)).applyPatchLocally(n[n.length-1],t)})}),this._applySnapshot=eu(this.storedValue,`@APPLY_SNAPSHOT`,function(t){if(t!==e.snapshot)return e.type.applySnapshot(e,t)}),Gu(this.storedValue,`$treenode`,this),Gu(this.storedValue,`toJSON`,Cu)}}),Object.defineProperty(t.prototype,`die`,{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===yu.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,`aboutToDie`,{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==Fl.UNINITIALIZED&&(this.getChildren().forEach(function(e){e.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(Il.Dispose),this._internalEventsClear(Il.Dispose))}}),Object.defineProperty(t.prototype,`finalizeDeath`,{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(e){e.finalizeDeath()}),this.root.identifierCache.notifyDied(this),this._snapshotUponDeath=this.snapshot,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,`onSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._addSnapshotReaction(),this._internalEventsRegister(Il.Snapshot,e)}}),Object.defineProperty(t.prototype,`emitSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._internalEventsEmit(Il.Snapshot,e)}}),Object.defineProperty(t.prototype,`onPatch`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._internalEventsRegister(Il.Patch,e)}}),Object.defineProperty(t.prototype,`emitPatch`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._internalEventsHasSubscribers(Il.Patch)){var n=ml(ad(Lu({},e,{path:t.path.substr(this.path.length)+(e.path?`/`+e.path:``)})),2),r=n[0],i=n[1];this._internalEventsEmit(Il.Patch,r,i)}this.parent&&this.parent.emitPatch(e,t)}}),Object.defineProperty(t.prototype,`hasDisposer`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._internalEventsHas(Il.Dispose,e)}}),Object.defineProperty(t.prototype,`addDisposer`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!this.hasDisposer(e)){this._internalEventsRegister(Il.Dispose,e,!0);return}throw new X(`cannot add a disposer when it is already registered for execution`)}}),Object.defineProperty(t.prototype,`removeDisposer`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!this._internalEventsHas(Il.Dispose,e))throw new X(`cannot remove a disposer which was never registered for execution`);this._internalEventsUnregister(Il.Dispose,e)}}),Object.defineProperty(t.prototype,`removeMiddleware`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.middlewares){var t=this.middlewares.indexOf(e);t>=0&&this.middlewares.splice(t,1)}}}),Object.defineProperty(t.prototype,`addMiddleWare`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;t===void 0&&(t=!0);var r={handler:e,includeHooks:t};return this.middlewares?this.middlewares.push(r):this.middlewares=[r],function(){n.removeMiddleware(r)}}}),Object.defineProperty(t.prototype,`applyPatchLocally`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.assertWritable({subpath:e}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,e,t)}}),Object.defineProperty(t.prototype,`_addSnapshotReaction`,{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(!this._hasSnapshotReaction){var t=nr(function(){return e.snapshot},function(t){return e.emitSnapshot(t)},Ll);this.addDisposer(t),this._hasSnapshotReaction=!0}}}),Object.defineProperty(t.prototype,`_internalEventsHasSubscribers`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!this._internalEvents&&this._internalEvents.hasSubscribers(e)}}),Object.defineProperty(t.prototype,`_internalEventsRegister`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){return n===void 0&&(n=!1),this._internalEvents||=new Ju,this._internalEvents.register(e,t,n)}}),Object.defineProperty(t.prototype,`_internalEventsHas`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return!!this._internalEvents&&this._internalEvents.has(e,t)}}),Object.defineProperty(t.prototype,`_internalEventsUnregister`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._internalEvents&&this._internalEvents.unregister(e,t)}}),Object.defineProperty(t.prototype,`_internalEventsEmit`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this._internalEvents&&(t=this._internalEvents).emit.apply(t,hl([e],ml(n),!1))}}),Object.defineProperty(t.prototype,`_internalEventsClear`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._internalEvents&&this._internalEvents.clear(e)}}),Object.defineProperty(t.prototype,`_internalEventsClearAll`,{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),t}(Ml);Rl.prototype.createObservableInstance=H(Rl.prototype.createObservableInstance),Rl.prototype.detach=H(Rl.prototype.detach),Rl.prototype.die=H(Rl.prototype.die);var zl,Bl;(function(e){e[e.String=1]=`String`,e[e.Number=2]=`Number`,e[e.Boolean=4]=`Boolean`,e[e.Date=8]=`Date`,e[e.Literal=16]=`Literal`,e[e.Array=32]=`Array`,e[e.Map=64]=`Map`,e[e.Object=128]=`Object`,e[e.Frozen=256]=`Frozen`,e[e.Optional=512]=`Optional`,e[e.Reference=1024]=`Reference`,e[e.Identifier=2048]=`Identifier`,e[e.Late=4096]=`Late`,e[e.Refinement=8192]=`Refinement`,e[e.Union=16384]=`Union`,e[e.Null=32768]=`Null`,e[e.Undefined=65536]=`Undefined`,e[e.Integer=131072]=`Integer`,e[e.Custom=262144]=`Custom`,e[e.SnapshotProcessor=524288]=`SnapshotProcessor`,e[e.Lazy=1048576]=`Lazy`,e[e.Finite=2097152]=`Finite`,e[e.Float=4194304]=`Float`})(Bl||={});var Vl=`cannotDetermine`,Hl=Symbol(`$type`),Ul=function(){function e(e){Object.defineProperty(this,zl,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`C`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`S`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`T`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`N`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`isType`,{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,`name`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e}return Object.defineProperty(e.prototype,`create`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return du(this,e),this.instantiate(null,``,t,e).value}}),Object.defineProperty(e.prototype,`getSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){throw new X(`unimplemented method`)}}),Object.defineProperty(e.prototype,`isAssignableFrom`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e===this}}),Object.defineProperty(e.prototype,`validate`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(Su(e)){var n=gl(e);return this.isAssignableFrom(n)?cu():lu(t,e)}return this.isValidSnapshot(e,t)}}),Object.defineProperty(e.prototype,`is`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.validate(e,[{path:``,type:this}]).length===0}}),Object.defineProperty(e.prototype,`Type`,{get:function(){throw new X("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`TypeWithoutSTN`,{get:function(){throw new X("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`SnapshotType`,{get:function(){throw new X("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`CreationType`,{get:function(){throw new X("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e}();zl=Hl,Ul.prototype.create=H(Ul.prototype.create);var Wl=function(e){ul(t,e);function t(t){var n=e.call(this,t)||this;return Object.defineProperty(n,`identifierAttribute`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(t.prototype,`create`,{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return t===void 0&&(t=this.getDefaultSnapshot()),e.prototype.create.call(this,t,n)}}),Object.defineProperty(t.prototype,`getValue`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.createObservableInstanceIfNeeded(),e.storedValue}}),Object.defineProperty(t.prototype,`isMatchingSnapshotId`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return!e.identifierAttribute||e.identifier===Nf(t[e.identifierAttribute])}}),Object.defineProperty(t.prototype,`tryToReconcileNode`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return e.isDetaching?!1:e.snapshot===t||bu(t)&&Y(t)===e?!0:e.type===this&&zu(t)&&!bu(t)&&this.isMatchingSnapshotId(e,t)?(e.applySnapshot(t),!0):!1}}),Object.defineProperty(t.prototype,`reconcile`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){if(this.tryToReconcileNode(e,t))return e.setParent(n,r),e;if(e.die(),bu(t)&&this.isAssignableFrom(gl(t))){var i=Y(t);return i.setParent(n,r),i}return this.instantiate(n,r,void 0,t)}}),Object.defineProperty(t.prototype,`getSubTypes`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(Ul);Wl.prototype.create=H(Wl.prototype.create);var Gl=function(e){ul(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(t.prototype,`createNewInstance`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e}}),Object.defineProperty(t.prototype,`getValue`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.storedValue}}),Object.defineProperty(t.prototype,`getSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.storedValue}}),Object.defineProperty(t.prototype,`reconcile`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){if(!e.isDetaching&&e.type===this&&e.storedValue===t)return e;var i=this.instantiate(n,r,void 0,t);return e.die(),i}}),Object.defineProperty(t.prototype,`getSubTypes`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(Ul);function Kl(e){return typeof e==`object`&&e&&e.isType===!0}function ql(e,t){td(e,Kl,`mobx-state-tree type`,t)}(function(){function e(e,t){Object.defineProperty(this,`hooks`,{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,`call`,{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,`flowsPending`,{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,`running`,{enumerable:!0,configurable:!0,writable:!0,value:!0}),e&&e.onStart(t)}return Object.defineProperty(e.prototype,`finish`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.running&&(this.running=!1,this.hooks&&this.hooks.onFinish(this.call,e))}}),Object.defineProperty(e.prototype,`incFlowsPending`,{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending++}}),Object.defineProperty(e.prototype,`decFlowsPending`,{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending--}}),Object.defineProperty(e.prototype,`hasFlowsPending`,{get:function(){return this.flowsPending>0},enumerable:!1,configurable:!0}),e})();var Jl=1,Yl;function Xl(){return Yl}function Zl(){return Jl++}function Ql(e,t){var n=Y(e.context);e.type===`action`&&n.assertAlive({actionContext:e});var r=n._isRunningAction;n._isRunningAction=!0;var i=Yl;Yl=e;try{return nu(n,e,t)}finally{Yl=i,n._isRunningAction=r}}function $l(e){if(e)return e.type===`action`?e:e.parentActionEvent}function eu(e,t,n){var r=function(){var r=Zl(),i=Yl,a=$l(i);return Ql({type:`action`,name:t,id:r,args:Yu(arguments),context:e,tree:wl(e),rootId:i?i.rootId:r,parentId:i?i.id:0,allParentIds:i?hl(hl([],ml(i.allParentIds),!1),[i.id],!1):[],parentEvent:i,parentActionEvent:a},n)};return r._isMSTAction=!0,r._isFlowAction=n._isFlowAction,r}var tu=function(){function e(e,t){Object.defineProperty(this,`arrayIndex`,{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,`inArrayIndex`,{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,`middlewares`,{enumerable:!0,configurable:!0,writable:!0,value:[]}),t.$mst_middleware&&this.middlewares.push(t.$mst_middleware);for(var n=e;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(e.prototype,`isEmpty`,{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`getNextMiddleware`,{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.middlewares[this.arrayIndex];if(e)return e[this.inArrayIndex++]||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}),e}();function nu(e,t,n){var r=new tu(e,n);if(r.isEmpty)return H(n).apply(null,t.args);var i=null;function a(e){var t=r.getNextMiddleware(),o=t&&t.handler;if(!o)return H(n).apply(null,e.args);if(!t.includeHooks&&cl[e.name])return a(e);var s=!1;function c(e,t){s=!0,i=a(e),t&&(i=t(i))}var l=!1;function u(e){l=!0,i=e}if(o(e,c,u),ed()){if(!s&&!l){var d=Y(e.tree);throw new X(`Neither the next() nor the abort() callback within the middleware ${o.name} for the action: "${e.name}" on the node: ${d.type.name} was invoked.`)}else if(s&&l){var d=Y(e.tree);throw new X(`The next() and abort() callback within the middleware ${o.name} for the action: "${e.name}" on the node: ${d.type.name} were invoked.`)}}return i}return a(t)}function ru(e){try{return JSON.stringify(e)}catch(e){return`<Unserializable: ${e}>`}}function iu(e){return typeof e==`function`?`<function${e.name?` `+e.name:``}>`:bu(e)?`<${e}>`:`\`${ru(e)}\``}function au(e){return e.length<280?e:`${e.substring(0,272)}......${e.substring(e.length-8)}`}function ou(e){var t=e.value,n=e.context[e.context.length-1].type,r=e.context.map(function(e){return e.path}).filter(function(e){return e.length>0}).join(`/`),i=r.length>0?`at path "/${r}" `:``,a=bu(t)?`value of type ${Y(t).type.name}:`:Bu(t)?`value`:`snapshot`,o=n&&bu(t)&&n.is(Y(t).snapshot);return`${i}${a} ${iu(t)} is not assignable ${n?`to type: \`${n.name}\``:``}`+(e.message?` (${e.message})`:``)+(n?Yd(n)||Bu(t)?`.`:`, expected an instance of \`${n.name}\` or a snapshot like \`${n.describe()}\` instead.`+(o?` (Note that a snapshot of the provided value is compatible with the targeted type)`:``):`.`)}function su(e,t,n){return e.concat([{path:t,type:n}])}function cu(){return Ou}function lu(e,t,n){return[{context:e,value:t,message:n}]}function uu(e){return e.reduce(function(e,t){return e.concat(t)},[])}function du(e,t){$u()&&fu(e,t)}function fu(e,t){var n=e.validate(t,[{path:``,type:e}]);if(n.length>0)throw new X(pu(e,t,n))}function pu(e,t,n){if(n.length!==0)return`Error while converting ${au(iu(t))} to \`${e.name}\`:
31
-
32
- `+n.map(ou).join(`
33
- `)}var mu=0,hu=function(){function e(){Object.defineProperty(this,`cacheId`,{enumerable:!0,configurable:!0,writable:!0,value:mu++}),Object.defineProperty(this,`cache`,{enumerable:!0,configurable:!0,writable:!0,value:z.map()}),Object.defineProperty(this,`lastCacheModificationPerId`,{enumerable:!0,configurable:!0,writable:!0,value:z.map()})}return Object.defineProperty(e.prototype,`updateLastCacheModificationPerId`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.lastCacheModificationPerId.get(e);this.lastCacheModificationPerId.set(e,t===void 0?1:t+1)}}),Object.defineProperty(e.prototype,`getLastCacheModificationPerId`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.lastCacheModificationPerId.get(e)||0;return`${this.cacheId}-${t}`}}),Object.defineProperty(e.prototype,`addNodeToCache`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(t===void 0&&(t=!0),e.identifierAttribute){var n=e.identifier;this.cache.has(n)||this.cache.set(n,z.array([],Au));var r=this.cache.get(n);if(r.indexOf(e)!==-1)throw new X(`Already registered`);r.push(e),t&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(e.prototype,`mergeCache`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;jr(e.identifierCache.cache).forEach(function(e){return e.forEach(function(e){t.addNodeToCache(e)})})}}),Object.defineProperty(e.prototype,`notifyDied`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.identifierAttribute){var t=e.identifier,n=this.cache.get(t);n&&(n.remove(e),n.length||this.cache.delete(t),this.updateLastCacheModificationPerId(e.identifier))}}}),Object.defineProperty(e.prototype,`splitCache`,{enumerable:!1,configurable:!0,writable:!0,value:function(t){var n=this,r=new e,i=t.path+`/`;return Mr(this.cache).forEach(function(e){for(var a=ml(e,2),o=a[0],s=a[1],c=!1,l=s.length-1;l>=0;l--){var u=s[l];(u===t||u.path.indexOf(i)===0)&&(r.addNodeToCache(u,!1),s.splice(l,1),s.length||n.cache.delete(o),c=!0)}c&&n.updateLastCacheModificationPerId(o)}),r}}),Object.defineProperty(e.prototype,`has`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.cache.get(t);return n?n.some(function(t){return e.isAssignableFrom(t.type)}):!1}}),Object.defineProperty(e.prototype,`resolve`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.cache.get(t);if(!n)return null;var r=n.filter(function(t){return e.isAssignableFrom(t.type)});switch(r.length){case 0:return null;case 1:return r[0];default:throw new X(`Cannot resolve a reference to type '${e.name}' with id: '${t}' unambigously, there are multiple candidates: ${r.map(function(e){return e.path}).join(`, `)}`)}}}),e}();function gu(e,t,n,r,i){var a=Su(i);if(a){if(a.parent)throw new X(`Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '${t?t.path:``}/${n}', but it lives already at '${a.path}'`);return t&&a.setParent(t,n),a}return new Rl(e,t,n,r,i)}function _u(e,t,n,r,i){return new Nl(e,t,n,r,i)}function vu(e){return e instanceof Nl||e instanceof Rl}var yu;(function(e){e[e.INITIALIZING=0]=`INITIALIZING`,e[e.CREATED=1]=`CREATED`,e[e.FINALIZED=2]=`FINALIZED`,e[e.DETACHING=3]=`DETACHING`,e[e.DEAD=4]=`DEAD`})(yu||={});function bu(e){return!!(e&&e.$treenode)}function xu(e,t){td(e,bu,`mobx-state-tree node`,t)}function Y(e){if(!bu(e))throw new X(`Value ${e} is no MST Node`);return e.$treenode}function Su(e){return e&&e.$treenode||null}function Cu(){return Y(this).snapshot}function wu(e,t,n){return n===void 0&&(n=!0),Tu(e,fd(t),n)}function Tu(e,t,n){n===void 0&&(n=!0);var r=e;try{for(var i=0;i<t.length;i++){var a=t[i];if(a===`..`){if(r=r.parent,r)continue}else if(a===`.`)continue;else if(r){if(r instanceof Nl){var o=r.value;bu(o)&&(r=Y(o))}if(r instanceof Rl&&r.getChildType(a)&&(r=r.getChildNode(a),r))continue}throw new X(`Could not resolve '${a}' in path '${dd(t.slice(0,i))||`/`}' while resolving '${dd(t)}'`)}}catch(e){if(!n)return;throw e}return r}function Eu(e){if(!e)return Ou;var t=Object.keys(e);if(!t.length)return Ou;var n=Array(t.length);return t.forEach(function(t,r){n[r]=e[t]}),n}var Du=Object.toString(),Ou=Object.freeze([]),ku=Object.freeze({}),Au=xn().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(Au);var X=function(e){ul(t,e);function t(t){return t===void 0&&(t=`Illegal state`),e.call(this,`[mobx-state-tree] ${t}`)||this}return t}(Error);function ju(e){return e}var Mu=Number.isInteger;function Nu(e){return Number(e)===e&&e%1!=0}function Pu(e){return Number.isFinite(e)}function Fu(e){return Array.isArray(e)||ui(e)}function Iu(e){return e?Fu(e)?e:[e]:Ou}function Lu(e){for(var t=[...arguments].slice(1),n=0;n<t.length;n++){var r=t[n];for(var i in r)e[i]=r[i]}return e}function Ru(e){if(typeof e!=`object`||!e)return!1;var t=Object.getPrototypeOf(e);return t==null?!0:t.constructor?.toString()===Du}function zu(e){return typeof e==`object`&&!!e&&!(e instanceof Date)&&!(e instanceof RegExp)}function Bu(e,t){return t===void 0&&(t=!0),e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||t&&e instanceof Date}function Vu(e){return ed()?Bu(e)||ui(e)?e:Object.freeze(e):e}function Hu(e){return ed()?(Vu(e),Ru(e)&&Object.keys(e).forEach(function(t){!Bu(e[t])&&!Object.isFrozen(e[t])&&Hu(e[t])}),e):e}function Uu(e){return typeof e!=`function`}function Wu(e,t,n){Oi(e)?Pr(e,t,n):Object.defineProperty(e,t,n)}function Gu(e,t,n){Wu(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Ku(e,t,n){Wu(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}var qu=function(){function e(){Object.defineProperty(this,`handlers`,{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,`hasSubscribers`,{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`register`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;return t===void 0&&(t=!1),t?this.handlers.unshift(e):this.handlers.push(e),function(){n.unregister(e)}}}),Object.defineProperty(e.prototype,`has`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.handlers.indexOf(e)>=0}}),Object.defineProperty(e.prototype,`unregister`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.handlers.indexOf(e);t>=0&&this.handlers.splice(t,1)}}),Object.defineProperty(e.prototype,`clear`,{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,`emit`,{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=[...arguments];this.handlers.slice().forEach(function(t){return t.apply(void 0,hl([],ml(e),!1))})}}),e}(),Ju=function(){function e(){Object.defineProperty(this,`eventHandlers`,{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,`hasSubscribers`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.eventHandlers&&this.eventHandlers[e];return!!t&&t.hasSubscribers}}),Object.defineProperty(e.prototype,`register`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){n===void 0&&(n=!1),this.eventHandlers||={};var r=this.eventHandlers[e];return r||=this.eventHandlers[e]=new qu,r.register(t,n)}}),Object.defineProperty(e.prototype,`has`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.eventHandlers&&this.eventHandlers[e];return!!n&&n.has(t)}}),Object.defineProperty(e.prototype,`unregister`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.eventHandlers&&this.eventHandlers[e];n&&n.unregister(t)}}),Object.defineProperty(e.prototype,`clear`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.eventHandlers&&delete this.eventHandlers[e]}}),Object.defineProperty(e.prototype,`clearAll`,{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(e.prototype,`emit`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this.eventHandlers&&this.eventHandlers[e];i&&(t=i).emit.apply(t,hl([],ml(n),!1))}}),e}();function Yu(e){for(var t=Array(e.length),n=0;n<e.length;n++)t[n]=e[n];return t}function Xu(e,t){return e.indexOf(t)===0}var Zu=function(e,t){ed()&&(Zu.ids&&!Zu.ids.hasOwnProperty(e)&&Qu(`Deprecation warning: `+t),Zu.ids&&(Zu.ids[e]=!0))};Zu.ids={};function Qu(e){console.warn(Error(`[mobx-state-tree] ${e}`))}function $u(){return ed()||typeof process<`u`&&{}.ENABLE_TYPE_CHECK===`true`}function ed(){return!1}function td(e,t,n,r){if(ed()&&!t(e))throw new X(`expected ${n} as argument ${Iu(r).join(` or `)}, got ${e} instead`)}function nd(e,t){td(e,function(e){return typeof e==`function`},`function`,t)}function rd(e,t,n,r){td(e,function(e){return typeof e==`number`},`number`,t),n!==void 0&&td(e,function(e){return e>=n},`number greater than ${n}`,t),r!==void 0&&td(e,function(e){return e<=r},`number lesser than ${r}`,t)}function id(e,t,n){n===void 0&&(n=!0),td(e,function(e){return typeof e==`string`},`string`,t),n||td(e,function(e){return e!==``},`not empty string`,t)}function ad(e){if(!(`oldValue`in e))throw new X("Patches without `oldValue` field cannot be inversed");return[od(e),sd(e)]}function od(e){switch(e.op){case`add`:return{op:`add`,path:e.path,value:e.value};case`remove`:return{op:`remove`,path:e.path};case`replace`:return{op:`replace`,path:e.path,value:e.value}}}function sd(e){switch(e.op){case`add`:return{op:`remove`,path:e.path};case`remove`:return{op:`add`,path:e.path,value:e.oldValue};case`replace`:return{op:`replace`,path:e.path,value:e.oldValue}}}function cd(e){return typeof e==`number`}function ld(e){return cd(e)===!0?``+e:e.indexOf(`/`)===-1&&e.indexOf(`~`)===-1?e:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function ud(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function dd(e){if(e.length===0)return``;var t=function(e){return e.map(ld).join(`/`)};return e[0]===`.`||e[0]===`..`?t(e):`/`+t(e)}function fd(e){var t=e.split(`/`).map(ud);if(!(e===``||e===`.`||e===`..`||Xu(e,`/`)||Xu(e,`./`)||Xu(e,`../`)))throw new X(`a json path must be either rooted, empty or relative, but got '${e}'`);return t[0]===``&&t.shift(),t}var pd=Symbol(`$preProcessorFailed`),md=function(e){ul(t,e);function t(t,n,r){var i=e.call(this,r||t.name)||this;return Object.defineProperty(i,`_subtype`,{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,`_processors`,{enumerable:!0,configurable:!0,writable:!0,value:n}),i}return Object.defineProperty(t.prototype,`flags`,{get:function(){return this._subtype.flags|Bl.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`describe`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return`snapshotProcessor(${this._subtype.describe()})`}}),Object.defineProperty(t.prototype,`preProcessSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._processors.preProcessor?this._processors.preProcessor.call(null,e):e}}),Object.defineProperty(t.prototype,`preProcessSnapshotSafe`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{return this.preProcessSnapshot(e)}catch{return pd}}}),Object.defineProperty(t.prototype,`postProcessSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._processors.postProcessor?this._processors.postProcessor.call(null,e,t.storedValue):e}}),Object.defineProperty(t.prototype,`_fixNode`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;hd(e.type,this,`create`),e instanceof Rl&&(e.hasSnapshotPostProcessor=!!this._processors.postProcessor);var n=e.getSnapshot;e.getSnapshot=function(){return t.postProcessSnapshot(n.call(e),e)},rf(this._subtype)||(e.getReconciliationType=function(){return t})}}),Object.defineProperty(t.prototype,`instantiate`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i=bu(r)?r:this.preProcessSnapshot(r),a=this._subtype.instantiate(e,t,n,i);return this._fixNode(a),a}}),Object.defineProperty(t.prototype,`reconcile`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i=this._subtype.reconcile(e,bu(t)?t:this.preProcessSnapshot(t),n,r);return i!==e&&this._fixNode(i),i}}),Object.defineProperty(t.prototype,`getSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){t===void 0&&(t=!0);var n=this._subtype.getSnapshot(e);return t?this.postProcessSnapshot(n,e):n}}),Object.defineProperty(t.prototype,`isValidSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.preProcessSnapshotSafe(e);return n===pd?lu(t,e,`Failed to preprocess value`):this._subtype.validate(n,t)}}),Object.defineProperty(t.prototype,`getSubTypes`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(t.prototype,`is`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Kl(e)?this._subtype:bu(e)?e:this.preProcessSnapshotSafe(e);return t===pd?!1:this._subtype.validate(t,[{path:``,type:this._subtype}]).length===0}}),Object.defineProperty(t.prototype,`isAssignableFrom`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._subtype.isAssignableFrom(e)}}),Object.defineProperty(t.prototype,`isMatchingSnapshotId`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!(this._subtype instanceof Wl))return!1;var n=this.preProcessSnapshot(t);return this._subtype.isMatchingSnapshotId(e,n)}}),t}(Ul);function hd(e,t){for(var n,r,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=pl(i),s=o.next();!s.done;s=o.next()){var c=s.value;e[c]=t[c].bind(t)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}function gd(e,t,n){if(ql(e,1),ed()){if(t.postProcessor&&typeof t.postProcessor!=`function`)throw new X(`postSnapshotProcessor must be a function`);if(t.preProcessor&&typeof t.preProcessor!=`function`)throw new X(`preSnapshotProcessor must be a function`)}return new md(e,t,n)}var _d=`Map.put can only be used to store complex values that have an identifier type attribute`;function vd(e,t){var n,r,i=e.getSubTypes();if(i===Vl)return!1;if(i){var a=Iu(i);try{for(var o=pl(a),s=o.next();!s.done;s=o.next()){var c=s.value;if(!vd(c,t))return!1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}return e instanceof Nd&&t.push(e),!0}var yd;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.YES=1]=`YES`,e[e.NO=2]=`NO`})(yd||={});var bd=function(e){ul(t,e);function t(t,n){return e.call(this,t,z.ref.enhancer,n)||this}return Object.defineProperty(t.prototype,`get`,{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.get.call(this,``+t)}}),Object.defineProperty(t.prototype,`has`,{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.has.call(this,``+t)}}),Object.defineProperty(t.prototype,`delete`,{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.delete.call(this,``+t)}}),Object.defineProperty(t.prototype,`set`,{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return e.prototype.set.call(this,``+t,n)}}),Object.defineProperty(t.prototype,`put`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!e)throw new X(`Map.put cannot be used to set empty values`);if(bu(e)){var t=Y(e);if(ed()&&!t.identifierAttribute||t.identifier===null)throw new X(_d);return this.set(t.identifier,e),e}else if(zu(e)){var n=Y(this),r=n.type;if(r.identifierMode!==yd.YES)throw new X(_d);var i=e[r.mapIdentifierAttribute];if(!Pf(i)){var a=this.put(r.getChildType().create(e,n.environment));return this.put(bl(a))}var o=Nf(i);return this.set(o,e),this.get(o)}else throw new X(`Map.put can only be used to store complex values`)}}),t}(mi),xd=function(e){ul(t,e);function t(t,n,r){r===void 0&&(r=[]);var i=e.call(this,t)||this;return Object.defineProperty(i,`_subType`,{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,`identifierMode`,{enumerable:!0,configurable:!0,writable:!0,value:yd.UNKNOWN}),Object.defineProperty(i,`mapIdentifierAttribute`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,`flags`,{enumerable:!0,configurable:!0,writable:!0,value:Bl.Map}),Object.defineProperty(i,`hookInitializers`,{enumerable:!0,configurable:!0,writable:!0,value:[]}),i._determineIdentifierMode(),i.hookInitializers=r,i}return Object.defineProperty(t.prototype,`hooks`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this.hookInitializers.length>0?this.hookInitializers.concat(e):[e];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,`instantiate`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return this._determineIdentifierMode(),gu(this,e,t,n,r)}}),Object.defineProperty(t.prototype,`_determineIdentifierMode`,{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===yd.UNKNOWN){var e=[];if(vd(this._subType,e)){var t=e.reduce(function(e,t){if(!t.identifierAttribute)return e;if(e&&e!==t.identifierAttribute)throw new X(`The objects in a map should all have the same identifier attribute, expected '${e}', but child of type '${t.name}' declared attribute '${t.identifierAttribute}' as identifier`);return t.identifierAttribute},void 0);t?(this.identifierMode=yd.YES,this.mapIdentifierAttribute=t):this.identifierMode=yd.NO}}}}),Object.defineProperty(t.prototype,`initializeChildNodes`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){t===void 0&&(t={});var n=e.type._subType,r={};return Object.keys(t).forEach(function(i){r[i]=n.instantiate(e,i,void 0,t[i])}),r}}),Object.defineProperty(t.prototype,`createNewInstance`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return new bd(e,this.name)}}),Object.defineProperty(t.prototype,`finalizeNewInstance`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){wr(t,e.unbox),e.type.hookInitializers.forEach(function(e){var n=e(t);Object.keys(n).forEach(function(e){var r=n[e],i=eu(t,e,r);(ed()?Ku:Gu)(t,e,i)})}),Tr(t,this.willChange),Fr(t,this.didChange)}}),Object.defineProperty(t.prototype,`describe`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,`getChildren`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return jr(e.storedValue)}}),Object.defineProperty(t.prototype,`getChildNode`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=e.storedValue.get(``+t);if(!n)throw new X(`Not a child `+t);return n}}),Object.defineProperty(t.prototype,`willChange`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Y(e.object),n=e.name;t.assertWritable({subpath:n});var r=t.type,i=r._subType;switch(e.type){case`update`:var a=e.newValue;if(a===e.object.get(n))return null;du(i,a),e.newValue=i.reconcile(t.getChildNode(n),e.newValue,t,n),r.processIdentifier(n,e.newValue);break;case`add`:du(i,e.newValue),e.newValue=i.instantiate(t,n,void 0,e.newValue),r.processIdentifier(n,e.newValue);break}return e}}),Object.defineProperty(t.prototype,`processIdentifier`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this.identifierMode===yd.YES&&t instanceof Rl){var n=t.identifier;if(n!==e)throw new X(`A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '${n}', but expected: '${e}'`)}}}),Object.defineProperty(t.prototype,`getSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={};return e.getChildren().forEach(function(e){t[e.subpath]=e.snapshot}),t}}),Object.defineProperty(t.prototype,`processInitialSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={};return Object.keys(e).forEach(function(n){t[n]=e[n].getSnapshot()}),t}}),Object.defineProperty(t.prototype,`didChange`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Y(e.object);switch(e.type){case`update`:t.emitPatch({op:`replace`,path:ld(e.name),value:e.newValue.snapshot,oldValue:e.oldValue?e.oldValue.snapshot:void 0},t);return;case`add`:t.emitPatch({op:`add`,path:ld(e.name),value:e.newValue.snapshot,oldValue:void 0},t);return;case`delete`:var n=e.oldValue.snapshot;e.oldValue.die(),t.emitPatch({op:`remove`,path:ld(e.name),oldValue:n},t);return}}}),Object.defineProperty(t.prototype,`applyPatchLocally`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=e.storedValue;switch(n.op){case`add`:case`replace`:r.set(t,n.value);break;case`remove`:r.delete(t);break}}}),Object.defineProperty(t.prototype,`applySnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){du(this,t);var n=e.storedValue,r={};if(Array.from(n.keys()).forEach(function(e){r[e]=!1}),t)for(var i in t)n.set(i,t[i]),r[``+i]=!0;Object.keys(r).forEach(function(e){r[e]===!1&&n.delete(e)})}}),Object.defineProperty(t.prototype,`getChildType`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,`isValidSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;return Ru(e)?uu(Object.keys(e).map(function(r){return n._subType.validate(e[r],su(t,r,n._subType))})):lu(t,e,`Value is not a plain object`)}}),Object.defineProperty(t.prototype,`getDefaultSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return ku}}),Object.defineProperty(t.prototype,`removeChild`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){e.storedValue.delete(t)}}),t}(Wl);xd.prototype.applySnapshot=H(xd.prototype.applySnapshot);function Sd(e){return new xd(`Map<string, ${e.name}>`,e)}var Cd=function(e){ul(t,e);function t(t,n,r){r===void 0&&(r=[]);var i=e.call(this,t)||this;return Object.defineProperty(i,`_subType`,{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,`flags`,{enumerable:!0,configurable:!0,writable:!0,value:Bl.Array}),Object.defineProperty(i,`hookInitializers`,{enumerable:!0,configurable:!0,writable:!0,value:[]}),i.hookInitializers=r,i}return Object.defineProperty(t.prototype,`hooks`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var n=this.hookInitializers.length>0?this.hookInitializers.concat(e):[e];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,`instantiate`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return gu(this,e,t,n,r)}}),Object.defineProperty(t.prototype,`initializeChildNodes`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){t===void 0&&(t=[]);var n=e.type._subType,r={};return t.forEach(function(t,i){var a=``+i;r[a]=n.instantiate(e,a,void 0,t)}),r}}),Object.defineProperty(t.prototype,`createNewInstance`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=dl(dl({},Au),{name:this.name});return z.array(Eu(e),t)}}),Object.defineProperty(t.prototype,`finalizeNewInstance`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){Vi(t).dehancer=e.unbox,e.type.hookInitializers.forEach(function(e){var n=e(t);Object.keys(n).forEach(function(e){var r=n[e],i=eu(t,e,r);(ed()?Ku:Gu)(t,e,i)})}),Tr(t,this.willChange),Fr(t,this.didChange)}}),Object.defineProperty(t.prototype,`describe`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,`getChildren`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.storedValue.slice()}}),Object.defineProperty(t.prototype,`getChildNode`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=Number(t);if(n<e.storedValue.length)return e.storedValue[n];throw new X(`Not a child: `+t)}}),Object.defineProperty(t.prototype,`willChange`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Y(e.object);t.assertWritable({subpath:``+e.index});var n=t.type._subType,r=t.getChildren();switch(e.type){case`update`:if(e.newValue===e.object[e.index])return null;var i=Td(t,n,[r[e.index]],[e.newValue],[e.index]);if(!i)return null;e.newValue=i[0];break;case`splice`:var a=e.index,o=e.removedCount,s=e.added,c=Td(t,n,r.slice(a,a+o),s,s.map(function(e,t){return a+t}));if(!c)return null;e.added=c;for(var l=a+o;l<r.length;l++)r[l].setParent(t,``+(l+s.length-o));break}return e}}),Object.defineProperty(t.prototype,`getSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.getChildren().map(function(e){return e.snapshot})}}),Object.defineProperty(t.prototype,`processInitialSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=[];return Object.keys(e).forEach(function(n){t.push(e[n].getSnapshot())}),t}}),Object.defineProperty(t.prototype,`didChange`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Y(e.object);switch(e.type){case`update`:t.emitPatch({op:`replace`,path:``+e.index,value:e.newValue.snapshot,oldValue:e.oldValue?e.oldValue.snapshot:void 0},t);return;case`splice`:if(e.removedCount&&e.addedCount===e.object.length){t.emitPatch({op:`replace`,path:``,value:t.snapshot,oldValue:e.removed.map(function(e){return e.snapshot})},t);return}for(var n=e.removedCount-1;n>=0;n--)t.emitPatch({op:`remove`,path:``+(e.index+n),oldValue:e.removed[n].snapshot},t);for(var n=0;n<e.addedCount;n++)t.emitPatch({op:`add`,path:``+(e.index+n),value:e.added[n].snapshot,oldValue:void 0},t);return}}}),Object.defineProperty(t.prototype,`applyPatchLocally`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=e.storedValue,i=t===`-`?r.length:Number(t);switch(n.op){case`replace`:r[i]=n.value;break;case`add`:r.splice(i,0,n.value);break;case`remove`:r.splice(i,1);break}}}),Object.defineProperty(t.prototype,`applySnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){du(this,t),e.storedValue.replace(t)}}),Object.defineProperty(t.prototype,`getChildType`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,`isValidSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;return Fu(e)?uu(e.map(function(e,r){return n._subType.validate(e,su(t,``+r,n._subType))})):lu(t,e,`Value is not an array`)}}),Object.defineProperty(t.prototype,`getDefaultSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ou}}),Object.defineProperty(t.prototype,`removeChild`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){e.storedValue.splice(Number(t),1)}}),t}(Wl);Cd.prototype.applySnapshot=H(Cd.prototype.applySnapshot);function wd(e){return ql(e,1),new Cd(`${e.name}[]`,e)}function Td(e,t,n,r,i){for(var a=!0,o=0;;o++){var s=o<=r.length-1,c=n[o],l=s?r[o]:void 0,u=``+i[o];if(vu(l)&&(l=l.storedValue),!c&&!s)break;if(!s)a=!1,n.splice(o,1),c instanceof Rl&&c.createObservableInstanceIfNeeded(),c.die(),o--;else if(!c){if(bu(l)&&Y(l).parent===e)throw new X(`Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '${e.path}/${u}', but it lives already at '${Y(l).path}'`);a=!1;var d=Ed(t,e,u,l);n.splice(o,0,d)}else if(Dd(c,l))n[o]=Ed(t,e,u,l,c);else{for(var f=void 0,p=o;p<n.length;p++)if(Dd(n[p],l)){f=n.splice(p,1)[0];break}a=!1;var d=Ed(t,e,u,l,f);n.splice(o,0,d)}}return a?null:n}function Ed(e,t,n,r,i){du(e,r);function a(){if(bu(r)){var a=Y(r);if(a.assertAlive(ku),a.parent!==null&&a.parent===t)return a.setParent(t,n),a}return i?e.reconcile(i,r,t,n):e.instantiate(t,n,void 0,r)}var o=a();return i&&i!==o&&(i instanceof Rl&&i.createObservableInstanceIfNeeded(),i.die()),o}function Dd(e,t){if(!e.isAlive)return!1;if(bu(t)){var n=Y(t);return n.isAlive&&n===e}if(e.snapshot===t)return!0;if(!(e instanceof Rl))return!1;var r=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&Ru(t)&&r.is(t)&&r.isMatchingSnapshotId(e,t)}var Od=`preProcessSnapshot`,kd=`postProcessSnapshot`;function Ad(){return Y(this).toString()}var jd={name:`AnonymousModel`,properties:{},initializers:Ou};function Md(e){var t=Object.keys(e),n=new Set;return t.forEach(function(e){if(n.has(e))throw new X(`${e} is declared twice in the model. Model should not contain the same keys`);n.add(e)}),t.reduce(function(t,n){if(n in cl)throw new X(`Hook '${n}' was defined as property. Hooks should be defined as part of the actions`);var r=Object.getOwnPropertyDescriptor(e,n);if(`get`in r)throw new X(`Getters are not supported as properties. Please use views instead`);var i=r.value;if(i==null)throw new X("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(Bu(i))t[n]=sf(Jd(i),i);else if(i instanceof xd)t[n]=sf(i,{});else if(i instanceof Cd)t[n]=sf(i,[]);else if(!Kl(i))throw ed()&&typeof i==`function`?new X(`Invalid type definition for property '${n}', it looks like you passed a function. Did you forget to invoke it, or did you intend to declare a view / action?`):ed()&&typeof i==`object`?new X(`Invalid type definition for property '${n}', it looks like you passed an object. Try passing another model type or a types.frozen.`):new X(`Invalid type definition for property '${n}', cannot infer a type from a value like '${i}' (${typeof i})`);return t},dl({},e))}var Nd=function(e){ul(t,e);function t(t){var n=e.call(this,t.name||jd.name)||this;return Object.defineProperty(n,`flags`,{enumerable:!0,configurable:!0,writable:!0,value:Bl.Object}),Object.defineProperty(n,`initializers`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,`properties`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,`preProcessor`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,`postProcessor`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,`propertyNames`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,`named`,{enumerable:!0,configurable:!0,writable:!0,value:function(e){return n.cloneAndEnhance({name:e})}}),Object.defineProperty(n,`props`,{enumerable:!0,configurable:!0,writable:!0,value:function(e){return n.cloneAndEnhance({properties:e})}}),Object.defineProperty(n,`preProcessSnapshot`,{enumerable:!0,configurable:!0,writable:!0,value:function(e){var t=n.preProcessor;return t?n.cloneAndEnhance({preProcessor:function(n){return t(e(n))}}):n.cloneAndEnhance({preProcessor:e})}}),Object.defineProperty(n,`postProcessSnapshot`,{enumerable:!0,configurable:!0,writable:!0,value:function(e){var t=n.postProcessor;return t?n.cloneAndEnhance({postProcessor:function(n){return e(t(n))}}):n.cloneAndEnhance({postProcessor:e})}}),Object.assign(n,jd,t),n.properties=Md(n.properties),Vu(n.properties),n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(t.prototype,`_getIdentifierAttribute`,{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=void 0;return this.forAllProps(function(t,n){if(n.flags&Bl.Identifier){if(e)throw new X(`Cannot define property '${t}' as object identifier, property '${e}' is already defined as identifier property`);e=t}}),e}}),Object.defineProperty(t.prototype,`cloneAndEnhance`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return new t({name:e.name||this.name,properties:Object.assign({},this.properties,e.properties),initializers:this.initializers.concat(e.initializers||[]),preProcessor:e.preProcessor||this.preProcessor,postProcessor:e.postProcessor||this.postProcessor})}}),Object.defineProperty(t.prototype,`actions`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return this.cloneAndEnhance({initializers:[function(n){return t.instantiateActions(n,e(n)),n}]})}}),Object.defineProperty(t.prototype,`instantiateActions`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;if(!Ru(t))throw new X(`actions initializer should return a plain object containing actions`);Object.getOwnPropertyNames(t).forEach(function(r){if(r in n.properties)throw new X(`'${r}' is a property and cannot be declared as an action`);if(r===Od)throw new X(`Cannot define action '${Od}', it should be defined using 'type.preProcessSnapshot(fn)' instead`);if(r===kd)throw new X(`Cannot define action '${kd}', it should be defined using 'type.postProcessSnapshot(fn)' instead`);var i=t[r],a=e[r];if(r in cl&&a){var o=i;i=function(){a.apply(null,arguments),o.apply(null,arguments)}}var s=i.$mst_middleware,c=i.bind(t);c._isFlowAction=i._isFlowAction||!1,c.$mst_middleware=s;var l=eu(e,r,c);t[r]=l,(ed()?Ku:Gu)(e,r,l)})}}),Object.defineProperty(t.prototype,`volatile`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(typeof e!=`function`)throw new X(`You passed an ${typeof e} to volatile state as an argument, when function is expected`);return this.cloneAndEnhance({initializers:[function(n){return t.instantiateVolatileState(n,e(n)),n}]})}}),Object.defineProperty(t.prototype,`instantiateVolatileState`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;if(!Ru(t))throw new X(`volatile state initializer should return a plain object containing state`);Object.getOwnPropertyNames(t).forEach(function(r){if(r in n.properties)throw new X(`'${r}' is a property and cannot be declared as volatile state`);Nr(e,r,t[r])})}}),Object.defineProperty(t.prototype,`extend`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return this.cloneAndEnhance({initializers:[function(n){var r=e(n),i=r.actions,a=r.views,o=r.state;for(var s in fl(r,[`actions`,`views`,`state`]))throw new X(`The \`extend\` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '${s}'`);return o&&t.instantiateVolatileState(n,o),a&&t.instantiateViews(n,a),i&&t.instantiateActions(n,i),n}]})}}),Object.defineProperty(t.prototype,`views`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return this.cloneAndEnhance({initializers:[function(n){return t.instantiateViews(n,e(n)),n}]})}}),Object.defineProperty(t.prototype,`instantiateViews`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;if(!Ru(t))throw new X(`views initializer should return a plain object containing views`);Object.getOwnPropertyNames(t).forEach(function(r){var i;if(r in n.properties)throw new X(`'${r}' is a property and cannot be declared as a view`);var a=Object.getOwnPropertyDescriptor(t,r);if(`get`in a)Pr(e,r,a),Zr(e,(i={},i[r]=Vt,i));else if(typeof a.value==`function`)(ed()?Ku:Gu)(e,r,a.value);else throw new X(`A view member should either be a function or getter based property`)})}}),Object.defineProperty(t.prototype,`instantiate`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i=bu(r)?r:this.applySnapshotPreProcessor(r);return gu(this,e,t,n,i)}}),Object.defineProperty(t.prototype,`initializeChildNodes`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){t===void 0&&(t={});var n=e.type,r={};return n.forAllProps(function(n,i){r[n]=i.instantiate(e,n,void 0,t[n])}),r}}),Object.defineProperty(t.prototype,`createNewInstance`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=dl(dl({},Au),{name:this.name});return z.object(e,ku,t)}}),Object.defineProperty(t.prototype,`finalizeNewInstance`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){Gu(t,`toString`,Ad),this.forAllProps(function(n){wr(t,n,e.unbox)}),this.initializers.reduce(function(e,t){return t(e)},t),Tr(t,this.willChange),Fr(t,this.didChange)}}),Object.defineProperty(t.prototype,`willChange`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e,n=Y(t.object),r=t.name;n.assertWritable({subpath:r});var i=n.type.properties[r];return i&&(du(i,t.newValue),t.newValue=i.reconcile(n.getChildNode(r),t.newValue,n,r)),t}}),Object.defineProperty(t.prototype,`didChange`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e,n=Y(t.object);if(n.type.properties[t.name]){var r=t.oldValue?t.oldValue.snapshot:void 0;n.emitPatch({op:`replace`,path:ld(t.name),value:t.newValue.snapshot,oldValue:r},n)}}}),Object.defineProperty(t.prototype,`getChildren`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=[];return this.forAllProps(function(r){n.push(t.getChildNode(e,r))}),n}}),Object.defineProperty(t.prototype,`getChildNode`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!(t in this.properties))throw new X(`Not a value property: `+t);var n=Vi(e.storedValue,t),r=n.raw?.call(n);if(!r)throw new X(`Node not available for property `+t);return r}}),Object.defineProperty(t.prototype,`getSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this;t===void 0&&(t=!0);var r={};return this.forAllProps(function(t,i){Bi(e.storedValue,t).reportObserved(),r[t]=n.getChildNode(e,t).snapshot}),t?this.applySnapshotPostProcessor(r):r}}),Object.defineProperty(t.prototype,`processInitialSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={};return Object.keys(e).forEach(function(n){t[n]=e[n].getSnapshot()}),this.applySnapshotPostProcessor(t)}}),Object.defineProperty(t.prototype,`applyPatchLocally`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){if(!(n.op===`replace`||n.op===`add`))throw new X(`object does not support operation ${n.op}`);e.storedValue[t]=n.value}}),Object.defineProperty(t.prototype,`applySnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){du(this,t);var n=this.applySnapshotPreProcessor(t);this.forAllProps(function(t){e.storedValue[t]=n[t]})}}),Object.defineProperty(t.prototype,`applySnapshotPreProcessor`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.preProcessor;return t?t.call(null,e):e}}),Object.defineProperty(t.prototype,`applySnapshotPostProcessor`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.postProcessor;return t?t.call(null,e):e}}),Object.defineProperty(t.prototype,`getChildType`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return id(e,1),this.properties[e]}}),Object.defineProperty(t.prototype,`isValidSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this,r=this.applySnapshotPreProcessor(e);return Ru(r)?uu(this.propertyNames.map(function(e){return n.properties[e].validate(r[e],su(t,e,n.properties[e]))})):lu(t,r,`Value is not a plain object`)}}),Object.defineProperty(t.prototype,`forAllProps`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this.propertyNames.forEach(function(n){return e(n,t.properties[n])})}}),Object.defineProperty(t.prototype,`describe`,{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return`{ `+this.propertyNames.map(function(t){return t+`: `+e.properties[t].describe()}).join(`; `)+` }`}}),Object.defineProperty(t.prototype,`getDefaultSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return ku}}),Object.defineProperty(t.prototype,`removeChild`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){e.storedValue[t]=void 0}}),t}(Wl);Nd.prototype.applySnapshot=H(Nd.prototype.applySnapshot);function Pd(){var e=[...arguments];if(ed()&&typeof e[0]!=`string`&&e[1])throw new X(`Model creation failed. First argument must be a string when two arguments are provided`);return new Nd({name:typeof e[0]==`string`?e.shift():`AnonymousModel`,properties:e.shift()||{}})}function Fd(){var e=[...arguments],t=typeof e[0]==`string`,n=t?e[0]:`AnonymousModel`;return t&&e.shift(),ed()&&e.forEach(function(e,n){td(e,Id,`mobx-state-tree model type`,t?n+2:n+1)}),e.reduce(function(e,t){return e.cloneAndEnhance({name:e.name+`_`+t.name,properties:t.properties,initializers:t.initializers,preProcessor:function(n){return t.applySnapshotPreProcessor(e.applySnapshotPreProcessor(n))},postProcessor:function(n){return t.applySnapshotPostProcessor(e.applySnapshotPostProcessor(n))}})}).named(n)}function Id(e){return Kl(e)&&(e.flags&Bl.Object)>0}var Ld=function(e){ul(t,e);function t(t,n,r,i){i===void 0&&(i=ju);var a=e.call(this,t)||this;return Object.defineProperty(a,`flags`,{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,`checker`,{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,`initializer`,{enumerable:!0,configurable:!0,writable:!0,value:i}),a.flags=n,a}return Object.defineProperty(t.prototype,`describe`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,`instantiate`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return _u(this,e,t,n,r)}}),Object.defineProperty(t.prototype,`createNewInstance`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.initializer(e)}}),Object.defineProperty(t.prototype,`isValidSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Bu(e)&&this.checker(e)?cu():lu(t,e,`Value is not a ${this.name===`Date`?`Date or a unix milliseconds timestamp`:this.name}`)}}),t}(Gl),Rd=new Ld(`string`,Bl.String,function(e){return typeof e==`string`}),zd=new Ld(`number`,Bl.Number,function(e){return typeof e==`number`}),Bd=new Ld(`integer`,Bl.Integer,function(e){return Mu(e)}),Vd=new Ld(`float`,Bl.Float,function(e){return Nu(e)}),Hd=new Ld(`finite`,Bl.Finite,function(e){return Pu(e)}),Ud=new Ld(`boolean`,Bl.Boolean,function(e){return typeof e==`boolean`}),Wd=new Ld(`null`,Bl.Null,function(e){return e===null}),Gd=new Ld(`undefined`,Bl.Undefined,function(e){return e===void 0}),Kd=new Ld(`Date`,Bl.Date,function(e){return typeof e==`number`||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});Kd.getSnapshot=function(e){return e.storedValue.getTime()};var qd=Kd;function Jd(e){switch(typeof e){case`string`:return Rd;case`number`:return zd;case`boolean`:return Ud;case`object`:if(e instanceof Date)return qd}throw new X(`Cannot determine primitive type from value `+e)}function Yd(e){return Kl(e)&&(e.flags&(Bl.String|Bl.Number|Bl.Integer|Bl.Boolean|Bl.Date))>0}var Xd=function(e){ul(t,e);function t(t){var n=e.call(this,JSON.stringify(t))||this;return Object.defineProperty(n,`value`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,`flags`,{enumerable:!0,configurable:!0,writable:!0,value:Bl.Literal}),n.value=t,n}return Object.defineProperty(t.prototype,`instantiate`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return _u(this,e,t,n,r)}}),Object.defineProperty(t.prototype,`describe`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(t.prototype,`isValidSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Bu(e)&&e===this.value?cu():lu(t,e,`Value is not a literal ${JSON.stringify(this.value)}`)}}),t}(Gl);function Zd(e){return td(e,Bu,`primitive`,1),new Xd(e)}var Qd=function(e){ul(t,e);function t(t,n,r,i){var a=e.call(this,t)||this;return Object.defineProperty(a,`_subtype`,{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,`_predicate`,{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,`_message`,{enumerable:!0,configurable:!0,writable:!0,value:i}),a}return Object.defineProperty(t.prototype,`flags`,{get:function(){return this._subtype.flags|Bl.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`describe`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,`instantiate`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return this._subtype.instantiate(e,t,n,r)}}),Object.defineProperty(t.prototype,`isAssignableFrom`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._subtype.isAssignableFrom(e)}}),Object.defineProperty(t.prototype,`isValidSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this._subtype.validate(e,t);if(n.length>0)return n;var r=bu(e)?Y(e).snapshot:e;return this._predicate(r)?cu():lu(t,e,this._message(e))}}),Object.defineProperty(t.prototype,`reconcile`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return this._subtype.reconcile(e,t,n,r)}}),Object.defineProperty(t.prototype,`getSubTypes`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(Ul);function $d(){var e=[...arguments],t=typeof e[0]==`string`?e.shift():Kl(e[0])?e[0].name:null,n=e[0],r=e[1],i=e[2]?e[2]:function(e){return`Value does not respect the refinement predicate`};return ql(n,[1,2]),id(t,1),nd(r,[2,3]),nd(i,[3,4]),new Qd(t,n,r,i)}function ef(e,t){var n=typeof e==`string`?t:e;ed()&&n.forEach(function(e,t){id(e,t+1)});var r=nf.apply(void 0,hl([],ml(n.map(function(e){return Zd(``+e)})),!1));return typeof e==`string`&&(r.name=e),r}var tf=function(e){ul(t,e);function t(t,n,r){var i=e.call(this,t)||this;return Object.defineProperty(i,`_types`,{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,`_dispatcher`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,`_eager`,{enumerable:!0,configurable:!0,writable:!0,value:!0}),r=dl({eager:!0,dispatcher:void 0},r),i._dispatcher=r.dispatcher,r.eager||(i._eager=!1),i}return Object.defineProperty(t.prototype,`flags`,{get:function(){var e=Bl.Union;return this._types.forEach(function(t){e|=t.flags}),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`isAssignableFrom`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._types.some(function(t){return t.isAssignableFrom(e)})}}),Object.defineProperty(t.prototype,`describe`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return`(`+this._types.map(function(e){return e.describe()}).join(` | `)+`)`}}),Object.defineProperty(t.prototype,`instantiate`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i=this.determineType(r,void 0);if(!i)throw new X(`No matching type for union `+this.describe());return i.instantiate(e,t,n,r)}}),Object.defineProperty(t.prototype,`reconcile`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i=this.determineType(t,e.getReconciliationType());if(!i)throw new X(`No matching type for union `+this.describe());return i.reconcile(e,t,n,r)}}),Object.defineProperty(t.prototype,`determineType`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._dispatcher?this._dispatcher(e):t?t.is(e)?t:this._types.filter(function(e){return e!==t}).find(function(t){return t.is(e)}):this._types.find(function(t){return t.is(e)})}}),Object.defineProperty(t.prototype,`isValidSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._dispatcher)return this._dispatcher(e).validate(e,t);for(var n=[],r=0,i=0;i<this._types.length;i++){var a=this._types[i].validate(e,t);if(a.length===0){if(this._eager)return cu();r++}else n.push(a)}return r===1?cu():lu(t,e,`No type is applicable for the union`).concat(uu(n))}}),Object.defineProperty(t.prototype,`getSubTypes`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t}(Ul);function nf(e){var t=[...arguments].slice(1),n=Kl(e)?void 0:e,r=Kl(e)?hl([e],ml(t),!1):t,i=`(`+r.map(function(e){return e.name}).join(` | `)+`)`;return ed()&&(n&&td(n,function(e){return Ru(e)},`object { eager?: boolean, dispatcher?: Function }`,1),r.forEach(function(e,t){ql(e,n?t+2:t+1)})),new tf(i,r,n)}function rf(e){return Kl(e)&&(e.flags&Bl.Union)>0}var af=function(e){ul(t,e);function t(t,n,r){var i=e.call(this,t.name)||this;return Object.defineProperty(i,`_subtype`,{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,`_defaultValue`,{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,`optionalValues`,{enumerable:!0,configurable:!0,writable:!0,value:r}),i}return Object.defineProperty(t.prototype,`flags`,{get:function(){return this._subtype.flags|Bl.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`describe`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+`?`}}),Object.defineProperty(t.prototype,`instantiate`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){if(this.optionalValues.indexOf(r)>=0){var i=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(e,t,n,i)}return this._subtype.instantiate(e,t,n,r)}}),Object.defineProperty(t.prototype,`reconcile`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return this._subtype.reconcile(e,this.optionalValues.indexOf(t)<0&&this._subtype.is(t)?t:this.getDefaultInstanceOrSnapshot(),n,r)}}),Object.defineProperty(t.prototype,`getDefaultInstanceOrSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=typeof this._defaultValue==`function`?this._defaultValue():this._defaultValue;return typeof this._defaultValue==`function`&&du(this,e),e}}),Object.defineProperty(t.prototype,`isValidSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.optionalValues.indexOf(e)>=0?cu():this._subtype.validate(e,t)}}),Object.defineProperty(t.prototype,`isAssignableFrom`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._subtype.isAssignableFrom(e)}}),Object.defineProperty(t.prototype,`getSubTypes`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(Ul);function of(e,t){if(typeof t!=`function`&&bu(t))throw new X(`default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead`);ql(e,1),ed()&&typeof t!=`function`&&du(e,t)}function sf(e,t,n){return of(e,t),new af(e,t,n||cf)}var cf=[void 0],lf=sf(Gd,void 0),uf=sf(Wd,null);function df(e){return ql(e,1),nf(e,lf)}function ff(e){return ql(e,1),nf(e,uf)}var pf=function(e){ul(t,e);function t(t,n){var r=e.call(this,t)||this;return Object.defineProperty(r,`_definition`,{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(r,`_subType`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r}return Object.defineProperty(t.prototype,`flags`,{get:function(){return(this._subType?this._subType.flags:0)|Bl.Late},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`getSubType`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!this._subType){var t=void 0;try{t=this._definition()}catch(e){if(e instanceof ReferenceError)t=void 0;else throw e}if(e&&t===void 0)throw new X(`Late type seems to be used too early, the definition (still) returns undefined`);if(t){if(ed()&&!Kl(t))throw new X(`Failed to determine subtype, make sure types.late returns a type definition.`);this._subType=t}}return this._subType}}),Object.defineProperty(t.prototype,`instantiate`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return this.getSubType(!0).instantiate(e,t,n,r)}}),Object.defineProperty(t.prototype,`reconcile`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return this.getSubType(!0).reconcile(e,t,n,r)}}),Object.defineProperty(t.prototype,`describe`,{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.getSubType(!1);return e?e.name:`<uknown late type>`}}),Object.defineProperty(t.prototype,`isValidSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this.getSubType(!1);return n?n.validate(e,t):cu()}}),Object.defineProperty(t.prototype,`isAssignableFrom`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getSubType(!1);return t?t.isAssignableFrom(e):!1}}),Object.defineProperty(t.prototype,`getSubTypes`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.getSubType(!1)||Vl}}),t}(Ul);function mf(e,t){var n=typeof e==`string`?e:`late(${e.toString()})`,r=typeof e==`string`?t:e;if(ed()&&!(typeof r==`function`&&r.length===0))throw new X(`Invalid late type, expected a function with zero arguments that returns a type, got: `+r);return new pf(n,r)}function hf(e,t){return new gf(e,t)}var gf=function(e){ul(t,e);function t(t,n){var r=e.call(this,t)||this;return Object.defineProperty(r,`options`,{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(r,`flags`,{enumerable:!0,configurable:!0,writable:!0,value:Bl.Lazy}),Object.defineProperty(r,`loadedType`,{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(r,`pendingNodeList`,{enumerable:!0,configurable:!0,writable:!0,value:z.array()}),zr(function(){return r.pendingNodeList.length>0&&r.pendingNodeList.some(function(e){return e.isAlive&&r.options.shouldLoadPredicate(e.parent?e.parent.value:null)})},function(){r.options.loadType().then(H(function(e){r.loadedType=e,r.pendingNodeList.forEach(function(e){e.parent&&r.loadedType&&e.parent.applyPatches([{op:`replace`,path:`/${e.subpath}`,value:e.snapshot}])})}))}),r}return Object.defineProperty(t.prototype,`describe`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return`<lazy ${this.name}>`}}),Object.defineProperty(t.prototype,`instantiate`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i=this;if(this.loadedType)return this.loadedType.instantiate(e,t,n,r);var a=_u(this,e,t,n,Hu(r));return this.pendingNodeList.push(a),zr(function(){return!a.isAlive},function(){return i.pendingNodeList.splice(i.pendingNodeList.indexOf(a),1)}),a}}),Object.defineProperty(t.prototype,`isValidSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.loadedType?this.loadedType.validate(e,t):Uu(e)?cu():lu(t,e,`Value is not serializable and cannot be lazy`)}}),Object.defineProperty(t.prototype,`reconcile`,{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,r,i){return this.loadedType?(t.die(),this.loadedType.instantiate(r,i,r.environment,n)):e.prototype.reconcile.call(this,t,n,r,i)}}),t}(Gl),_f=function(e){ul(t,e);function t(t){var n=e.call(this,t?`frozen(${t.name})`:`frozen`)||this;return Object.defineProperty(n,`subType`,{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,`flags`,{enumerable:!0,configurable:!0,writable:!0,value:Bl.Frozen}),n}return Object.defineProperty(t.prototype,`describe`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return`<any immutable value>`}}),Object.defineProperty(t.prototype,`instantiate`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){return _u(this,e,t,n,Hu(r))}}),Object.defineProperty(t.prototype,`isValidSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Uu(e)?this.subType?this.subType.validate(e,t):cu():lu(t,e,`Value is not serializable and cannot be frozen`)}}),t}(Gl),vf=new _f;function yf(e){return arguments.length===0?vf:Kl(e)?new _f(e):sf(vf,e)}function bf(e){switch(e){case cl.beforeDestroy:return`destroy`;case cl.beforeDetach:return`detach`;default:return}}var xf=function(){function e(e,t){if(Object.defineProperty(this,`targetType`,{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,`identifier`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`node`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,`resolvedReference`,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Pf(e))this.identifier=e;else if(bu(e)){var n=Y(e);if(!n.identifierAttribute)throw new X(`Can only store references with a defined identifier attribute.`);var r=n.unnormalizedIdentifier;if(r==null)throw new X(`Can only store references to tree nodes with a defined identifier.`);this.identifier=r}else throw new X(`Can only store references to tree nodes or identifiers, got: '${e}'`)}return Object.defineProperty(e.prototype,`updateResolvedReference`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Nf(this.identifier),n=e.root,r=n.identifierCache.getLastCacheModificationPerId(t);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==r){var i=this.targetType,a=n.identifierCache.resolve(i,t);if(!a)throw new Sf(`[mobx-state-tree] Failed to resolve reference '${this.identifier}' to type '${this.targetType.name}' (from node: ${e.path})`);this.resolvedReference={node:a,lastCacheModification:r}}}}),Object.defineProperty(e.prototype,`resolvedValue`,{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),Sf=function(e){ul(t,e);function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return t}(Error),Cf=function(e){ul(t,e);function t(t,n){var r=e.call(this,`reference(${t.name})`)||this;return Object.defineProperty(r,`targetType`,{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,`onInvalidated`,{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(r,`flags`,{enumerable:!0,configurable:!0,writable:!0,value:Bl.Reference}),r}return Object.defineProperty(t.prototype,`describe`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,`isAssignableFrom`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.targetType.isAssignableFrom(e)}}),Object.defineProperty(t.prototype,`isValidSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return Pf(e)?cu():lu(t,e,`Value is not a valid identifier, which is a string or a number`)}}),Object.defineProperty(t.prototype,`fireInvalidated`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i=t.parent;if(!(!i||!i.isAlive)){var a=i.storedValue;a&&this.onInvalidated({cause:e,parent:a,invalidTarget:r?r.storedValue:void 0,invalidId:n,replaceRef:function(e){vl(t.root.storedValue,{op:`replace`,value:e,path:t.path})},removeRef:function(){Id(i.type)?this.replaceRef(void 0):vl(t.root.storedValue,{op:`remove`,path:t.path})}})}}}),Object.defineProperty(t.prototype,`addTargetNodeWatcher`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var n=this,r=this.getValue(e);if(r){var i=Y(r),a=function(r,a){var o=bf(a);o&&n.fireInvalidated(o,e,t,i)},o=i.registerHook(cl.beforeDetach,a),s=i.registerHook(cl.beforeDestroy,a);return function(){o(),s()}}}}),Object.defineProperty(t.prototype,`watchTargetNodeForInvalidations`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){var r=this;if(this.onInvalidated){var i;e.registerHook(cl.beforeDestroy,function(){i&&i()});var a=function(a){i&&i();var o=e.parent,s=o&&o.storedValue;if(o&&o.isAlive&&s){var c=void 0;c=n?!!n.get(t,s):e.root.identifierCache.has(r.targetType,Nf(t)),c?i=r.addTargetNodeWatcher(e,t):a||r.fireInvalidated(`invalidSnapshotReference`,e,t,null)}};e.state===yu.FINALIZED?a(!0):(e.isRoot||e.root.registerHook(cl.afterCreationFinalization,function(){e.parent&&e.parent.createObservableInstanceIfNeeded()}),e.registerHook(cl.afterAttach,function(){a(!1)}))}}}),t}(Gl),wf=function(e){ul(t,e);function t(t,n){return e.call(this,t,n)||this}return Object.defineProperty(t.prototype,`getValue`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.isAlive)return e.storedValue.resolvedValue}}),Object.defineProperty(t.prototype,`getSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.storedValue.identifier}}),Object.defineProperty(t.prototype,`instantiate`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i=bu(r)?Dl(r):r,a=new xf(r,this.targetType),o=_u(this,e,t,n,a);return a.node=o,this.watchTargetNodeForInvalidations(o,i,void 0),o}}),Object.defineProperty(t.prototype,`reconcile`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){if(!e.isDetaching&&e.type===this){var i=bu(t),a=e.storedValue;if(!i&&a.identifier===t||i&&a.resolvedValue===t)return e.setParent(n,r),e}var o=this.instantiate(n,r,void 0,t);return e.die(),o}}),t}(Cf),Tf=function(e){ul(t,e);function t(t,n,r){var i=e.call(this,t,r)||this;return Object.defineProperty(i,`options`,{enumerable:!0,configurable:!0,writable:!0,value:n}),i}return Object.defineProperty(t.prototype,`getValue`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.isAlive)return this.options.get(e.storedValue,e.parent?e.parent.storedValue:null)}}),Object.defineProperty(t.prototype,`getSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.storedValue}}),Object.defineProperty(t.prototype,`instantiate`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i=bu(r)?this.options.set(r,e?e.storedValue:null):r,a=_u(this,e,t,n,i);return this.watchTargetNodeForInvalidations(a,i,this.options),a}}),Object.defineProperty(t.prototype,`reconcile`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i=bu(t)?this.options.set(t,e?e.storedValue:null):t;if(!e.isDetaching&&e.type===this&&e.storedValue===i)return e.setParent(n,r),e;var a=this.instantiate(n,r,void 0,i);return e.die(),a}}),t}(Cf);function Ef(e,t){if(ql(e,1),ed()&&arguments.length===2&&typeof arguments[1]==`string`)throw new X(`References with base path are no longer supported. Please remove the base path.`);var n=t||void 0,r=t?t.onInvalidated:void 0;if(n&&(n.get||n.set)){if(ed()&&(!n.get||!n.set))throw new X(`reference options must either contain both a 'get' and a 'set' method or none of them`);return new Tf(e,{get:n.get,set:n.set},r)}else return new wf(e,r)}function Df(e,t){var n=Ef(e,dl(dl({},t),{onInvalidated:function(e){t&&t.onInvalidated&&t.onInvalidated(e),e.removeRef()}}));return t&&t.acceptsUndefined===!1?n:df(n)}var Of=function(e){ul(t,e);function t(t,n){var r=e.call(this,t)||this;return Object.defineProperty(r,`validType`,{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(r,`flags`,{enumerable:!0,configurable:!0,writable:!0,value:Bl.Identifier}),r}return Object.defineProperty(t.prototype,`instantiate`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){if(!e||!(e.type instanceof Nd))throw new X(`Identifier types can only be instantiated as direct child of a model type`);return _u(this,e,t,n,r)}}),Object.defineProperty(t.prototype,`reconcile`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){if(e.storedValue!==t)throw new X(`Tried to change identifier from '${e.storedValue}' to '${t}'. Changing identifiers is not allowed.`);return e.setParent(n,r),e}}),Object.defineProperty(t.prototype,`isValidSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return typeof e===this.validType?cu():lu(t,e,`Value is not a valid ${this.describe()}, expected a ${this.validType}`)}}),t}(Gl),kf=function(e){ul(t,e);function t(){var t=e.call(this,`identifier`,`string`)||this;return Object.defineProperty(t,`flags`,{enumerable:!0,configurable:!0,writable:!0,value:Bl.Identifier}),t}return Object.defineProperty(t.prototype,`describe`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return`identifier`}}),t}(Of),Af=function(e){ul(t,e);function t(){return e.call(this,`identifierNumber`,`number`)||this}return Object.defineProperty(t.prototype,`getSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.storedValue}}),Object.defineProperty(t.prototype,`describe`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return`identifierNumber`}}),t}(Of),jf=new kf,Mf=new Af;function Nf(e){return``+e}function Pf(e){return typeof e==`string`||typeof e==`number`}function Ff(e){return new If(e)}var If=function(e){ul(t,e);function t(t){var n=e.call(this,t.name)||this;return Object.defineProperty(n,`options`,{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,`flags`,{enumerable:!0,configurable:!0,writable:!0,value:Bl.Custom}),n}return Object.defineProperty(t.prototype,`describe`,{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,`isValidSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this.options.isTargetType(e))return cu();var n=this.options.getValidationMessage(e);return n?lu(t,e,`Invalid value for type '${this.name}': ${n}`):cu()}}),Object.defineProperty(t.prototype,`getSnapshot`,{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.options.toSnapshot(e.storedValue)}}),Object.defineProperty(t.prototype,`instantiate`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i=this.options.isTargetType(r)?r:this.options.fromSnapshot(r,e&&e.root.environment);return _u(this,e,t,n,i)}}),Object.defineProperty(t.prototype,`reconcile`,{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,r){var i=!this.options.isTargetType(t);if(!e.isDetaching&&e.type===this&&(i?t===e.snapshot:t===e.storedValue))return e.setParent(n,r),e;var a=i?this.options.fromSnapshot(t,n.root.environment):t,o=this.instantiate(n,r,void 0,a);return e.die(),o}}),t}(Gl),Z={enumeration:ef,model:Pd,compose:Fd,custom:Ff,reference:Ef,safeReference:Df,union:nf,optional:sf,literal:Zd,maybe:df,maybeNull:ff,refinement:$d,string:Rd,boolean:Ud,number:zd,integer:Bd,float:Vd,finite:Hd,Date:qd,map:Sd,array:wd,frozen:yf,identifier:jf,identifierNumber:Mf,late:mf,lazy:hf,undefined:Gd,null:Wd,snapshotProcessor:gd};function Lf({oldText:e,newText:t,element:n}){if(!(t.length/Math.max(20,e.length)>=4))return n.fontSize;let r=n.width*n.page.computedHeight/t.length,i=1.5*Math.sqrt(r),a=n.fontSize;return Math.min(a,Math.max(5,Math.round(i)))}function Rf(e){try{let{stops:t}=Ys(e);if(t.length===0)return 127.5;let n=0,r=0;for(let e of t)try{let t=a.Util.colorToRGBA(e.color);if(!t||t.a<.5)continue;n+=(299*t.r+587*t.g+114*t.b)/1e3,r++}catch{continue}return r===0?127.5:n/r}catch(e){return console.warn(`Error calculating gradient brightness:`,e),127.5}}function zf(e){if(qs(e))return Rf(e);let t=a.Util.colorToRGBA(e);if(!t)return 127.5;let{r:n,g:r,b:i}=t;return(299*n+587*r+114*i)/1e3}function Bf(e){let{outlineSize:t,outlineColor:n}=function(e){let t=e.strokeWidth||0;return t>0?{outlineSize:t,outlineColor:e.stroke}:{outlineSize:e.shadowEnabled&&e.shadowBlur>0&&e.shadowOpacity>.1?e.shadowBlur*e.shadowOpacity:0,outlineColor:e.shadowColor}}(e);if(t<.001)return e.fill;let r=zf(e.fill),i=zf(n);return Math.abs(r-i)>=50?n:e.fill}var Vf;function Hf(){return Vf||(Vf=document.getElementById(`polotno-text-style`),Vf||(Vf=document.createElement(`style`),Vf.id=`polotno-text-style`,document.head.appendChild(Vf)),Vf)}a._fixTextRendering=!0;var Uf={border:`none`,padding:`0px`,overflow:`hidden`,background:`none`,outline:`none`,resize:`none`,overflowWrap:`break-word`,whiteSpace:`pre-wrap`,userSelect:`text`,wordBreak:`normal`,textTransform:`none`},Wf=U(({textNodeRef:e,element:t,onBlur:n,selectAll:r,cursorPosition:i})=>{let[a,o]=S.useState(Uf),s=e.current;S.useLayoutEffect(()=>{if(!s)return;let e={};e.width=s.width()-2*s.padding()+`px`,e.height=s.height()-2*s.padding()+s.fontSize()*s.lineHeight()+`px`,e.fontSize=s.fontSize()+`px`,e.lineHeight=s.lineHeight()+.01,e.fontFamily=s.fontFamily(),e.textAlign=s.align(),e.color=s.fill(),e.fontWeight=t.fontWeight,e.fontStyle=t.fontStyle,e.letterSpacing=t.letterSpacing+`em`,e.opacity=Math.max(t.a.opacity,.2),e.textTransform=t.textTransform,e.caretColor=Bf(t);let n=`\n .polotno-input::placeholder {\n color: ${a.color};\n opacity: 0.6;\n }\n `,r=Hf();r.innerHTML=``,r.appendChild(document.createTextNode(n)),JSON.stringify(e)!==JSON.stringify(a)&&o(e)});let c=S.useRef(null);if(S.useLayoutEffect(()=>{var e;let t=c.current;t&&((e=c.current)==null||e.focus(),t.selectionStart=t.selectionEnd=i||t.value.length,r&&(t?.select(),document.execCommand(`selectAll`,!1,void 0)))},[]),S.useEffect(()=>{window.addEventListener(`blur`,n);let e=e=>{var t;(t=c.current)!=null&&t.contains(e.target)||n()};return window.addEventListener(`touchstart`,e),()=>{window.removeEventListener(`blur`,n),window.removeEventListener(`touchstart`,e)}},[]),!s)return null;let l=0,u=s.textArr.length*s.lineHeight()*s.fontSize();t.verticalAlign===`middle`&&(l=(t.a.height-u)/2),t.verticalAlign===`bottom`&&(l=t.a.height-u);let d=mc(t.text);return S.createElement(`textarea`,{className:`polotno-input`,ref:c,dir:Jc(d),style:Object.assign(Object.assign(Object.assign({},Uf),a),{paddingTop:l+`px`}),value:d,onChange:e=>{let n=Lf({oldText:t.text,newText:e.target.value,element:t});t.set({text:e.target.value,fontSize:n})},placeholder:t.placeholder,onBlur:n})}),Gf=e=>S.createElement(Ss,null,S.createElement(Wf,Object.assign({},e))),Kf=(e,t,n,r,i)=>{let[a,o]=S.useReducer(e=>e+1,0),s=S.useRef(Dc(t,n,r)),c=S.useRef(null);return S.useLayoutEffect(()=>{if(s.current=Dc(t,n,r),s.current)return;let a=!0;return(async()=>{s.current=!1,o();let l=cc(`text ${t}`);await e.loadFont(t,n,r,i),a?(c.current=l,s.current=!0,o()):l()})(),()=>{c.current&&=(c.current(),null),a=!1}},[t,n,r]),S.useEffect(()=>{s.current&&setTimeout(()=>{c.current&&=(c.current(),null)})},[s.current]),[s.current]},qf=({fontLoaded:e,fontFamily:t,fontSize:n,lineHeight:r})=>S.useMemo(()=>tl({fontFamily:t,fontSize:n,lineHeight:r}),[e,t,n,r]);function Jf(e){let t=S.useRef(e),n=S.useRef(e);return S.useMemo(()=>{n.current=t.current,t.current=e},[e]),n.current}function Yf(e,t,n=!1){let r=e.fontSize(),i=e.height(),a=mc(t.text),o=t.a.fontSize;e.height(void 0);let s=Math.round(2*t.a.fontSize)-1;for(let r=1;r<s;r++){let r=t.a.height&&e.height()>t.a.height,i=a.split(`
34
- `).join(` `).split(/[\s-]+/).reduce((e,t)=>(t=t.toLowerCase(),/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(t)?e.concat(t.split(``)):e.concat(t)),[]),s=e.textArr.map(e=>e.text.toLowerCase()).join(`;`),c=i.find(e=>!s.includes(e)||(s=s.replace(e,``),!1));if(!(r||c&&!n))break;o-=.5,e.fontSize(o)}return e.fontSize(r),e.height(i),o}var Xf=U(({element:e,store:t})=>{let{textOverflowIndicatorStyle:n}=ps(),r=S.useRef(null),i=S.useRef(null),a=S.useRef(null),o=S.useRef([]),[,s]=S.useReducer(e=>e+1,0),{editorEnabled:c,selectAll:l}=(e=>{let[t,n]=S.useState(!1),r=S.useRef(!1);return S.useEffect(()=>{var t=!0;return setTimeout(()=>{t&&(e._editModeEnabled&&(r.current=!0),n(!0),setTimeout(()=>{r.current=!1},50))},50),()=>{t=!1}},[]),{editorEnabled:t&&e._editModeEnabled,selectAll:r.current}})(e),[u,d]=S.useState(!1),[f,p]=S.useState(!1),m=S.useRef(e.a.height),h=e.isSelected,g=Jf(h),{textVerticalResizeEnabled:_}=Lc,v=Lc.autoDeleteEmptyText,y=Jf(e.fontFamily),[b,x]=S.useState([]);S.useEffect(()=>{let e=r.current?.textArr??[];JSON.stringify(e)!==JSON.stringify(b)&&x(e)}),S.useEffect(()=>{if(e.a.width||e.type===`tablecell`)return;let t=r.current;t.width(600),e.set({width:1.4*t.getTextWidth()})},[]),S.useEffect(()=>{g&&!h&&v&&e.text===``&&e.removable&&!e.placeholder&&t.deleteElements([e.id])},[v,e.placeholder,e.removable,e.text,h,g]);let C=()=>{if(e.curveEnabled){let t=r.current;t?.clearCache(),t?.setAttrs({filters:[]});let n=i.current;n&&rl(n,e)}else{let t=r.current;t&&rl(t,e)}};S.useLayoutEffect(()=>{if(!f)return $n(()=>{C()})}),S.useEffect(()=>{let e=o.current;e.length>0&&(o.current=[],e.forEach(e=>e()))});let w=mc(e.text);e.textTransform===`uppercase`&&(w=w.toUpperCase());let[T]=Kf(t,e.fontFamily,e.fontStyle,e.fontWeight,e.text||e.placeholder),E=()=>{if(e.curveEnabled){let e=i.current;return e.getSelfRect().height||e.fontSize()}let t=r.current.clone({height:void 0}),n=Math.ceil(t.fontSize()*t.lineHeight()*t.textArr.length+1);return t.destroy(),n};S.useLayoutEffect(()=>{if(!T)return;if(e.type===`tablecell`){let{textOverflow:n}=Lc;if(n===`resize`){let t=E(),n=Al(e)?xl(e,2):null;n!=null&&n.setCellContentHeight&&n.setCellContentHeight(e.id,t)}else if(n===`change-font-size`){let n=r.current;if(n){let r=Yf(n,e,Lc.textSplitAllowed);r!==e.fontSize&&t.history.ignore(()=>{e.set({fontSize:r})})}}return}let{textOverflow:n,textSplitAllowed:i}=Lc,a=(n,r,i,a)=>{let c=cc(`text ${e.id}`),l=()=>{t.history.ignore(n,r,i).then(()=>{o.current.push(c),s()})};a?queueMicrotask(l):l()};if(!e.height){let t=E();a(()=>{e.height||e.set({height:t})},void 0,void 0,!0);return}if(!t.isPlaying)if(n!==`change-font-size`||u){if(n===`resize`){let t=E();_&&e.height<t&&!u&&a(()=>{var n;Al(e)&&e.set({height:t}),(n=r.current)==null||n.height(t)},!1,!0),_||e.height===t||u||a(()=>{var n;Al(e)&&e.set({height:t}),(n=r.current)==null||n.height(t)},!1,!0)}}else{let t=Yf(r.current,e,i);if(t!==e.fontSize){a(()=>{e.set({fontSize:t})},!1,!0);return}let n=E();e.height===n||_||a(()=>{e.set({height:n})},!1,!0)}}),S.useLayoutEffect(()=>{if(T&&e.curveEnabled){let t=i.current?.getSelfRect().width;if(t){let n=t-e.a.width,r=e.a.rotation*Math.PI/180,i=-n/2*Math.cos(r),a=-n/2*Math.sin(r);e.set({width:t,x:e.a.x+i,y:e.a.y+a})}}},[T,e.curveEnabled,e.curvePower,e.text,e.fontSize,e.fontFamily,e.fontWeight,e.fontStyle,e.letterSpacing]),S.useLayoutEffect(()=>{let e=r.current;e&&(e.width(e.width()+1e-8),e.width(e.width()-1e-8),e._setTextData(),C())},[T]);let D=S.useRef(null),O=S.useRef(0),k=n=>{n.evt.preventDefault(),t.selectedShapes.find(t=>t===e)&&e.contentEditable&&(O.current=function(e){let t=e.target,n=function(e){var t=e.getAbsoluteTransform().copy();t.invert();var n=e.getStage().getPointerPosition();return t.point(n)}(t),r=t.textArr,i=Math.floor(n.y/(t.fontSize()*t.lineHeight())),a=r.slice(0,i).reduce((e,t)=>e+t.text.length,i),o=r[i]??r[0],s=0;return t.align()===`right`?s=t.width()-o.width:t.align()===`center`&&(s=t.width()/2-o.width/2),a+Math.round((n.x-s)/o.width*o.text.length)}(n),e.toggleEditMode())},A=!w&&e.placeholder?.6:e.a.opacity;ec(r,A);let j=qf({fontLoaded:T,fontFamily:e.fontFamily,fontSize:e.a.fontSize,lineHeight:e.lineHeight}),M=e.selectable||t.role===`admin`,ee=Xs(e),N=Xs(e,e.stroke,`stroke`),P=S.useMemo(()=>e.backgroundEnabled?e.curveEnabled?function({width:e,height:t,padding:n=0,cornerRadius:r=0}){let i=-n,a=-n,o=e+n,s=t+n;return Hs(Vs(`M ${i} ${a} L ${o} ${a} L ${o} ${s} L ${i} ${s} Z`),r).path}({width:e.a.width,height:e.a.height,cornerRadius:e.backgroundCornerRadius*(e.a.fontSize*j*.5),padding:e.backgroundPadding*(e.a.fontSize*j*.5)}):function({lines:e,lineHeight:t,width:n,align:r=`left`,padding:i=0,cornerRadius:a=0}){return Us({rects:Ws({lines:e,lineHeight:t,width:n,align:r}),padding:i,cornerRadius:a})}({lines:JSON.parse(JSON.stringify(b)),cornerRadius:e.backgroundCornerRadius*(e.a.fontSize*j*.5),lineHeight:j*e.a.fontSize,padding:e.backgroundPadding*(e.a.fontSize*j*.5),width:e.a.width,align:e.align}):``,[e.backgroundEnabled,e.curveEnabled,e.backgroundCornerRadius,e.a.fontSize,e.a.height,j,e.backgroundPadding,e.a.width,e.align,b]),te=il(),ne=0;e.curveEnabled||(e.verticalAlign===`middle`?ne=(e.a.height-b.length*j*e.a.fontSize)/2:e.verticalAlign===`bottom`&&(ne=e.a.height-b.length*j*e.a.fontSize));let re=e.curveEnabled?Yc(e.a.width,e.a.height,e.curvePower,e.a.fontSize):``,F=T?`"`+e.fontFamily+`"`:y===e.fontFamily?`Arial`:`"`+y+`"`;return S.createElement(S.Fragment,null,S.createElement(Ho,{ref:a,x:e.a.x,y:e.a.y,rotation:e.a.rotation,hideInExport:!e.showInExport,listening:!1,visible:e.backgroundEnabled,opacity:e.backgroundOpacity*A,data:P,fill:e.backgroundColor,offsetY:-ne}),S.createElement(Ho,{data:re,stroke:n.stroke,strokeWidth:1,x:e.a.x,y:e.a.y,rotation:e.a.rotation,visible:!1}),S.createElement(Vo,Object.assign({ref:i,visible:e.curveEnabled,data:re,text:w||e.placeholder,listening:!1,align:`center`,textBaseline:`middle`},ee,N,{strokeWidth:e.strokeWidth,lineJoin:`round`,fillAfterStrokeEnabled:!0,fontSize:e.a.fontSize,fontFamily:`"${e.fontFamily}", "${y}"`,fontStyle:e.fontStyle+` `+e.fontWeight,textDecoration:e.textDecoration.trim(),letterSpacing:e.letterSpacing*e.a.fontSize,x:e.a.x,y:e.a.y,rotation:e.a.rotation,opacity:e._editModeEnabled?.3:A,hideInExport:!e.showInExport,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity})),S.createElement(Bo,Object.assign({ref:r,id:e.selectable?e.id:void 0,name:e.selectable?`element`:``,hideInExport:!e.showInExport,editModeEnabled:e._editModeEnabled,x:e.a.x,y:e.a.y,rotation:e.a.rotation,width:e.a.width,height:e.a.height,text:w||e.placeholder,direction:Jc(w)},ee,N,{lineJoin:`round`,strokeWidth:e.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:e.a.fontSize,fontFamily:F,fontStyle:e.fontStyle+` `+e.fontWeight,textDecoration:e.textDecoration,align:e.align,verticalAlign:e.verticalAlign,draggable:te?e.draggable&&h:e.draggable,preventDefault:!te||h,opacity:e.curveEnabled?0:A,visible:!e._editModeEnabled,ellipsis:Lc.textOverflow===`ellipsis`,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,lineHeight:j,letterSpacing:e.letterSpacing*e.a.fontSize,listening:!!e.selectable&&M,onDragStart:()=>{p(!0)},onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{p(!1),e.set({x:t.target.x(),y:t.target.y()})},onClick:k,onTap:k,onTransformStart:()=>{d(!0),m.current=r.current.height()},onTransform:t=>{var n,r;let i=t.target;(n=a.current)==null||n.setAttrs({x:i.x(),y:i.y(),rotation:i.rotation(),scale:i.scale()});let o=(i.getStage()?.findOne(`Transformer`)).getActiveAnchor();if(o===`middle-left`||o===`middle-right`){let t=i.scaleX(),n=i.width()*t,r=e.a.fontSize,a=n;n<r&&(a=r,D.current&&i.position(D.current)),i.width(a),i.scaleX(1),i.scaleY(1);let o=E();if(Lc.textOverflow===`ellipsis`)o=m.current;else{let t=Math.max(o,m.current);i.height(t),e.set({height:i.height()})}let s=Lc.textVerticalResizeEnabled?Math.max(o,m.current):E();e.set({x:i.x(),width:i.width(),rotation:i.rotation(),height:s}),C()}if(o===`top-center`||o===`bottom-center`){let n=Lc.textOverflow===`resize`?E():j*e.a.fontSize;t.target.height(Math.max(n,t.target.height()*t.target.scaleY())),t.target.scaleY(1)}D.current=t.target.position();let s=t.target.scaleX();(r=a.current)==null||r.setAttrs({scaleX:1,scaleY:1}),t.target.scaleX(1),t.target.scaleY(1),e.set({fontSize:e.a.fontSize*s,width:t.target.width()*s,x:t.target.x(),y:t.target.y(),rotation:t.target.rotation(),height:t.target.height()*s,shadowBlur:e.shadowBlur*s,shadowOffsetX:e.shadowOffsetX*s,shadowOffsetY:e.shadowOffsetY*s,strokeWidth:e.strokeWidth*s})},onTransformEnd:t=>{var n;let r=t.target.scaleX();t.target.scaleX(1),t.target.scaleY(1),e.set({fontSize:Math.round(e.a.fontSize*r),width:Math.ceil(t.target.width()*r),x:t.target.x(),y:t.target.y(),rotation:t.target.rotation(),height:t.target.height()*r,shadowBlur:e.shadowBlur*r,shadowOffsetX:e.shadowOffsetX*r,shadowOffsetY:e.shadowOffsetY*r,strokeWidth:e.strokeWidth*r}),(n=a.current)==null||n.setAttrs({scaleX:1,scaleY:1}),d(!1)}})),c&&e.contentEditable&&S.createElement(`Group`,{x:e.a.x,y:e.a.y,rotation:e.a.rotation},S.createElement(Gf,{textNodeRef:r,element:e,selectAll:l,cursorPosition:O.current,onBlur:()=>{e.toggleEditMode(!1)}})))}),Zf=n(((e,t)=>{e=t.exports=n;function n(e){return r.bind(null,e)}function r(e){var t=[].slice.call(arguments,1);t.unshift(`[`+e+`]`),process.stderr.write(t.join(` `)+`
35
- `)}})),Qf=n(((e,t)=>{var n=!1,r=!1,i=Zf()(`lex`);e=t.exports=a;function a(e){var t,a=``,o,s=0,c=-1,l=0,u=1,d=`before-selector`,f=[d],p={},m=[],h=[`media`,`keyframes`,{name:`-webkit-keyframes`,type:`keyframes`,prefix:`-webkit-`},{name:`-moz-keyframes`,type:`keyframes`,prefix:`-moz-`},{name:`-ms-keyframes`,type:`keyframes`,prefix:`-ms-`},{name:`-o-keyframes`,type:`keyframes`,prefix:`-o-`},`font-face`,{name:`import`,state:`before-at-value`},{name:`charset`,state:`before-at-value`},`supports`,`viewport`,{name:`namespace`,state:`before-at-value`},`document`,{name:`-moz-document`,type:`document`,prefix:`-moz-`},`page`];function g(){return T(),e[c]}function _(e){return e?f[f.length-1-e]:d}function v(t){var n=c+1;return t===e.slice(n,n+t.length)}function y(t){var n=e.slice(c).indexOf(t);return n>0?n:!1}function b(e){return e===x(1)}function x(t){return e[c+(t||1)]}function S(){var e=f.pop();return d=f[f.length-1],e}function C(e){return d=e,f.push(d),f.length}function w(e){var t=d;return f[f.length-1]=d=e,t}function T(t){if((t||1)==1)e[c]==`
36
- `?(u++,s=1):s++,c++;else{var n=e.slice(c,c+t).split(`
37
- `);n.length>1&&(u+=n.length-1,s=1),s+=n[n.length-1].length,c+=t}}function E(){p.end={line:u,col:s},n&&i(`addToken:`,JSON.stringify(p,null,2)),m.push(p),a=``,p={}}function D(e){p={type:e,start:{line:u,col:s}}}for(r&&(t=Date.now());o=g();)switch(n&&i(o,_()),o){case` `:switch(_()){case`selector`:case`value`:case`value-paren`:case`at-group`:case`at-value`:case`comment`:case`double-string`:case`single-string`:a+=o;break}break;case`
38
- `:case` `:case`\r`:case`\f`:switch(_()){case`value`:case`value-paren`:case`at-group`:case`comment`:case`single-string`:case`double-string`:case`selector`:a+=o;break;case`at-value`:o===`
39
- `&&(p.value=a.trim(),E(),S());break}break;case`:`:switch(_()){case`name`:p.name=a.trim(),a=``,w(`before-value`);break;case`before-selector`:a+=o,D(`selector`),C(`selector`);break;case`before-value`:w(`value`),a+=o;break;default:a+=o;break}break;case`;`:switch(_()){case`name`:case`before-value`:case`value`:a.trim().length>0&&(p.value=a.trim(),E()),w(`before-name`);break;case`value-paren`:a+=o;break;case`at-value`:p.value=a.trim(),E(),S();break;case`before-name`:break;default:a+=o;break}break;case`{`:switch(_()){case`selector`:if(x(-1)===`\\`){a+=o;break}p.text=a.trim(),E(),w(`before-name`),l+=1;break;case`at-group`:switch(p.name=a.trim(),p.type){case`font-face`:case`viewport`:case`page`:C(`before-name`);break;default:C(`before-selector`)}E(),l+=1;break;case`name`:case`at-rule`:p.name=a.trim(),E(),C(`before-name`),l+=1;break;case`comment`:case`double-string`:case`single-string`:a+=o;break;case`before-value`:w(`value`),a+=o;break}break;case`}`:switch(_()){case`before-name`:case`name`:case`before-value`:case`value`:a&&(p.value=a.trim()),p.name&&p.value&&E(),D(`end`),E(),S(),_()===`at-group`&&(D(`at-group-end`),E(),S()),l>0&&--l;break;case`at-group`:case`before-selector`:case`selector`:if(x(-1)===`\\`){a+=o;break}l>0&&_(1)===`at-group`&&(D(`at-group-end`),E()),l>1&&S(),l>0&&--l;break;case`double-string`:case`single-string`:case`comment`:a+=o;break}break;case`"`:case`'`:switch(_()){case`double-string`:o===`"`&&x(-1)!==`\\`&&S();break;case`single-string`:o===`'`&&x(-1)!==`\\`&&S();break;case`before-at-value`:w(`at-value`),C(o===`"`?`double-string`:`single-string`);break;case`before-value`:w(`value`),C(o===`"`?`double-string`:`single-string`);break;case`comment`:break;default:x(-1)!==`\\`&&C(o===`"`?`double-string`:`single-string`)}a+=o;break;case`/`:switch(_()){case`comment`:case`double-string`:case`single-string`:a+=o;break;case`before-value`:case`selector`:case`name`:case`value`:if(b(`*`)){var O=y(`*/`);O&&T(O+1)}else _()==`before-value`&&w(`value`),a+=o;break;default:b(`*`)?(D(`comment`),C(`comment`),T()):a+=o;break}break;case`*`:switch(_()){case`comment`:b(`/`)?(p.text=a,T(),E(),S()):a+=o;break;case`before-selector`:a+=o,D(`selector`),C(`selector`);break;case`before-value`:w(`value`),a+=o;break;default:a+=o}break;case`@`:switch(_()){case`comment`:case`double-string`:case`single-string`:a+=o;break;case`before-value`:w(`value`),a+=o;break;default:for(var k=!1,A,j,M=0,ee=h.length;!k&&M<ee;++M)j=h[M],A=j.name||j,v(A)&&(k=!0,D(A),C(j.state||`at-group`),T(A.length),j.prefix&&(p.prefix=j.prefix),j.type&&(p.type=j.type));k||(a+=o);break}break;case`(`:switch(_()){case`value`:C(`value-paren`);break;case`before-value`:w(`value`);break}a+=o;break;case`)`:switch(_()){case`value-paren`:S();break;case`before-value`:w(`value`);break}a+=o;break;default:switch(_()){case`before-selector`:D(`selector`),C(`selector`);break;case`before-name`:D(`property`),w(`name`);break;case`before-value`:w(`value`);break;case`before-at-value`:w(`at-value`);break}a+=o;break}return r&&i(`ran in`,Date.now()-t+`ms`),m}})),$f=n(((e,t)=>{var n=!1,r=!1,i=Zf()(`parse`),a=Qf();e=t.exports=u;var o,s,c,l;function u(e,t){var n;t||={},o=!!t.comments,c=!!t.position,s=0,l=Array.isArray(e)?e.slice():a(e);var u,d=[],p;for(r&&(n=Date.now());p=f();)u=b(p),u&&d.push(u);return r&&i(`ran in`,Date.now()-n+`ms`),{type:`stylesheet`,stylesheet:{rules:d}}}function d(e,t){t||={};for(var r,a=[`type`,`name`,`value`],o={},s=0;s<a.length;++s)r=a[s],e[r]&&(o[r]=t[r]||e[r]);for(a=Object.keys(t),s=0;s<a.length;++s)r=a[s],o[r]||(o[r]=t[r]);return c&&(o.position={start:e.start,end:e.end}),n&&i(`astNode:`,JSON.stringify(o,null,2)),o}function f(){var e=l.shift();return n&&i(`next:`,JSON.stringify(e,null,2)),e}function p(e){s+=1;var t={};switch(e.type){case`font-face`:case`viewport`:t.declarations=S();break;case`page`:t.prefix=e.prefix,t.declarations=S();break;default:t.prefix=e.prefix,t.rules=C()}return d(e,t)}function m(e){return d(e)}function h(e){return d(e)}function g(e){return d(e,{text:e.text})}function _(e){return d(e)}function v(e){return d(e)}function y(e){function t(e){return e.trim()}return d(e,{type:`rule`,selectors:e.text.split(`,`).map(t),declarations:S(e)})}function b(e){switch(e.type){case`property`:return v(e);case`selector`:return y(e);case`at-group-end`:--s;return;case`media`:case`keyframes`:return p(e);case`comment`:if(o)return g(e);break;case`charset`:return h(e);case`import`:return m(e);case`namespace`:return _(e);case`font-face`:case`supports`:case`viewport`:case`document`:case`page`:return p(e)}n&&i(`parseToken: unexpected token:`,JSON.stringify(e))}function x(e){for(var t,n=[],r;(r=f())&&e&&e(r);)t=b(r),t&&n.push(t);return r&&r.type!==`end`&&l.unshift(r),n}function S(){return x(function(e){return e.type===`property`||e.type===`comment`})}function C(){return x(function(){return s})}})),ep=n(((e,t)=>{var n=!1,r=!1,i=Zf()(`stringify`),a,o,s,c,l,u;e=t.exports=d;function d(e,t){var n;t||={},s=t.indentation||``,o=!!t.compress,a=!!t.comments,c=1,o?l=u=``:(l=`
40
- `,u=` `),r&&(n=Date.now());var d=_(e.stylesheet.rules,x).join(`
41
- `).trim();return r&&i(`ran in`,Date.now()-n+`ms`),d}function f(e){if(e){c+=e;return}return o?``:Array(c).join(s||``)}function p(e){return`@`+e.type+` `+e.value+`;`+l}function m(e){var t=``,n=e.prefix||``;e.name&&(t=` `+e.name);var r=e.type!==`page`;return`@`+n+e.type+t+u+v(e,r)+l}function h(e){return a?`/*`+(e.text||``)+`*/`+l:``}function g(e){var t;return e.selectors?t=e.selectors.join(`,`+l):(t=`@`+e.type,t+=e.name?` `+e.name:``),f()+t+u+v(e)+l}function _(e,t){return e.reduce(function(e,n){var r=n.type===`comment`?h(n):t(n);return r&&e.push(r),e},[])}function v(e,t){var n=e.declarations,r=b;return e.rules&&(n=e.rules,r=g),n=y(n,r),n&&=l+n+(t?``:l),`{`+n+f()+`}`}function y(e,t){if(!e)return``;f(1);var n=_(e,t);return f(-1),n.length?n.join(l):``}function b(e){if(e.type===`property`)return S(e);n&&i(`stringifyDeclaration: unexpected node:`,JSON.stringify(e))}function x(e){switch(e.type){case`rule`:return g(e);case`media`:case`keyframes`:return m(e);case`comment`:return h(e);case`import`:case`charset`:case`namespace`:return p(e);case`font-face`:case`supports`:case`viewport`:case`document`:case`page`:return m(e)}n&&i(`stringifyNode: unexpected node: `+JSON.stringify(e))}function S(e){var t=e.name?e.name+`:`+u:``;return f()+t+e.value+`;`}})),tp=t(n(((e,t)=>{t.exports={lex:Qf(),parse:$f(),stringify:ep()}}))(),1);function np(e){for(;e.parentNode;){if(e.nodeName===`defs`)return!0;e=e.parentNode}return!1}function rp(e){let t={};return e.querySelectorAll(`style`).forEach(e=>{let n=tp.default.parse(e.textContent).stylesheet.rules;for(let e of n)e.selectors&&e.selectors.forEach(n=>{let r=t[n]||{};e.declarations.forEach(e=>{r[e.name]=e.value}),t[n]=r})}),t}function ip(e,t){let n={fill:``,stroke:``},r=e.getAttribute(`class`)?.split(` `)||[],i=e.getAttribute(`id`),a={};i&&t[`#${i}`]?a=t[`#${i}`]:r.forEach(e=>{t[`.${e}`]&&(a=Object.assign(Object.assign({},a),t[`.${e}`]))}),t[e.nodeName]&&(a=Object.assign(Object.assign({},a),t[e.nodeName]));let o=e.getAttribute(`fill`);o&&o!==`none`?n.fill=o:a.fill&&a.fill!==`none`&&(n.fill=a.fill);let s=e.getAttribute(`stroke`);if(s&&s!==`none`?n.stroke=s:a.stroke&&a.stroke!==`none`&&(n.stroke=a.stroke),!n.fill&&e.style.fill&&e.style.fill!==`none`&&(n.fill=e.style.fill),!n.stroke&&e.style.stroke&&e.style.stroke!==`none`&&(n.stroke=e.style.stroke),!n.stroke&&!n.fill){let r=e.ownerSVGElement,i=r&&r!==e?ip(r,t):null;i?.fill===`currentColor`||i?.stroke===`currentColor`||(n.fill=`black`)}return n}var ap=[`path`,`rect`,`circle`,`line`,`polygon`,`polyline`,`ellipse`,`text`];function op(e){for(var t=[],n=e.getElementsByTagName(`*`),r=0,i=n.length;r<i;r++){let e=n[r];np(e)||(e.getAttribute(`fill`)!==null&&t.push(e),(e.getAttribute(`stroke`)!==null||e.style&&e.style.fill||ap.indexOf(e.nodeName)>=0)&&t.push(e))}return t}async function sp(e){return lp(await(await fetch(e)).text())}async function cp(e){return await(await fetch(e,{mode:`cors`})).text()}function lp(e){return`data:image/svg+xml;base64,`+window.btoa(unescape(encodeURIComponent(e)))}function up(e){var t=new DOMParser().parseFromString(e,`image/svg+xml`);let[n,r,i,a]=t.documentElement.getAttribute(`viewBox`)?.split(` `)||[],o=t.documentElement.getAttribute(`width`);!o&&t.documentElement.setAttribute(`width`,i+`px`);let s=t.documentElement.getAttribute(`height`);if((!s||s.indexOf(`%`)>=0)&&t.documentElement.setAttribute(`height`,a+`px`),o&&o.indexOf(`%`)>=0&&s&&s.indexOf(`%`)===-1){let e=parseFloat(s)/parseFloat(a);t.documentElement.setAttribute(`width`,e*parseFloat(i)+`px`)}if(s&&s.indexOf(`%`)>=0&&o&&o.indexOf(`%`)===-1){let e=parseFloat(o)/parseFloat(i);t.documentElement.setAttribute(`height`,e*parseFloat(a)+`px`)}return o===`100%`&&s===`100%`&&(t.documentElement.setAttribute(`width`,i+`px`),t.documentElement.setAttribute(`height`,a+`px`)),new XMLSerializer().serializeToString(t)}var dp=(e,t)=>{if(!e||!t)return!1;if(t===`currentColor`&&e===`black`)return!0;let n=a.Util.colorToRGBA(e),r=a.Util.colorToRGBA(t);return n&&r?n.r===r.r&&n.g===r.g&&n.b===r.b&&n.a===r.a:void 0};function fp(e,t){var n=new DOMParser().parseFromString(e,`image/svg+xml`);let r=op(n),i=Array.from(t.keys()),o=rp(n);return r.forEach(e=>{let{fill:r,stroke:s}=ip(e,o);[{prop:`fill`,color:r},{prop:`stroke`,color:s}].forEach(({prop:r,color:o})=>{let s=i.find(e=>dp(e,o));if(s){let i=t.get(s);if(qs(i)){let{rotation:t,stops:o}=Ys(i),s=o.map(e=>({offset:100*e.offset+`%`,"stop-color":e.color})),c=`color`+Math.round(1e8*Math.random());(function(e,t,n,r){var i=e.namespaceURI,o=document.createElementNS(i,`linearGradient`);let s=a.Util.degToRad(n+90),c=(Math.cos(s)+1)/2,l=(Math.sin(s)+1)/2,u=(Math.cos(s+Math.PI)+1)/2,d=(Math.sin(s+Math.PI)+1)/2;o.setAttribute(`x1`,100*c+`%`),o.setAttribute(`y1`,100*l+`%`),o.setAttribute(`x2`,100*u+`%`),o.setAttribute(`y2`,100*d+`%`),o.setAttribute(`gradientUnits`,`userSpaceOnUse`),o.setAttribute(`id`,t);for(var f=0;f<r.length;f++){var p=r[f],m=document.createElementNS(i,`stop`);for(var h in p)p.hasOwnProperty(h)&&m.setAttribute(h,p[h]);o.appendChild(m)}(e.querySelector(`defs`)||e.insertBefore(document.createElementNS(i,`defs`),e.firstChild)).appendChild(o)})(n.children[0],c,t,s),e.style[r]=null,e.setAttribute(r,`url('#${c}')`)}else e.style[r]=t.get(s)}})}),lp(new XMLSerializer().serializeToString(n))}var pp=(e,t=100,n=!1,r)=>{let i=S.useRef(r??e),[,a]=S.useReducer(e=>e+1,0),o=S.useCallback(e=>{i.current!==e&&(i.current=e,a())},[i]),s=S.useRef(null);return e===n&&(s.current&&=(clearTimeout(s.current),null),i.current=n),S.useEffect(()=>(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{o(e),s.current=null},t),()=>{s.current&&clearTimeout(s.current)}),[e,t,n]),[i.current,o]};function mp(){return document.createElement(`canvas`)}var hp=e=>e.indexOf(`data:image/svg+xml`)>=0||e.indexOf(`.svg`)>=0,gp=e=>{let[t,n]=S.useState(e);return S.useEffect(()=>{(async()=>{let r=await async function(e){return hp(e)?lp(up(await cp(e))):e}(e);r!==t&&n(r)})()},[e]),t};function _p(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}var vp=[`top-left`,`top-right`,`bottom-left`,`bottom-right`],yp=(e,t)=>t.width<5||t.height<5?e:t,bp={enabledAnchors:vp,keepRatio:!1,rotateEnabled:!1,boundBoxFunc:yp},xp={enabledAnchors:vp,rotateEnabled:!1,borderEnabled:!1,boundBoxFunc:yp},Sp=(e,t,n)=>Math.max(t,Math.min(n,e)),Cp=(e,t,n,r,i=0,o=!1,s=!0)=>{let c=Math.floor(Sp(e.a.width*r,1,1e4)),l=Math.floor(Sp(e.a.height*r,1,1e4)),u=Math.min(i*r,c/2,l/2),d=Math.max(e.a.width/n.width,e.a.height/n.height)*r,f=e.page._exportingOrRendering&&Lc.imageDownScalingEnabled&&d<1&&!o,m=n.x===0&&n.y===0&&n.width===t?.width&&n.height===t?.height,h=S.useMemo(()=>{if(t&&t.width&&t.height)return m&&u===0&&!f?void 0:mp()},[t,u,f,m]);return S.useLayoutEffect(()=>{if(!h||!t)return;p(h,c,l);let e=h.getContext(`2d`);if(!e)return;u&&(e.beginPath(),e.moveTo(u,0),e.lineTo(c-u,0),e.arc(c-u,u,u,3*Math.PI/2,0,!1),e.lineTo(c,l-u),e.arc(c-u,l-u,u,0,Math.PI/2,!1),e.lineTo(u,l),e.arc(u,l-u,u,Math.PI/2,Math.PI,!1),e.lineTo(0,u),e.arc(u,u,u,Math.PI,3*Math.PI/2,!1),e.clip());let r=f?function(e,t){var n,r;let i=mp();i.width=e.width,i.height=e.height;let a=Math.max(1,Math.floor(i.width*t)),o=Math.max(1,Math.floor(i.height*t));(n=i.getContext(`2d`))==null||n.drawImage(e,0,0,i.width,i.height);let s=function(e,t,n,r,i,a,o){for(var s=new ImageData(t,n),c=new Int32Array(e.data.buffer),l=e.width,u=new Int32Array(s.data.buffer),d=s.width,f=t/a,p=n/o,m=Math.round(1/f),h=Math.round(1/p),g=m*h,_=0;_<s.height;_++)for(var v=0;v<d;v++){for(var y=0+Math.round(v/f)+(0+Math.round(_/p))*l,b=0,x=0,S=0,C=0,w=0;w<h;w++)for(var T=0;T<m;T++){var E=c[y+T+w*l];b+=E<<24>>>24,x+=E<<16>>>24,S+=E<<8>>>24,C+=E>>>24}b=Math.round(b/g),x=Math.round(x/g),S=Math.round(S/g),C=Math.round(C/g),u[v+_*d]=C<<24|S<<16|x<<8|b}return s}(i.getContext(`2d`).getImageData(0,0,i.width,i.height),a,o,0,0,i.width,i.height);return i.width=a,i.height=o,(r=i.getContext(`2d`))==null||r.putImageData(s,0,0),i}(t,d):t,i=f?{x:Math.floor(n.x*d),y:Math.floor(n.y*d),width:Math.floor(n.width*d),height:Math.floor(n.height*d)}:n;e.drawImage(r,i.x,i.y,i.width,i.height,0,0,h.width,h.height)},[h,e.a.width,e.a.height,n.x,n.y,n.width,n.height,i,r,o,e.page._exportingOrRendering,f]),S.useEffect(()=>()=>{h&&h.nodeName===`CANVAS`&&a.Util.releaseCanvas(h)},[h]),h||t},wp=mp(),Tp=U(({element:e})=>{let t=Math.min(30,e.a.width/4,e.a.height/4),n=S.useRef(null);S.useEffect(()=>{let e=n.current;if(!e)return;let t=new a.Animation(t=>{e.rotate((t?.timeDiff||0)/2)},e.getLayer());return t.start(),()=>{t.stop()}});let{mediaLoadingStyle:r}=ps();return S.createElement(Fo,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},S.createElement(Lo,{width:e.a.width,height:e.a.height,fill:r.fill}),S.createElement(`Arc`,{ref:n,x:e.a.width/2,y:e.a.height/2,fill:r.textFill,outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270}))}),Ep=U(({element:e})=>{let{mediaErrorStyle:t}=ps(),n=Math.max(10,Math.min(30,e.a.width/25));return S.createElement(Fo,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},S.createElement(Lo,{width:e.a.width,height:e.a.height,fill:t.fill}),S.createElement(Bo,{text:`Can not load the image...`,fontSize:n,width:e.a.width,height:e.a.height,align:`center`,fill:t.textFill,verticalAlign:`middle`,padding:5}))}),Dp=Ko.default,Op=(e,t=``,n=``)=>{let r=S.useRef(),i=()=>{var e;(e=r.current)==null||e.call(r),r.current=void 0};S.useEffect(()=>i,[]),S.useLayoutEffect(()=>{let a=`image with id ${n} url: ${t.slice(0,200)}`;e!==`loading`||r.current||(r.current=cc(a)),e!==`loading`&&i(),e===`failed`&&pc(a)},[e])},kp=U(({element:e,store:t})=>{let n=ps(),[r,i]=S.useState(!1),o=S.useRef(null),s=S.useRef(null),c=e.isSelected,[l,u]=(e=>{let[t,n]=S.useReducer(e=>e+1,0),r=S.useRef(`loading`),i=S.useRef(e.src),a=S.useRef(e.src);a.current!==e.src&&(a.current=e.src,r.current=`loading`);let o=S.useMemo(()=>hp(e.src)||e.type===`svg`,[e.src,e.type]);return S.useEffect(()=>{if(!o||!e.src)return;let t=!1;return(async()=>{r.current=`loading`,n();let a=up(await cp(e.src)),o;o=e.colorsReplace?fp(a,e.colorsReplace||new Map):lp(a),t||(i.current=o,r.current=`loaded`,n())})(),()=>{t=!0}},[e.src,JSON.stringify(e.colorsReplace)]),o?[i.current,r.current]:[e.src,`loaded`]})(e),[d,f]=Dp(l,`anonymous`);Op(e.type!==`svg`||u===`loaded`?f:`loading`,e.src,e.id);let m=e.page._exportingOrRendering?1:Math.max(1,t.scale),h=t._elementsPixelRatio*m,g=(({image:e,status:t,type:n})=>{let r=S.useRef();return S.useEffect(()=>{r.current=e||r.current},[e]),t!==`failed`||t!==`failed`&&n===`svg`?r.current:void 0})({image:d,status:f,type:e.type}),_=((e,t)=>{let n=gp(e.maskSrc||``),[r,i]=Dp(n,`anonymous`);return Op(n?i:`loaded`,n||``,e.id),S.useMemo(()=>{if(!r||!t||!t.width||!t.height)return t;let n=mp();n.width=Math.max(t.width,1),n.height=Math.max(t.height,1);let i=n.getContext(`2d`);if(!i)return t;i.drawImage(t,0,0),i.globalCompositeOperation=`source-in`;let a=function(e,t){let n=t.width/t.height,r,i;return n>=e.width/e.height?(r=e.width,i=e.width/n):(r=e.height*n,i=e.height),{x:(e.width-r)/2,y:(e.height-i)/2,width:r,height:i}}(r,e);return i.drawImage(r,a.x,a.y,a.width,a.height,0,0,t.width,t.height),n},[t,r,e.a.width,e.a.height])})(e,((e,t,n)=>{let r=S.useMemo(()=>{var r,i;let{flipX:a,flipY:o}=e,s=e.type===`svg`||e.src.indexOf(`data:image/svg+xml`)>=0||e.src.indexOf(`.svg`)>=0,c=navigator.userAgent.toLowerCase().indexOf(`firefox`)>-1,l=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||c)&&s||e.maskSrc;if(!a&&!o&&!l)return t;if(!t||!t.width||!t.height)return null;let u=mp(),d=1;e.type===`svg`&&(d=Math.max(e.a.width/t.width*n,e.a.height/t.height*n)),p(u,Math.max(t.width*d,1),Math.max(t.height*d,1));let f=a?-u.width:0,m=o?-u.height:0;return(r=u.getContext(`2d`))==null||r.scale(a?-1:1,o?-1:1),(i=u.getContext(`2d`))==null||i.drawImage(t,f,m,u.width,u.height),u},[e.maskSrc,e.flipX,e.flipY,t,e.a.width,e.a.height,n]);return S.useEffect(()=>()=>{r&&r.nodeName===`CANVAS`&&a.Util.releaseCanvas(r)},[r]),r})(e,d||g,h))||wp,{cropX:v,cropY:y,cropWidth:b,cropHeight:x}=e.a;f!==`loaded`&&(v=y=0,b=x=1);let C=_.width*b,w=_.height*x,T=e.a.width/e.a.height,E,D,O=C/w,k=e.stretchEnabled;k?(E=C,D=w):T>=O?(E=C,D=C/T):(E=w*T,D=w);let A={x:_.width*v,y:_.height*y,width:E,height:D},j=e.cornerRadius??0,M=e.page._exportingOrRendering?1:Math.min(2,t.scale),ee=t._elementsPixelRatio*M,N=((e,t,n,r)=>{let[i,o]=Dp(gp(e.clipSrc||``),`anonymous`);Op(e.clipSrc?o:`loaded`,e.clipSrc,e.id);let s=S.useMemo(()=>{if(t&&i)return mp()},[t,i]);return S.useLayoutEffect(()=>{var r;if(!i||!t||!t.width||!t.height||!i||!i.width||!i.height||!s)return;let o=mp(),c=Math.max(e.a.width/i.width*n,e.a.height/i.height*n);o.width=Math.max(i.width*c,1),o.height=Math.max(i.height*c,1),(r=o.getContext(`2d`))==null||r.drawImage(i,0,0,o.width,o.height),s.width=Math.max(t.width,1),s.height=Math.max(t.height,1);let l=s.getContext(`2d`);l&&(l.save(),l.drawImage(o,0,0,t.width,t.height),a.Util.releaseCanvas(o),l.globalCompositeOperation=`source-in`,l.drawImage(t,0,0,s.width,s.height),l.restore())},[s,t,i,e.a.width,e.a.height,n,...r]),e.clipSrc&&i?s:t})(e,Cp(e,_,A,ee,j,r||e._cropModeEnabled||e.type===`svg`,!0),ee,[A,j,ee]),P=Math.max(e.a.width/E,e.a.height/D);S.useEffect(()=>{if(!e._cropModeEnabled)return;let t=o.current?.getStage();function n(t){e._cropModeEnabled&&t.target!==s.current&&e.toggleCropMode(!1)}function r(n){e._cropModeEnabled&&n.target.parentNode!==t?.content&&e.toggleCropMode(!1)}return document.body.addEventListener(`click`,r),t?.on(`click`,n),t?.on(`tap`,n),()=>{document.body.removeEventListener(`click`,r),document.body.removeEventListener(`touchstart`,r),t?.off(`click`,n),t?.off(`click`,n)}},[e._cropModeEnabled]),S.useLayoutEffect(()=>{if(!r&&!e._cropModeEnabled)return rl(o.current,e),$n(()=>{rl(o.current,e)},{delay:100})},[N,e.page._exportingOrRendering,r,b,x,e._cropModeEnabled]),S.useLayoutEffect(()=>{var t;r||e._cropModeEnabled?(t=o.current)==null||t.clearCache():rl(o.current,e)},[r,e.a.width,e.a.height,e._cropModeEnabled]),S.useEffect(()=>{rl(o.current,e)},[e.shadowEnabled,e.shadowBlur,e.cornerRadius,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]);let te=S.useRef(null),ne=S.useRef(null),re=S.useRef(null);S.useLayoutEffect(()=>{e._cropModeEnabled&&(ne.current.nodes([te.current]),re.current.nodes([s.current]))},[e._cropModeEnabled]);var F=S.useRef(null),I=S.useRef(0),L=S.useRef(!1);let ie=t=>{t.evt.touches?.length>2&&t.target.stopDrag(),Math.round(t.target.x())>0&&(t.target.x(0),t.target.scaleX(1)),Math.round(t.target.y())>0&&(t.target.y(0),t.target.scaleY(1));let n=t.target.width()*t.target.scaleX(),r=t.target.height()*t.target.scaleY(),i=Math.min(1,E/n),a=Math.min(1,D/r),o=1-i,s=Math.min(o,Math.max(0,Math.round(-t.target.x())/n)),c=1-a,l=Math.min(c,Math.max(0,Math.round(-t.target.y())/r));t.target.setAttrs({x:-s*_.width,y:-l*_.height,scaleX:1,scaleY:1}),e.set({cropX:s,cropY:l,cropWidth:i,cropHeight:a})},ae=()=>{e.type!==`svg`&&e.contentEditable&&(e.stretchEnabled||setTimeout(()=>{e.toggleCropMode(!0)}))},oe=e.type===`svg`&&g,[se]=pp(f===`loading`&&!oe,100,!1,!1),ce=f===`failed`,le=!se&&!ce,ue=S.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),de=le?e.a.opacity:0;ec(o,de);let fe=e.selectable||t.role===`admin`,pe=il(),me=Xs(e,e.borderColor,`stroke`);return S.createElement(S.Fragment,null,se&&S.createElement(Tp,{element:e}),ce&&S.createElement(Ep,{element:e}),S.createElement(zo,{ref:o,name:`element`,id:e.id,image:N,x:e.a.x,y:e.a.y,width:e.a.width||1,height:e.a.height||1,rotation:e.a.rotation,opacity:de,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:A,listening:fe,draggable:pe?e.draggable&&c:e.draggable,preventDefault:!pe||c,hideInExport:!e.showInExport,onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDblClick:ae,onDblTap:ae,onTransformStart:()=>{i(!0),ue.current={cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}},onTransform:t=>{let n=t.currentTarget,r=Math.abs(n.scaleX()-1)<1e-7?1:n.scaleX(),i=Math.abs(n.scaleY()-1)<1e-7?1:n.scaleY();n.scaleX(1),n.scaleY(1);let a=t.target.getStage()?.findOne(`Transformer`),o=1-E/_.width,s=Math.min(o,Math.max(0,e.cropX)),c=1-D/_.height,l=Math.min(c,Math.max(0,e.cropY)),u=a.getActiveAnchor(),d=!(u.indexOf(`middle`)>=0||u.indexOf(`center`)>=0),f=!d&&r<1&&ue.current.cropHeight>D/_.height,p=d?e.cropWidth:e.cropWidth*r;f&&(p=e.cropWidth);let m=!d&&i<1&&ue.current.cropWidth>E/_.width,h=d?e.cropHeight:e.cropHeight*i;m&&(h=e.cropHeight),k&&(p=e.cropWidth,h=e.cropHeight),e.set({cropX:s,cropY:l,x:n.x(),y:n.y(),width:n.width()*r,height:n.height()*i,rotation:t.target.rotation(),cropWidth:Math.min(p,1-s),cropHeight:Math.min(h,1-l)})},onTransformEnd:t=>{let n=t.currentTarget;e.set({width:n.width(),height:n.height(),x:n.x(),y:n.y(),rotation:t.target.rotation(),cropWidth:E/_.width,cropHeight:D/_.height}),i(!1)}}),S.createElement(Lo,Object.assign({x:e.x,y:e.y,width:Math.max(e.a.width-e.borderSize,0),height:Math.max(e.a.height-e.borderSize,0),opacity:de,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2},me,{strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,j-e.borderSize),hideInExport:!e.showInExport})),e._cropModeEnabled&&S.createElement(Cs,{selector:`.page-abs-container`,enabled:!0},S.createElement(`Rect`,{x:-window.innerWidth/t.scale,y:-window.innerWidth/t.scale,width:window.innerWidth/t.scale*3,height:window.innerWidth/t.scale*3,fill:n.cropOverlayFill}),S.createElement(`Image`,{listening:!1,image:N,x:e.x,y:e.y,width:e.a.width,height:e.a.height,rotation:e.rotation,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur}),S.createElement(`Group`,{x:e.x,y:e.y,rotation:e.rotation,scaleX:P,scaleY:P},S.createElement(`Image`,{image:_,ref:s,opacity:.4,draggable:!0,x:-e.cropX*_.width,y:-e.cropY*_.height,onDragMove:ie,onTransform:ie,onTouchMove:e=>{e.evt.preventDefault();let t=e.target.getStage().getPointersPositions();var n=t[0],r=t[1];let i=e.target;if(n&&!r&&!i.isDragging()&&L.current&&(i.startDrag(),L.current=!1),n&&r){a.hitOnDragEnabled=!0,i.isDragging()&&(L.current=!0,i.stopDrag());let t=e.target.getAbsoluteTransform().copy();t.invert();var o={x:n.x,y:n.y},s={x:r.x,y:r.y};if(!F.current){F.current=_p(o,s);return}var c=_p(o,s),l=function(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}(o,s);I.current||=l;let h=i.position();var u={x:c.x-h.x,y:c.y-h.y},d=l/I.current;i.scaleX(d),i.scaleY(d);let g=t.point(c),_=t.point(F.current);var f=g.x-_.x,p=g.y-_.y,m={x:Math.min(0,c.x-u.x*d+f),y:Math.min(0,c.y-u.y*d+p)};i.position(m),I.current=l,F.current=c,ie(e)}},onTouchEnd:e=>{I.current=0,F.current=null,a.hitOnDragEnabled=!1}}),S.createElement(`Transformer`,Object.assign({ref:re},xp,n.outerImageCropTransformerStyle)),S.createElement(`Rect`,{width:E,height:D,ref:te,listening:!1,onTransform:t=>{if(e.cropX<Math.abs(t.target.x()/_.width)&&t.target.x()<0&&e.cropX>0){let n=(e.cropWidth+e.cropX)*_.width;t.target.scaleX(1),t.target.width(n)}if(e.cropY<Math.abs(t.target.y()/_.height)&&t.target.y()<0&&e.cropY>0){let n=(e.cropHeight+e.cropY)*_.height;t.target.scaleY(1),t.target.height(n)}t.target.x()<-e.cropX*_.width-1e-9&&(t.target.x(-e.cropX*_.width),t.target.scaleX(1)),t.target.y()<-e.cropY*_.height-1e-9&&(t.target.y(-e.cropY*_.height),t.target.scaleY(1));let n=Math.min(1,Math.max(0,e.cropX+t.target.x()/_.width)),r=Math.min(1,Math.max(0,t.target.y()/_.height+e.cropY)),i=t.target.width()*t.target.scaleX(),a=t.target.height()*t.target.scaleY(),o=Math.min(1-n,i/_.width),s=Math.min(1-r,a/_.height),c=t.target.getAbsolutePosition(t.target.getParent().getParent());t.target.scale({x:1,y:1}),t.target.position({x:0,y:0}),e.set({x:c.x,y:c.y,cropX:n,cropY:r,cropWidth:o,cropHeight:s,width:Math.min(i*P,_.width*(1-n)*P),height:Math.min(a*P,_.height*(1-r)*P)})}}),S.createElement(`Transformer`,Object.assign({ref:ne},bp,n.innerImageCropTransformerStyle,{visible:e.resizable})))))}),Ap=t(n(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.Quill=r():n.Quill=r()})(typeof self<`u`?self:e,function(){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=109)})([(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=n(17),i=n(18),a=n(19),o=n(45),s=n(46),c=n(47),l=n(48),u=n(49),d=n(12),f=n(32),p=n(33),m=n(31),h=n(1);t.default={Scope:h.Scope,create:h.create,find:h.find,query:h.query,register:h.register,Container:r.default,Format:i.default,Leaf:a.default,Embed:l.default,Scroll:o.default,Block:c.default,Inline:s.default,Text:u.default,Attributor:{Attribute:d.default,Class:f.default,Style:p.default,Store:m.default}}}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0});var i=function(e){r(t,e);function t(t){var n=this;return t=`[Parchment] `+t,n=e.call(this,t)||this,n.message=t,n.name=n.constructor.name,n}return t}(Error);t.ParchmentError=i;var a={},o={},s={},c={};t.DATA_KEY=`__blot`;var l;(function(e){e[e.TYPE=3]=`TYPE`,e[e.LEVEL=12]=`LEVEL`,e[e.ATTRIBUTE=13]=`ATTRIBUTE`,e[e.BLOT=14]=`BLOT`,e[e.INLINE=7]=`INLINE`,e[e.BLOCK=11]=`BLOCK`,e[e.BLOCK_BLOT=10]=`BLOCK_BLOT`,e[e.INLINE_BLOT=6]=`INLINE_BLOT`,e[e.BLOCK_ATTRIBUTE=9]=`BLOCK_ATTRIBUTE`,e[e.INLINE_ATTRIBUTE=5]=`INLINE_ATTRIBUTE`,e[e.ANY=15]=`ANY`})(l=t.Scope||={});function u(e,t){var n=f(e);if(n==null)throw new i(`Unable to create `+e+` blot`);var r=n;return new r(e instanceof Node||e.nodeType===Node.TEXT_NODE?e:r.create(t),t)}t.create=u;function d(e,n){return n===void 0&&(n=!1),e==null?null:e[t.DATA_KEY]==null?n?d(e.parentNode,n):null:e[t.DATA_KEY].blot}t.find=d;function f(e,t){t===void 0&&(t=l.ANY);var n;if(typeof e==`string`)n=c[e]||a[e];else if(e instanceof Text||e.nodeType===Node.TEXT_NODE)n=c.text;else if(typeof e==`number`)e&l.LEVEL&l.BLOCK?n=c.block:e&l.LEVEL&l.INLINE&&(n=c.inline);else if(e instanceof HTMLElement){var r=(e.getAttribute(`class`)||``).split(/\s+/);for(var i in r)if(n=o[r[i]],n)break;n||=s[e.tagName]}return n==null?null:t&l.LEVEL&n.scope&&t&l.TYPE&n.scope?n:null}t.query=f;function p(){var e=[...arguments];if(e.length>1)return e.map(function(e){return p(e)});var t=e[0];if(typeof t.blotName!=`string`&&typeof t.attrName!=`string`)throw new i(`Invalid definition`);if(t.blotName===`abstract`)throw new i(`Cannot register abstract class`);return c[t.blotName||t.attrName]=t,typeof t.keyName==`string`?a[t.keyName]=t:(t.className!=null&&(o[t.className]=t),t.tagName!=null&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map(function(e){return e.toUpperCase()}):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(function(e){(s[e]==null||t.className==null)&&(s[e]=t)}))),t}t.register=p}),(function(e,t,n){var r=n(51),i=n(11),a=n(3),o=n(20),s=`\0`,c=function(e){Array.isArray(e)?this.ops=e:e!=null&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]};c.prototype.insert=function(e,t){var n={};return e.length===0?this:(n.insert=e,typeof t==`object`&&t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))},c.prototype.delete=function(e){return e<=0?this:this.push({delete:e})},c.prototype.retain=function(e,t){if(e<=0)return this;var n={retain:e};return typeof t==`object`&&t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)},c.prototype.push=function(e){var t=this.ops.length,n=this.ops[t-1];if(e=a(!0,{},e),typeof n==`object`){if(typeof e.delete==`number`&&typeof n.delete==`number`)return this.ops[t-1]={delete:n.delete+e.delete},this;if(typeof n.delete==`number`&&e.insert!=null&&(--t,n=this.ops[t-1],typeof n!=`object`))return this.ops.unshift(e),this;if(i(e.attributes,n.attributes)){if(typeof e.insert==`string`&&typeof n.insert==`string`)return this.ops[t-1]={insert:n.insert+e.insert},typeof e.attributes==`object`&&(this.ops[t-1].attributes=e.attributes),this;if(typeof e.retain==`number`&&typeof n.retain==`number`)return this.ops[t-1]={retain:n.retain+e.retain},typeof e.attributes==`object`&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this},c.prototype.chop=function(){var e=this.ops[this.ops.length-1];return e&&e.retain&&!e.attributes&&this.ops.pop(),this},c.prototype.filter=function(e){return this.ops.filter(e)},c.prototype.forEach=function(e){this.ops.forEach(e)},c.prototype.map=function(e){return this.ops.map(e)},c.prototype.partition=function(e){var t=[],n=[];return this.forEach(function(r){(e(r)?t:n).push(r)}),[t,n]},c.prototype.reduce=function(e,t){return this.ops.reduce(e,t)},c.prototype.changeLength=function(){return this.reduce(function(e,t){return t.insert?e+o.length(t):t.delete?e-t.delete:e},0)},c.prototype.length=function(){return this.reduce(function(e,t){return e+o.length(t)},0)},c.prototype.slice=function(e,t){e||=0,typeof t!=`number`&&(t=1/0);for(var n=[],r=o.iterator(this.ops),i=0;i<t&&r.hasNext();){var a;i<e?a=r.next(e-i):(a=r.next(t-i),n.push(a)),i+=o.length(a)}return new c(n)},c.prototype.compose=function(e){var t=o.iterator(this.ops),n=o.iterator(e.ops),r=[],a=n.peek();if(a!=null&&typeof a.retain==`number`&&a.attributes==null){for(var s=a.retain;t.peekType()===`insert`&&t.peekLength()<=s;)s-=t.peekLength(),r.push(t.next());a.retain-s>0&&n.next(a.retain-s)}for(var l=new c(r);t.hasNext()||n.hasNext();)if(n.peekType()===`insert`)l.push(n.next());else if(t.peekType()===`delete`)l.push(t.next());else{var u=Math.min(t.peekLength(),n.peekLength()),d=t.next(u),f=n.next(u);if(typeof f.retain==`number`){var p={};typeof d.retain==`number`?p.retain=u:p.insert=d.insert;var m=o.attributes.compose(d.attributes,f.attributes,typeof d.retain==`number`);if(m&&(p.attributes=m),l.push(p),!n.hasNext()&&i(l.ops[l.ops.length-1],p)){var h=new c(t.rest());return l.concat(h).chop()}}else typeof f.delete==`number`&&typeof d.retain==`number`&&l.push(f)}return l.chop()},c.prototype.concat=function(e){var t=new c(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t},c.prototype.diff=function(e,t){if(this.ops===e.ops)return new c;var n=[this,e].map(function(t){return t.map(function(n){if(n.insert!=null)return typeof n.insert==`string`?n.insert:s;throw Error(`diff() called `+(t===e?`on`:`with`)+` non-document`)}).join(``)}),a=new c,l=r(n[0],n[1],t),u=o.iterator(this.ops),d=o.iterator(e.ops);return l.forEach(function(e){for(var t=e[1].length;t>0;){var n=0;switch(e[0]){case r.INSERT:n=Math.min(d.peekLength(),t),a.push(d.next(n));break;case r.DELETE:n=Math.min(t,u.peekLength()),u.next(n),a.delete(n);break;case r.EQUAL:n=Math.min(u.peekLength(),d.peekLength(),t);var s=u.next(n),c=d.next(n);i(s.insert,c.insert)?a.retain(n,o.attributes.diff(s.attributes,c.attributes)):a.push(c).delete(n);break}t-=n}}),a.chop()},c.prototype.eachLine=function(e,t){t||=`
42
- `;for(var n=o.iterator(this.ops),r=new c,i=0;n.hasNext();){if(n.peekType()!==`insert`)return;var a=n.peek(),s=o.length(a)-n.peekLength(),l=typeof a.insert==`string`?a.insert.indexOf(t,s)-s:-1;if(l<0)r.push(n.next());else if(l>0)r.push(n.next(l));else{if(e(r,n.next(1).attributes||{},i)===!1)return;i+=1,r=new c}}r.length()>0&&e(r,{},i)},c.prototype.transform=function(e,t){if(t=!!t,typeof e==`number`)return this.transformPosition(e,t);for(var n=o.iterator(this.ops),r=o.iterator(e.ops),i=new c;n.hasNext()||r.hasNext();)if(n.peekType()===`insert`&&(t||r.peekType()!==`insert`))i.retain(o.length(n.next()));else if(r.peekType()===`insert`)i.push(r.next());else{var a=Math.min(n.peekLength(),r.peekLength()),s=n.next(a),l=r.next(a);if(s.delete)continue;l.delete?i.push(l):i.retain(a,o.attributes.transform(s.attributes,l.attributes,t))}return i.chop()},c.prototype.transformPosition=function(e,t){t=!!t;for(var n=o.iterator(this.ops),r=0;n.hasNext()&&r<=e;){var i=n.peekLength(),a=n.peekType();if(n.next(),a===`delete`){e-=Math.min(i,e-r);continue}else a===`insert`&&(r<e||!t)&&(e+=i);r+=i}return e},e.exports=c}),(function(e,t){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=t.BlockEmbed=t.bubbleFormats=void 0;var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=d(n(3)),o=d(n(2)),s=d(n(0)),c=d(n(16)),l=d(n(6)),u=d(n(7));function d(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function p(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function m(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=1,g=function(e){m(t,e);function t(){return f(this,t),p(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,[{key:`attach`,value:function(){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`attach`,this).call(this),this.attributes=new s.default.Attributor.Store(this.domNode)}},{key:`delta`,value:function(){return new o.default().insert(this.value(),(0,a.default)(this.formats(),this.attributes.values()))}},{key:`format`,value:function(e,t){var n=s.default.query(e,s.default.Scope.BLOCK_ATTRIBUTE);n!=null&&this.attributes.attribute(n,t)}},{key:`formatAt`,value:function(e,t,n,r){this.format(n,r)}},{key:`insertAt`,value:function(e,n,r){if(typeof n==`string`&&n.endsWith(`
43
- `)){var a=s.default.create(_.blotName);this.parent.insertBefore(a,e===0?this:this.next),a.insertAt(0,n.slice(0,-1))}else i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`insertAt`,this).call(this,e,n,r)}}]),t}(s.default.Embed);g.scope=s.default.Scope.BLOCK_BLOT;var _=function(e){m(t,e);function t(e){f(this,t);var n=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.cache={},n}return r(t,[{key:`delta`,value:function(){return this.cache.delta??(this.cache.delta=this.descendants(s.default.Leaf).reduce(function(e,t){return t.length()===0?e:e.insert(t.value(),v(t))},new o.default).insert(`
44
- `,v(this))),this.cache.delta}},{key:`deleteAt`,value:function(e,n){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`deleteAt`,this).call(this,e,n),this.cache={}}},{key:`formatAt`,value:function(e,n,r,a){n<=0||(s.default.query(r,s.default.Scope.BLOCK)?e+n===this.length()&&this.format(r,a):i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`formatAt`,this).call(this,e,Math.min(n,this.length()-e-1),r,a),this.cache={})}},{key:`insertAt`,value:function(e,n,r){if(r!=null)return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`insertAt`,this).call(this,e,n,r);if(n.length!==0){var a=n.split(`
45
- `),o=a.shift();o.length>0&&(e<this.length()-1||this.children.tail==null?i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`insertAt`,this).call(this,Math.min(e,this.length()-1),o):this.children.tail.insertAt(this.children.tail.length(),o),this.cache={});var s=this;a.reduce(function(e,t){return s=s.split(e,!0),s.insertAt(0,t),t.length},e+o.length)}}},{key:`insertBefore`,value:function(e,n){var r=this.children.head;i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`insertBefore`,this).call(this,e,n),r instanceof c.default&&r.remove(),this.cache={}}},{key:`length`,value:function(){return this.cache.length??(this.cache.length=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`length`,this).call(this)+h),this.cache.length}},{key:`moveChildren`,value:function(e,n){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`moveChildren`,this).call(this,e,n),this.cache={}}},{key:`optimize`,value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`optimize`,this).call(this,e),this.cache={}}},{key:`path`,value:function(e){return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`path`,this).call(this,e,!0)}},{key:`removeChild`,value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`removeChild`,this).call(this,e),this.cache={}}},{key:`split`,value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(n&&(e===0||e>=this.length()-h)){var r=this.clone();return e===0?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}else{var a=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`split`,this).call(this,e,n);return this.cache={},a}}}]),t}(s.default.Block);_.blotName=`block`,_.tagName=`P`,_.defaultChild=`break`,_.allowedChildren=[l.default,s.default.Embed,u.default];function v(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e==null||(typeof e.formats==`function`&&(t=(0,a.default)(t,e.formats())),e.parent==null||e.parent.blotName==`scroll`||e.parent.statics.scope!==e.statics.scope)?t:v(e.parent,t)}t.bubbleFormats=v,t.BlockEmbed=g,t.default=_}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=t.overload=t.expandConfig=void 0;var r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),a=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();n(50);var o=g(n(2)),s=g(n(14)),c=g(n(8)),l=g(n(9)),u=g(n(0)),d=n(15),f=g(d),p=g(n(3)),m=g(n(10)),h=g(n(34));function g(e){return e&&e.__esModule?e:{default:e}}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var y=(0,m.default)(`quill`),b=function(){a(e,null,[{key:`debug`,value:function(e){e===!0&&(e=`log`),m.default.level(e)}},{key:`find`,value:function(e){return e.__quill||u.default.find(e)}},{key:`import`,value:function(e){return this.imports[e]??y.error(`Cannot import `+e+`. Are you sure it was registered?`),this.imports[e]}},{key:`register`,value:function(e,t){var n=this,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof e!=`string`){var i=e.attrName||e.blotName;typeof i==`string`?this.register(`formats/`+i,e,t):Object.keys(e).forEach(function(r){n.register(r,e[r],t)})}else this.imports[e]!=null&&!r&&y.warn(`Overwriting `+e+` with`,t),this.imports[e]=t,(e.startsWith(`blots/`)||e.startsWith(`formats/`))&&t.blotName!==`abstract`?u.default.register(t):e.startsWith(`modules`)&&typeof t.register==`function`&&t.register()}}]);function e(t){var n=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(v(this,e),this.options=x(t,r),this.container=this.options.container,this.container==null)return y.error(`Invalid Quill container`,t);this.options.debug&&e.debug(this.options.debug);var i=this.container.innerHTML.trim();this.container.classList.add(`ql-container`),this.container.innerHTML=``,this.container.__quill=this,this.root=this.addContainer(`ql-editor`),this.root.classList.add(`ql-blank`),this.root.setAttribute(`data-gramm`,!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new c.default,this.scroll=u.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new s.default(this.scroll),this.selection=new f.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule(`keyboard`),this.clipboard=this.theme.addModule(`clipboard`),this.history=this.theme.addModule(`history`),this.theme.init(),this.emitter.on(c.default.events.EDITOR_CHANGE,function(e){e===c.default.events.TEXT_CHANGE&&n.root.classList.toggle(`ql-blank`,n.editor.isBlank())}),this.emitter.on(c.default.events.SCROLL_UPDATE,function(e,t){var r=n.selection.lastRange,i=r&&r.length===0?r.index:void 0;S.call(n,function(){return n.editor.update(null,t,i)},e)});var a=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+i+`<p><br></p></div>`);this.setContents(a),this.history.clear(),this.options.placeholder&&this.root.setAttribute(`data-placeholder`,this.options.placeholder),this.options.readOnly&&this.disable()}return a(e,[{key:`addContainer`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e==`string`){var n=e;e=document.createElement(`div`),e.classList.add(n)}return this.container.insertBefore(e,t),e}},{key:`blur`,value:function(){this.selection.setRange(null)}},{key:`deleteText`,value:function(e,t,n){var r=this,a=i(C(e,t,n),4);return e=a[0],t=a[1],n=a[3],S.call(this,function(){return r.editor.deleteText(e,t)},n,e,-1*t)}},{key:`disable`,value:function(){this.enable(!1)}},{key:`enable`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle(`ql-disabled`,!e)}},{key:`focus`,value:function(){var e=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=e,this.scrollIntoView()}},{key:`format`,value:function(e,t){var n=this,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:c.default.sources.API;return S.call(this,function(){var r=n.getSelection(!0),i=new o.default;if(r==null)return i;if(u.default.query(e,u.default.Scope.BLOCK))i=n.editor.formatLine(r.index,r.length,_({},e,t));else if(r.length===0)return n.selection.format(e,t),i;else i=n.editor.formatText(r.index,r.length,_({},e,t));return n.setSelection(r,c.default.sources.SILENT),i},r)}},{key:`formatLine`,value:function(e,t,n,r,a){var o=this,s=void 0,c=i(C(e,t,n,r,a),4);return e=c[0],t=c[1],s=c[2],a=c[3],S.call(this,function(){return o.editor.formatLine(e,t,s)},a,e,0)}},{key:`formatText`,value:function(e,t,n,r,a){var o=this,s=void 0,c=i(C(e,t,n,r,a),4);return e=c[0],t=c[1],s=c[2],a=c[3],S.call(this,function(){return o.editor.formatText(e,t,s)},a,e,0)}},{key:`getBounds`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=void 0;n=typeof e==`number`?this.selection.getBounds(e,t):this.selection.getBounds(e.index,e.length);var r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}},{key:`getContents`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e,n=i(C(e,t),2);return e=n[0],t=n[1],this.editor.getContents(e,t)}},{key:`getFormat`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e==`number`?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}},{key:`getIndex`,value:function(e){return e.offset(this.scroll)}},{key:`getLength`,value:function(){return this.scroll.length()}},{key:`getLeaf`,value:function(e){return this.scroll.leaf(e)}},{key:`getLine`,value:function(e){return this.scroll.line(e)}},{key:`getLines`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e==`number`?this.scroll.lines(e,t):this.scroll.lines(e.index,e.length)}},{key:`getModule`,value:function(e){return this.theme.modules[e]}},{key:`getSelection`,value:function(){return arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:`getText`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e,n=i(C(e,t),2);return e=n[0],t=n[1],this.editor.getText(e,t)}},{key:`hasFocus`,value:function(){return this.selection.hasFocus()}},{key:`insertEmbed`,value:function(t,n,r){var i=this,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e.sources.API;return S.call(this,function(){return i.editor.insertEmbed(t,n,r)},a,t)}},{key:`insertText`,value:function(e,t,n,r,a){var o=this,s=void 0,c=i(C(e,0,n,r,a),4);return e=c[0],s=c[2],a=c[3],S.call(this,function(){return o.editor.insertText(e,t,s)},a,e,t.length)}},{key:`isEnabled`,value:function(){return!this.container.classList.contains(`ql-disabled`)}},{key:`off`,value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:`on`,value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:`once`,value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:`pasteHTML`,value:function(e,t,n){this.clipboard.dangerouslyPasteHTML(e,t,n)}},{key:`removeFormat`,value:function(e,t,n){var r=this,a=i(C(e,t,n),4);return e=a[0],t=a[1],n=a[3],S.call(this,function(){return r.editor.removeFormat(e,t)},n,e)}},{key:`scrollIntoView`,value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:`setContents`,value:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c.default.sources.API;return S.call(this,function(){e=new o.default(e);var n=t.getLength(),r=t.editor.deleteText(0,n),i=t.editor.applyDelta(e),a=i.ops[i.ops.length-1];return a!=null&&typeof a.insert==`string`&&a.insert[a.insert.length-1]===`
46
- `&&(t.editor.deleteText(t.getLength()-1,1),i.delete(1)),r.compose(i)},n)}},{key:`setSelection`,value:function(t,n,r){if(t==null)this.selection.setRange(null,n||e.sources.API);else{var a=i(C(t,n,r),4);t=a[0],n=a[1],r=a[3],this.selection.setRange(new d.Range(t,n),r),r!==c.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:`setText`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c.default.sources.API,n=new o.default().insert(e);return this.setContents(n,t)}},{key:`update`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c.default.sources.USER,t=this.scroll.update(e);return this.selection.update(e),t}},{key:`updateContents`,value:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c.default.sources.API;return S.call(this,function(){return e=new o.default(e),t.editor.applyDelta(e,n)},n,!0)}}]),e}();b.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:``,readOnly:!1,scrollingContainer:null,strict:!0,theme:`default`},b.events=c.default.events,b.sources=c.default.sources,b.version=`1.3.7`,b.imports={delta:o.default,parchment:u.default,"core/module":l.default,"core/theme":h.default};function x(e,t){if(t=(0,p.default)(!0,{container:e,modules:{clipboard:!0,keyboard:!0,history:!0}},t),!t.theme||t.theme===b.DEFAULTS.theme)t.theme=h.default;else if(t.theme=b.import(`themes/`+t.theme),t.theme==null)throw Error(`Invalid theme `+t.theme+`. Did you register it?`);var n=(0,p.default)(!0,{},t.theme.DEFAULTS);[n,t].forEach(function(e){e.modules=e.modules||{},Object.keys(e.modules).forEach(function(t){e.modules[t]===!0&&(e.modules[t]={})})});var r=Object.keys(n.modules).concat(Object.keys(t.modules)).reduce(function(e,t){var n=b.import(`modules/`+t);return n==null?y.error(`Cannot load `+t+` module. Are you sure you registered it?`):e[t]=n.DEFAULTS||{},e},{});return t.modules!=null&&t.modules.toolbar&&t.modules.toolbar.constructor!==Object&&(t.modules.toolbar={container:t.modules.toolbar}),t=(0,p.default)(!0,{},b.DEFAULTS,{modules:r},n,t),[`bounds`,`container`,`scrollingContainer`].forEach(function(e){typeof t[e]==`string`&&(t[e]=document.querySelector(t[e]))}),t.modules=Object.keys(t.modules).reduce(function(e,n){return t.modules[n]&&(e[n]=t.modules[n]),e},{}),t}function S(e,t,n,r){if(this.options.strict&&!this.isEnabled()&&t===c.default.sources.USER)return new o.default;var i=n==null?null:this.getSelection(),a=this.editor.delta,s=e();if(i!=null&&(n===!0&&(n=i.index),r==null?i=w(i,s,t):r!==0&&(i=w(i,n,r,t)),this.setSelection(i,c.default.sources.SILENT)),s.length()>0){var l,u=[c.default.events.TEXT_CHANGE,s,a,t];if((l=this.emitter).emit.apply(l,[c.default.events.EDITOR_CHANGE].concat(u)),t!==c.default.sources.SILENT){var d;(d=this.emitter).emit.apply(d,u)}}return s}function C(e,t,n,i,a){var o={};return typeof e.index==`number`&&typeof e.length==`number`?typeof t==`number`?(t=e.length,e=e.index):(a=i,i=n,n=t,t=e.length,e=e.index):typeof t!=`number`&&(a=i,i=n,n=t,t=0),(n===void 0?`undefined`:r(n))===`object`?(o=n,a=i):typeof n==`string`&&(i==null?a=n:o[n]=i),a||=c.default.sources.API,[e,t,o,a]}function w(e,t,n,r){if(e==null)return null;var a=void 0,s=void 0;if(t instanceof o.default){var l=i([e.index,e.index+e.length].map(function(e){return t.transformPosition(e,r!==c.default.sources.USER)}),2);a=l[0],s=l[1]}else{var u=i([e.index,e.index+e.length].map(function(e){return e<t||e===t&&r===c.default.sources.USER?e:n>=0?e+n:Math.max(t,e+n)}),2);a=u[0],s=u[1]}return new d.Range(a,s-a)}t.expandConfig=x,t.overload=C,t.default=b}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=s(n(7)),o=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function l(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function u(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=function(e){u(t,e);function t(){return c(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,[{key:`formatAt`,value:function(e,n,r,a){if(t.compare(this.statics.blotName,r)<0&&o.default.query(r,o.default.Scope.BLOT)){var s=this.isolate(e,n);a&&s.wrap(r,a)}else i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`formatAt`,this).call(this,e,n,r,a)}},{key:`optimize`,value:function(e){if(i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`optimize`,this).call(this,e),this.parent instanceof t&&t.compare(this.statics.blotName,this.parent.statics.blotName)>0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:`compare`,value:function(e,n){var r=t.order.indexOf(e),i=t.order.indexOf(n);return r>=0||i>=0?r-i:e===n?0:e<n?-1:1}}]),t}(o.default.Inline);d.allowedChildren=[d,o.default.Embed,a.default],d.order=[`cursor`,`inline`,`underline`,`strike`,`italic`,`bold`,`script`,`link`,`code`],t.default=d}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=i(n(0));function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function s(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.default=function(e){s(t,e);function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return t}(r.default.Text)}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=s(n(54)),o=s(n(10));function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function l(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function u(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=(0,o.default)(`quill:events`);[`selectionchange`,`mousedown`,`mouseup`,`click`].forEach(function(e){document.addEventListener(e,function(){var e=[...arguments];[].slice.call(document.querySelectorAll(`.ql-container`)).forEach(function(t){if(t.__quill&&t.__quill.emitter){var n;(n=t.__quill.emitter).handleDOM.apply(n,e)}})})});var f=function(e){u(t,e);function t(){c(this,t);var e=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.listeners={},e.on(`error`,d.error),e}return r(t,[{key:`emit`,value:function(){d.log.apply(d,arguments),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`emit`,this).apply(this,arguments)}},{key:`handleDOM`,value:function(e){var t=[...arguments].slice(1);(this.listeners[e.type]||[]).forEach(function(n){var r=n.node,i=n.handler;(e.target===r||r.contains(e.target))&&i.apply(void 0,[e].concat(t))})}},{key:`listenDOM`,value:function(e,t,n){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push({node:t,handler:n})}}]),t}(a.default);f.events={EDITOR_CHANGE:`editor-change`,SCROLL_BEFORE_UPDATE:`scroll-before-update`,SCROLL_OPTIMIZE:`scroll-optimize`,SCROLL_UPDATE:`scroll-update`,SELECTION_CHANGE:`selection-change`,TEXT_CHANGE:`text-change`},f.sources={API:`api`,SILENT:`silent`,USER:`user`},t.default=f}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});function r(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var i=function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};r(this,e),this.quill=t,this.options=n};i.DEFAULTS={},t.default=i}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=[`error`,`warn`,`log`,`info`],i=`warn`;function a(e){if(r.indexOf(e)<=r.indexOf(i)){var t,n=[...arguments].slice(1);(t=console)[e].apply(t,n)}}function o(e){return r.reduce(function(t,n){return t[n]=a.bind(console,n,e),t},{})}a.level=o.level=function(e){i=e},t.default=o}),(function(e,t,n){var r=Array.prototype.slice,i=n(52),a=n(53),o=e.exports=function(e,t,n){return n||={},e===t?!0:e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||typeof e!=`object`&&typeof t!=`object`?n.strict?e===t:e==t:l(e,t,n)};function s(e){return e==null}function c(e){return!(!e||typeof e!=`object`||typeof e.length!=`number`||typeof e.copy!=`function`||typeof e.slice!=`function`||e.length>0&&typeof e[0]!=`number`)}function l(e,t,n){var l,u;if(s(e)||s(t)||e.prototype!==t.prototype)return!1;if(a(e))return a(t)?(e=r.call(e),t=r.call(t),o(e,t,n)):!1;if(c(e)){if(!c(t)||e.length!==t.length)return!1;for(l=0;l<e.length;l++)if(e[l]!==t[l])return!1;return!0}try{var d=i(e),f=i(t)}catch{return!1}if(d.length!=f.length)return!1;for(d.sort(),f.sort(),l=d.length-1;l>=0;l--)if(d[l]!=f[l])return!1;for(l=d.length-1;l>=0;l--)if(u=d[l],!o(e[u],t[u],n))return!1;return typeof e==typeof t}}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=n(1);t.default=function(){function e(e,t,n){n===void 0&&(n={}),this.attrName=e,this.keyName=t;var i=r.Scope.TYPE&r.Scope.ATTRIBUTE;n.scope==null?this.scope=r.Scope.ATTRIBUTE:this.scope=n.scope&r.Scope.LEVEL|i,n.whitelist!=null&&(this.whitelist=n.whitelist)}return e.keys=function(e){return[].map.call(e.attributes,function(e){return e.name})},e.prototype.add=function(e,t){return this.canAdd(e,t)?(e.setAttribute(this.keyName,t),!0):!1},e.prototype.canAdd=function(e,t){return r.query(e,r.Scope.BLOT&(this.scope|r.Scope.TYPE))==null?!1:this.whitelist==null?!0:typeof t==`string`?this.whitelist.indexOf(t.replace(/["']/g,``))>-1:this.whitelist.indexOf(t)>-1},e.prototype.remove=function(e){e.removeAttribute(this.keyName)},e.prototype.value=function(e){var t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:``},e}()}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=t.Code=void 0;var r=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),i=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},o=d(n(2)),s=d(n(0)),c=d(n(4)),l=d(n(6)),u=d(n(7));function d(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function p(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function m(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=function(e){m(t,e);function t(){return f(this,t),p(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return t}(l.default);h.blotName=`code`,h.tagName=`CODE`;var g=function(e){m(t,e);function t(){return f(this,t),p(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,[{key:`delta`,value:function(){var e=this,t=this.domNode.textContent;return t.endsWith(`
47
- `)&&(t=t.slice(0,-1)),t.split(`
48
- `).reduce(function(t,n){return t.insert(n).insert(`
49
- `,e.formats())},new o.default)}},{key:`format`,value:function(e,n){if(!(e===this.statics.blotName&&n)){var i=r(this.descendant(u.default,this.length()-1),1)[0];i?.deleteAt(i.length()-1,1),a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`format`,this).call(this,e,n)}}},{key:`formatAt`,value:function(e,n,r,i){if(n!==0&&!(s.default.query(r,s.default.Scope.BLOCK)==null||r===this.statics.blotName&&i===this.statics.formats(this.domNode))){var a=this.newlineIndex(e);if(!(a<0||a>=e+n)){var o=this.newlineIndex(e,!0)+1,c=a-o+1,l=this.isolate(o,c),u=l.next;l.format(r,i),u instanceof t&&u.formatAt(0,e-o+n-c,r,i)}}}},{key:`insertAt`,value:function(e,t,n){if(n==null){var i=r(this.descendant(u.default,e),2),a=i[0],o=i[1];a.insertAt(o,t)}}},{key:`length`,value:function(){var e=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
50
- `)?e:e+1}},{key:`newlineIndex`,value:function(e){if(arguments.length>1&&arguments[1]!==void 0&&arguments[1])return this.domNode.textContent.slice(0,e).lastIndexOf(`
51
- `);var t=this.domNode.textContent.slice(e).indexOf(`
52
- `);return t>-1?e+t:-1}},{key:`optimize`,value:function(e){this.domNode.textContent.endsWith(`
53
- `)||this.appendChild(s.default.create(`text`,`
54
- `)),a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`optimize`,this).call(this,e);var n=this.next;n!=null&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(e),n.moveChildren(this),n.remove())}},{key:`replace`,value:function(e){a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`replace`,this).call(this,e),[].slice.call(this.domNode.querySelectorAll(`*`)).forEach(function(e){var t=s.default.find(e);t==null?e.parentNode.removeChild(e):t instanceof s.default.Embed?t.remove():t.unwrap()})}}],[{key:`create`,value:function(e){var n=a(t.__proto__||Object.getPrototypeOf(t),`create`,this).call(this,e);return n.setAttribute(`spellcheck`,!1),n}},{key:`formats`,value:function(){return!0}}]),t}(c.default);g.blotName=`code-block`,g.tagName=`PRE`,g.TAB=` `,t.Code=h,t.default=g}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),a=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=_(n(2)),s=_(n(20)),c=_(n(0)),l=_(n(13)),u=_(n(24)),d=n(4),f=_(d),p=_(n(16)),m=_(n(21)),h=_(n(11)),g=_(n(3));function _(e){return e&&e.__esModule?e:{default:e}}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var b=/^[ -~]*$/,x=function(){function e(t){y(this,e),this.scroll=t,this.delta=this.getDelta()}return a(e,[{key:`applyDelta`,value:function(e){var t=this,n=!1;this.scroll.update();var a=this.scroll.length();return this.scroll.batchStart(),e=C(e),e.reduce(function(e,o){var l=o.retain||o.delete||o.insert.length||1,u=o.attributes||{};if(o.insert!=null){if(typeof o.insert==`string`){var p=o.insert;p.endsWith(`
55
- `)&&n&&(n=!1,p=p.slice(0,-1)),e>=a&&!p.endsWith(`
56
- `)&&(n=!0),t.scroll.insertAt(e,p);var m=i(t.scroll.line(e),2),h=m[0],_=m[1],v=(0,g.default)({},(0,d.bubbleFormats)(h));if(h instanceof f.default){var y=i(h.descendant(c.default.Leaf,_),1)[0];v=(0,g.default)(v,(0,d.bubbleFormats)(y))}u=s.default.attributes.diff(v,u)||{}}else if(r(o.insert)===`object`){var b=Object.keys(o.insert)[0];if(b==null)return e;t.scroll.insertAt(e,b,o.insert[b])}a+=l}return Object.keys(u).forEach(function(n){t.scroll.formatAt(e,l,n,u[n])}),e+l},0),e.reduce(function(e,n){return typeof n.delete==`number`?(t.scroll.deleteAt(e,n.delete),e):e+(n.retain||n.insert.length||1)},0),this.scroll.batchEnd(),this.update(e)}},{key:`deleteText`,value:function(e,t){return this.scroll.deleteAt(e,t),this.update(new o.default().retain(e).delete(t))}},{key:`formatLine`,value:function(e,t){var n=this,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(r).forEach(function(i){if(!(n.scroll.whitelist!=null&&!n.scroll.whitelist[i])){var a=n.scroll.lines(e,Math.max(t,1)),o=t;a.forEach(function(t){var a=t.length();if(!(t instanceof l.default))t.format(i,r[i]);else{var s=e-t.offset(n.scroll),c=t.newlineIndex(s+o)-s+1;t.formatAt(s,c,i,r[i])}o-=a})}}),this.scroll.optimize(),this.update(new o.default().retain(e).retain(t,(0,m.default)(r)))}},{key:`formatText`,value:function(e,t){var n=this,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(r).forEach(function(i){n.scroll.formatAt(e,t,i,r[i])}),this.update(new o.default().retain(e).retain(t,(0,m.default)(r)))}},{key:`getContents`,value:function(e,t){return this.delta.slice(e,e+t)}},{key:`getDelta`,value:function(){return this.scroll.lines().reduce(function(e,t){return e.concat(t.delta())},new o.default)}},{key:`getFormat`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=[],r=[];t===0?this.scroll.path(e).forEach(function(e){var t=i(e,1)[0];t instanceof f.default?n.push(t):t instanceof c.default.Leaf&&r.push(t)}):(n=this.scroll.lines(e,t),r=this.scroll.descendants(c.default.Leaf,e,t));var a=[n,r].map(function(e){if(e.length===0)return{};for(var t=(0,d.bubbleFormats)(e.shift());Object.keys(t).length>0;){var n=e.shift();if(n==null)return t;t=S((0,d.bubbleFormats)(n),t)}return t});return g.default.apply(g.default,a)}},{key:`getText`,value:function(e,t){return this.getContents(e,t).filter(function(e){return typeof e.insert==`string`}).map(function(e){return e.insert}).join(``)}},{key:`insertEmbed`,value:function(e,t,n){return this.scroll.insertAt(e,t,n),this.update(new o.default().retain(e).insert(v({},t,n)))}},{key:`insertText`,value:function(e,t){var n=this,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`
57
- `).replace(/\r/g,`
58
- `),this.scroll.insertAt(e,t),Object.keys(r).forEach(function(i){n.scroll.formatAt(e,t.length,i,r[i])}),this.update(new o.default().retain(e).insert(t,(0,m.default)(r)))}},{key:`isBlank`,value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var e=this.scroll.children.head;return e.statics.blotName!==f.default.blotName||e.children.length>1?!1:e.children.head instanceof p.default}},{key:`removeFormat`,value:function(e,t){var n=this.getText(e,t),r=i(this.scroll.line(e+t),2),a=r[0],s=r[1],c=0,u=new o.default;a!=null&&(c=a instanceof l.default?a.newlineIndex(s)-s+1:a.length()-s,u=a.delta().slice(s,s+c-1).insert(`
59
- `));var d=this.getContents(e,t+c).diff(new o.default().insert(n).concat(u)),f=new o.default().retain(e).concat(d);return this.applyDelta(f)}},{key:`update`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=this.delta;if(t.length===1&&t[0].type===`characterData`&&t[0].target.data.match(b)&&c.default.find(t[0].target)){var i=c.default.find(t[0].target),a=(0,d.bubbleFormats)(i),s=i.offset(this.scroll),l=t[0].oldValue.replace(u.default.CONTENTS,``),f=new o.default().insert(l),p=new o.default().insert(i.value());e=new o.default().retain(s).concat(f.diff(p,n)).reduce(function(e,t){return t.insert?e.insert(t.insert,a):e.push(t)},new o.default),this.delta=r.compose(e)}else this.delta=this.getDelta(),(!e||!(0,h.default)(r.compose(e),this.delta))&&(e=r.diff(this.delta,n));return e}}]),e}();function S(e,t){return Object.keys(t).reduce(function(n,r){return e[r]==null||(t[r]===e[r]?n[r]=t[r]:Array.isArray(t[r])?t[r].indexOf(e[r])<0&&(n[r]=t[r].concat([e[r]])):n[r]=[t[r],e[r]]),n},{})}function C(e){return e.reduce(function(e,t){if(t.insert===1){var n=(0,m.default)(t.attributes);return delete n.image,e.insert({image:t.attributes.image},n)}if(t.attributes!=null&&(t.attributes.list===!0||t.attributes.bullet===!0)&&(t=(0,m.default)(t),t.attributes.list?t.attributes.list=`ordered`:(t.attributes.list=`bullet`,delete t.attributes.bullet)),typeof t.insert==`string`){var r=t.insert.replace(/\r\n/g,`
60
- `).replace(/\r/g,`
61
- `);return e.insert(r,t.attributes)}return e.push(t)},new o.default)}t.default=x}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=t.Range=void 0;var r=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),i=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=u(n(0)),o=u(n(21)),s=u(n(11)),c=u(n(8)),l=u(n(10));function u(e){return e&&e.__esModule?e:{default:e}}function d(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}else return Array.from(e)}function f(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var p=(0,l.default)(`quill:selection`),m=function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;f(this,e),this.index=t,this.length=n},h=function(){function e(t,n){var r=this;f(this,e),this.emitter=n,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=a.default.create(`cursor`,this),this.lastRange=this.savedRange=new m(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM(`selectionchange`,document,function(){r.mouseDown||setTimeout(r.update.bind(r,c.default.sources.USER),1)}),this.emitter.on(c.default.events.EDITOR_CHANGE,function(e,t){e===c.default.events.TEXT_CHANGE&&t.length()>0&&r.update(c.default.sources.SILENT)}),this.emitter.on(c.default.events.SCROLL_BEFORE_UPDATE,function(){if(r.hasFocus()){var e=r.getNativeRange();e!=null&&e.start.node!==r.cursor.textNode&&r.emitter.once(c.default.events.SCROLL_UPDATE,function(){try{r.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset)}catch{}})}}),this.emitter.on(c.default.events.SCROLL_OPTIMIZE,function(e,t){if(t.range){var n=t.range,i=n.startNode,a=n.startOffset,o=n.endNode,s=n.endOffset;r.setNativeRange(i,a,o,s)}}),this.update(c.default.sources.SILENT)}return i(e,[{key:`handleComposition`,value:function(){var e=this;this.root.addEventListener(`compositionstart`,function(){e.composing=!0}),this.root.addEventListener(`compositionend`,function(){if(e.composing=!1,e.cursor.parent){var t=e.cursor.restore();if(!t)return;setTimeout(function(){e.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)},1)}})}},{key:`handleDragging`,value:function(){var e=this;this.emitter.listenDOM(`mousedown`,document.body,function(){e.mouseDown=!0}),this.emitter.listenDOM(`mouseup`,document.body,function(){e.mouseDown=!1,e.update(c.default.sources.USER)})}},{key:`focus`,value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:`format`,value:function(e,t){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[e])){this.scroll.update();var n=this.getNativeRange();if(!(n==null||!n.native.collapsed||a.default.query(e,a.default.Scope.BLOCK))){if(n.start.node!==this.cursor.textNode){var r=a.default.find(n.start.node,!1);if(r==null)return;if(r instanceof a.default.Leaf){var i=r.split(n.start.offset);r.parent.insertBefore(this.cursor,i)}else r.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:`getBounds`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=this.scroll.length();e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;var i=void 0,a=r(this.scroll.leaf(e),2),o=a[0],s=a[1];if(o==null)return null;var c=r(o.position(s,!0),2);i=c[0],s=c[1];var l=document.createRange();if(t>0){l.setStart(i,s);var u=r(this.scroll.leaf(e+t),2);if(o=u[0],s=u[1],o==null)return null;var d=r(o.position(s,!0),2);return i=d[0],s=d[1],l.setEnd(i,s),l.getBoundingClientRect()}else{var f=`left`,p=void 0;return i instanceof Text?(s<i.data.length?(l.setStart(i,s),l.setEnd(i,s+1)):(l.setStart(i,s-1),l.setEnd(i,s),f=`right`),p=l.getBoundingClientRect()):(p=o.domNode.getBoundingClientRect(),s>0&&(f=`right`)),{bottom:p.top+p.height,height:p.height,left:p[f],right:p[f],top:p.top,width:0}}}},{key:`getNativeRange`,value:function(){var e=document.getSelection();if(e==null||e.rangeCount<=0)return null;var t=e.getRangeAt(0);if(t==null)return null;var n=this.normalizeNative(t);return p.info(`getNativeRange`,n),n}},{key:`getRange`,value:function(){var e=this.getNativeRange();return e==null?[null,null]:[this.normalizedToRange(e),e]}},{key:`hasFocus`,value:function(){return document.activeElement===this.root}},{key:`normalizedToRange`,value:function(e){var t=this,n=[[e.start.node,e.start.offset]];e.native.collapsed||n.push([e.end.node,e.end.offset]);var i=n.map(function(e){var n=r(e,2),i=n[0],o=n[1],s=a.default.find(i,!0),c=s.offset(t.scroll);return o===0?c:s instanceof a.default.Container?c+s.length():c+s.index(i,o)}),o=Math.min(Math.max.apply(Math,d(i)),this.scroll.length()-1),s=Math.min.apply(Math,[o].concat(d(i)));return new m(s,o-s)}},{key:`normalizeNative`,value:function(e){if(!g(this.root,e.startContainer)||!e.collapsed&&!g(this.root,e.endContainer))return null;var t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(function(e){for(var t=e.node,n=e.offset;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>n)t=t.childNodes[n],n=0;else if(t.childNodes.length===n)t=t.lastChild,n=t instanceof Text?t.data.length:t.childNodes.length+1;else break;e.node=t,e.offset=n}),t}},{key:`rangeToNative`,value:function(e){var t=this,n=e.collapsed?[e.index]:[e.index,e.index+e.length],i=[],a=this.scroll.length();return n.forEach(function(e,n){e=Math.min(a-1,e);var o=void 0,s=r(t.scroll.leaf(e),2),c=s[0],l=s[1],u=r(c.position(l,n!==0),2);o=u[0],l=u[1],i.push(o,l)}),i.length<2&&(i=i.concat(i)),i}},{key:`scrollIntoView`,value:function(e){var t=this.lastRange;if(t!=null){var n=this.getBounds(t.index,t.length);if(n!=null){var i=this.scroll.length()-1,a=r(this.scroll.line(Math.min(t.index,i)),1)[0],o=a;if(t.length>0&&(o=r(this.scroll.line(Math.min(t.index+t.length,i)),1)[0]),!(a==null||o==null)){var s=e.getBoundingClientRect();n.top<s.top?e.scrollTop-=s.top-n.top:n.bottom>s.bottom&&(e.scrollTop+=n.bottom-s.bottom)}}}}},{key:`setNativeRange`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(p.info(`setNativeRange`,e,t,n,r),!(e!=null&&(this.root.parentNode==null||e.parentNode==null||n.parentNode==null))){var a=document.getSelection();if(a!=null)if(e!=null){this.hasFocus()||this.root.focus();var o=(this.getNativeRange()||{}).native;if(o==null||i||e!==o.startContainer||t!==o.startOffset||n!==o.endContainer||r!==o.endOffset){e.tagName==`BR`&&(t=[].indexOf.call(e.parentNode.childNodes,e),e=e.parentNode),n.tagName==`BR`&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var s=document.createRange();s.setStart(e,t),s.setEnd(n,r),a.removeAllRanges(),a.addRange(s)}}else a.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:`setRange`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:c.default.sources.API;if(typeof t==`string`&&(n=t,t=!1),p.info(`setRange`,e),e!=null){var r=this.rangeToNative(e);this.setNativeRange.apply(this,d(r).concat([t]))}else this.setNativeRange(null);this.update(n)}},{key:`update`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c.default.sources.USER,t=this.lastRange,n=r(this.getRange(),2),i=n[0],a=n[1];if(this.lastRange=i,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,s.default)(t,this.lastRange)){var l;!this.composing&&a!=null&&a.native.collapsed&&a.start.node!==this.cursor.textNode&&this.cursor.restore();var u=[c.default.events.SELECTION_CHANGE,(0,o.default)(this.lastRange),(0,o.default)(t),e];if((l=this.emitter).emit.apply(l,[c.default.events.EDITOR_CHANGE].concat(u)),e!==c.default.sources.SILENT){var d;(d=this.emitter).emit.apply(d,u)}}}}]),e}();function g(e,t){try{t.parentNode}catch{return!1}return t instanceof Text&&(t=t.parentNode),e.contains(t)}t.Range=m,t.default=h}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function c(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function l(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(e){l(t,e);function t(){return s(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,[{key:`insertInto`,value:function(e,n){e.children.length===0?i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`insertInto`,this).call(this,e,n):this.remove()}},{key:`length`,value:function(){return 0}},{key:`value`,value:function(){return``}}],[{key:`value`,value:function(){}}]),t}(a.default.Embed);u.blotName=`break`,u.tagName=`BR`,t.default=u}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0});var i=n(44),a=n(30),o=n(1),s=function(e){r(t,e);function t(t){var n=e.call(this,t)||this;return n.build(),n}return t.prototype.appendChild=function(e){this.insertBefore(e)},t.prototype.attach=function(){e.prototype.attach.call(this),this.children.forEach(function(e){e.attach()})},t.prototype.build=function(){var e=this;this.children=new i.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(t){try{var n=c(t);e.insertBefore(n,e.children.head||void 0)}catch(e){if(e instanceof o.ParchmentError)return;throw e}})},t.prototype.deleteAt=function(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,function(e,t,n){e.deleteAt(t,n)})},t.prototype.descendant=function(e,n){var r=this.children.find(n),i=r[0],a=r[1];return e.blotName==null&&e(i)||e.blotName!=null&&i instanceof e?[i,a]:i instanceof t?i.descendant(e,a):[null,-1]},t.prototype.descendants=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=Number.MAX_VALUE);var i=[],a=r;return this.children.forEachAt(n,r,function(n,r,o){(e.blotName==null&&e(n)||e.blotName!=null&&n instanceof e)&&i.push(n),n instanceof t&&(i=i.concat(n.descendants(e,r,a))),a-=o}),i},t.prototype.detach=function(){this.children.forEach(function(e){e.detach()}),e.prototype.detach.call(this)},t.prototype.formatAt=function(e,t,n,r){this.children.forEachAt(e,t,function(e,t,i){e.formatAt(t,i,n,r)})},t.prototype.insertAt=function(e,t,n){var r=this.children.find(e),i=r[0],a=r[1];if(i)i.insertAt(a,t,n);else{var s=n==null?o.create(`text`,t):o.create(t,n);this.appendChild(s)}},t.prototype.insertBefore=function(e,t){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(t){return e instanceof t}))throw new o.ParchmentError(`Cannot insert `+e.statics.blotName+` into `+this.statics.blotName);e.insertInto(this,t)},t.prototype.length=function(){return this.children.reduce(function(e,t){return e+t.length()},0)},t.prototype.moveChildren=function(e,t){this.children.forEach(function(n){e.insertBefore(n,t)})},t.prototype.optimize=function(t){if(e.prototype.optimize.call(this,t),this.children.length===0)if(this.statics.defaultChild!=null){var n=o.create(this.statics.defaultChild);this.appendChild(n),n.optimize(t)}else this.remove()},t.prototype.path=function(e,n){n===void 0&&(n=!1);var r=this.children.find(e,n),i=r[0],a=r[1],o=[[this,e]];return i instanceof t?o.concat(i.path(a,n)):(i!=null&&o.push([i,a]),o)},t.prototype.removeChild=function(e){this.children.remove(e)},t.prototype.replace=function(n){n instanceof t&&n.moveChildren(this),e.prototype.replace.call(this,n)},t.prototype.split=function(e,t){if(t===void 0&&(t=!1),!t){if(e===0)return this;if(e===this.length())return this.next}var n=this.clone();return this.parent.insertBefore(n,this.next),this.children.forEachAt(e,this.length(),function(e,r,i){e=e.split(r,t),n.appendChild(e)}),n},t.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},t.prototype.update=function(e,t){var n=this,r=[],i=[];e.forEach(function(e){e.target===n.domNode&&e.type===`childList`&&(r.push.apply(r,e.addedNodes),i.push.apply(i,e.removedNodes))}),i.forEach(function(e){if(!(e.parentNode!=null&&e.tagName!==`IFRAME`&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var t=o.find(e);t!=null&&(t.domNode.parentNode==null||t.domNode.parentNode===n.domNode)&&t.detach()}}),r.filter(function(e){return e.parentNode==n.domNode}).sort(function(e,t){return e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(e){var t=null;e.nextSibling!=null&&(t=o.find(e.nextSibling));var r=c(e);(r.next!=t||r.next==null)&&(r.parent!=null&&r.parent.removeChild(n),n.insertBefore(r,t||void 0))})},t}(a.default);function c(e){var t=o.find(e);if(t==null)try{t=o.create(e)}catch{t=o.create(o.Scope.INLINE),[].slice.call(e.childNodes).forEach(function(e){t.domNode.appendChild(e)}),e.parentNode&&e.parentNode.replaceChild(t.domNode,e),t.attach()}return t}t.default=s}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0});var i=n(12),a=n(31),o=n(17),s=n(1);t.default=function(e){r(t,e);function t(t){var n=e.call(this,t)||this;return n.attributes=new a.default(n.domNode),n}return t.formats=function(e){if(typeof this.tagName==`string`)return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()},t.prototype.format=function(e,t){var n=s.query(e);n instanceof i.default?this.attributes.attribute(n,t):t&&n!=null&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t)},t.prototype.formats=function(){var e=this.attributes.values(),t=this.statics.formats(this.domNode);return t!=null&&(e[this.statics.blotName]=t),e},t.prototype.replaceWith=function(t,n){var r=e.prototype.replaceWith.call(this,t,n);return this.attributes.copy(r),r},t.prototype.update=function(t,n){var r=this;e.prototype.update.call(this,t,n),t.some(function(e){return e.target===r.domNode&&e.type===`attributes`})&&this.attributes.build()},t.prototype.wrap=function(n,r){var i=e.prototype.wrap.call(this,n,r);return i instanceof t&&i.statics.scope===this.statics.scope&&this.attributes.move(i),i},t}(o.default)}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0});var i=n(30),a=n(1);t.default=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.value=function(e){return!0},t.prototype.index=function(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1},t.prototype.position=function(e,t){var n=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]},t.prototype.value=function(){var e;return e={},e[this.statics.blotName]=this.statics.value(this.domNode)||!0,e},t.scope=a.Scope.INLINE_BLOT,t}(i.default)}),(function(e,t,n){var r=n(11),i=n(3),a={attributes:{compose:function(e,t,n){typeof e!=`object`&&(e={}),typeof t!=`object`&&(t={});var r=i(!0,{},t);for(var a in n||(r=Object.keys(r).reduce(function(e,t){return r[t]!=null&&(e[t]=r[t]),e},{})),e)e[a]!==void 0&&t[a]===void 0&&(r[a]=e[a]);return Object.keys(r).length>0?r:void 0},diff:function(e,t){typeof e!=`object`&&(e={}),typeof t!=`object`&&(t={});var n=Object.keys(e).concat(Object.keys(t)).reduce(function(n,i){return r(e[i],t[i])||(n[i]=t[i]===void 0?null:t[i]),n},{});return Object.keys(n).length>0?n:void 0},transform:function(e,t,n){if(typeof e!=`object`)return t;if(typeof t==`object`){if(!n)return t;var r=Object.keys(t).reduce(function(n,r){return e[r]===void 0&&(n[r]=t[r]),n},{});return Object.keys(r).length>0?r:void 0}}},iterator:function(e){return new o(e)},length:function(e){return typeof e.delete==`number`?e.delete:typeof e.retain==`number`?e.retain:typeof e.insert==`string`?e.insert.length:1}};function o(e){this.ops=e,this.index=0,this.offset=0}o.prototype.hasNext=function(){return this.peekLength()<1/0},o.prototype.next=function(e){e||=1/0;var t=this.ops[this.index];if(t){var n=this.offset,r=a.length(t);if(e>=r-n?(e=r-n,this.index+=1,this.offset=0):this.offset+=e,typeof t.delete==`number`)return{delete:e};var i={};return t.attributes&&(i.attributes=t.attributes),typeof t.retain==`number`?i.retain=e:typeof t.insert==`string`?i.insert=t.insert.substr(n,e):i.insert=t.insert,i}else return{retain:1/0}},o.prototype.peek=function(){return this.ops[this.index]},o.prototype.peekLength=function(){return this.ops[this.index]?a.length(this.ops[this.index])-this.offset:1/0},o.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete==`number`?`delete`:typeof this.ops[this.index].retain==`number`?`retain`:`insert`:`retain`},o.prototype.rest=function(){if(!this.hasNext())return[];if(this.offset===0)return this.ops.slice(this.index);var e=this.offset,t=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(r)},e.exports=a}),(function(e,t){var n=(function(){function e(e,t){return t!=null&&e instanceof t}var t;try{t=Map}catch{t=function(){}}var n;try{n=Set}catch{n=function(){}}var r;try{r=Promise}catch{r=function(){}}function i(a,o,s,c,u){typeof o==`object`&&(s=o.depth,c=o.prototype,u=o.includeNonEnumerable,o=o.circular);var d=[],f=[],p=typeof Buffer<`u`;o===void 0&&(o=!0),s===void 0&&(s=1/0);function m(a,s){if(a===null)return null;if(s===0)return a;var h,g;if(typeof a!=`object`)return a;if(e(a,t))h=new t;else if(e(a,n))h=new n;else if(e(a,r))h=new r(function(e,t){a.then(function(t){e(m(t,s-1))},function(e){t(m(e,s-1))})});else if(i.__isArray(a))h=[];else if(i.__isRegExp(a))h=new RegExp(a.source,l(a)),a.lastIndex&&(h.lastIndex=a.lastIndex);else if(i.__isDate(a))h=new Date(a.getTime());else if(p&&Buffer.isBuffer(a))return h=Buffer.allocUnsafe?Buffer.allocUnsafe(a.length):new Buffer(a.length),a.copy(h),h;else e(a,Error)?h=Object.create(a):c===void 0?(g=Object.getPrototypeOf(a),h=Object.create(g)):(h=Object.create(c),g=c);if(o){var _=d.indexOf(a);if(_!=-1)return f[_];d.push(a),f.push(h)}for(var v in e(a,t)&&a.forEach(function(e,t){var n=m(t,s-1),r=m(e,s-1);h.set(n,r)}),e(a,n)&&a.forEach(function(e){var t=m(e,s-1);h.add(t)}),a){var y;g&&(y=Object.getOwnPropertyDescriptor(g,v)),!(y&&y.set==null)&&(h[v]=m(a[v],s-1))}if(Object.getOwnPropertySymbols)for(var b=Object.getOwnPropertySymbols(a),v=0;v<b.length;v++){var x=b[v],S=Object.getOwnPropertyDescriptor(a,x);S&&!S.enumerable&&!u||(h[x]=m(a[x],s-1),S.enumerable||Object.defineProperty(h,x,{enumerable:!1}))}if(u)for(var C=Object.getOwnPropertyNames(a),v=0;v<C.length;v++){var w=C[v],S=Object.getOwnPropertyDescriptor(a,w);S&&S.enumerable||(h[w]=m(a[w],s-1),Object.defineProperty(h,w,{enumerable:!1}))}return h}return m(a,s)}i.clonePrototype=function(e){if(e===null)return null;var t=function(){};return t.prototype=e,new t};function a(e){return Object.prototype.toString.call(e)}i.__objToStr=a;function o(e){return typeof e==`object`&&a(e)===`[object Date]`}i.__isDate=o;function s(e){return typeof e==`object`&&a(e)===`[object Array]`}i.__isArray=s;function c(e){return typeof e==`object`&&a(e)===`[object RegExp]`}i.__isRegExp=c;function l(e){var t=``;return e.global&&(t+=`g`),e.ignoreCase&&(t+=`i`),e.multiline&&(t+=`m`),t}return i.__getRegExpFlags=l,i})();typeof e==`object`&&e.exports&&(e.exports=n)}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),i=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},o=p(n(0)),s=p(n(8)),c=n(4),l=p(c),u=p(n(16)),d=p(n(13)),f=p(n(25));function p(e){return e&&e.__esModule?e:{default:e}}function m(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function h(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function g(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _(e){return e instanceof l.default||e instanceof c.BlockEmbed}var v=function(e){g(t,e);function t(e,n){m(this,t);var r=h(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.emitter=n.emitter,Array.isArray(n.whitelist)&&(r.whitelist=n.whitelist.reduce(function(e,t){return e[t]=!0,e},{})),r.domNode.addEventListener(`DOMNodeInserted`,function(){}),r.optimize(),r.enable(),r}return i(t,[{key:`batchStart`,value:function(){this.batch=!0}},{key:`batchEnd`,value:function(){this.batch=!1,this.optimize()}},{key:`deleteAt`,value:function(e,n){var i=r(this.line(e),2),o=i[0],s=i[1],l=r(this.line(e+n),1)[0];if(a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`deleteAt`,this).call(this,e,n),l!=null&&o!==l&&s>0){if(o instanceof c.BlockEmbed||l instanceof c.BlockEmbed){this.optimize();return}if(o instanceof d.default){var f=o.newlineIndex(o.length(),!0);if(f>-1&&(o=o.split(f+1),o===l)){this.optimize();return}}else if(l instanceof d.default){var p=l.newlineIndex(0);p>-1&&l.split(p+1)}var m=l.children.head instanceof u.default?null:l.children.head;o.moveChildren(l,m),o.remove()}this.optimize()}},{key:`enable`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute(`contenteditable`,e)}},{key:`formatAt`,value:function(e,n,r,i){this.whitelist!=null&&!this.whitelist[r]||(a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`formatAt`,this).call(this,e,n,r,i),this.optimize())}},{key:`insertAt`,value:function(e,n,r){if(!(r!=null&&this.whitelist!=null&&!this.whitelist[n])){if(e>=this.length())if(r==null||o.default.query(n,o.default.Scope.BLOCK)==null){var i=o.default.create(this.statics.defaultChild);this.appendChild(i),r==null&&n.endsWith(`
62
- `)&&(n=n.slice(0,-1)),i.insertAt(0,n,r)}else{var s=o.default.create(n,r);this.appendChild(s)}else a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`insertAt`,this).call(this,e,n,r);this.optimize()}}},{key:`insertBefore`,value:function(e,n){if(e.statics.scope===o.default.Scope.INLINE_BLOT){var r=o.default.create(this.statics.defaultChild);r.appendChild(e),e=r}a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`insertBefore`,this).call(this,e,n)}},{key:`leaf`,value:function(e){return this.path(e).pop()||[null,-1]}},{key:`line`,value:function(e){return e===this.length()?this.line(e-1):this.descendant(_,e)}},{key:`lines`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return function e(t,n,r){var i=[],a=r;return t.children.forEachAt(n,r,function(t,n,r){_(t)?i.push(t):t instanceof o.default.Container&&(i=i.concat(e(t,n,a))),a-=r}),i}(this,e,t)}},{key:`optimize`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`optimize`,this).call(this,e,n),e.length>0&&this.emitter.emit(s.default.events.SCROLL_OPTIMIZE,e,n))}},{key:`path`,value:function(e){return a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`path`,this).call(this,e).slice(1)}},{key:`update`,value:function(e){if(this.batch!==!0){var n=s.default.sources.USER;typeof e==`string`&&(n=e),Array.isArray(e)||(e=this.observer.takeRecords()),e.length>0&&this.emitter.emit(s.default.events.SCROLL_BEFORE_UPDATE,n,e),a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`update`,this).call(this,e.concat([])),e.length>0&&this.emitter.emit(s.default.events.SCROLL_UPDATE,n,e)}}}]),t}(o.default.Scroll);v.blotName=`scroll`,v.className=`ql-editor`,v.tagName=`DIV`,v.defaultChild=`block`,v.allowedChildren=[l.default,c.BlockEmbed,f.default],t.default=v}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.SHORTKEY=t.default=void 0;var r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),a=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=h(n(21)),s=h(n(11)),c=h(n(3)),l=h(n(2)),u=h(n(20)),d=h(n(0)),f=h(n(5)),p=h(n(10)),m=h(n(9));function h(e){return e&&e.__esModule?e:{default:e}}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function v(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function y(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var b=(0,p.default)(`quill:keyboard`),x=/Mac/i.test(navigator.platform)?`metaKey`:`ctrlKey`,S=function(e){y(t,e),a(t,null,[{key:`match`,value:function(e,t){return t=A(t),[`altKey`,`ctrlKey`,`metaKey`,`shiftKey`].some(function(n){return!!t[n]!==e[n]&&t[n]!==null})?!1:t.key===(e.which||e.keyCode)}}]);function t(e,n){_(this,t);var r=v(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.bindings={},Object.keys(r.options.bindings).forEach(function(t){t===`list autofill`&&e.scroll.whitelist!=null&&!e.scroll.whitelist.list||r.options.bindings[t]&&r.addBinding(r.options.bindings[t])}),r.addBinding({key:t.keys.ENTER,shiftKey:null},D),r.addBinding({key:t.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(r.addBinding({key:t.keys.BACKSPACE},{collapsed:!0},w),r.addBinding({key:t.keys.DELETE},{collapsed:!0},T)):(r.addBinding({key:t.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},w),r.addBinding({key:t.keys.DELETE},{collapsed:!0,suffix:/^.?$/},T)),r.addBinding({key:t.keys.BACKSPACE},{collapsed:!1},E),r.addBinding({key:t.keys.DELETE},{collapsed:!1},E),r.addBinding({key:t.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},w),r.listen(),r}return a(t,[{key:`addBinding`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=A(e);if(r==null||r.key==null)return b.warn(`Attempted to add invalid keyboard binding`,r);typeof t==`function`&&(t={handler:t}),typeof n==`function`&&(n={handler:n}),r=(0,c.default)(r,t,n),this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}},{key:`listen`,value:function(){var e=this;this.quill.root.addEventListener(`keydown`,function(n){if(!n.defaultPrevented){var a=n.which||n.keyCode,o=(e.bindings[a]||[]).filter(function(e){return t.match(n,e)});if(o.length!==0){var c=e.quill.getSelection();if(!(c==null||!e.quill.hasFocus())){var l=i(e.quill.getLine(c.index),2),u=l[0],f=l[1],p=i(e.quill.getLeaf(c.index),2),m=p[0],h=p[1],g=i(c.length===0?[m,h]:e.quill.getLeaf(c.index+c.length),2),_=g[0],v=g[1],y=m instanceof d.default.Text?m.value().slice(0,h):``,b=_ instanceof d.default.Text?_.value().slice(v):``,x={collapsed:c.length===0,empty:c.length===0&&u.length()<=1,format:e.quill.getFormat(c),offset:f,prefix:y,suffix:b};o.some(function(t){if(t.collapsed!=null&&t.collapsed!==x.collapsed||t.empty!=null&&t.empty!==x.empty||t.offset!=null&&t.offset!==x.offset)return!1;if(Array.isArray(t.format)){if(t.format.every(function(e){return x.format[e]==null}))return!1}else if(r(t.format)===`object`&&!Object.keys(t.format).every(function(e){return t.format[e]===!0?x.format[e]!=null:t.format[e]===!1?x.format[e]==null:(0,s.default)(t.format[e],x.format[e])}))return!1;return t.prefix!=null&&!t.prefix.test(x.prefix)||t.suffix!=null&&!t.suffix.test(x.suffix)?!1:t.handler.call(e,c,x)!==!0})&&n.preventDefault()}}}})}}]),t}(m.default);S.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},S.DEFAULTS={bindings:{bold:k(`bold`),italic:k(`italic`),underline:k(`underline`),indent:{key:S.keys.TAB,format:[`blockquote`,`indent`,`list`],handler:function(e,t){if(t.collapsed&&t.offset!==0)return!0;this.quill.format(`indent`,`+1`,f.default.sources.USER)}},outdent:{key:S.keys.TAB,shiftKey:!0,format:[`blockquote`,`indent`,`list`],handler:function(e,t){if(t.collapsed&&t.offset!==0)return!0;this.quill.format(`indent`,`-1`,f.default.sources.USER)}},"outdent backspace":{key:S.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:[`indent`,`list`],offset:0,handler:function(e,t){t.format.indent==null?t.format.list!=null&&this.quill.format(`list`,!1,f.default.sources.USER):this.quill.format(`indent`,`-1`,f.default.sources.USER)}},"indent code-block":O(!0),"outdent code-block":O(!1),"remove tab":{key:S.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(e){this.quill.deleteText(e.index-1,1,f.default.sources.USER)}},tab:{key:S.keys.TAB,handler:function(e){this.quill.history.cutoff();var t=new l.default().retain(e.index).delete(e.length).insert(` `);this.quill.updateContents(t,f.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,f.default.sources.SILENT)}},"list empty enter":{key:S.keys.ENTER,collapsed:!0,format:[`list`],empty:!0,handler:function(e,t){this.quill.format(`list`,!1,f.default.sources.USER),t.format.indent&&this.quill.format(`indent`,!1,f.default.sources.USER)}},"checklist enter":{key:S.keys.ENTER,collapsed:!0,format:{list:`checked`},handler:function(e){var t=i(this.quill.getLine(e.index),2),n=t[0],r=t[1],a=(0,c.default)({},n.formats(),{list:`checked`}),o=new l.default().retain(e.index).insert(`
63
- `,a).retain(n.length()-r-1).retain(1,{list:`unchecked`});this.quill.updateContents(o,f.default.sources.USER),this.quill.setSelection(e.index+1,f.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:S.keys.ENTER,collapsed:!0,format:[`header`],suffix:/^$/,handler:function(e,t){var n=i(this.quill.getLine(e.index),2),r=n[0],a=n[1],o=new l.default().retain(e.index).insert(`
64
- `,t.format).retain(r.length()-a-1).retain(1,{header:null});this.quill.updateContents(o,f.default.sources.USER),this.quill.setSelection(e.index+1,f.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:` `,collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(e,t){var n=t.prefix.length,r=i(this.quill.getLine(e.index),2),a=r[0],o=r[1];if(o>n)return!0;var s=void 0;switch(t.prefix.trim()){case`[]`:case`[ ]`:s=`unchecked`;break;case`[x]`:s=`checked`;break;case`-`:case`*`:s=`bullet`;break;default:s=`ordered`}this.quill.insertText(e.index,` `,f.default.sources.USER),this.quill.history.cutoff();var c=new l.default().retain(e.index-o).delete(n+1).retain(a.length()-2-o).retain(1,{list:s});this.quill.updateContents(c,f.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,f.default.sources.SILENT)}},"code exit":{key:S.keys.ENTER,collapsed:!0,format:[`code-block`],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(e){var t=i(this.quill.getLine(e.index),2),n=t[0],r=t[1],a=new l.default().retain(e.index+n.length()-r-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(a,f.default.sources.USER)}},"embed left":C(S.keys.LEFT,!1),"embed left shift":C(S.keys.LEFT,!0),"embed right":C(S.keys.RIGHT,!1),"embed right shift":C(S.keys.RIGHT,!0)}};function C(e,t){var n,r=e===S.keys.LEFT?`prefix`:`suffix`;return n={key:e,shiftKey:t,altKey:null},g(n,r,/^$/),g(n,`handler`,function(n){var r=n.index;return e===S.keys.RIGHT&&(r+=n.length+1),i(this.quill.getLeaf(r),1)[0]instanceof d.default.Embed?(e===S.keys.LEFT?t?this.quill.setSelection(n.index-1,n.length+1,f.default.sources.USER):this.quill.setSelection(n.index-1,f.default.sources.USER):t?this.quill.setSelection(n.index,n.length+1,f.default.sources.USER):this.quill.setSelection(n.index+n.length+1,f.default.sources.USER),!1):!0}),n}function w(e,t){if(!(e.index===0||this.quill.getLength()<=1)){var n=i(this.quill.getLine(e.index),1)[0],r={};if(t.offset===0){var a=i(this.quill.getLine(e.index-1),1)[0];if(a!=null&&a.length()>1){var o=n.formats(),s=this.quill.getFormat(e.index-1,1);r=u.default.attributes.diff(o,s)||{}}}var c=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;this.quill.deleteText(e.index-c,c,f.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(e.index-c,c,r,f.default.sources.USER),this.quill.focus()}}function T(e,t){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(!(e.index>=this.quill.getLength()-n)){var r={},a=0,o=i(this.quill.getLine(e.index),1)[0];if(t.offset>=o.length()-1){var s=i(this.quill.getLine(e.index+1),1)[0];if(s){var c=o.formats(),l=this.quill.getFormat(e.index,1);r=u.default.attributes.diff(c,l)||{},a=s.length()}}this.quill.deleteText(e.index,n,f.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(e.index+a-1,n,r,f.default.sources.USER)}}function E(e){var t=this.quill.getLines(e),n={};if(t.length>1){var r=t[0].formats(),i=t[t.length-1].formats();n=u.default.attributes.diff(i,r)||{}}this.quill.deleteText(e,f.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(e.index,1,n,f.default.sources.USER),this.quill.setSelection(e.index,f.default.sources.SILENT),this.quill.focus()}function D(e,t){var n=this;e.length>0&&this.quill.scroll.deleteAt(e.index,e.length);var r=Object.keys(t.format).reduce(function(e,n){return d.default.query(n,d.default.Scope.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e},{});this.quill.insertText(e.index,`
65
- `,r,f.default.sources.USER),this.quill.setSelection(e.index+1,f.default.sources.SILENT),this.quill.focus(),Object.keys(t.format).forEach(function(e){r[e]??(Array.isArray(t.format[e])||e!==`link`&&n.quill.format(e,t.format[e],f.default.sources.USER))})}function O(e){return{key:S.keys.TAB,shiftKey:!e,format:{"code-block":!0},handler:function(t){var n=d.default.query(`code-block`),r=t.index,a=t.length,o=i(this.quill.scroll.descendant(n,r),2),s=o[0],c=o[1];if(s!=null){var l=this.quill.getIndex(s),u=s.newlineIndex(c,!0)+1,p=s.newlineIndex(l+c+a),m=s.domNode.textContent.slice(u,p).split(`
66
- `);c=0,m.forEach(function(t,i){e?(s.insertAt(u+c,n.TAB),c+=n.TAB.length,i===0?r+=n.TAB.length:a+=n.TAB.length):t.startsWith(n.TAB)&&(s.deleteAt(u+c,n.TAB.length),c-=n.TAB.length,i===0?r-=n.TAB.length:a-=n.TAB.length),c+=t.length+1}),this.quill.update(f.default.sources.USER),this.quill.setSelection(r,a,f.default.sources.SILENT)}}}}function k(e){return{key:e[0].toUpperCase(),shortKey:!0,handler:function(t,n){this.quill.format(e,!n.format[e],f.default.sources.USER)}}}function A(e){if(typeof e==`string`||typeof e==`number`)return A({key:e});if((e===void 0?`undefined`:r(e))===`object`&&(e=(0,o.default)(e,!1)),typeof e.key==`string`)if(S.keys[e.key.toUpperCase()]!=null)e.key=S.keys[e.key.toUpperCase()];else if(e.key.length===1)e.key=e.key.toUpperCase().charCodeAt(0);else return null;return e.shortKey&&(e[x]=e.shortKey,delete e.shortKey),e}t.default=S,t.SHORTKEY=x}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=c(n(0)),s=c(n(7));function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function u(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function d(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var f=function(e){d(t,e),a(t,null,[{key:`value`,value:function(){}}]);function t(e,n){l(this,t);var r=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.selection=n,r.textNode=document.createTextNode(t.CONTENTS),r.domNode.appendChild(r.textNode),r._length=0,r}return a(t,[{key:`detach`,value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:`format`,value:function(e,n){if(this._length!==0)return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`format`,this).call(this,e,n);for(var r=this,a=0;r!=null&&r.statics.scope!==o.default.Scope.BLOCK_BLOT;)a+=r.offset(r.parent),r=r.parent;r!=null&&(this._length=t.CONTENTS.length,r.optimize(),r.formatAt(a,t.CONTENTS.length,e,n),this._length=0)}},{key:`index`,value:function(e,n){return e===this.textNode?0:i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`index`,this).call(this,e,n)}},{key:`length`,value:function(){return this._length}},{key:`position`,value:function(){return[this.textNode,this.textNode.data.length]}},{key:`remove`,value:function(){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`remove`,this).call(this),this.parent=null}},{key:`restore`,value:function(){if(!(this.selection.composing||this.parent==null)){var e=this.textNode,n=this.selection.getNativeRange(),i=void 0,a=void 0,c=void 0;if(n!=null&&n.start.node===e&&n.end.node===e){var l=[e,n.start.offset,n.end.offset];i=l[0],a=l[1],c=l[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==t.CONTENTS){var u=this.textNode.data.split(t.CONTENTS).join(``);this.next instanceof s.default?(i=this.next.domNode,this.next.insertAt(0,u),this.textNode.data=t.CONTENTS):(this.textNode.data=u,this.parent.insertBefore(o.default.create(this.textNode),this),this.textNode=document.createTextNode(t.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),a!=null){var d=r([a,c].map(function(e){return Math.max(0,Math.min(i.data.length,e-1))}),2);return a=d[0],c=d[1],{startNode:i,startOffset:a,endNode:i,endOffset:c}}}}},{key:`update`,value:function(e,t){var n=this;if(e.some(function(e){return e.type===`characterData`&&e.target===n.textNode})){var r=this.restore();r&&(t.range=r)}}},{key:`value`,value:function(){return``}}]),t}(o.default.Embed);f.blotName=`cursor`,f.className=`ql-cursor`,f.tagName=`span`,f.CONTENTS=``,t.default=f}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=o(n(0)),i=n(4),a=o(i);function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function c(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function l(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(e){l(t,e);function t(){return s(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return t}(r.default.Container);u.allowedChildren=[a.default,i.BlockEmbed,u],t.default=u}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.ColorStyle=t.ColorClass=t.ColorAttributor=void 0;var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function c(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function l(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(e){l(t,e);function t(){return s(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,[{key:`value`,value:function(e){var n=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`value`,this).call(this,e);return n.startsWith(`rgb(`)?(n=n.replace(/^[^\d]+/,``).replace(/[^\d]+$/,``),`#`+n.split(`,`).map(function(e){return(`00`+parseInt(e).toString(16)).slice(-2)}).join(``)):n}}]),t}(a.default.Attributor.Style),d=new a.default.Attributor.Class(`color`,`ql-color`,{scope:a.default.Scope.INLINE}),f=new u(`color`,`color`,{scope:a.default.Scope.INLINE});t.ColorAttributor=u,t.ColorClass=d,t.ColorStyle=f}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.sanitize=t.default=void 0;var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=o(n(6));function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function c(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function l(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(e){l(t,e);function t(){return s(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,[{key:`format`,value:function(e,n){if(e!==this.statics.blotName||!n)return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`format`,this).call(this,e,n);n=this.constructor.sanitize(n),this.domNode.setAttribute(`href`,n)}}],[{key:`create`,value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),`create`,this).call(this,e);return e=this.sanitize(e),n.setAttribute(`href`,e),n.setAttribute(`rel`,`noopener noreferrer`),n.setAttribute(`target`,`_blank`),n}},{key:`formats`,value:function(e){return e.getAttribute(`href`)}},{key:`sanitize`,value:function(e){return d(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}}]),t}(a.default);u.blotName=`link`,u.tagName=`A`,u.SANITIZED_URL=`about:blank`,u.PROTOCOL_WHITELIST=[`http`,`https`,`mailto`,`tel`];function d(e,t){var n=document.createElement(`a`);n.href=e;var r=n.href.slice(0,n.href.indexOf(`:`));return t.indexOf(r)>-1}t.default=u,t.sanitize=d}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=s(n(23)),o=s(n(107));function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var l=0;function u(e,t){e.setAttribute(t,e.getAttribute(t)!==`true`)}t.default=function(){function e(t){var n=this;c(this,e),this.select=t,this.container=document.createElement(`span`),this.buildPicker(),this.select.style.display=`none`,this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener(`mousedown`,function(){n.togglePicker()}),this.label.addEventListener(`keydown`,function(e){switch(e.keyCode){case a.default.keys.ENTER:n.togglePicker();break;case a.default.keys.ESCAPE:n.escape(),e.preventDefault();break;default:}}),this.select.addEventListener(`change`,this.update.bind(this))}return i(e,[{key:`togglePicker`,value:function(){this.container.classList.toggle(`ql-expanded`),u(this.label,`aria-expanded`),u(this.options,`aria-hidden`)}},{key:`buildItem`,value:function(e){var t=this,n=document.createElement(`span`);return n.tabIndex=`0`,n.setAttribute(`role`,`button`),n.classList.add(`ql-picker-item`),e.hasAttribute(`value`)&&n.setAttribute(`data-value`,e.getAttribute(`value`)),e.textContent&&n.setAttribute(`data-label`,e.textContent),n.addEventListener(`click`,function(){t.selectItem(n,!0)}),n.addEventListener(`keydown`,function(e){switch(e.keyCode){case a.default.keys.ENTER:t.selectItem(n,!0),e.preventDefault();break;case a.default.keys.ESCAPE:t.escape(),e.preventDefault();break;default:}}),n}},{key:`buildLabel`,value:function(){var e=document.createElement(`span`);return e.classList.add(`ql-picker-label`),e.innerHTML=o.default,e.tabIndex=`0`,e.setAttribute(`role`,`button`),e.setAttribute(`aria-expanded`,`false`),this.container.appendChild(e),e}},{key:`buildOptions`,value:function(){var e=this,t=document.createElement(`span`);t.classList.add(`ql-picker-options`),t.setAttribute(`aria-hidden`,`true`),t.tabIndex=`-1`,t.id=`ql-picker-options-`+l,l+=1,this.label.setAttribute(`aria-controls`,t.id),this.options=t,[].slice.call(this.select.options).forEach(function(n){var r=e.buildItem(n);t.appendChild(r),n.selected===!0&&e.selectItem(r)}),this.container.appendChild(t)}},{key:`buildPicker`,value:function(){var e=this;[].slice.call(this.select.attributes).forEach(function(t){e.container.setAttribute(t.name,t.value)}),this.container.classList.add(`ql-picker`),this.label=this.buildLabel(),this.buildOptions()}},{key:`escape`,value:function(){var e=this;this.close(),setTimeout(function(){return e.label.focus()},1)}},{key:`close`,value:function(){this.container.classList.remove(`ql-expanded`),this.label.setAttribute(`aria-expanded`,`false`),this.options.setAttribute(`aria-hidden`,`true`)}},{key:`selectItem`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=this.container.querySelector(`.ql-selected`);if(e!==n&&(n?.classList.remove(`ql-selected`),e!=null&&(e.classList.add(`ql-selected`),this.select.selectedIndex=[].indexOf.call(e.parentNode.children,e),e.hasAttribute(`data-value`)?this.label.setAttribute(`data-value`,e.getAttribute(`data-value`)):this.label.removeAttribute(`data-value`),e.hasAttribute(`data-label`)?this.label.setAttribute(`data-label`,e.getAttribute(`data-label`)):this.label.removeAttribute(`data-label`),t))){if(typeof Event==`function`)this.select.dispatchEvent(new Event(`change`));else if((typeof Event>`u`?`undefined`:r(Event))===`object`){var i=document.createEvent(`Event`);i.initEvent(`change`,!0,!0),this.select.dispatchEvent(i)}this.close()}}},{key:`update`,value:function(){var e=void 0;if(this.select.selectedIndex>-1){var t=this.container.querySelector(`.ql-picker-options`).children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);var n=e!=null&&e!==this.select.querySelector(`option[selected]`);this.label.classList.toggle(`ql-active`,n)}}]),e}()}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=_(n(0)),i=_(n(5)),a=n(4),o=_(a),s=_(n(16)),c=_(n(25)),l=_(n(24)),u=_(n(35)),d=_(n(6)),f=_(n(22)),p=_(n(7)),m=_(n(55)),h=_(n(42)),g=_(n(23));function _(e){return e&&e.__esModule?e:{default:e}}i.default.register({"blots/block":o.default,"blots/block/embed":a.BlockEmbed,"blots/break":s.default,"blots/container":c.default,"blots/cursor":l.default,"blots/embed":u.default,"blots/inline":d.default,"blots/scroll":f.default,"blots/text":p.default,"modules/clipboard":m.default,"modules/history":h.default,"modules/keyboard":g.default}),r.default.register(o.default,s.default,l.default,d.default,f.default,p.default),t.default=i.default}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=n(1);t.default=function(){function e(e){this.domNode=e,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(e.prototype,`statics`,{get:function(){return this.constructor},enumerable:!0,configurable:!0}),e.create=function(e){if(this.tagName==null)throw new r.ParchmentError(`Blot definition missing tagName`);var t;return Array.isArray(this.tagName)?(typeof e==`string`&&(e=e.toUpperCase(),parseInt(e).toString()===e&&(e=parseInt(e))),t=typeof e==`number`?document.createElement(this.tagName[e-1]):this.tagName.indexOf(e)>-1?document.createElement(e):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t},e.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},e.prototype.clone=function(){var e=this.domNode.cloneNode(!1);return r.create(e)},e.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},e.prototype.deleteAt=function(e,t){this.isolate(e,t).remove()},e.prototype.formatAt=function(e,t,n,i){var a=this.isolate(e,t);if(r.query(n,r.Scope.BLOT)!=null&&i)a.wrap(n,i);else if(r.query(n,r.Scope.ATTRIBUTE)!=null){var o=r.create(this.statics.scope);a.wrap(o),o.format(n,i)}},e.prototype.insertAt=function(e,t,n){var i=n==null?r.create(`text`,t):r.create(t,n),a=this.split(e);this.parent.insertBefore(i,a)},e.prototype.insertInto=function(e,t){t===void 0&&(t=null),this.parent!=null&&this.parent.children.remove(this);var n=null;e.children.insertBefore(this,t),t!=null&&(n=t.domNode),(this.domNode.parentNode!=e.domNode||this.domNode.nextSibling!=n)&&e.domNode.insertBefore(this.domNode,n),this.parent=e,this.attach()},e.prototype.isolate=function(e,t){var n=this.split(e);return n.split(t),n},e.prototype.length=function(){return 1},e.prototype.offset=function(e){return e===void 0&&(e=this.parent),this.parent==null||this==e?0:this.parent.children.offset(this)+this.parent.offset(e)},e.prototype.optimize=function(e){this.domNode[r.DATA_KEY]!=null&&delete this.domNode[r.DATA_KEY].mutations},e.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},e.prototype.replace=function(e){e.parent!=null&&(e.parent.insertBefore(this,e.next),e.remove())},e.prototype.replaceWith=function(e,t){var n=typeof e==`string`?r.create(e,t):e;return n.replace(this),n},e.prototype.split=function(e,t){return e===0?this:this.next},e.prototype.update=function(e,t){},e.prototype.wrap=function(e,t){var n=typeof e==`string`?r.create(e,t):e;return this.parent!=null&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},e.blotName=`abstract`,e}()}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=n(12),i=n(32),a=n(33),o=n(1);t.default=function(){function e(e){this.attributes={},this.domNode=e,this.build()}return e.prototype.attribute=function(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)==null?delete this.attributes[e.attrName]:this.attributes[e.attrName]=e):(e.remove(this.domNode),delete this.attributes[e.attrName])},e.prototype.build=function(){var e=this;this.attributes={};var t=r.default.keys(this.domNode),n=i.default.keys(this.domNode),s=a.default.keys(this.domNode);t.concat(n).concat(s).forEach(function(t){var n=o.query(t,o.Scope.ATTRIBUTE);n instanceof r.default&&(e.attributes[n.attrName]=n)})},e.prototype.copy=function(e){var t=this;Object.keys(this.attributes).forEach(function(n){var r=t.attributes[n].value(t.domNode);e.format(n,r)})},e.prototype.move=function(e){var t=this;this.copy(e),Object.keys(this.attributes).forEach(function(e){t.attributes[e].remove(t.domNode)}),this.attributes={}},e.prototype.values=function(){var e=this;return Object.keys(this.attributes).reduce(function(t,n){return t[n]=e.attributes[n].value(e.domNode),t},{})},e}()}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0});var i=n(12);function a(e,t){return(e.getAttribute(`class`)||``).split(/\s+/).filter(function(e){return e.indexOf(t+`-`)===0})}t.default=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.keys=function(e){return(e.getAttribute(`class`)||``).split(/\s+/).map(function(e){return e.split(`-`).slice(0,-1).join(`-`)})},t.prototype.add=function(e,t){return this.canAdd(e,t)?(this.remove(e),e.classList.add(this.keyName+`-`+t),!0):!1},t.prototype.remove=function(e){a(e,this.keyName).forEach(function(t){e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute(`class`)},t.prototype.value=function(e){var t=(a(e,this.keyName)[0]||``).slice(this.keyName.length+1);return this.canAdd(e,t)?t:``},t}(i.default)}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0});var i=n(12);function a(e){var t=e.split(`-`),n=t.slice(1).map(function(e){return e[0].toUpperCase()+e.slice(1)}).join(``);return t[0]+n}t.default=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.keys=function(e){return(e.getAttribute(`style`)||``).split(`;`).map(function(e){return e.split(`:`)[0].trim()})},t.prototype.add=function(e,t){return this.canAdd(e,t)?(e.style[a(this.keyName)]=t,!0):!1},t.prototype.remove=function(e){e.style[a(this.keyName)]=``,e.getAttribute(`style`)||e.removeAttribute(`style`)},t.prototype.value=function(e){var t=e.style[a(this.keyName)];return this.canAdd(e,t)?t:``},t}(i.default)}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var a=function(){function e(t,n){i(this,e),this.quill=t,this.options=n,this.modules={}}return r(e,[{key:`init`,value:function(){var e=this;Object.keys(this.options.modules).forEach(function(t){e.modules[t]??e.addModule(t)})}},{key:`addModule`,value:function(e){var t=this.quill.constructor.import(`modules/`+e);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}]),e}();a.DEFAULTS={modules:{}},a.themes={default:a},t.default=a}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=s(n(0)),o=s(n(7));function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function l(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function u(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=``;t.default=function(e){u(t,e);function t(e){c(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.contentNode=document.createElement(`span`),n.contentNode.setAttribute(`contenteditable`,!1),[].slice.call(n.domNode.childNodes).forEach(function(e){n.contentNode.appendChild(e)}),n.leftGuard=document.createTextNode(d),n.rightGuard=document.createTextNode(d),n.domNode.appendChild(n.leftGuard),n.domNode.appendChild(n.contentNode),n.domNode.appendChild(n.rightGuard),n}return r(t,[{key:`index`,value:function(e,n){return e===this.leftGuard?0:e===this.rightGuard?1:i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`index`,this).call(this,e,n)}},{key:`restore`,value:function(e){var t=void 0,n=void 0,r=e.data.split(d).join(``);if(e===this.leftGuard)if(this.prev instanceof o.default){var i=this.prev.length();this.prev.insertAt(i,r),t={startNode:this.prev.domNode,startOffset:i+r.length}}else n=document.createTextNode(r),this.parent.insertBefore(a.default.create(n),this),t={startNode:n,startOffset:r.length};else e===this.rightGuard&&(this.next instanceof o.default?(this.next.insertAt(0,r),t={startNode:this.next.domNode,startOffset:r.length}):(n=document.createTextNode(r),this.parent.insertBefore(a.default.create(n),this.next),t={startNode:n,startOffset:r.length}));return e.data=d,t}},{key:`update`,value:function(e,t){var n=this;e.forEach(function(e){if(e.type===`characterData`&&(e.target===n.leftGuard||e.target===n.rightGuard)){var r=n.restore(e.target);r&&(t.range=r)}})}}]),t}(a.default.Embed)}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.AlignStyle=t.AlignClass=t.AlignAttribute=void 0;var r=i(n(0));function i(e){return e&&e.__esModule?e:{default:e}}var a={scope:r.default.Scope.BLOCK,whitelist:[`right`,`center`,`justify`]},o=new r.default.Attributor.Attribute(`align`,`align`,a),s=new r.default.Attributor.Class(`align`,`ql-align`,a),c=new r.default.Attributor.Style(`align`,`text-align`,a);t.AlignAttribute=o,t.AlignClass=s,t.AlignStyle=c}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.BackgroundStyle=t.BackgroundClass=void 0;var r=a(n(0)),i=n(26);function a(e){return e&&e.__esModule?e:{default:e}}var o=new r.default.Attributor.Class(`background`,`ql-bg`,{scope:r.default.Scope.INLINE}),s=new i.ColorAttributor(`background`,`background-color`,{scope:r.default.Scope.INLINE});t.BackgroundClass=o,t.BackgroundStyle=s}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.DirectionStyle=t.DirectionClass=t.DirectionAttribute=void 0;var r=i(n(0));function i(e){return e&&e.__esModule?e:{default:e}}var a={scope:r.default.Scope.BLOCK,whitelist:[`rtl`]},o=new r.default.Attributor.Attribute(`direction`,`dir`,a),s=new r.default.Attributor.Class(`direction`,`ql-direction`,a),c=new r.default.Attributor.Style(`direction`,`direction`,a);t.DirectionAttribute=o,t.DirectionClass=s,t.DirectionStyle=c}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.FontClass=t.FontStyle=void 0;var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function c(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function l(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u={scope:a.default.Scope.INLINE,whitelist:[`serif`,`monospace`]},d=new a.default.Attributor.Class(`font`,`ql-font`,u);t.FontStyle=new(function(e){l(t,e);function t(){return s(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,[{key:`value`,value:function(e){return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`value`,this).call(this,e).replace(/["']/g,``)}}]),t}(a.default.Attributor.Style))(`font`,`font-family`,u),t.FontClass=d}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.SizeStyle=t.SizeClass=void 0;var r=i(n(0));function i(e){return e&&e.__esModule?e:{default:e}}var a=new r.default.Attributor.Class(`size`,`ql-size`,{scope:r.default.Scope.INLINE,whitelist:[`small`,`large`,`huge`]}),o=new r.default.Attributor.Style(`size`,`font-size`,{scope:r.default.Scope.INLINE,whitelist:[`10px`,`18px`,`32px`]});t.SizeClass=a,t.SizeStyle=o}),(function(e,t,n){e.exports={align:{"":n(76),center:n(77),right:n(78),justify:n(79)},background:n(80),blockquote:n(81),bold:n(82),clean:n(83),code:n(58),"code-block":n(58),color:n(84),direction:{"":n(85),rtl:n(86)},float:{center:n(87),full:n(88),left:n(89),right:n(90)},formula:n(91),header:{1:n(92),2:n(93)},italic:n(94),image:n(95),indent:{"+1":n(96),"-1":n(97)},link:n(98),list:{ordered:n(99),bullet:n(100),check:n(101)},script:{sub:n(102),super:n(103)},strike:n(104),underline:n(105),video:n(106)}}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.getLastChangeIndex=t.default=void 0;var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=s(n(0)),a=s(n(5)),o=s(n(9));function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function l(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function u(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=function(e){u(t,e);function t(e,n){c(this,t);var r=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.lastRecorded=0,r.ignoreChange=!1,r.clear(),r.quill.on(a.default.events.EDITOR_CHANGE,function(e,t,n,i){e!==a.default.events.TEXT_CHANGE||r.ignoreChange||(!r.options.userOnly||i===a.default.sources.USER?r.record(t,n):r.transform(t))}),r.quill.keyboard.addBinding({key:`Z`,shortKey:!0},r.undo.bind(r)),r.quill.keyboard.addBinding({key:`Z`,shortKey:!0,shiftKey:!0},r.redo.bind(r)),/Win/i.test(navigator.platform)&&r.quill.keyboard.addBinding({key:`Y`,shortKey:!0},r.redo.bind(r)),r}return r(t,[{key:`change`,value:function(e,t){if(this.stack[e].length!==0){var n=this.stack[e].pop();this.stack[t].push(n),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n[e],a.default.sources.USER),this.ignoreChange=!1;var r=p(n[e]);this.quill.setSelection(r)}}},{key:`clear`,value:function(){this.stack={undo:[],redo:[]}}},{key:`cutoff`,value:function(){this.lastRecorded=0}},{key:`record`,value:function(e,t){if(e.ops.length!==0){this.stack.redo=[];var n=this.quill.getContents().diff(t),r=Date.now();if(this.lastRecorded+this.options.delay>r&&this.stack.undo.length>0){var i=this.stack.undo.pop();n=n.compose(i.undo),e=i.redo.compose(e)}else this.lastRecorded=r;this.stack.undo.push({redo:e,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:`redo`,value:function(){this.change(`redo`,`undo`)}},{key:`transform`,value:function(e){this.stack.undo.forEach(function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)}),this.stack.redo.forEach(function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)})}},{key:`undo`,value:function(){this.change(`undo`,`redo`)}}]),t}(o.default);d.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function f(e){var t=e.ops[e.ops.length-1];return t==null?!1:t.insert==null?t.attributes==null?!1:Object.keys(t.attributes).some(function(e){return i.default.query(e,i.default.Scope.BLOCK)!=null}):typeof t.insert==`string`&&t.insert.endsWith(`
67
- `)}function p(e){var t=e.reduce(function(e,t){return e+=t.delete||0,e},0),n=e.length()-t;return f(e)&&--n,n}t.default=d,t.getLastChangeIndex=p}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=t.BaseTooltip=void 0;var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=m(n(3)),o=m(n(2)),s=m(n(8)),c=m(n(23)),l=m(n(34)),u=m(n(59)),d=m(n(60)),f=m(n(28)),p=m(n(61));function m(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function g(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function _(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var v=[!1,`center`,`right`,`justify`],y=`#000000.#e60000.#ff9900.#ffff00.#008a00.#0066cc.#9933ff.#ffffff.#facccc.#ffebcc.#ffffcc.#cce8cc.#cce0f5.#ebd6ff.#bbbbbb.#f06666.#ffc266.#ffff66.#66b966.#66a3e0.#c285ff.#888888.#a10000.#b26b00.#b2b200.#006100.#0047b2.#6b24b2.#444444.#5c0000.#663d00.#666600.#003700.#002966.#3d1466`.split(`.`),b=[!1,`serif`,`monospace`],x=[`1`,`2`,`3`,!1],S=[`small`,!1,`large`,`huge`],C=function(e){_(t,e);function t(e,n){h(this,t);var r=g(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return e.emitter.listenDOM(`click`,document.body,function t(n){if(!document.body.contains(e.root))return document.body.removeEventListener(`click`,t);r.tooltip!=null&&!r.tooltip.root.contains(n.target)&&document.activeElement!==r.tooltip.textbox&&!r.quill.hasFocus()&&r.tooltip.hide(),r.pickers!=null&&r.pickers.forEach(function(e){e.container.contains(n.target)||e.close()})}),r}return r(t,[{key:`addModule`,value:function(e){var n=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`addModule`,this).call(this,e);return e===`toolbar`&&this.extendToolbar(n),n}},{key:`buildButtons`,value:function(e,t){e.forEach(function(e){(e.getAttribute(`class`)||``).split(/\s+/).forEach(function(n){if(n.startsWith(`ql-`)&&(n=n.slice(3),t[n]!=null))if(n===`direction`)e.innerHTML=t[n][``]+t[n].rtl;else if(typeof t[n]==`string`)e.innerHTML=t[n];else{var r=e.value||``;r!=null&&t[n][r]&&(e.innerHTML=t[n][r])}})})}},{key:`buildPickers`,value:function(e,t){var n=this;this.pickers=e.map(function(e){if(e.classList.contains(`ql-align`))return e.querySelector(`option`)??E(e,v),new d.default(e,t.align);if(e.classList.contains(`ql-background`)||e.classList.contains(`ql-color`)){var n=e.classList.contains(`ql-background`)?`background`:`color`;return e.querySelector(`option`)??E(e,y,n===`background`?`#ffffff`:`#000000`),new u.default(e,t[n])}else return e.querySelector(`option`)??(e.classList.contains(`ql-font`)?E(e,b):e.classList.contains(`ql-header`)?E(e,x):e.classList.contains(`ql-size`)&&E(e,S)),new f.default(e)}),this.quill.on(s.default.events.EDITOR_CHANGE,function(){n.pickers.forEach(function(e){e.update()})})}}]),t}(l.default);C.DEFAULTS=(0,a.default)(!0,{},l.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit(`formula`)},image:function(){var e=this,t=this.container.querySelector(`input.ql-image[type=file]`);t??(t=document.createElement(`input`),t.setAttribute(`type`,`file`),t.setAttribute(`accept`,`image/png, image/gif, image/jpeg, image/bmp, image/x-icon`),t.classList.add(`ql-image`),t.addEventListener(`change`,function(){if(t.files!=null&&t.files[0]!=null){var n=new FileReader;n.onload=function(n){var r=e.quill.getSelection(!0);e.quill.updateContents(new o.default().retain(r.index).delete(r.length).insert({image:n.target.result}),s.default.sources.USER),e.quill.setSelection(r.index+1,s.default.sources.SILENT),t.value=``},n.readAsDataURL(t.files[0])}}),this.container.appendChild(t)),t.click()},video:function(){this.quill.theme.tooltip.edit(`video`)}}}}});var w=function(e){_(t,e);function t(e,n){h(this,t);var r=g(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.textbox=r.root.querySelector(`input[type="text"]`),r.listen(),r}return r(t,[{key:`listen`,value:function(){var e=this;this.textbox.addEventListener(`keydown`,function(t){c.default.match(t,`enter`)?(e.save(),t.preventDefault()):c.default.match(t,`escape`)&&(e.cancel(),t.preventDefault())})}},{key:`cancel`,value:function(){this.hide()}},{key:`edit`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:`link`,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove(`ql-hidden`),this.root.classList.add(`ql-editing`),t==null?e!==this.root.getAttribute(`data-mode`)&&(this.textbox.value=``):this.textbox.value=t,this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute(`placeholder`,this.textbox.getAttribute(`data-`+e)||``),this.root.setAttribute(`data-mode`,e)}},{key:`restoreFocus`,value:function(){var e=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=e}},{key:`save`,value:function(){var e=this.textbox.value;switch(this.root.getAttribute(`data-mode`)){case`link`:var t=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,`link`,e,s.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format(`link`,e,s.default.sources.USER)),this.quill.root.scrollTop=t;break;case`video`:e=T(e);case`formula`:if(!e)break;var n=this.quill.getSelection(!0);if(n!=null){var r=n.index+n.length;this.quill.insertEmbed(r,this.root.getAttribute(`data-mode`),e,s.default.sources.USER),this.root.getAttribute(`data-mode`)===`formula`&&this.quill.insertText(r+1,` `,s.default.sources.USER),this.quill.setSelection(r+2,s.default.sources.USER)}break;default:}this.textbox.value=``,this.hide()}}]),t}(p.default);function T(e){var t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?(t[1]||`https`)+`://www.youtube.com/embed/`+t[2]+`?showinfo=0`:(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(t[1]||`https`)+`://player.vimeo.com/video/`+t[2]+`/`:e}function E(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t.forEach(function(t){var r=document.createElement(`option`);t===n?r.setAttribute(`selected`,`selected`):r.setAttribute(`value`,t),e.appendChild(r)})}t.BaseTooltip=w,t.default=C}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=function(){function e(){this.head=this.tail=null,this.length=0}return e.prototype.append=function(){var e=[...arguments];this.insertBefore(e[0],null),e.length>1&&this.append.apply(this,e.slice(1))},e.prototype.contains=function(e){for(var t,n=this.iterator();t=n();)if(t===e)return!0;return!1},e.prototype.insertBefore=function(e,t){e&&(e.next=t,t==null?this.tail==null?(e.prev=null,this.head=this.tail=e):(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)),this.length+=1)},e.prototype.offset=function(e){for(var t=0,n=this.head;n!=null;){if(n===e)return t;t+=n.length(),n=n.next}return-1},e.prototype.remove=function(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),--this.length)},e.prototype.iterator=function(e){return e===void 0&&(e=this.head),function(){var t=e;return e!=null&&(e=e.next),t}},e.prototype.find=function(e,t){t===void 0&&(t=!1);for(var n,r=this.iterator();n=r();){var i=n.length();if(e<i||t&&e===i&&(n.next==null||n.next.length()!==0))return[n,e];e-=i}return[null,0]},e.prototype.forEach=function(e){for(var t,n=this.iterator();t=n();)e(t)},e.prototype.forEachAt=function(e,t,n){if(!(t<=0))for(var r=this.find(e),i=r[0],a=r[1],o,s=e-a,c=this.iterator(i);(o=c())&&s<e+t;){var l=o.length();e>s?n(o,e-s,Math.min(t,s+l-e)):n(o,0,Math.min(l,e+t-s)),s+=l}},e.prototype.map=function(e){return this.reduce(function(t,n){return t.push(e(n)),t},[])},e.prototype.reduce=function(e,t){for(var n,r=this.iterator();n=r();)t=e(t,n);return t},e}()}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0});var i=n(17),a=n(1),o={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},s=100;t.default=function(e){r(t,e);function t(t){var n=e.call(this,t)||this;return n.scroll=n,n.observer=new MutationObserver(function(e){n.update(e)}),n.observer.observe(n.domNode,o),n.attach(),n}return t.prototype.detach=function(){e.prototype.detach.call(this),this.observer.disconnect()},t.prototype.deleteAt=function(t,n){this.update(),t===0&&n===this.length()?this.children.forEach(function(e){e.remove()}):e.prototype.deleteAt.call(this,t,n)},t.prototype.formatAt=function(t,n,r,i){this.update(),e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.insertAt=function(t,n,r){this.update(),e.prototype.insertAt.call(this,t,n,r)},t.prototype.optimize=function(t,n){var r=this;t===void 0&&(t=[]),n===void 0&&(n={}),e.prototype.optimize.call(this,n);for(var o=[].slice.call(this.observer.takeRecords());o.length>0;)t.push(o.pop());for(var c=function(e,t){t===void 0&&(t=!0),!(e==null||e===r)&&e.domNode.parentNode!=null&&(e.domNode[a.DATA_KEY].mutations??(e.domNode[a.DATA_KEY].mutations=[]),t&&c(e.parent))},l=function(e){e.domNode[a.DATA_KEY]==null||e.domNode[a.DATA_KEY].mutations==null||(e instanceof i.default&&e.children.forEach(l),e.optimize(n))},u=t,d=0;u.length>0;d+=1){if(d>=s)throw Error(`[Parchment] Maximum optimize iterations reached`);for(u.forEach(function(e){var t=a.find(e.target,!0);t!=null&&(t.domNode===e.target&&(e.type===`childList`?(c(a.find(e.previousSibling,!1)),[].forEach.call(e.addedNodes,function(e){var t=a.find(e,!1);c(t,!1),t instanceof i.default&&t.children.forEach(function(e){c(e,!1)})})):e.type===`attributes`&&c(t.prev)),c(t))}),this.children.forEach(l),u=[].slice.call(this.observer.takeRecords()),o=u.slice();o.length>0;)t.push(o.pop())}},t.prototype.update=function(t,n){var r=this;n===void 0&&(n={}),t||=this.observer.takeRecords(),t.map(function(e){var t=a.find(e.target,!0);return t==null?null:t.domNode[a.DATA_KEY].mutations==null?(t.domNode[a.DATA_KEY].mutations=[e],t):(t.domNode[a.DATA_KEY].mutations.push(e),null)}).forEach(function(e){e==null||e===r||e.domNode[a.DATA_KEY]==null||e.update(e.domNode[a.DATA_KEY].mutations||[],n)}),this.domNode[a.DATA_KEY].mutations!=null&&e.prototype.update.call(this,this.domNode[a.DATA_KEY].mutations,n),this.optimize(t,n)},t.blotName=`scroll`,t.defaultChild=`block`,t.scope=a.Scope.BLOCK_BLOT,t.tagName=`DIV`,t}(i.default)}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0});var i=n(18),a=n(1);function o(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(e[n]!==t[n])return!1;return!0}t.default=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.formats=function(n){if(n.tagName!==t.tagName)return e.formats.call(this,n)},t.prototype.format=function(n,r){var a=this;n===this.statics.blotName&&!r?(this.children.forEach(function(e){e instanceof i.default||(e=e.wrap(t.blotName,!0)),a.attributes.copy(e)}),this.unwrap()):e.prototype.format.call(this,n,r)},t.prototype.formatAt=function(t,n,r,i){this.formats()[r]!=null||a.query(r,a.Scope.ATTRIBUTE)?this.isolate(t,n).format(r,i):e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.optimize=function(n){e.prototype.optimize.call(this,n);var r=this.formats();if(Object.keys(r).length===0)return this.unwrap();var i=this.next;i instanceof t&&i.prev===this&&o(r,i.formats())&&(i.moveChildren(this),i.remove())},t.blotName=`inline`,t.scope=a.Scope.INLINE_BLOT,t.tagName=`SPAN`,t}(i.default)}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0});var i=n(18),a=n(1);t.default=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.formats=function(n){var r=a.query(t.blotName).tagName;if(n.tagName!==r)return e.formats.call(this,n)},t.prototype.format=function(n,r){a.query(n,a.Scope.BLOCK)!=null&&(n===this.statics.blotName&&!r?this.replaceWith(t.blotName):e.prototype.format.call(this,n,r))},t.prototype.formatAt=function(t,n,r,i){a.query(r,a.Scope.BLOCK)==null?e.prototype.formatAt.call(this,t,n,r,i):this.format(r,i)},t.prototype.insertAt=function(t,n,r){if(r==null||a.query(n,a.Scope.INLINE)!=null)e.prototype.insertAt.call(this,t,n,r);else{var i=this.split(t),o=a.create(n,r);i.parent.insertBefore(o,i)}},t.prototype.update=function(t,n){navigator.userAgent.match(/Trident/)?this.build():e.prototype.update.call(this,t,n)},t.blotName=`block`,t.scope=a.Scope.BLOCK_BLOT,t.tagName=`P`,t}(i.default)}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0}),t.default=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.formats=function(e){},t.prototype.format=function(t,n){e.prototype.formatAt.call(this,0,this.length(),t,n)},t.prototype.formatAt=function(t,n,r,i){t===0&&n===this.length()?this.format(r,i):e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.formats=function(){return this.statics.formats(this.domNode)},t}(n(19).default)}),(function(e,t,n){var r=this&&this.__extends||(function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(t,`__esModule`,{value:!0});var i=n(19),a=n(1);t.default=function(e){r(t,e);function t(t){var n=e.call(this,t)||this;return n.text=n.statics.value(n.domNode),n}return t.create=function(e){return document.createTextNode(e)},t.value=function(e){var t=e.data;return t.normalize&&(t=t.normalize()),t},t.prototype.deleteAt=function(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)},t.prototype.index=function(e,t){return this.domNode===e?t:-1},t.prototype.insertAt=function(t,n,r){r==null?(this.text=this.text.slice(0,t)+n+this.text.slice(t),this.domNode.data=this.text):e.prototype.insertAt.call(this,t,n,r)},t.prototype.length=function(){return this.text.length},t.prototype.optimize=function(n){e.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof t&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},t.prototype.position=function(e,t){return t===void 0&&(t=!1),[this.domNode,e]},t.prototype.split=function(e,t){if(t===void 0&&(t=!1),!t){if(e===0)return this;if(e===this.length())return this.next}var n=a.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},t.prototype.update=function(e,t){var n=this;e.some(function(e){return e.type===`characterData`&&e.target===n.domNode})&&(this.text=this.statics.value(this.domNode))},t.prototype.value=function(){return this.text},t.blotName=`text`,t.scope=a.Scope.INLINE_BLOT,t}(i.default)}),(function(e,t,n){var r=document.createElement(`div`);if(r.classList.toggle(`test-class`,!1),r.classList.contains(`test-class`)){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return arguments.length>1&&!this.contains(e)==!t?t:i.call(this,e)}}String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t||=0,this.substr(t,e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){var n=this.toString();(typeof t!=`number`||!isFinite(t)||Math.floor(t)!==t||t>n.length)&&(t=n.length),t-=e.length;var r=n.indexOf(e,t);return r!==-1&&r===t}),Array.prototype.find||Object.defineProperty(Array.prototype,`find`,{value:function(e){if(this===null)throw TypeError(`Array.prototype.find called on null or undefined`);if(typeof e!=`function`)throw TypeError(`predicate must be a function`);for(var t=Object(this),n=t.length>>>0,r=arguments[1],i,a=0;a<n;a++)if(i=t[a],e.call(r,i,a,t))return i}}),document.addEventListener(`DOMContentLoaded`,function(){document.execCommand(`enableObjectResizing`,!1,!1),document.execCommand(`autoUrlDetect`,!1,!1)})}),(function(e,t){var n=-1,r=1,i=0;function a(e,t,n){if(e==t)return e?[[i,e]]:[];(n<0||e.length<n)&&(n=null);var r=l(e,t),a=e.substring(0,r);e=e.substring(r),t=t.substring(r),r=u(e,t);var s=e.substring(e.length-r);e=e.substring(0,e.length-r),t=t.substring(0,t.length-r);var c=o(e,t);return a&&c.unshift([i,a]),s&&c.push([i,s]),f(c),n!=null&&(c=h(c,n)),c=g(c),c}function o(e,t){var o;if(!e)return[[r,t]];if(!t)return[[n,e]];var c=e.length>t.length?e:t,l=e.length>t.length?t:e,u=c.indexOf(l);if(u!=-1)return o=[[r,c.substring(0,u)],[i,l],[r,c.substring(u+l.length)]],e.length>t.length&&(o[0][0]=o[2][0]=n),o;if(l.length==1)return[[n,e],[r,t]];var f=d(e,t);if(f){var p=f[0],m=f[1],h=f[2],g=f[3],_=f[4],v=a(p,h),y=a(m,g);return v.concat([[i,_]],y)}return s(e,t)}function s(e,t){for(var i=e.length,a=t.length,o=Math.ceil((i+a)/2),s=o,l=2*o,u=Array(l),d=Array(l),f=0;f<l;f++)u[f]=-1,d[f]=-1;u[s+1]=0,d[s+1]=0;for(var p=i-a,m=p%2!=0,h=0,g=0,_=0,v=0,y=0;y<o;y++){for(var b=-y+h;b<=y-g;b+=2){for(var x=s+b,S=b==-y||b!=y&&u[x-1]<u[x+1]?u[x+1]:u[x-1]+1,C=S-b;S<i&&C<a&&e.charAt(S)==t.charAt(C);)S++,C++;if(u[x]=S,S>i)g+=2;else if(C>a)h+=2;else if(m){var w=s+p-b;if(w>=0&&w<l&&d[w]!=-1){var T=i-d[w];if(S>=T)return c(e,t,S,C)}}}for(var E=-y+_;E<=y-v;E+=2){for(var w=s+E,T=E==-y||E!=y&&d[w-1]<d[w+1]?d[w+1]:d[w-1]+1,D=T-E;T<i&&D<a&&e.charAt(i-T-1)==t.charAt(a-D-1);)T++,D++;if(d[w]=T,T>i)v+=2;else if(D>a)_+=2;else if(!m){var x=s+p-E;if(x>=0&&x<l&&u[x]!=-1){var S=u[x],C=s+S-x;if(T=i-T,S>=T)return c(e,t,S,C)}}}}return[[n,e],[r,t]]}function c(e,t,n,r){var i=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=a(i,o),u=a(s,c);return l.concat(u)}function l(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i}function u(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i}function d(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2<n.length)return null;function i(e,t,n){for(var r=e.substring(n,n+Math.floor(e.length/4)),i=-1,a=``,o,s,c,d;(i=t.indexOf(r,i+1))!=-1;){var f=l(e.substring(n),t.substring(i)),p=u(e.substring(0,n),t.substring(0,i));a.length<p+f&&(a=t.substring(i-p,i)+t.substring(i,i+f),o=e.substring(0,n-p),s=e.substring(n+f),c=t.substring(0,i-p),d=t.substring(i+f))}return a.length*2>=e.length?[o,s,c,d,a]:null}var a=i(n,r,Math.ceil(n.length/4)),o=i(n,r,Math.ceil(n.length/2)),s;if(!a&&!o)return null;s=o?a&&a[4].length>o[4].length?a:o:a;var c,d,f,p;e.length>t.length?(c=s[0],d=s[1],f=s[2],p=s[3]):(f=s[0],p=s[1],c=s[2],d=s[3]);var m=s[4];return[c,d,f,p,m]}function f(e){e.push([i,``]);for(var t=0,a=0,o=0,s=``,c=``,d;t<e.length;)switch(e[t][0]){case r:o++,c+=e[t][1],t++;break;case n:a++,s+=e[t][1],t++;break;case i:a+o>1?(a!==0&&o!==0&&(d=l(c,s),d!==0&&(t-a-o>0&&e[t-a-o-1][0]==i?e[t-a-o-1][1]+=c.substring(0,d):(e.splice(0,0,[i,c.substring(0,d)]),t++),c=c.substring(d),s=s.substring(d)),d=u(c,s),d!==0&&(e[t][1]=c.substring(c.length-d)+e[t][1],c=c.substring(0,c.length-d),s=s.substring(0,s.length-d))),a===0?e.splice(t-o,a+o,[r,c]):o===0?e.splice(t-a,a+o,[n,s]):e.splice(t-a-o,a+o,[n,s],[r,c]),t=t-a-o+ +!!a+ +!!o+1):t!==0&&e[t-1][0]==i?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,o=0,a=0,s=``,c=``;break}e[e.length-1][1]===``&&e.pop();var p=!1;for(t=1;t<e.length-1;)e[t-1][0]==i&&e[t+1][0]==i&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)==e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),p=!0):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),p=!0)),t++;p&&f(e)}var p=a;p.INSERT=r,p.DELETE=n,p.EQUAL=i,e.exports=p;function m(e,t){if(t===0)return[i,e];for(var r=0,a=0;a<e.length;a++){var o=e[a];if(o[0]===n||o[0]===i){var s=r+o[1].length;if(t===s)return[a+1,e];if(t<s){e=e.slice();var c=t-r,l=[o[0],o[1].slice(0,c)],u=[o[0],o[1].slice(c)];return e.splice(a,1,l,u),[a+1,e]}else r=s}}throw Error(`cursor_pos is out of bounds!`)}function h(e,t){var n=m(e,t),r=n[1],a=n[0],o=r[a],s=r[a+1];if(o==null||o[0]!==i)return e;if(s!=null&&o[1]+s[1]===s[1]+o[1])return r.splice(a,2,s,o),_(r,a,2);if(s!=null&&s[1].indexOf(o[1])===0){r.splice(a,2,[s[0],o[1]],[0,o[1]]);var c=s[1].slice(o[1].length);return c.length>0&&r.splice(a+2,0,[s[0],c]),_(r,a,3)}else return e}function g(e){for(var t=!1,a=function(e){return e.charCodeAt(0)>=56320&&e.charCodeAt(0)<=57343},o=function(e){return e.charCodeAt(e.length-1)>=55296&&e.charCodeAt(e.length-1)<=56319},s=2;s<e.length;s+=1)e[s-2][0]===i&&o(e[s-2][1])&&e[s-1][0]===n&&a(e[s-1][1])&&e[s][0]===r&&a(e[s][1])&&(t=!0,e[s-1][1]=e[s-2][1].slice(-1)+e[s-1][1],e[s][1]=e[s-2][1].slice(-1)+e[s][1],e[s-2][1]=e[s-2][1].slice(0,-1));if(!t)return e;for(var c=[],s=0;s<e.length;s+=1)e[s][1].length>0&&c.push(e[s]);return c}function _(e,t,n){for(var r=t+n-1;r>=0&&r>=t-1;r--)if(r+1<e.length){var i=e[r],a=e[r+1];i[0]===a[1]&&e.splice(r,2,[i[0],i[1]+a[1]])}return e}}),(function(e,t){t=e.exports=typeof Object.keys==`function`?Object.keys:n,t.shim=n;function n(e){var t=[];for(var n in e)t.push(n);return t}}),(function(e,t){t=e.exports=(function(){return Object.prototype.toString.call(arguments)})()==`[object Arguments]`?n:r,t.supported=n;function n(e){return Object.prototype.toString.call(e)==`[object Arguments]`}t.unsupported=r;function r(e){return e&&typeof e==`object`&&typeof e.length==`number`&&Object.prototype.hasOwnProperty.call(e,`callee`)&&!Object.prototype.propertyIsEnumerable.call(e,`callee`)||!1}}),(function(e,t){var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(){this._events=new i,this._eventsCount=0}o.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},o.prototype.listeners=function(e,t){var n=r?r+e:e,i=this._events[n];if(t)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var a=0,o=i.length,s=Array(o);a<o;a++)s[a]=i[a].fn;return s},o.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},o.prototype.on=function(e,t,n){var i=new a(t,n||this),o=r?r+e:e;return this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],i]:this._events[o].push(i):(this._events[o]=i,this._eventsCount++),this},o.prototype.once=function(e,t,n){var i=new a(t,n||this,!0),o=r?r+e:e;return this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],i]:this._events[o].push(i):(this._events[o]=i,this._eventsCount++),this},o.prototype.removeListener=function(e,t,n,a){var o=r?r+e:e;if(!this._events[o])return this;if(!t)return--this._eventsCount===0?this._events=new i:delete this._events[o],this;var s=this._events[o];if(s.fn)s.fn===t&&(!a||s.once)&&(!n||s.context===n)&&(--this._eventsCount===0?this._events=new i:delete this._events[o]);else{for(var c=0,l=[],u=s.length;c<u;c++)(s[c].fn!==t||a&&!s[c].once||n&&s[c].context!==n)&&l.push(s[c]);l.length?this._events[o]=l.length===1?l[0]:l:--this._eventsCount===0?this._events=new i:delete this._events[o]}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&(--this._eventsCount===0?this._events=new i:delete this._events[t])):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prototype.setMaxListeners=function(){return this},o.prefixed=r,o.EventEmitter=o,e!==void 0&&(e.exports=o)}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.matchText=t.matchSpacing=t.matchNewline=t.matchBlot=t.matchAttributor=t.default=void 0;var r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),a=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=y(n(3)),s=y(n(2)),c=y(n(0)),l=y(n(5)),u=y(n(10)),d=y(n(9)),f=n(36),p=n(37),m=y(n(13)),h=n(26),g=n(38),_=n(39),v=n(40);function y(e){return e&&e.__esModule?e:{default:e}}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function S(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function C(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var w=(0,u.default)(`quill:clipboard`),T=`__ql-matcher`,E=[[Node.TEXT_NODE,oe],[Node.TEXT_NODE,L],[`br`,re],[Node.ELEMENT_NODE,L],[Node.ELEMENT_NODE,ne],[Node.ELEMENT_NODE,ie],[Node.ELEMENT_NODE,te],[Node.ELEMENT_NODE,ae],[`li`,I],[`b`,P.bind(P,`bold`)],[`i`,P.bind(P,`italic`)],[`style`,F]],D=[f.AlignAttribute,g.DirectionAttribute].reduce(function(e,t){return e[t.keyName]=t,e},{}),O=[f.AlignStyle,p.BackgroundStyle,h.ColorStyle,g.DirectionStyle,_.FontStyle,v.SizeStyle].reduce(function(e,t){return e[t.keyName]=t,e},{}),k=function(e){C(t,e);function t(e,n){x(this,t);var r=S(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.quill.root.addEventListener(`paste`,r.onPaste.bind(r)),r.container=r.quill.addContainer(`ql-clipboard`),r.container.setAttribute(`contenteditable`,!0),r.container.setAttribute(`tabindex`,-1),r.matchers=[],E.concat(r.options.matchers).forEach(function(e){var t=i(e,2),a=t[0],o=t[1];!n.matchVisual&&o===ie||r.addMatcher(a,o)}),r}return a(t,[{key:`addMatcher`,value:function(e,t){this.matchers.push([e,t])}},{key:`convert`,value:function(e){if(typeof e==`string`)return this.container.innerHTML=e.replace(/\>\r?\n +\</g,`><`),this.convert();var t=this.quill.getFormat(this.quill.selection.savedRange.index);if(t[m.default.blotName]){var n=this.container.innerText;return this.container.innerHTML=``,new s.default().insert(n,b({},m.default.blotName,t[m.default.blotName]))}var r=i(this.prepareMatching(),2),a=r[0],o=r[1],c=N(this.container,a,o);return M(c,`
68
- `)&&c.ops[c.ops.length-1].attributes==null&&(c=c.compose(new s.default().retain(c.length()-1).delete(1))),w.log(`convert`,this.container.innerHTML,c),this.container.innerHTML=``,c}},{key:`dangerouslyPasteHTML`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.default.sources.API;if(typeof e==`string`)this.quill.setContents(this.convert(e),t),this.quill.setSelection(0,l.default.sources.SILENT);else{var r=this.convert(t);this.quill.updateContents(new s.default().retain(e).concat(r),n),this.quill.setSelection(e+r.length(),l.default.sources.SILENT)}}},{key:`onPaste`,value:function(e){var t=this;if(!(e.defaultPrevented||!this.quill.isEnabled())){var n=this.quill.getSelection(),r=new s.default().retain(n.index),i=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(l.default.sources.SILENT),setTimeout(function(){r=r.concat(t.convert()).delete(n.length),t.quill.updateContents(r,l.default.sources.USER),t.quill.setSelection(r.length()-n.length,l.default.sources.SILENT),t.quill.scrollingContainer.scrollTop=i,t.quill.focus()},1)}}},{key:`prepareMatching`,value:function(){var e=this,t=[],n=[];return this.matchers.forEach(function(r){var a=i(r,2),o=a[0],s=a[1];switch(o){case Node.TEXT_NODE:n.push(s);break;case Node.ELEMENT_NODE:t.push(s);break;default:[].forEach.call(e.container.querySelectorAll(o),function(e){e[T]=e[T]||[],e[T].push(s)});break}}),[t,n]}}]),t}(d.default);k.DEFAULTS={matchers:[],matchVisual:!0};function A(e,t,n){return(t===void 0?`undefined`:r(t))===`object`?Object.keys(t).reduce(function(e,n){return A(e,n,t[n])},e):e.reduce(function(e,r){return r.attributes&&r.attributes[t]?e.push(r):e.insert(r.insert,(0,o.default)({},b({},t,n),r.attributes))},new s.default)}function j(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};var t=`__ql-computed-style`;return e[t]||(e[t]=window.getComputedStyle(e))}function M(e,t){for(var n=``,r=e.ops.length-1;r>=0&&n.length<t.length;--r){var i=e.ops[r];if(typeof i.insert!=`string`)break;n=i.insert+n}return n.slice(-1*t.length)===t}function ee(e){if(e.childNodes.length===0)return!1;var t=j(e);return[`block`,`list-item`].indexOf(t.display)>-1}function N(e,t,n){return e.nodeType===e.TEXT_NODE?n.reduce(function(t,n){return n(e,t)},new s.default):e.nodeType===e.ELEMENT_NODE?[].reduce.call(e.childNodes||[],function(r,i){var a=N(i,t,n);return i.nodeType===e.ELEMENT_NODE&&(a=t.reduce(function(e,t){return t(i,e)},a),a=(i[T]||[]).reduce(function(e,t){return t(i,e)},a)),r.concat(a)},new s.default):new s.default}function P(e,t,n){return A(n,e,!0)}function te(e,t){var n=c.default.Attributor.Attribute.keys(e),r=c.default.Attributor.Class.keys(e),i=c.default.Attributor.Style.keys(e),a={};return n.concat(r).concat(i).forEach(function(t){var n=c.default.query(t,c.default.Scope.ATTRIBUTE);n!=null&&(a[n.attrName]=n.value(e),a[n.attrName])||(n=D[t],n!=null&&(n.attrName===t||n.keyName===t)&&(a[n.attrName]=n.value(e)||void 0),n=O[t],n!=null&&(n.attrName===t||n.keyName===t)&&(n=O[t],a[n.attrName]=n.value(e)||void 0))}),Object.keys(a).length>0&&(t=A(t,a)),t}function ne(e,t){var n=c.default.query(e);if(n==null)return t;if(n.prototype instanceof c.default.Embed){var r={},i=n.value(e);i!=null&&(r[n.blotName]=i,t=new s.default().insert(r,n.formats(e)))}else typeof n.formats==`function`&&(t=A(t,n.blotName,n.formats(e)));return t}function re(e,t){return M(t,`
69
- `)||t.insert(`
70
- `),t}function F(){return new s.default}function I(e,t){var n=c.default.query(e);if(n==null||n.blotName!==`list-item`||!M(t,`
71
- `))return t;for(var r=-1,i=e.parentNode;!i.classList.contains(`ql-clipboard`);)(c.default.query(i)||{}).blotName===`list`&&(r+=1),i=i.parentNode;return r<=0?t:t.compose(new s.default().retain(t.length()-1).retain(1,{indent:r}))}function L(e,t){return M(t,`
72
- `)||(ee(e)||t.length()>0&&e.nextSibling&&ee(e.nextSibling))&&t.insert(`
73
- `),t}function ie(e,t){if(ee(e)&&e.nextElementSibling!=null&&!M(t,`
74
-
75
- `)){var n=e.offsetHeight+parseFloat(j(e).marginTop)+parseFloat(j(e).marginBottom);e.nextElementSibling.offsetTop>e.offsetTop+n*1.5&&t.insert(`
76
- `)}return t}function ae(e,t){var n={},r=e.style||{};return r.fontStyle&&j(e).fontStyle===`italic`&&(n.italic=!0),r.fontWeight&&(j(e).fontWeight.startsWith(`bold`)||parseInt(j(e).fontWeight)>=700)&&(n.bold=!0),Object.keys(n).length>0&&(t=A(t,n)),parseFloat(r.textIndent||0)>0&&(t=new s.default().insert(` `).concat(t)),t}function oe(e,t){var n=e.data;if(e.parentNode.tagName===`O:P`)return t.insert(n.trim());if(n.trim().length===0&&e.parentNode.classList.contains(`ql-clipboard`))return t;if(!j(e.parentNode).whiteSpace.startsWith(`pre`)){var r=function(e,t){return t=t.replace(/[^\u00a0]/g,``),t.length<1&&e?` `:t};n=n.replace(/\r\n/g,` `).replace(/\n/g,` `),n=n.replace(/\s\s+/g,r.bind(r,!0)),(e.previousSibling==null&&ee(e.parentNode)||e.previousSibling!=null&&ee(e.previousSibling))&&(n=n.replace(/^\s+/,r.bind(r,!1))),(e.nextSibling==null&&ee(e.parentNode)||e.nextSibling!=null&&ee(e.nextSibling))&&(n=n.replace(/\s+$/,r.bind(r,!1)))}return t.insert(n)}t.default=k,t.matchAttributor=te,t.matchBlot=ne,t.matchNewline=L,t.matchSpacing=ie,t.matchText=oe}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=o(n(6));function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function c(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function l(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(e){l(t,e);function t(){return s(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,[{key:`optimize`,value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`optimize`,this).call(this,e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:`create`,value:function(){return i(t.__proto__||Object.getPrototypeOf(t),`create`,this).call(this)}},{key:`formats`,value:function(){return!0}}]),t}(a.default);u.blotName=`bold`,u.tagName=[`STRONG`,`B`],t.default=u}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.addControls=t.default=void 0;var r=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),i=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=u(n(2)),o=u(n(0)),s=u(n(5)),c=u(n(10)),l=u(n(9));function u(e){return e&&e.__esModule?e:{default:e}}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function p(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function m(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=(0,c.default)(`quill:toolbar`),g=function(e){m(t,e);function t(e,n){f(this,t);var i=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if(Array.isArray(i.options.container)){var a=document.createElement(`div`);v(a,i.options.container),e.container.parentNode.insertBefore(a,e.container),i.container=a}else typeof i.options.container==`string`?i.container=document.querySelector(i.options.container):i.container=i.options.container;if(!(i.container instanceof HTMLElement)){var o;return o=h.error(`Container required for toolbar`,i.options),p(i,o)}return i.container.classList.add(`ql-toolbar`),i.controls=[],i.handlers={},Object.keys(i.options.handlers).forEach(function(e){i.addHandler(e,i.options.handlers[e])}),[].forEach.call(i.container.querySelectorAll(`button, select`),function(e){i.attach(e)}),i.quill.on(s.default.events.EDITOR_CHANGE,function(e,t){e===s.default.events.SELECTION_CHANGE&&i.update(t)}),i.quill.on(s.default.events.SCROLL_OPTIMIZE,function(){var e=r(i.quill.selection.getRange(),1)[0];i.update(e)}),i}return i(t,[{key:`addHandler`,value:function(e,t){this.handlers[e]=t}},{key:`attach`,value:function(e){var t=this,n=[].find.call(e.classList,function(e){return e.indexOf(`ql-`)===0});if(n){if(n=n.slice(3),e.tagName===`BUTTON`&&e.setAttribute(`type`,`button`),this.handlers[n]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[n]==null){h.warn(`ignoring attaching to disabled format`,n,e);return}if(o.default.query(n)==null){h.warn(`ignoring attaching to nonexistent format`,n,e);return}}var i=e.tagName===`SELECT`?`change`:`click`;e.addEventListener(i,function(i){var c=void 0;if(e.tagName===`SELECT`){if(e.selectedIndex<0)return;var l=e.options[e.selectedIndex];c=l.hasAttribute(`selected`)?!1:l.value||!1}else c=e.classList.contains(`ql-active`)?!1:e.value||!e.hasAttribute(`value`),i.preventDefault();t.quill.focus();var u=r(t.quill.selection.getRange(),1)[0];if(t.handlers[n]!=null)t.handlers[n].call(t,c);else if(o.default.query(n).prototype instanceof o.default.Embed){if(c=prompt(`Enter `+n),!c)return;t.quill.updateContents(new a.default().retain(u.index).delete(u.length).insert(d({},n,c)),s.default.sources.USER)}else t.quill.format(n,c,s.default.sources.USER);t.update(u)}),this.controls.push([n,e])}}},{key:`update`,value:function(e){var t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(function(n){var i=r(n,2),a=i[0],o=i[1];if(o.tagName===`SELECT`){var s=void 0;if(e==null)s=null;else if(t[a]==null)s=o.querySelector(`option[selected]`);else if(!Array.isArray(t[a])){var c=t[a];typeof c==`string`&&(c=c.replace(/\"/g,`\\"`)),s=o.querySelector(`option[value="`+c+`"]`)}s==null?(o.value=``,o.selectedIndex=-1):s.selected=!0}else if(e==null)o.classList.remove(`ql-active`);else if(o.hasAttribute(`value`)){var l=t[a]===o.getAttribute(`value`)||t[a]!=null&&t[a].toString()===o.getAttribute(`value`)||t[a]==null&&!o.getAttribute(`value`);o.classList.toggle(`ql-active`,l)}else o.classList.toggle(`ql-active`,t[a]!=null)})}}]),t}(l.default);g.DEFAULTS={};function _(e,t,n){var r=document.createElement(`button`);r.setAttribute(`type`,`button`),r.classList.add(`ql-`+t),n!=null&&(r.value=n),e.appendChild(r)}function v(e,t){Array.isArray(t[0])||(t=[t]),t.forEach(function(t){var n=document.createElement(`span`);n.classList.add(`ql-formats`),t.forEach(function(e){if(typeof e==`string`)_(n,e);else{var t=Object.keys(e)[0],r=e[t];Array.isArray(r)?y(n,t,r):_(n,t,r)}}),e.appendChild(n)})}function y(e,t,n){var r=document.createElement(`select`);r.classList.add(`ql-`+t),n.forEach(function(e){var t=document.createElement(`option`);e===!1?t.setAttribute(`selected`,`selected`):t.setAttribute(`value`,e),r.appendChild(t)}),e.appendChild(r)}g.DEFAULTS={container:null,handlers:{clean:function(){var e=this,t=this.quill.getSelection();if(t!=null)if(t.length==0){var n=this.quill.getFormat();Object.keys(n).forEach(function(t){o.default.query(t,o.default.Scope.INLINE)!=null&&e.quill.format(t,!1)})}else this.quill.removeFormat(t,s.default.sources.USER)},direction:function(e){var t=this.quill.getFormat().align;e===`rtl`&&t==null?this.quill.format(`align`,`right`,s.default.sources.USER):!e&&t===`right`&&this.quill.format(`align`,!1,s.default.sources.USER),this.quill.format(`direction`,e,s.default.sources.USER)},indent:function(e){var t=this.quill.getSelection(),n=this.quill.getFormat(t),r=parseInt(n.indent||0);if(e===`+1`||e===`-1`){var i=e===`+1`?1:-1;n.direction===`rtl`&&(i*=-1),this.quill.format(`indent`,r+i,s.default.sources.USER)}},link:function(e){e===!0&&(e=prompt(`Enter link URL:`)),this.quill.format(`link`,e,s.default.sources.USER)},list:function(e){var t=this.quill.getSelection(),n=this.quill.getFormat(t);e===`check`?n.list===`checked`||n.list===`unchecked`?this.quill.format(`list`,!1,s.default.sources.USER):this.quill.format(`list`,`unchecked`,s.default.sources.USER):this.quill.format(`list`,e,s.default.sources.USER)}}},t.default=g,t.addControls=v}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>`}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=o(n(28));function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function c(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function l(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.default=function(e){l(t,e);function t(e,n){s(this,t);var r=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.label.innerHTML=n,r.container.classList.add(`ql-color-picker`),[].slice.call(r.container.querySelectorAll(`.ql-picker-item`),0,7).forEach(function(e){e.classList.add(`ql-primary`)}),r}return r(t,[{key:`buildItem`,value:function(e){var n=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`buildItem`,this).call(this,e);return n.style.backgroundColor=e.getAttribute(`value`)||``,n}},{key:`selectItem`,value:function(e,n){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`selectItem`,this).call(this,e,n);var r=this.label.querySelector(`.ql-color-label`),a=e&&e.getAttribute(`data-value`)||``;r&&(r.tagName===`line`?r.style.stroke=a:r.style.fill=a)}}]),t}(a.default)}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=o(n(28));function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function c(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function l(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.default=function(e){l(t,e);function t(e,n){s(this,t);var r=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.container.classList.add(`ql-icon-picker`),[].forEach.call(r.container.querySelectorAll(`.ql-picker-item`),function(e){e.innerHTML=n[e.getAttribute(`data-value`)||``]}),r.defaultItem=r.container.querySelector(`.ql-selected`),r.selectItem(r.defaultItem),r}return r(t,[{key:`selectItem`,value:function(e,n){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`selectItem`,this).call(this,e,n),e||=this.defaultItem,this.label.innerHTML=e.innerHTML}}]),t}(a.default)}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}t.default=function(){function e(t,n){var r=this;i(this,e),this.quill=t,this.boundsContainer=n||document.body,this.root=t.addContainer(`ql-tooltip`),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener(`scroll`,function(){r.root.style.marginTop=-1*r.quill.root.scrollTop+`px`}),this.hide()}return r(e,[{key:`hide`,value:function(){this.root.classList.add(`ql-hidden`)}},{key:`position`,value:function(e){var t=e.left+e.width/2-this.root.offsetWidth/2,n=e.bottom+this.quill.root.scrollTop;this.root.style.left=t+`px`,this.root.style.top=n+`px`,this.root.classList.remove(`ql-flip`);var r=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect(),a=0;if(i.right>r.right&&(a=r.right-i.right,this.root.style.left=t+a+`px`),i.left<r.left&&(a=r.left-i.left,this.root.style.left=t+a+`px`),i.bottom>r.bottom){var o=i.bottom-i.top,s=e.bottom-e.top+o;this.root.style.top=n-s+`px`,this.root.classList.add(`ql-flip`)}return a}},{key:`show`,value:function(){this.root.classList.remove(`ql-editing`),this.root.classList.remove(`ql-hidden`)}}]),e}()}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=p(n(3)),s=p(n(8)),c=n(43),l=p(c),u=p(n(27)),d=n(15),f=p(n(41));function p(e){return e&&e.__esModule?e:{default:e}}function m(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function h(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function g(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _=[[{header:[`1`,`2`,`3`,!1]}],[`bold`,`italic`,`underline`,`link`],[{list:`ordered`},{list:`bullet`}],[`clean`]],v=function(e){g(t,e);function t(e,n){m(this,t),n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=_);var r=h(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.quill.container.classList.add(`ql-snow`),r}return a(t,[{key:`extendToolbar`,value:function(e){e.container.classList.add(`ql-snow`),this.buildButtons([].slice.call(e.container.querySelectorAll(`button`)),f.default),this.buildPickers([].slice.call(e.container.querySelectorAll(`select`)),f.default),this.tooltip=new y(this.quill,this.options.bounds),e.container.querySelector(`.ql-link`)&&this.quill.keyboard.addBinding({key:`K`,shortKey:!0},function(t,n){e.handlers.link.call(e,!n.format.link)})}}]),t}(l.default);v.DEFAULTS=(0,o.default)(!0,{},l.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(e){if(e){var t=this.quill.getSelection();if(t==null||t.length==0)return;var n=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(n)&&n.indexOf(`mailto:`)!==0&&(n=`mailto:`+n),this.quill.theme.tooltip.edit(`link`,n)}else this.quill.format(`link`,!1)}}}}});var y=function(e){g(t,e);function t(e,n){m(this,t);var r=h(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.preview=r.root.querySelector(`a.ql-preview`),r}return a(t,[{key:`listen`,value:function(){var e=this;i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`listen`,this).call(this),this.root.querySelector(`a.ql-action`).addEventListener(`click`,function(t){e.root.classList.contains(`ql-editing`)?e.save():e.edit(`link`,e.preview.textContent),t.preventDefault()}),this.root.querySelector(`a.ql-remove`).addEventListener(`click`,function(t){if(e.linkRange!=null){var n=e.linkRange;e.restoreFocus(),e.quill.formatText(n,`link`,!1,s.default.sources.USER),delete e.linkRange}t.preventDefault(),e.hide()}),this.quill.on(s.default.events.SELECTION_CHANGE,function(t,n,i){if(t!=null){if(t.length===0&&i===s.default.sources.USER){var a=r(e.quill.scroll.descendant(u.default,t.index),2),o=a[0],c=a[1];if(o!=null){e.linkRange=new d.Range(t.index-c,o.length());var l=u.default.formats(o.domNode);e.preview.textContent=l,e.preview.setAttribute(`href`,l),e.show(),e.position(e.quill.getBounds(e.linkRange));return}}else delete e.linkRange;e.hide()}})}},{key:`show`,value:function(){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`show`,this).call(this),this.root.removeAttribute(`data-mode`)}}]),t}(c.BaseTooltip);y.TEMPLATE=[`<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>`,`<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">`,`<a class="ql-action"></a>`,`<a class="ql-remove"></a>`].join(``),t.default=v}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=P(n(29)),i=n(36),a=n(38),o=n(64),s=P(n(65)),c=P(n(66)),l=n(67),u=P(l),d=n(37),f=n(26),p=n(39),m=n(40),h=P(n(56)),g=P(n(68)),_=P(n(27)),v=P(n(69)),y=P(n(70)),b=P(n(71)),x=P(n(72)),S=P(n(73)),C=n(13),w=P(C),T=P(n(74)),E=P(n(75)),D=P(n(57)),O=P(n(41)),k=P(n(28)),A=P(n(59)),j=P(n(60)),M=P(n(61)),ee=P(n(108)),N=P(n(62));function P(e){return e&&e.__esModule?e:{default:e}}r.default.register({"attributors/attribute/direction":a.DirectionAttribute,"attributors/class/align":i.AlignClass,"attributors/class/background":d.BackgroundClass,"attributors/class/color":f.ColorClass,"attributors/class/direction":a.DirectionClass,"attributors/class/font":p.FontClass,"attributors/class/size":m.SizeClass,"attributors/style/align":i.AlignStyle,"attributors/style/background":d.BackgroundStyle,"attributors/style/color":f.ColorStyle,"attributors/style/direction":a.DirectionStyle,"attributors/style/font":p.FontStyle,"attributors/style/size":m.SizeStyle},!0),r.default.register({"formats/align":i.AlignClass,"formats/direction":a.DirectionClass,"formats/indent":o.IndentClass,"formats/background":d.BackgroundStyle,"formats/color":f.ColorStyle,"formats/font":p.FontClass,"formats/size":m.SizeClass,"formats/blockquote":s.default,"formats/code-block":w.default,"formats/header":c.default,"formats/list":u.default,"formats/bold":h.default,"formats/code":C.Code,"formats/italic":g.default,"formats/link":_.default,"formats/script":v.default,"formats/strike":y.default,"formats/underline":b.default,"formats/image":x.default,"formats/video":S.default,"formats/list/item":l.ListItem,"modules/formula":T.default,"modules/syntax":E.default,"modules/toolbar":D.default,"themes/bubble":ee.default,"themes/snow":N.default,"ui/icons":O.default,"ui/picker":k.default,"ui/icon-picker":j.default,"ui/color-picker":A.default,"ui/tooltip":M.default},!0),t.default=r.default}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.IndentClass=void 0;var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function c(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function l(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.IndentClass=new(function(e){l(t,e);function t(){return s(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,[{key:`add`,value:function(e,n){if(n===`+1`||n===`-1`){var r=this.value(e)||0;n=n===`+1`?r+1:r-1}return n===0?(this.remove(e),!0):i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`add`,this).call(this,e,n)}},{key:`canAdd`,value:function(e,n){return i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`canAdd`,this).call(this,e,n)||i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`canAdd`,this).call(this,e,parseInt(n))}},{key:`value`,value:function(e){return parseInt(i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`value`,this).call(this,e))||void 0}}]),t}(a.default.Attributor.Class))(`indent`,`ql-indent`,{scope:a.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]})}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=i(n(4));function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function s(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=function(e){s(t,e);function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return t}(r.default);c.blotName=`blockquote`,c.tagName=`blockquote`,t.default=c}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=a(n(4));function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function s(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function c(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=function(e){c(t,e);function t(){return o(this,t),s(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,null,[{key:`formats`,value:function(e){return this.tagName.indexOf(e.tagName)+1}}]),t}(i.default);l.blotName=`header`,l.tagName=[`H1`,`H2`,`H3`,`H4`,`H5`,`H6`],t.default=l}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=t.ListItem=void 0;var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=c(n(0)),o=c(n(4)),s=c(n(25));function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function d(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function f(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var p=function(e){f(t,e);function t(){return u(this,t),d(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,[{key:`format`,value:function(e,n){e===m.blotName&&!n?this.replaceWith(a.default.create(this.statics.scope)):i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`format`,this).call(this,e,n)}},{key:`remove`,value:function(){this.prev==null&&this.next==null?this.parent.remove():i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`remove`,this).call(this)}},{key:`replaceWith`,value:function(e,n){return this.parent.isolate(this.offset(this.parent),this.length()),e===this.parent.statics.blotName?(this.parent.replaceWith(e,n),this):(this.parent.unwrap(),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`replaceWith`,this).call(this,e,n))}}],[{key:`formats`,value:function(e){return e.tagName===this.tagName?void 0:i(t.__proto__||Object.getPrototypeOf(t),`formats`,this).call(this,e)}}]),t}(o.default);p.blotName=`list-item`,p.tagName=`LI`;var m=function(e){f(t,e),r(t,null,[{key:`create`,value:function(e){var n=e===`ordered`?`OL`:`UL`,r=i(t.__proto__||Object.getPrototypeOf(t),`create`,this).call(this,n);return(e===`checked`||e===`unchecked`)&&r.setAttribute(`data-checked`,e===`checked`),r}},{key:`formats`,value:function(e){if(e.tagName===`OL`)return`ordered`;if(e.tagName===`UL`)return e.hasAttribute(`data-checked`)?e.getAttribute(`data-checked`)===`true`?`checked`:`unchecked`:`bullet`}}]);function t(e){u(this,t);var n=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),r=function(t){if(t.target.parentNode===e){var r=n.statics.formats(e),i=a.default.find(t.target);r===`checked`?i.format(`list`,`unchecked`):r===`unchecked`&&i.format(`list`,`checked`)}};return e.addEventListener(`touchstart`,r),e.addEventListener(`mousedown`,r),n}return r(t,[{key:`format`,value:function(e,t){this.children.length>0&&this.children.tail.format(e,t)}},{key:`formats`,value:function(){return l({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:`insertBefore`,value:function(e,n){if(e instanceof p)i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`insertBefore`,this).call(this,e,n);else{var r=n==null?this.length():n.offset(this),a=this.split(r);a.parent.insertBefore(e,a)}}},{key:`optimize`,value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`optimize`,this).call(this,e);var n=this.next;n!=null&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute(`data-checked`)===this.domNode.getAttribute(`data-checked`)&&(n.moveChildren(this),n.remove())}},{key:`replace`,value:function(e){if(e.statics.blotName!==this.statics.blotName){var n=a.default.create(this.statics.defaultChild);e.moveChildren(n),this.appendChild(n)}i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`replace`,this).call(this,e)}}]),t}(s.default);m.blotName=`list`,m.scope=a.default.Scope.BLOCK_BLOT,m.tagName=[`OL`,`UL`],m.defaultChild=`list-item`,m.allowedChildren=[p],t.ListItem=p,t.default=m}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=i(n(56));function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function s(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=function(e){s(t,e);function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return t}(r.default);c.blotName=`italic`,c.tagName=[`EM`,`I`],t.default=c}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=o(n(6));function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function c(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function l(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(e){l(t,e);function t(){return s(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,null,[{key:`create`,value:function(e){return e===`super`?document.createElement(`sup`):e===`sub`?document.createElement(`sub`):i(t.__proto__||Object.getPrototypeOf(t),`create`,this).call(this,e)}},{key:`formats`,value:function(e){if(e.tagName===`SUB`)return`sub`;if(e.tagName===`SUP`)return`super`}}]),t}(a.default);u.blotName=`script`,u.tagName=[`SUB`,`SUP`],t.default=u}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=i(n(6));function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function s(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=function(e){s(t,e);function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return t}(r.default);c.blotName=`strike`,c.tagName=`S`,t.default=c}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=i(n(6));function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function s(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var c=function(e){s(t,e);function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return t}(r.default);c.blotName=`underline`,c.tagName=`U`,t.default=c}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=s(n(0)),o=n(27);function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function l(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function u(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=[`alt`,`height`,`width`],f=function(e){u(t,e);function t(){return c(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,[{key:`format`,value:function(e,n){d.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`format`,this).call(this,e,n)}}],[{key:`create`,value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),`create`,this).call(this,e);return typeof e==`string`&&n.setAttribute(`src`,this.sanitize(e)),n}},{key:`formats`,value:function(e){return d.reduce(function(t,n){return e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t},{})}},{key:`match`,value:function(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}},{key:`sanitize`,value:function(e){return(0,o.sanitize)(e,[`http`,`https`,`data`])?e:`//:0`}},{key:`value`,value:function(e){return e.getAttribute(`src`)}}]),t}(a.default.Embed);f.blotName=`image`,f.tagName=`IMG`,t.default=f}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0});var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=n(4),o=s(n(27));function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function l(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function u(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var d=[`height`,`width`],f=function(e){u(t,e);function t(){return c(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,[{key:`format`,value:function(e,n){d.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`format`,this).call(this,e,n)}}],[{key:`create`,value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),`create`,this).call(this,e);return n.setAttribute(`frameborder`,`0`),n.setAttribute(`allowfullscreen`,!0),n.setAttribute(`src`,this.sanitize(e)),n}},{key:`formats`,value:function(e){return d.reduce(function(t,n){return e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t},{})}},{key:`sanitize`,value:function(e){return o.default.sanitize(e)}},{key:`value`,value:function(e){return e.getAttribute(`src`)}}]),t}(a.BlockEmbed);f.blotName=`video`,f.className=`ql-video`,f.tagName=`IFRAME`,t.default=f}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=t.FormulaBlot=void 0;var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=c(n(35)),o=c(n(5)),s=c(n(9));function c(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function u(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function d(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var f=function(e){d(t,e);function t(){return l(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,null,[{key:`create`,value:function(e){var n=i(t.__proto__||Object.getPrototypeOf(t),`create`,this).call(this,e);return typeof e==`string`&&(window.katex.render(e,n,{throwOnError:!1,errorColor:`#f00`}),n.setAttribute(`data-value`,e)),n}},{key:`value`,value:function(e){return e.getAttribute(`data-value`)}}]),t}(a.default);f.blotName=`formula`,f.className=`ql-formula`,f.tagName=`SPAN`;var p=function(e){d(t,e),r(t,null,[{key:`register`,value:function(){o.default.register(f,!0)}}]);function t(){l(this,t);var e=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(window.katex==null)throw Error(`Formula module requires KaTeX.`);return e}return t}(s.default);t.FormulaBlot=f,t.default=p}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=t.CodeToken=t.CodeBlock=void 0;var r=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},a=l(n(0)),o=l(n(5)),s=l(n(9)),c=l(n(13));function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function d(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function f(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var p=function(e){f(t,e);function t(){return u(this,t),d(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,[{key:`replaceWith`,value:function(e){this.domNode.textContent=this.domNode.textContent,this.attach(),i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`replaceWith`,this).call(this,e)}},{key:`highlight`,value:function(e){var t=this.domNode.textContent;this.cachedText!==t&&((t.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=e(t),this.domNode.normalize(),this.attach()),this.cachedText=t)}}]),t}(c.default);p.className=`ql-syntax`;var m=new a.default.Attributor.Class(`token`,`hljs`,{scope:a.default.Scope.INLINE}),h=function(e){f(t,e),r(t,null,[{key:`register`,value:function(){o.default.register(m,!0),o.default.register(p,!0)}}]);function t(e,n){u(this,t);var r=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if(typeof r.options.highlight!=`function`)throw Error(`Syntax module requires highlight.js. Please include the library on the page before Quill.`);var i=null;return r.quill.on(o.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(i),i=setTimeout(function(){r.highlight(),i=null},r.options.interval)}),r.highlight(),r}return r(t,[{key:`highlight`,value:function(){var e=this;if(!this.quill.selection.composing){this.quill.update(o.default.sources.USER);var t=this.quill.getSelection();this.quill.scroll.descendants(p).forEach(function(t){t.highlight(e.options.highlight)}),this.quill.update(o.default.sources.SILENT),t!=null&&this.quill.setSelection(t,o.default.sources.SILENT)}}}]),t}(s.default);h.DEFAULTS={highlight:function(){return window.hljs==null?null:function(e){return window.hljs.highlightAuto(e).value}}(),interval:1e3},t.CodeBlock=p,t.CodeToken=m,t.default=h}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>`}),(function(e,t){e.exports=`<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>`}),(function(e,t){e.exports=`<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>`}),(function(e,t){e.exports=`<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>`}),(function(e,t){e.exports=`<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>`}),(function(e,t){e.exports=`<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>`}),(function(e,t,n){Object.defineProperty(t,`__esModule`,{value:!0}),t.default=t.BubbleTooltip=void 0;var r=function e(t,n,r){t===null&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(i===void 0){var a=Object.getPrototypeOf(t);return a===null?void 0:e(a,n,r)}else if(`value`in i)return i.value;else{var o=i.get;return o===void 0?void 0:o.call(r)}},i=function(){function e(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)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=d(n(3)),o=d(n(8)),s=n(43),c=d(s),l=n(15),u=d(n(41));function d(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function p(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function m(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var h=[[`bold`,`italic`,`link`],[{header:1},{header:2},`blockquote`]],g=function(e){m(t,e);function t(e,n){f(this,t),n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=h);var r=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.quill.container.classList.add(`ql-bubble`),r}return i(t,[{key:`extendToolbar`,value:function(e){this.tooltip=new _(this.quill,this.options.bounds),this.tooltip.root.appendChild(e.container),this.buildButtons([].slice.call(e.container.querySelectorAll(`button`)),u.default),this.buildPickers([].slice.call(e.container.querySelectorAll(`select`)),u.default)}}]),t}(c.default);g.DEFAULTS=(0,a.default)(!0,{},c.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(e){e?this.quill.theme.tooltip.edit():this.quill.format(`link`,!1)}}}}});var _=function(e){m(t,e);function t(e,n){f(this,t);var r=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.quill.on(o.default.events.EDITOR_CHANGE,function(e,t,n,i){if(e===o.default.events.SELECTION_CHANGE)if(t!=null&&t.length>0&&i===o.default.sources.USER){r.show(),r.root.style.left=`0px`,r.root.style.width=``,r.root.style.width=r.root.offsetWidth+`px`;var a=r.quill.getLines(t.index,t.length);if(a.length===1)r.position(r.quill.getBounds(t));else{var s=a[a.length-1],c=r.quill.getIndex(s),u=Math.min(s.length()-1,t.index+t.length-c),d=r.quill.getBounds(new l.Range(c,u));r.position(d)}}else document.activeElement!==r.textbox&&r.quill.hasFocus()&&r.hide()}),r}return i(t,[{key:`listen`,value:function(){var e=this;r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`listen`,this).call(this),this.root.querySelector(`.ql-close`).addEventListener(`click`,function(){e.root.classList.remove(`ql-editing`)}),this.quill.on(o.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!e.root.classList.contains(`ql-hidden`)){var t=e.quill.getSelection();t!=null&&e.position(e.quill.getBounds(t))}},1)})}},{key:`cancel`,value:function(){this.show()}},{key:`position`,value:function(e){var n=r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),`position`,this).call(this,e),i=this.root.querySelector(`.ql-tooltip-arrow`);if(i.style.marginLeft=``,n===0)return n;i.style.marginLeft=-1*n-i.offsetWidth/2+`px`}}]),t}(s.BaseTooltip);_.TEMPLATE=[`<span class="ql-tooltip-arrow"></span>`,`<div class="ql-tooltip-editor">`,`<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">`,`<a class="ql-close"></a>`,`</div>`].join(``),t.BubbleTooltip=_,t.default=g}),(function(e,t,n){e.exports=n(63)})]).default})}))(),1);function jp(e,t){if(!e.includes(`@font-face`))return``;let n=new Set,r=new Set;t&&((t.match(/font-weight:\s*(\d+|bold|normal)/gi)||[]).forEach(e=>{let t=e.split(`:`)[1].trim();t===`bold`?n.add(`700`):t===`normal`?n.add(`400`):/^\d+$/.test(t)&&n.add(t)}),(t.match(/font-style:\s*(italic|normal)/gi)||[]).forEach(e=>{e.split(`:`)[1].trim().toLowerCase()===`italic`&&r.add(`italic`)}),/<(b|strong)\b/i.test(t)&&n.add(`700`),/<(i|em)\b/i.test(t)&&r.add(`italic`));let i=mc(t);i&&i.trim()&&n.add(`400`),n.size===0&&n.add(`400`);let a=n,o=r.has(`italic`),s=Array.from(new Set(i)).map(e=>e.codePointAt(0)).filter(e=>e!==void 0),c=e.split(/}\s*/).map(e=>e&&e+`}`).filter(e=>/@font-face/.test(e)&&(e=>{let t=(e.match(/font-weight:\s*(\d+)/)||[])[1];if(t&&!a.has(t)||/font-style:\s*italic/.test(e)&&!o)return!1;let n=e.match(/unicode-range:\s*([^;]+);/);if(!n)return!0;let r=n[1].split(`,`).map(e=>{let[t,n=t]=e.replace(`U+`,``).split(`-`).map(e=>parseInt(e,16));return[t,n]});return s.some(e=>r.some(([t,n])=>e>=t&&e<=n))})(e)).join(`
77
- `);return c?`<style>${c}</style>`:``}var Mp=`
78
- p {
79
- margin: 0;
80
- padding: 0;
81
- word-wrap: break-word; /* Required for Firefox */
82
- /* a text may have several spaces, we need to preserve them */
83
- white-space: pre-wrap;
84
- }
85
-
86
- /* Reset default list styles and setup counters */
87
- ul, ol {
88
- list-style: none; /* Remove default markers */
89
- padding-inline-start: 0; /* Reset padding */
90
- margin: 0;
91
- display: block; /* Use block instead of inline-block for better text wrapping */
92
- width: 100%;
93
- text-decoration: inherit;
94
- counter-reset: ol-counter; /* Initialize counter for ol */
95
- }
96
-
97
- li {
98
- position: relative; /* Needed for absolute positioning of ::before */
99
- padding-inline-start: 2.1em; /* Space for the marker (start side) */
100
- margin: 0; /* Reset default li margins */
101
- word-wrap: break-word; /* Required for Firefox text wrapping */
102
- white-space: pre-wrap; /* Preserve spaces and allow wrapping */
103
- }
104
-
105
- li::before {
106
- content: ''; /* Base content */
107
- position: absolute;
108
- /* Use logical properties for positioning */
109
- inset-inline-start: 0; /* Position marker at the start edge (left in LTR, right in RTL) */
110
- top: 0; /* Adjust vertical alignment */
111
- /* Prevent letter-spacing from affecting the marker */
112
- letter-spacing: normal;
113
- /* Define width to ensure consistent spacing and alignment */
114
- display: inline-block;
115
- width: 2em; /* Width for the marker container */
116
- /* Align multi-digit numbers to the end (right in LTR, left in RTL) */
117
- text-align: end;
118
- /* Space between marker and text (using logical property) */
119
- margin-inline-end: 0.8em; /* Pushes text away from marker (2.5em total = 1.7em width + 0.8em margin)*/
120
- /* Prevent marker style from inheriting list item styles */
121
- font-weight: normal;
122
- font-style: normal;
123
- }
124
-
125
- /* Style for bullet points */
126
- ul > li::before {
127
- content: '•'; /* Literal bullet character */
128
- /* Center the bullet within its allocated width */
129
- text-align: center; /* Override text-align: end for bullets */
130
- font-size: 1.2em;
131
- top: 0em; /* Re-adjust vertical alignment for bullet */
132
- /* Bullets don't need number alignment, width can be tighter */
133
- width: 2em;
134
- /* Adjust margin to maintain overall padding */
135
- margin-inline-end: 1.5em; /* 2.5em total padding = 1em width + 1.5em margin */
136
- }
137
-
138
- /* Style for numbers using counter */
139
- ol > li {
140
- counter-increment: ol-counter; /* Increment counter for each li in ol */
141
- }
142
-
143
- ol > li::before {
144
- content: counter(ol-counter) "."; /* Display counter value + dot */
145
- }
146
-
147
- .ql-indent-1 {
148
- margin-inline-start: 0.5em;
149
- }
150
- .ql-indent-2 {
151
- margin-inline-start: 1em;
152
- }
153
- .ql-indent-3 {
154
- margin-inline-start: 1.5em;
155
- }
156
- `,Np=`\n<style>\n html, body {\n padding: 0;\n margin: 0;\n }\n ${Mp}\n</style>\n`,Pp=new Map,Fp=new Map,Ip=/@font-face\s*\{[^}]*\}/g,Lp=/url\(\s*(['"]?)(.*?)\1\s*\)/g,Rp=/unicode-range:\s*([^;}]+)/i;function zp(e,t){if(!t)return!0;let n=e.match(Rp);if(!n)return!0;let r=function(e){let t=[];for(let n of e.split(`,`)){let e=n.trim().match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f]+))?$/i);if(e)if(e[2])t.push([parseInt(e[1],16),parseInt(e[2],16)]);else if(e[1].includes(`?`))t.push([parseInt(e[1].replace(/\?/g,`0`),16),parseInt(e[1].replace(/\?/g,`F`),16)]);else{let n=parseInt(e[1],16);t.push([n,n])}}return t}(n[1]);return r.length===0||function(e,t){for(let n of t)for(let[t,r]of e)if(n>=t&&n<=r)return!0;return!1}(r,t)}function Bp(e,t){let n=new Set;for(let r of e.matchAll(Ip))if(zp(r[0],t))for(let e of r[0].matchAll(Lp)){let t=e[2];t&&!t.startsWith(`data:`)&&n.add(t)}return Array.from(n)}function Vp(e){let t=Pp.get(e);return t||(t=async function(e){try{let t=await fetch(e);if(!t.ok)return e;let n=t.headers.get(`Content-Type`)||`font/woff2`,r=await t.arrayBuffer(),i=new Uint8Array(r),a=``;for(let e=0;e<i.length;e++)a+=String.fromCharCode(i[e]);return`data:${n};base64,${btoa(a)}`}catch{return e}}(e),Pp.set(e,t)),t}function Hp(e,t){let n=function(e,t){let n=e.length,r=`${n}|${e.slice(0,500)}|${n>200?e.slice((n>>1)-50,50+(n>>1)):``}|${n>100?e.slice(-100):``}`;if(t&&t.size>0){let e=5381,n=[...t].sort((e,t)=>e-t);for(let t=0;t<n.length;t++)e=(e<<5)+e+n[t]|0;r+=`\0`+(e>>>0)}return r}(e,t),r=Fp.get(n);if(r)return r;let i=async function(e,t){let n=Bp(e,t);if(n.length===0&&!t)return e;let r=await Promise.all(n.map(async e=>[e,await Vp(e)])),i=new Map(r);return e.replace(Ip,e=>zp(e,t)?e.replace(Lp,(e,t,n)=>{if(!n||n.startsWith(`data:`))return e;let r=i.get(n);return r?`url("${r}")`:e}):``)}(e,t);return Fp.set(n,i),i}var Up=/<style[^>]*>([\s\S]*?)<\/style>/gi;function Wp(e){let t=[],n=e.replace(Up,(e,n)=>(t.push(n),``));return{css:t.join(`
157
- `),html:n}}var Gp=class{constructor(e){this.map=new Map,this._maxEntries=e}get maxEntries(){return this._maxEntries}get size(){return this.map.size}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}set(e,t){if(this.map.has(e))this.map.delete(e);else if(this.map.size>=this._maxEntries){let e=this.map.keys().next().value;this.map.delete(e)}this.map.set(e,t)}setWithEviction(e,t,n){if(this.map.has(e))this.map.delete(e);else if(this.map.size>=this._maxEntries){let e=this.map.keys().next().value,t=this.map.get(e);this.map.delete(e),n(e,t)}this.map.set(e,t)}clear(){this.map.clear()}forEach(e){this.map.forEach(e)}resize(e){for(this._maxEntries=e;this.map.size>e;){let e=this.map.keys().next().value;this.map.delete(e)}}},Kp;function qp(e,t){`close`in t.image&&typeof t.image.close==`function`&&t.image.close()}async function Jp(e){let t=`data:image/svg+xml;charset=utf-8,`+encodeURIComponent(e),n=new Image;return n.src=t,await new Promise((e,t)=>{n.onload=()=>e(),n.onerror=()=>t(Error(`Failed to load SVG as image`))}),{image:n}}async function Yp(e){var t;let n=!!e.cache,r=typeof e.cache==`object`&&(t=e.cache.maxEntries)!=null?t:50;if(n){let t=function(e){return Kp?Kp.maxEntries!==e&&Kp.resize(e):Kp=new Gp(e),Kp}(r),n=function(e){return`${e.html}\0${e.css??``}\0${e.width}\0${e.height}\0${e.pixelRatio??1}`}(e),i=t.get(n);if(i)return i.image;let a=await Jp(await em(e));return t.setWithEviction(n,a,qp),a.image}return(await Jp(await em(e))).image}function Xp(e){let t=new DOMParser().parseFromString(e,`text/html`),n=new XMLSerializer,r=``;for(let e of Array.from(t.body.childNodes))r+=n.serializeToString(e);return r}function Zp({xhtml:e,css:t,width:n,height:r,pixelRatio:i=1}){let a=n*i,o=r*i,s=i===1?`margin: 0;`:`margin: 0; width: ${n}px; height: ${r}px; transform: scale(${i}); transform-origin: 0 0;`;return`<svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${o}"><foreignObject width="${a}" height="${o}" style="float: left;"><html xmlns="http://www.w3.org/1999/xhtml"><head><style>${function(e){return e.replace(/<\/style/gi,`\\3c /style`)}(t)}</style></head><body style="${s}">${e}</body></html></foreignObject></svg>`}var Qp;async function $p({html:e,css:t=``,width:n,height:r,pixelRatio:i=1}){let a=Wp(e),o=await Hp([t,a.css].filter(Boolean).join(`
158
- `),function(e){let t=new DOMParser().parseFromString(e,`text/html`).body.textContent||``,n=new Set;for(let e=0;e<t.length;e++){let r=t.codePointAt(e);n.add(r),r>65535&&e++}return n}(a.html));return Zp({xhtml:Xp(a.html),css:o,width:n,height:r,pixelRatio:i})}async function em(e){var t,n;if(e.cache){let r=(n=typeof e.cache==`object`&&(t=e.cache.maxEntries)!=null?t:50,Qp?Qp.maxEntries!==n&&Qp.resize(n):Qp=new Gp(n),Qp),i=`${e.html}\0${e.css??``}\0${e.width}\0${e.height}\0${e.pixelRatio??1}`,a=r.get(i);if(a)return a;let o=await $p(e);return r.set(i,o),o}return $p(e)}var tm,nm=()=>(tm||(tm=document.createElement(`div`),tm.id=`polotno-hidden-do-not-touch`,tm.style.overflow=`hidden`,tm.style.position=`relative`,document.body.appendChild(tm),tm.innerHTML=`<style>#polotno-hidden-do-not-touch {
159
- p {
160
- margin: 0;
161
- padding: 0;
162
- word-wrap: break-word; /* Required for Firefox */
163
- /* a text may have several spaces, we need to preserve them */
164
- white-space: pre-wrap;
165
- }
166
-
167
- /* Reset default list styles and setup counters */
168
- ul, ol {
169
- list-style: none; /* Remove default markers */
170
- padding-inline-start: 0; /* Reset padding */
171
- margin: 0;
172
- display: block; /* Use block instead of inline-block for better text wrapping */
173
- width: 100%;
174
- text-decoration: inherit;
175
- counter-reset: ol-counter; /* Initialize counter for ol */
176
- }
177
-
178
- li {
179
- position: relative; /* Needed for absolute positioning of ::before */
180
- padding-inline-start: 2.1em; /* Space for the marker (start side) */
181
- margin: 0; /* Reset default li margins */
182
- word-wrap: break-word; /* Required for Firefox text wrapping */
183
- white-space: pre-wrap; /* Preserve spaces and allow wrapping */
184
- }
185
-
186
- li::before {
187
- content: ''; /* Base content */
188
- position: absolute;
189
- /* Use logical properties for positioning */
190
- inset-inline-start: 0; /* Position marker at the start edge (left in LTR, right in RTL) */
191
- top: 0; /* Adjust vertical alignment */
192
- /* Prevent letter-spacing from affecting the marker */
193
- letter-spacing: normal;
194
- /* Define width to ensure consistent spacing and alignment */
195
- display: inline-block;
196
- width: 2em; /* Width for the marker container */
197
- /* Align multi-digit numbers to the end (right in LTR, left in RTL) */
198
- text-align: end;
199
- /* Space between marker and text (using logical property) */
200
- margin-inline-end: 0.8em; /* Pushes text away from marker (2.5em total = 1.7em width + 0.8em margin)*/
201
- /* Prevent marker style from inheriting list item styles */
202
- font-weight: normal;
203
- font-style: normal;
204
- }
205
-
206
- /* Style for bullet points */
207
- ul > li::before {
208
- content: '•'; /* Literal bullet character */
209
- /* Center the bullet within its allocated width */
210
- text-align: center; /* Override text-align: end for bullets */
211
- font-size: 1.2em;
212
- top: 0em; /* Re-adjust vertical alignment for bullet */
213
- /* Bullets don't need number alignment, width can be tighter */
214
- width: 2em;
215
- /* Adjust margin to maintain overall padding */
216
- margin-inline-end: 1.5em; /* 2.5em total padding = 1em width + 1.5em margin */
217
- }
218
-
219
- /* Style for numbers using counter */
220
- ol > li {
221
- counter-increment: ol-counter; /* Increment counter for each li in ol */
222
- }
223
-
224
- ol > li::before {
225
- content: counter(ol-counter) "."; /* Display counter value + dot */
226
- }
227
-
228
- .ql-indent-1 {
229
- margin-inline-start: 0.5em;
230
- }
231
- .ql-indent-2 {
232
- margin-inline-start: 1em;
233
- }
234
- .ql-indent-3 {
235
- margin-inline-start: 1.5em;
236
- }
237
- }</style>`),tm);navigator.userAgent.includes(`Firefox`);function rm({html:e}){let t=document.createElement(`div`);t.innerHTML=e,t.style.display=`inline-block`,t.style.position=`fixed`,t.style.top=`0px`,t.style.left=`0px`,t.style.zIndex=`1000`,t.style.whiteSpace=`nowrap`,t.style.visibility=`hidden`;let n=nm();n.appendChild(t);let r=t.innerText,i=t.childNodes[0];i.style.whiteSpace=`nowrap`;let a=r?.split(/\s+/)||[],o=!1;for(let e=0;e<a.length;e++){let n=a[e];if(i&&(i.textContent=n,o=i.scrollWidth>t.clientWidth,o))break}return n.removeChild(t),o}function im(e){let t=document.createElement(`div`);t.innerHTML=e,t.style.display=`inline-block`,t.style.position=`fixed`,t.style.top=`0px`,t.style.left=`0px`,t.style.zIndex=`1000`;let n=nm();n.appendChild(t);let r=t.getBoundingClientRect();return n.removeChild(t),{width:r.width,height:r.height}}function am(e){let t=document.createElement(`div`);t.innerHTML=e,t.style.display=`inline-block`,t.style.position=`fixed`,t.style.top=`0px`,t.style.left=`0px`,t.style.zIndex=`1000`;let n=nm();n.appendChild(t);let r=t.getBoundingClientRect(),i=[],a=document.createTreeWalker(t,NodeFilter.SHOW_TEXT),o=a.nextNode();for(;o;){let e=o.nodeValue||``;if(e.length>0){let t=document.createRange();t.setStart(o,0),t.setEnd(o,e.length);let n=t.getClientRects(),a=o.parentElement,s=0,c=!1;if(a){let e=window.getComputedStyle(a),t=parseFloat(e.letterSpacing);Number.isNaN(t)||(s=t),c=e.direction===`rtl`}for(let e=0;e<n.length;e++){let t=n[e];t.width===0&&t.height===0||i.push({left:t.left-r.left,right:t.right-r.left,top:t.top-r.top,bottom:t.bottom-r.top,letterSpacing:s,isRtl:c})}}o=a.nextNode()}if(n.removeChild(t),i.length===0)return[];i.sort((e,t)=>e.top-t.top||e.left-t.left);let s=[];for(let e of i){let t=s[s.length-1];if(t){let n=Math.min(t.bottom,e.bottom)-Math.max(t.top,e.top),r=Math.min(t.bottom-t.top,e.bottom-e.top);if(r>0&&n>.5*r){let n=!t.isRtl&&e.right>t.right,r=t.isRtl&&e.left<t.left;(n||r)&&(t.trailingLetterSpacing=e.letterSpacing),t.left=Math.min(t.left,e.left),t.right=Math.max(t.right,e.right),t.top=Math.min(t.top,e.top),t.bottom=Math.max(t.bottom,e.bottom);continue}}s.push({left:e.left,right:e.right,top:e.top,bottom:e.bottom,trailingLetterSpacing:e.letterSpacing,isRtl:e.isRtl})}return s.map(e=>{let{trailingLetterSpacing:t,isRtl:n}=e,{left:r,right:i,top:a,bottom:o}=e;if(t!==0)if(n){let e=r+t;r=t>0?Math.min(i,e):e}else{let e=i-t;i=t>0?Math.max(r,e):e}return{left:r,right:i,top:a,bottom:o}})}var om={},sm=new Map;async function cm({html:e,width:t,height:n,fontFamily:r,padding:i,font:a,pixelRatio:o}){let s=``;if(r!==`Arial`&&!a&&(s=await async function(e,t){let n=`${e}|${t}`;if(sm.has(n))return sm.get(n);let r=`https://fonts.googleapis.com/css?family=${e}:${t}&display=swap`,i=await(await fetch(r)).text();return sm.set(n,i),i}(r,jc())),a){let e=a.styles||(a.url?[{src:`url("${a.url}")`}]:(e=>{if(om[e])return om[e];let t=function(e){let t=[];for(let n=0;n<document.styleSheets.length;n++){let r=document.styleSheets[n];try{let n=r.cssRules;if(n)for(let r=0;r<n.length;r++){let i=n[r];i instanceof CSSFontFaceRule&&i.style.fontFamily.replace(/['"]/g,``)===e&&t.push(i)}}catch(e){console.warn(`Could not access stylesheet: ${r.href}`,e)}}return t}(e).filter(t=>t.style.fontFamily.replace(/['"]/g,``)===e).map(e=>({src:e.style.getPropertyValue(`src`),fontStyle:e.style.getPropertyValue(`font-style`)||`normal`,fontWeight:e.style.getPropertyValue(`font-weight`)||`normal`}));return om[e]=t,t})(r));s=``,e.forEach(e=>{s+=`\n @font-face {\n font-family: '${r}';\n src: ${e.src};\n font-style: ${e.fontStyle||`normal`};\n font-weight: ${e.fontWeight||`normal`};\n }\n `})}let c=``;return s&&(c=jp(s,e)),Yp({html:`<div style="padding: ${i}px;" dir="auto">${e+=c+Np}</div>`,width:t+2*i,height:n+2*i,cache:{maxEntries:100},pixelRatio:o})}var lm={data:``},um=e=>typeof window==`object`?((e?e.querySelector(`#_goober`):window._goober)||Object.assign((e||document.head).appendChild(document.createElement(`style`)),{innerHTML:` `,id:`_goober`})).firstChild:e||lm,dm=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,fm=/\/\*[^]*?\*\/|\s\s+|\n/g,pm=(e,t)=>{let n=``,r=``,i=``;for(let a in e){let o=e[a];a[0]==`@`?a[1]==`i`?n=a+` `+o+`;`:r+=a[1]==`f`?pm(o,a):a+`{`+pm(o,a[1]==`k`?``:t)+`}`:typeof o==`object`?r+=pm(o,t?t.replace(/([^,])+/g,e=>a.replace(/(^:.*)|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+` `+t:t)):a):o!=null&&(a=a.replace(/[A-Z]/g,`-$&`).toLowerCase(),i+=pm.p?pm.p(a,o):a+`:`+o+`;`)}return n+(t&&i?t+`{`+i+`}`:i)+r},mm={},hm=e=>{if(typeof e==`object`){let t=``;for(let n in e)t+=n+hm(e[n]);return t}return e},gm=(e,t,n,r,i)=>{let a=hm(e),o=mm[a]||(mm[a]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return`go`+n})(a));if(!mm[o]){let t=a===e?(e=>{let t,n=[{}];for(;t=dm.exec(e.replace(fm,``));)t[4]?n.shift():t[3]?n.unshift(n[0][t[3]]=n[0][t[3]]||{}):n[0][t[1]]=t[2];return n[0]})(e):e;mm[o]=pm(i?{[`@keyframes `+o]:t}:t,n?``:`.`+o)}return((e,t,n)=>{t.data.indexOf(e)==-1&&(t.data=n?e+t.data:t.data+e)})(mm[o],t,r),o};function _m(e){let t=this||{},n=e.call?e(t.p):e;return gm(n.unshift?n.raw?((e,t,n)=>e.reduce((e,r,i)=>{let a=t[i];if(a&&a.call){let e=a(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;a=t?`.`+t:e&&typeof e==`object`?e.props?``:pm(e,``):!1===e?``:e}return e+r+(a??``)},``))(n,[].slice.call(arguments,1),t.p):n.reduce((e,n)=>Object.assign(e,n&&n.call?n(t.p):n),{}):n,um(t.target),t.g,t.o,t.k)}var vm,ym,bm;_m.bind({g:1}),_m.bind({k:1});function xm(e,t,n,r){pm.p=t,vm=e,ym=n,bm=r}function Sm(e,t){let n=this||{};return function(){let r=arguments;function i(a,o){let s=Object.assign({},a),c=s.className||i.className;n.p=Object.assign({theme:ym&&ym()},s),n.o=/ *go\d+/.test(c),s.className=_m.apply(n,r)+(c?` `+c:``),t&&(s.ref=o);let l=e;return e[0]&&(l=s.as||e,delete s.as),bm&&l[0]&&bm(s),vm(l,s)}return t?t(i):i}}xm(S.createElement,void 0,void 0,void 0);var Cm=Sm;function wm(e,t){if(t===1)return e;let n=a.Util.colorToRGBA(e);return n?`rgba(${n.r}, ${n.g}, ${n.b}, ${n.a*t})`:e}function Tm(e){let t=(e||``).trim();if(t===`<p><br></p>`||t===`<p></p>`)return``;if(t.startsWith(`<p>`)&&t.endsWith(`</p>`)){let e=t.slice(3,-4);if(!/(<\/?(p|div|h[1-6]|ul|ol|li|table|thead|tbody|tr|td|blockquote)\b)/i.test(e))return e}return e}var Em=z({enabled:!1,currentFormat:{},editor:z.object({instance:null},{},{deep:!1})}),Dm=Cm(`div`,S.forwardRef)`
238
- .ql-editor {
239
- outline: none;
240
- }
241
- .ql-clipboard {
242
- pointer-events: none;
243
- opacity: 0;
244
- }
245
- ${Mp}
246
- strong {
247
- font-weight: 700;
248
- }
249
- .ql-direction-rtl {
250
- direction: rtl;
251
- }
252
- /* Apply gradient fill to all text-bearing elements when --polotno-gradient is set */
253
- &[style*="--polotno-gradient"] .ql-editor,
254
- &[style*="--polotno-gradient"] .ql-editor p,
255
- &[style*="--polotno-gradient"] .ql-editor li,
256
- &[style*="--polotno-gradient"] .ql-editor li::before {
257
- background-image: var(--polotno-gradient);
258
- background-size: 100% 100%;
259
- background-repeat: repeat;
260
- -webkit-background-clip: text;
261
- -moz-background-clip: text;
262
- background-clip: text;
263
- -webkit-text-fill-color: transparent;
264
- color: transparent;
265
- }
266
- `,Om=[`bold`,`color`,`font`,`italic`,`size`,`strike`,`underline`,`indent`,`list`,`direction`],km=(e,t)=>{var n=e.clipboard.convert(`<div class='ql-editor' style='outline: none;'>`+t+`<p><br></p></div>`);e.setContents(n),e.history.clear()},Am=({html:e,onBlur:t,onChange:n,element:r,clickCoords:i})=>{let a=S.useRef(null);S.useEffect(()=>{if(!a.current)return;let o=(s=a.current,new Ap.default(s,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:Om}));var s;Zn(()=>{Em.editor.instance=o}),window.__polotnoQuill=o,o.on(`text-change`,()=>{o.getSelection()&&Zn(()=>{Em.currentFormat=o.getFormat(o.getSelection())}),setTimeout(()=>{let e=a.current?.childNodes[0];if(!e)return;let t=e.innerHTML;n(Tm(t));let i=o.getContents(),s=r.fill,c=null,l=!0;for(let e of i.ops){if(typeof e.insert!=`string`||e.insert===`
267
- `)continue;let t=e.attributes?.color||s;if(c===null)c=t;else if(t!==c){l=!1;break}}l&&c&&r.set({fill:c})},10)}),km(o,e),i?Fm(o,i):o.setSelection(0,0,`api`),o.on(`selection-change`,(e,t,n)=>{e&&Zn(()=>{Em.currentFormat=o.getFormat(o.getSelection())})}),a.current.childNodes[0].addEventListener(`blur`,e=>{let n=e.relatedTarget;n?.classList.contains(`ql-clipboard`)||(function(e){return!!e&&!!e.closest(`.sketch-picker`)})(n)||t()});let c=a.current.childNodes[0],l=e=>{var t,n;let r=o.getSelection();if(!r||r.length===0)return;let i=o.getText(r.index,r.length).replace(/\n$/,``),a=window.getSelection(),s=``;if(a&&a.rangeCount>0){let e=a.getRangeAt(0),t=document.createElement(`div`);t.appendChild(e.cloneContents()),s=t.innerHTML}if((t=e.clipboardData)==null||t.setData(`text/plain`,i),s){let t=`<!DOCTYPE html><html><head><meta charset="utf-8"></head><body><!--StartFragment--><div style="white-space: pre-wrap; word-wrap: break-word;">`+s+`</div><!--EndFragment--></body></html>`;(n=e.clipboardData)==null||n.setData(`text/html`,t)}e.preventDefault()},u=e=>{l(e);let t=o.getSelection();t&&t.length>0&&o.deleteText(t.index,t.length)};return c.addEventListener(`copy`,l),c.addEventListener(`cut`,u),()=>{c.removeEventListener(`copy`,l),c.removeEventListener(`cut`,u),Zn(()=>{Em.editor.instance=null,Em.currentFormat={}}),delete window.__polotnoQuill}},[]),S.useEffect(()=>nr(()=>r.text,()=>{let t=Em.editor.instance;if(!t)return;let n=t.getSelection(),i=a.current?.childNodes?.[0];Tm(i?.innerHTML||``)===r.text||(km(t,e),n&&(t.setSelection(n.index,n.length),Zn(()=>{Em.currentFormat=t.getFormat(t.getSelection())})))},{fireImmediately:!0}),[]),S.useEffect(()=>{window.addEventListener(`blur`,t);let e=e=>{var n;(n=a.current)!=null&&n.contains(e.target)||t()};return window.addEventListener(`touchstart`,e),()=>{window.removeEventListener(`blur`,t),window.removeEventListener(`touchstart`,e)}},[]);let o={color:r.fill};r.fill.indexOf(`gradient`)>=0&&(o[`--polotno-gradient`]=r.fill,o.color=`transparent`);let s=Bf(r);return S.createElement(Dm,{ref:a,style:Object.assign(Object.assign({},o),{fontSize:r.fontSize,fontWeight:r.fontWeight,textTransform:r.textTransform,width:r.a.width,fontFamily:`"`+r.fontFamily+`"`,lineHeight:r.lineHeight,letterSpacing:r.letterSpacing*r.fontSize+`px`,textAlign:r.align,opacity:Math.max(r.a.opacity,.2),textShadow:r.shadowEnabled?`${r.shadowOffsetX}px ${r.shadowOffsetY}px ${r.shadowBlur}px ${wm(r.shadowColor,r.shadowOpacity??1)}`:void 0,caretColor:s}),dir:Jc(mc(r.text))})};function jm(e){let t=document.createElement(`canvas`);return t.getContext(`2d`)?.drawImage(e,0,0,t.width,t.height),function(e){return!function(e){let t=e.getContext(`2d`).getImageData(0,0,e.width,e.height).data;for(let e=0;e<t.length;e+=4)if(t[e+3]!==0)return!0;return!1}(e)}(t)}var Mm=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Nm=navigator.userAgent.includes(`Firefox`),Pm=U(({element:e,store:t})=>{let{textOverflowIndicatorStyle:n}=ps(),r=S.useRef(null),[i,o]=S.useState(),[s,c]=S.useState(!1),[l,u]=S.useState(!1),d=S.useRef(e.height),f=e.isSelected,p=Jf(f),m=e.fontSize/3,{textVerticalResizeEnabled:h}=Lc,g=Lc.autoDeleteEmptyText,_=Jf(e.fontFamily),[v]=Kf(t,e.fontFamily,e.fontStyle,e.fontWeight,e.text||e.placeholder),y=e._editModeEnabled;ec(r);let b=v?e.fontFamily:_===e.fontFamily?`Arial`:_,x=Xs(e).fill,C=el(e,{fontFamily:b,color:x}),w=el(e,{fontFamily:b,color:x,forEditor:!0}),T=S.useRef([]),[,E]=S.useReducer(e=>e+1,0);S.useEffect(()=>{let e=T.current;e.length>0&&(T.current=[],e.forEach(e=>e()))});let{width:D,height:O}=function(e,t,n){return S.useMemo(()=>im(e),[e,t.width,n])}(C,e,v);S.useEffect(()=>{if(!v)return;let n=(n,r,i,a)=>{let o=cc(`text ${e.id}`),s=()=>{t.history.ignore(n,r,i).then(()=>{T.current.push(o),E()})};a?queueMicrotask(s):s()};if(!e.height){n(()=>{e.height||e.set({height:O})},void 0,void 0,!0);return}let{textOverflow:r}=Lc;if(r!==`change-font-size`||s)r===`resize`&&(h&&e.height<O&&!s&&n(()=>{e.set({height:O})},!1,!0),h||e.height===O||s||n(()=>{e.set({height:O})},!1,!0));else{let t=(e=>{let t=e.fontSize;for(let n=1;n<50;n++){let n=el(Object.assign(Object.assign({},e.toJSON()),{fontSize:t}),{fontFamily:e.fontFamily}),{height:r}=im(n);if(!(e.height&&r>e.height||!Lc.textSplitAllowed&&!e.curveEnabled&&rm({html:n})))break;t-=.5}return t})(e);t===e.fontSize?e.height!==O&&(h&&e.height<O?n(()=>{e.set({height:O})},!1,!0):h||n(()=>{e.set({height:O})},!1,!0)):n(()=>{e.set({fontSize:t})},!1,!0)}});let k=S.useMemo(()=>{let e={lastArgs:null,lastResult:null};return async function(t){return e.lastArgs&&e.lastResult&&(n=e.lastArgs,r=t,JSON.stringify(n)===JSON.stringify(r))||(e.lastResult=await cm(t),e.lastArgs=Object.assign({},t)),e.lastResult;var n,r}},[]),A=S.useRef(0),j=S.useRef(null);S.useEffect(()=>{s||y||(async()=>{A.current++;let n=A.current,r=cc(`text ${e.id} ${n}`);j.current&&j.current(),j.current=r,u(!0);let i=null,a=Mm?5:1;for(let r=0;r<a;r++){let a=r>0?k:cm;try{if(i=await a({skipCache:r>0,html:C,width:e.width||1,height:e.height||O||1,fontFamily:b,padding:m,pixelRatio:t._elementsPixelRatio,font:t.fonts.find(e=>e.fontFamily===b)||_c.find(e=>e.fontFamily===b)}),n!==A.current)return;if((Mm||Nm)&&i&&jm(i)){await new Promise(e=>setTimeout(e,50*(r+1)));continue}break}catch(t){console.error(t),pc(`Error rendering rich text with id ${e.id}`);break}}i?o(i):r?(r(),r=null):console.error(`Finish function is called twice!`),u(!1)})()},[C,s,O,y,b,e.height,t._elementsPixelRatio,v]);let[M,ee]=pp(l,300),[N]=pp(s,300,!0),P=N||M;S.useEffect(()=>{var t;if(!P)return $n(()=>{let t=r.current;rl(t,e)});(t=r.current)==null||t.clearCache()},[i,P,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]),S.useEffect(()=>{i&&!l&&j.current&&(j.current(),j.current=null)},[i,l]),S.useLayoutEffect(()=>{if(!v||!e.curveEnabled)return;let t=new a.TextPath({data:Yc(e.a.width,e.a.height,e.curvePower,e.a.fontSize),text:mc(e.text),letterSpacing:e.letterSpacing*e.a.fontSize,fontSize:e.a.fontSize,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,align:`center`,textBaseline:`middle`,fill:e.fill}),n=t.getSelfRect().width;if(n){let t=n-e.a.width,r=e.a.rotation*Math.PI/180,i=-t/2*Math.cos(r),a=-t/2*Math.sin(r);queueMicrotask(()=>{e.set({width:n,x:e.a.x+i,y:e.a.y+a})})}t.destroy()},[v,e.curveEnabled,e.curvePower,e.text,e.fontSize,e.fontFamily,e.fontWeight,e.fontStyle,e.letterSpacing]),S.useEffect(()=>()=>{j.current&&j.current()},[]),S.useEffect(()=>{p&&!f&&g&&mc(e.text)===``&&e.removable&&!e.placeholder&&t.deleteElements([e.id])},[g,e.placeholder,e.removable,e.text,f,p]);let te=0;e.verticalAlign===`middle`&&(te=(e.height-O)/2),e.verticalAlign===`bottom`&&(te=e.height-O);let ne=qf({fontLoaded:v,fontFamily:e.fontFamily,fontSize:e.fontSize,lineHeight:e.lineHeight}),re=e.backgroundPadding*(e.fontSize*ne*.5),F=e.backgroundCornerRadius*(e.fontSize*ne*.5),I=S.useMemo(()=>{if(!e.backgroundEnabled||e.curveEnabled||e.legacyBackground)return``;let t=am(C);return t.length===0?``:Us({rects:t.map(e=>({left:e.left+m,right:e.right+m,top:e.top+m,bottom:e.bottom+m})),padding:re,cornerRadius:F})},[e.backgroundEnabled,e.curveEnabled,e.legacyBackground,C,v,re,F,m]),L=il(),ie=Yc(e.a.width,O,e.curvePower,e.fontSize),ae=S.useRef(null),oe=S.useRef(null),se=y&&e.strokeWidth>0&&!e.curveEnabled,ce=D>0?(e.a.width+2*m)/(D+2*m):1;return S.createElement(S.Fragment,null,e.curveEnabled||e.legacyBackground?S.createElement(Lo,{x:e.a.x,y:e.a.y,offsetX:re/ce,offsetY:re/ce,rotation:e.a.rotation,scaleX:ce,scaleY:ce,hideInExport:!e.showInExport,listening:!1,visible:e.backgroundEnabled,opacity:e.backgroundOpacity*e.a.opacity,fill:e.backgroundColor,width:e.width+2*re,height:e.height+2*re,cornerRadius:F}):S.createElement(Ho,{name:`html-background`,x:e.a.x,y:e.a.y,offsetX:m/ce,offsetY:(m-te)/ce,rotation:e.a.rotation,scaleX:ce,scaleY:ce,hideInExport:!e.showInExport,listening:!1,visible:e.backgroundEnabled&&I.length>0,opacity:e.backgroundOpacity*e.a.opacity,fill:e.backgroundColor,data:I}),S.createElement(Ho,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,data:ie,stroke:n.stroke,strokeWidth:1,visible:!1}),S.createElement(Lo,{ref:r,name:`element`,x:e.a.x,y:e.a.y,listening:e.selectable,rotation:e.a.rotation,width:e.a.width,height:e.a.height,visible:!P,draggable:L?e.draggable&&f:e.draggable,preventDefault:!L||f,opacity:y?0:e.a.opacity,hideInExport:!e.showInExport,onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},id:e.id,onDblClick:t=>{e.contentEditable&&(oe.current={x:t.evt.clientX,y:t.evt.clientY},e.toggleEditMode(!0))},onDblTap:t=>{if(e.contentEditable){let n=t.evt.changedTouches?.[0];oe.current=n?{x:n.clientX,y:n.clientY}:null,e.toggleEditMode(!0)}},onTransformStart:t=>{c(!0),d.current=e.height},onTransform:t=>{let n=t.target,r=(n.getStage()?.findOne(`Transformer`)).getActiveAnchor(),i=r===`middle-left`||r===`middle-right`,a=r===`top-center`||r===`bottom-center`,o=n.scaleX();if(i){let t=n.scaleX(),r=n.width()*t,i=e.fontSize,a=r;r<i&&(a=i,ae.current&&n.position(ae.current)),n.width(a),n.scaleX(1),n.scaleY(1);let o=im(el(Object.assign(Object.assign({},e.toJSON()),{width:a}),{fontFamily:b,color:x})).height,s=Lc.textVerticalResizeEnabled?Math.max(o,d.current):o;n.height(s),e.set({width:n.width(),height:s,x:n.x(),y:n.y()})}else if(a){let r=Lc.textOverflow===`resize`,i=typeof e.lineHeight==`number`?e.lineHeight:1,a=r?O:i*e.fontSize,o=Math.max(a,t.target.height()*t.target.scaleY());n.scaleY(1),e.set({x:n.x(),y:n.y(),height:o,rotation:n.rotation()})}else n.scaleX(1),n.scaleY(1),e.set({fontSize:e.fontSize*o,letterSpacing:e.letterSpacing,width:n.width()*o,x:n.x(),y:n.y(),rotation:n.rotation(),height:n.height()*o});ae.current=t.target.position()},onTransformEnd:t=>{c(!1),u(!0);let n=t.target.scaleX();t.target.scaleX(1),t.target.scaleY(1),e.set({fontSize:e.fontSize*n,width:t.target.width()*n,x:t.target.x(),y:t.target.y(),rotation:t.target.rotation(),shadowBlur:e.shadowBlur*n,shadowOffsetX:e.shadowOffsetX*n,shadowOffsetY:e.shadowOffsetY*n,strokeWidth:e.strokeWidth*n})}}),S.createElement(zo,{ref:r,image:i,x:e.a.x,y:e.a.y,offsetX:m,offsetY:m-te,listening:!1,rotation:e.a.rotation,width:e.a.width+2*m,height:(e.a.width+2*m)*((i?.height??0)/(i?.width||1)||1),visible:!P&&!y,opacity:e.a.opacity,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,hideInExport:!e.showInExport,editModeEnabled:e._editModeEnabled||s||P}),(P||se)&&S.createElement(`Group`,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,offsetY:-te},S.createElement(Ss,{divProps:{style:{pointerEvents:`none`}}},S.createElement(Dm,{dangerouslySetInnerHTML:{__html:C},style:{pointerEvents:`none`,opacity:e.a.opacity,textShadow:e.shadowEnabled?`${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur}px ${wm(e.shadowColor,e.shadowOpacity??1)}`:void 0}}))),y&&S.createElement(`Group`,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,offsetY:-te},S.createElement(Ss,null,S.createElement(Am,{html:w,element:e,onChange:t=>{let n=Lf({oldText:mc(e.text),newText:mc(t),element:e});e.set({text:t,fontSize:n})},onBlur:t=>{e.toggleEditMode(!1),ee(!0)},clickCoords:oe.current}))))});function Fm(e,t){if(!e||!t)return;let{x:n,y:r}=t;try{let t=null;if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(n,r);else if(document.caretPositionFromPoint){let e=document.caretPositionFromPoint(n,r);e&&(t=document.createRange(),t.setStart(e.offsetNode,e.offset))}if(t){let n=Ap.default.find(t.startContainer,!0);if(n){let r=n.offset(e.scroll)+t.startOffset;e.setSelection(r,0,`api`);return}}}catch{}e.setSelection(0,0,`api`)}function Im(e){return e/180*Math.PI}function Lm(e,t,n,r,i){let a=Math.sqrt(n*n+r*r);return i+=Math.atan2(r,n),{x:e+a*Math.cos(i),y:t+a*Math.sin(i)}}function Rm(e){let{x:t,y:n,width:r,height:i}=e,a=Im(e.rotation),o=Lm(t,n,0,0,a),s=Lm(t,n,r,0,a),c=Lm(t,n,r,i,a),l=Lm(t,n,0,i,a),u=Math.min(o.x,s.x,c.x,l.x),d=Math.min(o.y,s.y,c.y,l.y),f=Math.max(o.x,s.x,c.x,l.x),p=Math.max(o.y,s.y,c.y,l.y);return{x:u,y:d,width:f-u,height:p-d,minX:u,minY:d,maxX:f,maxY:p}}function zm(e){let t=e.map(e=>Rm(e)),n=Math.min(...t.map(e=>e.minX)),r=Math.min(...t.map(e=>e.minY)),i=Math.max(...t.map(e=>e.maxX)),a=Math.max(...t.map(e=>e.maxY));return{x:n,y:r,width:i-n,height:a-r,minX:n,minY:r,maxX:i,maxY:a}}function Bm(e){let t=Im(e.rotation||0);return{x:e.x+e.width/2*Math.cos(t)+e.height/2*Math.sin(-t),y:e.y+e.height/2*Math.cos(t)+e.width/2*Math.sin(t)}}function Vm(e,t,n){let r=Im(t),i=n.x+(e.x-n.x)*Math.cos(r)-(e.y-n.y)*Math.sin(r),a=n.y+(e.x-n.x)*Math.sin(r)+(e.y-n.y)*Math.cos(r);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:i,y:a})}function Hm(e,t){return Vm(e,t,Bm(e))}var Um=({targetKonvaNodes:e,guideKonvaNode:t,distance:n,snapDirection:r})=>n<5;function Wm(e,t){var n=[],r=[];e.vertical.forEach(e=>{t.vertical.forEach(t=>{var r=Math.abs(e.offset-t.guide);Um({targetKonvaNodes:t.nodes,guideKonvaNode:e.node,distance:r,snapDirection:e.snap})&&n.push({lineGuide:e.offset,diff:r,snap:t.snap,offset:t.offset})})}),e.horizontal.forEach(e=>{t.horizontal.forEach(t=>{var n=Math.abs(e.offset-t.guide);Um({targetKonvaNodes:t.nodes,guideKonvaNode:e.node,distance:n,snapDirection:e.snap})&&r.push({lineGuide:e.offset,diff:n,snap:t.snap,offset:t.offset})})});var i=[];let a=n.sort((e,t)=>e.diff-t.diff),o=r.sort((e,t)=>e.diff-t.diff);var s=a[0],c=o[0];return s&&a.filter(e=>Math.abs(e.diff-s.diff)<.1).forEach(e=>{i.push(Object.assign({orientation:`V`},e))}),c&&o.filter(e=>Math.abs(e.diff-c.diff)<.1).forEach(e=>{i.push(Object.assign({orientation:`H`},e))}),i}var Gm=()=>{if(a.DD._dragElements.size===0)return;let e=[...a.DD._dragElements.entries()],t=e.find(([e,t])=>t.node instanceof a.Transformer);t&&(e.splice(e.indexOf(t),1),e.unshift(t),a.DD._dragElements.clear(),e.forEach(([e,t])=>{a.DD._dragElements.set(e,t)}))};function Km(e,t){let n=S.useRef(null),{snapGuideStyle:r}=ps(),i=S.useRef(r);i.current=r;let o=e=>e.hasName(`element`)||e.hasName(`page-background`)||!n.current&&e.hasName(`elements-area`);function s(t){let n=e.current?.getStage(),r=[],i=[];return n.find(o).forEach(e=>{if(!(t.indexOf(e)>=0)){var n=e.getClientRect({skipShadow:!0,skipStroke:!0});r.push({offset:n.x,node:e,snap:`start`},{offset:n.x+n.width,node:e,snap:`end`},{offset:n.x+n.width/2,node:e,snap:`center`}),i.push({offset:n.y,node:e,snap:`start`},{offset:n.y+n.height,node:e,snap:`end`},{offset:n.y+n.height/2,node:e,snap:`center`})}}),{vertical:r,horizontal:i}}function c(t){let n=e.current?.getLayer(),r=n?.children.find(e=>e.name()===`line-guides`);t.forEach(e=>{if(e.orientation===`H`){var t=new a.Line({x:-n.getStage().x(),y:-n.getStage().y(),points:[-6e3,e.lineGuide,6e3,e.lineGuide],stroke:i.current.stroke,strokeWidth:i.current.strokeWidth,name:`guid-line`,dash:i.current.dash});r?.add(t),n.batchDraw()}else e.orientation===`V`&&(t=new a.Line({x:-n.getStage().x(),y:-n.getStage().y(),points:[e.lineGuide,-6e3,e.lineGuide,6e3],stroke:i.current.stroke,strokeWidth:i.current.strokeWidth,name:`guid-line`,dash:i.current.dash}),r?.add(t))})}let l=e=>{e.target.getLayer().children.find(e=>e.name()===`line-guides`)?.destroyChildren();var t=Wm(s(e.target.nodes()),function(e){let t=e.__getNodeRect(),n=Rm(Object.assign(Object.assign({},t),{rotation:a.Util.radToDeg(t.rotation)})),r=e.getAbsolutePosition();return{vertical:[{guide:n.x,offset:r.x-n.x,snap:`start`,nodes:e.nodes()},{guide:n.x+n.width/2,offset:r.x-n.x-n.width/2,snap:`center`,nodes:e.nodes()},{guide:n.x+n.width,offset:r.x-n.x-n.width,snap:`end`,nodes:e.nodes()}],horizontal:[{guide:n.y,offset:r.y-n.y,snap:`start`,nodes:e.nodes()},{guide:n.y+n.height/2,offset:r.y-n.y-n.height/2,snap:`center`,nodes:e.nodes()},{guide:n.y+n.height,offset:r.y-n.y-n.height,snap:`end`,nodes:e.nodes()}]}}(e.target));if(!t.length)return;c(t);let n=e.target.getAbsolutePosition(),r=(e.target.nodes().map(e=>e.getAbsolutePosition()),Object.assign({},n));t.forEach(e=>{switch(e.snap){case`start`:case`center`:case`end`:switch(e.orientation){case`V`:r.x=e.lineGuide+e.offset;break;case`H`:r.y=e.lineGuide+e.offset}}});let i=r.x-n.x,o=r.y-n.y;e.evt.ctrlKey||e.evt.metaKey||e.target.nodes().forEach(e=>{let t=e.getAbsolutePosition();e.setAbsolutePosition({x:t.x+i,y:t.y+o})})},u=(t,n,r)=>{let i=e.current;if(i.getLayer().children.find(e=>e.name()===`line-guides`)?.destroyChildren(),i.getActiveAnchor()===`rotater`)return n;let a=Ym[i.getActiveAnchor()],o=i.findOne(`.${a}`)?.getAbsolutePosition();if(!o)return n;let l={x:t.x-o.x,y:t.y-o.y},u=function(e,t){let n=Jm(e,t)/Jm(t,t);return{x:n*t.x,y:n*t.y}}({x:n.x-t.x,y:n.y-t.y},l);if(Math.sqrt(u.x**2+u.y**2)>5)return n;let d={x:t.x+u.x,y:t.y+u.y};var f=Wm(s(i.nodes()),{vertical:[{guide:d.x,offset:0,snap:`start`,nodes:i.nodes()}],horizontal:[{guide:d.y,offset:0,snap:`start`,nodes:i.nodes()}]});if(!f.length||(c(f),r.ctrlKey||r.metaKey))return n;let p=[];if(f.forEach(e=>{let t=function(e,t,n){if(n.orientation===`V`){let r=n.lineGuide;if(Math.abs(t.x-e.x)<1e-4)return null;let i=(t.y-e.y)/(t.x-e.x);return{x:r,y:i*r+(e.y-i*e.x)}}{let r=n.lineGuide;if(Math.abs(t.y-e.y)<1e-4)return null;let i=(t.y-e.y)/(t.x-e.x);return{x:(r-e.y)/i+e.x,y:r}}}(d,o,{orientation:e.orientation,lineGuide:e.lineGuide});t&&p.push(t)}),p.length>0){let e=p[0],t=Math.sqrt((d.x-e.x)**2+(d.y-e.y)**2);if(p.forEach(n=>{let r=Math.sqrt((d.x-n.x)**2+(d.y-n.y)**2);r<t&&(t=r,e=n)}),t<10)return e}return d},d=e=>{if(!e.target)return;let t=e.target.getLayer();t.children.find(e=>e.name()===`line-guides`)?.destroyChildren(),t.batchDraw()};S.useEffect(()=>{e.current&&(e.current.anchorDragBoundFunc(u),e.current.on(`dragstart`,e=>{setTimeout(()=>{Gm()})}),e.current.on(`dragmove`,l),e.current.on(`dragend`,d),e.current.on(`transformend`,d),e.current.on(`transform`,t=>{var n,r;t.evt.ctrlKey||t.evt.metaKey?(n=e.current)==null||n.rotationSnapTolerance(0):(r=e.current)==null||r.rotationSnapTolerance(5)}))},[])}function qm(e,t,n){let{snapGuideStyle:r}=ps(),i=S.useRef(r);i.current=r;let o=e=>e.hasName(`element`)||e.hasName(`line-anchor`)||e.hasName(`page-background`)||e.hasName(`elements-area`),s=n=>{n.target.getLayer().children.find(e=>e.name()===`line-guides`)?.destroyChildren();var r,s=Wm(function(t){let n=e.current?.getStage();var r=[],i=[];return n.find(o).forEach(e=>{if(!(t.indexOf(e)>=0)){var n=e.getClientRect({skipShadow:!0,skipStroke:!0});e.hasName(`line-anchor`)&&(n={x:e.absolutePosition().x,y:e.absolutePosition().y,width:0,height:0}),r.push({offset:n.x,node:e,snap:`start`},{offset:n.x+n.width,node:e,snap:`end`},{offset:n.x+n.width/2,node:e,snap:`center`}),i.push({offset:n.y,node:e,snap:`start`},{offset:n.y+n.height,node:e,snap:`end`},{offset:n.y+n.height/2,node:e,snap:`center`})}}),{vertical:r,horizontal:i}}([n.target,...t.map(e=>e.current)]),{vertical:[{guide:(r=n.target).absolutePosition().x,offset:0,snap:`center`,nodes:[r]}],horizontal:[{guide:r.absolutePosition().y,offset:0,snap:`center`,nodes:[r]}]});if(!s.length)return;(function(t){let n=e.current?.getLayer(),r=n?.children.find(e=>e.name()===`line-guides`);t.forEach(e=>{if(e.orientation===`H`){var t=new a.Line({x:-n.getStage().x(),y:-n.getStage().y(),points:[-6e3,e.lineGuide,6e3,e.lineGuide],stroke:i.current.stroke,strokeWidth:i.current.strokeWidth,name:`guid-line`,dash:i.current.dash});r?.add(t),n.batchDraw()}else e.orientation===`V`&&(t=new a.Line({x:-n.getStage().x(),y:-n.getStage().y(),points:[e.lineGuide,-6e3,e.lineGuide,6e3],stroke:i.current.stroke,strokeWidth:i.current.strokeWidth,name:`guid-line`,dash:i.current.dash}),r?.add(t))})})(s);let c=n.target.getAbsolutePosition(),l=Object.assign({},c);s.forEach(e=>{switch(e.snap){case`start`:case`center`:case`end`:switch(e.orientation){case`V`:l.x=e.lineGuide+e.offset;break;case`H`:l.y=e.lineGuide+e.offset}}});let u=l.x-c.x,d=l.y-c.y;if(!n.evt.ctrlKey&&!n.evt.metaKey){let e=n.target.getAbsolutePosition();n.target.absolutePosition({x:e.x+u,y:e.y+d})}},c=e=>{if(!e.target)return;let t=e.target.getLayer();t.children.find(e=>e.name()===`line-guides`)?.destroyChildren(),t.batchDraw()};S.useEffect(()=>{e.current&&(e.current.on(`dragmove`,s),e.current.on(`dragend`,c))},n)}function Jm(e,t){return e.x*t.x+e.y*t.y}var Ym={"top-left":`bottom-right`,"top-center":`bottom-center`,"top-right":`bottom-left`,"middle-right":`middle-left`,"bottom-right":`top-left`,"bottom-center":`top-center`,"bottom-left":`top-right`,"middle-left":`middle-right`};function Xm(e){let{x:t,y:n,width:r,height:i,rotation:a}=e.a,o=a*Math.PI/180,s={x:t+i/2*Math.cos(o+Math.PI/2),y:n+i/2*Math.sin(o+Math.PI/2)};return{middleLeft:s,middleRight:{x:s.x+r*Math.cos(o),y:s.y+r*Math.sin(o)}}}function Zm(e,t,n){let r=Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),i=Math.atan2(t.y-e.y,t.x-e.x),a=180*i/Math.PI;return{x:e.x+Math.cos(i-Math.PI/2)*n/2,y:e.y+Math.sin(i-Math.PI/2)*n/2,width:r,height:n,rotation:a}}var Qm=(e,t,n)=>{let r=n.anchorSize;return{offsetX:r/2/e,offsetY:r/2/e,width:r/e,height:r/e,cornerRadius:n.anchorCornerRadius/e,fill:n.anchorFill,stroke:n.anchorStroke,strokeWidth:n.anchorStrokeWidth,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:e=>{e.target.getStage().container().style.cursor=`crosshair`},onMouseLeave:e=>{e.target.getStage().container().style.cursor=``},onDragStart:e=>{t.history.startTransaction()},onDragEnd:e=>{t.history.endTransaction()}}},$m=U(({element:e,type:t})=>{let n=Xs(e,e.a.color,`fill`),r=Xs(e,e.a.color,`stroke`),i=Object.assign(Object.assign(Object.assign({strokeWidth:e.height,lineCap:`round`,lineJoin:`round`},r),n),{opacity:e.a.opacity,hideInExport:!e.showInExport});return S.createElement(S.Fragment,null,t===`arrow`&&S.createElement(`Line`,Object.assign({points:[3*e.height,2*-e.height,0,0,3*e.height,2*e.height]},i)),t===`triangle`&&S.createElement(`Line`,Object.assign({points:[3*e.height,2*-e.height,0,0,3*e.height,2*e.height],closed:!0},i)),t===`bar`&&S.createElement(`Line`,Object.assign({points:[0,2*-e.height,0,2*e.height],closed:!0},i)),t===`square`&&S.createElement(`Line`,Object.assign({points:[0,2*-e.height,4*e.height,2*-e.height,4*e.height,2*e.height,0,2*e.height],closed:!0},i)),t===`circle`&&S.createElement(`Circle`,Object.assign({x:2*e.height,y:0,radius:2*e.height},i)))}),eh=U(({element:e,store:t})=>{let{transformerStyle:n}=ps(),r=S.useRef(null),i=S.useRef(null),a=S.useRef(null),o=e.selectable||t.role===`admin`,s=il(),c=t.selectedElements.indexOf(e)>=0&&t.selectedElements.length===1,l=e.isSelected,{middleLeft:u,middleRight:d}=Xm(e);qm(i,[r],[c]),qm(a,[r],[c]);let f=Xs(e,e.a.color,`stroke`);return S.createElement(S.Fragment,null,S.createElement(Ro,Object.assign({ref:r,name:`element`,id:e.id,x:e.a.x,y:e.a.y,points:[0,0,e.a.width,0],offsetY:-e.a.height/2,strokeWidth:e.a.height,hitStrokeWidth:Math.max(e.a.height,20),dash:e.dash.map(t=>t*e.a.height)},f,{rotation:e.a.rotation,opacity:e.animated(`opacity`),shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,listening:o,draggable:s?e.draggable&&l:e.draggable,preventDefault:!s||l,hideInExport:!e.showInExport,onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onTransform:t=>{let n=t.target.scaleX();t.target.scaleX(1),t.target.scaleY(1),e.set({height:e.height*n,width:e.width*n,x:t.target.x(),y:t.target.y(),rotation:t.target.rotation()})}})),S.createElement(Fo,{x:u.x,y:u.y,rotation:e.rotation,hideInExport:!e.showInExport,onClick:e=>r.current?.fire(`click`,e),onTap:e=>r.current?.fire(`tap`,e)},S.createElement($m,{element:e,type:e.startHead})),S.createElement(Fo,{x:d.x,y:d.y,rotation:e.rotation+180,onClick:e=>r.current?.fire(`click`,e),onTap:e=>r.current?.fire(`tap`,e)},S.createElement($m,{element:e,type:e.endHead})),c&&e.resizable&&S.createElement(Cs,{selector:`.page-abs-container`,enabled:!0},S.createElement(`Group`,{visible:c},S.createElement(`Rect`,Object.assign({x:u.x,y:u.y,ref:i,name:`line-anchor`},Qm(t.scale,t,n),{onDragMove:t=>{let n=Zm(t.target.position(),d,e.height);e.set({x:n.x,y:n.y,width:n.width,rotation:n.rotation})}})),S.createElement(`Rect`,Object.assign({x:d.x,y:d.y,ref:a,name:`line-anchor`},Qm(t.scale,t,n),{onDragMove:t=>{let n=Zm(u,t.target.position(),e.height);e.set({x:n.x,y:n.y,width:n.width,rotation:n.rotation})}})))))}),th=.05,nh=(e,t,n)=>{let[r,i]=S.useState({input:null,videoSink:null,duration:0,isReady:!1,error:null});S.useRef(r).current=r;let a=S.useRef(0),d=S.useRef(null),f=S.useRef(null),p=S.useRef(null),m=S.useRef(null),h=S.useRef(null),g=S.useRef(null),_=S.useRef(!1),v=S.useRef(null),y=S.useRef([]),b=S.useRef(null),x=S.useRef(!1),[,C]=S.useReducer(e=>e+1,0);return S.useEffect(()=>{if(!n)return;let t=!0,r=++a.current,d=null;return(async()=>{try{if(!t||r!==a.current)return;d=cc(`mediabunny init ${e.id}`);let n=await async function(e){if(function(e){return e.startsWith(`data:`)}(e))return new l(function(e){let t=e.indexOf(`,`);if(t===-1)throw Error(`Invalid data URL format`);let n=e.slice(t+1),r=atob(n),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);return i.buffer}(e));if(function(e){return e.startsWith(`file://`)}(e))try{return new l(await(await fetch(e)).arrayBuffer())}catch(t){throw Error(`Failed to load file URL: ${e}. File URLs may not be supported in this environment. Error: ${t}`)}return new o(e)}(e.src);if(!t||r!==a.current){d&&=(d(),null);return}let f=new s({source:n,formats:c}),p=await f.computeDuration(),m=await f.getPrimaryVideoTrack();if(!m)throw Error(`No video track found`);if(m.codec===null)throw Error(`Unsupported video codec`);if(!await m.canDecode())throw Error(`Unable to decode the video track`);let h=new u(m,{poolSize:5,fit:`contain`,alpha:await m.canBeTransparent()});if(!t||r!==a.current){f.dispose(),d&&=(d(),null);return}d&&=(d(),null),i(e=>Object.assign(Object.assign({},e),{input:f,videoSink:h,duration:p,isReady:!0,error:null}))}catch(n){console.error(`Failed to initialize mediabunny:`,n),d&&=(d(),null),t&&r===a.current&&(pc(`Failed to initialize mediabunny for video ${e.id}: ${n}`),i(e=>Object.assign(Object.assign({},e),{error:String(n),isReady:!1})))}})(),()=>{t=!1,d&&=(d(),null)}},[e.src,n]),S.useEffect(()=>()=>{f.current&&=(f.current.return(),null),d.current&&=(d.current(),null),p.current=null,m.current=null,h.current=null,_.current=!1,v.current=null,y.current=[],b.current=null,x.current=!1,i({input:null,videoSink:null,duration:0,isReady:!1,error:null})},[n]),S.useEffect(()=>{if(!n||!r.isReady||!r.videoSink)return;let i=++a.current,o=typeof e.src==`string`?e.src.slice(0,120):String(e.src),s=(t,n={},i=`debug`)=>{let a=``;try{a=JSON.stringify(Object.assign(Object.assign({},n),{timeCalc:g.current}))}catch(e){a=`[unserializable extras: ${String(e)}]`}let s=`mediabunny event=${t} elementId=${e.id} targetTime=${h.current} duration=${r.duration} lastFrameTimestamp=${m.current} hasIterator=${!!f.current} prefetchSize=${y.current.length} srcHint=${o} extras=${a}`;i===`error`?console.error(s):i===`warn`?console.warn(s):console.debug(s)},c=e=>{let t=r.duration||0;if(!t||!Number.isFinite(t))return e;let n=t>th?t-th:t;return Math.max(0,Math.min(e,n))},l=e=>{let t=r.duration||0;return!(!t||!Number.isFinite(t))&&t-e<=.050001000000000004},u=e=>{let t=p.current;t&&t.width===e.canvas.width&&t.height===e.canvas.height||(t||(t=document.createElement(`canvas`),p.current=t),t.width=e.canvas.width,t.height=e.canvas.height);let n=t.getContext(`2d`);n&&(n.clearRect(0,0,t.width,t.height),n.drawImage(e.canvas,0,0)),m.current=e.timestamp},S=e=>{let t=f.current;t&&(x.current||(x.current=!0,b.current=(async()=>{try{for(;y.current.length<4&&e===a.current;){let n=await t.next();if(e!==a.current)return;if(n.done||!n.value)break;y.current.push({timestamp:n.value.timestamp,frame:n.value})}}catch{}finally{x.current=!1,b.current=null}})()))},w=e=>{let t=y.current;for(let n=0;n<t.length;n++)if(Math.abs(t[n].timestamp-e)<th){let e=t[n];return y.current=t.slice(n+1),e}return null},T=()=>{y.current=[]},E=async(e,t,n=0)=>{let i=c(e),o=(e=>{let t=m.current;return t===null||e<t-th||e>t+.5})(i)?`seek`:`iterate`;try{let n=r.videoSink,c=m.current;if(c!==null&&Math.abs(c-i)<th){h.current=e;return}let d=w(i);if(d){u(d.frame),h.current=e,S(t),C();return}if(b.current){await b.current;let n=w(i);if(n){u(n.frame),h.current=e,S(t),C();return}}if(T(),o===`seek`){f.current&&=(await f.current.return(),null);let r=n.canvases(i);f.current=r;let c=await r.next();if(t!==a.current){f.current&&=(await f.current.return(),null);return}if(c.done||!c.value){if(l(i)||s(`iterator_exhausted`,{mode:o,requestedTargetTime:e,clampedTargetTime:i},`warn`),t===a.current&&!l(i))try{f.current&&=(await f.current.return(),null),T();let r=n.canvases(i);f.current=r;let a=await r.next();!a.done&&a.value&&(u(a.value),S(t),h.current=e,C())}catch{}return}u(c.value),S(t)}else{let r=f.current;if(!r)return;let c=!1;for(;t===a.current;){let d=await r.next();if(t!==a.current)break;if(d.done||!d.value){if(l(i)||s(`iterator_exhausted`,{mode:o,requestedTargetTime:e,clampedTargetTime:i},`warn`),!c&&!l(i)){c=!0;try{f.current&&=(await f.current.return(),null),T();let e=n.canvases(i);f.current=e;let r=await e.next();if(t!==a.current||r.done||!r.value)break;u(r.value),S(t);break}catch{break}}break}let p=d.value;if(u(p),Math.abs(p.timestamp-i)<th){S(t);break}if(p.timestamp>i){S(t);break}}}h.current=e,C()}catch(r){let a=r instanceof Error?{name:r.name,message:r.message,stack:r.stack}:{message:String(r)},c=r instanceof Error?`${r.name}: ${r.message}`:String(r),l=c.includes(`Unsupported configuration`)||c.includes(`isConfigSupported`)||c.includes(`OperationError`);if(s(`frame_process_failed`,{mode:o,requestedTargetTime:e,clampedTargetTime:i,unsupportedConfigAttempt:n,isUnsupportedConfig:l,error:a},`error`),l&&n<1)try{f.current&&=(await f.current.return(),null),T(),b.current=null,x.current=!1,m.current=null,await E(e,t,n+1)}catch{}}},D=$n(()=>{let n=r.videoSink,o=r.duration;if(!n||!o)return;let s=e.startTime*o*1e3,l=o*(e.endTime-e.startTime)*1e3,u=((t.currentTime||e.page.startTime)-e.page.startTime)%l+s,f=u/1e3,p=c(f);g.current={pageStartTime:e.page.startTime,storeCurrentTime:t.currentTime,offsetMs:s,durationMs:l,restMs:u,targetTime:f,clampedTargetTime:p,startTime:e.startTime,endTime:e.endTime,videoDuration:o},((t,n)=>{_.current?v.current=t:(_.current=!0,d.current||=cc(`mediabunny video frame ${e.id}`),(async()=>{let e=t;for(;e!==null&&n===a.current;)await E(e,n),e=v.current,v.current=null;d.current&&=(d.current(),null),_.current=!1})())})(p,i)});return()=>{D(),a.current++,d.current&&=(d.current(),null)}},[n,r.isReady,r.videoSink,r.duration,t,e]),n&&r.isReady?p.current:null};function rh(){return document.createElement(`canvas`)}var ih=new window.Image;ih.src=lp(`
268
- <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
269
- <path opacity="0.6" d="M4 5.49683V18.5032C4 20.05 5.68077 21.0113 7.01404 20.227L18.0694 13.7239C19.384 12.9506 19.384 11.0494 18.0694 10.2761L7.01404 3.77296C5.68077 2.98869 4 3.95 4 5.49683Z" fill="white"/>
270
- <path d="M4 5.49683V18.5032C4 20.05 5.68077 21.0113 7.01404 20.227L18.0694 13.7239C19.384 12.9506 19.384 11.0494 18.0694 10.2761L7.01404 3.77296C5.68077 2.98869 4 3.95 4 5.49683Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
271
- </svg>
272
- `);var ah=new window.Image;ah.src=lp(`
273
- <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
274
- <path opacity="0.6" d="M14 19L14 5C14 3.89543 14.8954 3 16 3L17 3C18.1046 3 19 3.89543 19 5L19 19C19 20.1046 18.1046 21 17 21L16 21C14.8954 21 14 20.1046 14 19Z" fill="white"/>
275
- <path opacity="0.6" d="M10 19L10 5C10 3.89543 9.10457 3 8 3L7 3C5.89543 3 5 3.89543 5 5L5 19C5 20.1046 5.89543 21 7 21L8 21C9.10457 21 10 20.1046 10 19Z" fill="white"/>
276
- <path d="M14 19L14 5C14 3.89543 14.8954 3 16 3L17 3C18.1046 3 19 3.89543 19 5L19 19C19 20.1046 18.1046 21 17 21L16 21C14.8954 21 14 20.1046 14 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
277
- <path d="M10 19L10 5C10 3.89543 9.10457 3 8 3L7 3C5.89543 3 5 3.89543 5 5L5 19C5 20.1046 5.89543 21 7 21L8 21C9.10457 21 10 20.1046 10 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
278
- </svg>
279
- `);var oh=(e,t,n,r,i=0,o=!1)=>{let s=Math.floor(Math.max(e.width*r,1)),c=Math.floor(Math.max(e.height*r,1)),l=Math.min(i*r,s/2,c/2),u=Math.max(e.width/n.width,e.height/n.height)*r,d=e.page._exportingOrRendering&&Lc.imageDownScalingEnabled&&u<1&&!o,f=t instanceof HTMLVideoElement?t.videoWidth:t?.width,p=t instanceof HTMLVideoElement?t.videoHeight:t?.height,m=n.x===0&&n.y===0&&n.width===f&&n.height===p,h=S.useMemo(()=>{if(t&&f&&p)return m&&l===0&&!d?void 0:rh()},[t,l,d,m,f,p]),g=()=>{if(!h||!t)return;h.width=s,h.height=c;let e=h.getContext(`2d`);if(!e)return;l&&(e.beginPath(),e.moveTo(l,0),e.lineTo(s-l,0),e.arc(s-l,l,l,3*Math.PI/2,0,!1),e.lineTo(s,c-l),e.arc(s-l,c-l,l,0,Math.PI/2,!1),e.lineTo(l,c),e.arc(l,c-l,l,Math.PI/2,Math.PI,!1),e.lineTo(0,l),e.arc(l,l,l,Math.PI,3*Math.PI/2,!1),e.clip());let r=d?function(e,t){var n,r;let i=rh(),a=e instanceof HTMLVideoElement?e.videoWidth:e.width,o=e instanceof HTMLVideoElement?e.videoHeight:e.height;i.width=a,i.height=o,(n=i.getContext(`2d`))==null||n.drawImage(e,0,0,i.width,i.height);let s=function(e,t,n,r,i,a,o){for(var s=new ImageData(t,n),c=new Int32Array(e.data.buffer),l=e.width,u=new Int32Array(s.data.buffer),d=s.width,f=t/a,p=n/o,m=Math.round(1/f),h=Math.round(1/p),g=m*h,_=0;_<s.height;_++)for(var v=0;v<d;v++){for(var y=0+Math.round(v/f)+(0+Math.round(_/p))*l,b=0,x=0,S=0,C=0,w=0;w<h;w++)for(var T=0;T<m;T++){var E=c[y+T+w*l];b+=E<<24>>>24,x+=E<<16>>>24,S+=E<<8>>>24,C+=E>>>24}b=Math.round(b/g),x=Math.round(x/g),S=Math.round(S/g),C=Math.round(C/g),u[v+_*d]=C<<24|S<<16|x<<8|b}return s}(i.getContext(`2d`).getImageData(0,0,i.width,i.height),Math.floor(i.width*t),Math.floor(i.height*t),0,0,i.width,i.height);return i.width=Math.floor(i.width*t),i.height=Math.floor(i.height*t),(r=i.getContext(`2d`))==null||r.putImageData(s,0,0),i}(t,u):t,i=d?{x:Math.floor(n.x*u),y:Math.floor(n.y*u),width:Math.floor(n.width*u),height:Math.floor(n.height*u)}:n;e.drawImage(r,i.x,i.y,i.width,i.height,0,0,h.width,h.height)};return S.useLayoutEffect(()=>{g()},[h,e.width,e.height,n.x,n.y,n.width,n.height,i,r,o,e.page._exportingOrRendering,d]),S.useEffect(()=>()=>{h&&h.nodeName===`CANVAS`&&a.Util.releaseCanvas(h)},[h]),[h||t,g]},sh=rh(),ch=U(({element:e})=>{let t=Math.min(30,e.width/4,e.height/4),n=S.useRef(null);S.useEffect(()=>{let e=n.current;if(!e)return;let t=new a.Animation(t=>{e.rotate((t?.timeDiff||0)/2)},e.getLayer());return t.start(),()=>{t.stop()}});let{mediaLoadingStyle:r}=ps();return S.createElement(Fo,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},S.createElement(Lo,{width:e.width,height:e.height,fill:r.fill}),S.createElement(`Arc`,{ref:n,x:e.width/2,y:e.height/2,fill:r.textFill,outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270}))}),lh=U(({element:e})=>{let{mediaErrorStyle:t}=ps(),n=Math.max(10,Math.min(30,e.width/25));return S.createElement(Fo,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},S.createElement(Lo,{width:e.width,height:e.height,fill:t.fill}),S.createElement(Bo,{text:`Can not load the video...`,fontSize:n,width:e.width,height:e.height,align:`center`,fill:t.textFill,verticalAlign:`middle`,padding:5}))}),uh=function(e,t,n){let r=S.useRef(`loading`),i=S.useRef(void 0),[a,o]=S.useState(0),s=S.useRef(),c=S.useRef(),l=S.useRef();return s.current===e&&c.current===t&&l.current===n||(r.current=`loading`,i.current=void 0,s.current=e,c.current=t,l.current=n),S.useLayoutEffect(function(){if(e){var a=document.createElement(`video`);return a.addEventListener(`canplay`,s),a.addEventListener(`error`,c),t&&(a.crossOrigin=t),n&&(a.referrerPolicy=n),a.src=e,a.load(),function(){a.removeEventListener(`canplay`,s),a.removeEventListener(`error`,c)}}function s(){r.current=`loaded`,i.current=a,i.current.currentTime=0,o(Math.random()),i.current.removeEventListener(`canplay`,s)}function c(e){let t=a.readyState===4,n=a.buffered&&a.buffered.length>0&&a.buffered.end(a.buffered.length-1)/a.duration*100>=100;if(t&&n)return;let s=e.message||a.error?.message||`Unknown error`,c=Error(`Video failed to load: `+s);console.error(c),r.current=`failed`,i.current=void 0,o(Math.random())}},[e,t,n]),[i.current,r.current]};function dh(e){return e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA}var fh=(e,t,n)=>{let r=S.useRef(),i=()=>{var e;(e=r.current)==null||e.call(r),r.current=void 0};S.useEffect(()=>i,[]),S.useLayoutEffect(()=>{let a=`video with id ${n} url: ${t.slice(0,200)}`;e!==`loading`||r.current||(r.current=cc(a)),e!==`loading`&&i(),e===`failed`&&pc(a)},[e])},ph=U(({element:e,store:t})=>{let[n,r]=S.useState(!1),i=S.useRef(null),o=S.useRef(null),s=e.isSelected,[c,l]=S.useState(!1),[u,d]=uh(e.src,`anonymous`),[f,p]=S.useState(!1),m=t.activePage===e.page,h=e.page._exportingOrRendering&&d===`loaded`,g=nh(e,t,h);fh(d,e.src,e.id),u&&(u.playsInline=!0);let _=((e,t,n)=>{let r=S.useMemo(()=>{var r,i;let{flipX:a,flipY:o}=e,s=e.type===`svg`||e.src.indexOf(`data:image/svg+xml`)>=0||e.src.indexOf(`.svg`)>=0,c=navigator.userAgent.toLowerCase().indexOf(`firefox`)>-1;if(!(a||o||c&&s))return t;if(!t)return null;let l=t instanceof HTMLVideoElement?t.videoWidth:t?.width,u=t instanceof HTMLVideoElement?t.videoHeight:t?.height;if(!l||!u)return null;let d=rh(),f=1;e.type===`svg`&&(f=Math.max(e.width/l*n,e.height/u*n)),d.width=Math.max(l*f,1),d.height=Math.max(u*f,1);let p=a?-d.width:0,m=o?-d.height:0;return(r=d.getContext(`2d`))==null||r.scale(a?-1:1,o?-1:1),(i=d.getContext(`2d`))==null||i.drawImage(t,p,m,d.width,d.height),d},[e.flipX,e.flipY,t,e.width,e.height,n]);return S.useEffect(()=>()=>{r&&r.nodeName===`CANVAS`&&a.Util.releaseCanvas(r)},[r]),r})(e,u,t._elementsPixelRatio),v=h&&g||_||sh;S.useEffect(()=>{u&&t.history.ignore(()=>{e.set({duration:1e3*u.duration})})},[u]),S.useEffect(()=>{if(!u)return;let n=t.animatedElementsIds,r=(!n.length||n.includes(e.id))&&t.isPlaying,o=m&&(r||c);if(!o){u.pause();return}o&&(u.currentTime=e.startTime*u.duration,u.play());let s=new a.Animation(()=>{ie.current()},i.current?.getLayer());s.start();let d=()=>{l(!1),u.currentTime=e.startTime*u.duration},f=()=>{u.currentTime>=e.endTime*u.duration&&(u.pause(),u.currentTime=e.startTime*u.duration,l(!1))};return u.addEventListener(`ended`,d),u.addEventListener(`timeupdate`,f),()=>{u.pause(),s.stop(),u.removeEventListener(`ended`,d),u.removeEventListener(`timeupdate`,f)}},[u,c,t.isPlaying,m]),S.useEffect(()=>{u&&(u.volume=e.volume)},[u,e.volume]);let y=S.useRef(null);S.useEffect(()=>{let n=$n(()=>{var n;if(u){if(h&&g){L(),t.currentTime;return}let r=t.animatedElementsIds;if(r.length&&!r.includes(e.id))return;let a=t.currentTime>=e.page.startTime&&t.currentTime<e.page.startTime+e.page.duration,o=e.startTime*u.duration*1e3,s=u.duration*(e.endTime-e.startTime)*1e3,c=((t.currentTime||e.page.startTime)-e.page.startTime)%s+o;if(a||(c=0),Math.abs(1e3*u.currentTime-c)>500||!t.isPlaying){let n=c/1e3;n!==u.currentTime&&(u.currentTime=n),!dh(u)&&!t.isPlaying&&!y.current&&(y.current=cc(`video ${e.id}`))}ie.current(),(n=i.current?.getLayer())==null||n.batchDraw()}});return()=>{n(),y.current&&=(y.current(),null)}},[t,u,h,g]),S.useEffect(()=>{var t;if(!u)return;if(h){(t=y.current)==null||t.call(y),y.current=null;return}let n=()=>{var t;!dh(u)&&e.page._exportingOrRendering||(y.current&&=(ie.current(),(t=i.current?.getLayer())==null||t.batchDraw(),y.current(),null))},r;return e.page._exportingOrRendering&&(r=setInterval(n,20)),u.addEventListener(`timeupdate`,n),u.addEventListener(`canplay`,n),()=>{clearInterval(r),u.removeEventListener(`timeupdate`,n),u.removeEventListener(`canplay`,n)}},[e.page._exportingOrRendering,u,e.id,cc,h]);let{cropX:b,cropY:x,cropWidth:C,cropHeight:w}=e;d!==`loaded`&&(b=x=0,C=w=1);let T=(E=v)instanceof HTMLVideoElement?E.videoWidth:E?.width||0;var E;let D=(e=>e instanceof HTMLVideoElement?e.videoHeight:e?.height||0)(v),O=T*C,k=D*w,A=e.width/e.height,j,M,ee=O/k,N=e.type===`svg`;N?(j=O,M=k):A>=ee?(j=O,M=O/A):(j=k*A,M=k);let P={x:T*b,y:D*x,width:j,height:M},te=e.cornerRadius??0,[ne,re]=oh(e,v,P,t._elementsPixelRatio,te,!0),[F,I]=((e,t,n,r)=>{let[i,o]=(0,Ko.default)((e=>{let[t,n]=S.useState(e);return S.useEffect(()=>{(async()=>{let r=await async function(e){return e.indexOf(`data:image/svg+xml`)>=0||e.indexOf(`.svg`)>=0?lp(up(await cp(e))):e}(e);r!==t&&n(r)})()},[e]),t})(e.clipSrc||``),`anonymous`);fh(e.clipSrc?o:`loaded`,e.clipSrc,e.id);let s=S.useMemo(()=>{if(t&&i)return rh()},[t,i]);function c(){var r;if(!i)return;let o=t instanceof HTMLVideoElement?t.videoWidth:t?.width,c=t instanceof HTMLVideoElement?t.videoHeight:t?.height;if(!t||!o||!c||!i||!i.width||!i.height||!s)return;let l=rh(),u=Math.max(e.width/i.width*n,e.height/i.height*n);l.width=i.width*u,l.height=i.height*u,(r=l.getContext(`2d`))==null||r.drawImage(i,0,0,l.width,l.height),s.width=Math.max(o,1),s.height=Math.max(c,1);let d=s.getContext(`2d`);d&&(d.save(),d.drawImage(l,0,0,o,c),a.Util.releaseCanvas(l),d.globalCompositeOperation=`source-in`,d.drawImage(t,0,0,s.width,s.height),d.restore())}return S.useLayoutEffect(()=>{c()},[s,t,i,e.width,e.height,n,...r]),[e.clipSrc&&i?s:t,c]})(e,ne,t._elementsPixelRatio,[P,te,t._elementsPixelRatio]);function L(){var e;re(),I(),(e=i.current?.getLayer())==null||e.batchDraw()}S.useEffect(()=>{L()});let ie=S.useRef(L);ie.current=L;let ae=Math.max(e.width/j,e.height/M);S.useEffect(()=>{if(!e._cropModeEnabled)return;let t=i.current?.getStage();function n(t){e._cropModeEnabled&&t.target!==o.current&&e.toggleCropMode(!1)}function r(n){e._cropModeEnabled&&n.target.parentNode!==t?.content&&e.toggleCropMode(!1)}return document.body.addEventListener(`click`,r),t?.on(`click`,n),t?.on(`tap`,n),()=>{document.body.removeEventListener(`click`,r),document.body.removeEventListener(`touchstart`,r),t?.off(`click`,n),t?.off(`click`,n)}},[e._cropModeEnabled]),S.useLayoutEffect(()=>{if(!n&&!e._cropModeEnabled)return rl(i.current,e),$n(()=>{rl(i.current,e)},{delay:100})},[v,n,C,w,e._cropModeEnabled]),S.useLayoutEffect(()=>{var t;n||e._cropModeEnabled?(t=i.current)==null||t.clearCache():rl(i.current,e)},[n,e.width,e.height,e._cropModeEnabled]),S.useEffect(()=>{rl(i.current,e)},[e.shadowEnabled,e.shadowBlur,e.cornerRadius,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]);let oe=S.useRef(null),se=S.useRef(null),ce=S.useRef(null);S.useLayoutEffect(()=>{e._cropModeEnabled&&(se.current.nodes([oe.current]),ce.current.nodes([o.current]))},[e._cropModeEnabled]);let le=t=>{Math.round(t.target.x())>0&&(t.target.x(0),t.target.scaleX(1)),Math.round(t.target.y())>0&&(t.target.y(0),t.target.scaleY(1));let n=t.target.width()*t.target.scaleX(),r=t.target.height()*t.target.scaleY(),i=Math.min(1,j/n),a=Math.min(1,M/r),o=1-i,s=Math.min(o,Math.max(0,Math.round(-t.target.x())/n)),c=1-a,l=Math.min(c,Math.max(0,Math.round(-t.target.y())/r));t.target.setAttrs({x:-s*T,y:-l*D,scaleX:1,scaleY:1}),e.set({cropX:s,cropY:l,cropWidth:i,cropHeight:a})},ue=()=>{e.type!==`svg`&&e.contentEditable&&setTimeout(()=>{e.toggleCropMode(!0)})},de=d===`loading`,fe=d===`failed`,pe=!de&&!fe,me=S.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),he=pe?e.a.opacity:0;ec(i,he);let ge=e.selectable||t.role===`admin`,_e=il();return S.createElement(S.Fragment,null,S.createElement(Fo,{onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1)},de&&S.createElement(ch,{element:e}),fe&&S.createElement(lh,{element:e}),S.createElement(zo,{ref:i,name:`element`,id:e.id,image:F,x:e.a.x,y:e.a.y,width:e.a.width||1,height:e.a.height||1,rotation:e.a.rotation,opacity:he,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:P,listening:ge,draggable:_e?e.draggable&&s:e.draggable,preventDefault:!_e||s,hideInExport:!e.showInExport,onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDblClick:ue,onDblTap:ue,onTransformStart:()=>{r(!0),me.current={cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}},onTransform:t=>{let n=t.currentTarget,r=Math.abs(n.scaleX()-1)<1e-7?1:n.scaleX(),i=Math.abs(n.scaleY()-1)<1e-7?1:n.scaleY();n.scaleX(1),n.scaleY(1);let a=t.target.getStage()?.findOne(`Transformer`),o=1-j/T,s=Math.min(o,Math.max(0,e.cropX)),c=1-M/D,l=Math.min(c,Math.max(0,e.cropY)),u=a.getActiveAnchor(),d=!(u.indexOf(`middle`)>=0||u.indexOf(`center`)>=0),f=!d&&r<1&&me.current.cropHeight>M/D,p=d?e.cropWidth:e.cropWidth*r;f&&(p=e.cropWidth);let m=!d&&i<1&&me.current.cropWidth>j/T,h=d?e.cropHeight:e.cropHeight*i;m&&(h=e.cropHeight),N&&(p=e.cropWidth,h=e.cropHeight),e.set({cropX:s,cropY:l,x:n.x(),y:n.y(),width:n.width()*r,height:n.height()*i,rotation:t.target.rotation(),cropWidth:Math.min(p,1-s),cropHeight:Math.min(h,1-l)})},onTransformEnd:t=>{let n=t.currentTarget;e.set({width:n.width(),height:n.height(),x:n.x(),y:n.y(),rotation:t.target.rotation(),cropWidth:j/T,cropHeight:M/D}),r(!1)}}),S.createElement(Lo,{x:e.a.x,y:e.a.y,width:Math.max(e.a.width-e.borderSize,0),height:Math.max(e.a.height-e.borderSize,0),opacity:he,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2,stroke:e.borderColor,strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,te-e.borderSize),hideInExport:!e.showInExport}),!t.isPlaying&&S.createElement(`Image`,{image:c?f||_e?ah:void 0:ih,x:e.a.x,y:e.a.y,offsetX:-e.a.width/2+15/t.scale,offsetY:-e.a.height/2+15/t.scale,rotation:e.a.rotation,width:30/t.scale,height:30/t.scale,hideInExport:!0,onClick:()=>l(!c),onTap:()=>l(!c)}),e._cropModeEnabled&&S.createElement(Cs,{selector:`.page-abs-container`,enabled:!0},S.createElement(`Rect`,{x:-window.innerWidth/t.scale,y:-window.innerWidth/t.scale,width:window.innerWidth/t.scale*3,height:window.innerWidth/t.scale*3,fill:`rgba(0,0,0,0.3)`}),S.createElement(`Image`,{listening:!1,image:F,x:e.a.x,y:e.a.y,width:e.a.width,height:e.a.height,rotation:e.a.rotation,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur}),S.createElement(`Group`,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,scaleX:ae,scaleY:ae},S.createElement(`Image`,{image:v,ref:o,width:T,height:D,opacity:.4,draggable:!0,x:-e.cropX*T,y:-e.cropY*D,onDragMove:le,onTransform:le}),S.createElement(`Transformer`,{ref:ce,anchorSize:20,enabledAnchors:[`top-left`,`top-right`,`bottom-left`,`bottom-right`],boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),S.createElement(`Rect`,{width:j,height:M,ref:oe,listening:!1,onTransform:t=>{t.target.x()<-e.cropX*T-1e-9&&(t.target.x(-e.cropX*T),t.target.scaleX(1)),t.target.y()<-e.cropY*D-1e-9&&(t.target.y(-e.cropY*D),t.target.scaleY(1));let n=Math.min(1,Math.max(0,e.cropX+t.target.x()/T)),r=Math.min(1,Math.max(0,t.target.y()/D+e.cropY)),i=t.target.width()*t.target.scaleX(),a=t.target.height()*t.target.scaleY(),o=Math.min(1-n,i/T),s=Math.min(1-r,a/D),c=t.target.getAbsolutePosition(t.target.getParent().getParent());t.target.scale({x:1,y:1}),t.target.position({x:0,y:0}),e.set({x:c.x,y:c.y,cropX:n,cropY:r,cropWidth:o,cropHeight:s,width:Math.min(i*ae,T*(1-n)*ae),height:Math.min(a*ae,D*(1-r)*ae)})}}),S.createElement(`Transformer`,{ref:se,enabledAnchors:[`top-left`,`top-right`,`bottom-left`,`bottom-right`],boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,keepRatio:!1,rotateEnabled:!1,anchorFill:`rgb(240, 240, 240)`,anchorStrokeWidth:2,borderStrokeWidth:2,visible:e.resizable})))))}),mh=({width:e,height:t,cornerRadius:n})=>{if(n>0){let r=Math.min(n,e/2,t/2);return`M 0 ${r} A ${r} ${r} 0 0 1 ${r} 0 L ${e-r} 0 A ${r} ${r} 0 0 1 ${e} ${r} L ${e} ${t-r} A ${r} ${r} 0 0 1 ${e-r} ${t} L ${r} ${t} A ${r} ${r} 0 0 1 0 ${t-r} Z`}return`M 0 0 L ${e} 0 L ${e} ${t} L 0 ${t} Z`},hh=({width:e,height:t})=>`M ${e/2} 0 L ${e} ${t} L 0 ${t} Z`,gh=({width:e,height:t})=>`M 0 0 L ${e} 0 L 0 ${t} Z`,_h=({width:e,height:t})=>`M ${e/2} ${t/2} m -${e/2}, 0 a ${e/2},${t/2} 0 1,0 ${e},0 a ${e/2},${t/2} 0 1,0 -${e},0`;function vh({width:e,height:t}){let n=e/2,r=t/2,i=e/2,a=t/2,o=i/2,s=a/2,c=``,l=Math.PI/5;for(let e=0;e<10;e++){let t=e%2==0?a:s,u=n+(e%2==0?i:o)*Math.sin(e*l),d=r-t*Math.cos(e*l);e===0?c=`M ${u} ${d}`:c+=` L ${u} ${d}`}return c+` Z`}function yh({width:e,height:t}){let n=e/2,r=t/2;return`M ${n} 0 L ${e} ${r} L ${n} ${t} L 0 ${r} Z`}function bh({width:e,height:t}){let n=e/2,r=t/2,i=e/2,a=t/2,o=``,s=2*Math.PI/5;for(let e=0;e<5;e++){let t=a,c=n+i*Math.sin(e*s),l=r-t*Math.cos(e*s);e===0?o=`M ${c} ${l}`:o+=` L ${c} ${l}`}return o+` Z`}function xh({width:e,height:t}){let n=e/2,r=t/2,i=e/2,a=t/2,o=``,s=2*Math.PI/6;for(let e=0;e<6;e++){let t=a,c=n+i*Math.sin(e*s),l=r-t*Math.cos(e*s);e===0?o=`M ${c} ${l}`:o+=` L ${c} ${l}`}return o+` Z`}function Q({path:e,aspectRatio:t,width:n,height:r}){return{path:e,scaleX:n/t.width,scaleY:r/t.height}}function Sh({width:e,height:t}){let n=.1*Math.min(e,t),r=.2*e,i=.2*t,a=.5*e,o=`M ${n},0`;return o+=` H `+(e-n),o+=` A ${n},${n} 0 0 1 ${e},${n}`,o+=` V `+(t-n-i),o+=` A ${n},${n} 0 0 1 ${e-n},${t-i}`,o+=` H ${a+r/2}`,o+=` L ${a},${t}`,o+=` L ${a-r/2},${t-i}`,o+=` H ${n}`,o+=` A ${n},${n} 0 0 1 0,${t-n-i}`,o+=` V ${n}`,o+=` A ${n},${n} 0 0 1 ${n},0`,o+=` Z`,o}function Ch({width:e,height:t}){let n=.3*e,r=.3*t,i=e/2,a=t/2,o=i-n/2,s=i+n/2,c=a-r/2,l=a+r/2,u=`M ${o},0 `;return u+=`H ${s} `,u+=`V ${c} `,u+=`H ${e} `,u+=`V ${l} `,u+=`H ${s} `,u+=`V ${t} `,u+=`H ${o} `,u+=`V ${l} `,u+=`H 0 `,u+=`V ${c} `,u+=`H ${o} `,u+=`V 0 `,u+=`Z`,u}var wh={rect:mh,circle:_h,star:vh,triangle:hh,rightTriangle:gh,diamond:yh,pentagon:bh,hexagon:xh,speechBubble:Sh,cross:Ch,arc:({width:e,height:t})=>Q({path:`M234 117C234 85.97 221.673 56.21 199.731 34.269C177.79 12.327 148.03 0 117 0C85.97 0 56.2103 12.327 34.2685 34.268C12.3268 56.21 0 85.97 0 117H117H234Z`,aspectRatio:{width:234,height:117},width:e,height:t}),cloud:({width:e,height:t})=>Q({path:`M216.41 57.006C216.961 54.084 217.249 51.069 217.249 47.986C217.249 21.4841 195.972 0 169.725 0C153.666 0 139.467 8.043 130.865 20.3575C122.606 13.3566 111.954 9.1402 100.327 9.1402C74.3322 9.1402 53.2123 30.2136 52.8094 56.364H52.8035C23.6407 56.364 0 80.235 0 109.682C0 139.129 23.6407 163 52.8035 163H208.197C237.359 163 261 139.129 261 109.682C261 83.056 241.672 60.99 216.41 57.006Z`,aspectRatio:{width:261,height:163},width:e,height:t}),rightArrow:({width:e,height:t})=>{let n=.6*e;return`M 0 ${t/4} L ${n} ${t/4} L ${n} 0 L ${e} ${t/2} L ${n} ${t} L ${n} ${.75*t} L 0 ${.75*t} Z`},leftArrow:({width:e,height:t})=>{let n=.4*e;return`M ${e} ${t/4} L ${n} ${t/4} L ${n} 0 L 0 ${t/2} L ${n} ${t} L ${n} ${.75*t} L ${e} ${.75*t} Z`},downArrow:({width:e,height:t})=>{let n=.6*t;return`M ${e/4} 0 L ${e/4} ${n} L 0 ${n} L ${e/2} ${t} L ${e} ${n} L ${.75*e} ${n} L ${.75*e} 0 Z`},upArrow:({width:e,height:t})=>{let n=.4*t;return`M ${e/4} ${t} L ${e/4} ${n} L 0 ${n} L ${e/2} 0 L ${e} ${n} L ${.75*e} ${n} L ${.75*e} ${t} Z`},asterisk1:({width:e,height:t})=>Q({path:`M45.5265 218.498C51.5466 222.87 58.5359 224.98 65.4742 224.98C75.916 224.98 86.221 220.2 92.853 211.217C92.872 211.198 92.89 211.178 92.907 211.157C92.923 211.136 92.939 211.115 92.954 211.094L92.977 211.061C92.993 211.039 93.008 211.017 93.023 210.996L116.491 178.725L139.959 210.996C139.982 211.031 140.006 211.058 140.029 211.088C140.04 211.102 140.05 211.116 140.061 211.132C151.115 226.188 172.355 229.505 187.473 218.515C202.608 207.526 205.992 186.278 195.074 171.104L195.05 171.066C195.03 171.034 195.014 171.01 194.989 170.985L171.572 138.696L209.512 126.346C227.334 120.545 237.129 101.305 231.33 83.476C225.532 65.648 206.315 55.8493 188.476 61.6334L150.537 73.933L150.52 34.0064C150.502 15.2594 135.248 0 116.508 0C97.768 0 82.514 15.2594 82.497 34.0234L82.463 73.916L44.5233 61.6163C44.5083 61.6163 44.49 61.613 44.4716 61.6078C44.4477 61.6014 44.4232 61.5918 44.4041 61.5823C26.5992 55.8664 7.45076 65.665 1.66886 83.46C-4.11314 101.254 5.61427 120.426 23.3511 126.278C23.3675 126.283 23.3822 126.289 23.3963 126.295L23.4588 126.319L23.4873 126.329L61.4098 138.679L37.9929 170.968C37.9844 170.985 37.9718 171.002 37.9591 171.019C37.9462 171.036 37.9336 171.053 37.9251 171.07C26.9903 186.244 30.3915 207.509 45.5265 218.498Z`,aspectRatio:{width:233,height:225},width:e,height:t}),asterisk2:({width:e,height:t})=>Q({path:`M46.0556 112L0 85.388L33.9456 26.6121L80.028 53.1781L80.054 0H147.946L147.972 53.1781L194.054 26.6121L228 85.388L181.944 112L228 138.612L194.054 197.388L147.972 170.822L147.946 224H80.054L80.028 170.822L33.9456 197.388L0 138.612L46.0556 112Z`,aspectRatio:{width:228,height:224},width:e,height:t}),bookmark:({width:e,height:t})=>Q({path:`M0 0H199V238L99.5 142.8L0 238V0Z`,aspectRatio:{width:199,height:238},width:e,height:t}),butterfly:({width:e,height:t})=>Q({path:`M94.5 100.713C91.935 150.916 50.703 190.909 0 191.493V0C50.703 0.5845 91.935 40.5767 94.5 90.78C97.031 41.2385 137.217 1.6407 187 0.0438004V191.45C137.217 189.853 97.031 150.255 94.5 100.713Z`,aspectRatio:{width:187,height:192},width:e,height:t}),cylinder:({width:e,height:t})=>Q({path:`M169 36.8497V218.15C169 238.502 131.168 255 84.5 255C37.832 255 0 238.502 0 218.15V36.8497C0 16.4982 37.832 0 84.5 0C131.168 0 169 16.4982 169 36.8497Z`,aspectRatio:{width:169,height:255},width:e,height:t}),diamond2:({width:e,height:t})=>Q({path:`M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z`,aspectRatio:{width:248,height:185},width:e,height:t}),door:({width:e,height:t})=>Q({path:`M140 69.697C140 31.2044 108.66 0 70 0C31.34 0 0 31.2044 0 69.697V207H140V69.697Z`,aspectRatio:{width:140,height:207},width:e,height:t}),drop1:({width:e,height:t})=>Q({path:`M167 150.687C167 196.328 129.407 234 83.139 234C37.593 234 0 196.328 0 150.687C0 100.7 51.329 36.9474 83.139 0C114.948 39.1207 167 98.526 167 150.687Z`,aspectRatio:{width:167,height:234},width:e,height:t}),drop2:({width:e,height:t})=>Q({path:`M73 239C53.64 239 35.071 231.315 21.3812 217.634C7.691 203.954 0 185.4 0 166.054C0 136.091 13.8696 113.633 30.768 86.27C43.912 64.9877 58.888 40.7377 70.597 7.6816C71.281 5.7496 72.989 0 72.989 0C72.989 0 72.993 0.0124998 73 0.0363998C73.007 0.0124998 73.011 0 73.011 0C73.011 0 74.719 5.7496 75.403 7.6816C87.112 40.7377 102.088 64.9877 115.232 86.27C132.13 113.633 146 136.091 146 166.054C146 185.4 138.309 203.954 124.619 217.634C111.025 231.218 92.225 239 73 239Z`,aspectRatio:{width:146,height:239},width:e,height:t}),explosion:({width:e,height:t})=>Q({path:`M165.802 184.465L118.997 260L125.343 182.079L34.9058 219.45L99.164 159.817L0 163.792L78.538 134.373L0 74.7401L86.471 89.052V0L118.997 89.052L165.802 10.3364L149.143 97.798L217.368 29.419L165.802 112.905L245.927 81.101L165.802 143.914H261L165.802 184.465Z`,aspectRatio:{width:261,height:260},width:e,height:t}),flag:({width:e,height:t})=>Q({path:`M0 142.161C0 142.161 51.9956 118.626 103 137.469C159.992 158.525 206 141.31 206 141.31V11.1373C206 11.1373 160 28.3218 103.016 7.28273C52 -11.553 0 12.0974 0 12.0974V142.161Z`,aspectRatio:{width:206,height:148},width:e,height:t}),flower:({width:e,height:t})=>Q({path:`M135.351 66.1893C196.683 -5.00591 256.536 100.304 164.908 117.361C256.536 135.16 195.944 239.728 135.351 168.532C166.386 257.526 45.9394 256.785 76.975 168.532C15.643 239.728 -44.2109 135.16 47.4173 117.361C-44.9498 100.304 15.643 -4.26431 76.975 66.1893C45.2005 -22.0631 166.386 -22.0631 135.351 66.1893ZM105.793 104.012C113.183 104.012 119.833 109.945 119.833 117.361C119.833 124.777 113.183 131.452 105.793 131.452C98.404 131.452 92.492 124.777 92.492 117.361C92.492 109.945 98.404 104.012 105.793 104.012Z`,aspectRatio:{width:212,height:235},width:e,height:t}),frame:({width:e,height:t})=>Q({path:`M0 0H240L200 88L240 176H0L40 88L0 0Z`,aspectRatio:{width:240,height:176},width:e,height:t}),heart1:({width:e,height:t})=>Q({path:`M215.886 56.157C215.886 24.729 191.112 0 160.584 0C135.933 0 115.08 16.983 107.937 39.93C100.788 16.986 79.935 0.591 55.284 0.591C24.75 0.591 0 24.615 0 56.055C0 71.919 6.321 83.127 16.494 95.121L107.988 189.447L199.377 95.121C209.559 83.127 215.886 72.009 215.886 56.157Z`,aspectRatio:{width:216,height:190},width:e,height:t}),home:({width:e,height:t})=>Q({path:`M0 62.143L95.5 0L191 62.143V195H0V62.143Z`,aspectRatio:{width:191,height:195},width:e,height:t}),home2:({width:e,height:t})=>Q({path:`M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z`,aspectRatio:{width:206,height:189},width:e,height:t}),hourglass:({width:e,height:t})=>Q({path:`M0.392782 0H187.607C193.014 43.3688 140.804 53.797 140.804 97.5C140.804 141.203 193.014 151.631 187.607 195H0.392782C-5.01452 151.631 47.196 141.203 47.196 97.5C47.196 53.797 -5.01452 43.3688 0.392782 0Z`,aspectRatio:{width:188,height:195},width:e,height:t}),house:({width:e,height:t})=>Q({path:`M0 92.367L95 0L190 92.367V223H0V92.367Z`,aspectRatio:{width:190,height:223},width:e,height:t}),keyhole:({width:e,height:t})=>Q({path:`M115 57.0494C115 25.5387 89.416 0 57.863 0C26.311 0 0.726898 25.5414 0.726898 57.0494C0.726898 78.652 12.759 97.451 30.505 107.136L0 219H114.845L84.448 107.524C102.608 97.962 115 78.959 115 57.0494Z`,aspectRatio:{width:115,height:219},width:e,height:t}),kiss:({width:e,height:t})=>Q({path:`M124.5 17.1468C80.036 -36.5162 0 52.9218 0 52.9218C0 52.9218 44.4643 120 124.5 120C204.536 120 249 52.9218 249 52.9218C249 52.9218 168.964 -36.5162 124.5 17.1468Z`,aspectRatio:{width:249,height:120},width:e,height:t}),leaf:({width:e,height:t})=>Q({path:`M204.414 0.0151567C204.414 0.0151567 206.837 93.9509 150.394 150.394C93.9507 206.837 0.0151569 204.413 0.0151569 204.413C0.0151569 204.413 -2.40835 110.478 54.0347 54.0349C110.478 -2.40834 204.414 0.0151567 204.414 0.0151567Z`,aspectRatio:{width:205,height:205},width:e,height:t}),lightning1:({width:e,height:t})=>Q({path:`M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z`,aspectRatio:{width:143,height:253},width:e,height:t}),lightning2:({width:e,height:t})=>Q({path:`M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z`,aspectRatio:{width:126,height:227},width:e,height:t}),magnet:({width:e,height:t})=>Q({path:`M88.402 0H0V67.669H88.402C105.271 67.669 118.957 81.308 118.957 98C118.957 114.689 105.271 128.331 88.402 128.331H0V196H88.402C142.747 196 187 152.072 187 98C187 43.9279 142.747 0 88.402 0Z`,aspectRatio:{width:187,height:196},width:e,height:t}),mithosis:({width:e,height:t})=>Q({path:`M150.996 136.45C137.141 128.926 117.559 128.7 103.532 135.896C93.843 140.867 82.875 143.67 71.2577 143.67C31.9033 143.67 0 111.508 0 71.835C0 32.161 31.9033 0 71.2577 0C83.467 0 94.959 3.0955 105.004 8.5504C118.859 16.0745 138.441 16.3 152.467 9.1038C162.157 4.1328 173.125 1.3303 184.742 1.3303C224.097 1.3303 256 33.492 256 73.165C256 112.839 224.097 145 184.742 145C172.533 145 161.041 141.905 150.996 136.45Z`,aspectRatio:{width:256,height:145},width:e,height:t}),orangeRicky:({width:e,height:t})=>Q({path:`M69 0H0V69V138V207H69H138V138H69V69V0Z`,aspectRatio:{width:138,height:207},width:e,height:t}),party:({width:e,height:t})=>Q({path:`M134.622 0L144.682 68.2539L174.415 5.9977L163.91 74.1846L210.671 23.4578L180.535 85.519L240.169 50.8289L193.079 101.25L260.29 85.679L200.43 119.98L269.245 124.911L201.934 140.044L266.237 165.04L197.456 159.661L251.535 202.5L187.396 177.086L226.445 233.962L172.646 190.771L193.197 256.631L154.518 199.501L154.743 268.492L134.622 202.5L114.501 268.492L114.727 199.501L76.0482 256.631L96.5985 190.771L42.7992 233.962L81.8489 177.086L17.7091 202.5L71.7885 159.661L3.0072 165.04L67.3112 140.044L0 124.911L68.8149 119.98L8.9545 85.679L76.1658 101.25L29.0753 50.8289L88.7105 85.519L58.5743 23.4578L105.335 74.1846L94.8305 5.9977L124.562 68.2539L134.622 0Z`,aspectRatio:{width:270,height:269},width:e,height:t}),pillow:({width:e,height:t})=>Q({path:`M176 0.00169945C157.812 16.9062 125.203 28.174 88.001 28.174C50.798 28.174 18.1881 16.9054 0 0V258.421C18.1882 241.516 50.798 230.248 88 230.248C125.202 230.248 157.812 241.516 176 258.421V0.00169945Z`,aspectRatio:{width:176,height:259},width:e,height:t}),polygon:({width:e,height:t})=>Q({path:`M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z`,aspectRatio:{width:220,height:252},width:e,height:t}),rainbow:({width:e,height:t})=>Q({path:`M186.907 141H282C282 63.128 218.872 0 141 0C63.1278 0 0 63.128 0 141H95.093C95.093 115.646 115.646 95.093 141 95.093C166.354 95.093 186.907 115.646 186.907 141Z`,aspectRatio:{width:282,height:141},width:e,height:t}),rhodeIsland:({width:e,height:t})=>Q({path:`M69 0H0V69V138H69V207H138V138V69H69V0Z`,aspectRatio:{width:138,height:207},width:e,height:t}),shell:({width:e,height:t})=>Q({path:`M109 0C169.199 0 218 48.743 218 108.87C185.392 108.87 158.958 135.273 158.958 167.842C158.958 179.736 158.958 191 158.958 191H59.042C59.042 191 59.042 179.736 59.042 167.842C59.042 135.273 32.6077 108.87 0 108.87C0 48.743 48.8007 0 109 0Z`,aspectRatio:{width:218,height:191},width:e,height:t}),shield1:({width:e,height:t})=>Q({path:`M203.184 30.7277C142.457 30.7277 102.853 0 102.853 0C102.853 0 63.249 30.7277 3.05098 30.7277C3.05098 30.7277 -3.81372 128.209 3.05098 162.115C9.38758 193.902 102.853 249 102.853 249C102.853 249 196.319 193.902 203.184 162.115C209.52 128.738 203.184 30.7277 203.184 30.7277Z`,aspectRatio:{width:206,height:249},width:e,height:t}),shield2:({width:e,height:t})=>Q({path:`M0 12.9585C64.624 -4.3195 136.376 -4.3195 201 12.9585C201 51.0564 201 89.154 201 127.252C201 184.396 100.498 240 100.498 240C100.498 240 0 184.406 0 127.252C0 89.154 0 51.0564 0 12.9585Z`,aspectRatio:{width:201,height:240},width:e,height:t}),skewedRectangle:({width:e,height:t})=>Q({path:`M85.9799 0H290L204.02 141H0L85.9799 0Z`,aspectRatio:{width:290,height:141},width:e,height:t}),softFlower:({width:e,height:t})=>Q({path:`M109 0C80.073 0 56.6234 23.4498 56.6234 52.3766C56.6234 54.722 54.722 56.6234 52.3766 56.6234C23.4498 56.6234 0 80.073 0 109C0 137.927 23.4498 161.377 52.3766 161.377C54.722 161.377 56.6234 163.278 56.6234 165.623C56.6234 194.55 80.073 218 109 218C137.927 218 161.377 194.55 161.377 165.623C161.377 163.278 163.278 161.377 165.623 161.377C194.55 161.377 218 137.927 218 109C218 80.073 194.55 56.6234 165.623 56.6234C163.278 56.6234 161.377 54.722 161.377 52.3766C161.377 23.4498 137.927 0 109 0Z`,aspectRatio:{width:218,height:218},width:e,height:t}),softStar:({width:e,height:t})=>Q({path:`M130.424 3.17662C130.927 -1.05888 137.073 -1.05888 137.576 3.17662L141.792 38.7086C147.236 84.59 183.41 120.764 229.291 126.208L264.823 130.424C269.059 130.927 269.059 137.073 264.823 137.576L229.291 141.792C183.41 147.236 147.236 183.41 141.792 229.291L137.576 264.823C137.073 269.059 130.927 269.059 130.424 264.823L126.208 229.291C120.764 183.41 84.59 147.236 38.7086 141.792L3.17662 137.576C-1.05888 137.073 -1.05888 130.927 3.17662 130.424L38.7086 126.208C84.59 120.764 120.764 84.59 126.208 38.7086L130.424 3.17662Z`,aspectRatio:{width:268,height:268},width:e,height:t}),stairs1:({width:e,height:t})=>Q({path:`M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z`,aspectRatio:{width:203,height:203},width:e,height:t}),stairs2:({width:e,height:t})=>Q({path:`M50 0H0V200H200V150H150V100H100V50H50V0Z`,aspectRatio:{width:200,height:200},width:e,height:t}),teewee:({width:e,height:t})=>Q({path:`M69 0H138V69H207V138H138H69H0V69H69V0Z`,aspectRatio:{width:207,height:138},width:e,height:t}),blob1:({width:e,height:t})=>Q({path:`M172.979 19.611C191.285 33.0858 204.505 54.442 210.861 78.5949C217.471 103.002 217.471 130.46 205.776 151.816C194.335 173.427 171.454 189.444 147.047 196.054C122.639 202.919 96.7069 200.631 75.3506 190.715C54.2486 180.546 37.7229 163.003 23.4855 142.155C9.5022 121.307 -2.19289 97.4087 0.349524 74.7813C3.14617 52.1538 19.9261 30.7976 40.2654 17.8313C60.6046 4.61077 84.5033 -0.474048 108.148 0.0344341C131.538 0.542916 154.928 6.13621 172.979 19.611Z`,aspectRatio:{width:216,height:200},width:e,height:t}),blob10:({width:e,height:t})=>Q({path:`M188.684 8.95173C205.601 24.3309 200.988 63.0866 191.453 99.3816C182.225 135.677 168.076 169.511 146.238 175.355C124.399 181.507 94.871 159.668 66.5733 143.059C37.9679 126.449 10.5929 115.068 2.59569 95.0754C-5.4015 75.0824 5.97912 46.1694 24.4342 30.4826C42.8893 14.7958 68.4188 12.0276 100.715 6.79864C132.704 1.5697 171.767 -6.42749 188.684 8.95173Z`,aspectRatio:{width:200,height:177},width:e,height:t}),blob11:({width:e,height:t})=>Q({path:`M137.368 29.4923C148.97 46.7605 146.542 72.1231 148.161 99.1046C149.779 126.086 155.715 154.956 144.113 174.383C132.781 193.81 103.911 203.793 80.4369 198.666C56.963 193.27 38.6156 173.034 28.3626 153.607C17.8398 134.181 15.4115 115.833 9.47555 91.5498C3.53961 67.2664 -5.63411 37.3169 4.61887 20.0488C15.1417 2.51078 45.0911 -1.80626 72.8821 0.622074C100.673 2.78059 126.036 12.2241 137.368 29.4923Z`,aspectRatio:{width:152,height:200},width:e,height:t}),blob12:({width:e,height:t})=>Q({path:`M158.391 17.923C172.491 28.5703 180.261 48.1384 187.743 70.5842C194.937 93.3177 202.419 118.641 194.649 138.785C187.167 158.928 164.146 173.317 138.535 184.54C112.923 196.05 84.4347 204.108 58.8235 197.777C33.2123 191.446 10.191 170.439 2.99688 146.267C-4.48504 121.807 3.57241 94.181 10.4788 68.282C17.0974 42.0953 22.565 17.6352 37.8166 7.27563C53.0682 -3.37171 78.1038 0.081487 100.837 2.67138C123.859 5.26127 144.29 7.27563 158.391 17.923Z`,aspectRatio:{width:198,height:200},width:e,height:t}),blob13:({width:e,height:t})=>Q({path:`M149.668 1.37595C170.663 5.22017 193.728 17.3442 198.755 34.7911C204.078 52.2379 191.363 75.3032 178.943 93.9329C166.819 112.563 154.99 126.757 140.501 145.386C126.011 164.312 108.86 187.673 92.5957 186.194C76.3317 185.011 60.9549 159.285 45.8737 140.655C30.4968 122.321 15.7114 110.788 7.43151 95.1157C-0.848339 79.4432 -2.32688 59.0392 3.5873 41.5924C9.50148 23.8498 23.1041 8.76868 38.7767 3.44592C54.745 -1.87685 73.3746 2.55879 91.7086 2.26308C110.338 2.26308 128.968 -2.17256 149.668 1.37595Z`,aspectRatio:{width:200,height:187},width:e,height:t}),blob14:({width:e,height:t})=>Q({path:`M137.838 28.6426C150.711 40.5617 165.014 46.5213 178.363 58.2021C191.474 69.8828 203.87 87.0464 198.864 99.6807C193.858 112.315 171.689 120.42 157.862 135.676C144.275 151.171 139.269 173.579 126.873 182.161C114.477 190.505 94.9294 185.022 76.8123 178.109C58.4568 171.196 41.5316 163.091 28.1822 150.456C14.5943 137.822 4.58225 120.42 1.24488 101.826C-2.09248 83.2322 1.00651 62.9697 13.8792 52.4809C26.7519 41.992 49.1598 41.0385 65.6083 30.788C82.0567 20.5376 92.0688 0.990158 103.034 0.0366268C113.762 -0.916905 125.204 16.9618 137.838 28.6426Z`,aspectRatio:{width:200,height:187},width:e,height:t}),blob15:({width:e,height:t})=>Q({path:`M185.203 1.52939C197.679 7.62217 200 32.2835 200 51.7223C200 71.1612 197.389 85.3777 197.679 100.175C198.259 114.681 201.741 129.768 198.259 143.114C194.778 156.46 184.623 168.356 171.567 173.868C158.801 179.671 143.134 179.091 130.368 174.739C117.312 170.387 106.867 162.263 86.8482 160.812C66.539 159.362 36.9454 164.294 18.9572 155.3C0.968966 146.306 -5.41395 123.095 5.03083 105.977C15.4756 88.5692 42.4579 77.5442 55.5139 59.5559C68.2798 41.8578 67.1192 17.4867 76.9837 9.6531C86.5581 2.10965 107.158 11.3939 128.627 9.6531C150.097 8.20244 172.728 -4.27327 185.203 1.52939Z`,aspectRatio:{width:200,height:179},width:e,height:t}),blob16:({width:e,height:t})=>Q({path:`M158.441 55.3221C167.253 80.2399 160.264 105.462 147.501 134.938C134.738 164.717 116.81 199.055 97.0576 199.967C77.3057 201.182 55.7305 168.668 34.4592 133.722C13.1879 99.0802 -7.77953 62.3112 2.85612 36.4818C13.4918 10.6523 56.0344 -3.93369 90.0685 0.928322C123.799 6.09421 149.324 30.7081 158.441 55.3221Z`,aspectRatio:{width:163,height:200},width:e,height:t}),blob17:({width:e,height:t})=>Q({path:`M168.917 36.7587C178.871 53.2457 175.138 76.5764 172.961 106.129C170.472 135.37 169.85 170.832 150.563 187.63C131.276 204.739 93.3252 203.495 65.0173 187.63C36.7095 172.077 18.0449 142.213 7.77943 107.373C-2.79714 72.2213 -4.35252 32.7147 14.312 14.0502C32.9765 -4.3033 72.1721 -1.50361 103.591 4.7179C135.32 10.6283 158.962 20.2717 168.917 36.7587Z`,aspectRatio:{width:176,height:200},width:e,height:t}),blob18:({width:e,height:t})=>Q({path:`M178.188 21.1464C193.012 36.3069 196.381 62.9219 198.739 88.1893C200.76 113.12 201.771 136.366 190.316 149.168C178.862 162.307 155.279 164.665 135.065 167.697C115.188 170.73 99.0168 174.098 72.4018 177.131C46.1237 180.163 9.40176 182.521 1.65309 168.371C-6.09559 154.221 15.4659 123.564 23.5515 92.9059C31.6371 62.2481 26.2467 31.2534 38.3751 15.4192C50.1665 -0.0781831 79.8136 -1.08888 107.776 0.595609C136.076 1.9432 163.028 5.64909 178.188 21.1464Z`,aspectRatio:{width:200,height:180},width:e,height:t}),blob19:({width:e,height:t})=>Q({path:`M148.621 13.3857C171.945 24.3818 194.937 41.3756 192.938 60.702C190.605 80.3615 163.282 101.687 149.953 123.346C136.958 145.005 137.958 166.664 128.295 174.661C118.631 182.325 98.3054 175.994 73.6476 181.991C48.9899 187.989 20.0004 205.983 11.0036 197.986C1.67366 189.989 12.6697 156.001 12.3365 131.343C12.0033 106.685 0.340809 91.0243 0.00759636 75.0301C-0.325616 59.0359 10.3372 42.3753 25.3318 28.7135C39.9931 15.0518 58.9863 4.05578 80.3119 1.05687C101.638 -2.27526 124.962 2.38972 148.621 13.3857Z`,aspectRatio:{width:194,height:200},width:e,height:t}),blob2:({width:e,height:t})=>Q({path:`M140.464 18.6393C156.081 28.3718 169.887 39.9149 178.714 54.853C187.541 69.5649 191.389 87.6717 189.578 104.421C187.768 121.396 180.525 137.239 172.377 153.535C164.455 169.832 155.854 186.58 142.048 194.276C128.241 201.971 109.456 200.613 92.4804 197.671C75.2789 194.502 60.1144 189.749 45.1762 182.733C30.4644 175.716 16.2052 166.21 8.28346 153.083C0.361703 139.729 -1.44898 122.527 1.04072 106.91C3.30408 91.2931 9.64147 76.8076 15.9789 60.5114C22.0899 44.2153 28.201 26.1084 40.6495 14.7916C53.0979 3.24849 71.8838 -1.27823 89.7643 0.306124C107.871 1.66414 124.846 9.13322 140.464 18.6393Z`,aspectRatio:{width:191,height:200},width:e,height:t}),blob20:({width:e,height:t})=>Q({path:`M150.035 13.2464C157.376 24.9386 153.026 48.323 157.92 65.7254C163.087 83.1277 177.498 94.2761 182.392 108.415C187.287 122.555 182.392 139.957 173.147 156.272C163.63 172.587 149.763 187.814 132.089 195.155C114.414 202.225 93.2053 201.137 73.6276 194.611C54.3219 188.357 36.9196 176.937 25.7712 161.438C14.8947 145.667 10.5441 126.09 5.92163 105.696C1.57105 85.0311 -3.05145 63.5501 2.65869 45.0601C8.64075 26.5701 24.6835 11.0711 43.1735 4.54524C61.6635 -1.98064 82.6007 0.194657 102.722 1.01039C122.844 1.82613 142.421 1.55421 150.035 13.2464Z`,aspectRatio:{width:185,height:200},width:e,height:t}),blob21:({width:e,height:t})=>Q({path:`M152.611 0.184799C172.596 -0.723643 197.73 1.39606 199.85 13.8114C201.969 26.2268 181.075 48.9379 174.716 68.0151C168.357 87.0924 176.533 102.536 174.11 114.649C171.991 127.064 159.575 136.148 146.252 139.782C132.928 143.719 118.696 141.902 105.977 139.176C93.562 136.451 82.6606 132.212 63.2805 131.909C43.9004 131.606 16.0416 135.24 5.44306 125.853C-5.15543 116.465 1.50648 94.0572 10.2881 76.4939C18.7669 59.2335 29.6682 46.8182 38.7526 35.3112C48.1398 23.5015 56.3158 12.903 66.9143 8.36078C77.5128 4.12138 91.1394 6.24108 104.766 5.63546C118.696 4.72701 132.928 1.09324 152.611 0.184799Z`,aspectRatio:{width:200,height:143},width:e,height:t}),blob22:({width:e,height:t})=>Q({path:`M195.507 15.5715C206.818 33.1668 193.622 69.3001 190.166 101.663C186.71 134.34 193.308 163.561 181.996 178.014C170.685 192.153 141.464 191.525 114.443 189.326C87.1072 187.44 62.2852 183.67 40.6052 169.531C19.2395 155.077 1.6441 130.255 0.0730908 103.862C-1.18372 77.4694 13.898 49.5054 35.2638 31.91C56.6296 14.0004 84.5936 6.45958 116.328 2.37494C148.063 -1.70969 184.196 -2.3381 195.507 15.5715Z`,aspectRatio:{width:200,height:191},width:e,height:t}),blob23:({width:e,height:t})=>Q({path:`M135.742 9.14189C157.815 19.2326 179.258 38.4681 176.105 56.7576C172.951 74.7317 145.202 92.0751 127.858 109.734C110.83 127.077 104.523 145.052 87.4953 164.918C70.4672 184.468 42.7177 206.227 27.5816 198.343C12.4455 190.46 9.60747 153.566 6.45411 126.762C2.98542 100.274 -0.798607 84.1917 0.147399 67.1636C0.77807 50.4508 6.76944 32.4767 19.0675 20.8093C31.0503 9.14189 49.6551 3.78119 70.4672 1.2585C90.964 -1.26418 113.668 -0.633508 135.742 9.14189Z`,aspectRatio:{width:177,height:200},width:e,height:t}),blob24:({width:e,height:t})=>Q({path:`M165.663 24.3715C171.555 44.4059 158.003 76.2254 151.816 96.2598C145.923 116.294 147.691 124.544 148.28 135.445C148.575 146.346 147.396 159.309 140.62 170.8C133.549 181.996 120.88 191.424 104.381 196.432C87.8821 201.441 67.553 202.03 54.8841 192.602C41.9207 183.469 36.6174 164.023 25.1271 143.105C13.3421 122.187 -4.33535 99.7953 0.967891 85.0641C6.27113 70.6275 34.2604 63.8511 56.0626 48.5307C77.5702 33.5048 92.8907 9.93489 113.22 2.56928C133.843 -4.79633 159.77 4.04241 165.663 24.3715Z`,aspectRatio:{width:168,height:200},width:e,height:t}),blob25:({width:e,height:t})=>Q({path:`M180.115 1.256C192.651 2.1962 189.83 34.163 190.771 58.2947C191.711 82.4265 196.098 98.4099 198.606 117.214C201.113 136.018 201.426 157.642 189.204 165.791C177.294 173.626 153.163 167.671 135.299 163.91C117.749 159.836 106.466 157.956 85.7818 162.97C65.0974 168.298 35.3244 180.521 18.7143 174.253C1.79068 167.985 -1.97012 142.913 0.850478 120.975C3.67107 99.0367 13.0731 79.6059 18.4009 54.8473C23.7287 30.0888 24.9823 -0.310996 40.0254 0.00240332C54.7552 0.00240332 82.9612 31.029 111.167 31.029C139.373 31.029 167.579 0.315802 180.115 1.256Z`,aspectRatio:{width:200,height:176},width:e,height:t}),blob26:({width:e,height:t})=>Q({path:`M142.571 0.586925C159.976 3.39414 176.258 15.1844 184.96 30.9048C193.662 46.6253 194.224 66.8372 189.171 83.6805C183.837 100.805 172.327 114.56 163.064 129.157C153.8 143.755 146.501 158.914 134.43 173.231C122.359 187.828 105.516 201.303 89.5146 199.899C73.2327 198.776 58.0738 182.775 42.9148 169.862C28.0366 157.23 13.7198 147.685 6.42103 134.491C-0.877729 121.297 -1.15845 103.892 1.64876 88.4528C4.45598 72.7324 10.0704 58.6963 18.4921 47.4674C27.1944 36.2386 38.4233 27.8169 50.4943 22.2025C62.846 16.3073 75.7592 13.5001 91.1989 8.72785C106.919 4.23631 125.166 -1.93957 142.571 0.586925Z`,aspectRatio:{width:193,height:200},width:e,height:t}),blob27:({width:e,height:t})=>Q({path:`M112.602 54.9337C129.225 71.8646 155.391 78.9448 158.777 89.719C162.471 100.493 143.693 114.654 127.07 135.586C110.447 156.519 96.2866 184.224 71.0442 194.998C46.1096 205.465 10.4008 199.308 2.0893 178.375C-6.22223 157.443 12.5557 121.734 18.4045 92.1817C24.5612 62.6296 17.7889 38.9263 26.4082 21.9954C34.7197 5.06454 58.423 -5.40183 73.5069 2.9097C88.8986 10.9134 95.9788 38.0028 112.602 54.9337Z`,aspectRatio:{width:160,height:200},width:e,height:t}),blob28:({width:e,height:t})=>Q({path:`M125.281 68.5835C142.15 82.9923 165.344 90.021 181.862 108.998C198.028 127.624 207.516 158.902 192.405 166.634C177.293 174.716 137.581 159.605 112.629 156.442C87.326 152.928 77.1344 161.713 59.9142 165.579C43.0453 169.445 19.1478 168.391 11.7677 157.496C4.73907 146.25 14.2278 124.813 11.4163 94.2382C8.2534 63.6634 -6.85825 23.9514 3.68476 8.48836C14.2278 -7.32615 50.4254 1.10826 73.9715 16.2199C97.5175 31.683 108.412 54.1747 125.281 68.5835Z`,aspectRatio:{width:200,height:169},width:e,height:t}),blob29:({width:e,height:t})=>Q({path:`M162.987 10.2348C169.16 25.1809 154.864 58.6471 147.066 79.4417C139.268 100.236 138.293 108.359 134.719 114.532C131.47 120.706 125.297 124.93 119.448 143.45C113.6 161.97 107.426 194.461 98.004 199.335C88.5814 204.209 75.5849 181.14 55.7651 167.494C35.6203 153.522 8.65241 148.648 1.8292 135.327C-4.994 122.33 8.65241 100.561 20.0244 82.041C31.3964 63.5208 40.1691 48.2498 53.4906 35.5782C66.8122 22.9065 84.0326 13.159 106.452 6.33584C128.871 -0.812285 156.489 -4.71127 162.987 10.2348Z`,aspectRatio:{width:165,height:200},width:e,height:t}),blob3:({width:e,height:t})=>Q({path:`M158.095 64.2637C176.543 95.19 192.277 129.1 181.697 155.686C171.117 182.001 133.951 201.533 99.4982 199.905C64.7739 198.549 33.0338 176.032 15.4004 145.377C-2.23296 114.994 -5.75963 76.2002 10.2461 46.6303C26.2518 17.0605 61.5185 -3.557 89.732 0.512241C118.217 4.58149 139.377 33.0662 158.095 64.2637Z`,aspectRatio:{width:186,height:200},width:e,height:t}),blob30:({width:e,height:t})=>Q({path:`M146.076 34.4585C157.052 54.582 155.833 80.1936 164.675 100.622C173.212 121.355 191.201 136.905 189.372 149.711C187.542 162.212 165.285 171.969 146.99 175.018C129.001 178.372 114.671 174.713 103.39 175.018C92.1083 175.018 83.876 178.982 66.8015 186.299C49.7271 193.617 23.8105 204.288 14.3586 198.19C4.90665 191.787 11.6145 168.615 10.3949 147.882C8.87037 127.148 -0.581561 108.549 0.0282404 89.3407C0.638042 70.1319 11.6145 50.6182 28.384 32.934C44.8487 15.5546 67.4113 0.309578 89.974 0.00467694C112.537 -0.300224 135.099 14.335 146.076 34.4585Z`,aspectRatio:{width:190,height:200},width:e,height:t}),blob31:({width:e,height:t})=>Q({path:`M134.218 44.0392C153.568 36.4264 184.97 26.9105 195.755 33.2544C206.222 39.9156 195.755 62.1194 181.481 76.3933C166.89 90.35 148.175 96.0596 145.638 116.36C143.1 136.661 156.74 171.235 151.664 183.923C146.589 196.928 123.434 187.413 105.036 178.531C86.6388 169.967 73.3165 161.72 52.0643 158.548C30.812 155.058 1.62986 156.644 0.0438693 145.225C-1.22492 133.806 25.4197 109.382 29.2261 86.8609C32.7152 64.3398 13.6834 44.0392 11.7802 26.9105C9.877 9.46461 24.7853 -4.80928 42.5484 1.53467C59.9942 7.87863 79.9777 34.5232 93.6172 45.308C107.257 56.4099 114.869 51.3347 134.218 44.0392Z`,aspectRatio:{width:200,height:191},width:e,height:t}),blob32:({width:e,height:t})=>Q({path:`M200 100.339C200 149.831 145.763 197.966 95.5932 197.966C45.7627 197.966 0 149.831 0 100.339C0 50.8475 45.7627 0 95.5932 0C145.763 0 200 50.8475 200 100.339Z`,aspectRatio:{width:200,height:198},width:e,height:t}),blob4:({width:e,height:t})=>Q({path:`M183.427 38.712C198.21 63.2519 196.141 95.1833 189.341 126.523C182.836 157.863 171.305 188.908 150.609 197.482C130.208 205.76 100.642 192.16 69.8936 177.968C39.4405 164.072 7.80478 150.176 1.30024 128.593C-5.2043 107.01 13.718 77.7393 35.3012 51.7211C56.5888 25.9986 81.1287 3.23272 108.921 0.276112C137.009 -2.38484 168.349 14.4678 183.427 38.712Z`,aspectRatio:{width:195,height:200},width:e,height:t}),blob5:({width:e,height:t})=>Q({path:`M166.251 30.6913C183.816 48.5185 195.875 71.8512 199.021 98.8542C202.429 125.595 197.186 155.744 179.359 169.115C161.794 182.223 131.645 178.815 103.331 176.979C75.0171 175.144 48.8006 174.882 29.6625 161.512C10.7866 148.141 -0.748681 121.925 0.0378149 96.2326C0.824311 70.8025 14.1947 46.159 33.0706 28.3318C52.2087 10.5045 76.8522 -0.5064 100.971 0.0179307C125.091 0.804426 148.423 12.864 166.251 30.6913Z`,aspectRatio:{width:200,height:179},width:e,height:t}),blob6:({width:e,height:t})=>Q({path:`M149.146 50.5452C161.911 68.0278 171.901 81.9028 176.619 97.9979C181.336 114.37 180.781 133.241 173.011 149.891C165.519 166.541 151.366 180.693 133.051 189.851C114.736 199.008 92.2586 202.893 71.446 197.621C50.6334 192.348 30.9308 177.918 18.1658 158.216C5.12323 138.791 -0.981801 113.815 0.128204 87.7304C1.51571 61.6453 10.6733 34.1726 29.2658 17.5226C48.1359 1.14999 76.996 -4.40004 98.9186 3.6475C120.841 11.695 136.381 32.7851 149.146 50.5452Z`,aspectRatio:{width:180,height:200},width:e,height:t}),blob7:({width:e,height:t})=>Q({path:`M158.662 41.8295C178.593 57.8305 204.138 64.5677 213.402 79.7266C222.666 94.6047 215.367 118.466 203.015 135.028C190.383 151.871 172.698 161.977 156.416 168.434C140.134 174.89 124.975 177.697 104.483 185.277C83.9903 192.856 58.1642 205.208 44.9704 197.629C31.4959 190.33 31.2152 163.1 21.9514 138.116C12.9684 112.851 -4.71688 90.1132 1.17822 75.5158C7.35404 61.1991 36.8295 55.5847 58.7256 40.1452C80.9024 24.7056 95.4998 -0.278374 109.816 0.00234533C124.414 0.283064 138.45 25.8285 158.662 41.8295Z`,aspectRatio:{width:218,height:200},width:e,height:t}),blob8:({width:e,height:t})=>Q({path:`M153.53 11.0108C168.179 18.1858 181.931 29.5461 192.993 44.4939C203.755 59.4417 212.425 78.2759 210.631 96.5122C209.136 114.748 197.477 132.088 182.529 142.252C167.581 152.716 148.747 156.004 128.717 168.262C108.687 180.22 87.1622 201.147 69.8228 199.951C52.7823 198.456 39.6283 174.54 32.4533 153.015C25.2784 131.49 24.0826 112.357 16.6087 91.131C9.13477 70.2041 -4.31825 46.8855 1.36191 31.9377C7.04207 16.691 31.8554 9.51607 52.7823 5.33069C73.4103 0.846349 90.4507 -0.648433 106.594 0.248435C123.037 1.1453 138.882 4.13486 153.53 11.0108Z`,aspectRatio:{width:211,height:200},width:e,height:t}),blob9:({width:e,height:t})=>Q({path:`M140.289 20.2182C156.96 27.7956 176.661 32.0895 189.29 43.9608C201.667 55.5796 206.718 75.0283 202.424 91.6987C198.131 108.622 184.491 122.766 175.651 140.952C166.81 158.885 162.769 180.607 150.393 191.216C138.016 201.824 117.052 201.572 98.866 197.025C80.6802 192.479 65.2727 183.891 48.3497 175.808C31.4268 167.726 13.2409 160.148 5.1583 146.761C-2.67172 133.122 -0.398493 113.673 4.14797 96.7504C8.69444 80.08 15.5141 65.6828 23.3442 52.296C31.4268 38.6566 40.5197 25.775 52.6436 15.6717C65.0201 5.82101 80.6802 -1.50385 95.3299 0.264221C109.98 1.77971 123.619 12.6407 140.289 20.2182Z`,aspectRatio:{width:204,height:200},width:e,height:t})};function Th(e){return wh[e]||mh}function Eh(e){let{subType:t}=e,n=e,r=Th(t);return r?function(e,t){let{width:n,height:r,fill:i,stroke:a,strokeWidth:o,dash:s}=e,c=(s||[]).map(e=>e*o),l=t(e),u=1,d=1;typeof l!=`string`&&(u=l.scaleX,d=l.scaleY,l=l.path);let f=`clip-${e.id||Math.random()}`;return`\n <svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${r}">\n <defs>\n <clipPath id="${f}">\n <path d="${l}" />\n </clipPath>\n </defs>\n\n \x3c!-- Path for the fill --\x3e\n <path d="${l}" fill="${i}" transform="scale(${u}, ${d})"/>\n\n \x3c!-- Path for the stroke, clipped by the star path --\x3e\n <path d="${l}" fill="none" stroke="${a}" stroke-width="${2*o}" clip-path="url(#${f})" transform="scale(${u}, ${d})" stroke-dasharray="${c.join(` `)}"/>\n </svg>\n `}(n,r):(console.error(`Polotno error: Can not convert ${e.subType} figure to svg.`),mh(n))}var Dh={},Oh=U(({element:e,store:t})=>{let n=S.useRef(null),r=e.selectable||t.role===`admin`,i=il(),a=e.isSelected,o=Math.min(e.strokeWidth,e.width/2,e.height/2),s=Math.max(0,Math.min(e.width/2,e.height/2,e.cornerRadius)),c=Xs(e,e.a.fill,`fill`),l=Object.assign(Object.assign({width:e.a.width,height:e.a.height},c),{cornerRadius:s,opacity:e.animated(`opacity`),shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,preventDefault:!i||a,hideInExport:!e.showInExport}),u=Xs(e,e.stroke,`stroke`),d=Object.assign(Object.assign({visible:o>0,x:o/2,y:o/2,width:e.a.width-o,height:e.a.height-o},u),{strokeWidth:o,cornerRadius:Math.max(0,s-o),dash:e.dash.map(e=>e*o),opacity:e.animated(`opacity`),hideInExport:!e.showInExport,listening:!1}),f=(p=e.subType,Dh[p]||(Dh[p]=(m=Th(p),U(({element:e,fillProps:t,strokeProps:n})=>{let r=m({width:e.a.width,height:e.a.height,cornerRadius:e.cornerRadius}),i=1,a=1;typeof r!=`string`&&(i=r.scaleX,a=r.scaleY,r=r.path);let o=S.useRef(null);return S.createElement(S.Fragment,null,S.createElement(`Rect`,{width:e.width,height:e.height,fill:`transparent`}),S.createElement(`Path`,Object.assign({},t,{ref:o,data:r,scaleX:i,scaleY:a})),S.createElement(`Group`,{clipFunc:e=>{let t=o.current;if(t){var n=t.dataArray;e.beginPath();for(var r=0;r<n.length;r++){var i=n[r].command,a=n[r].points;switch(i){case`L`:e.lineTo(a[0],a[1]);break;case`M`:e.moveTo(a[0],a[1]);break;case`C`:e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case`Q`:e.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case`A`:var s=a[0],c=a[1],l=a[2],u=a[3],d=a[4],f=a[5],p=a[6],m=a[7],h=l>u?l:u,g=l>u?1:l/u,_=l>u?u/l:1;e.translate(s,c),e.rotate(p),e.scale(g,_),e.arc(0,0,h,d,d+f,!m),e.scale(1/g,1/_),e.rotate(-p),e.translate(-s,-c);break;case`z`:e.closePath()}}}},scaleX:i,scaleY:a},S.createElement(`Path`,Object.assign({},n,{x:0,y:0,data:r,strokeWidth:2*n.strokeWidth,dash:n.dash.map(e=>e)}))))}))),Dh[p]||`Group`);var p,m;return S.createElement(S.Fragment,null,S.createElement(Fo,{ref:n,id:e.id,x:e.a.x,y:e.a.y,rotation:e.a.rotation,opacity:e.a.opacity,listening:r,draggable:i?e.draggable&&a:e.draggable,name:`element`,onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onTransform:t=>{let n=t.target.scale();t.target.scaleX(1),t.target.scaleY(1),e.set({width:e.width*n.x,height:e.height*n.y,x:t.target.x(),y:t.target.y(),rotation:t.target.rotation()})}},S.createElement(f,{element:e,fillProps:l,strokeProps:d})))}),kh=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.loop=e.conditional=e.parse=void 0,e.parse=function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:r;if(Array.isArray(n))n.forEach(function(n){return e(t,n,r,i)});else if(typeof n==`function`)n(t,r,i,e);else{var a=Object.keys(n)[0];Array.isArray(n[a])?(i[a]={},e(t,n[a],r,i[a])):i[a]=n[a](t,r,i,e)}return r},e.conditional=function(e,t){return function(n,r,i,a){t(n,r,i)&&a(n,e,r,i)}},e.loop=function(e,t){return function(n,r,i,a){for(var o=[],s=n.pos;t(n,r,i);){var c={};if(a(n,e,r,c),n.pos===s)break;s=n.pos,o.push(c)}return o}}})),Ah=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readBits=e.readArray=e.readUnsigned=e.readString=e.peekBytes=e.readBytes=e.peekByte=e.readByte=e.buildStream=void 0,e.buildStream=function(e){return{data:e,pos:0}};var t=function(){return function(e){return e.data[e.pos++]}};e.readByte=t,e.peekByte=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(t){return t.data[t.pos+e]}};var n=function(e){return function(t){return t.data.subarray(t.pos,t.pos+=e)}};e.readBytes=n,e.peekBytes=function(e){return function(t){return t.data.subarray(t.pos,t.pos+e)}},e.readString=function(e){return function(t){return Array.from(n(e)(t)).map(function(e){return String.fromCharCode(e)}).join(``)}},e.readUnsigned=function(e){return function(t){var r=n(2)(t);return e?(r[1]<<8)+r[0]:(r[0]<<8)+r[1]}},e.readArray=function(e,t){return function(r,i,a){for(var o=typeof t==`function`?t(r,i,a):t,s=n(e),c=Array(o),l=0;l<o;l++)c[l]=s(r);return c}};var r=function(e,t,n){for(var r=0,i=0;i<n;i++)r+=e[t+i]&&2**(n-i-1);return r};e.readBits=function(e){return function(n){for(var i=t()(n),a=Array(8),o=0;o<8;o++)a[7-o]=!!(i&1<<o);return Object.keys(e).reduce(function(t,n){var i=e[n];return i.length?t[n]=r(a,i.index,i.length):t[n]=a[i.index],t},{})}}})),jh=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=void 0;var t=kh(),n=Ah(),r={blocks:function(e){for(var t=0,r=[],i=e.data.length,a=0,o=(0,n.readByte)()(e);o!==t&&o;o=(0,n.readByte)()(e)){if(e.pos+o>=i){var s=i-e.pos;r.push((0,n.readBytes)(s)(e)),a+=s;break}r.push((0,n.readBytes)(o)(e)),a+=o}for(var c=new Uint8Array(a),l=0,u=0;u<r.length;u++)c.set(r[u],l),l+=r[u].length;return c}},i=(0,t.conditional)({gce:[{codes:(0,n.readBytes)(2)},{byteSize:(0,n.readByte)()},{extras:(0,n.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,n.readUnsigned)(!0)},{transparentColorIndex:(0,n.readByte)()},{terminator:(0,n.readByte)()}]},function(e){var t=(0,n.peekBytes)(2)(e);return t[0]===33&&t[1]===249}),a=(0,t.conditional)({image:[{code:(0,n.readByte)()},{descriptor:[{left:(0,n.readUnsigned)(!0)},{top:(0,n.readUnsigned)(!0)},{width:(0,n.readUnsigned)(!0)},{height:(0,n.readUnsigned)(!0)},{lct:(0,n.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,t.conditional)({lct:(0,n.readArray)(3,function(e,t,n){return 2**(n.descriptor.lct.size+1)})},function(e,t,n){return n.descriptor.lct.exists}),{data:[{minCodeSize:(0,n.readByte)()},r]}]},function(e){return(0,n.peekByte)()(e)===44}),o=(0,t.conditional)({text:[{codes:(0,n.readBytes)(2)},{blockSize:(0,n.readByte)()},{preData:function(e,t,r){return(0,n.readBytes)(r.text.blockSize)(e)}},r]},function(e){var t=(0,n.peekBytes)(2)(e);return t[0]===33&&t[1]===1}),s=(0,t.conditional)({application:[{codes:(0,n.readBytes)(2)},{blockSize:(0,n.readByte)()},{id:function(e,t,r){return(0,n.readString)(r.blockSize)(e)}},r]},function(e){var t=(0,n.peekBytes)(2)(e);return t[0]===33&&t[1]===255}),c=(0,t.conditional)({comment:[{codes:(0,n.readBytes)(2)},r]},function(e){var t=(0,n.peekBytes)(2)(e);return t[0]===33&&t[1]===254});e.default=[{header:[{signature:(0,n.readString)(3)},{version:(0,n.readString)(3)}]},{lsd:[{width:(0,n.readUnsigned)(!0)},{height:(0,n.readUnsigned)(!0)},{gct:(0,n.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,n.readByte)()},{pixelAspectRatio:(0,n.readByte)()}]},(0,t.conditional)({gct:(0,n.readArray)(3,function(e,t){return 2**(t.lsd.gct.size+1)})},function(e,t){return t.lsd.gct.exists}),{frames:(0,t.loop)([i,s,c,a,o],function(e){var t=(0,n.peekByte)()(e);return t===33||t===44})}]})),Mh=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.deinterlace=void 0,e.deinterlace=function(e,t){for(var n=Array(e.length),r=e.length/t,i=function(r,i){var a=e.slice(i*t,(i+1)*t);n.splice.apply(n,[r*t,t].concat(a))},a=[0,4,2,1],o=[8,8,4,2],s=0,c=0;c<4;c++)for(var l=a[c];l<r;l+=o[c])i(l,s),s++;return n}})),Nh=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.lzw=void 0,e.lzw=function(e,t,n){var r=4096,i=-1,a=n,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S=Array(n),C=Array(r),w=Array(r),T=Array(r+1);for(_=e,s=1<<_,u=s+1,o=s+2,f=i,l=_+1,c=(1<<l)-1,m=0;m<s;m++)C[m]=0,w[m]=m;var g=p=v=y=x=b=0,p,v,y,x,b;for(h=0;h<a;){if(y===0){if(p<l){g+=t[b]<<p,p+=8,b++;continue}if(m=g&c,g>>=l,p-=l,m>o||m==u)break;if(m==s){l=_+1,c=(1<<l)-1,o=s+2,f=i;continue}if(f==i){T[y++]=w[m],f=m,v=m;continue}for(d=m,m==o&&(T[y++]=v,m=f);m>s;)T[y++]=w[m],m=C[m];v=w[m]&255,T[y++]=v,o<r&&(C[o]=f,w[o]=v,o++,(o&c)===0&&o<r&&(l++,c+=o)),f=d}y--,S[x++]=T[y],h++}for(h=x;h<a;h++)S[h]=0;return S}})),Ph=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.decompressFrames=e.decompressFrame=e.parseGIF=void 0;var t=o(jh()),n=kh(),r=Ah(),i=Mh(),a=Nh();function o(e){return e&&e.__esModule?e:{default:e}}e.parseGIF=function(e){var i=new Uint8Array(e);return(0,n.parse)((0,r.buildStream)(i),t.default)};var s=function(e){for(var t=e.pixels.length,n=new Uint8ClampedArray(t*4),r=0;r<t;r++){var i=r*4,a=e.pixels[r],o=e.colorTable[a]||[0,0,0];n[i]=o[0],n[i+1]=o[1],n[i+2]=o[2],n[i+3]=a===e.transparentIndex?0:255}return n},c=function(e,t,n){if(!e.image){console.warn(`gif frame does not have associated image.`);return}var r=e.image,o=r.descriptor.width*r.descriptor.height,c=(0,a.lzw)(r.data.minCodeSize,r.data.blocks,o);r.descriptor.lct.interlaced&&(c=(0,i.deinterlace)(c,r.descriptor.width));var l={pixels:c,dims:{top:e.image.descriptor.top,left:e.image.descriptor.left,width:e.image.descriptor.width,height:e.image.descriptor.height}};return r.descriptor.lct&&r.descriptor.lct.exists?l.colorTable=r.lct:l.colorTable=t,e.gce&&(l.delay=(e.gce.delay||10)*10,l.disposalType=e.gce.extras.disposal,e.gce.extras.transparentColorGiven&&(l.transparentIndex=e.gce.transparentColorIndex)),n&&(l.patch=s(l)),l};e.decompressFrame=c,e.decompressFrames=function(e,t){return e.frames.filter(function(e){return e.image}).map(function(n){return c(n,e.gct,t)})}}))();function Fh(e,t,n){let r=t.getContext(`2d`),i=n.getContext(`2d`);if(!r||!i)return;e.disposalType===2&&r.clearRect(0,0,t.width,t.height),n.width=e.width,n.height=e.height;let a=i.createImageData(e.width,e.height);a.data.set(e.patch),i.putImageData(a,0,0),r.drawImage(n,e.left,e.top)}var Ih=U(({element:e})=>{let t=Math.min(30,e.width/4,e.height/4),n=S.useRef(null);S.useEffect(()=>{let e=n.current;if(!e)return;let t=new a.Animation(t=>{e.rotate((t?.timeDiff||0)/2)},e.getLayer());return t.start(),()=>{t.stop()}},[]);let{mediaLoadingStyle:r}=ps();return S.createElement(Fo,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},S.createElement(Lo,{width:e.width,height:e.height,fill:r.fill}),S.createElement(`Arc`,{ref:n,x:e.width/2,y:e.height/2,fill:r.textFill,outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270}))}),Lh=U(({element:e})=>{let{mediaErrorStyle:t}=ps(),n=Math.max(10,Math.min(30,e.width/22));return S.createElement(Fo,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},S.createElement(Lo,{width:e.width,height:e.height,fill:t.fill}),S.createElement(Bo,{text:`Cannot load the GIF...`,fontSize:n,width:e.width,height:e.height,align:`center`,fill:t.textFill,verticalAlign:`middle`,padding:5}))}),Rh=U(({element:e,store:t})=>{let[n,r]=S.useState(!1),i=e.isSelected,o=S.useRef(null),s=S.useRef(),[c,l,u,d]=function(e){let[t,n]=S.useState([]),[r,i]=S.useState(0),[a,o]=S.useState(`loading`),[s,c]=S.useState({width:0,height:0});return S.useEffect(()=>{(async()=>{try{let t=(0,Ph.parseGIF)(await(await fetch(e)).arrayBuffer()),r=(0,Ph.decompressFrames)(t,!0),a=t.lsd.width,s=t.lsd.height;c({width:a,height:s});let l=r.map(e=>({patch:new Uint8ClampedArray(e.patch),delay:e.delay,width:e.dims.width,height:e.dims.height,left:e.dims.left,top:e.dims.top,disposalType:e.disposalType})),u=l.reduce((e,t)=>e+t.delay,0);n(l),i(u),o(`loaded`)}catch(e){console.error(`Failed to load GIF:`,e),o(`failed`)}})()},[e]),[t,r,s,a]}(e.src);Op(d,e.src,e.id),S.useEffect(()=>(s.current=document.createElement(`canvas`),()=>{s.current&&a.Util.releaseCanvas(s.current)}),[]),S.useEffect(()=>{if(d===`loaded`&&s.current&&(s.current.width=u.width,s.current.height=u.height,c.length>0)){let e=s.current.getContext(`2d`);if(e){e.clearRect(0,0,u.width,u.height);let t=document.createElement(`canvas`);Fh(c[0],s.current,t)}}},[u,d,c]),S.useEffect(()=>{if(!c.length||!s.current)return;let n=s.current;n.width=u.width,n.height=u.height;let r=document.createElement(`canvas`),i=n.getContext(`2d`);i&&i.clearRect(0,0,n.width,n.height);let a=-1;Fh(c[0],n,r),y(),a=0;let d=e=>{let t=(e=>{let t=e%l,n=0;for(let e=0;e<c.length;e++)if(n+=c[e].delay,n>t)return e;return 0})(e);t!==a&&(Fh(c[t],n,r),y(),o.current.getLayer().draw(),a=t)};if(t.isPlaying||e.page._exportingOrRendering)return $n(()=>{d(t.currentTime-e.page.startTime)});{let e=window.setInterval(()=>{d(t.currentTime||performance.now())},16);return()=>{clearInterval(e)}}},[t.isPlaying,c,l,e.page._exportingOrRendering]),S.useEffect(()=>{l&&t.history.ignore(()=>{e.set({duration:l})})},[l]);let{cropX:f,cropY:p,cropWidth:m,cropHeight:h}=e;d!==`loaded`&&(f=p=0,m=h=1);let g={x:u.width*f,y:u.height*p,width:u.width*m,height:u.height*h},_=e.cornerRadius??0,[v,y]=oh(e,s.current,g,t._elementsPixelRatio,_,n||e._cropModeEnabled);S.useLayoutEffect(()=>{if(!n&&!e._cropModeEnabled&&o.current)return rl(o.current,e),$n(()=>{rl(o.current,e)},{delay:100})},[s.current,n,m,h,e._cropModeEnabled,u.width,u.height]);let b=d===`loading`,x=d===`failed`,C=b||x?0:e.a.opacity;ec(o,C);let w=e.selectable||t.role===`admin`,T=il();return S.createElement(S.Fragment,null,b&&S.createElement(Ih,{element:e}),x&&S.createElement(Lh,{element:e}),S.createElement(zo,{ref:o,name:`element`,id:e.id,image:v,x:e.a.x,y:e.a.y,width:e.a.width||1,height:e.a.height||1,rotation:e.a.rotation,opacity:C,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:g,listening:w,draggable:T?e.draggable&&i:e.draggable,preventDefault:!T||i,hideInExport:!e.showInExport,onDragMove:t=>{e.set({x:t.target.x(),y:t.target.y()})},onDragEnd:t=>{e.set({x:t.target.x(),y:t.target.y()})},onTransformStart:()=>r(!0),onTransform:t=>{let n=t.currentTarget,r=Math.abs(n.scaleX()-1)<1e-7?1:n.scaleX(),i=Math.abs(n.scaleY()-1)<1e-7?1:n.scaleY();n.scaleX(1),n.scaleY(1),e.set({x:n.x(),y:n.y(),width:n.width()*r,height:n.height()*i,rotation:n.rotation()})},onTransformEnd:()=>r(!1)}),S.createElement(Lo,{x:e.a.x,y:e.a.y,width:Math.max(e.a.width-e.borderSize,0),height:Math.max(e.a.height-e.borderSize,0),opacity:C,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2,stroke:e.borderColor,strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,_-e.borderSize),hideInExport:!e.showInExport}))}),zh=U(({element:e,store:t})=>{let n=S.useRef(null),r=S.useRef(null),i=e.selectable||t.role===`admin`,a=il(),o=e.isSelected,s=e._focusedCellIds.length>0,c=e.editingCell;S.useEffect(()=>{o||e.clearCellFocus()},[o]);let l=c?._editModeEnabled;S.useEffect(()=>{e._editingCellId&&c&&!c._editModeEnabled&&e.exitCellEdit()},[l]),S.useEffect(()=>{s&&!e._editingCellId&&setTimeout(()=>r.current?.focus(),0)},[s,e._editingCellId]),S.useEffect(()=>$n(()=>{e._fitRowsToContent&&t.history.ignore(()=>{e._applyFitRowsToContent()})}),[e,t]);let u=t=>{let r=t.target.getStage();if(!r)return;let i=r.getPointerPosition();if(!i)return;let a=n.current;if(!a)return;let o=a.getAbsoluteTransform().copy().invert().point(i);for(let t of e.visibleCells){let n=e.getCellRect(t.row,t.col,t.rowSpan,t.colSpan);if(o.x>=n.x&&o.x<=n.x+n.width&&o.y>=n.y&&o.y<=n.y+n.height)return t}},d=(e,t)=>e===`dashed`?[4*t,2*t]:e===`dotted`?[t,t]:void 0,f=[];for(let t of e.visibleCells){let n=e.getCellRect(t.row,t.col,t.rowSpan,t.colSpan);if(t.row===0){let e=t.getEffectiveBorder(`top`);e.style!==`none`&&e.width>0&&f.push(S.createElement(`Line`,{key:`bt-${t.id}`,points:[n.x,n.y+e.width/2,n.x+n.width,n.y+e.width/2],stroke:e.color,strokeWidth:e.width,dash:d(e.style,e.width),listening:!1}))}if(t.col===0){let e=t.getEffectiveBorder(`left`);e.style!==`none`&&e.width>0&&f.push(S.createElement(`Line`,{key:`bl-${t.id}`,points:[n.x+e.width/2,n.y,n.x+e.width/2,n.y+n.height],stroke:e.color,strokeWidth:e.width,dash:d(e.style,e.width),listening:!1}))}{let e=t.getEffectiveBorder(`bottom`);e.style!==`none`&&e.width>0&&f.push(S.createElement(`Line`,{key:`bb-${t.id}`,points:[n.x,n.y+n.height-e.width/2,n.x+n.width,n.y+n.height-e.width/2],stroke:e.color,strokeWidth:e.width,dash:d(e.style,e.width),listening:!1}))}{let e=t.getEffectiveBorder(`right`);e.style!==`none`&&e.width>0&&f.push(S.createElement(`Line`,{key:`br-${t.id}`,points:[n.x+n.width-e.width/2,n.y,n.x+n.width-e.width/2,n.y+n.height],stroke:e.color,strokeWidth:e.width,dash:d(e.style,e.width),listening:!1}))}}return S.createElement(S.Fragment,null,S.createElement(Lo,{id:e.id,name:`element`,x:e.a.x,y:e.a.y,rotation:e.a.rotation,width:e.a.width,height:e.a.height,fill:`transparent`,opacity:e.a.opacity,hideInExport:!e.showInExport,listening:i,draggable:a?e.draggable&&o:e.draggable,onClick:t=>{if(!o||e.locked||!e.contentEditable)return;let n=u(t);n&&(t.evt.shiftKey&&s?(t.cancelBubble=!0,e.focusCellRange(n.row,n.col)):e.focusCell(n.id))},onDblClick:t=>{if(!o||e.locked||!e.contentEditable)return;let n=u(t);n&&e.enterCellEdit(n.id)},onDragMove:t=>{var r;let i=t.target;e.set({x:i.x(),y:i.y()}),(r=n.current)==null||r.position({x:i.x(),y:i.y()})},onDragEnd:t=>{let n=t.target;e.set({x:n.x(),y:n.y()})},onTransformStart:()=>{e._setIsTransforming(!0)},onTransformEnd:()=>{e._setIsTransforming(!1),e._resetBaseRowHeights()},onTransform:t=>{var r,i;let a=t.target,o=a.scaleX(),s=a.scaleY();a.scaleX(1),a.scaleY(1);let c=e.width*o,l=e.height*s;a.width(c),a.height(l);let u=a.x(),d=a.y(),f=a.rotation();(r=n.current)==null||r.position({x:u,y:d}),(i=n.current)==null||i.rotation(f),e.set({width:c,height:l,x:u,y:d,rotation:f})}}),S.createElement(Fo,{ref:n,x:e.a.x,y:e.a.y,rotation:e.a.rotation,opacity:e.a.opacity,hideInExport:!e.showInExport,scaleX:e.a.width/e.width,scaleY:e.a.height/e.height},e.visibleCells.map(t=>{let n=e.getCellRect(t.row,t.col,t.rowSpan,t.colSpan);return t.cellBackground===`transparent`?null:S.createElement(Lo,{key:`bg-${t.id}`,x:n.x,y:n.y,width:n.width,height:n.height,fill:t.cellBackground,listening:!1})}),f,e.visibleCells.map(e=>S.createElement(Xf,{key:`text-${e.id}`,element:e,store:t})),e._focusedCellIds.map(t=>{let n=e.cells.find(e=>e.id===t);if(!n)return null;let r=e.getCellRect(n.row,n.col,n.rowSpan,n.colSpan);return S.createElement(Lo,{key:`focus-${t}`,x:r.x,y:r.y,width:r.width,height:r.height,fill:`rgba(13, 131, 221, 0.1)`,stroke:`#0d83dd`,strokeWidth:2,listening:!1})}),s&&!c&&S.createElement(Ss,null,S.createElement(`input`,{ref:r,style:{position:`absolute`,opacity:0,width:`1px`,height:`1px`,pointerEvents:`none`},readOnly:!0})),o&&!c&&!t.isPlaying&&(()=>{let n=[],r=0;for(let i=0;i<e.cols-1;i++){r+=e.colWidths[i]*e.a.width;let a=r,o=i;n.push(S.createElement(`Line`,{key:`col-resize-${i}`,x:a,points:[0,0,0,e.a.height],stroke:`transparent`,strokeWidth:1,hitStrokeWidth:16,draggable:!0,onMouseEnter:e=>{let t=e.target.getStage()?.container();t&&(t.style.cursor=`col-resize`)},onMouseLeave:e=>{let t=e.target.getStage()?.container();t&&(t.style.cursor=``)},onDragStart:e=>{e.cancelBubble=!0,t.history.startTransaction()},onDragMove:t=>{t.cancelBubble=!0;let n=t.target,r=(n.x()-a)/e.width;n.x(a),e.resizeColumn(o,r)},onDragEnd:e=>{e.cancelBubble=!0,e.target.x(a),t.history.endTransaction()}}))}return n})(),o&&!c&&!t.isPlaying&&(()=>{let n=[],r=0;for(let i=0;i<e.rows-1;i++){r+=e.rowHeights[i]*e.a.height;let a=r,o=i;n.push(S.createElement(`Line`,{key:`row-resize-${i}`,y:a,points:[0,0,e.a.width,0],stroke:`transparent`,strokeWidth:1,hitStrokeWidth:16,draggable:!0,onMouseEnter:e=>{let t=e.target.getStage()?.container();t&&(t.style.cursor=`row-resize`)},onMouseLeave:e=>{let t=e.target.getStage()?.container();t&&(t.style.cursor=``)},onDragStart:n=>{n.cancelBubble=!0,e._setIsResizingRows(!0),t.history.startTransaction()},onDragMove:t=>{t.cancelBubble=!0;let n=t.target,r=(n.y()-a)/e.height;n.y(a),e.resizeRow(o,r)},onDragEnd:n=>{n.cancelBubble=!0,n.target.y(a),e._setIsResizingRows(!1),e._resetBaseRowHeights(),t.history.endTransaction()}}))}return n})()))}),Bh=U(({element:e})=>{let{highlighterStyle:t}=ps();return S.createElement(Lo,Object.assign({name:`highlighter`,x:e.a.x,y:e.a.y,rotation:e.a.rotation,width:e.a.width,height:e.a.height,listening:!1,strokeScaleEnabled:!1},t))}),Vh=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+=`-`:e+=`_`,e),``),Hh=function(e,t){if(e===t)return!0;if(typeof e==`object`&&e&&typeof t==`object`&&t){if(Object.keys(e).length!=Object.keys(t).length)return!1;for(var n in e)if(!t.hasOwnProperty(n)||!Hh(e[n],t[n]))return!1;return!0}return!1};Object.assign(Z);var Uh=Z.model(`UndoManager`,{history:Z.array(Z.frozen()),undoIdx:-1,targetPath:``}).views(e=>({get canUndo(){return e.undoIdx>0},get canRedo(){return e.undoIdx<e.history.length-1}})).actions(e=>{let t,n,r=!1,i=null,a=0,o=0,s=()=>o>0;function c(){let e=bl(t);return{pages:e.pages,width:e.width,height:e.height,custom:e.custom,audios:e.audios}}function l(e){let n=!Hh(t.pages.map(e=>e.id),e.pages.map(e=>e.id)),r=!Hh(t.custom,e.custom);n?yl(t.pages,e.pages):t.pages.forEach((t,n)=>{yl(t,e.pages[n])}),r&&t.set({custom:e.custom}),t.setSize(e.width,e.height)}let u={startTransaction(){o++},endTransaction(e){o--,e||u.requestAddState(c())},async ignore(e,t=!1,n=!1){n&&await new Promise(e=>setTimeout(e,10));let r=!!a;a&&u.addUndoState();let i=s();u.startTransaction();let c=o;try{await e()}catch(e){setTimeout(()=>{throw e})}let l=c!==o,d=!l;u.endTransaction(d),t||i&&!r||u.replaceState(),l||(clearTimeout(a),a=0)},async transaction(e){await u.ignore(e,!0),u.addUndoState()},requestAddState(e){i=e,a||s()||(r?r=!1:a=setTimeout(()=>{a=0,clearTimeout(a),s()||u.addUndoState()},100))},addUndoState(){if(r){r=!1;return}let t=e.history[e.undoIdx];!Hh(i,t)&&(clearTimeout(a),a=0,e.history.splice(e.undoIdx+1),e.history.push(i),e.undoIdx=e.history.length-1)},afterCreate(){if(t=El(e,`..`),!t)throw Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");n=_l(t,()=>{u.requestAddState(c())}),e.history.length===0&&u.requestAddState(c())},clear(){clearTimeout(a),a=0,e.history.splice(0,e.history.length),e.undoIdx=-1,u.addUndoState()},beforeDestroy(){n()},undo(){a&&u.addUndoState(),s()?l(e.history[e.undoIdx]):e.canUndo?(e.undoIdx--,r=!0,l(e.history[e.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){a&&u.addUndoState(),e.canRedo?(e.undoIdx++,r=!0,l(e.history[e.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){e.history[e.undoIdx]=c()}};return u});async function Wh(e,t){let n=await(await fetch(e)).blob(),r=document.createElement(`a`),i=URL.createObjectURL(n);r.href=i,r.download=t,document.body.appendChild(r),r.click(),setTimeout(function(){document.body.removeChild(r),window.URL.revokeObjectURL(i)},0)}var Gh=null;function Kh(){return window.jspdf?.jsPDF?Promise.resolve(window.jspdf.jsPDF):Gh||(typeof window.__polotnoLoadJspdf==`function`?(Gh=window.__polotnoLoadJspdf().then(e=>e?.jsPDF||e),Gh):(Gh=new Promise(e=>{var t=document.createElement(`script`);t.onload=function(){e(window.jspdf.jsPDF)},t.src=`https://cdnjs.cloudflare.com/ajax/libs/jspdf/3.0.1/jspdf.umd.min.js`,document.head.appendChild(t)}),Gh))}function qh(){return window.GIF?Promise.resolve(window.GIF):new Promise(e=>{var t=document.createElement(`script`);t.onload=function(){e(window.GIF)},t.src=`https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js`,document.head.appendChild(t)})}async function Jh({width:e,height:t}){return new(await(qh()))({workers:4,width:e,height:t,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
280
- (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p<this.pages.length;p++){for(var i=0;i<ByteArray.pageSize;i++){rv+=ByteArray.charMap[this.pages[p][i]]}}return rv};ByteArray.prototype.writeByte=function(val){if(this.cursor>=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i<l;i++)this.writeByte(string.charCodeAt(i))};ByteArray.prototype.writeBytes=function(array,offset,length){for(var l=length||array.length,i=offset||0;i<l;i++)this.writeByte(array[i])};function GIFEncoder(width,height){this.width=~~width;this.height=~~height;this.transparent=null;this.transIndex=0;this.repeat=-1;this.delay=0;this.image=null;this.pixels=null;this.indexedPixels=null;this.colorDepth=null;this.colorTab=null;this.neuQuant=null;this.usedEntry=new Array;this.palSize=7;this.dispose=-1;this.firstFrame=true;this.sample=10;this.dither=false;this.globalPalette=false;this.out=new ByteArray}GIFEncoder.prototype.setDelay=function(milliseconds){this.delay=Math.round(milliseconds/10)};GIFEncoder.prototype.setFrameRate=function(fps){this.delay=Math.round(100/fps)};GIFEncoder.prototype.setDispose=function(disposalCode){if(disposalCode>=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j<nPix;j++){var index=this.findClosestRGB(this.pixels[k++]&255,this.pixels[k++]&255,this.pixels[k++]&255);this.usedEntry[index]=true;this.indexedPixels[j]=index}};GIFEncoder.prototype.ditherPixels=function(kernel,serpentine){var kernels={FalseFloydSteinberg:[[3/8,1,0],[3/8,0,1],[2/8,1,1]],FloydSteinberg:[[7/16,1,0],[3/16,-1,1],[5/16,0,1],[1/16,1,1]],Stucki:[[8/42,1,0],[4/42,2,0],[2/42,-2,1],[4/42,-1,1],[8/42,0,1],[4/42,1,1],[2/42,2,1],[1/42,-2,2],[2/42,-1,2],[4/42,0,2],[2/42,1,2],[1/42,2,2]],Atkinson:[[1/8,1,0],[1/8,2,0],[1/8,-1,1],[1/8,0,1],[1/8,1,1],[1/8,0,2]]};if(!kernel||!kernels[kernel]){throw"Unknown dithering kernel: "+kernel}var ds=kernels[kernel];var index=0,height=this.height,width=this.width,data=this.pixels;var direction=serpentine?-1:1;this.indexedPixels=new Uint8Array(this.pixels.length/3);for(var y=0;y<height;y++){if(serpentine)direction=direction*-1;for(var x=direction==1?0:width-1,xend=direction==1?width:0;x!==xend;x+=direction){index=y*width+x;var idx=index*3;var r1=data[idx];var g1=data[idx+1];var b1=data[idx+2];idx=this.findClosestRGB(r1,g1,b1);this.usedEntry[idx]=true;this.indexedPixels[index]=idx;idx*=3;var r2=this.colorTab[idx];var g2=this.colorTab[idx+1];var b2=this.colorTab[idx+2];var er=r1-r2;var eg=g1-g2;var eb=b1-b2;for(var i=direction==1?0:ds.length-1,end=direction==1?ds.length:0;i!==end;i+=direction){var x1=ds[i][1];var y1=ds[i][2];if(x1+x>=0&&x1+x<width&&y1+y>=0&&y1+y<height){var d=ds[i][0];idx=index+x1+y1*width;idx*=3;data[idx]=Math.max(0,Math.min(255,data[idx]+er*d));data[idx+1]=Math.max(0,Math.min(255,data[idx+1]+eg*d));data[idx+2]=Math.max(0,Math.min(255,data[idx+2]+eb*d))}}}}};GIFEncoder.prototype.findClosest=function(c,used){return this.findClosestRGB((c&16711680)>>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i<len;index++){var dr=r-(this.colorTab[i++]&255);var dg=g-(this.colorTab[i++]&255);var db=b-(this.colorTab[i++]&255);var d=dr*dr+dg*dg+db*db;if((!used||this.usedEntry[index])&&d<dmin){dmin=d;minpos=index}}return minpos};GIFEncoder.prototype.getImagePixels=function(){var w=this.width;var h=this.height;this.pixels=new Uint8Array(w*h*3);var data=this.image;var srcPos=0;var count=0;for(var i=0;i<h;i++){for(var j=0;j<w;j++){this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];srcPos++}}};GIFEncoder.prototype.writeGraphicCtrlExt=function(){this.out.writeByte(33);this.out.writeByte(249);this.out.writeByte(4);var transp,disp;if(this.transparent===null){transp=0;disp=0}else{transp=1;disp=2}if(this.dispose>=0){disp=dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i<n;i++)this.out.writeByte(0)};GIFEncoder.prototype.writeShort=function(pValue){this.out.writeByte(pValue&255);this.out.writeByte(pValue>>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":2,"./TypedNeuQuant.js":3}],2:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i<hsize;++i)htab[i]=-1}function compress(init_bits,outs){var fcode,c,i,ent,disp,hsize_reg,hshift;g_init_bits=init_bits;clear_flg=false;n_bits=g_init_bits;maxcode=MAXCODE(n_bits);ClearCode=1<<init_bits-1;EOFCode=ClearCode+1;free_ent=ClearCode+2;a_count=0;ent=nextPixel();hshift=0;for(fcode=HSIZE;fcode<65536;fcode*=2)++hshift;hshift=8-hshift;hsize_reg=HSIZE;cl_hash(hsize_reg);output(ClearCode,outs);outer_loop:while((c=nextPixel())!=EOF){fcode=(c<<BITS)+ent;i=c<<hshift^ent;if(htab[i]===fcode){ent=codetab[i];continue}else if(htab[i]>=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<<BITS){codetab[i]=free_ent++;htab[i]=fcode}else{cl_block(outs)}}output(ent,outs);output(EOFCode,outs)}function encode(outs){outs.writeByte(initCodeSize);remaining=width*height;curPixel=0;compress(initCodeSize+1,outs);outs.writeByte(0)}function flush_char(outs){if(a_count>0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<<n_bits)-1}function nextPixel(){if(remaining===0)return EOF;--remaining;var pix=pixels[curPixel++];return pix&255}function output(code,outs){cur_accum&=masks[cur_bits];if(cur_bits>0)cur_accum|=code<<cur_bits;else cur_accum=code;cur_bits+=n_bits;while(cur_bits>=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<<BITS;else maxcode=MAXCODE(n_bits)}}if(code==EOFCode){while(cur_bits>0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],3:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<<intbiasshift;var gammashift=10;var gamma=1<<gammashift;var betashift=10;var beta=intbias>>betashift;var betagamma=intbias<<gammashift-betashift;var initrad=netsize>>3;var radiusbiasshift=6;var radiusbias=1<<radiusbiasshift;var initradius=initrad*radiusbias;var radiusdec=30;var alphabiasshift=10;var initalpha=1<<alphabiasshift;var alphadec;var radbiasshift=8;var radbias=1<<radbiasshift;var alpharadbshift=alphabiasshift+radbiasshift;var alpharadbias=1<<alpharadbshift;var prime1=499;var prime2=491;var prime3=487;var prime4=503;var minpicturebytes=3*prime4;function NeuQuant(pixels,samplefac){var network;var netindex;var bias;var freq;var radpower;function init(){network=[];netindex=new Int32Array(256);bias=new Int32Array(netsize);freq=new Int32Array(netsize);radpower=new Int32Array(netsize>>3);var i,v;for(i=0;i<netsize;i++){v=(i<<netbiasshift+8)/netsize;network[i]=new Float64Array([v,v,v,0]);freq[i]=intbias/netsize;bias[i]=0}}function unbiasnet(){for(var i=0;i<netsize;i++){network[i][0]>>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(j<hi||k>lo){a=radpower[m++];if(j<hi){p=network[j++];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}if(k>lo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i<netsize;i++){n=network[i];dist=Math.abs(n[0]-b)+Math.abs(n[1]-g)+Math.abs(n[2]-r);if(dist<bestd){bestd=dist;bestpos=i}biasdist=dist-(bias[i]>>intbiasshift-netbiasshift);if(biasdist<bestbiasd){bestbiasd=biasdist;bestbiaspos=i}betafreq=freq[i]>>betashift;freq[i]-=betafreq;bias[i]+=betafreq<<gammashift}freq[bestpos]+=beta;bias[bestpos]-=betagamma;return bestbiaspos}function inxbuild(){var i,j,p,q,smallpos,smallval,previouscol=0,startpos=0;for(i=0;i<netsize;i++){p=network[i];smallpos=i;smallval=p[1];for(j=i+1;j<netsize;j++){q=network[j];if(q[1]<smallval){smallpos=j;smallval=q[1]}}q=network[smallpos];if(i!=smallpos){j=q[0];q[0]=p[0];p[0]=j;j=q[1];q[1]=p[1];p[1]=j;j=q[2];q[2]=p[2];p[2]=j;j=q[3];q[3]=p[3];p[3]=j}if(smallval!=previouscol){netindex[previouscol]=startpos+i>>1;for(j=previouscol+1;j<smallval;j++)netindex[j]=i;previouscol=smallval;startpos=i}}netindex[previouscol]=startpos+maxnetpos>>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i<netsize||j>=0){if(i<netsize){p=network[i];dist=p[1]-g;if(dist>=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}if(j>=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}}return best}function learn(){var i;var lengthcount=pixels.length;var alphadec=30+(samplefac-1)/3;var samplepixels=lengthcount/(3*samplefac);var delta=~~(samplepixels/ncycles);var alpha=initalpha;var radius=initradius;var rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i<rad;i++)radpower[i]=alpha*((rad*rad-i*i)*radbias/(rad*rad));var step;if(lengthcount<minpicturebytes){samplefac=1;step=3}else if(lengthcount%prime1!==0){step=3*prime1}else if(lengthcount%prime2!==0){step=3*prime2}else if(lengthcount%prime3!==0){step=3*prime3}else{step=3*prime4}var b,g,r,j;var pix=0;i=0;while(i<samplepixels){b=(pixels[pix]&255)<<netbiasshift;g=(pixels[pix+1]&255)<<netbiasshift;r=(pixels[pix+2]&255)<<netbiasshift;j=contest(b,g,r);altersingle(alpha,j,b,g,r);if(rad!==0)alterneigh(rad,j,b,g,r);pix+=step;if(pix>=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;j<rad;j++)radpower[j]=alpha*((rad*rad-j*j)*radbias/(rad*rad))}}}function buildColormap(){init();learn();unbiasnet();inxbuild()}this.buildColormap=buildColormap;function getColormap(){var map=[];var index=[];for(var i=0;i<netsize;i++)index[network[i][3]]=i;var k=0;for(var l=0;l<netsize;l++){var j=index[l];map[k++]=network[j][0];map[k++]=network[j][1];map[k++]=network[j][2]}return map}this.getColormap=getColormap;this.lookupRGB=inxsearch}module.exports=NeuQuant},{}],4:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i<len;i++){page=ref[i];results.push(page.buffer)}return results}();return self.postMessage(frame,transfer)}else{return self.postMessage(frame)}};self.onmessage=function(event){return renderFrame(event.data)}},{"./GIFEncoder.js":1}]},{},[4]);
281
- `],{type:`application/javascript`}))})}var Yh=`https://api.polotno.com`;`${Yh}`;var Xh=()=>Yh+`/api`,Zh=z({value:!1}),Qh=z({value:`v1`}),$h=()=>Qh.value,eg=z({value:0}),tg=()=>eg.value,ng=()=>Zh.value,rg=H(()=>{Zh.value=!0}),ig=typeof window<`u`?window.location.origin:``,ag=typeof navigator<`u`&&navigator.userAgent.indexOf(`Headless`)>-1,og=typeof navigator<`u`&&navigator.userAgent.indexOf(`Electron`)>-1;ig===`file://`&&ag&&(ig=`headless`),ig===`file://`&&og&&(ig=`electron`);var sg=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${ig}" here: https://polotno.com/cabinet`,cg=fetch;async function lg(e){for(let t=0;t<5;t++)try{let t=await cg(Xh()+`/validate-key`,{method:`POST`,body:JSON.stringify({key:e,site:location.host,skdVersion:`2.40.0`})});if(Zn(()=>{Qh.value=t.headers.get(`x-api-version`)||``}),!e)return console.error(`Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet`),Zn(()=>{eg.value=1}),!1;if(t.status!==200){await new Promise(e=>setTimeout(e,3e3));continue}let n=await t.json();return n.is_valid||(console.error(`Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet`),Zn(()=>{eg.value=1})),n.is_paid||(console.log(`%cPolotno Free Version. For development usage only. https://polotno.com/`,`background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;`),Zn(()=>{eg.value===0&&(eg.value=2)})),n.is_domain_valid||console.log(sg,`background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;`),Bc(n.remove_background_enabled),n.is_paid||!1}catch{await new Promise(e=>setTimeout(e,3e3))}return console.error(`Can not validate Polotno API key. Please report to anton@polotno.com immediately.`),!0}async function ug(e,t){await lg(e)&&!t||rg()}var dg=[112,72,89,115],fg=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=1&n?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})(),pg=()=>typeof globalThis<`u`?globalThis.Buffer:void 0,mg=(e,t,n)=>{e[t]=n>>>24&255,e[t+1]=n>>>16&255,e[t+2]=n>>>8&255,e[t+3]=255&n},hg=(e,t,n)=>{let r=e.indexOf(`,`),i=(e=>{if(typeof atob==`function`){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}let t=pg();if(t)return new Uint8Array(t.from(e,`base64`));throw Error(`No base64 decoder available`)})(r>=0?e.slice(r+1):e);return`data:${t};base64,${(e=>{if(typeof btoa==`function`){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}let t=pg();if(t)return t.from(e).toString(`base64`);throw Error(`No base64 encoder available`)})(t===`image/png`?((e,t)=>{let n=(e=>{let t=new Uint8Array(9),n=new DataView(t.buffer);n.setUint32(0,e,!1),n.setUint32(4,e,!1),t[8]=1;let r=new Uint8Array(8+t.length+4);mg(r,0,t.length),r.set(dg,4),r.set(t,8);let i=new Uint8Array(4+t.length);return i.set(dg,0),i.set(t,4),mg(r,8+t.length,(e=>{let t=4294967295;for(let n=0;n<e.length;n++)t=fg[255&(t^e[n])]^t>>>8;return(4294967295^t)>>>0})(i)),r})(Math.round(t/.0254)),r=((e,t)=>{let n=8;for(;n+8<=e.length;){let r=e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3],i=n+4,a=e.subarray(i,i+4),o=8+r+4;if(t.every((e,t)=>a[t]===e))return{offset:n,totalLength:o};n+=o}return null})(e,dg);if(r){let t=new Uint8Array(e.length-r.totalLength+n.length);return t.set(e.slice(0,r.offset),0),t.set(n,r.offset),t.set(e.slice(r.offset+r.totalLength),r.offset+n.length),t}let i=16+(e[8]<<24|e[9]<<16|e[10]<<8|e[11])+4;if(i>e.length)return e;let a=new Uint8Array(e.length+n.length);return a.set(e.slice(0,i),0),a.set(n,i),a.set(e.slice(i),i+n.length),a})(i,n):((e,t)=>{let n=(e=>{let t=2;for(;t+4<e.length;){if(e[t]!==255)return-1;let n=e[t+1];if(n===216||n===217){t+=2;continue}let r=e[t+2]<<8|e[t+3];if(r<2)return-1;if(n===224&&e[t+4]===74&&e[t+5]===70&&e[t+6]===73&&e[t+7]===70&&e[t+8]===0)return t;let i=t+2+r;if(i<=t||i>e.length)return-1;t=i}return-1})(e);if(n>=0){let r=new Uint8Array(e),i=n+11;return r[i]=1,r[i+1]=t>>8&255,r[i+2]=255&t,r[i+3]=t>>8&255,r[i+4]=255&t,r}let r=(e=>{let t=new Uint8Array(18);return t[0]=255,t[1]=224,t[2]=0,t[3]=16,t[4]=74,t[5]=70,t[6]=73,t[7]=70,t[8]=0,t[9]=1,t[10]=1,t[11]=1,t[12]=e>>8&255,t[13]=255&e,t[14]=e>>8&255,t[15]=255&e,t})(t),i=new Uint8Array(e.length+r.length);return i.set(e.subarray(0,2),0),i.set(r,2),i.set(e.subarray(2),2+r.length),i})(i,n))}`},gg=({px:e,unit:t=`px`,dpi:n})=>{switch(t){case`pt`:default:return e;case`mm`:return e/(n/25.4);case`cm`:return e/(n/2.54);case`in`:return e/n}},_g=({px:e,precious:t=2,dpi:n=72,unit:r=`px`})=>parseFloat(gg({px:e,dpi:n,unit:r}).toFixed(t)),vg=({unitVal:e,dpi:t,unit:n})=>e/gg({px:1,unit:n,dpi:t}),yg=e=>{let t=parseFloat(gg(e).toFixed(1));switch(e.unit){case`pt`:return`${Math.round(t)}pt`;case`mm`:return`${t}mm`;case`cm`:return`${t}cm`;case`in`:return`${t}in`;default:return`${Math.round(t)}px`}};async function bg(e){for(let t=0;t<30;t++){let t=await e();if(t)return t;await new Promise(e=>setTimeout(e,50))}}function xg(e){return new Promise((t,n)=>{let r=document.createElement(`img`);r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.crossOrigin=`anonymous`,r.src=e})}async function Sg(e,t){let n=await xg(e),r=document.createElement(`canvas`);r.width=2*n.width,r.height=2*n.height,r.getContext(`2d`).drawImage(n,0,0,r.width,r.height);let i=document.createElement(`canvas`);i.width=t.width,i.height=t.height;let a=i.getContext(`2d`),{cropX:o,cropY:s}=t,c=r.width*t.cropWidth,l=r.height*t.cropHeight,u=t.width/t.height,d,f,p=c/l;return t.type===`svg`?(d=c,f=l):u>=p?(d=c,f=c/u):(d=l*u,f=l),a.drawImage(r,o*r.width,s*r.height,d,f,0,0,i.width,i.height),i.toDataURL(`image/png`)}function Cg(e,t){let{width:n,height:r}=e,i=n/r,a,o;i>=t.width/t.height?(a=t.width,o=t.width/i):(a=t.height*i,o=t.height);let s=(t.width-a)/2,c=(t.height-o)/2;return{cropX:s/t.width,cropY:c/t.height,cropWidth:a/t.width,cropHeight:o/t.height}}var wg;(function(e){e.sepia=`sepia`,e.grayscale=`grayscale`,e.natural=`natural`,e.warm=`warm`,e.cold=`cold`,e.temperature=`temperature`,e.contrast=`contrast`,e.shadows=`shadows`,e.white=`white`,e.black=`black`,e.vibrance=`vibrance`,e.saturation=`saturation`})(wg||={});function Tg(e,t){let n={filter:``,html:void 0};switch(e){case wg.warm:{let e=Math.max(0,Math.min(1,t??.5)),r=1+.3*e,i=1+.15*e;return n.filter=`url(#warm-filter)`,n.html=`\n <svg xmlns="http://www.w3.org/2000/svg" style="display:none">\n <filter id="warm-filter" color-interpolation-filters="sRGB">\n <feColorMatrix type="matrix" values="\n ${r} 0 0 0 0\n 0 ${i} 0 0 0\n 0 0 1 0 0\n 0 0 0 1 0" />\n </filter>\n </svg>`,n}case wg.cold:{let e=Math.max(0,Math.min(1,t??.5)),r=1-.15*e,i=1-.1*e,a=1+.15*e;return n.filter=`url(#cold-filter)`,n.html=`\n <svg xmlns="http://www.w3.org/2000/svg" style="display:none">\n <filter id="cold-filter" color-interpolation-filters="sRGB">\n <feColorMatrix type="matrix" values="\n ${r} 0 0 0 0\n 0 ${i} 0 0 0\n 0 0 ${a} 0 0\n 0 0 0 1 0" />\n </filter>\n </svg>`,n}case`natural`:{let e=Math.max(0,Math.min(1,t??.5)),r=1+.1*e;return n.filter=`saturate(${1+.3*e}) brightness(${r}) contrast(${1+.2*e})`,n}case wg.temperature:{let e=Math.max(-1,Math.min(1,t??0)),r=1+.15*e,i=1-.15*e;return n.filter=`url(#temperature-filter)`,n.html=`\n <svg xmlns="http://www.w3.org/2000/svg" style="display:none">\n <filter id="temperature-filter" color-interpolation-filters="sRGB">\n <feColorMatrix type="matrix" values="\n ${r} 0 0 0 0\n 0 1 0 0 0\n 0 0 ${i} 0 0\n 0 0 0 1 0" />\n </filter>\n </svg>\n `,n}case wg.contrast:{let e=100*Math.max(-1,Math.min(1,t??0)),r=259*(e+255)/(255*(259-e)),i=.5*(1-r);return n.filter=`url(#contrast-filter)`,n.html=`\n <svg xmlns="http://www.w3.org/2000/svg" style="display:none">\n <filter id="contrast-filter" color-interpolation-filters="sRGB">\n <feComponentTransfer>\n <feFuncR type="linear" slope="${r}" intercept="${i}" />\n <feFuncG type="linear" slope="${r}" intercept="${i}" />\n <feFuncB type="linear" slope="${r}" intercept="${i}" />\n </feComponentTransfer>\n </filter>\n </svg>\n `,n}case wg.shadows:{let e=Math.min(Math.max(1-.6*Math.max(-1,Math.min(1,t??0)),.4),2.5);return n.filter=`url(#shadows-filter)`,n.html=`\n <svg xmlns="http://www.w3.org/2000/svg" style="display:none">\n <filter id="shadows-filter" color-interpolation-filters="sRGB">\n <feComponentTransfer>\n <feFuncR type="gamma" amplitude="1" exponent="${e}" offset="0" />\n <feFuncG type="gamma" amplitude="1" exponent="${e}" offset="0" />\n <feFuncB type="gamma" amplitude="1" exponent="${e}" offset="0" />\n </feComponentTransfer>\n </filter>\n </svg>\n `,n}case wg.white:case wg.black:return null;case wg.vibrance:{let e=Math.max(-1,Math.min(1,t??0)),r=.299,i=.587,a=.114,o;o=e>=0?1+1.5*e:1+e;let s=1-o,c=s*r+o,l=s*i,u=s*a,d=s*r,f=s*i+o,p=s*a,m=s*r,h=s*i,g=s*a+o;return n.filter=`url(#vibrance-filter)`,n.html=`\n <svg xmlns="http://www.w3.org/2000/svg" style="display:none">\n <filter id="vibrance-filter" color-interpolation-filters="sRGB">\n <feColorMatrix type="matrix" values="\n ${c} ${l} ${u} 0 0\n ${d} ${f} ${p} 0 0\n ${m} ${h} ${g} 0 0\n 0 0 0 1 0" />\n </filter>\n </svg>\n `,n}case wg.saturation:{let e=.2126,r=.7152,i=.0722,a=1+Math.max(-1,Math.min(1,t??0)),o=1-a,s=o*e+a,c=o*r,l=o*i,u=o*e,d=o*r+a,f=o*i,p=o*e,m=o*r,h=o*i+a;return n.filter=`url(#saturation-filter)`,n.html=`\n <svg xmlns="http://www.w3.org/2000/svg" style="display:none">\n <filter id="saturation-filter" color-interpolation-filters="sRGB">\n <feColorMatrix type="matrix" values="\n ${s} ${c} ${l} 0 0\n ${u} ${d} ${f} 0 0\n ${p} ${m} ${h} 0 0\n 0 0 0 1 0" />\n </filter>\n </svg>\n `,n}default:return null}}async function Eg(e){return new Promise((t,n)=>{let r=document.createElement(`video`);r.crossOrigin=`anonymous`,r.src=e,r.addEventListener(`loadedmetadata`,()=>{let{videoWidth:e,videoHeight:n}=r;t({width:e,height:n})}),r.addEventListener(`error`,t=>{let r=e.slice(0,100);n(Error(`Failed to load video: ${r}`))})})}var Dg=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},Og=(e,t,...n)=>({type:e,props:t,children:n||[]});function kg(e){return qs(e),e}function Ag(e){var t=new DOMParser().parseFromString(e,`image/svg+xml`);return t.documentElement.setAttribute(`preserveAspectRatio`,`none`),new XMLSerializer().serializeToString(t)}var jg=async({element:e,page:t,store:n})=>{let{src:r}=e;if(e.type===`svg`){let t=await cp(r);t=Ag(t),r=Object.keys(e.colorsReplace).length?fp(t,new Map(Object.entries(e.colorsReplace))):lp(t)}let i=``;e.flipX&&(i+=`scaleX(-1)`),e.flipY&&(i+=`scaleY(-1)`),i||=`none`;let a={};if(e.type===`svg`&&e.maskSrc){let t=await sp(r);a[`mask-image`]=`url(${t})`,a[`mask-size`]=`100% 100%`,a[`mask-position`]=`0 0`,a[`mask-repeat`]=`no-repeat`,a[`-webkit-mask-image`]=`url(${t})`,a[`-webkit-mask-size`]=`100% 100%`,a[`-webkit-mask-position`]=`0 0`,a[`-webkit-mask-repeat`]=`no-repeat`,r=e.maskSrc}else if(e.clipSrc){let t=e.clipSrc,n=await sp(t);a[`mask-image`]=`url(${n})`,a[`mask-size`]=`100% 100%`,a[`mask-position`]=`0 0`,a[`mask-repeat`]=`no-repeat`,a[`-webkit-mask-image`]=`url(${n})`,a[`-webkit-mask-size`]=`100% 100%`,a[`-webkit-mask-position`]=`0 0`,a[`-webkit-mask-repeat`]=`no-repeat`}let o=await xg(r),s=o.width*e.cropWidth,c=o.height*e.cropHeight,l=e.width/e.height,u,d,f=s/c,p=e.type===`svg`||e.stretchEnabled;p?(u=s,d=c):l>=f?(u=s,d=s/l):(u=c*l,d=c);let m=u/o.width,h=d/o.height,g=u/d>e.width/e.height?e.height/d:e.width/u,_=p?e.width/u:g,v=p?e.height/d:g,y=u*_/m,b=d*v/h,x=e.cropX*_*o.width,S=e.cropY*v*o.height;e.flipX&&(x=(1-e.cropX-e.cropWidth)*_*o.width),e.flipY&&(S=(1-e.cropY-e.cropHeight)*v*o.height);let C=e.borderSize&&qs(e.borderColor),w=C?Math.max(0,e.cornerRadius-e.borderSize):e.cornerRadius,T=Og(`div`,{style:Object.assign(Object.assign({},a),{width:`100%`,height:`100%`,borderRadius:w+`px`,border:e.borderSize&&!C?`${e.borderSize}px solid ${e.borderColor}`:`none`,backgroundRepeat:`no-repeat`,backgroundImage:`url(${r})`,transform:i,backgroundSize:`${Math.round(y)}px ${Math.round(b)}px`,backgroundPositionX:-Math.round(x)+`px`,backgroundPositionY:-Math.round(S)+`px`})});return C?Og(`div`,{style:{width:`100%`,height:`100%`,borderRadius:e.cornerRadius+`px`,background:kg(e.borderColor),padding:e.borderSize+`px`,boxSizing:`border-box`}},T):T},Mg=({element:e,type:t})=>{let n={"stroke-width":e.height,stroke:e.color,"stroke-linecap":`round`,"stroke-linejoin":`round`,opacity:e.opacity},r=Object.assign(Object.assign({},n),{fill:e.color}),i=Object.assign(Object.assign({},n),{fill:`none`});return t===`arrow`?Og(`polyline`,Object.assign({points:`${3*e.height},${2*-e.height} 0,0 ${3*e.height},${2*e.height}`},i)):t===`triangle`?Og(`polygon`,Object.assign({points:`${3*e.height},${2*-e.height} 0,0 ${3*e.height},${2*e.height}`},r)):t===`bar`?Og(`polyline`,Object.assign({points:`0,${2*-e.height} 0,${2*e.height}`},i)):t===`circle`?Og(`circle`,Object.assign({cx:2*e.height,cy:0,r:2*e.height},r)):t===`square`?Og(`polygon`,Object.assign({points:`0,${2*-e.height} ${4*e.height},${2*-e.height} ${4*e.height},${2*e.height} 0,${2*e.height}`},r)):null},Ng={image:jg,svg:jg,text:async({element:e,page:t,store:n})=>{let r=qs(e.fill),i=qs(e.stroke);if(e.curveEnabled){let t=Yc(e.width,e.height,e.curvePower,e.fontSize),n=$c(J(e.text),{fontWeight:e.fontWeight||`normal`,fontStyle:e.fontStyle||`normal`,fill:e.fill||`black`}),a=`\n <svg xmlns="http://www.w3.org/2000/svg" width="${e.width}" height="${e.height}" style="display: block;">\n <defs>\n <path id="curve-${e.id}" d="${t}" fill="none" />`;if(r){let t=`curve-fill-grad-${e.id}`;a+=Xc(e.fill,t)}if(i&&e.strokeWidth){let t=`curve-stroke-grad-${e.id}`;a+=Xc(e.stroke,t)}a+=`</defs>\n <text\n font-family="'${e.fontFamily}'"\n font-size="${e.fontSize}"\n font-weight="${e.fontWeight}"\n font-style="${e.fontStyle}"\n fill="${r?`url(#curve-fill-grad-${e.id})`:e.fill}"\n text-anchor="middle"\n dominant-baseline="central"\n letter-spacing="${e.letterSpacing*e.fontSize}px"${e.textDecoration?` text-decoration="${e.textDecoration}"`:``}${e.strokeWidth?` stroke="${i?`url(#curve-stroke-grad-${e.id})`:e.stroke}" stroke-width="${e.strokeWidth}" paint-order="stroke fill"`:``}>\n <textPath href="#curve-${e.id}" startOffset="50%">${n}</textPath>\n </text>\n </svg>`;let o=e.backgroundPadding*(e.fontSize*e.lineHeight);return Og(`div`,{style:{position:`relative`,width:`100%`,height:`100%`}},e.backgroundEnabled&&Og(`div`,{style:{position:`absolute`,top:-o/2+`px`,left:-o/2+`px`,width:e.width+o+`px`,height:e.height+o+`px`,backgroundColor:e.backgroundColor,opacity:e.backgroundOpacity,borderRadius:e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5)+`px`}}),Og(`div`,{style:{width:`100%`,height:`100%`,position:`absolute`,top:0,left:0},innerHTML:a}))}let a=e=>({backgroundImage:e,backgroundSize:`100% 100%`,backgroundRepeat:`repeat`,WebkitBackgroundClip:`text`,MozBackgroundClip:`text`,backgroundClip:`text`,WebkitTextFillColor:`transparent`,MozTextFillColor:`transparent`,color:`transparent`}),o={top:0,left:0};r&&(o=Object.assign(Object.assign({},o),a(e.fill)));let s=null;if(e.backgroundEnabled)if(e.legacyBackground){let t=e.backgroundPadding*(e.fontSize*e.lineHeight);s=Og(`div`,{style:{position:`absolute`,top:-t/2+`px`,left:-t/2+`px`,display:`block`,width:e.width+t+`px`,height:e.height+t+`px`,backgroundColor:e.backgroundColor,opacity:e.backgroundOpacity,borderRadius:e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5)+`px`}})}else{let t=el(e),n=[];try{n=am(t)}catch{n=[]}if(n.length){let r=e.backgroundPadding*(e.fontSize*e.lineHeight*.5),i=e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5),a=Us({rects:n,padding:r,cornerRadius:i});if(a){let i=0;try{let{height:n}=im(t);e.verticalAlign===`middle`?i=(e.height-n)/2:e.verticalAlign===`bottom`&&(i=e.height-n)}catch{}let o=Math.min(...n.map(e=>e.top)),c=Math.max(...n.map(e=>e.bottom)),l=Math.min(...n.map(e=>e.left)),u=l-r,d=o-r,f=Math.max(...n.map(e=>e.right))-l+2*r,p=c-o+2*r;s=Og(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:f,height:p,viewBox:`${u} ${d} ${f} ${p}`,style:{position:`absolute`,top:i+d+`px`,left:u+`px`,opacity:e.backgroundOpacity,pointerEvents:`none`},innerHTML:`<path d="${a}" fill="${e.backgroundColor}" />`})}}}else s=null;e.verticalAlign===`middle`?(o.top=`50%`,o.transform=`translateY(-50%)`):e.verticalAlign===`bottom`&&(o.bottom=0);let c=/<[a-z][\s\S]*>/i.test(e.text),l=c?e.text:e.text.split(`
282
- `).join(`<br />`);if(e.strokeWidth&&(i||r&&!i)){let t=Object.assign({position:`absolute`,width:e.width+`px`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,fontSize:e.fontSize+`px`,textAlign:e.align,fontFamily:`'${e.fontFamily}'`,textDecoration:e.textDecoration||`none`,textDecorationColor:e.textDecoration?e.fill:void 0,textTransform:e.textTransform||`none`,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing*e.fontSize+`px`,fontStyle:e.fontStyle,fontWeight:e.fontWeight},o),n=i?Object.assign(Object.assign(Object.assign({},t),a(e.stroke)),{WebkitTextStroke:`${e.strokeWidth}px transparent`}):Object.assign(Object.assign({},t),{color:`transparent`,WebkitTextStroke:`${e.strokeWidth}px ${e.stroke}`}),u=r?Object.assign(Object.assign({},t),a(e.fill)):Object.assign(Object.assign({},t),{color:e.fill}),d=`el-`+e.id,f=c?`<style>#${d} {${Mp}}</style>`:``,p=Og(`div`,{style:Object.assign(Object.assign({},n),{position:`absolute`,top:0,left:0,pointerEvents:`none`}),"aria-hidden":`true`,innerHTML:c?`${f}${l}`:l}),m=Og(`div`,Object.assign(Object.assign({style:Object.assign(Object.assign({},u),{position:`relative`})},c?{id:d}:{}),{innerHTML:c?`${f}${l}`:l}));return Og(`div`,{style:{position:`relative`,width:`100%`,height:`100%`}},s,Og(`div`,{style:{position:`relative`,width:e.width+`px`}},p,m))}let u=Object.assign(Object.assign({},o),{position:`absolute`,width:e.width+`px`,color:e.fill,whiteSpace:`pre-wrap`,wordBreak:`break-word`,fontSize:e.fontSize+`px`,textAlign:e.align,fontFamily:`'${e.fontFamily}'`,textDecoration:e.textDecoration||`none`,textDecorationColor:e.textDecoration?e.fill:void 0,textTransform:e.textTransform||`none`,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing*e.fontSize+`px`,fontStyle:e.fontStyle,fontWeight:e.fontWeight,WebkitTextStroke:e.strokeWidth?`${e.strokeWidth}px ${e.stroke}`:void 0,paintOrder:e.strokeWidth?`stroke fill`:void 0}),d=`el-`+e.id,f=c?{id:d}:{},p=`<style>#${d} {${Mp}}</style>`,m=Og(`div`,Object.assign(Object.assign({style:u},f),{innerHTML:c?`${p}${l}`:l}));return Og(`div`,{style:{position:`relative`,width:`100%`,height:`100%`}},s,m)},line:async({element:e,page:t,store:n})=>Og(`svg`,{style:{width:`100%`,height:`100%`,contain:`layout style size`,overflow:`visible`}},Og(`line`,{x1:0,y1:e.height/2,x2:e.width,y2:e.height/2,stroke:e.color,"stroke-width":e.height,"stroke-dasharray":e.dash&&e.dash.length?e.dash.map(t=>t*e.height).join(` `):void 0}),Og(`g`,{transform:`translate(0 ${e.height/2})`},Mg({element:e,type:e.startHead})),Og(`g`,{transform:`translate(${e.width} ${e.height/2}) rotate(180)`},Mg({element:e,type:e.endHead}))),figure:async({element:e,page:t,store:n,elementHook:r})=>{let i=Eh(e);if(e.strokeWidth&&qs(e.stroke)){let t=`figure-stroke-grad-${e.id}`,n=Xc(e.stroke,t);i=i.replace(RegExp(`stroke="${e.stroke.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}"`,`g`),`stroke="url(#${t})"`),i=i.replace(`</defs>`,`${n}</defs>`)}if(qs(e.fill)){let t=`figure-fill-grad-${e.id}`,n=Xc(e.fill,t);i=i.replace(RegExp(`fill="${e.fill.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}"`,`g`),`fill="url(#${t})"`),i=i.replace(`</defs>`,`${n}</defs>`)}let a=Og(`div`,{innerHTML:i});return r&&r({dom:a,element:e})||a},group:async({element:e,page:t,store:n,elementHook:r})=>{let i=await Promise.all(e.children.map(e=>Pg({element:e,page:t,store:n,elementHook:r}))),a=Og(`div`,{style:{transformOrigin:`top left`,opacity:e.opacity}},...i);return r&&r({dom:a,element:e})||a},video:async({element:e,page:t,store:n,elementHook:r})=>{let{cropX:i,cropY:a,cropWidth:o,cropHeight:s}=e,c=await Eg(e.src),l=c.width*o,u=c.height*s,d=e.width/e.height,f,p;d>=l/u?(f=l,p=l/d):(f=u*d,p=u);let m=f/o,h=p/s,g=i*c.width,_=a*c.height,v=Math.max(e.width/c.width,e.height/c.height),y={position:`absolute`,width:`${Math.round(m*v)}px`,height:`${Math.round(h*v)}px`,left:-Math.round(g*v)+`px`,top:-Math.round(_*v)+`px`,objectFit:`fill`},b=`video-${e.id}`,x=e.borderSize&&qs(e.borderColor),S=Og(`div`,{style:{position:`relative`,width:`100%`,height:`100%`,overflow:`hidden`,borderRadius:(x?Math.max(0,e.cornerRadius-e.borderSize):e.cornerRadius)+`px`,border:e.borderSize&&!x?`${e.borderSize}px solid ${e.borderColor}`:`none`}},Og(`video`,{id:b,src:e.src,style:y,controls:!0,playsInline:!0,muted:!0,volume:e.volume}));if(x){let t=Og(`div`,{style:{width:`100%`,height:`100%`,borderRadius:e.cornerRadius+`px`,background:kg(e.borderColor),padding:e.borderSize+`px`,boxSizing:`border-box`}},S);return r&&r({dom:t,element:e})||t}return r&&r({dom:S,element:e})||S},gif:jg,table:async({element:e})=>{let t=e.rows,n=e.cols,r=e.colWidths,i=e.rowHeights,a=[`fontSize`,`fontFamily`,`fontWeight`,`fontStyle`,`textDecoration`,`textTransform`,`fill`,`align`,`verticalAlign`,`lineHeight`,`letterSpacing`,`strokeWidth`,`stroke`,`cellBackground`,`cellPadding`],o=(e.cells||[]).map(t=>{if(!t)return t;let n=Object.assign({},t);for(let t of a)n[t]===void 0&&(n[t]=e[t]);return n}),s=[];for(let r=0;r<t;r++){let t=[];for(let a=0;a<n;a++){let s=o[r*n+a];if(!s||s.mergedInto)continue;let c=s.cellPadding||4,l=s.colSpan||1,u=s.rowSpan||1,d=t=>{let n=s.borders?.[t];return`${n?.width??e.borderWidth}px ${n?.style??e.borderStyle??`solid`} ${n?.color??e.borderColor}`},f={style:{padding:c+`px`,background:s.cellBackground||`transparent`,fontSize:(s.fontSize||12)+`px`,fontFamily:`'${s.fontFamily||`Roboto`}'`,fontWeight:s.fontWeight||`normal`,fontStyle:s.fontStyle||`normal`,color:s.fill||`black`,textAlign:s.align||`left`,verticalAlign:s.verticalAlign||`top`,lineHeight:String(s.lineHeight||1.2),letterSpacing:s.letterSpacing?s.letterSpacing*(s.fontSize||12)+`px`:void 0,textDecoration:s.textDecoration||`none`,textTransform:s.textTransform||`none`,borderTop:d(`top`),borderRight:d(`right`),borderBottom:d(`bottom`),borderLeft:d(`left`),overflow:`hidden`,wordBreak:`break-word`,whiteSpace:`pre-wrap`,height:i[r]*e.height+`px`}};l>1&&(f.colspan=String(l)),u>1&&(f.rowspan=String(u)),t.push(Og(`td`,f,mc(s.text||``)))}s.push(Og(`tr`,{},...t))}return Og(`table`,{style:{width:`100%`,height:`100%`,borderCollapse:`collapse`,tableLayout:`fixed`}},Og(`colgroup`,{},...r.map(e=>Og(`col`,{style:{width:100*e+`%`}}))),Og(`tbody`,{},...s))}};async function Pg({element:e,page:t,store:n,elementHook:r}){let i=await Ng[e.type];if(i||(i=()=>Og(`div`,{}),console.error(`HTML export does not support ${e.type} type...`)),!e.visible)return null;let o=await i({element:e,page:t,store:n}),s=[],c=[];if(e.blurEnabled&&s.push(`blur(${e.blurRadius/2}px)`),e.brightnessEnabled&&s.push(`brightness(${100*e.brightness+100}%)`),e.sepiaEnabled&&s.push(`sepia()`),e.grayscaleEnabled&&s.push(`grayscale()`),e.filters)for(let[t,n]of Object.entries(e.filters)){let e=Tg(wg[t],n.intensity);e&&(s.push(e.filter),e.html&&c.push(e.html))}if(e.shadowEnabled){let t=function(e,t){if(t===1)return e;let n=a.Util.colorToRGBA(e);return n?`rgba(${n.r}, ${n.g}, ${n.b}, ${n.a*t})`:e}(e.shadowColor,e.shadowOpacity??1);s.push(`drop-shadow(${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur/2}px ${t})`)}let l=Og(`div`,{id:e.id,style:{position:`absolute`,left:e.x+`px`,top:e.y+`px`,width:e.width+`px`,height:e.height+`px`,transform:`rotate(${e.rotation}deg)`,transformOrigin:`top left`,opacity:e.opacity,display:e.visible&&e.showInExport?`block`:`none`,filter:s.join(` `)||`none`}},o,...c);return r&&r({dom:l,element:e})||l}async function Fg({json:e,elementHook:t}){let n=await Promise.all(e.pages.map(n=>async function({page:e,store:t,elementHook:n}){let r=await Promise.all(e.children.map(r=>Pg({element:r,page:e,store:t,elementHook:n}))),i=e.width===`auto`?t.width:e.width,a=e.height===`auto`?t.height:e.height,o={};if(e.background.indexOf(`url`)>=0||e.background.indexOf(`http`)>=0||e.background.indexOf(`.jpg`)>=0||e.background.indexOf(`.png`)>=0||e.background.indexOf(`.jpeg`)>=0){let{width:n,height:o}=await xg(e.background),s=await jg({element:Object.assign({x:0,y:0,width:i,height:a,src:e.background,cornerRadius:0},Cg({width:i,height:a},{width:n,height:o})),page:e,store:t});r.unshift(s)}else o=qs(e.background)?Object.assign(Object.assign({},o),{backgroundImage:e.background}):Object.assign(Object.assign({},o),{backgroundColor:e.background});return Og(`div`,{className:`page`,id:e.id,style:Object.assign(Object.assign({},o),{width:i+`px`,height:a+`px`,overflow:`hidden`,position:`relative`})},...r)}({page:n,store:e,elementHook:t}))),r=[];return z_({children:e.pages},e=>{e.type!==`text`&&e.type!==`tablecell`&&e.type!==`table`||!e.fontFamily||r.indexOf(e.fontFamily)!==-1||r.push(e.fontFamily)}),Og(`div`,{className:`design`},...r.map(t=>{let n=e.fonts.find(e=>e.fontFamily===t);return n?Og(`style`,{},(n.styles||(n.url?[{src:`url("${n.url}")`}]:[])).map(e=>`\n @font-face {\n font-family: '${n.fontFamily}';\n src: ${e.src};\n font-style: ${e.fontStyle||`normal`};\n font-weight: ${e.fontWeight||`normal`};\n font-display: swap;\n }`).join(`
283
- `)):Og(`link`,{href:Mc(t),rel:`stylesheet`})}),...n)}var Ig=({dom:e})=>{if(typeof e==`string`)return e;if(!e)return``;let t=e.props,{innerHTML:n}=t,r=Dg(t,[`innerHTML`]),i=Object.keys(r).map(e=>e===`style`&&typeof r[e]==`object`?`style="${Object.keys(r[e]).filter(t=>r[e][t]!=null).map(t=>`${t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}: ${r[e][t]}`).join(`; `)}"`:((e,t)=>t==null||t===``?``:typeof t==`object`?`${e}="${Object.keys(t).map(e=>`${e.replace(/-([a-z])/g,e=>e[1].toUpperCase())}:${t[e]};`).join(` `)}"`:`${e}="${t}"`)(e,r[e])).filter(e=>e&&e.trim().length>0).join(` `);return`<${e.type} ${i}>${n||e.children.map(e=>Ig({dom:e})).join(``)}</${e.type}>`};async function Lg({json:e,elementHook:t}){return Ig({dom:await Fg({json:e,elementHook:t})})}var Rg=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},zg=(e,t)=>{if(e.children)for(let n of e.children){if(!0===t(n))break;zg(n,t)}if(e.cells){for(let n of e.cells)if(!0===t(n))break}},$=(e,t,...n)=>({type:e,props:t,children:n||[]});function Bg(e,t){if(!qs(e))return null;let{stops:n,rotation:r}=Ys(e),i=r*Math.PI/180,a=.5-.5*Math.sin(i),o=.5+.5*Math.cos(i),s=.5+.5*Math.sin(i),c=.5-.5*Math.cos(i),l=n.map(({offset:e,color:t})=>$(`stop`,{offset:100*e+`%`,"stop-color":t}));return $(`linearGradient`,{id:t,x1:100*a+`%`,y1:100*o+`%`,x2:100*s+`%`,y2:100*c+`%`},...l)}var Vg=async e=>{try{let t=await fetch(e);if(typeof Buffer<`u`){let e=await t.arrayBuffer(),n=Buffer.from(e).toString(`base64`);return`data:${t.headers.get(`content-type`)||`image/png`};base64,${n}`}{let e=await t.blob();return new Promise((t,n)=>{let r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=n,r.readAsDataURL(e)})}}catch(t){return console.error(`Error converting URL to data URL:`,t),e}},Hg=async({element:e,page:t,store:n})=>{let{src:r}=e;r=e.type===`svg`?fp(await cp(r),new Map(Object.entries(e.colorsReplace))):await Vg(r);let i,a,o,s,c=``;if(e.flipX||e.flipY){let t=e.flipX?-1:1,n=e.flipY?-1:1,r=e.width/2,i=e.height/2;c=`translate(${r}, ${i}) scale(${t}, ${n}) translate(${-r}, ${-i})`}e.clipSrc&&(i=`clip-img-mask-${e.id}`,a=await Vg(e.clipSrc)),e.maskSrc&&(o=`mask-img-${e.id}`,s=await Vg(e.maskSrc));let l=await xg(r),u=l.width*e.cropWidth,d=l.height*e.cropHeight,f=e.width/e.height,p,m,h=u/d,g=typeof e.stretchEnabled==`boolean`&&e.stretchEnabled||e.type===`svg`;g?(p=u,m=d):f>=h?(p=u,m=u/f):(p=d*f,m=d);let _=p/l.width,v=m/l.height,y=p/m>e.width/e.height?e.height/m:e.width/p,b=g?e.width/p:y,x=g?e.height/m:y,S=p*b/_,C=m*x/v,w=e.cropX*l.width*b,T=e.cropY*l.height*x;e.flipX&&(w=(1-e.cropX-e.cropWidth)*l.width*b),e.flipY&&(T=(1-e.cropY-e.cropHeight)*l.height*x);let E=`clip-${e.id}`,D=e.cornerRadius||0,O=r.replace(/&/g,`&amp;`),k={x:-w,y:-T,width:S,height:C,preserveAspectRatio:`none`,"clip-path":`url(#${E})`},A=[$(`clipPath`,{id:E},$(`rect`,{x:0,y:0,width:e.width,height:e.height,rx:D||void 0,ry:D||void 0}))];i&&a&&A.push($(`mask`,{id:i,maskUnits:`userSpaceOnUse`,"mask-type":`alpha`},$(`image`,{href:a.replace(/&/g,`&amp;`),x:0,y:0,width:e.width,height:e.height,preserveAspectRatio:`none`}))),o&&A.push($(`mask`,{id:o,maskUnits:`userSpaceOnUse`,"mask-type":`alpha`},$(`image`,Object.assign({href:O},k))));let j=O,M={};o&&s&&(j=s.replace(/&/g,`&amp;`),M.mask=`url(#${o})`);let ee={};i&&(ee.mask=`url(#${i})`);let N=e.borderSize||0,P=N>0&&qs(e.borderColor),te=P?`border-grad-${e.id}`:null;if(P){let t=Bg(e.borderColor,te);t&&A.push(t)}let ne=N>0?$(`rect`,{x:N/2,y:N/2,width:Math.max(0,e.width-N),height:Math.max(0,e.height-N),fill:`none`,stroke:P?`url(#${te})`:e.borderColor,"stroke-width":N,rx:Math.max(0,D-N)||void 0,ry:Math.max(0,D-N)||void 0}):null,re=$(`g`,{},$(`defs`,{},...A),$(`image`,Object.assign(Object.assign({href:j},k),M)),ne);return $(`g`,ee,c?$(`g`,{transform:c},re):re)},Ug=({element:e,type:t})=>{let n={"stroke-width":e.height,stroke:e.color,"stroke-linecap":`round`,"stroke-linejoin":`round`},r=Object.assign(Object.assign({},n),{fill:e.color}),i=Object.assign(Object.assign({},n),{fill:`none`});return t===`arrow`?$(`polyline`,Object.assign({points:`${3*e.height},${2*-e.height} 0,0 ${3*e.height},${2*e.height}`},i)):t===`triangle`?$(`polygon`,Object.assign({points:`${3*e.height},${2*-e.height} 0,0 ${3*e.height},${2*e.height}`},r)):t===`bar`?$(`polyline`,Object.assign({points:`0,${2*-e.height} 0,${2*e.height}`},i)):t===`circle`?$(`circle`,Object.assign({cx:2*e.height,cy:0,r:2*e.height},r)):t===`square`?$(`polygon`,Object.assign({points:`0,${2*-e.height} ${4*e.height},${2*-e.height} ${4*e.height},${2*e.height} 0,${2*e.height}`},r)):null},Wg={image:Hg,svg:Hg,text:async({element:e,page:t,store:n})=>{let r=qs(e.fill),i=qs(e.stroke);if(e.curveEnabled){let t=Yc(e.width,e.height,e.curvePower,e.fontSize),n=`curve-path-${e.id}`,a=(mc(e.text).replace(/\n/g,` `),J(e.text)),o={fontWeight:e.fontWeight||`normal`,fontStyle:e.fontStyle||`normal`,fill:e.fill||`black`},s=$c(a,o),c=$c(a,o,{omitColors:!0}),l=e.backgroundPadding*(e.fontSize*e.lineHeight*.5),u=e.backgroundEnabled?$(`rect`,{x:-l,y:-l,width:e.width+2*l,height:e.height+2*l,fill:e.backgroundColor,opacity:e.backgroundOpacity,rx:e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5),ry:e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5)}):null,d=[$(`path`,{id:n,d:t,fill:`none`})],f=e.strokeWidth&&(i||r&&!i);if(r){let t=`curve-fill-grad-${e.id}`,n=Bg(e.fill,t);n&&d.push(n)}if(i&&e.strokeWidth){let t=`curve-stroke-grad-${e.id}`,n=Bg(e.stroke,t);n&&d.push(n)}if(f){let t={"font-size":e.fontSize+`px`,"text-anchor":`middle`,"dominant-baseline":`central`,"font-family":e.fontFamily,"font-style":e.fontStyle,"font-weight":e.fontWeight,"text-decoration":e.textDecoration||void 0,"letter-spacing":e.letterSpacing*e.fontSize+`px`},a=i?`url(#curve-stroke-grad-${e.id})`:e.stroke,o=$(`text`,Object.assign(Object.assign({},t),{fill:a,"stroke-width":e.strokeWidth,stroke:a}),$(`textPath`,{href:`#${n}`,startOffset:`50%`,innerHTML:c})),l=r?`url(#curve-fill-grad-${e.id})`:e.fill,f=$(`text`,Object.assign(Object.assign({},t),{fill:l}),$(`textPath`,{href:`#${n}`,startOffset:`50%`,innerHTML:s}));return $(`g`,{},u,$(`defs`,{},...d),o,f)}return $(`g`,{},u,$(`defs`,{},...d),$(`text`,{fill:r?`url(#curve-fill-grad-${e.id})`:e.fill,"font-size":e.fontSize+`px`,"text-anchor":`middle`,"dominant-baseline":`central`,"font-family":e.fontFamily,"font-style":e.fontStyle,"font-weight":e.fontWeight,"text-decoration":e.textDecoration||void 0,"letter-spacing":e.letterSpacing*e.fontSize+`px`,"stroke-width":e.strokeWidth||void 0,stroke:e.strokeWidth?i?`url(#curve-stroke-grad-${e.id})`:e.stroke:void 0,"paint-order":e.strokeWidth?`stroke fill`:void 0},$(`textPath`,{href:`#${n}`,startOffset:`50%`,innerHTML:s})))}let a=(e,t,n,r,i,a=0)=>{let o=document.createElement(`canvas`).getContext(`2d`);return o.font=`${i} ${r} ${t}px ${n}`,o.measureText(e).width+Math.max(0,(e?e.length:0)-1)*a*t},o=(e,t,n,r,i,o,s=0)=>{let c=[];return e.split(`
284
- `).forEach(e=>{let l=e.split(` `),u=``;for(let e=0;e<l.length;e++){let d=u+l[e]+` `;a(d,n,r,i,o,s)>t+.5&&e>0?(c.push(u.trim()),u=l[e]+` `):u=d}c.push(u.trim())}),c},s=mc(e.text);e.textTransform==`uppercase`&&(s=s.toUpperCase());let c=e.fontSize,l=[];for(;;){l=o(s,e.width,c,e.fontFamily,e.fontWeight,e.fontStyle,e.letterSpacing);let t=Math.max(...l.map(t=>a(t,c,e.fontFamily,e.fontWeight,e.fontStyle,e.letterSpacing))),n=l.length*c*e.lineHeight;if(t<=e.width&&n<=e.height||(--c,c<4))break}let u=c*e.lineHeight,d=l.length*u,f=c;e.verticalAlign===`middle`?f=(e.height-d)/2+c:e.verticalAlign===`bottom`&&(f=e.height-d+c);let p=e.align===`center`?`middle`:e.align===`right`?`end`:`start`,m=l.map((t,n)=>$(`tspan`,{x:e.align===`center`?e.width/2:e.align===`right`?e.width:0,dy:n===0?0:u,innerHTML:t===``?`​`:t})),h=e.backgroundPadding*(c*e.lineHeight*.5),g=e.backgroundCornerRadius*(c*e.lineHeight*.5),_=null;if(e.backgroundEnabled)if(e.legacyBackground)_=$(`rect`,{x:-h,y:-h,width:e.width+2*h,height:e.height+2*h,fill:e.backgroundColor,opacity:e.backgroundOpacity,rx:g,ry:g});else{let t=Ws({lines:l.map(t=>({width:t===``?0:a(t,c,e.fontFamily,e.fontWeight,e.fontStyle,e.letterSpacing)})),lineHeight:u,width:e.width,align:e.align===`justify`?`justify`:e.align}),n=0;e.verticalAlign===`middle`?n=(e.height-l.length*u)/2:e.verticalAlign===`bottom`&&(n=e.height-l.length*u);let r=Us({rects:t,padding:h,cornerRadius:g});r&&(_=$(`path`,{d:r,fill:e.backgroundColor,opacity:e.backgroundOpacity,transform:n?`translate(0,${n})`:void 0}))}let v=[],y=e.strokeWidth&&(i||r&&!i);if(r){let t=`text-fill-grad-${e.id}`,n=Bg(e.fill,t);n&&v.push(n)}if(i&&e.strokeWidth){let t=`text-stroke-grad-${e.id}`,n=Bg(e.stroke,t);n&&v.push(n)}if(y){let t={y:f,"font-size":c+`px`,"text-anchor":p,"font-family":e.fontFamily,"font-style":e.fontStyle,"font-weight":e.fontWeight,"text-decoration":e.textDecoration,"line-height":e.lineHeight,"letter-spacing":e.letterSpacing*c+`px`},n=i?`url(#text-stroke-grad-${e.id})`:e.stroke,a=$(`text`,Object.assign(Object.assign({},t),{fill:n,"stroke-width":e.strokeWidth,stroke:n}),...m.map(e=>$(`tspan`,e.props,e.props.innerHTML))),o=r?`url(#text-fill-grad-${e.id})`:e.fill,s=$(`text`,Object.assign(Object.assign({},t),{fill:o}),...m.map(e=>$(`tspan`,e.props,e.props.innerHTML)));return $(`g`,{},_,v.length>0?$(`defs`,{},...v):null,a,s)}return $(`g`,{},_,v.length>0?$(`defs`,{},...v):null,$(`text`,{fill:r?`url(#text-fill-grad-${e.id})`:e.fill,y:f,"font-size":c+`px`,"text-anchor":p,"font-family":e.fontFamily,"font-style":e.fontStyle,"font-weight":e.fontWeight,"text-decoration":e.textDecoration,"line-height":e.lineHeight,"letter-spacing":e.letterSpacing*c+`px`,"stroke-width":e.strokeWidth||void 0,stroke:e.strokeWidth?e.stroke:void 0,"paint-order":e.strokeWidth?`stroke fill`:void 0},...m))},line:async({element:e,page:t,store:n})=>$(`g`,{},$(`line`,{x1:0,y1:e.height/2,x2:e.width,y2:e.height/2,stroke:e.color,"stroke-width":e.height,"stroke-dasharray":e.dash&&e.dash.length?e.dash.map(t=>t*e.height).join(` `):void 0}),$(`g`,{transform:`translate(0 ${e.height/2})`},Ug({element:e,type:e.startHead})),$(`g`,{transform:`translate(${e.width} ${e.height/2}) rotate(180)`},Ug({element:e,type:e.endHead}))),figure:async({element:e,page:t,store:n,elementHook:r})=>{let i=function(e){let t=e.replace(/<svg[^>]*>/,``);return t=t.replace(/<\/svg>/,``),t}(Eh(e)),a=[];if(e.strokeWidth&&qs(e.stroke)){let t=`figure-stroke-grad-${e.id}`,n=Bg(e.stroke,t);if(n){a.push(n);let r=e.stroke.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);i=i.replace(RegExp(`stroke="${r}"`,`g`),`stroke="url(#${t})"`)}}if(qs(e.fill)){let t=`figure-fill-grad-${e.id}`,n=Bg(e.fill,t);if(n){a.push(n);let r=e.fill.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);i=i.replace(RegExp(`fill="${r}"`,`g`),`fill="url(#${t})"`)}}if(a.length>0){let t=$(`g`,{},$(`defs`,{},...a),$(`g`,{innerHTML:i}));return r&&r({dom:t,element:e})||t}let o=$(`g`,{innerHTML:i});return r&&r({dom:o,element:e})||o},group:async({element:e,page:t,store:n,elementHook:r})=>{let i=$(`g`,{style:{"transform-origin":`top left`}},...await Promise.all(e.children.map(e=>Gg({element:e,page:t,store:n,elementHook:r}))));return r&&r({dom:i,element:e})||i},gif:Hg,table:async({element:e})=>{e.rows;let t=e.cols,n=e.colWidths,r=e.rowHeights,i=[`fontSize`,`fontFamily`,`fontWeight`,`fontStyle`,`textDecoration`,`textTransform`,`fill`,`align`,`verticalAlign`,`lineHeight`,`letterSpacing`,`strokeWidth`,`stroke`,`cellBackground`,`cellPadding`],a=(e.cells||[]).map((n,r)=>{let a=Object.assign(Object.assign({},n),{row:Math.floor(r/t),col:r%t});for(let t of i)a[t]===void 0&&(a[t]=e[t]);return a}),o=[],s=(t,i,a,o)=>{let s=0;for(let t=0;t<i;t++)s+=n[t]*e.width;let c=0;for(let n=0;n<t;n++)c+=r[n]*e.height;let l=0;for(let t=i;t<i+o;t++)l+=(n[t]||0)*e.width;let u=0;for(let n=t;n<t+a;n++)u+=(r[n]||0)*e.height;return{x:s,y:c,width:l,height:u}};for(let e of a)if(!e.mergedInto&&e.cellBackground&&e.cellBackground!==`transparent`){s(e.row,e.col,e.colSpan||1,e.colSpan||1);let{x:t,y:n,width:r,height:i}=s(e.row,e.col,e.rowSpan||1,e.colSpan||1);o.push($(`rect`,{x:t,y:n,width:r,height:i,fill:e.cellBackground}))}let c=(e,t)=>e===`dashed`?`${4*t},${2*t}`:e===`dotted`?`${t},${t}`:void 0,l=(t,n)=>{let r=t.borders?.[n];return{width:r?.width??e.borderWidth,style:r?.style??e.borderStyle??`solid`,color:r?.color??e.borderColor}};for(let e of a){if(e.mergedInto)continue;let t=s(e.row,e.col,e.rowSpan||1,e.colSpan||1);if(e.row===0){let n=l(e,`top`);n.style!==`none`&&n.width>0&&o.push($(`line`,{x1:t.x,y1:t.y+n.width/2,x2:t.x+t.width,y2:t.y+n.width/2,stroke:n.color,"stroke-width":n.width,"stroke-dasharray":c(n.style,n.width)}))}if(e.col===0){let n=l(e,`left`);n.style!==`none`&&n.width>0&&o.push($(`line`,{x1:t.x+n.width/2,y1:t.y,x2:t.x+n.width/2,y2:t.y+t.height,stroke:n.color,"stroke-width":n.width,"stroke-dasharray":c(n.style,n.width)}))}{let n=l(e,`bottom`);n.style!==`none`&&n.width>0&&o.push($(`line`,{x1:t.x,y1:t.y+t.height-n.width/2,x2:t.x+t.width,y2:t.y+t.height-n.width/2,stroke:n.color,"stroke-width":n.width,"stroke-dasharray":c(n.style,n.width)}))}{let n=l(e,`right`);n.style!==`none`&&n.width>0&&o.push($(`line`,{x1:t.x+t.width-n.width/2,y1:t.y,x2:t.x+t.width-n.width/2,y2:t.y+t.height,stroke:n.color,"stroke-width":n.width,"stroke-dasharray":c(n.style,n.width)}))}}for(let t of a){if(t.mergedInto)continue;let i=mc(t.text||``);if(!i)continue;t.textTransform===`uppercase`&&(i=i.toUpperCase());let a=t.cellPadding||4,s=0;for(let r=0;r<t.col;r++)s+=n[r]*e.width;let c=0;for(let n=0;n<t.row;n++)c+=r[n]*e.height;let l=n[t.col]*e.width,u=r[t.row]*e.height,d=t.fontSize||12,f=t.align||`left`,p=s+a,m=`start`;f===`center`?(p=s+l/2,m=`middle`):f===`right`&&(p=s+l-a,m=`end`);let h=c+a+d,g=t.verticalAlign||`top`;g===`middle`?h=c+u/2+d/3:g===`bottom`&&(h=c+u-a),o.push($(`text`,{x:p,y:h,"font-size":d,"font-family":t.fontFamily||`Roboto`,"font-weight":t.fontWeight||`normal`,"font-style":t.fontStyle||`normal`,fill:t.fill||`black`,"text-anchor":m,"text-decoration":t.textDecoration||`none`,"letter-spacing":t.letterSpacing?t.letterSpacing*d+`px`:void 0},i))}return $(`g`,{},...o)}};async function Gg({element:e,page:t,store:n,elementHook:r}){var i;let a=await Wg[e.type];a||(a=()=>$(`g`,{}),console.error(`SVG export does not support ${e.type} type...`));let o=await a({element:e,page:t,store:n}),s=[],c=[];if(e.blurEnabled&&s.push(`blur(${e.blurRadius/2}px)`),e.brightnessEnabled&&s.push(`brightness(${100*e.brightness+100}%)`),e.sepiaEnabled&&s.push(`sepia()`),e.grayscaleEnabled&&s.push(`grayscale()`),e.shadowEnabled&&s.push(`drop-shadow(${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur}px ${e.shadowColor})`),e.filters)for(let[t,n]of Object.entries(e.filters)){let e=Tg(wg[t],n.intensity);if(e&&(s.push(e.filter),e.html)){let t=e.html.replace(/<svg([^>]*)>/,`<g$1>`).replace(/<\/svg>/,`</g>`);c.push(t)}}let l=$(`g`,{className:`element`,id:e.id,transform:e.type===`group`?void 0:`translate(${e.x}, ${e.y}) rotate(${e.rotation})`,display:(i=e.visible)==null||i?void 0:`none`,opacity:e.opacity,style:{"transform-origin":`top left`,filter:s.join(` `)}},o,...c);return r&&r({dom:l,element:e})||l}async function Kg(e){try{let t=await fetch(e),n=t.headers.get(`content-type`)||`font/ttf`,r=await t.arrayBuffer();return`data:${n};base64,${typeof Buffer<`u`?Buffer.from(r).toString(`base64`):function(e){let t=new Uint8Array(e),n=``;for(let e=0;e<t.length;e+=32768){let r=t.subarray(e,e+32768);n+=String.fromCharCode(...r)}if(typeof btoa<`u`)return btoa(n);if(typeof Buffer<`u`)return Buffer.from(t).toString(`base64`);throw Error(`No base64 encoder available in this environment`)}(r)}`}catch(t){return console.error(`Error embedding font:`,t),e}}async function qg({json:e,elementHook:t,fontEmbedding:n=`inline`}){let r=[];zg({children:e.pages},e=>{e.type!==`text`&&e.type!==`tablecell`&&e.type!==`table`||!e.fontFamily||r.indexOf(e.fontFamily)!==-1||r.push(e.fontFamily)});let i=n===`inline`?await async function(e,t){return await Promise.all(e.map(async e=>{if(e===`Arial`)return null;let n=t.find(t=>t.fontFamily===e);if(n)return $(`style`,{},`@font-face { font-family: ${e}; src: url(${await Kg(n.url)}); }`);{let t=`https://fonts.googleapis.com/css?family=${e}:bi,normal,i,b`;try{let n=await(await fetch(t)).text(),r=(n.match(/url\((.*?)\)/g)?.map(e=>e.replace(/url\((.*?)\)/,`$1`)))?.filter(e=>e.startsWith(`https`));if(!r?.length)throw Error(`No font URLs found`);return $(`style`,{},(await Promise.all(r.map(async t=>{let r=await Kg(t),i=n.match(/font-style:\s*(.*?);/),a=n.match(/font-weight:\s*(.*?);/);return`@font-face {\n font-family: ${e};\n font-style: ${i?i[1]:`normal`};\n font-weight: ${a?a[1]:`normal`};\n src: url(${r});\n }`}))).join(`
285
- `))}catch(e){return console.error(`Error embedding Google Font:`,e),$(`defs`,{},$(`style`,{type:`text/css`,innerHTML:`@import url('${t}');`.replace(/&/g,`&amp;`)}))}}}))}(r,e.fonts):[],a=await Promise.all(e.pages.map(n=>async function({page:e,store:t,elementHook:n}){let r=await Promise.all(e.children.map(r=>Gg({element:r,page:e,store:t,elementHook:n}))),i=e.background.indexOf(`url`)>=0||e.background.indexOf(`http`)>=0||e.background.indexOf(`.jpg`)>=0||e.background.indexOf(`.png`)>=0||e.background.indexOf(`.jpeg`)>=0,a;if(i){let n=await xg(e.background);a=await Sg(e.background,Object.assign({width:t.width,height:t.height,x:0,y:0},Cg({width:t.width,height:t.height},{width:n.width,height:n.height})))}return $(`g`,{className:`page`,style:{}},i?$(`image`,{"xlink:href":a,x:0,y:0,width:t.width,height:t.height,preserveAspectRatio:`none`}):$(`rect`,{x:0,y:0,width:t.width,height:t.height,fill:i?void 0:e.background}),...r)}({page:n,store:e,elementHook:t})));return $(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 ${e.width} ${e.height}`,width:e.width,height:e.height},...i,...a)}var Jg=({dom:e,nestLevel:t=0})=>{if(typeof e==`string`)return e;if(!e)return``;let n=e.props,{innerHTML:r}=n,i=Rg(n,[`innerHTML`]),a=Object.keys(i).map(e=>((e,t)=>typeof t==`object`?`${e}="${Object.keys(t).map(e=>`${e}:${t[e]};`).join(` `)}"`:t==null||t===``?``:`${e}="${t}"`)(e,i[e])).filter(e=>e&&e.trim().length>0).join(` `),o=` `.repeat(t);return`${o}<${e.type}${a?` `+a:``}>${r||`
286
- `+e.children.map(e=>Jg({dom:e,nestLevel:t+1})).join(``)}${o}</${e.type}>\n`};async function Yg({json:e,elementHook:t,fontEmbedding:n=`inline`}){return Jg({dom:await qg({json:e,elementHook:t,fontEmbedding:n})})}var Xg=Z.model(`Page`,{id:Z.identifier,children:Z.array(Z.late(()=>V_)),width:Z.optional(Z.union(Z.number,Z.literal(`auto`)),`auto`),height:Z.optional(Z.union(Z.number,Z.literal(`auto`)),`auto`),background:`white`,bleed:0,custom:Z.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(e=>{let t=Object.assign({},e),n={};for(var r in t)r[0]!==`_`&&(n[r]=e[r]);return n}).views(e=>({get store(){return Cl(e,e_)}})).views(e=>({get startTime(){let t=0;for(let n of e.store.pages){if(n.id===e.id)return t;t+=n.duration}return t},get _exportingOrRendering(){return e._exporting||e._rendering}})).views(e=>({get computedWidth(){return e.width===`auto`?e.store.width:e.width},get computedHeight(){return e.height===`auto`?e.store.height:e.height}})).actions(e=>({toJSON:()=>JSON.parse(JSON.stringify(bl(e))),_forEachElementUp(t,n){let r=t.map(t=>({id:t,index:e.children.findIndex(e=>e.id===t)}));r.sort((e,t)=>t.index-e.index);for(let{index:i}of r){if(i==-1)continue;let r=i<e.children.length-1&&e.children[i+1],a=t.indexOf(r?.id)>=0;i===e.children.length-1||a||n(i)}},_forEachElementDown(t,n){let r=t.map(t=>({id:t,index:e.children.findIndex(e=>e.id===t)}));r.sort((e,t)=>e.index-t.index);for(let{index:i}of r){if(i==-1)continue;let r=i>0&&e.children[i-1],a=t.indexOf(r?.id)>=0;i===0||a||n(i)}return!1}})).actions(e=>{let t={clone(t={}){let n=e.toJSON(),r=new Map;n.children.forEach(e=>{let t=e.id,n=Vh(10);r.set(t,n),e.id=n,z_(e,e=>{let t=e.id,n=Vh(10);r.set(t,n),e.id=n})}),n.children.forEach(e=>{e.cells&&e.cells.forEach(e=>{e.mergedInto&&r.has(e.mergedInto)&&(e.mergedInto=r.get(e.mergedInto))})});let i=Object.assign(Object.assign(Object.assign({},n),{id:Vh(10)}),t),a=e.store.addPage(i),o=e.store.pages.indexOf(e);return a.setZIndex(o+1),a.select(),a},setZIndex(t){e.store.setPageZIndex(e.id,t)},set(t){Object.assign(e,t)},select(){e.store.selectPage(e.id)},addElement(t,{skipSelect:n=!1}={}){let r=W_[t.type];if(!r){console.error(`Can not find model with type `+t.type);return}`children`in t&&Array.isArray(t.children)&&z_(t,e=>{e.id=e.id||Vh(10)});let i=e.children.reduce((e,n)=>{if(n.type===`group`){let r=n.children.reduce((e,n)=>{let r=n.name?.match(RegExp(`${t.type}-(\\d+)`));if(r){let t=parseInt(r[1],10);return Math.max(e,t||0)}},0);return Math.max(e,r||0)}{let r=n.name.match(RegExp(`${t.type}-(\\d+)`));if(r){let t=parseInt(r[1],10);return Math.max(e,t||0)}}return e},0),a=r.create(Object.assign({id:Vh(10),name:`${t.type}-${i+1}`},t));return e.children.push(a),a.selectable&&!n&&e.store.selectElements([a.id]),a},canMoveElementsUp(t){let n=!1;return e._forEachElementUp(t,()=>{n||=!0}),n},moveElementsUp(t){e._forEachElementUp(t,t=>{let n=e.children[t];Ol(n),e.children.splice(t+1,0,n)})},canMoveElementsTop:e=>t.canMoveElementsUp(e),moveElementsTop(t){let n=[],r=[];e.children.forEach(e=>{t.indexOf(e.id)>=0?n.push(e):r.push(e)}),e.children.replace(r.concat(n))},canMoveElementsDown(t){let n=!1;return e._forEachElementDown(t,()=>{n||=!0}),n},moveElementsDown(t){e._forEachElementDown(t,t=>{let n=e.children[t];Ol(n),e.children.splice(t-1,0,n)})},canMoveElementsBottom:e=>t.canMoveElementsDown(e),moveElementsBottom(t){let n=[],r=[];e.children.forEach(e=>{t.indexOf(e.id)>=0?n.push(e):r.push(e)}),e.children.replace(n.concat(r))},setElementZIndex(t,n){let r=e.children.find(e=>e.id===t);r&&(Ol(r),e.children.remove(r),e.children.splice(n,0,r))},setSize({width:t,height:n,useMagic:r,softChange:i}){if(r){let r=[],i=t=>t.type===`image`&&t.x<1&&t.y<1&&t.width>=e.computedWidth-2&&t.height>=e.computedHeight-2;R_(e,e=>{e.type!==`group`&&(i(e)||r.push(e))});let a=r.length?zm(r):{x:0,y:0,width:e.computedWidth,height:e.computedHeight},o=1/4,s=Math.max(0,Math.min(a.x,e.computedWidth-a.x-a.width)),c=e.computedWidth*o,l=Math.max(0,s-c),u=Math.max(0,Math.min(a.y,e.computedHeight-a.y-a.height)),d=e.computedHeight*o,f=Math.max(0,u-d),p=e.computedWidth-2*l,m=e.computedHeight-2*f,h=t/p,g=n/m,_=Math.min(h,g),v=(t-p*_)/2-l*_,y=(n-m*_)/2-f*_;R_(e,e=>{if(e.type!==`group`){if(i(e))e.set({x:e.x*_,y:e.y*_,width:e.width*h,height:e.height*g,cropX:0,cropY:0,cropWidth:1,cropHeight:1});else if(e.set({x:v+e.x*_,y:y+e.y*_,width:e.width*_,height:e.height*_}),e.type===`text`)e.set({fontSize:e.fontSize*_});else if(e.type===`figure`)e.set({strokeWidth:e.strokeWidth*_});else if(e.type===`table`){e.set({borderWidth:e.borderWidth*_});for(let t of e.cells){let e={fontSize:t.fontSize*_,cellPadding:t.cellPadding*_};if(t.borders){let n=JSON.parse(JSON.stringify(t.borders));for(let e of[`top`,`right`,`bottom`,`left`])n[e]?.width!=null&&(n[e]=Object.assign(Object.assign({},n[e]),{width:n[e].width*_}));e.borders=n}t.set(e)}}}})}i||(e.width=t),i||(e.height=n)}};return t}).actions(e=>({moveElementUp(t){console.warn(`page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead.`),e.moveElementsUp([t])},moveElementDown(t){console.warn(`page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead.`),e.moveElementsDown([t])},moveElementTop(t){console.warn(`page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead.`),e.moveElementsTop([t])},moveElementBottom(t){console.warn(`page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead.`),e.moveElementsBottom([t])},play(){e.store.play({startTime:e.startTime,endTime:e.startTime+e.duration})}})),Zg=Z.model(`Audio`,{id:Z.identifier,src:``,duration:0,startTime:0,endTime:1,volume:1,delay:0,custom:Z.frozen()}).actions(e=>({toJSON:()=>Object.assign({},bl(e))})).actions(e=>({set(t){Object.assign(e,t)}})),Qg=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};ol(`ignore`);var $g=Z.model(`Font`,{fontFamily:Z.string,url:Z.optional(Z.string,``),styles:Z.frozen()}).preProcessSnapshot(e=>Object.assign(Object.assign({},e),{fontFamily:e.fontFamily||e.name})),e_=Z.model(`Store`,{role:``,pages:Z.array(Xg),fonts:Z.array($g),audios:Z.array(Zg),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:Z.optional(Z.enumeration(`UnitType`,[`pt`,`mm`,`cm`,`in`,`px`]),`px`),dpi:72,schemaVersion:3,bleedVisible:!1,rulesVisible:!1,distanceGuidesVisible:!1,openedSidePanel:``,previousOpenedSidePanel:``,custom:Z.frozen(),tool:Z.optional(Z.enumeration(`Tool`,[`selection`,`draw`,`pan`,`text`,`eraser`]),`selection`),toolOptions:Z.optional(Z.model({brushType:Z.optional(Z.enumeration(`BrushType`,[`brush`,`highlighter`]),`brush`),strokeWidth:Z.optional(Z.number,5),stroke:Z.optional(Z.string,`#000000`),opacity:Z.optional(Z.number,1)}),{}),selectedElementsIds:Z.array(Z.string),animatedElementsIds:Z.array(Z.string),history:Z.optional(Uh,{targetPath:`../pages`}),_elementsPixelRatio:Math.min(2,typeof window<`u`&&window.devicePixelRatio||1),_activePageId:``,_selectedPagesIds:Z.array(Z.string),_forceShowCredit:!1,_key:``,_validated:!1}).views(e=>{let t=Vt(()=>{let t={};return z_({children:e.pages},e=>(t[e.id]=e,!1)),t},{keepAlive:!0});return{get _idsMap(){return t.get()}}}).views(e=>({get _bleedVisible(){return console.warn(`store._bleedVisible is deprecated. Please use store.bleedVisible instead.`),e.bleedVisible},get selectedElements(){return e.selectedElementsIds.map(t=>{for(let n of e.pages)for(let e of n.children)if(e.id===t)return e}).filter(e=>!!e)},get children(){return e.pages},get selectedShapes(){let e=[];return R_({children:this.selectedElements},t=>{t.type!==`group`&&e.push(t)}),e},get activePage(){return e.pages.slice().find(t=>t.id===e._activePageId)||(e.pages.length?e.pages[0]:null)},get selectedPages(){return e._selectedPagesIds.map(t=>e.pages.find(e=>e.id===t))},get duration(){let t=0;return e.pages.forEach(e=>{t+=e.duration}),t},get _hasCroppedImages(){return this.find(e=>e.type===`image`&&e._cropModeEnabled)},find(t){let n;return z_({children:e.pages},e=>{if(!n&&t(e))return n=e,!0}),n},getElementById:t=>e._idsMap[t]})).actions(e=>{let t=0,n=null,r=!1,i={afterCreate(){e.history.canUndo},setCurrentTime(t){e.currentTime=t},_togglePlaying(t=!e.isPlaying){e.isPlaying=t},play({animatedElementsIds:a=[],startTime:o=0,currentTime:s=0,endTime:c=e.duration,repeat:l=!1}={}){s&&(console.warn(`currentTime property of store.play() is deprecated. Please use startTime instead.`),o=s),e.animatedElementsIds=jl(a),e.currentTime=o,e.isPlaying=!0,t=Date.now(),n=c,r=l,requestAnimationFrame(()=>i.seek())},checkActivePage(){let t=0;for(let n of e.pages){if(e.currentTime>=n.startTime&&e.currentTime<n.startTime+n.duration){i.selectPage(n.id);break}t+=n.duration}},seek(){if(!e.isPlaying)return;let a=Date.now(),o=a-t;t=a,e.currentTime+=o,i.checkActivePage();let s=n||e.duration;e.isPlaying&&e.currentTime<s?requestAnimationFrame(()=>i.seek()):e.isPlaying&&r?(e.currentTime=0,requestAnimationFrame(()=>i.seek())):i.stop()},stop(){e.isPlaying=!1,e.currentTime=0,e.animatedElementsIds=jl([]),i.checkActivePage()},__(){e._validated||=(ug(e._key,e._forceShowCredit),!0)},set(t){Object.assign(e,t)},setUnit({unit:t,dpi:n}){e.unit=t||e.unit,e.dpi=n||e.dpi},setRole(t){e.role=t},setTool(t){e.tool=t},setToolOptions(t){Object.assign(e.toolOptions,t)},addPage(t){let n=Xg.create(Object.assign({id:Vh(10)},t));return e.pages.push(n),e._activePageId=n.id,n},selectPage(t){e._activePageId=t,e._selectedPagesIds.length===1&&(e._selectedPagesIds=jl([t]))},selectPages(t){e._selectedPagesIds=jl(t),e._selectedPagesIds.length===1&&(e._activePageId=e._selectedPagesIds[0])},selectElements(t){e.selectedElementsIds=jl(t.map(t=>e.getElementById(t)).sort((e,t)=>e.page.children.indexOf(e)-e.page.children.indexOf(t)).filter(e=>!!e).map(e=>e.id))},toggleBleed(t){e.bleedVisible=t??!e.bleedVisible},toggleRulers(t){e.rulesVisible=t??!e.rulesVisible},toggleDistanceGuides(t){e.distanceGuidesVisible=t??!e.distanceGuidesVisible},openSidePanel(t){e.openedSidePanel!==t&&(e.previousOpenedSidePanel=e.openedSidePanel,e.openedSidePanel=t)},restoreSidePanel(){let t=e.previousOpenedSidePanel;t&&t!==e.openedSidePanel?e.openedSidePanel=t:e.openedSidePanel=`photos`},setScale(t){e.scale=t},_setScaleToFit(t){e.scaleToFit=t},setElementsPixelRatio(t){e._elementsPixelRatio=t},setSize(t,n,r){e.pages.forEach(e=>{e.setSize({width:t,height:n,useMagic:r,softChange:!0})}),e.width=t,e.height=n},setPageZIndex(t,n){let r=e.pages.find(e=>e.id===t);r&&(Ol(r),e.pages.remove(r),e.pages.splice(n,0,r))},deletePages(t){let n=e.pages.indexOf(e.activePage);t.forEach(t=>{kl(e.pages.find(e=>e.id===t))});let r=Math.min(e.pages.length-1,n),i=e.pages[r];i&&(e._activePageId=i.id),e.selectedElementsIds=jl(e.selectedElementsIds.filter(t=>e.getElementById(t)))},groupElements(t,n={}){let r=t.map(t=>e.getElementById(t)),i=r[0].page;if(r.forEach(e=>{e&&Ol(e)}),!r.length)return;let a=i.children.reduce((e,t)=>{if(t.type===`group`){let n=t.name.match(/group-(\d+)/);if(n){let t=parseInt(n[1],10);return Math.max(e,t)}}return e},0),o=Object.assign({id:Vh(10),name:`group-${a+1}`,children:r,type:`group`},n);return i.children.push(o),e.selectedElementsIds=jl([o.id]),i.children.find(e=>e.id===o.id)},ungroupElements(t){let n=t.map(t=>e.getElementById(t)),r=[];n.forEach(e=>{if(e&&e.type===`group`){let t=e.page,n=t.children.indexOf(e);e.children.forEach(e=>{r.push(e.id)}),e.children.forEach(e=>{Ol(e),t.children.push(e)}),t.children.splice(n,1)}}),e.selectedElementsIds=jl(r)},deleteElements(t){let n=[];e.find(e=>(t.includes(e.id)&&n.push(e),!1)),n.forEach(e=>{kl(e)}),e.selectedElementsIds=jl(e.selectedElementsIds.filter(t=>e.getElementById(t)))},on(t,n){if(t===`change`){let t=i.toJSON();return _l(e,e=>{let r=i.toJSON();!Hh(t,r)&&(t=r,n(r))})}},async _toCanvas({pixelRatio:t,ignoreBackground:n,pageId:r,mimeType:o,includeBleed:s,_skipTimeout:c,quickMode:l=!1,_exportCanvases:u}={}){let f=t||1;r||=e.pages[0]?.id;let p=e.pages.find(e=>e.id===r);if(!p)throw Error(`No page for export with id ${r}`);let m=e._elementsPixelRatio;f>e._elementsPixelRatio&&i.setElementsPixelRatio(f),l?p?.set({_forceMount:!0}):p?.set({_exporting:!0});let h=await bg(()=>{let e=a.stages.filter(e=>e.getAttr(`pageId`)===r);return e.length===0?null:e});if(!h)throw p?.set({_forceMount:!1,_exporting:!1}),i.setElementsPixelRatio(m),Error(`Export is failed. Can not find stage for page ${r}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);h.length>1&&console.error(`Polotno error: Detected several canvas elements for page "${r}" in the document. This is not supported and will lead to incorrect export. Make sure to use unique ids for all pages and make sure you unmount <Workspace /> when it is not needed.`);let g=h[0];await i.waitLoading({_skipTimeout:c});let _=g.findOne(`.page-container`);if(!_)throw i.setElementsPixelRatio(m),p?.set({_forceMount:!1,_exporting:!1}),Error(`Export is failed. Canvas was unmounted.`);let v=g.position();g.position({x:0,y:0}),g.find(`Transformer`).forEach(e=>{e.setAttr(`oldVisible`,e.visible()),e.visible(!1)}),_.find(`.page-background`).forEach(e=>e.shadowEnabled(!1)),_.find(`.page-background`).forEach(e=>e.strokeEnabled(!1)),_.find(`.highlighter`).forEach(e=>e.visible(!1));let y=_.findOne(`.page-background-group`),b=y.clip();y.clip({x:null,y:null,width:null,height:null});let x=_.findOne(`.elements-container`),S=x.clip();x.clip({x:null,y:null,width:null,height:null});let C=_.find(e=>!e.visible()&&e.getAttr(`editModeEnabled`)&&!e.getAttr(`hideInExport`));C.forEach(e=>{e.setAttr(`oldVisible`,e.visible()),e.show()});let w=_.find(e=>e.getAttr(`hideInExport`));w.forEach(e=>{e.setAttr(`oldVisible`,e.visible()),e.hide()}),n&&_.find(`.page-background`).forEach(e=>e.hide());let T=s?p.bleed:0,E=T;!e.bleedVisible&&s||(e.bleedVisible||s?e.bleedVisible&&s?E=0:e.bleedVisible&&!s&&(E=-p.bleed):E=0);let D=p.computedWidth+2*T,O=p.computedHeight+2*T,k=_.scale();_.scale({x:1,y:1});let A=d(_,{x:_.x()-E,y:_.y()-E,width:D,height:O,pixelRatio:f,sceneCanvas:u?.sceneCanvas,bufferCanvas:u?.bufferCanvas});_.scale(k);let j=A._canvas;if(o===`image/jpeg`){let e=j.getContext(`2d`);e.save(),e.globalCompositeOperation=`destination-over`,e.fillStyle=`white`,e.fillRect(0,0,j.width,j.height),e.restore()}return n&&_.find(`.page-background`).forEach(e=>e.show()),w.forEach(e=>{e.visible(e.getAttr(`oldVisible`))}),C.forEach(e=>{e.visible(e.getAttr(`oldVisible`))}),_.find(`.page-background`).forEach(e=>e.shadowEnabled(!0)),_.find(`.page-background`).forEach(e=>e.strokeEnabled(!0)),g.find(`Transformer`).forEach(e=>{e.visible(e.getAttr(`oldVisible`))}),_.find(`.highlighter`).forEach(e=>e.visible(!0)),y.clip(b),x.clip(S),g.position(v),p?.set({_exporting:!1,_forceMount:!1}),await Promise.resolve(),i.setElementsPixelRatio(m),j},async toDataURL(t={}){var{mimeType:n,quality:r,dpi:o,dpiMetadata:s=`auto`}=t,c=Qg(t,[`mimeType`,`quality`,`dpi`,`dpiMetadata`]);let l=await i._toCanvas(Object.assign({mimeType:n},c)),u=n||`image/png`,d=l.toDataURL(u,r);a.Util.releaseCanvas(l);let f=o??e.dpi;return u!==`image/png`&&u!==`image/jpeg`||s===`never`||s===`auto`&&f===72?d:hg(d,u,f)},async toBlob(e={}){var{mimeType:t,quality:n}=e,r=Qg(e,[`mimeType`,`quality`]);let o=await i._toCanvas(Object.assign({mimeType:t},r)),s=await new Promise(e=>{o.toBlob(e,t,n)});return a.Util.releaseCanvas(o),s},async saveAsImage(e={}){var{fileName:t}=e,n=Qg(e,[`fileName`]);let r=(n.mimeType||`image/png`).split(`/`)[1];Wh(await i.toDataURL(n),t||`polotno.`+r)},async _toPDF(t){let n=t.dpi||e.dpi,r=t.parallel||1,a=t.unit||(e.unit===`px`?`mm`:e.unit),o=t.pixelRatio||1,s=t.pageIds||e.pages.map(e=>e.id),c=e.pages.filter(e=>s.includes(e.id)),l=await Kh(),u=e=>gg({px:e,unit:a,dpi:n}),d=t.cropMarkSize||0,f=u(d),p=c[0]||{},m=t.includeBleed?p.bleed:0,h=u(p.computedWidth+2*m+2*f),g=u(p.computedHeight+2*m+2*f);var _=new l({unit:a,orientation:h>g?`landscape`:`portrait`,format:[h,g],compress:!0,putOnlyUsedFonts:!0});_.deletePage(1);let v=((e,t)=>{let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n})(c,r),y=0;for(let e of v){let n=e.map(async e=>{let n=t.includeBleed?e.bleed:0,r=e.computedWidth+2*n+2*d,a=e.computedHeight+2*n+2*d,c=u(r),l=u(a),f=0,p=o;for(;f<10;){f+=1;let n=await i.toDataURL(Object.assign(Object.assign({},t),{pageId:e.id,pixelRatio:p,dpiMetadata:`never`}));if(n.length>20)return p!==o&&console.error(`Polotno can not export PDF with current settings. Quality is automatically reduced. pixelRatio was reduced to ${parseFloat(p.toFixed(3))}.`),t.onProgress&&t.onProgress(++y/s.length*.9),{url:n,width:c,height:l,widthPx:r,heightPx:a};p*=.8}});(await Promise.all(n)).filter(e=>e!==void 0).forEach(({url:e,width:t,height:n,widthPx:r,heightPx:i})=>{_.addPage([t,n],t>n?`landscape`:`portrait`);let o=_.getCurrentPageInfo();var s;switch(a){case`pt`:s=1;break;case`mm`:s=72/25.4;break;case`cm`:s=72/2.54;break;case`in`:s=72;break;case`px`:s=.75;break;default:throw`Invalid unit: `+a}if(o.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:t*s,topRightY:n*s},o.pageContext.artBox={bottomLeftX:u(d+m)*s,bottomLeftY:u(d+m)*s,topRightX:u(r-d-m)*s,topRightY:u(i-d-m)*s},o.pageContext.bleedBox={bottomLeftX:u(d+m)*s,bottomLeftY:u(d+m)*s,topRightX:u(r-d-m)*s,topRightY:u(i-d-m)*s},f){_.setLineWidth(u(1));let e=f+u(m);_.line(e,0,e,f),_.line(0,e,f,e),_.line(t-e,0,t-e,f),_.line(t,e,t-f,e),_.line(0,n-e,f,n-e),_.line(e,n,e,n-f),_.line(t,n-e,t-f,n-e),_.line(t-e,n,t-e,n-f)}_.addImage(e,f,f,t-2*f,n-2*f,void 0,`FAST`)})}return _},toPDFDataURL:async e=>(await i._toPDF(Object.assign({mimeType:`image/jpeg`},e))).output(`datauristring`),async toGIFDataURL(t={}){let n=t.pixelRatio||1,r=await Jh({width:e.width*n,height:e.height*n}),a=1e3/(t.fps||10),o=e.duration/a;for(let t=0;t<o-1;t++){let o=t*a||1;i.setCurrentTime(o);let s=0,c=``;for(let t of e.pages)if(s+=t.duration,t.set({_rendering:s>o}),s>o){c=t.id;break}let l=await i._toCanvas({pixelRatio:n,pageId:c,_skipTimeout:!0});r.addFrame(l.getContext(`2d`),{delay:a,copy:!0})}for(let t of e.pages)t.set({_rendering:!1});return i.stop(),r.render(),new Promise(e=>{r.on(`finished`,function(t){(function(e,t){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.readAsDataURL(e)})(t,e)})})},async saveAsGIF(e={}){var{fileName:t}=e,n=Qg(e,[`fileName`]);Wh(await i.toGIFDataURL(n),t||`polotno.gif`)},async toHTML({elementHook:e}={}){return Lg({json:i.toJSON(),elementHook:e})},async saveAsHTML({fileName:e,elementHook:t}={}){let n=await i.toHTML({elementHook:t});Wh(`data:text/html;base64,`+window.btoa(unescape(encodeURIComponent(n))),e||`polotno.html`)},async toSVG({elementHook:e,pageId:t,fontEmbedding:n=`inline`}={fontEmbedding:`inline`}){let r=i.toJSON();t||=r.pages[0]?.id;let a=r.pages.find(e=>e.id===t);return Yg({json:Object.assign(Object.assign({},r),{pages:a?[a]:[]}),elementHook:e,fontEmbedding:n})},async saveAsSVG({fileName:e,elementHook:t,pageId:n,fontEmbedding:r=`inline`}={}){let a=await i.toSVG({elementHook:t,pageId:n,fontEmbedding:r});Wh(`data:text/svg;base64,`+window.btoa(unescape(encodeURIComponent(a))),e||`polotno.svg`)},async saveAsPDF(e={}){var{fileName:t}=e,n=Qg(e,[`fileName`]);(await i._toPDF(Object.assign({mimeType:`image/jpeg`},n))).save(t||`polotno.pdf`)},async waitLoading({_skipTimeout:e=!1}={}){e||await new Promise(e=>setTimeout(e,50)),await uc()},toJSON:()=>({width:e.width,height:e.height,fonts:bl(e.fonts),pages:bl(e.pages),audios:bl(e.audios),unit:e.unit,dpi:e.dpi,custom:e.custom,schemaVersion:e.schemaVersion}),loadJSON(t,n=!1){var r,i;let a=typeof n==`boolean`?n:(r=n?.keepHistory)!=null&&r,o=typeof n!=`boolean`&&(i=n?.modernizeTextBackground)!=null&&i,s=JSON.parse(JSON.stringify(t)),c=s.schemaVersion||0;c<1&&Lc.htmlRenderEnabled&&z_({children:s.pages},e=>{e.type===`text`&&(e.letterSpacing=e.letterSpacing*16/e.fontSize)}),c<2&&z_({children:s.pages},e=>{e.filters&&Object.keys(e.filters).forEach(t=>{if([`warm`,`cold`,`natural`].includes(t))return;let n=e.filters[t];n&&typeof n.intensity==`number`&&(n.intensity/=100)})}),c<3&&Lc.htmlRenderEnabled&&!o&&z_({children:s.pages},e=>{e.type===`text`&&e.backgroundEnabled&&(e.legacyBackground=!0)}),delete s.schemaVersion;let l=e.activePage?e.pages.indexOf(e.activePage):0;s._activePageId=(s.pages[l]||s.pages[0])?.id;let u=Object.assign({},bl(e));Object.assign(u,s),u.history=a?bl(e.history):{history:[],undoIdx:-1,targetPath:``},yl(e,u)},clear({keepHistory:t=!1}={}){let n=e.pages.map(e=>e.id);i.deletePages(n),e.custom=null,t||e.history.clear()},addFont(t){i.removeFont(t.fontFamily),e.fonts.push(t)},removeFont(t){e.fonts.filter(e=>e.fontFamily===t).forEach(e=>kl(e))},addAudio(t){let n=Zg.create(Object.assign({id:Vh(10)},t));e.audios.push(n)},removeAudio(t){let n=e.audios.find(e=>e.id===t);n&&e.audios.remove(n)},async loadFont(t,n,r,i){let a=e.fonts.find(e=>e.fontFamily===t)||_c.find(e=>e.fontFamily===t),o=[{fontStyle:`normal`,fontWeight:`normal`},{fontStyle:`normal`,fontWeight:`bold`}];return a?(a.styles&&(o=a.styles.map(e=>({fontStyle:e.fontStyle||`normal`,fontWeight:e.fontWeight||`normal`}))),Ic(a)):Nc(t),n&&r&&!o.some(e=>e.fontStyle===n&&e.fontWeight===r)&&o.push({fontStyle:n,fontWeight:r}),Promise.all(o.map(e=>Oc(t,e.fontStyle,e.fontWeight,i)))},validate:e=>e_.validate(e,[{path:``,type:e_}]).map(e=>({path:`store`+e.context.map(e=>e.path).join(`.`),message:e.message}))};return i});function t_({key:e,showCredit:t}={key:``,showCredit:!1}){return e_.create({_forceShowCredit:t,_key:e})}var n_=Z.model(`Node`,{id:Z.identifier,type:`none`,name:``,opacity:1,custom:Z.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(e=>{for(var t in e)e[t]===null&&(e[t]=void 0);return e}).postProcessSnapshot(e=>{let t=Object.assign({},e),n={};for(var r in t)r[0]!==`_`&&(n[r]=e[r]);return n}).views(e=>({get page(){return Cl(e,Xg)},get store(){return Cl(e,e_)},get top(){let t=e;for(;;){if(!Sl(t,H_))return t;t=Cl(t,H_)}},get parent(){if(Sl(e,H_)){let t=Cl(e,H_);return t&&t.children&&t.children.length,t}if(Sl(e,Xg)){let t=Cl(e,Xg);return t&&t.children&&t.children.length,t}if(Sl(e,e_)){let t=Cl(e,e_);return t&&t.pages&&t.pages.length,t}return null},get zIndex(){return e.parent.children.indexOf(e)}})).actions(e=>({toJSON:()=>Object.assign({},bl(e))})).actions(e=>({clone(t={},{skipSelect:n=!1}={}){let r=JSON.parse(JSON.stringify(e.toJSON()));t.id=t.id||Vh(10);let i=new Map;return z_(r,e=>{let t=e.id,n=Vh(10);i.set(t,n),e.id=n}),z_(r,e=>{e.mergedInto&&i.has(e.mergedInto)&&(e.mergedInto=i.get(e.mergedInto))}),Object.assign(r,t),e.page.addElement(r,{skipSelect:n})},set(t){Object.assign(e,t)},moveUp(){e.page.moveElementsUp([e.id])},moveTop(){e.page.moveElementsTop([e.id])},moveDown(){e.page.moveElementsDown([e.id])},moveBottom(){e.page.moveElementsBottom([e.id])},setZIndex(t){e.parent.setElementZIndex(e.id,t)},beforeDestroy(){}})),r_={right:{from:{x:-200},to:{x:0}},left:{from:{x:200},to:{x:0}},up:{from:{y:200},to:{y:0}},down:{from:{y:-200},to:{y:0}},"bottom-right":{from:{x:-200,y:-200},to:{x:0,y:0}},"bottom-left":{from:{x:200,y:-200},to:{x:0,y:0}},"top-right":{from:{x:-200,y:200},to:{x:0,y:0}},"top-left":{from:{x:200,y:200},to:{x:0,y:0}}},i_={right:{cropX:-1},left:{cropX:1},up:{cropY:1},down:{cropY:-1}},a_={none:()=>({}),fade:({dTime:e,element:t,animation:n})=>{let r=e/n.duration;return n.type===`enter`?{opacity:r*t.opacity}:{opacity:(1-r)*t.opacity}},rotate:({dTime:e,element:t,animation:n})=>{let r=e/n.duration*360;return Hm({x:t.x,y:t.y,width:t.width,height:t.height,rotation:t.rotation},r)},blink:({dTime:e,element:t,animation:n})=>{let r=n.duration,i=e%r/(r/2),a=i<=1?i:2-i;return{opacity:t.opacity*a}},bounce:({dTime:e,element:t,animation:n})=>{let r=n.duration,i=r/2,a=n.data.strength??1,o={},s={x:t.x+t.width/3*a,y:t.y+t.height/3*a,width:t.width/3*a,height:t.height/3*a,fontSize:t.fontSize/3*a},c={x:t.x,y:t.y,width:t.width,height:t.height,fontSize:t.fontSize},l=e%r/i,u=l<=1?l:2-l;for(let e in s){let t=s[e];o[e]=t+u*(c[e]-t)}return o},move:({dTime:e,element:t,animation:n})=>{let r=r_[n.data.direction]||r_.right,i=n.data.strength??1,a={};for(var o in r.from){let s=r.from[o],c=r.to[o];n.type===`exit`&&(s=r.to[o],c=-r.from[o]),s*=i,c*=i;let l=t[o]+s,u=t[o]+c-l;a[o]=l+e/n.duration*u}return a},zoom:({dTime:e,element:t,animation:n})=>{let r={},i=1+(((n.data.direction||`in`)===`in`?3/4:5/4)-1)*(n.data.strength??1),a=t.rotation*Math.PI/180,o=Math.cos(a),s=Math.sin(a),c=t.width*(1-i),l=t.height*(1-i),u=(c*o-l*s)/2,d=(c*s+l*o)/2,f={x:t.x+u,y:t.y+d,width:t.width*i,height:t.height*i,fontSize:t.fontSize*i},p={x:t.x,y:t.y,width:t.width,height:t.height,fontSize:t.fontSize};for(var m in f){let t=f[m],i=p[m];if(n.type===`exit`){let e=t;t=i,i=e}let a=i-t;r[m]=t+e/n.duration*a}return r},cameraZoom:({dTime:e,element:t,animation:n})=>{let r={},i=i_[n.data.direction||`right`]||i_.right,a=n.data.movementStrength??.1,o=n.data.shakeStrength??.015,s=n.data.zoomStrength??.6,c=e/n.duration,l=o*(1-c),u=Math.sin(12*c)*l*.7+Math.sin(8*c)*l*.3;if(n.type===`exit`){let e=Math.max(t.cropWidth||1,t.cropHeight||1);s=Math.min(s,1-e)}n.type;let d=1-(1-c)**2,f=t.cropX||0,p=t.cropY||0,m=t.cropWidth||1,h=t.cropHeight||1,g=m,_=h,v,y,b=0,x=0;if(i.cropX){let e=i.cropX>0?1-(f+m):f;b=Math.min(e,Math.abs(a))*i.cropX}if(i.cropY){let e=i.cropY>0?1-(p+h):p;x=Math.min(e,Math.abs(a))*i.cropY}return n.type===`enter`?(v=i.cropX?f+b*(1-d):f,y=i.cropY?p+x*(1-d):p):(v=i.cropX?f+b*d:f,y=i.cropY?p+x*d:p),r.cropX=Math.max(0,Math.min(1-g,v+u*g)),r.cropY=Math.max(0,Math.min(1-_,y+u*_)),r.cropWidth=g,r.cropHeight=_,r}},o_=({element:e,dTime:t,animation:n})=>{let r=a_[n.name];return r?r({element:e,dTime:t,animation:n}):(console.error(`Can not find animation type: `+n.name),{})},s_=Z.model(`Animation`,{delay:0,duration:500,enabled:!0,type:Z.enumeration(`Type`,[`enter`,`exit`,`loop`]),name:`none`,data:Z.frozen({})}),c_=(e,t)=>{let n={};for(let r in t)if(typeof e[r]==`number`&&typeof t[r]==`number`){let i=t[r]-e[r];i!==0&&(n[r]=i)}return n},l_=Z.model(`ShapeFilter`,{intensity:1}),u_=[`temperature`,`contrast`,`highlights`,`shadows`,`white`,`black`,`saturation`,`vibrance`],d_=n_.named(`Shape`).props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:Z.array(s_),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,filters:Z.map(l_),shadowEnabled:!1,shadowBlur:5,shadowOffsetX:0,shadowOffsetY:0,shadowColor:`black`,shadowOpacity:1,visible:!0,draggable:!0,resizable:!0,selectable:!0,contentEditable:!0,styleEditable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(e=>{let t=Object.assign(Object.assign({},e),{x:`x`in e&&e.x||0,y:`y`in e&&e.y||0,filters:`filters`in e?Array.isArray(e.filters)?{}:e.filters:void 0});return`width`in e&&(t.width=t.width||1),`height`in e&&(t.height=t.height||1),`locked`in e&&e.locked&&(t.draggable=!1,t.contentEditable=!1,t.styleEditable=!1,t.resizable=!1,t.removable=!1),t}).views(e=>{let t=[`x`,`y`,`width`,`height`,`rotation`,`opacity`,`color`,`fontSize`,`cropX`,`cropY`,`cropWidth`,`cropHeight`],n=e,r={x:n.x??0,y:n.y??0,width:n.width??0,height:n.height??0,rotation:n.rotation??0,opacity:n.opacity??1};for(let i of t)i in e&&(r[i]=n[i]);let i=z(r),a=H(e=>{for(let t in e)i[t]=e[t]}),o=H(e=>{Object.assign(i,e)}),s=H(e=>{for(let t in e)typeof i[t]==`number`&&(i[t]=i[t]+e[t])});return{get locked(){return!(e.draggable||e.contentEditable||e.styleEditable||e.resizable)},get a(){let{currentTime:t}=e.store,r={};for(let e in i)r[e]=n[e];if(a(r),t===0)return i;let c=t-e.page.startTime;if(c>e.page.duration||c<0)return i;let l=e.store.animatedElementsIds;if(l.length&&!l.includes(e.id))return i;let u=e.animations.find(e=>e.type===`enter`),d=u?.enabled&&c<u.delay;d&&o({opacity:0});let f=u?.enabled&&c>=u.delay&&c<=u.delay+u.duration;f&&s(c_(e,o_({element:e,animation:u,dTime:c-u.delay})));let p=e.animations.find(e=>e.type===`exit`);!d&&!f&&p?.enabled&&c>=e.page.duration-p.duration-p.delay&&c<=e.page.duration-p.delay&&s(c_(e,o_({element:e,animation:p,dTime:c-(e.page.duration-p.duration-p.delay)}))),p!=null&&p.enabled&&c>=e.page.duration-p.delay&&o({opacity:0});let m=e.animations.find(e=>e.type===`loop`);return m?.enabled&&s(c_(e,o_({element:e,animation:m,dTime:c}))),i},animated(e){return this.a[e]},get isSelected(){return!!Al(e)&&e.store.selectedShapes.indexOf(e)>=0&&e.selectable},get isSelectedDirectly(){return!!Al(e)&&e.store.selectedElements.indexOf(e)>=0&&e.selectable}}}).actions(e=>({setAnimation(t,n){let r=e.animations.find(e=>e.type===t);r?Object.assign(r,n):e.animations.push(Object.assign({type:t},n))},setFilter(t,n){u_.includes(t)||e.filters.forEach((t,n)=>{u_.includes(n.toString())||e.filters.delete(n.toString())}),n==null?e.filters.delete(t):e.filters.set(t,{intensity:n})}})),f_=d_.named(`Text`).props({type:`text`,text:``,placeholder:``,fontSize:14,fontFamily:`Roboto`,fontStyle:`normal`,fontWeight:`normal`,textDecoration:``,textTransform:`none`,fill:`black`,align:`center`,width:100,height:0,verticalAlign:`top`,strokeWidth:0,stroke:`black`,lineHeight:Z.optional(Z.union(Z.number,Z.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:`#7ED321`,backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5,legacyBackground:Z.maybe(Z.boolean),curveEnabled:!1,curvePower:.5}).preProcessSnapshot(e=>Object.assign(Object.assign({},e),{fontSize:e.fontSize!=null&&e.fontSize<1?1:e.fontSize})).actions(e=>{let t=e.set;return{set(e){e.fontSize!=null&&e.fontSize<1&&(e=Object.assign(Object.assign({},e),{fontSize:1})),t(e)},afterCreate(){if(!e.height){let t=e.lineHeight,n=typeof t==`number`?t:parseFloat(t)||1.2;e.height=Math.round(e.fontSize*n)}},toggleEditMode(t){let n=t??!e._editModeEnabled;n!==e._editModeEnabled&&(e._editModeEnabled=n,e._editModeEnabled?e.store.history.startTransaction():e.store.history.endTransaction())}}}),p_=d_.named(`Image`).props({type:`image`,width:100,height:100,src:``,cropX:0,cropY:0,cropWidth:1,cropHeight:1,cornerRadius:0,flipX:!1,flipY:!1,clipSrc:``,borderColor:`black`,borderSize:0,keepRatio:!1,stretchEnabled:!1}).extend(e=>{let t=z.box(!1),n=!1;return{views:{get _cropModeEnabled(){return t.get()}},actions:{toggleCropMode(r){let i=r??!t.get();t.set(i),i&&!n?(e.store.history.startTransaction(),n=!0):!i&&n&&(e.store.history.endTransaction(),n=!1)},beforeDestroy(){n&&=(e.store.history.endTransaction(),!1)}}}}),m_=p_.named(`Video`).props({type:`video`,duration:0,startTime:0,endTime:1,volume:1}),h_=d_.named(`Line`).props({type:`line`,width:400,height:10,color:`black`,dash:Z.array(Z.number),startHead:``,endHead:``}).actions(e=>({})),g_=d_.named(`SVG`).props({type:`svg`,src:``,maskSrc:``,cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,stretchEnabled:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:`black`,borderSize:0,cornerRadius:0,colorsReplace:Z.map(Z.string)}).preProcessSnapshot(e=>Object.assign(Object.assign({},e),{src:e.src||e.svgSource,colorsReplace:Array.isArray(e.colorsReplace)?{}:e.colorsReplace})).actions(e=>({replaceColor(t,n){e.colorsReplace.set(t,n)}})),__=d_.named(`Figure`).props({type:`figure`,subType:`rect`,fill:`rgb(0, 161, 255)`,dash:Z.array(Z.number),strokeWidth:0,stroke:`rgba(98, 197, 255, 1)`,cornerRadius:0}),v_=p_.named(`Gif`).props({type:`gif`,duration:0,keepRatio:!0}),y_=.05,b_=Z.enumeration([`solid`,`dashed`,`dotted`,`none`]);function x_(e){return xl(e,2)}function S_(e,t,n){return e[`_${t}`]??(Al(e)?x_(e)[t]:n)}function C_(e){return xl(e,1)}var w_=Z.model(`BorderSide`,{color:Z.maybe(Z.string),width:Z.maybe(Z.number),style:Z.maybe(b_)}).postProcessSnapshot(e=>{let t={};for(let[n,r]of Object.entries(e))r!=null&&(t[n]=r);return t}),T_=Z.model(`CellBorders`,{top:Z.maybe(w_),right:Z.maybe(w_),bottom:Z.maybe(w_),left:Z.maybe(w_)}).postProcessSnapshot(e=>{let t={};for(let[n,r]of Object.entries(e))typeof r==`object`&&r&&Object.keys(r).length>0&&(t[n]=r);return t}),E_=[`fontSize`,`fontFamily`,`fontWeight`,`fontStyle`,`textDecoration`,`textTransform`,`fill`,`align`,`verticalAlign`,`lineHeight`,`letterSpacing`,`strokeWidth`,`stroke`,`cellBackground`,`cellPadding`],D_=new Set(E_),O_=[`blurEnabled`,`blurRadius`,`brightnessEnabled`,`brightness`,`sepiaEnabled`,`grayscaleEnabled`,`filters`,`shadowEnabled`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`,`shadowColor`,`shadowOpacity`],k_=[`id`,`type`,`text`,`opacity`,`rowSpan`,`colSpan`,`mergedInto`,`name`,`custom`,`borders`],A_=new Set(`row.col.x.y.width.height.rotation.draggable.resizable.selectable.removable.contentEditable.visible.showInExport.alwaysOnTop.backgroundEnabled.backgroundOpacity.backgroundColor.backgroundCornerRadius.backgroundPadding.curveEnabled.curvePower.shadowEnabled.shadowBlur.shadowOffsetX.shadowOffsetY.shadowColor.shadowOpacity.blurEnabled.blurRadius.brightnessEnabled.brightness.sepiaEnabled.grayscaleEnabled.placeholder.animations.filters`.split(`.`)),j_={opacity:1,rowSpan:1,colSpan:1,name:``},M_=[],N_=Z.model(`TableCell`,{id:Z.identifier,type:Z.optional(Z.literal(`tablecell`),`tablecell`),text:``,_fontSize:Z.maybe(Z.number),_fontFamily:Z.maybe(Z.string),_fontWeight:Z.maybe(Z.string),_fontStyle:Z.maybe(Z.string),_textDecoration:Z.maybe(Z.string),_textTransform:Z.maybe(Z.string),_fill:Z.maybe(Z.string),_align:Z.maybe(Z.string),_verticalAlign:Z.maybe(Z.string),_lineHeight:Z.maybe(Z.union(Z.number,Z.string)),_letterSpacing:Z.maybe(Z.number),_strokeWidth:Z.maybe(Z.number),_stroke:Z.maybe(Z.string),_cellBackground:Z.maybe(Z.string),_cellPadding:Z.maybe(Z.number),opacity:1,rowSpan:1,colSpan:1,mergedInto:Z.maybe(Z.string),borders:Z.maybe(T_),name:``,custom:Z.frozen()}).volatile(()=>({_editModeEnabled:!1,filters:z.map()})).preProcessSnapshot(e=>{if(!e)return e;for(let t in e)e[t]===null&&(e[t]=void 0);let t={};for(let n of k_)n in e&&(t[n]=e[n]);for(let n of E_)e[n]!==void 0&&(t[`_${n}`]=e[n]);return t}).postProcessSnapshot(e=>{let t={};for(let[n,r]of Object.entries(e))if(n.startsWith(`_`))r!=null&&(t[n.slice(1)]=r);else if(n===`borders`)typeof r==`object`&&r&&Object.keys(r).length>0&&(t.borders=r);else{if(n in j_&&r===j_[n])continue;t[n]=r}return t}).views(e=>{let t={get row(){if(!Al(e))return 0;let t=x_(e),n=C_(e).indexOf(e);return n===-1?0:Math.floor(n/t.cols)},get col(){if(!Al(e))return 0;let t=x_(e),n=C_(e).indexOf(e);return n===-1?0:n%t.cols},get store(){return Al(e)?wl(e):null},get page(){if(!Al(e))return null;try{return x_(e).page}catch{return null}},get fontSize(){return S_(e,`fontSize`,30)},get fontFamily(){return S_(e,`fontFamily`,`Roboto`)},get fontWeight(){return S_(e,`fontWeight`,`normal`)},get fontStyle(){return S_(e,`fontStyle`,`normal`)},get textDecoration(){return S_(e,`textDecoration`,``)},get textTransform(){return S_(e,`textTransform`,`none`)},get fill(){return S_(e,`fill`,`black`)},get align(){return S_(e,`align`,`left`)},get verticalAlign(){return S_(e,`verticalAlign`,`top`)},get lineHeight(){return S_(e,`lineHeight`,1.2)},get letterSpacing(){return S_(e,`letterSpacing`,0)},get strokeWidth(){return S_(e,`strokeWidth`,0)},get stroke(){return S_(e,`stroke`,`black`)},get cellBackground(){return S_(e,`cellBackground`,`transparent`)},get cellPadding(){return S_(e,`cellPadding`,4)},get width(){if(!Al(e))return 100;try{return x_(e).getCellRect(t.row,t.col,e.rowSpan,e.colSpan).width}catch{return 100}},get height(){if(!Al(e))return 100;try{return x_(e).getCellRect(t.row,t.col,e.rowSpan,e.colSpan).height}catch{return 100}},get a(){if(!Al(e))return{x:0,y:0,width:100,height:100,rotation:0,opacity:1,fontSize:16};let n=x_(e).getCellRect(t.row,t.col,e.rowSpan,e.colSpan),r=t.cellPadding;return{x:n.x+r,y:n.y+r,width:n.width-2*r,height:n.height-2*r,rotation:0,opacity:e.opacity??1,fontSize:t.fontSize}},getEffectiveBorder(t){let n=Al(e)?x_(e):null,r=e.borders?.[t];return{color:r?.color??n?.borderColor??`#000000`,width:r?.width??n?.borderWidth??1,style:r?.style??n?.borderStyle??`solid`}},get x(){return 0},get y(){return 0},get rotation(){return 0},get draggable(){return!1},get resizable(){return!1},get selectable(){return!1},get removable(){return!1},get contentEditable(){return!0},get visible(){return!0},get showInExport(){return!0},get alwaysOnTop(){return!1},get placeholder(){return``},get backgroundEnabled(){return!1},get backgroundOpacity(){return 1},get backgroundColor(){return`transparent`},get backgroundCornerRadius(){return 0},get backgroundPadding(){return 0},get curveEnabled(){return!1},get curvePower(){return 0},get shadowEnabled(){return!1},get shadowBlur(){return 0},get shadowOffsetX(){return 0},get shadowOffsetY(){return 0},get shadowColor(){return`black`},get shadowOpacity(){return 1},get blurEnabled(){return!1},get blurRadius(){return 0},get brightnessEnabled(){return!1},get brightness(){return 0},get sepiaEnabled(){return!1},get grayscaleEnabled(){return!1},get animations(){return M_}};return t}).actions(e=>({toJSON:()=>Object.assign({},bl(e)),set(t){t.fontSize!=null&&t.fontSize<1&&(t=Object.assign(Object.assign({},t),{fontSize:1}));let n={};for(let[e,r]of Object.entries(t))D_.has(e)?n[`_${e}`]=r:e===`borders`?n.borders=r&&JSON.parse(JSON.stringify(r)):A_.has(e)||(n[e]=r);Object.assign(e,n)},setBorder(t,n){let r=e.borders?Object.assign({},bl(e.borders)):{},i=r[t]||{},a=Object.assign({},i);n.color!==void 0&&(a.color=n.color),n.width!==void 0&&(a.width=n.width),n.style!==void 0&&(a.style=n.style),r[t]=a,e.borders=jl(r)},toggleEditMode(t){let n=t??!e._editModeEnabled;n!==e._editModeEnabled&&(e._editModeEnabled=n,e._editModeEnabled?e.store.history.startTransaction():e.store.history.endTransaction())}}));function P_(e){return Array.from({length:e},()=>1/e)}function F_(e){let t=e.reduce((e,t)=>e+t,0);return t===0?P_(e.length):e.map(e=>e/t)}var I_=d_.named(`Table`).props({type:`table`,width:300,height:200,rows:3,cols:3,colWidths:Z.array(Z.number),rowHeights:Z.array(Z.number),cells:Z.array(N_),borderColor:`#000000`,borderWidth:1,borderStyle:Z.optional(Z.enumeration([`solid`,`dashed`,`dotted`,`none`]),`solid`),fontSize:30,fontFamily:`Roboto`,fontWeight:`normal`,fontStyle:`normal`,textDecoration:``,textTransform:`none`,fill:`black`,align:`left`,verticalAlign:`top`,lineHeight:Z.optional(Z.union(Z.number,Z.string),1.2),letterSpacing:0,strokeWidth:0,stroke:`black`,cellBackground:`transparent`,cellPadding:4}).postProcessSnapshot(e=>{e.cells&&((e=Object.assign({},e)).cells=e.cells.map(t=>{let n={};for(let[r,i]of Object.entries(t))D_.has(r)&&i===e[r]||(n[r]=i);return n}));for(let t of O_)delete e[t];return e}).volatile(()=>({_focusedCellIds:[],_editingCellId:void 0,_anchorCellId:void 0,_cellContentHeights:z.map(),_baseRowHeights:null,_baseHeight:null,_isResizingRows:!1,_isTransforming:!1})).actions(e=>({afterCreate(){let t=e.rows*e.cols;if(e.cells.length===0)e.cells.replace(jl(function(e,t){let n=[];for(let r=0;r<e*t;r++)n.push({id:Vh(10),text:``});return n}(e.rows,e.cols)));else if(e.cells.length<t)for(;e.cells.length<t;)e.cells.push(jl({id:Vh(10),text:``}));else e.cells.length>t&&e.cells.splice(t);e.colWidths.length===0&&e.colWidths.replace(P_(e.cols)),e.rowHeights.length===0&&e.rowHeights.replace(P_(e.rows))}})).views(e=>({get _cellMap(){let t=new Map,n=e.cols;return e.cells.forEach((e,r)=>{t.set(`${Math.floor(r/n)}:${r%n}`,e)}),t},getActualRowHeight:t=>e.rowHeights[t]*e.height})).views(e=>{let t={getCell:(t,n)=>e._cellMap.get(`${t}:${n}`),get minWidth(){return 20*e.cols},get minHeight(){return 20*e.rows},get actualHeight(){let t=0;for(let n=0;n<e.rows;n++)t+=e.getActualRowHeight(n);return t},getCellRect(t,n,r=1,i=1){let a=0;for(let t=0;t<n;t++)a+=e.colWidths[t]*e.width;let o=0;for(let n=0;n<t;n++)o+=e.getActualRowHeight(n);let s=0;for(let t=n;t<n+i;t++)s+=(e.colWidths[t]||0)*e.width;let c=0;for(let n=t;n<t+r;n++)c+=e.getActualRowHeight(n);return{x:a,y:o,width:s,height:c}},get visibleCells(){return e.cells.filter(e=>!e.mergedInto)},get focusedCells(){return e.cells.filter(t=>e._focusedCellIds.includes(t.id))},get editingCell(){if(e._editingCellId)return e.cells.find(t=>t.id===e._editingCellId)},get _fitRowsToContent(){if(e._isResizingRows||e._isTransforming||e._cellContentHeights.size===0)return null;let n=e._baseHeight??e.height,r=e._baseRowHeights??[...e.rowHeights],i=!1,a=[];for(let o=0;o<e.rows;o++){let s=e.rowHeights[o]*e.height,c=r[o]*n,l=0;for(let n=0;n<e.cols;n++){let r=t.getCell(o,n);if(!r)continue;let i=e._cellContentHeights.get(r.id);if(i!==void 0){let e=i+2*r.cellPadding;l=Math.max(l,e)}}let u=Math.max(l,c);Math.abs(u-s)>1?(a.push(u),i=!0):a.push(s)}if(!i)return null;let o=a.reduce((e,t)=>e+t,0);return{rowHeights:a.map(e=>e/o),height:o}}};return t}).actions(e=>{let t={setCellContentHeight(t,n){e._cellContentHeights.set(t,n)},_applyFitRowsToContent(){e._baseRowHeights===null&&(e._baseRowHeights=[...e.rowHeights],e._baseHeight=e.height);let t=e._fitRowsToContent;t&&(e.height=t.height,e.rowHeights.replace(t.rowHeights))},focusCell(t,n=!1){n?e._focusedCellIds.includes(t)||(e._focusedCellIds=[...e._focusedCellIds,t]):(e._focusedCellIds=[t],e._anchorCellId=t)},focusCellRange(t,n){let r=e.cells.find(t=>t.id===e._anchorCellId);if(!r)return;let i=Math.min(r.row,t),a=Math.max(r.row,t),o=Math.min(r.col,n),s=Math.max(r.col,n),c=[];for(let t of e.cells)t.row>=i&&t.row<=a&&t.col>=o&&t.col<=s&&c.push(t.id);e._focusedCellIds=c},clearCellFocus(){if(Al(e)){if(e._editingCellId){let t=e.cells.find(t=>t.id===e._editingCellId);t&&t.toggleEditMode(!1)}e._focusedCellIds=[],e._editingCellId=void 0,e._anchorCellId=void 0}},enterCellEdit(t){e._editingCellId=t,e._focusedCellIds.includes(t)||(e._focusedCellIds=[t]);let n=e.cells.find(e=>e.id===t);n&&n.toggleEditMode(!0)},exitCellEdit(){if(e._editingCellId){let t=e.cells.find(t=>t.id===e._editingCellId);t&&t.toggleEditMode(!1)}e._editingCellId=void 0},_resetBaseRowHeights(){e._baseRowHeights=null,e._baseHeight=null},_setIsResizingRows(t){e._isResizingRows=t},_setIsTransforming(t){e._isTransforming=t},addRow(n){t._resetBaseRowHeights();let r=n>0?n-1:0,i=(e.rowHeights[r]||1/(e.rows+1))*e.height,a=e.height+i,o=[];for(let t=0;t<e.rows;t++)o.push(e.rowHeights[t]*e.height/a);o.splice(n,0,i/a);let s=n*e.cols,c=Array.from({length:e.cols},()=>({id:Vh(10),text:``}));e.cells.splice(s,0,...jl(c)),e.rows+=1,e.height=a,e.rowHeights.replace(F_(o))},removeRow(n){if(e.rows<=1)return;t._resetBaseRowHeights();let r=n*e.cols,i=[];for(let t=r;t<r+e.cols;t++)i.push(e.cells[t].id);if(e._editingCellId&&i.includes(e._editingCellId)){let t=e.cells.find(t=>t.id===e._editingCellId);t&&t.toggleEditMode(!1),e._editingCellId=void 0}e._focusedCellIds=e._focusedCellIds.filter(e=>!i.includes(e)),i.forEach(t=>e._cellContentHeights.delete(t)),e.cells.splice(r,e.cols);let a=[...e.rowHeights];a.splice(n,1),--e.rows,e.rowHeights.replace(F_(a))},addColumn(t){let n=t>0?t-1:0,r=(e.colWidths[n]||1/(e.cols+1))*e.width,i=e.width+r,a=[];for(let t=0;t<e.cols;t++)a.push(e.colWidths[t]*e.width/i);a.splice(t,0,r/i);let o=e.cols;for(let n=e.rows-1;n>=0;n--)e.cells.splice(n*o+t,0,jl({id:Vh(10),text:``}));e.cols+=1,e.width=i,e.colWidths.replace(F_(a))},removeColumn(t){if(e.cols<=1)return;let n=e.cols,r=[];for(let i=0;i<e.rows;i++)r.push(e.cells[i*n+t].id);if(e._editingCellId&&r.includes(e._editingCellId)){let t=e.cells.find(t=>t.id===e._editingCellId);t&&t.toggleEditMode(!1),e._editingCellId=void 0}e._focusedCellIds=e._focusedCellIds.filter(e=>!r.includes(e)),r.forEach(t=>e._cellContentHeights.delete(t));for(let r=e.rows-1;r>=0;r--)e.cells.splice(r*n+t,1);let i=[...e.colWidths];i.splice(t,1),--e.cols,e.colWidths.replace(F_(i))},distributeRowsEvenly(){t._resetBaseRowHeights(),e.rowHeights.replace(P_(e.rows))},distributeColumnsEvenly(){e.colWidths.replace(P_(e.cols))},resizeColumn(t,n){if(t>=e.cols-1)return;let r=[...e.colWidths],i=r[t]+r[t+1],a=r[t]+n,o=r[t+1]-n;a<y_?(r[t]=y_,r[t+1]=i-y_):o<y_?(r[t+1]=y_,r[t]=i-y_):(r[t]=a,r[t+1]=o),e.colWidths.replace(r)},resizeRow(t,n){if(t>=e.rows-1)return;let r=[...e.rowHeights],i=r[t]+r[t+1],a=r[t]+n,o=r[t+1]-n;a<y_?(r[t]=y_,r[t+1]=i-y_):o<y_?(r[t+1]=y_,r[t]=i-y_):(r[t]=a,r[t+1]=o),e.rowHeights.replace(r)},setCellBorders(t,n,r){let i={top:{side:`bottom`,dr:-1,dc:0},bottom:{side:`top`,dr:1,dc:0},left:{side:`right`,dr:0,dc:-1},right:{side:`left`,dr:0,dc:1}};for(let a of t){let t=e.cells.find(e=>e.id===a);if(t)for(let a of n){t.setBorder(a,r);let n=i[a],o=t.row+n.dr,s=t.col+n.dc,c=e.getCell(o,s);c&&c.setBorder(n.side,r)}}}};return t}).actions(e=>({clone(t={},{skipSelect:n=!1}={}){let r=JSON.parse(JSON.stringify(e.toJSON()));if(t.id=t.id||Vh(10),r.cells){let e=new Map;r.cells.forEach(t=>{let n=t.id,r=Vh(10);e.set(n,r),t.id=r}),r.cells.forEach(t=>{t.mergedInto&&e.has(t.mergedInto)&&(t.mergedInto=e.get(t.mergedInto))})}return Object.assign(r,t),e.page.addElement(r,{skipSelect:n})}})),L_=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},R_=(e,t)=>{if(e.children)for(let n of e.children){if(!0===t(n))break;R_(n,t)}},z_=(e,t)=>{if(e.children)for(let n of e.children){if(!0===t(n))break;z_(n,t)}if(e.cells){for(let n of e.cells)if(!0===t(n))break}},B_=[...Array(20)].map((e,t)=>Z.late(()=>U_[t])),V_=Z.union({dispatcher:e=>{let t=W_[e.type];if(!t)throw Error(`Unknown element type: "${e.type}"`);return t}},g_,f_,p_,h_,m_,__,v_,I_,Z.late(()=>H_),...B_),H_=n_.named(`Group`).props({type:`group`,children:Z.array(V_)}).views(e=>({get draggable(){let t=!0;return R_(e,e=>{e.draggable||(t=!1)}),t},get resizable(){let t=!0;return R_(e,e=>{e.resizable||(t=!1)}),t},get contentEditable(){let t=!0;return R_(e,e=>{e.contentEditable||(t=!1)}),t},get styleEditable(){let t=!0;return R_(e,e=>{e.styleEditable||(t=!1)}),t},get locked(){let t=!0;return R_(e,e=>{e.locked||(t=!1)}),t}})).actions(e=>({set(t){var{draggable:n,contentEditable:r,styleEditable:i,resizable:a}=t,o=L_(t,[`draggable`,`contentEditable`,`styleEditable`,`resizable`]);n!==void 0&&R_(e,e=>{e.set({draggable:n})}),r!==void 0&&R_(e,e=>{e.set({contentEditable:r})}),i!==void 0&&R_(e,e=>{e.set({styleEditable:i})}),a!==void 0&&R_(e,e=>{e.set({resizable:a})}),Object.assign(e,o)},addElement(t,{skipSelect:n=!1}={}){let r=W_[t.type];if(!r){console.error(`Can not find model with type `+t.type);return}t.children&&t.children.forEach(e=>{e.id=e.id||Vh(10)});let i=r.create(Object.assign({id:Vh(10)},t));return e.children.push(i),i.selectable&&!n&&e.store.selectElements([i.id]),i},setElementZIndex(t,n){let r=e.children.find(e=>e.id===t);r&&(Ol(r),e.children.remove(r),e.children.splice(n,0,r))},setAnimation(t,n){R_(e,e=>{e.setAnimation(t,n)})}})),U_=[],W_={svg:g_,text:f_,image:p_,group:H_,line:h_,video:m_,figure:__,gif:v_,table:I_},G_={text:Xf,image:kp,svg:kp,line:eh,video:ph,figure:Oh,group:U(e=>{let{element:t,store:n}=e,{children:r}=t,i=t.selectable||n.role===`admin`;return S.createElement(Fo,{opacity:t.opacity,listening:i,hideInExport:!t.showInExport,id:t.id},r.map(t=>S.createElement(q_,Object.assign({},e,{key:t.id,store:n,element:t}))))}),gif:Rh,table:zh},K_=(e,t)=>{let n=[];R_(e,e=>{e.type!==`group`&&n.push(e.a)});let r=[];n.forEach(e=>{let t=[{x:0,y:0},{x:0+e.width,y:0},{x:0+e.width,y:0+e.height},{x:0,y:0+e.height}],n=new a.Transform;n.translate(e.x,e.y),n.rotate(a.Util.degToRad(e.rotation)),t.forEach(e=>{let t=n.point(e);r.push(t)})});let i=new a.Transform;i.rotate(-a.Util.degToRad(t));let o=1/0,s=1/0,c=-1/0,l=-1/0;r.forEach(e=>{let t=i.point(e);o=Math.min(o,t.x),s=Math.min(s,t.y),c=Math.max(c,t.x),l=Math.max(l,t.y)}),i.invert();let u=i.point({x:o,y:s});return{x:u.x,y:u.y,width:c-o,height:l-s,rotation:t}},q_=U(e=>{var t;let{element:n,store:r}=e,[i,o]=S.useState(!1),s=n.isSelectedDirectly,c=n.parent?.type===`group`,l=(e=>{let[t,n]=S.useState();return S.useEffect(()=>{let t=setTimeout(()=>{let t=e.page.id,r=a.stages.find(e=>e.getAttr(`pageId`)===t);r||console.error(`No stage is found for element`,e.id),n(r)});return()=>clearTimeout(t)},[e.id]),t})(n),u=S.useRef();S.useEffect(()=>{if(l){let e=e=>{let t=e.target.findAncestor(`.element`,!0),i=r.getElementById(t?.id())?.top;o(i?.id===n.id)};l.on(`mouseover`,e);let t=()=>{o(!1)};return l.on(`mouseleave`,t),()=>{l.off(`mouseover`,e),l.off(`mouseleave`,t)}}},[l]);let d=G_[e.element.type];return e.element.type===`text`&&Lc.htmlRenderEnabled&&(d=Pm),e.element.visible?d?S.createElement(Fo,{name:`element-container`},S.createElement(d,Object.assign({},e)),i&&!s&&!c&&S.createElement(Bh,{element:n.type===`group`?{a:K_(n,((u.current||=l?.findOne(`Transformer`),t=u.current)===null||t===void 0?void 0:t.rotation())||0)}:n})):(console.error(`Can not find component for `+e.element.type),null):null});function J_(e,t=.5){if(e.length<3)return e;let n=[];n.push(e[0]);for(let t=0;t<e.length-1;t++){let r=e[Math.max(0,t-1)],i=e[t],a=e[t+1],o=e[Math.min(e.length-1,t+2)];for(let e=0;e<10;e++){let t=e/10,s=t*t,c=s*t,l=.5*(2*i.x+(-r.x+a.x)*t+(2*r.x-5*i.x+4*a.x-o.x)*s+(-r.x+3*i.x-3*a.x+o.x)*c),u=.5*(2*i.y+(-r.y+a.y)*t+(2*r.y-5*i.y+4*a.y-o.y)*s+(-r.y+3*i.y-3*a.y+o.y)*c);n.push({x:l,y:u})}}return n.push(e[e.length-1]),n}function Y_(e){if(e.length===0)return``;if(e.length===1){let t=e[0];return`M ${t.x},${t.y} L ${t.x+.1},${t.y}`}let t=`M ${e[0].x},${e[0].y}`;for(let n=1;n<e.length-1;n++){let r=e[n],i=e[n+1],a=(r.x+i.x)/2,o=(r.y+i.y)/2;t+=` Q ${r.x},${r.y} ${a},${o}`}if(e.length>1){let n=e[e.length-1];t+=` L ${n.x},${n.y}`}return t}function X_(e){if(e.length===0)return{x:0,y:0,width:0,height:0};let t=e[0].x,n=e[0].y,r=e[0].x,i=e[0].y;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x),i=Math.max(i,a.y);return{x:t,y:n,width:r-t,height:i-n}}function Z_(e,t){if(e.length===0)throw Error(`Cannot create SVG from empty path`);let n=t.smooth?J_(e):e,r=X_(n),i=t.strokeWidth,a=r.x-i,o=r.y-i,s=r.width+2*i,c=r.height+2*i;return{src:lp(`\n <svg xmlns="http://www.w3.org/2000/svg" width="${s}" height="${c}" viewBox="0 0 ${s} ${c}">\n <path\n d="${Y_(n.map(e=>({x:e.x-a,y:e.y-o})))}"\n stroke="${t.stroke}"\n stroke-width="${t.strokeWidth}"\n stroke-linecap="round"\n stroke-linejoin="round"\n fill="none"\n />\n </svg>\n `.trim()),x:a,y:o,width:s,height:c}}var Q_=U(({store:e,page:t,width:n,height:r,scale:i,xPadding:a,yPadding:o,bleed:s})=>{let[c,l]=S.useState(!1),[u,d]=S.useState([]),f=S.useRef(null),p=e.tool===`draw`,{strokeWidth:m,stroke:h,opacity:g,brushType:_}=e.toolOptions,v=S.useCallback(e=>{if(!p||(l(!0),e.cancelBubble=!0,!e.target.getStage()))return;let t=f.current.getRelativePointerPosition();t&&d([{x:t.x,y:t.y}])},[p,i,a,o,s]),y=S.useCallback(e=>{if(!p||!c||(e.cancelBubble=!0,!e.target.getStage()))return;let t=f.current.getRelativePointerPosition();t&&d(e=>[...e,{x:t.x,y:t.y}])},[p,c,i,a,o,s]),b=S.useCallback(()=>{if(p&&c){if(l(!1),u.length>=1)try{let n=Z_(u,{stroke:h,strokeWidth:m,smooth:!0}),r=e.selectedElementsIds.slice();e.history.transaction(()=>{t.addElement({type:`svg`,x:n.x,y:n.y,width:n.width,height:n.height,src:n.src,opacity:g},{skipSelect:!0})}),e.selectElements(r)}catch(e){console.error(`Error creating path SVG:`,e)}d([])}},[p,c,u,h,m,g,t,e.history,e]);S.useEffect(()=>{if(!c)return;let e=()=>b();return window.addEventListener(`mouseup`,e),window.addEventListener(`touchend`,e),()=>{window.removeEventListener(`mouseup`,e),window.removeEventListener(`touchend`,e)}},[c,b]);let x=S.useMemo(()=>u.flatMap(e=>[e.x,e.y]),[u]);return S.useEffect(()=>{if(p&&f.current){let e=f.current.getStage();if(!e)return;let t=m*i;if(t>100||t<4)e.container().style.cursor=`crosshair`;else{let n=t/2,r=t/2,i=`data:image/svg+xml;base64,${btoa(`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}" viewBox="0 0 ${t} ${t}">\n <circle cx="${r}" cy="${r}" r="${n-1}" fill="${h}" opacity="${g}" stroke="white" stroke-width="1"/>\n <circle cx="${r}" cy="${r}" r="${n-1}" fill="none" stroke="black" stroke-width="1" opacity="0.3"/>\n </svg>`)}`;e.container().style.cursor=`url("${i}") ${r} ${r}, crosshair`}return()=>{e.container()&&(e.container().style.cursor=``)}}},[p,h,m,g,i]),p?S.createElement(Fo,{ref:f,listening:p,x:a+s*i,y:o+s*i,scaleX:i,scaleY:i},S.createElement(Lo,{x:-(a+s*i)/i,y:-(o+s*i)/i,width:n/i,height:r/i,fill:`transparent`,onMouseDown:v,onMouseMove:y,onMouseUp:b,onTouchStart:v,onTouchMove:y,onTouchEnd:b}),u.length>0&&S.createElement(`Line`,{points:x,stroke:h,strokeWidth:m,lineCap:`round`,lineJoin:`round`,opacity:g,tension:.5,listening:!1})):null});function $_(e,t,n=`scale`){let r=t.width/t.height,i,a;r>=e.width/e.height?(i=e.width,a=e.width/r):(i=e.height*r,a=e.height);let o=0,s=0;return n===`left-top`?(o=0,s=0):n===`left-middle`?(o=0,s=(e.height-a)/2):n===`left-bottom`?(o=0,s=e.height-a):n===`center-top`?(o=(e.width-i)/2,s=0):n===`center-middle`?(o=(e.width-i)/2,s=(e.height-a)/2):n===`center-bottom`?(o=(e.width-i)/2,s=e.height-a):n===`right-top`?(o=e.width-i,s=0):n===`right-middle`?(o=e.width-i,s=(e.height-a)/2):n===`right-bottom`?(o=e.width-i,s=e.height-a):n===`scale`?(o=0,s=0,i=e.width,a=e.height):console.error(Error(`Unknown clip position property - `+n)),{cropX:o,cropY:s,cropWidth:i,cropHeight:a}}var ev=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},tv=e=>Wo.batchedUpdates(e,null);$i(e=>{Wo.isAlreadyRendering()?queueMicrotask(()=>tv(e)):tv(e)});var nv=a.DD._drag;window.removeEventListener(`mousemove`,nv),a.DD._drag=function(e){Zn(()=>{nv.call(this,e)})},window.addEventListener(`mousemove`,a.DD._drag);var rv={enabledAnchors:[`top-left`,`top-center`,`top-right`,`middle-left`,`bottom-left`,`bottom-right`,`bottom-center`,`middle-right`],rotateEnabled:!0,rotationSnaps:[0,45,90,135,180,225,270,315],ignoreStroke:!0,flipEnabled:!1,keepRatio:!0},iv={text:{enabledAnchors:[`top-left`,`top-right`,`middle-left`,`bottom-left`,`bottom-right`,`middle-right`]},svg:{enabledAnchors:[`top-left`,`top-right`,`bottom-left`,`bottom-right`]},gif:{enabledAnchors:[`top-left`,`top-right`,`bottom-left`,`bottom-right`]},line:{enabledAnchors:[],borderEnabled:!1,rotateEnabled:!1},image:{enabledAnchors:[`top-left`,`top-right`,`bottom-left`,`bottom-right`]},many:{enabledAnchors:[`top-left`,`top-right`,`bottom-left`,`bottom-right`]},group:{enabledAnchors:[`top-left`,`top-right`,`bottom-left`,`bottom-right`]},table:{keepRatio:!1,enabledAnchors:[`top-left`,`top-right`,`middle-left`,`middle-right`,`bottom-left`,`bottom-right`]}},av=e=>S.createElement(Lo,Object.assign({},e,{preventDefault:!1})),ov=e=>{var{url:t}=e,n=ev(e,[`url`]);let[r,i]=(0,Ko.default)(t,`anonymous`),a=r?$_(r,{width:n.width,height:n.height},`center-middle`):{};return Op(i,t,`page background`),S.createElement(zo,Object.assign({image:r},n,a))},sv=e=>{let t=Xs({a:{width:e.width,height:e.height},width:e.width,height:e.height},e.fill);return S.createElement(Lo,Object.assign({},e,t))},cv=e=>{let{background:t,scale:n,borderColor:r,transparencyBackgroundColor:i}=e,o=ev(e,[`background`,`scale`,`borderColor`,`transparencyBackgroundColor`]),s=S.useMemo(()=>!!a.Util.colorToRGBA(t)||qs(t),[t]),c=S.useMemo(()=>{if(qs(t))return!0;let e=a.Util.colorToRGBA(t);return!e||e.a<1},[t]),l=S.useMemo(()=>{if(!c||i)return null;let e=document.createElement(`canvas`);e.width=60,e.height=60;let t=e.getContext(`2d`);return t&&(t.fillStyle=`black`,t.fillRect(30,0,30,30),t.fillRect(0,30,30,30)),e},[c,i]);return S.createElement(S.Fragment,null,c&&(i?S.createElement(`Rect`,Object.assign({fill:i},o,{hideInExport:!0})):S.createElement(`Rect`,Object.assign({fillPatternImage:l},o,{opacity:.1,hideInExport:!0}))),s?S.createElement(sv,Object.assign({fill:t},o)):S.createElement(ov,Object.assign({url:t},o)))},lv=U(({selection:e})=>{if(!e.visible)return null;let{selectionRectStyle:t}=ps();return S.createElement(Lo,{name:`selection`,x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),width:Math.abs(e.x1-e.x2),height:Math.abs(e.y1-e.y2),fill:t.fill,stroke:t.stroke,strokeWidth:t.strokeWidth})});function uv(e){let t=180*e/Math.PI;return t%=360,t>180?t-=360:t<-180&&(t+=360),Math.round(t)}var dv=U(({x:e,y:t,width:n,height:r,rotation:i,anchor:o,store:s})=>{let{transformLabelStyle:c}=ps();if(e===void 0||t===void 0||n===void 0||r===void 0||i===void 0||o===void 0)return null;let l=Rm({x:e,y:t,width:n,height:r,rotation:a.Util.radToDeg(i)}),u=(r/2+70)*Math.cos(i-Math.PI/2),d=(r/2+70)*Math.sin(i-Math.PI/2),f=_g({unit:s.unit,dpi:s.dpi,px:n/s.scale,precious:s.unit===`px`?0:1})+` x `+_g({unit:s.unit,dpi:s.dpi,px:r/s.scale,precious:s.unit===`px`?0:1})+(s.unit===`px`?``:` `+s.unit);return S.createElement(S.Fragment,null,S.createElement(Io,{x:(l.minX+l.maxX)/2+u,y:(l.minY+l.maxY)/2+d,offsetX:14,offsetY:14,visible:o===`rotater`},S.createElement(`Tag`,{cornerRadius:5,fill:c.fill}),S.createElement(Bo,{align:`center`,verticalAlign:`middle`,fill:c.textFill,padding:8,text:uv(i).toString()+`°`})),S.createElement(Io,{x:(l.minX+l.maxX)/2,y:l.maxY+20,visible:o!==`rotater`},S.createElement(`Tag`,{cornerRadius:5,fill:c.fill,pointerDirection:`up`,pointerHeight:0,pointerWidth:0}),S.createElement(Bo,{align:`center`,verticalAlign:`middle`,fill:c.textFill,padding:8,text:f})))}),fv=U(({elements:e,store:t})=>{let n=e.filter(e=>e.alwaysOnTop),r=e.filter(e=>!e.alwaysOnTop).concat(n);return S.createElement(S.Fragment,null,r.map(e=>S.createElement(q_,{key:e.id,store:t,element:e,onClick:()=>{console.warn(`Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.`)}})))}),pv=({store:e})=>{let[t,n]=S.useState(!1),[r,i]=S.useState({x:0,y:0});return{open:S.useCallback(e=>{n(!0),i(e)},[]),close:S.useCallback(()=>{n(!1)},[]),props:{isOpen:t,offset:r,setIsOpen:n}}},mv=null,hv=atob(`UG9sb3RubyBmcmVlIGxpY2Vuc2UgbGltaXRhdGlvbiBleGNlZWRlZCAtIFBsZWFzZSB1cGdyYWRlIHlvdXIgYWNjb3VudC4=`),gv=atob(`I2MwMzkyYg==`),_v=atob(`djAuOS4y`),vv=e=>S.createElement(S.Fragment,null,S.createElement(Io,{fill:gv,height:200},S.createElement(`Tag`,{fill:gv}),S.createElement(Bo,Object.assign({},e,{fill:`white`,text:hv,height:void 0,padding:10,fontSize:20})))),yv=atob(`RlJFRSAgVFJJQUwgIExJQ0VOU0U=`),bv=(atob(`UG93ZXJlZCBieSBQb2xvdG5v`),atob(`TElDRU5TRSAgS0VZICBJUyAgTUlTU0lORw==`)),xv=atob(`UGxlYXNlIGFjdGl2YXRlIHlvdXIgbGljZW5zZS4KTGljZW5zZSByZWxhdGVkIHF1ZXN0aW9uczoKcG9sb3Ruby5jb20vY29udGFjdA==`),Sv=e=>{let t=tg()===1,n=t?bv:yv,r=t?230:195;return S.createElement(Fo,Object.assign({},e,{listening:!1}),S.createElement(Lo,{fill:gv,width:r,height:24,cornerRadius:2}),S.createElement(Bo,{text:n,fill:`white`,fontSize:13,fontFamily:`monospace`,width:r,align:`center`,y:5,listening:!1}),t&&S.createElement(`Text`,{text:xv,fill:`rgba(0,0,0,0.6)`,fontSize:14,y:30,listening:!1}))},Cv=U(({store:e,page:t,width:n,height:r,pageControlsEnabled:i,components:o,altCloneEnabled:s,viewportSize:c,layout:l=`vertical`,tooltipSafeArea:u,transformerSafeArea:d})=>{let f=ps(),p=f.transformerStyle,m=rv,h=e.bleedVisible?t.bleed:0,g=t.computedWidth+2*h,_=t.computedHeight+2*h,v=(n-g*e.scale)/2,y=(r-_*e.scale)/2,b=S.useRef(null),x=S.useRef(null),C=S.useRef(null),w=i==null||i,T=S.useRef(!1),[E,D]=S.useState(null),[O,k]=S.useState({}),[A,j]=S.useState(0),M=pv({store:e}),ee=e.selectedElements.find(e=>e._cropModeEnabled),N=e.selectedElements.find(e=>e.curveEnabled),P=e.selectedShapes.filter(e=>!e.resizable).length>0,te=e.selectedShapes.filter(e=>!e.draggable).length>0,ne=e.selectedElements.filter(e=>!e.visible).length>0;S.useLayoutEffect(()=>{var t;if(!b.current)return;let n=b.current.getStage(),r=e.selectedShapes.map(e=>e._cropModeEnabled?null:n.findOne(`#`+e.id)).filter(e=>!!e),i=e.selectedElements.length===1,a=i&&e.selectedElements[0]?.type||`many`,o=iv[a],s=Object.assign(Object.assign({},m),o||{});o&&(a!==`svg`&&a!==`image`&&a!==`gif`||e.selectedElements[0].keepRatio||(s.enabledAnchors=m.enabledAnchors),a===`text`&&Lc.textVerticalResizeEnabled&&(s.enabledAnchors=iv.text.enabledAnchors?.concat([`bottom-center`])),a===`text`&&i&&e.selectedElements[0].curveEnabled&&(s.enabledAnchors=iv.many.enabledAnchors)),b.current.setAttrs(Object.assign(Object.assign({},s),p)),P&&b.current.enabledAnchors([]),te&&b.current.rotateEnabled(!1),r.find(e=>e?.isDragging())&&r.forEach(e=>{e.isDragging()||e==null||e.startDrag()}),b.current.nodes(r),Gm(),(t=b.current.getLayer())==null||t.batchDraw()},[e.selectedShapes,ee,P,ne,te,N,p]);let re=()=>{let e=b.current;if(!e)return;if(!e.isTransforming()){k({});return}if(!e.nodes().length||!e.isTransforming())return;let t=e.__getNodeRect(),n=e?.getActiveAnchor(),r=e.getStage();k({anchor:n,x:t.x-(r?.x()??0),y:t.y-(r?.y()??0),rotation:t.rotation,width:t.width,height:t.height})},F=S.useCallback(()=>{if(b.current?.isTransforming())return;let e=b.current;if(!e||!e.nodes().length){j(0);return}let t=e.getClientRect();e.getStage()&&j(function(e,t,n,r=0){let i=e.x+e.width/2,a=e.y+e.height/2,o=e.width/2,s=e.height/2,c=r*Math.PI/180,l=e=>{let t=e*Math.PI/180,r=(e%360+360)%360,l;l=r===0||r===180?s:o;let u=Math.sin(t)*(l+n),d=-Math.cos(t)*(l+n),f=u*Math.cos(c)-d*Math.sin(c),p=u*Math.sin(c)+d*Math.cos(c);return{x:i+f,y:a+p}},u=e=>e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom;if(u(l(0)))return 0;for(let e of[180,270,90])if(u(l(e)))return e;return 0}(t,{top:d?.top||0,bottom:r-(d?.bottom||0),left:d?.left||0,right:n-(d?.right||0)},p.rotateAnchorOffset,e.rotation()))},[d,n,r]);S.useEffect(()=>{var e;(e=b.current)==null||e.update(),re(),F()},[e.scale,F]),S.useEffect(()=>{F()},[e.selectedShapes,F]);let I=va(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),L=S.useRef(!1),ie=il(),ae=H(e=>{if(ie)return;L.current=!1;let t=e.target.findAncestor(`.elements-container`),n=e.target.findAncestor(`Transformer`),r=e.target.findAncestor(`.page-abs-container`);if(t||n||r)return;let i=e.target.getStage()?.getPointerPosition();i&&(i.x-=e.target.getStage()?.x()??0,i.y-=e.target.getStage()?.y()??0,I.visible=!0,I.x1=i.x,I.y1=i.y,I.x2=i.x,I.y2=i.y,(e.target.getStage()?.getPointersPositions().length??0)>=2&&(I.visible=!1))});(({stageRef:e,containerRef:t,viewportSize:n})=>{S.useEffect(()=>{let n=t.current?.closest(`.polotno-workspace-inner`);function r(){if(!e.current)return;let r=t.current?.getBoundingClientRect(),i=n?.getBoundingClientRect();if(!r||!i)return;let a=Math.max(0,i.left-r.left-100),o=Math.max(0,i.top-r.top-100);e.current.position({x:-a,y:-o}),e.current.container().style.transform=`translate(${a}px, ${o}px)`}return r(),n?.addEventListener(`scroll`,r),()=>{n?.removeEventListener(`scroll`,r)}},[n.width,n.height])})({stageRef:x,containerRef:C,viewportSize:c}),S.useEffect(()=>{let t=H(e=>{var t;if(!I.visible)return;(t=x.current)==null||t.setPointersPositions(e);let n=x.current?.getPointerPosition();n?(n.x-=x.current?.x()??0,n.y-=x.current?.y()??0):n={x:I.x2,y:I.y2},I.x2=n.x,I.y2=n.y}),n=H(()=>{if(!I.visible||!x.current)return;let t=x.current.findOne(`.selection`),n=t?t.getClientRect({skipStroke:!0}):{width:0,height:0,x:0,y:0};if(n.width&&n.height){let t=[];x.current.find(`.element`).forEach(r=>{let i=r.getClientRect(),o=e.getElementById(r.id()),s=o?.draggable,c=o?.selectable;a.Util.haveIntersection(n,i)&&s&&c&&t.push(o.top.id)});let r=[...new Set(t)];L.current=!0,e.selectElements(r)}I.visible=!1});return window.addEventListener(`mousemove`,t),window.addEventListener(`touchmove`,t),window.addEventListener(`mouseup`,n,{capture:!0}),window.addEventListener(`touchend`,n,{capture:!0}),()=>{window.removeEventListener(`mousemove`,t),window.removeEventListener(`touchmove`,t),window.removeEventListener(`mouseup`,n),window.removeEventListener(`touchend`,n)}},[]);let oe=S.useCallback(n=>{if(!e.selectedElements[0]||n&&e.selectedElementsIds.includes(n))return;let r=zm(e.selectedShapes),i=Rm(n?e.getElementById(n):{x:0,y:0,width:t.computedWidth,height:t.computedHeight,rotation:0}),a=[];r.minX>i.maxX&&a.push({distance:r.minX-i.maxX,box1:r,box2:i,points:[{x:r.minX,y:r.minY+r.height/2},{x:i.maxX,y:r.minY+r.height/2},{x:i.maxX,y:i.minY+i.height/2}]}),r.maxX<i.minX&&a.push({distance:i.minX-r.maxX,box1:r,box2:i,points:[{x:r.maxX,y:r.minY+r.height/2},{x:i.minX,y:r.minY+r.height/2},{x:i.minX,y:i.minY+i.height/2}]}),r.minY>i.maxY&&a.push({box1:r,box2:i,distance:r.minY-i.maxY,points:[{x:r.minX+r.width/2,y:r.minY},{x:r.minX+r.width/2,y:i.maxY},{x:i.minX+i.width/2,y:i.maxY}]}),r.maxY<i.minY&&a.push({box1:r,box2:i,distance:i.minY-r.maxY,points:[{x:r.minX+r.width/2,y:r.maxY},{x:r.minX+r.width/2,y:i.minY},{x:i.minX+i.width/2,y:i.minY}]});let o=r.minX>=i.minX&&r.maxX<=i.maxX&&r.minY>=i.minY&&r.maxY<=i.maxY;if(o&&(a.push({distance:r.minX-i.minX,box1:r,box2:i,points:[{x:r.minX,y:r.minY+r.height/2},{x:i.minX,y:r.minY+r.height/2},{x:i.minX,y:i.minY+i.height/2}]}),a.push({distance:i.maxX-r.maxX,box1:r,box2:i,points:[{x:r.maxX,y:r.minY+r.height/2},{x:i.maxX,y:r.minY+r.height/2},{x:i.maxX,y:i.minY+i.height/2}]}),a.push({box1:r,box2:i,distance:r.minY-i.minY,points:[{x:r.minX+r.width/2,y:r.minY},{x:r.minX+r.width/2,y:i.minY},{x:i.minX+i.width/2,y:i.minY}]}),a.push({box1:r,box2:i,distance:i.maxY-r.maxY,points:[{x:r.minX+r.width/2,y:r.maxY},{x:r.minX+r.width/2,y:i.maxY},{x:i.minX+i.width/2,y:i.maxY}]})),a.length===0&&!o){let e=r.minX<i.maxX&&r.maxX>i.minX,t=r.minY<i.maxY&&r.maxY>i.minY;if(e&&t){let e=(Math.max(r.minY,i.minY)+Math.min(r.maxY,i.maxY))/2,t=(Math.max(r.minX,i.minX)+Math.min(r.maxX,i.maxX))/2;r.minX<i.minX?a.push({distance:i.minX-r.minX,box1:r,box2:i,points:[{x:r.minX,y:e},{x:i.minX,y:e},{x:i.minX,y:e}]}):a.push({distance:r.minX-i.minX,box1:r,box2:i,points:[{x:r.minX,y:e},{x:i.minX,y:e},{x:i.minX,y:e}]}),r.maxX>i.maxX?a.push({distance:r.maxX-i.maxX,box1:r,box2:i,points:[{x:i.maxX,y:e},{x:r.maxX,y:e},{x:i.maxX,y:e}]}):a.push({distance:i.maxX-r.maxX,box1:r,box2:i,points:[{x:r.maxX,y:e},{x:i.maxX,y:e},{x:i.maxX,y:e}]}),r.minY<i.minY?a.push({box1:r,box2:i,distance:i.minY-r.minY,points:[{x:t,y:r.minY},{x:t,y:i.minY},{x:t,y:i.minY}]}):a.push({box1:r,box2:i,distance:r.minY-i.minY,points:[{x:t,y:r.minY},{x:t,y:i.minY},{x:t,y:i.minY}]}),r.maxY>i.maxY?a.push({box1:r,box2:i,distance:r.maxY-i.maxY,points:[{x:t,y:i.maxY},{x:t,y:r.maxY},{x:t,y:i.maxY}]}):a.push({box1:r,box2:i,distance:i.maxY-r.maxY,points:[{x:t,y:r.maxY},{x:t,y:i.maxY},{x:t,y:i.maxY}]})}}JSON.stringify(E)!==JSON.stringify(a)&&D(a)},[e,t]);S.useEffect(()=>{e.distanceGuidesVisible?oe():E&&D(null)},[e.distanceGuidesVisible,oe,e.selectedShapes.map(e=>`${e.x},${e.y},${e.width},${e.height},${e.rotation}`).join(`|`)]);let se=S.useRef(!1);S.useEffect(()=>{let e,t=C.current?.closest(`.polotno-workspace-inner`),n=()=>{se.current=!0,clearTimeout(e),e=setTimeout(()=>{se.current=!1},300)};return t?.addEventListener(`scroll`,n),()=>{clearTimeout(e),t?.removeEventListener(`scroll`,n)}},[]),S.useEffect(()=>{let e=x.current;if(!e)return;let t=e.container(),n=e=>{var t,n;e.touches.length>=2&&((t=b.current)!=null&&t.isDragging()&&b.current.stopDrag(),(n=b.current)==null||n.nodes().forEach(e=>{e.isDragging()&&e.stopDrag()}))};return t.addEventListener(`touchstart`,n,{passive:!0}),t.addEventListener(`touchmove`,n,{passive:!0}),()=>{t.removeEventListener(`touchstart`,n),t.removeEventListener(`touchmove`,n)}},[]);let ce=n=>{if(e.activePage!==t&&t.select(),se.current||L.current)return;let r=n.evt.ctrlKey||n.evt.metaKey||n.evt.shiftKey,i=n.target.findAncestor(`.elements-container`),a=n.target.findAncestor(`.page-abs-container`),o=n.target.findAncestor(`Transformer`);if(!(r||i||o||a||I.visible)){e.selectElements([]);return}let s=n.target.findAncestor(`.element-container`,!0)?.findOne(`.element`)||n.target.findAncestor(`.element`,!0),c=e.getElementById(s?.id())?.top?.id,l=e.selectedElementsIds.indexOf(c)>=0,u=n.target.findAncestor(`.page-container`,!0);c&&r&&!l?e.selectElements(e.selectedElementsIds.concat([c])):c&&r&&l?e.selectElements(e.selectedElementsIds.filter(e=>e!==c)):!c||r||l?u?e.selectPages([t.id]):e.selectPages([]):e.selectElements([c])};Km(b,e);let le=e.activePage===t,ue=e._selectedPagesIds.includes(t.id),de=o?.PageControls,fe=o?.Tooltip,pe=o?.ContextMenu,me=1/e.scale,he=0/e.scale;return S.createElement(`div`,{ref:C,onDragOver:e=>e.preventDefault(),onDrop:n=>{if(n.preventDefault(),!x.current)return;x.current.setPointersPositions(n);let r=x.current.findOne(`.elements-container`)?.getRelativePointerPosition(),i=x.current.getPointerPosition(),a=x.current.getAllIntersections(i).map(e=>e.findAncestor(`.element`,!0)).filter(Boolean),o=[...new Set(a.reverse())].map(t=>e.getElementById(t.id())).filter(e=>!!e),s=o[0];mv&&r&&(mv(r,s,{elements:o,page:t}),mv=null)},style:{position:`relative`,width:n+`px`,height:r+`px`,overflow:`hidden`,flexShrink:0},className:`polotno-page-container`+(le?` active-page`:``)},S.createElement(Go,{ref:x,width:Math.min(n,c.width+200),height:Math.min(c.height+200,r),onClick:ce,onTap:ce,onContextMenu:t=>{t.evt.preventDefault();let n=t.target.findAncestor(`.element`,!0),r=e.getElementById(n?.id())?.top?.id;r?e.selectedElementsIds.indexOf(r)>=0||e.selectElements([r]):e.selectElements([]),M.open({x:t.evt.clientX,y:t.evt.clientY})},onMouseDown:ae,onMouseMove:t=>{if(!e.distanceGuidesVisible&&!t.evt.altKey){E&&D(null);return}oe(t.target.findAncestor(`.element`,!0)?.id())},onDragStart:t=>{var n;let r=t.target.getStage();if(r&&r.getPointersPositions().length>=2){t.target.stopDrag();return}let i=t.target.findAncestor(`.element`,!0);if(i){let r=e.getElementById(i?.id())?.top?.id;!(e.selectedElementsIds.indexOf(r)>=0)&&r&&(e.selectElements([r]),t.target.stopDrag(),t.target.startDrag(t),(n=b.current)==null||n.startDrag(t))}E&&D(null)},pageId:t.id,style:{position:`absolute`,overflow:`hidden`,top:0,left:0}},S.createElement(Po,null,S.createElement(av,{width:n,height:r,fill:f.workspaceBackgroundColor}),S.createElement(Fo,{x:v,y,scaleX:e.scale,scaleY:e.scale,name:`page-container`},S.createElement(Fo,{name:`page-container-2`},S.createElement(Fo,{name:`page-background-group`,x:h,y:h},S.createElement(cv,{x:-t.bleed,y:-t.bleed,width:t.computedWidth+2*t.bleed,height:t.computedHeight+2*t.bleed,background:t.background,transparencyBackgroundColor:f.transparencyBackgroundColor,name:`page-background`,preventDefault:!1,scale:e.scale})),S.createElement(Fo,{x:h,y:h,name:`elements-container`,listening:!e.isPlaying},S.createElement(Lo,{name:`elements-area`,width:t.computedWidth,height:t.computedHeight,listening:!1}),S.createElement(fv,{elements:t.children,store:e})),S.createElement(Lo,{stroke:f.bleedColor,name:`bleed`,strokeWidth:t.bleed,x:t.bleed/2,y:t.bleed/2,width:t.computedWidth+t.bleed,height:t.computedHeight+t.bleed,listening:!1,visible:t.bleed>0&&e.bleedVisible,hideInExport:!0}),$h()===_v&&S.createElement(vv,{name:`hit-detection`,x:-me/2-he,y:-me/2-he,width:g+me+2*he,height:_+me+2*he}))),S.createElement(Ro,{name:`workspace-background`,points:[0,0,n,0,n,r,0,r,0,0,v,y,v,r-y,n-v,r-y,n-v,y,v,y],listening:!1,closed:!0,fill:f.workspaceBackgroundColor}),S.createElement(Fo,{x:v,y,scaleX:e.scale,scaleY:e.scale},S.createElement(Lo,{name:`page-highlight`,hideInExport:!0,x:-me/2-he,y:-me/2-he,width:g+me+2*he,height:_+me+2*he,stroke:ue?f.activePageBorderColor:f.pageBorderColor,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),S.createElement(Fo,{x:v+h*e.scale,y:y+h*e.scale,scaleX:e.scale,scaleY:e.scale,name:`page-abs-container`},S.createElement(Uo,{ref:b,rotateAnchorAngle:A,onDragStart:n=>{var r;let i=n.target.getStage();i&&i.getPointersPositions().length>=2?n.target.stopDrag():((r=n.evt)!=null&&r.altKey&&s&&e.selectedElements.forEach(e=>{let n=e.clone({},{skipSelect:!0}),r=t.children.indexOf(e);t.setElementZIndex(n.id,r)}),T.current=!0,e.history.startTransaction())},onDragEnd:()=>{T.current&&=(e.history.endTransaction(),!1),F()},onTransformStart:()=>{e.history.startTransaction(),D(null)},boundBoxFunc:(t,n)=>{let r=Math.abs(n.width)<1||Math.abs(n.height)<1,i=Math.abs(t.width)<1||Math.abs(t.height)<1;if(r&&!i)return t;let a=e.selectedElements;if(a.length===1&&a[0]?.type===`table`){let e=a[0],r=Math.abs(t.width),i=Math.abs(t.height);if(r>0&&i>0){let a=Math.abs(n.width)/r,o=Math.abs(n.height)/i,s=e.width*a,c=e.height*o;if(s<e.minWidth||c<e.minHeight)return t}}return n},onTransform:e=>{let t=b.current.nodes(),n=t[t.length-1];e.target===n&&setTimeout(()=>{re()},0)},onTransformEnd:t=>{k({}),e.history.endTransaction(),F()},visible:!e.isPlaying}),E&&E.map(({points:t,distance:n,box1:r,box2:i},a)=>S.createElement(`Group`,{name:`distances-container`,hideInExport:!0,key:a,listening:!1},S.createElement(`Rect`,Object.assign({},r,{stroke:f.distanceGuideStyle.stroke,strokeWidth:1,strokeScaleEnabled:!1})),S.createElement(`Rect`,Object.assign({},i,{stroke:f.distanceGuideStyle.stroke,strokeWidth:1,strokeScaleEnabled:!1})),S.createElement(`Line`,{points:[t[0].x,t[0].y,t[1].x,t[1].y],stroke:f.distanceGuideStyle.stroke,strokeWidth:1,strokeScaleEnabled:!1}),S.createElement(`Line`,{points:[t[1].x,t[1].y,t[2].x,t[2].y],stroke:f.distanceGuideStyle.stroke,strokeWidth:1,strokeScaleEnabled:!1}),S.createElement(`Label`,{x:(t[0].x+t[1].x)/2,y:(t[0].y+t[1].y)/2,offsetY:-10,scaleX:1/e.scale,scaleY:1/e.scale},S.createElement(`Tag`,{cornerRadius:5,fill:f.distanceGuideStyle.labelFill,pointerDirection:`down`}),S.createElement(`Text`,{align:`center`,verticalAlign:`middle`,fill:f.distanceGuideStyle.labelTextFill,padding:5,text:yg({unit:e.unit,dpi:e.dpi,px:n})})))),t._rendering&&S.createElement(`Group`,null,S.createElement(`Rect`,{width:g,height:_,fill:`rgba(255,255,255,0.9)`}),S.createElement(`Text`,{text:`Rendering...`,fontSize:60,width:g,height:_,align:`center`,verticalAlign:`middle`})),fe&&S.createElement(fe,{components:o,store:e,page:t,stageRef:x,tooltipSafeArea:u}),pe&&S.createElement(Ss,null,S.createElement(pe,Object.assign({components:o,store:e},M.props)))),S.createElement(Q_,{store:e,page:t,width:n,height:r,scale:e.scale,xPadding:v,yPadding:y,bleed:h}),S.createElement(dv,Object.assign({},O,{store:e})),S.createElement(lv,{selection:I}),tg()>0&&S.createElement(`Group`,{hideInExport:!0},S.createElement(Sv,{name:`cache-bounds`,x:n-(tg()===1?250:210),y:r-(tg()===1?95:45)}),S.createElement(Sv,{name:`cache-bounds-t`,x:10,y:10})),ng()&&S.createElement(`Text`,{text:`Powered by polotno.com`,fontSize:14,fill:`rgba(0,0,0,0.6)`,x:n-170,y:r-18,onMouseEnter:e=>{e.target.getStage().container().style.cursor=`pointer`},onMouseLeave:e=>{e.target.getStage().container().style.cursor=``},onTouchStart:e=>{e.cancelBubble=!0},onMouseDown:e=>{e.cancelBubble=!0},onClick:()=>{window.open(`https://polotno.com`,`_blank`,`noopener`)},onTap:()=>{window.open(`https://polotno.com`,`_blank`,`noopener`)}}),S.createElement(Fo,{name:`line-guides`}))),w&&de&&S.createElement(de,{store:e,page:t,xPadding:v,yPadding:y,layout:l}))}),wv=Sm(`div`,S.forwardRef)`
287
- position: absolute;
288
- top: 0;
289
- left: 0;
290
- pointer-events: none;
291
- `,Tv=Sm(`div`,S.forwardRef)`
292
- height: 14px;
293
- position: sticky;
294
- font-size: 8px;
295
- line-height: 14px;
296
- top: 0;
297
- left: 0;
298
- color: grey;
299
- border-bottom: 1px solid grey;
300
- background-color: #e8e8e8;
301
- overflow: hidden;
302
- box-sizing: border-box;
303
- `,Ev=Sm(`div`,S.forwardRef)`
304
- left: 0;
305
- width: 14px;
306
- position: sticky;
307
- font-size: 8px;
308
- line-height: 14px;
309
- color: grey;
310
- border-right: 1px solid grey;
311
- background-color: #e8e8e8;
312
- overflow: hidden;
313
- box-sizing: border-box;
314
- `,Dv=Sm(`div`,S.forwardRef)`
315
- position: absolute;
316
- border-left: 1px solid grey;
317
- padding-left: 2px;
318
- `,Ov=Sm(`div`,S.forwardRef)`
319
- position: absolute;
320
- left: 14px;
321
- border-left: 1px solid grey;
322
- padding-left: 2px;
323
- transform: rotate(90deg);
324
- transform-origin: left top;
325
- overflow: hidden;
326
- `,kv=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4],Av=U(({store:e,width:t,height:n,pageSizes:r,layout:i=`vertical`,renderOnlyActivePage:a})=>{let{rulerStyle:o}=ps(),s=S.useRef(null);if(!e.activePage)return null;let c=i===`horizontal`,l=e.activePage,u=(e.bleedVisible&&l.bleed,l.computedWidth*e.scale),d=l.computedHeight*e.scale,f=(t-u)/2,p=(n-d)/2,m=(h=t=>vg({unitVal:t,dpi:e.dpi,unit:e.unit})*e.scale,kv.find(e=>h(e)>30)||1e4);var h;let g=vg({unitVal:m,dpi:e.dpi,unit:e.unit})*e.scale,_=Math.round(u/g)+1,v=Math.round(d/g)+1,y=zm(e.selectedShapes),{backgroundColor:b,textColor:x,borderColor:C,borderSize:w,tickColor:T,tickSize:E}=o;return S.createElement(wv,{ref:s,className:`polotno-rulers`,style:{display:`flex`,flexDirection:`column`}},c?S.createElement(S.Fragment,null,S.createElement(`div`,{style:{display:`flex`,flexDirection:`row`,position:`sticky`,top:0,zIndex:1}},S.createElement(`div`,{className:`polotno-ruler-corner`,style:{width:`14px`,height:`14px`,flexShrink:0,marginRight:`-14px`,boxSizing:`border-box`,backgroundColor:b,borderRight:`${w}px solid ${C}`,borderBottom:`${w}px solid ${C}`,position:`sticky`,left:0,zIndex:2}}),(a?[e.activePage]:e.pages).map((n,i)=>{if(!n)return null;let a=r?r[i]:t,o=(a-n.computedWidth*e.scale)/2;return S.createElement(Tv,{key:n.id,style:{width:a+`px`,flexShrink:0,position:`relative`,backgroundColor:b,color:x,borderBottom:`${w}px solid ${C}`},className:`polotno-x-ruler`},[...Array(_)].map((t,n)=>S.createElement(Dv,{key:n,className:`polotno-ruler-tick`,style:{left:o+n*g+`px`,width:g+`px`,borderLeft:`${E}px solid ${T}`}},e.unit===`px`||m>=1?Math.round(m*n):(m*n).toFixed(1))),e.selectedShapes[0]?.page===n&&S.createElement(`div`,{className:`polotno-ruler-selection`,style:{position:`absolute`,left:o+y.x*e.scale+`px`,height:`14px`,width:y.width*e.scale,backgroundColor:`rgba(0,0,0,0.15)`}}))})),S.createElement(Ev,{style:{height:n+`px`,position:`sticky`,left:0,marginTop:`-14px`,backgroundColor:b,color:x,borderRight:`${w}px solid ${C}`},className:`polotno-y-ruler`},[...Array(v)].map((t,n)=>S.createElement(Ov,{key:n,className:`polotno-ruler-tick`,style:{top:p+n*g+`px`,width:g+`px`,borderLeft:`${E}px solid ${T}`}},e.unit===`px`||m>=1?Math.round(m*n):(m*n).toFixed(1))),!!e.selectedShapes.length&&S.createElement(`div`,{className:`polotno-ruler-selection`,style:{position:`absolute`,top:p+y.y*e.scale+`px`,width:`14px`,height:y.height*e.scale,backgroundColor:`rgba(0,0,0,0.15)`}}))):S.createElement(S.Fragment,null,S.createElement(Tv,{style:{width:t+`px`,backgroundColor:b,color:x,borderBottom:`${w}px solid ${C}`},className:`polotno-x-ruler`},[...Array(_)].map((t,n)=>S.createElement(Dv,{key:n,className:`polotno-ruler-tick`,style:{left:f+n*g+`px`,width:g+`px`,borderLeft:`${E}px solid ${T}`}},e.unit===`px`||m>=1?Math.round(m*n):(m*n).toFixed(1))),!!e.selectedShapes.length&&S.createElement(`div`,{className:`polotno-ruler-selection`,style:{position:`absolute`,left:f+y.x*e.scale+`px`,height:`14px`,width:y.width*e.scale,backgroundColor:`rgba(0,0,0,0.15)`}})),(a?[e.activePage]:e.pages).map((t,i)=>{if(!t)return null;let a=r?r[i]:n,o=(a-t.computedHeight*e.scale)/2,s=i===0?14:0;return S.createElement(Ev,{key:t.id,style:{height:a-s+`px`,backgroundColor:b,color:x,borderRight:`${w}px solid ${C}`},className:`polotno-y-ruler`},[...Array(v)].map((t,n)=>S.createElement(Ov,{key:n,className:`polotno-ruler-tick`,style:{top:o+n*g-s+`px`,width:g+`px`,borderLeft:`${E}px solid ${T}`}},e.unit===`px`||m>=1?Math.round(m*n):(m*n).toFixed(1))),e.selectedShapes[0]?.page===t&&S.createElement(`div`,{className:`polotno-ruler-selection`,style:{position:`absolute`,top:o+y.y*e.scale-s+`px`,width:`14px`,height:y.height*e.scale,backgroundColor:`rgba(0,0,0,0.15)`}}))})))}),jv=U(({audio:e,store:t})=>{let[n,r]=function(e){let[t,n]=S.useState(null),[r,i]=S.useState(`loading`);return S.useEffect(()=>{let t=new Audio(e),r=()=>{i(`loaded`),n(t)},a=()=>{i(`failed`),n(null)};return t.addEventListener(`canplay`,r),t.addEventListener(`error`,a),()=>{t.removeEventListener(`canplay`,r),t.removeEventListener(`error`,a)}},[e]),[t,r]}(e.src);return S.useEffect(()=>{n&&t.history.ignore(()=>{e.set({duration:1e3*n.duration})})},[n,e,t.history]),S.useEffect(()=>{if(!n)return;let r=()=>{n.currentTime=e.startTime*e.duration/1e3},i=()=>{let t=e.endTime*e.duration/1e3;n.currentTime>=t&&(n.pause(),n.currentTime=e.startTime*e.duration/1e3)};n.addEventListener(`ended`,r),n.addEventListener(`timeupdate`,i);let a=$n(()=>{let r=t.animatedElementsIds;if(r.length&&!r.includes(e.id))return;let i=t.currentTime-e.delay,a=e.duration*(e.endTime-e.startTime),o=i>=0&&i<a;if(!t.isPlaying||t.animatedElementsIds.length!==0||!o){n.pause();return}n.volume=e.volume,n.paused&&n.play();let s=i%a/1e3+e.startTime*e.duration/1e3,c=n.currentTime;Math.abs(c-s)>.5&&s!==c&&(n.currentTime=s)});return()=>{n.pause(),n.removeEventListener(`ended`,r),n.removeEventListener(`timeupdate`,i),a()}},[t.isPlaying,e.startTime,e.endTime,e.volume,n]),null}),Mv={data:[],pageId:``},Nv=`polotno_clipboard`,Pv=(e,t)=>{Mv={data:JSON.parse(JSON.stringify(e)),pageId:t||``};try{localStorage.setItem(Nv,JSON.stringify(e)),localStorage.setItem(Nv+`_page`,t||``)}catch{}},Fv=()=>{try{let e=localStorage.getItem(Nv),t=localStorage.getItem(Nv+`_page`);if(e)return{data:JSON.parse(e),pageId:t}}catch{}return Mv},Iv=e=>{e.selectedElements.length!==0&&Pv(e.selectedElements.map(e=>e.toJSON()),e.activePage?.id)},Lv=e=>{Pv(e.selectedElements.map(e=>e.toJSON()),e.activePage?.id);let t=e.selectedElements.filter(e=>e.removable).map(e=>e.id);e.deleteElements(t)},Rv=e=>{e.history.transaction(()=>{let t=0,n=0,{data:r,pageId:i}=Fv();if(i===e.activePage?.id)t=e.width/20,n=e.height/20;else{let i=[];R_({children:r},e=>{e.type!==`group`&&i.push(e)});let a=zm(i);a.maxX>e.width&&(t=-a.minX),a.maxY>e.height&&(n=-a.minY)}let a=[];R_({children:r},e=>{delete e.id,e.type!==`group`&&(e.x+=t,e.y+=n)}),r.forEach(t=>{let n=e.activePage?.addElement(t);n&&a.push(n.id)}),Pv(r,e.activePage?.id),e.selectElements(a)})};function zv(e,t){let n=[];e.forEach(e=>{if(!1===e.removable)return;let t=e.clone();e.type===`group`?t.children.forEach(e=>{e.set({x:e.x+50,y:e.y+50})}):t.set({x:e.x+50,y:e.y+50}),n.push(t.id)}),t.selectElements(n)}var Bv=e=>{if(e.type!==`group`)return Rm(e);let t=1/0,n=1/0,r=-1/0,i=-1/0;return e.children.forEach(e=>{let a=Bv(e);t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x+a.width),i=Math.max(i,a.y+a.height)}),{x:t,y:n,width:r-t,height:i-n}},Vv=(e,t,n)=>{if(e.type!==`group`){let r=Rm(e),i=t-r.x,a=n-r.y;e.set({x:e.x+i,y:e.y+a})}else{let r=t-Bv(e).x,i=n-Bv(e).y;e.children.forEach(e=>{let t=Bv(e);Vv(e,t.x+r,t.y+i)})}};function Hv(e){let t=e.activePage?.computedWidth;e.selectedElements.forEach(e=>{t=Math.min(t,Bv(e).x)}),e.selectedElements.length===1&&(t=0),e.selectedElements.forEach(e=>{let n=Bv(e);Vv(e,n.x-n.x+t,n.y)})}function Uv(e){let t=0;e.selectedElements.forEach(e=>{let n=Bv(e);t=Math.max(t,n.x+n.width)}),e.selectedElements.length===1&&(t=e.activePage?.computedWidth),e.selectedElements.forEach(e=>{let n=Bv(e);Vv(e,t-n.width,n.y)})}function Wv(e){let t=e.activePage?.computedHeight;e.selectedElements.forEach(e=>{t=Math.min(t,Bv(e).y)}),e.selectedElements.length===1&&(t=0),e.selectedElements.forEach(e=>{let n=Bv(e);Vv(e,n.x,n.y-n.y+t)})}function Gv(e){let t=e.activePage?.computedHeight,n=0;e.selectedElements.forEach(e=>{let r=Bv(e);t=Math.min(t,r.y),n=Math.max(n,r.y+r.height)});let r=(n+t)/2;e.selectedElements.length===1&&(r=e.activePage?.computedHeight/2),e.selectedElements.forEach(e=>{let t=Bv(e);Vv(e,t.x,r-t.height/2)})}function Kv(e){let t=0;e.selectedElements.forEach(e=>{let n=Bv(e);t=Math.max(t,n.y+n.height)}),e.selectedElements.length===1&&(t=e.activePage?.computedHeight),e.selectedElements.forEach(e=>{let n=Bv(e);Vv(e,n.x,t-n.height)})}function qv(e){let t=e.activePage?.computedWidth,n=0;e.selectedElements.forEach(e=>{let r=Bv(e);t=Math.min(t,r.x),n=Math.max(n,r.x+r.width)});let r=(n+t)/2;e.selectedElements.length===1&&(r=e.activePage?.computedWidth/2),e.selectedElements.forEach(e=>{let t=Bv(e);Vv(e,r-t.width/2,t.y)})}var Jv=`rgba(191, 191, 191, 100)`;function Yv(e,t,n){let r=e.getCell(t,n);r&&e.focusCell(r.id)}function Xv(e,t,n){let r=e.getCell(t,n);r&&e.enterCellEdit(r.id)}function Zv(e,t){var n,r,i,a,o,s,c,l;let u=function(e){if(e.selectedElements.length!==1)return null;let t=e.selectedElements[0];return t.type===`table`?t:null}(t);if(u&&function(e,t){let n=t._focusedCellIds.length>0,r=!!t._editingCellId;if(!n&&!r)return!1;if(r){if(e.key===`Escape`)return e.preventDefault(),t.exitCellEdit(),!0;if(e.key===`Tab`){e.preventDefault();let n=t.editingCell;if(t.exitCellEdit(),n)if(e.shiftKey){let e=n.col-1,r=n.row;e<0&&(--r,e=t.cols-1),r<0&&(r=t.rows-1,e=t.cols-1),Xv(t,r,e)}else{let e=n.col+1,r=n.row;e>=t.cols&&(r+=1,e=0),r>=t.rows&&(r=0,e=0),Xv(t,r,e)}return!0}if(e.metaKey||e.ctrlKey){let n=t.editingCell;if(n){if(e.key===`b`)return e.preventDefault(),n.set({fontWeight:n.fontWeight===`bold`?`normal`:`bold`}),!0;if(e.key===`i`)return e.preventDefault(),n.set({fontStyle:n.fontStyle===`italic`?`normal`:`italic`}),!0;if(e.key===`u`){e.preventDefault();let t=n.textDecoration.split(` `).filter(Boolean),r=t.includes(`underline`);return n.set({textDecoration:r?t.filter(e=>e!==`underline`).join(` `):[...t,`underline`].join(` `)}),!0}}}return!0}if(e.key===`Escape`)return e.preventDefault(),t.clearCellFocus(),!0;let i=t.focusedCells[0];if(!i)return!1;let a=i.row,o=i.col;if(e.key===`Enter`)return e.preventDefault(),t.enterCellEdit(i.id),!0;if(e.key===`Tab`){if(e.preventDefault(),e.shiftKey){let e=o-1,n=a;e<0&&(--n,e=t.cols-1),n<0&&(n=t.rows-1,e=t.cols-1),Yv(t,n,e)}else{let e=o+1,n=a;e>=t.cols&&(n+=1,e=0),n>=t.rows&&(n=0,e=0),Yv(t,n,e)}return!0}if(e.key===`ArrowRight`||e.key===`ArrowLeft`||e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),e.shiftKey){let n=function(e){let t=e.cells.find(t=>t.id===e._anchorCellId);if(!t)return null;let n=e.focusedCells;if(n.length<=1)return{row:t.row,col:t.col};let r=1/0,i=-1,a=1/0,o=-1;for(let e of n)e.row<r&&(r=e.row),e.row>i&&(i=e.row),e.col<a&&(a=e.col),e.col>o&&(o=e.col);return{row:t.row===r?i:r,col:t.col===a?o:a}}(t)||{row:a,col:o},r=n.row,i=n.col;e.key===`ArrowRight`&&(i=Math.min(n.col+1,t.cols-1)),e.key===`ArrowLeft`&&(i=Math.max(n.col-1,0)),e.key===`ArrowDown`&&(r=Math.min(n.row+1,t.rows-1)),e.key===`ArrowUp`&&(r=Math.max(n.row-1,0)),t.focusCellRange(r,i)}else e.key===`ArrowRight`&&Yv(t,a,Math.min(o+1,t.cols-1)),e.key===`ArrowLeft`&&Yv(t,a,Math.max(o-1,0)),e.key===`ArrowDown`&&Yv(t,Math.min(a+1,t.rows-1),o),e.key===`ArrowUp`&&Yv(t,Math.max(a-1,0),o);return!0}if(e.key===`Delete`||e.key===`Backspace`)return e.preventDefault(),t.focusedCells.forEach(e=>{e.set({text:``})}),!0;let s=e.ctrlKey||e.metaKey;if(s&&e.code===`KeyC`){e.preventDefault();let n=t.focusedCells.map(e=>mc(e.text));return navigator.clipboard.writeText(n.join(`
327
- `)),!0}return s&&e.code===`KeyV`?(e.preventDefault(),navigator.clipboard.readText().then(e=>{let n=t.focusedCells[0];n&&n.set({text:e})}),!0):!(!s||e.code!==`KeyA`||(e.preventDefault(),t.cells.forEach(e=>{t.focusCell(e.id,!0)}),0))}(e,u)||document.activeElement?.tagName===`INPUT`||document.activeElement?.tagName===`TEXTAREA`||document.activeElement?.contentEditable===`true`)return;let d=document.querySelector(`.polotno-workspace-container`);if(document.activeElement!==d&&!d?.contains(document.activeElement)){let e=window.getSelection();if(e&&e.toString().length>0)return}let f=t.selectedElements.filter(e=>e.removable).map(e=>e.id);e.keyCode!==46&&e.keyCode!==8||t.deleteElements(f);let p=e.ctrlKey||e.metaKey,m=e.shiftKey,h=e.altKey;if(e.key===`Escape`){e.preventDefault(),t.tool===`draw`?t.setTool(`selection`):t.selectElements([]);return}if(!p||m||e.key.toLowerCase()!==`z`&&e.key.toLowerCase()!==`y`||(e.preventDefault(),t.history.undo()),p&&m&&(e.key.toLowerCase()===`z`||e.key.toLowerCase()===`y`)&&(e.preventDefault(),t.history.redo()),p&&e.code===`KeyA`){e.preventDefault();let n=(t.activePage?.children.filter(e=>e.selectable))?.map(e=>e.id)||[];t.selectElements(n)}if(p&&e.code===`KeyC`&&(e.preventDefault(),Iv(t)),p&&e.code===`KeyX`&&(e.preventDefault(),Lv(t)),p&&e.code===`KeyV`&&(e.preventDefault(),Rv(t)),e.code===`ArrowDown`){e.preventDefault();let n=e.shiftKey?10:1;t.selectedShapes.forEach(e=>{e.draggable&&e.set({y:e.y+n})})}if(e.code===`ArrowUp`){e.preventDefault();let n=e.shiftKey?10:1;t.selectedShapes.forEach(e=>{e.draggable&&e.set({y:e.y-n})})}if(e.code===`ArrowLeft`){e.preventDefault();let n=e.shiftKey?10:1;t.selectedShapes.forEach(e=>{e.draggable&&e.set({x:e.x-n})})}if(e.code===`ArrowRight`){e.preventDefault();let n=e.shiftKey?10:1;t.selectedShapes.forEach(e=>{e.draggable&&e.set({x:e.x+n})})}if(p&&e.code===`KeyG`){e.preventDefault();let n=t.selectedElements[0];if(n&&n.type===`group`){let e=n;t.ungroupElements([e.id])}else t.groupElements(t.selectedElements.map(e=>e.id))}if(p&&e.code===`KeyD`&&(e.preventDefault(),zv(t.selectedElements,t)),e.code===`KeyT`&&!p){e.preventDefault();let r=t.width/2,i=t.width/2-r/2,a=t.height/2-30/2,o=(t.width+t.height)/2160;(n=t.activePage)==null||n.addElement({type:`text`,x:i,y:a,width:r,fontSize:30*o,text:`Sample Text`,fontFamily:`Roboto`})}if(e.code===`KeyR`&&!p){e.preventDefault();let n={type:`figure`,x:t.width/4,y:t.height/4,width:300,height:300,fill:Jv,stroke:`#0c0c0c`,strokeWidth:0,subType:`rect`};(r=t.activePage)==null||r.addElement(n)}if(e.code===`KeyL`&&!p){e.preventDefault();let n=(t.activePage?.computedWidth??0)/3,r={type:`line`,x:(t.activePage?.computedWidth??0)/2-n/2,y:(t.activePage?.computedHeight??0)/2,width:n,color:Jv};(i=t.activePage)==null||i.addElement(r)}if(e.code===`KeyO`&&!p){e.preventDefault(),e.preventDefault();let n={type:`figure`,x:t.width/4,y:t.height/4,width:300,height:300,fill:Jv,stroke:`#0c0c0c`,strokeWidth:0,subType:`circle`};(a=t.activePage)==null||a.addElement(n)}p&&e.code===`Equal`&&(e.preventDefault(),t.setScale(t.scale+.1)),p&&e.code===`Minus`&&(e.preventDefault(),t.setScale(t.scale-.1)),h&&(e.code===`KeyA`&&(e.preventDefault(),Hv(t)),e.code===`KeyD`&&(e.preventDefault(),Uv(t)),e.code===`KeyS`&&(e.preventDefault(),Kv(t)),e.code===`KeyW`&&(e.preventDefault(),Wv(t)),e.code===`KeyV`&&(e.preventDefault(),Gv(t)),e.code===`KeyH`&&(e.preventDefault(),qv(t))),e.code===`BracketRight`&&(e.preventDefault(),p?(o=t.activePage)==null||o.moveElementsUp(t.selectedElementsIds):(s=t.activePage)==null||s.moveElementsTop(t.selectedElementsIds)),e.code===`BracketLeft`&&(e.preventDefault(),p?(c=t.activePage)==null||c.moveElementsDown(t.selectedElementsIds):(l=t.activePage)==null||l.moveElementsBottom(t.selectedElementsIds))}var Qv=z({toolbar:{duration:`Duration`,opacity:`Opacity`,effects:`Effects`,blur:`Blur`,curvedText:`Curved text`,curvePower:`Power`,temperature:`Temperature`,saturation:`Saturation`,contrast:`Contrast`,shadows:`Shadows`,white:`White`,black:`Black`,vibrance:`Vibrance`,textBackground:`Background`,backgroundCornerRadius:`Corner radius`,backgroundOpacity:`Opacity`,backgroundPadding:`Padding`,brightness:`Brightness`,filters:`Filters`,sepia:`Sepia`,grayscale:`Grayscale`,cold:`Cold`,natural:`Natural`,warm:`Warm`,textStroke:`Text Stroke`,shadow:`Shadow`,border:`Border`,cornerRadius:`Corner Radius`,copyStyle:`Copy style`,uppercase:`Uppercase`,position:`Position`,layering:`Layering`,toForward:`To Front`,up:`Forward`,down:`Backward`,toBottom:`To back`,alignLeft:`Align left`,alignCenter:`Align center`,alignRight:`Align right`,alignTop:`Align top`,alignMiddle:`Align middle`,alignBottom:`Align bottom`,flip:`Flip`,flipHorizontally:`Flip horizontally`,flipVertically:`Flip vertically`,fitToBackground:`Fit to page`,removeBackground:`Remove background`,removeBackgroundTitle:`Remove background from image`,cancelRemoveBackground:`Cancel`,confirmRemoveBackground:`Confirm`,crop:`Crop`,cropDone:`Done`,cropCancel:`Cancel`,clip:`Apply mask`,removeClip:`Remove mask`,removeMask:`Remove mask`,transparency:`Transparency`,lockedDescription:`Object is locked. Unlock it to allow changes from canvas.`,unlockedDescription:`Object is unlocked. Lock it to prevent changes from canvas.`,removeElements:`Remove elements`,duplicateElements:`Duplicate elements`,download:`Download`,saveAsImage:`Save as image`,saveAsPDF:`Save as PDF`,lineHeight:`Line height`,letterSpacing:`Letter spacing`,offsetX:`Offset X`,offsetY:`Offset Y`,color:`Color`,selectable:`Selectable`,draggable:`Draggable`,removable:`Removable`,resizable:`Resizable`,contentEditable:`Can change content`,styleEditable:`Can change style`,alwaysOnTop:`Always on top`,showInExport:`Show in export`,ungroupElements:`Ungroup`,groupElements:`Group`,lineSize:`Line size`,fade:`Fade`,move:`Move`,zoom:`Zoom`,animate:`Animate`,rotate:`Rotate`,none:`None`,bounce:`Bounce`,blink:`Blink`,strength:`Strength`,spaceEvenly:`Space evenly`,horizontalDistribution:`Horizontally`,verticalDistribution:`Vertically`,strokeWidth:`Stroke Width`,strokeSettings:`Stroke settings`,spacing:`Spacing`,volume:`Volume`,lineStyle:`Line style`,lineStartHead:`Line start`,lineEndHead:`Line end`,textDirection:`Text direction`,fontSize:`Font size`,fontFamily:`Font family`,textAlign:`Text align`,verticalAlign:`Vertical align`,bold:`Bold`,italic:`Italic`,underline:`Underline`,strikethrough:`Strikethrough`,cellBackground:`Cell background`,tableBorderSettings:`Border settings`,tableBorderColor:`Border color`,tableBorderWidth:`Border width`,tableBorderStyle:`Border style`,borderAllSides:`All sides`,borderTop:`Top`,borderBottom:`Bottom`,borderLeft:`Left`,borderRight:`Right`,borderNone:`No border`,tableStructure:`Table structure`,tableRows:`Rows`,tableColumns:`Columns`,insertRowAbove:`Insert row above`,insertRowBelow:`Insert row below`,deleteRow:`Delete row`,insertColumnLeft:`Insert column left`,insertColumnRight:`Insert column right`,deleteColumn:`Delete column`,distributeRowsEvenly:`Distribute rows evenly`,distributeColumnsEvenly:`Distribute columns evenly`,cellPadding:`Cell padding`,listFormat:`List`,colorPicker:{solid:`Solid`,linear:`Linear`,angle:`Angle`},aiText:{aiWrite:`AI write`,rewrite:`Rewrite`,shorten:`Shorten`,continue:`Continue writing`,proofread:`Proofread`,tones:`Tones`,friendly:`Friendly`,professional:`Professional`,humorous:`Humorous`,formal:`Formal`,customPrompt:`Custom prompt`,generatedResult:`Generated result`,cancel:`Cancel`,generate:`Generate`,back:`Back`,tryAgain:`Try Again`,insert:`Insert`,promptPlaceholder:`Describe what you want to generate`}},workspace:{noPages:`There are no pages yet...`,addPage:`Add page`,removePage:`Remove page`,duplicatePage:`Duplicate page`,moveUp:`Move up`,moveDown:`Move down`,moveLeft:`Move left`,moveRight:`Move right`},scale:{reset:`Reset`},error:{removeBackground:`Ops! Something went wrong. Background can not be removed.`},sidePanel:{templates:`Templates`,searchTemplatesWithSameSize:`Show templates with the same size`,searchPlaceholder:`Search...`,otherFormats:`Other formats`,noResults:`No results`,error:`Loading is failed...`,text:`Text`,uploadFont:`Upload font`,myFonts:`My fonts`,photos:`Photos`,videos:`Videos`,animations:`Animations`,effects:`Effects`,elements:`Elements`,shapes:`Shapes`,tables:`Tables`,lines:`Lines`,draw:`Draw`,upload:`Upload`,uploadImage:`Add file`,uploadTip:`Upload your assets`,background:`Background`,resize:`Resize`,layers:`Layers`,animate:`Animate`,layerTypes:{image:`Image`,text:`Text`,svg:`SVG`,line:`Line`,figure:`Figure`,group:`Group`},layersTip:`Elements on your active page:`,noLayers:`No elements on the page...`,namePlaceholder:`Type element name...`,useMagicResize:`Use magic resize`,clipImage:`Mask image`,width:`Width`,height:`Height`,magicResizeDescription:`Magic resize will automatically resize and move all elements on the canvas`,headerText:`Header`,createHeader:`Create header`,subHeaderText:`Sub Header`,createSubHeader:`Create sub header`,bodyText:`Body text`,createBody:`Create body text`},pagesTimeline:{pages:`Pages`,removePage:`Remove page`,addPage:`Add page`,duplicatePage:`Duplicate page`,removeAudio:`Remove audio`,duplicateAudio:`Duplicate audio`,muteAudio:`Mute`,unmuteAudio:`Unmute`,volume:`Volume`},contextMenu:{duplicate:`Duplicate`,remove:`Remove`,lock:`Lock`,unlock:`Unlock`,copy:`Copy`,paste:`Paste`,copyStyle:`Copy style`,moveUp:`Move up`,moveDown:`Move down`,moveBack:`Move back`,moveForward:`Move forward`}}),$v=e=>e&&typeof e==`object`;function ey(e,t){Object.keys(t).forEach(n=>{let r=e[n],i=t[n];$v(i)&&$v(r)?ey(r,i):e[n]=i})}function ty(e,t,n=``){Object.keys(t).forEach(r=>{let i=t[r],a=n?`${n}.${r}`:r;$v(i)?$v(e[r])?ty(e[r],i,a):console.warn(`Missing nested translation object at '${a}'`):e[r]===void 0&&console.warn(`Missing translation '${a}'`)})}H((e,{validate:t=!1}={})=>{t&&ty(e,Qv),ey(Qv,e)});var ny={},ry=e=>{let t=function(e,t){var n,r=t.split(`.`),i=e;for(n=0;n<r.length;++n){if(i[r[n]]==null)return;i=i[r[n]]}return i}(Qv,e);if(t!==void 0)return t;ny[e]||(ny[e]=!0,console.warn(`Missing translation '${e}'`));let n=e.split(`.`),r=n[n.length-1]||` `;return r.charAt(0).toUpperCase()+r.slice(1)},iy=(e,t,n)=>Math.max(t,Math.min(n,e)),ay=(e,t)=>Math.sqrt((t.clientX-e.clientX)**2+(t.clientY-e.clientY)**2),oy=({store:e})=>S.createElement(`div`,{style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,textAlign:`center`}},S.createElement(`p`,null,ry(`workspace.noPages`)),S.createElement(`button`,{onClick:()=>{e.addPage()}},ry(`workspace.addPage`))),sy=({width:e,height:t,xPadding:n,yPadding:r,backgroundColor:i})=>S.createElement(`div`,{style:{width:e+`px`,height:t+`px`,backgroundColor:i,paddingLeft:n+`px`,paddingRight:n+`px`,paddingTop:r+`px`,paddingBottom:r+`px`,flexShrink:0}},S.createElement(`div`,{style:{width:` 100%`,height:`100%`,backgroundColor:`white`}})),cy=U(({store:e,layout:t=`vertical`,pageControlsEnabled:n,backgroundColor:r,transparencyBackgroundColor:i,pageBorderColor:a,activePageBorderColor:o,bleedColor:s,snapGuideStroke:c,snapGuideStrokeWidth:l,snapGuideDash:u,selectionRectFill:d,selectionRectStroke:f,selectionRectStrokeWidth:p,transformLabelFill:m,transformLabelTextFill:h,cropOverlayFill:g,transformerStyle:_,innerImageCropTransformerStyle:v,outerImageCropTransformerStyle:y,highlighterStyle:b,mediaLoadingStyle:x,mediaErrorStyle:C,textOverflowIndicatorStyle:w,distanceGuideStroke:T,distanceLabelFill:E,distanceLabelTextFill:D,rulerBackgroundColor:O,rulerTextColor:k,rulerBorderColor:A,rulerBorderSize:j,rulerTickColor:M,rulerTickSize:ee,components:N,onKeyDown:P,paddingX:te,paddingY:ne,pageGap:re,altCloneEnabled:F=!0,visiblePagesOffset:I,renderOnlyActivePage:L,scrollToPageThreshold:ie=.5,tooltipSafeArea:ae})=>{let oe=t===`horizontal`,se=te??20,ce=ne??55,[le,ue]=S.useState({width:100,height:100}),de=S.useRef(le),fe=S.useRef(null),pe=S.useRef(null),me=S.useRef(0),he=e.bleedVisible?Math.max(0,...e.pages.map(e=>e.bleed)):0,ge=Math.max(...e.pages.map(e=>e.computedWidth)),_e=Math.max(...e.pages.map(e=>e.computedHeight)),ve=e.activePage?.computedHeight||0,ye=ge+2*he,be=(L?ve:_e)+2*he,xe=async({skipTimeout:t}={skipTimeout:!1})=>{if(t||await new Promise(e=>setTimeout(e,50)),fe.current===null)return;let n=fe.current.getBoundingClientRect();n.width!==0&&n.height!==0||(console.warn(`Polotno warning: <Workspace /> component can not automatically detect its size.
328
- Width or height of parent elements is equal 0.
329
- Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
330
- For simpler debugging here is the log of the parent element:`),console.log(fe.current));let r=pe.current.clientWidth||n.width,i={width:r,height:n.height};(de.current.width!==i.width||de.current.height!==i.height)&&(ue(i),de.current=i);let a=(r-2*se)/ye,o=e.pages.length>1?3.1:2,s=(n.height-ce*o)/be,c=(r-se*(e.pages.length>1?3.1:2))/ye,l=(n.height-2*ce)/be,u=e.pages.length?Math.max(Math.min(oe?c:a,oe?l:s),.01):1;e.scaleToFit!==u&&(e.setScale(u),e._setScaleToFit(u))};S.useLayoutEffect(()=>{xe({skipTimeout:!0})},[]),S.useEffect(()=>{xe()},[ye,be,ne,te]),S.useLayoutEffect(()=>{xe({skipTimeout:!0})},[e.openedSidePanel]),S.useEffect(()=>{e.__()},[]),S.useEffect(()=>{let e=fe.current;if(window.ResizeObserver){let t=new ResizeObserver(()=>{xe({skipTimeout:!0})});return t.observe(e),()=>t.unobserve(e)}{let e=setInterval(()=>{xe({skipTimeout:!0})},100);return()=>clearInterval(e)}},[ye,be]);let Se=L?1:e.pages.length,Ce,we;if(oe){let t=ye*e.scale*Se;Ce=Math.max(se,(le.width-t)/Se/2),we=Math.max(ce,(le.height-be*e.scale)/2)}else{Ce=Math.max(se,(le.width-ye*e.scale)/2);let t=be*e.scale*Se;we=Math.max(ce,(le.height-t)/Se/2)}Number.isNaN(Ce)&&(Ce=se),Number.isNaN(we)&&(we=ce),S.useEffect(()=>{let t=t=>{(P||Zv)(t,e)};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[]),S.useEffect(()=>{let t=t=>{if(t.ctrlKey||t.metaKey){t.preventDefault();let n=Math.max(5,e.scaleToFit),r=Math.min(.1,e.scaleToFit);oe&&ye>0&&Number.isFinite(ye)&&(r=Math.max(r,300/ye)),r=Math.max(r,.01);let i=.03,a=iy(t.deltaY<0?e.scale*(1+i):e.scale/(1+i),r,n);e.setScale(a);return}},n=pe.current;return n?.addEventListener(`wheel`,t),()=>n?.removeEventListener(`wheel`,t)},[oe,ye,e]),S.useEffect(()=>{let t=pe.current;if(!t)return;let n=e=>{e.touches.length===2&&(me.current=ay(e.touches[0],e.touches[1]))},r=n=>{if(n.touches.length===2&&me.current>0){n.preventDefault();let r=ay(n.touches[0],n.touches[1]),i=r/me.current,a=Math.max(5,e.scaleToFit),o=Math.min(.1,e.scaleToFit);oe&&ye>0&&Number.isFinite(ye)&&(o=Math.max(o,300/ye)),o=Math.max(o,.01);let s=e.scale,c=iy(s*i,o,a),l=c/s,u=t.getBoundingClientRect(),d=(n.touches[0].clientX+n.touches[1].clientX)/2-u.left,f=(n.touches[0].clientY+n.touches[1].clientY)/2-u.top,p=t.scrollLeft+d,m=t.scrollTop+f;je.current=!0,e.setScale(c),t.scrollLeft=p*l-d,t.scrollTop=m*l-f,me.current=r}},i=()=>{me.current=0};return t.addEventListener(`touchstart`,n,{passive:!0}),t.addEventListener(`touchmove`,r,{passive:!1}),t.addEventListener(`touchend`,i,{passive:!0}),()=>{t.removeEventListener(`touchstart`,n),t.removeEventListener(`touchmove`,r),t.removeEventListener(`touchend`,i)}},[oe,ye,e]);let Te=re!==void 0,Ee=e.pages.map(t=>{if(oe){let n=(t.computedWidth+2*he)*e.scale;return Te?n+re:n+2*Ce}{let n=(t.computedHeight+2*he)*e.scale;return Te?n+re:n+2*we}}),De=[],Oe=Te?oe?Ce:we:0;for(let e=0;e<Ee.length;e++)De.push(Oe),Oe+=Ee[e];let ke=Ee.reduce((e,t)=>e+t,0),Ae=Te?ke+(oe?2*Ce:2*we):ke,je=S.useRef(!1),[,Me]=S.useReducer(e=>e+1,0);((e,t,n,r,i)=>{let a=S.useRef(0),o=S.useRef(0),s=S.useRef(null),c=S.useRef(null),l=S.useRef(!1),u=S.useRef(r.pages.length);l.current=u.current!==r.pages.length,u.current=r.pages.length,S.useEffect(()=>{let t=e.current,n=()=>{a.current=t.scrollLeft,o.current=t.scrollTop,s.current=t.scrollWidth,c.current=t.scrollHeight};return t.addEventListener(`scroll`,n),n(),()=>{t.removeEventListener(`scroll`,n)}},[]),S.useLayoutEffect(()=>{if(!e.current||l.current)return;let t=e.current,n=s.current,r=c.current;if(n===null||r===null){s.current=t.scrollWidth,c.current=t.scrollHeight,a.current=t.scrollLeft,o.current=t.scrollTop;return}i.current=!0;let u=t.offsetWidth,d=t.offsetHeight,f=(a.current+u/2)/n,p=(o.current+d/2)/r,m=Math.max(0,t.scrollWidth-u),h=Math.max(0,t.scrollHeight-d);t.scrollLeft=iy(f*t.scrollWidth-u/2,0,m),t.scrollTop=iy(p*t.scrollHeight-d/2,0,h),s.current=t.scrollWidth,c.current=t.scrollHeight,a.current=t.scrollLeft,o.current=t.scrollTop},[n,t])})(pe,Ae,e.scale,e,je);let{handleScroll:Ne}=((e,t,n,r,i,a,o,s,c,l)=>{let u=S.useRef(!1),d=S.useRef(null),f=S.useRef(!1),p=c===`horizontal`;S.useEffect(()=>{let t=e.current,n=()=>{o.current};return t.addEventListener(`scroll`,n),()=>{t.removeEventListener(`scroll`,n)}},[]);let m=r.pages.indexOf(r.activePage);return S.useLayoutEffect(()=>{if(s||!r.activePage||!e.current||u.current)return;let a=e.current,o=r.pages.indexOf(r.activePage),c=t[o]||0,d=p?a.scrollLeft:a.scrollTop,m=p?a.scrollWidth-a.clientWidth:a.scrollHeight-a.clientHeight,h=Math.min(c,Math.max(0,m)),g=n[o]||n[0]||0,_=()=>{};return(Math.abs(h-d)>g*i||f.current)&&(f.current=!0,_=(({element:e,scrollTop:t,scrollLeft:n,duration:r=300,onFinish:i=()=>{}})=>{let a=t!==void 0,o=a?e.scrollTop:e.scrollLeft,s=a?t:n,c=s-o,l=0,u=!1;if(r===0)return a?e.scrollTop=s:e.scrollLeft=s,()=>{};let d=()=>{if(u)return;l+=20;let t=f(l,o,c,r);a?e.scrollTop=t:e.scrollLeft=t,l<r?setTimeout(d,20):i()},f=(e,t,n,r)=>(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t;return d(),()=>{u=!0}})(Object.assign(Object.assign({element:a},p?{scrollLeft:h}:{scrollTop:h}),{onFinish:()=>{f.current=!1,l?.()},duration:r.isPlaying?0:300}))),_},[r.activePage,m,r.isPlaying,s,c,t,n]),{handleScroll:e=>{if(s||f.current)return;u.current=!0,clearTimeout(d.current),d.current=setTimeout(()=>{u.current=!1},300);let n=(p?e.currentTarget.scrollLeft:e.currentTarget.scrollTop)+(p?a.width:a.height)/3,i=0;for(let e=t.length-1;e>=0;e--)if(n>=t[e]){i=e;break}let o=r.pages[i];o&&r.activePage!==o&&o.select()}}})(pe,De,Ee,e,ie,le,je,L,t,Me),R=le.width>=ye*e.scale+2*Ce,Pe=le.height>=be*e.scale+2*we,Fe=r||`rgba(232, 232, 232, 0.9)`,Ie=N?.NoPages||oy,Le=oe?le.width:le.height,Re=pe.current?oe?pe.current.scrollLeft:pe.current.scrollTop:0,ze=e=>{for(let t=De.length-1;t>=0;t--)if(e>=De[t])return t;return 0},Be=Math.max(0,ze(Re)),Ve=Math.min(e.pages.length-1,ze(Re+Le)),He=I??1,Ue=Math.max(0,Be-He),We=Math.min(e.pages.length-1,Ve+He),Ge=vs({cropOverlayFill:g,workspaceBackgroundColor:r,pageBorderColor:a,activePageBorderColor:o,bleedColor:s,transparencyBackgroundColor:i,transformerStyle:_,innerImageCropTransformerStyle:v,outerImageCropTransformerStyle:y,highlighterStyle:b,snapGuideStroke:c,snapGuideStrokeWidth:l,snapGuideDash:u,selectionRectFill:d,selectionRectStroke:f,selectionRectStrokeWidth:p,transformLabelFill:m,transformLabelTextFill:h,distanceGuideStroke:T,distanceLabelFill:E,distanceLabelTextFill:D,mediaLoadingStyle:x,mediaErrorStyle:C,textOverflowIndicatorStyle:w,rulerBackgroundColor:O,rulerTextColor:k,rulerBorderColor:A,rulerBorderSize:j,rulerTickColor:M,rulerTickSize:ee});return S.createElement(fs,{value:Ge},S.createElement(`div`,{ref:fe,style:{width:`100%`,height:`100%`,position:`relative`,outline:`none`,flex:1,backgroundColor:Fe,overflow:`hidden`},tabIndex:0,className:`polotno-workspace-container`},S.createElement(`div`,{ref:pe,onScroll:Ne,style:Object.assign({position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,display:`flex`,flexDirection:oe?`row`:`column`,overflow:`auto`,overflowX:oe?`auto`:R?`hidden`:`auto`,overflowY:oe&&Pe?`hidden`:`auto`},Te&&{paddingTop:oe?0:we,paddingBottom:oe?0:we,paddingLeft:oe?Ce:0,paddingRight:oe?Ce:0,boxSizing:`border-box`}),className:`polotno-workspace-inner`},e.pages.map((r,i)=>{let a=r===e.activePage;if(L&&!a&&!r._exportingOrRendering&&!r._forceMount)return null;let o=a||i>=Ue&&i<=We||r._exportingOrRendering||r._forceMount,s=oe?Ee[i]:ye*e.scale+2*Ce,c=oe?be*e.scale+2*we:Ee[i];if(!o)return S.createElement(`div`,{key:r.id,style:{flexShrink:0}},S.createElement(sy,{width:s,height:c,backgroundColor:Fe,xPadding:Ce,yPadding:we}));let l=S.createElement(Cv,{key:r.id,page:r,xPadding:Ce,yPadding:we,width:s,height:c,store:e,pageControlsEnabled:n,altCloneEnabled:F,components:N,viewportSize:le,layout:t,tooltipSafeArea:ae});return(r._exportingOrRendering||r._forceMount)&&!a&&L?S.createElement(`div`,{style:{display:`none`,flexShrink:0},key:r.id},l):l}),e.rulesVisible&&S.createElement(Av,{store:e,xPadding:Ce,yPadding:we,width:ye*e.scale+2*Ce,height:be*e.scale+2*we,pageSizes:Ee,layout:t,renderOnlyActivePage:L}),e.pages.length===0&&S.createElement(Ie,{store:e}),e.audios.map(t=>S.createElement(jv,{key:t.id,audio:t,store:e})))))});i.prototype._requestDraw=()=>{},Qs(!1),Uc(`change-font-size`);var ly=t_({key:new URLSearchParams(location.search).get(`key`)});window.store=ly;var uy=null;window.__polotnoLoadJspdf=async()=>(uy||=m(()=>import(`./jspdf.es.min-DQ47o5Bu.js`),__vite__mapDeps([0,1,2,3]),import.meta.url),await uy);var dy=null;window.__polotnoLoadVideoExport=async()=>(dy||=m(()=>import(`./lib-DjVS41Qk.js`),__vite__mapDeps([4,1,5]),import.meta.url),await dy),window.config={addGlobalFont:vc,setRichTextEnabled:Vc,setTextVerticalResizeEnabled:zc,setTextOverflow:Uc,onLoadError:fc,setAssetLoadTimeout:ic,setFontLoadTimeout:oc,unstable_setTextSplitAllowed:Wc},C.createRoot(document.getElementById(`root`)).render(S.createElement(cy,{visiblePagesOffset:0,renderOnlyActivePage:!0,store:ly,components:{PageControls:()=>null,Tooltip:()=>null}}));