tinbase 0.10.0 → 0.10.2

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.
Files changed (156) hide show
  1. package/README.md +10 -9
  2. package/dist/admin/api.d.ts +62 -1
  3. package/dist/admin/api.js +221 -10
  4. package/dist/admin/api.js.map +1 -1
  5. package/dist/admin/ui.d.ts +1 -1
  6. package/dist/admin/ui.js +1548 -16
  7. package/dist/admin/ui.js.map +1 -1
  8. package/dist/auth/handler.d.ts +52 -5
  9. package/dist/auth/handler.js +147 -36
  10. package/dist/auth/handler.js.map +1 -1
  11. package/dist/auth/inbox.d.ts +4 -2
  12. package/dist/auth/inbox.js +1 -0
  13. package/dist/auth/inbox.js.map +1 -1
  14. package/dist/auth/oauth.d.ts +30 -4
  15. package/dist/auth/oauth.js +22 -6
  16. package/dist/auth/oauth.js.map +1 -1
  17. package/dist/auth/password.d.ts +5 -0
  18. package/dist/auth/password.js +7 -0
  19. package/dist/auth/password.js.map +1 -1
  20. package/dist/auth/qr.d.ts +1 -1
  21. package/dist/auth/qr.js +1 -1
  22. package/dist/auth/rate-limit.d.ts +33 -0
  23. package/dist/auth/rate-limit.js +63 -0
  24. package/dist/auth/rate-limit.js.map +1 -0
  25. package/dist/auth/redirect.d.ts +20 -0
  26. package/dist/auth/redirect.js +79 -0
  27. package/dist/auth/redirect.js.map +1 -0
  28. package/dist/auth/settings.d.ts +55 -0
  29. package/dist/auth/settings.js +116 -0
  30. package/dist/auth/settings.js.map +1 -0
  31. package/dist/auth/totp.js +1 -1
  32. package/dist/cli.js +43 -21
  33. package/dist/cli.js.map +1 -1
  34. package/dist/cron/service.d.ts +15 -2
  35. package/dist/cron/service.js +19 -2
  36. package/dist/cron/service.js.map +1 -1
  37. package/dist/db/bootstrap.d.ts +13 -6
  38. package/dist/db/bootstrap.js +26 -5
  39. package/dist/db/bootstrap.js.map +1 -1
  40. package/dist/db/database.d.ts +61 -3
  41. package/dist/db/database.js +72 -9
  42. package/dist/db/database.js.map +1 -1
  43. package/dist/db/emulated.d.ts +39 -2
  44. package/dist/db/emulated.js +39 -23
  45. package/dist/db/emulated.js.map +1 -1
  46. package/dist/db/engine.d.ts +19 -5
  47. package/dist/db/engine.js +4 -2
  48. package/dist/db/engine.js.map +1 -1
  49. package/dist/db/inspect.d.ts +6 -1
  50. package/dist/db/inspect.js +2 -1
  51. package/dist/db/inspect.js.map +1 -1
  52. package/dist/db/pglite-engine.d.ts +7 -1
  53. package/dist/db/pglite-engine.js +7 -1
  54. package/dist/db/pglite-engine.js.map +1 -1
  55. package/dist/db/pgmem-engine.d.ts +9 -3
  56. package/dist/db/pgmem-engine.js +13 -7
  57. package/dist/db/pgmem-engine.js.map +1 -1
  58. package/dist/db/schema-diff.d.ts +9 -1
  59. package/dist/db/schema-diff.js +19 -5
  60. package/dist/db/schema-diff.js.map +1 -1
  61. package/dist/db/sql-compat.d.ts +2 -2
  62. package/dist/db/sql-compat.js +2 -2
  63. package/dist/functions/deno-shim.d.ts +6 -17
  64. package/dist/functions/deno-shim.js +42 -10
  65. package/dist/functions/deno-shim.js.map +1 -1
  66. package/dist/functions/handler.d.ts +9 -4
  67. package/dist/functions/handler.js +9 -1
  68. package/dist/functions/handler.js.map +1 -1
  69. package/dist/gen-types.d.ts +6 -1
  70. package/dist/gen-types.js +53 -41
  71. package/dist/gen-types.js.map +1 -1
  72. package/dist/index.d.ts +33 -3
  73. package/dist/index.js +158 -28
  74. package/dist/index.js.map +1 -1
  75. package/dist/jwt.d.ts +4 -1
  76. package/dist/jwt.js +4 -2
  77. package/dist/jwt.js.map +1 -1
  78. package/dist/log-buffer.d.ts +7 -1
  79. package/dist/log-buffer.js +3 -0
  80. package/dist/log-buffer.js.map +1 -1
  81. package/dist/net/service.d.ts +35 -6
  82. package/dist/net/service.js +72 -17
  83. package/dist/net/service.js.map +1 -1
  84. package/dist/node/bun-server.d.ts +2 -1
  85. package/dist/node/bun-server.js +11 -1
  86. package/dist/node/bun-server.js.map +1 -1
  87. package/dist/node/bundle-function.d.ts +1 -1
  88. package/dist/node/bundle-function.js +1 -1
  89. package/dist/node/config-toml.d.ts +31 -0
  90. package/dist/node/config-toml.js +186 -0
  91. package/dist/node/config-toml.js.map +1 -0
  92. package/dist/node/db-diff.d.ts +13 -1
  93. package/dist/node/db-diff.js +3 -1
  94. package/dist/node/db-diff.js.map +1 -1
  95. package/dist/node/fs-driver.d.ts +16 -1
  96. package/dist/node/fs-driver.js +20 -1
  97. package/dist/node/fs-driver.js.map +1 -1
  98. package/dist/node/index.d.ts +2 -2
  99. package/dist/node/index.js +1 -1
  100. package/dist/node/index.js.map +1 -1
  101. package/dist/node/load-config.d.ts +80 -0
  102. package/dist/node/load-config.js +230 -0
  103. package/dist/node/load-config.js.map +1 -0
  104. package/dist/node/load-functions.d.ts +17 -2
  105. package/dist/node/load-functions.js +17 -4
  106. package/dist/node/load-functions.js.map +1 -1
  107. package/dist/node/native/engine.d.ts +7 -0
  108. package/dist/node/native/engine.js +58 -7
  109. package/dist/node/native/engine.js.map +1 -1
  110. package/dist/node/native/wire.d.ts +15 -1
  111. package/dist/node/native/wire.js +32 -10
  112. package/dist/node/native/wire.js.map +1 -1
  113. package/dist/node/project.d.ts +15 -1
  114. package/dist/node/project.js +19 -7
  115. package/dist/node/project.js.map +1 -1
  116. package/dist/node/server-shared.d.ts +4 -1
  117. package/dist/node/server.d.ts +11 -0
  118. package/dist/node/server.js +11 -0
  119. package/dist/node/server.js.map +1 -1
  120. package/dist/node/ws.d.ts +26 -1
  121. package/dist/node/ws.js +26 -3
  122. package/dist/node/ws.js.map +1 -1
  123. package/dist/realtime/engine.d.ts +6 -0
  124. package/dist/realtime/engine.js +45 -34
  125. package/dist/realtime/engine.js.map +1 -1
  126. package/dist/rest/build.d.ts +37 -1
  127. package/dist/rest/build.js +48 -8
  128. package/dist/rest/build.js.map +1 -1
  129. package/dist/rest/errors.d.ts +8 -0
  130. package/dist/rest/errors.js +12 -1
  131. package/dist/rest/errors.js.map +1 -1
  132. package/dist/rest/handler.d.ts +17 -1
  133. package/dist/rest/handler.js +48 -5
  134. package/dist/rest/handler.js.map +1 -1
  135. package/dist/rest/parse.d.ts +24 -1
  136. package/dist/rest/parse.js +7 -1
  137. package/dist/rest/parse.js.map +1 -1
  138. package/dist/retention/service.d.ts +3 -0
  139. package/dist/retention/service.js +3 -1
  140. package/dist/retention/service.js.map +1 -1
  141. package/dist/security.d.ts +22 -0
  142. package/dist/security.js +47 -0
  143. package/dist/security.js.map +1 -0
  144. package/dist/storage/driver.d.ts +8 -1
  145. package/dist/storage/driver.js +4 -1
  146. package/dist/storage/driver.js.map +1 -1
  147. package/dist/storage/handler.d.ts +10 -1
  148. package/dist/storage/handler.js +93 -12
  149. package/dist/storage/handler.js.map +1 -1
  150. package/dist/types.d.ts +77 -1
  151. package/dist/types.js +10 -0
  152. package/dist/types.js.map +1 -1
  153. package/dist/webhooks/service.d.ts +25 -2
  154. package/dist/webhooks/service.js +21 -3
  155. package/dist/webhooks/service.js.map +1 -1
  156. package/package.json +5 -3
@@ -6,4 +6,4 @@
6
6
  * HTML file so it ships inside the tinbase single binary.
7
7
  * Rebuild: cd admin-ui && npm run build
8
8
  */
9
- export declare const ADMIN_HTML = "<!doctype html>\n<html lang=\"en\" class=\"dark\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <meta name=\"robots\" content=\"noindex\" />\n <title>tinbase studio</title>\n <script type=\"module\" crossorigin>var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(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 l=o((e=>{var t=Symbol.for(`react.transitional.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.consumer`),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.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var ee=Array.isArray;function S(){}var C={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function ne(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function re(e,t){return ne(e.type,t,e.props)}function w(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ie(e){var t={\"=\":`=0`,\":\":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ae=/\\/+/g;function oe(e,t){return typeof e==`object`&&e&&e.key!=null?ie(``+e.key):t.toString(36)}function se(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(S,S):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ce(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`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ce(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+oe(e,0):a,ee(o)?(i=``,c!=null&&(i=c.replace(ae,`$&/`)+`/`),ce(o,r,i,``,function(e){return e})):o!=null&&(w(o)&&(o=re(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ae,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(ee(e))for(var u=0;u<e.length;u++)a=e[u],s=l+oe(a,u),c+=ce(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+oe(a,u++),c+=ce(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ce(se(e),r,i,a,o);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 le(e,t,n){if(e==null)return e;var r=[],i=0;return ce(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ue(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 T=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},E={map:le,forEach:function(e,t,n){le(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return le(e,function(){t++}),t},toArray:function(e){return le(e,function(e){return e})||[]},only:function(e){if(!w(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=E,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return C.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!te.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return ne(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)te.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return ne(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=w,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ue}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=C.T,n={};C.T=n;try{var r=e(),i=C.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(S,T)}catch(e){T(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),C.T=t}},e.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},e.use=function(e){return C.H.use(e)},e.useActionState=function(e,t,n){return C.H.useActionState(e,t,n)},e.useCallback=function(e,t){return C.H.useCallback(e,t)},e.useContext=function(e){return C.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return C.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return C.H.useEffect(e,t)},e.useEffectEvent=function(e){return C.H.useEffectEvent(e)},e.useId=function(){return C.H.useId()},e.useImperativeHandle=function(e,t,n){return C.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return C.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return C.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return C.H.useMemo(e,t)},e.useOptimistic=function(e,t){return C.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return C.H.useReducer(e,t,n)},e.useRef=function(e){return C.H.useRef(e)},e.useState=function(e){return C.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return C.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return C.H.useTransition()},e.version=`19.2.7`})),u=o(((e,t)=>{t.exports=l()})),d=o((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(e.unstable_now=void 0,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=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(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 x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,ee||(ee=!0,w());else{var t=n(l);t!==null&&oe(x,t.startTime-e)}}var ee=!1,S=-1,C=5,te=-1;function ne(){return g?!0:!(e.unstable_now()-te<C)}function re(){if(g=!1,ee){var t=e.unstable_now();te=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(S),S=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ne());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&oe(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?w():ee=!1}}}var w;if(typeof y==`function`)w=function(){y(re)};else if(typeof MessageChannel<`u`){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=re,w=function(){ae.postMessage(null)}}else w=function(){_(re,0)};function oe(t,n){S=_(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_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`):C=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},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_requestPaint=function(){g=!0},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?(v(S),S=-1):h=!0,oe(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,w()))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.7`})),m=o(((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=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),ee=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),te=Symbol.for(`react.suspense`),ne=Symbol.for(`react.suspense_list`),re=Symbol.for(`react.memo`),w=Symbol.for(`react.lazy`),ie=Symbol.for(`react.activity`),ae=Symbol.for(`react.memo_cache_sentinel`),oe=Symbol.iterator;function se(e){return typeof e!=`object`||!e?null:(e=oe&&e[oe]||e[`@@iterator`],typeof e==`function`?e:null)}var ce=Symbol.for(`react.client.reference`);function le(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case te:return`Suspense`;case ne:return`SuspenseList`;case ie:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case S:return e.displayName||`Context`;case ee:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case re:return t=e.displayName||null,t===null?le(e.type)||`Memo`:t;case w:t=e._payload,e=e._init;try{return le(e(t))}catch{}}return null}var ue=Array.isArray,T=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},fe=[],pe=-1;function me(e){return{current:e}}function he(e){0>pe||(e.current=fe[pe],fe[pe]=null,pe--)}function D(e,t){pe++,fe[pe]=e.current,e.current=t}var ge=me(null),_e=me(null),ve=me(null),ye=me(null);function be(e,t){switch(D(ve,t),D(_e,e),D(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}he(ge),D(ge,e)}function xe(){he(ge),he(_e),he(ve)}function Se(e){e.memoizedState!==null&&D(ye,e);var t=ge.current,n=Hd(t,e.type);t!==n&&(D(_e,e),D(ge,n))}function Ce(e){_e.current===e&&(he(ge),he(_e)),ye.current===e&&(he(ye),Qf._currentValue=de)}var O,k;function A(e){if(O===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\\n( *(at )?)/);O=t&&t[1]||``,k=-1<e.stack.indexOf(`\n at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`\n`+O+e+k}var we=!1;function Te(e,t){if(!e||we)return``;we=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,\"props\",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,\"name\",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`\n`),l=s.split(`\n`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`\n`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{we=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?A(n):``}function Ee(e,t){switch(e.tag){case 26:case 27:case 5:return A(e.type);case 16:return A(`Lazy`);case 13:return e.child!==t&&t!==null?A(`Suspense Fallback`):A(`Suspense`);case 19:return A(`SuspenseList`);case 0:case 15:return Te(e.type,!1);case 11:return Te(e.type.render,!1);case 1:return Te(e.type,!0);case 31:return A(`Activity`);default:return``}}function De(e){try{var t=``,n=null;do t+=Ee(e,n),n=e,e=e.return;while(e);return t}catch(e){return`\nError generating stack: `+e.message+`\n`+e.stack}}var Oe=Object.prototype.hasOwnProperty,j=t.unstable_scheduleCallback,ke=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,je=t.unstable_requestPaint,Me=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,Pe=t.unstable_ImmediatePriority,Fe=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,Le=t.unstable_LowPriority,Re=t.unstable_IdlePriority,ze=t.log,Be=t.unstable_setDisableYieldValue,Ve=null,He=null;function Ue(e){if(typeof ze==`function`&&Be(e),He&&typeof He.setStrictMode==`function`)try{He.setStrictMode(Ve,e)}catch{}}var We=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-We(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&at(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function at(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-We(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ot(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-We(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function st(e,t){var n=t&-t;return n=n&42?1:ct(n),(n&(e.suspendedLanes|t))===0?n:0}function ct(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function lt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ut(){var e=E.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function dt(e,t){var n=E.p;try{return E.p=e,t()}finally{E.p=n}}var ft=Math.random().toString(36).slice(2),pt=`__reactFiber$`+ft,mt=`__reactProps$`+ft,ht=`__reactContainer$`+ft,gt=`__reactEvents$`+ft,_t=`__reactListeners$`+ft,vt=`__reactHandles$`+ft,yt=`__reactResources$`+ft,bt=`__reactMarker$`+ft;function xt(e){delete e[pt],delete e[mt],delete e[gt],delete e[_t],delete e[vt]}function St(e){var t=e[pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ht]||n[pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[pt])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function Ct(e){if(e=e[pt]||e[ht]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function wt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Tt(e){var t=e[yt];return t||=e[yt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function M(e){e[bt]=!0}var Et=new Set,Dt={};function Ot(e,t){kt(e,t),kt(e+`Capture`,t)}function kt(e,t){for(Dt[e]=t,e=0;e<t.length;e++)Et.add(t[e])}var At=RegExp(`^[: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]*$`),jt={},Mt={};function Nt(e){return Oe.call(Mt,e)?!0:Oe.call(jt,e)?!1:At.test(e)?Mt[e]=!0:(jt[e]=!0,!1)}function Pt(e,t,n){if(Nt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Ft(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function It(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Lt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Rt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function zt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bt(e){if(!e._valueTracker){var t=Rt(e)?`checked`:`value`;e._valueTracker=zt(e,t,``+e[t])}}function Vt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Rt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Ht(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Ut=/[\\n\"\\\\]/g;function Wt(e){return e.replace(Ut,function(e){return`\\\\`+e.charCodeAt(0).toString(16)+` `})}function Gt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Lt(t)):e.value!==``+Lt(t)&&(e.value=``+Lt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):qt(e,o,Lt(n)):qt(e,o,Lt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Lt(s):e.removeAttribute(`name`)}function Kt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Bt(e);return}n=n==null?``:``+Lt(n),t=t==null?n:``+Lt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Bt(e)}function qt(e,t,n){t===`number`&&Ht(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Jt(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=``+Lt(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 Yt(e,t,n){if(t!=null&&(t=``+Lt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Lt(n)}function Xt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ue(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Lt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Bt(e)}function Zt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function $t(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Qt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function en(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&$t(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&$t(e,o,t[o])}function tn(e){if(e.indexOf(`-`)===-1)return!1;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 nn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),rn=/^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*:/i;function an(e){return rn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function on(){}var sn=null;function cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ln=null,un=null;function dn(e){var t=Ct(e);if(t&&(e=t.stateNode)){var n=e[mt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Gt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=\"`+Wt(``+t)+`\"][type=\"radio\"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[mt]||null;if(!a)throw Error(i(90));Gt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Vt(r)}break a;case`textarea`:Yt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Jt(e,!!n.multiple,t,!1)}}}var fn=!1;function pn(e,t,n){if(fn)return e(t,n);fn=!0;try{return e(t)}finally{if(fn=!1,(ln!==null||un!==null)&&(bu(),ln&&(t=ln,e=un,un=ln=null,dn(t),e)))for(t=0;t<e.length;t++)dn(e[t])}}function mn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[mt]||null;if(r===null)return null;n=r[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`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var hn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),gn=!1;if(hn)try{var _n={};Object.defineProperty(_n,\"passive\",{get:function(){gn=!0}}),window.addEventListener(`test`,_n,_n),window.removeEventListener(`test`,_n,_n)}catch{gn=!1}var vn=null,yn=null,bn=null;function xn(){if(bn)return bn;var e,t=yn,n=t.length,r,i=`value`in vn?vn.value:vn.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 bn=i.slice(e,1<r?1-r:void 0)}function Sn(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 Cn(){return!0}function wn(){return!1}function Tn(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)?Cn:wn,this.isPropagationStopped=wn,this}return h(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=Cn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Cn)},persist:function(){},isPersistent:Cn}),t}var En={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dn=Tn(En),On=h({},En,{view:0,detail:0}),kn=Tn(On),An,jn,Mn,Nn=h({},On,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wn,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!==Mn&&(Mn&&e.type===`mousemove`?(An=e.screenX-Mn.screenX,jn=e.screenY-Mn.screenY):jn=An=0,Mn=e),An)},movementY:function(e){return`movementY`in e?e.movementY:jn}}),Pn=Tn(Nn),Fn=Tn(h({},Nn,{dataTransfer:0})),In=Tn(h({},On,{relatedTarget:0})),Ln=Tn(h({},En,{animationName:0,elapsedTime:0,pseudoElement:0})),Rn=Tn(h({},En,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),zn=Tn(h({},En,{data:0})),Bn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Vn={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`},Hn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Un(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Hn[e])?!!t[e]:!1}function Wn(){return Un}var Gn=Tn(h({},On,{key:function(e){if(e.key){var t=Bn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Sn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Vn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wn,charCode:function(e){return e.type===`keypress`?Sn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Sn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Kn=Tn(h({},Nn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),qn=Tn(h({},On,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wn})),Jn=Tn(h({},En,{propertyName:0,elapsedTime:0,pseudoElement:0})),Yn=Tn(h({},Nn,{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})),Xn=Tn(h({},En,{newState:0,oldState:0})),Zn=[9,13,27,32],Qn=hn&&`CompositionEvent`in window,$n=null;hn&&`documentMode`in document&&($n=document.documentMode);var er=hn&&`TextEvent`in window&&!$n,tr=hn&&(!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=xn(),bn=yn=vn=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){ln?un?un.push(r):un=[r]:ln=r,t=Ed(t,`onChange`),0<t.length&&(n=new Dn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var fr=null,pr=null;function mr(e){yd(e,0)}function hr(e){if(Vt(wt(e)))return e}function gr(e,t){if(e===`change`)return t}var _r=!1;if(hn){var vr;if(hn){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,cn(e)),pn(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(!Oe.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(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ht(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ht(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`)}var Fr=hn&&`documentMode`in document&&11>=document.documentMode,Ir=null,Lr=null,Rr=null,zr=!1;function Br(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;zr||Ir==null||Ir!==Ht(r)||(r=Ir,`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}),Rr&&kr(Rr,r)||(Rr=r,r=Ed(Lr,`onSelect`),0<r.length&&(t=new Dn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ir)))}function N(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Vr={animationend:N(`Animation`,`AnimationEnd`),animationiteration:N(`Animation`,`AnimationIteration`),animationstart:N(`Animation`,`AnimationStart`),transitionrun:N(`Transition`,`TransitionRun`),transitionstart:N(`Transition`,`TransitionStart`),transitioncancel:N(`Transition`,`TransitionCancel`),transitionend:N(`Transition`,`TransitionEnd`)},Hr={},Ur={};hn&&(Ur=document.createElement(`div`).style,`AnimationEvent`in window||(delete Vr.animationend.animation,delete Vr.animationiteration.animation,delete Vr.animationstart.animation),`TransitionEvent`in window||delete Vr.transitionend.transition);function Wr(e){if(Hr[e])return Hr[e];if(!Vr[e])return e;var t=Vr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ur)return Hr[e]=t[n];return e}var Gr=Wr(`animationend`),Kr=Wr(`animationiteration`),qr=Wr(`animationstart`),Jr=Wr(`transitionrun`),Yr=Wr(`transitionstart`),Xr=Wr(`transitioncancel`),Zr=Wr(`transitionend`),Qr=new Map,$r=`abort auxClick beforeToggle 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(` `);$r.push(`scrollEnd`);function ei(e,t){Qr.set(e,t),Ot(t,[e])}var ti=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ni=[],ri=0,ii=0;function ai(){for(var e=ri,t=ii=ri=0;t<e;){var n=ni[t];ni[t++]=null;var r=ni[t];ni[t++]=null;var i=ni[t];ni[t++]=null;var a=ni[t];if(ni[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&li(n,i,a)}}function oi(e,t,n,r){ni[ri++]=e,ni[ri++]=t,ni[ri++]=n,ni[ri++]=r,ii|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function si(e,t,n,r){return oi(e,t,n,r),ui(e)}function ci(e,t){return oi(e,null,null,t),ui(e)}function li(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-We(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ui(e){if(50<du)throw du=0,fu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var di={};function fi(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.refCleanup=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 pi(e,t,n,r){return new fi(e,t,n,r)}function mi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function hi(e,t){var n=e.alternate;return n===null?(n=pi(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&65011712,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.refCleanup=e.refCleanup,n}function gi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function _i(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)mi(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,ge.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ie:return e=pi(31,n,t,a),e.elementType=ie,e.lanes=o,e;case y:return vi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=pi(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case te:return e=pi(13,n,t,a),e.elementType=te,e.lanes=o,e;case ne:return e=pi(19,n,t,a),e.elementType=ne,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case S:s=10;break a;case ee:s=9;break a;case C:s=11;break a;case re:s=14;break a;case w:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=pi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function vi(e,t,n,r){return e=pi(7,e,r,t),e.lanes=n,e}function yi(e,t,n){return e=pi(6,e,null,t),e.lanes=n,e}function bi(e){var t=pi(18,null,null,0);return t.stateNode=e,t}function xi(e,t,n){return t=pi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Si=new WeakMap;function Ci(e,t){if(typeof e==`object`&&e){var n=Si.get(e);return n===void 0?(t={value:e,source:t,stack:De(t)},Si.set(e,t),t):n}return{value:e,source:t,stack:De(t)}}var wi=[],Ti=0,Ei=null,Di=0,Oi=[],ki=0,Ai=null,ji=1,Mi=``;function Ni(e,t){wi[Ti++]=Di,wi[Ti++]=Ei,Ei=e,Di=t}function Pi(e,t,n){Oi[ki++]=ji,Oi[ki++]=Mi,Oi[ki++]=Ai,Ai=e;var r=ji;e=Mi;var i=32-We(r)-1;r&=~(1<<i),n+=1;var a=32-We(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ji=1<<32-We(t)+i|n<<i|r,Mi=a+e}else ji=1<<a|n<<i|r,Mi=e}function Fi(e){e.return!==null&&(Ni(e,1),Pi(e,1,0))}function Ii(e){for(;e===Ei;)Ei=wi[--Ti],wi[Ti]=null,Di=wi[--Ti],wi[Ti]=null;for(;e===Ai;)Ai=Oi[--ki],Oi[ki]=null,Mi=Oi[--ki],Oi[ki]=null,ji=Oi[--ki],Oi[ki]=null}function Li(e,t){Oi[ki++]=ji,Oi[ki++]=Mi,Oi[ki++]=Ai,ji=t.id,Mi=t.overflow,Ai=e}var Ri=null,P=null,F=!1,zi=null,Bi=!1,Vi=Error(i(519));function Hi(e){throw Ji(Ci(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Vi}function Ui(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[pt]=e,t[mt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),Kt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),Xt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=on),t=!0):t=!1,t||Hi(e,!0)}function Wi(e){for(Ri=e.return;Ri;)switch(Ri.tag){case 5:case 31:case 13:Bi=!1;return;case 27:case 3:Bi=!0;return;default:Ri=Ri.return}}function Gi(e){if(e!==Ri)return!1;if(!F)return Wi(e),F=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&P&&Hi(e),Wi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));P=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));P=uf(e)}else t===27?(t=P,Zd(e.type)?(e=lf,lf=null,P=e):P=t):P=Ri?cf(e.stateNode.nextSibling):null;return!0}function Ki(){P=Ri=null,F=!1}function qi(){var e=zi;return e!==null&&(Zl===null?Zl=e:Zl.push.apply(Zl,e),zi=null),e}function Ji(e){zi===null?zi=[e]:zi.push(e)}var Yi=me(null),Xi=null,Zi=null;function Qi(e,t,n){D(Yi,t._currentValue),t._currentValue=n}function $i(e){e._currentValue=Yi.current,he(Yi)}function ea(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 ta(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ea(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ea(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function na(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Or(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ye.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&ta(t,e,n,r),t.flags|=262144}function ra(e){for(e=e.firstContext;e!==null;){if(!Or(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ia(e){Xi=e,Zi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function aa(e){return sa(Xi,e)}function oa(e,t){return Xi===null&&ia(e),sa(e,t)}function sa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Zi===null){if(e===null)throw Error(i(308));Zi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Zi=Zi.next=t;return n}var ca=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},la=t.unstable_scheduleCallback,ua=t.unstable_NormalPriority,da={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function fa(){return{controller:new ca,data:new Map,refCount:0}}function pa(e){e.refCount--,e.refCount===0&&la(ua,function(){e.controller.abort()})}var ma=null,ha=0,ga=0,_a=null;function va(e,t){if(ma===null){var n=ma=[];ha=0,ga=dd(),_a={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ha++,t.then(ya,ya),t}function ya(){if(--ha===0&&ma!==null){_a!==null&&(_a.status=`fulfilled`);var e=ma;ma=null,ga=0,_a=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ba(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var xa=T.S;T.S=function(e,t){eu=Me(),typeof t==`object`&&t&&typeof t.then==`function`&&va(e,t),xa!==null&&xa(e,t)};var Sa=me(null);function Ca(){var e=Sa.current;return e===null?K.pooledCache:e}function wa(e,t){t===null?D(Sa,Sa.current):D(Sa,t.pool)}function Ta(){var e=Ca();return e===null?null:{parent:da._currentValue,pool:e}}var Ea=Error(i(460)),Da=Error(i(474)),Oa=Error(i(542)),ka={then:function(){}};function Aa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ja(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(on,on),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Fa(e),e;default:if(typeof t.status==`string`)t.then(on,on);else{if(e=K,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Fa(e),e}throw Na=t,Ea}}function Ma(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Na=e,Ea):e}}var Na=null;function Pa(){if(Na===null)throw Error(i(459));var e=Na;return Na=null,e}function Fa(e){if(e===Ea||e===Oa)throw Error(i(483))}var Ia=null,La=0;function Ra(e){var t=La;return La+=1,Ia===null&&(Ia=[]),ja(Ia,e,t)}function za(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ba(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Va(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){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=hi(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|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=yi(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===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===w&&Ma(i)===t.type)?(t=a(t,n.props),za(t,n),t.return=e,t):(t=_i(n.type,n.key,n.props,null,e.mode,r),za(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=xi(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=vi(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`||typeof t==`bigint`)return t=yi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=_i(t.type,t.key,t.props,null,e.mode,n),za(n,t),n.return=e,n;case v:return t=xi(t,e.mode,n),t.return=e,t;case w:return t=Ma(t),f(e,t,n)}if(ue(t)||se(t))return t=vi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ra(t),n);if(t.$$typeof===S)return f(e,oa(e,t),n);Ba(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`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case w:return n=Ma(n),p(e,t,n,r)}if(ue(n)||se(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ra(n),r);if(n.$$typeof===S)return p(e,t,oa(e,n),r);Ba(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case w:return r=Ma(r),m(e,t,n,r,i)}if(ue(r)||se(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ra(r),i);if(r.$$typeof===S)return m(e,t,n,oa(t,r),i);Ba(t,r)}return null}function h(i,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(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),F&&Ni(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return F&&Ni(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,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(i,e)}),F&&Ni(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=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),F&&Ni(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 F&&Ni(a,g),u}for(h=r(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)}),F&&Ni(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===w&&Ma(l)===r.type){n(e,r.sibling),c=a(r,o.props),za(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=vi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=_i(o.type,o.key,o.props,null,e.mode,c),za(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=xi(o,e.mode,c),c.return=e,e=c}return s(e);case w:return o=Ma(o),b(e,r,o,c)}if(ue(o))return h(e,r,o,c);if(se(o)){if(l=se(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ra(o),c);if(o.$$typeof===S)return b(e,r,oa(e,o),c);Ba(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=yi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{La=0;var i=b(e,t,n,r);return Ia=null,i}catch(t){if(t===Ea||t===Oa)throw t;var a=pi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ha=Va(!0),Ua=Va(!1),Wa=!1;function Ga(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ka(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function qa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ja(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ui(e),li(e,null,n),t}return oi(e,r,t,n),ui(e)}function Ya(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}function Xa(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={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,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,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Za=!1;function Qa(){if(Za){var e=_a;if(e!==null)throw e}}function $a(e,t,n,r){Za=!1;var i=e.updateQueue;Wa=!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&-536870913,p=f!==s.lane;if(p?(J&f)===f:(r&f)===f){f!==0&&f===ga&&(Za=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Wa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else 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;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function eo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function to(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)eo(n[e],t)}var no=me(null),ro=me(0);function io(e,t){e=Wl,D(ro,e),D(no,t),Wl=e|t.baseLanes}function ao(){D(ro,Wl),D(no,no.current)}function oo(){Wl=ro.current,he(no),he(ro)}var so=me(null),co=null;function lo(e){var t=e.alternate;D(I,I.current&1),D(so,e),co===null&&(t===null||no.current!==null||t.memoizedState!==null)&&(co=e)}function uo(e){D(I,I.current),D(so,e),co===null&&(co=e)}function fo(e){e.tag===22?(D(I,I.current),D(so,e),co===null&&(co=e)):po(e)}function po(){D(I,I.current),D(so,so.current)}function mo(e){he(so),co===e&&(co=null),he(I)}var I=me(0);function ho(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){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 go=0,L=null,R=null,z=null,_o=!1,vo=!1,yo=!1,bo=0,xo=0,So=null,Co=0;function B(){throw Error(i(321))}function wo(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 To(e,t,n,r,i,a){return go=a,L=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,T.H=e===null||e.memoizedState===null?Vs:Hs,yo=!1,a=n(r,i),yo=!1,vo&&(a=Do(t,n,r,i)),Eo(e),a}function Eo(e){T.H=Bs;var t=R!==null&&R.next!==null;if(go=0,z=R=L=null,_o=!1,xo=0,So=null,t)throw Error(i(300));e===null||H||(e=e.dependencies,e!==null&&ra(e)&&(H=!0))}function Do(e,t,n,r){L=e;var a=0;do{if(vo&&(So=null),xo=0,vo=!1,25<=a)throw Error(i(301));if(a+=1,z=R=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}T.H=Us,o=t(n,r)}while(vo);return o}function Oo(){var e=T.H,t=e.useState()[0];return t=typeof t.then==`function`?Po(t):t,e=e.useState()[0],(R===null?null:R.memoizedState)!==e&&(L.flags|=1024),t}function ko(){var e=bo!==0;return bo=0,e}function Ao(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function jo(e){if(_o){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_o=!1}go=0,z=R=L=null,vo=!1,xo=bo=0,So=null}function Mo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return z===null?L.memoizedState=z=e:z=z.next=e,z}function V(){if(R===null){var e=L.alternate;e=e===null?null:e.memoizedState}else e=R.next;var t=z===null?L.memoizedState:z.next;if(t!==null)z=t,R=e;else{if(e===null)throw L.alternate===null?Error(i(467)):Error(i(310));R=e,e={memoizedState:R.memoizedState,baseState:R.baseState,baseQueue:R.baseQueue,queue:R.queue,next:null},z===null?L.memoizedState=z=e:z=z.next=e}return z}function No(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Po(e){var t=xo;return xo+=1,So===null&&(So=[]),e=ja(So,e,t),t=L,(z===null?t.memoizedState:z.next)===null&&(t=t.alternate,T.H=t===null||t.memoizedState===null?Vs:Hs),e}function Fo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Po(e);if(e.$$typeof===S)return aa(e)}throw Error(i(438,String(e)))}function Io(e){var t=null,n=L.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=L.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=No(),L.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ae;return t.index++,n}function Lo(e,t){return typeof t==`function`?t(e):t}function Ro(e){return zo(V(),R,e)}function zo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(go&f)===f:(J&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ga&&(d=!0);else if((go&p)===p){u=u.next,p===ga&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,L.lanes|=p,Gl|=p;f=u.action,yo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,L.lanes|=f,Gl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Or(o,e.memoizedState)&&(H=!0,d&&(n=_a,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Bo(e){var t=V(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=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)||(H=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Vo(e,t,n){var r=L,a=V(),o=F;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Or((R||a).memoizedState,n);if(s&&(a.memoizedState=n,H=!0),a=a.queue,fs(Wo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||z!==null&&z.memoizedState.tag&1){if(r.flags|=2048,ss(9,{destroy:void 0},Uo.bind(null,r,a,n,t),null),K===null)throw Error(i(349));o||go&127||Ho(r,t,n)}return n}function Ho(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=L.updateQueue,t===null?(t=No(),L.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=ci(e,2);t!==null&&hu(t,e,2)}function qo(e){var t=Mo();if(typeof e==`function`){var n=e;if(e=n(),yo){Ue(!0);try{n()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:e},t}function Jo(e,t,n,r){return e.baseState=n,zo(e,R,typeof r==`function`?r:Lo)}function Yo(e,t,n,r,a){if(Ls(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};T.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Xo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Xo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=T.T,o={};T.T=o;try{var s=n(i,r),c=T.S;c!==null&&c(o,s),Zo(e,t,s)}catch(n){$o(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),T.T=a}}else try{a=n(i,r),Zo(e,t,a)}catch(n){$o(e,t,n)}}function Zo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Qo(e,t,n)},function(n){return $o(e,t,n)}):Qo(e,t,n)}function Qo(e,t,n){t.status=`fulfilled`,t.value=n,es(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Xo(e,n)))}function $o(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,es(t),t=t.next;while(t!==r)}e.action=null}function es(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ts(e,t){return t}function ns(e,t){if(F){var n=K.formState;if(n!==null){a:{var r=L;if(F){if(P){b:{for(var i=P,a=Bi;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){P=cf(i.nextSibling),r=i.data===`F!`;break a}}Hi(r)}r=!1}r&&(t=n[0])}}return n=Mo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ts,lastRenderedState:t},n.queue=r,n=Ps.bind(null,L,r),r.dispatch=n,r=qo(!1),a=Is.bind(null,L,!1,r.queue),r=Mo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Yo.bind(null,L,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function rs(e){return is(V(),R,e)}function is(e,t,n){if(t=zo(e,t,ts)[0],e=Ro(Lo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Po(t)}catch(e){throw e===Ea?Oa:e}else r=t;t=V();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(L.flags|=2048,ss(9,{destroy:void 0},as.bind(null,i,n),null)),[r,a,e]}function as(e,t){e.action=t}function os(e){var t=V(),n=R;if(n!==null)return is(t,n,e);V(),t=t.memoizedState,n=V();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ss(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=L.updateQueue,t===null&&(t=No(),L.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function cs(){return V().memoizedState}function ls(e,t,n,r){var i=Mo();L.flags|=e,i.memoizedState=ss(1|t,{destroy:void 0},n,r===void 0?null:r)}function us(e,t,n,r){var i=V();r=r===void 0?null:r;var a=i.memoizedState.inst;R!==null&&r!==null&&wo(r,R.memoizedState.deps)?i.memoizedState=ss(t,a,n,r):(L.flags|=e,i.memoizedState=ss(1|t,a,n,r))}function ds(e,t){ls(8390656,8,e,t)}function fs(e,t){us(2048,8,e,t)}function ps(e){L.flags|=4;var t=L.updateQueue;if(t===null)t=No(),L.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ms(e){var t=V().memoizedState;return ps({ref:t,nextImpl:e}),function(){if(G&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function hs(e,t){return us(4,2,e,t)}function gs(e,t){return us(4,4,e,t)}function _s(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function vs(e,t,n){n=n==null?null:n.concat([e]),us(4,4,_s.bind(null,t,e),n)}function ys(){}function bs(e,t){var n=V();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&wo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function xs(e,t){var n=V();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&wo(t,r[1]))return r[0];if(r=e(),yo){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r}function Ss(e,t,n){return n===void 0||go&1073741824&&!(J&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),L.lanes|=e,Gl|=e,n)}function Cs(e,t,n,r){return Or(n,t)?n:no.current===null?!(go&42)||go&1073741824&&!(J&261930)?(H=!0,e.memoizedState=n):(e=mu(),L.lanes|=e,Gl|=e,t):(e=Ss(e,n,r),Or(e,t)||(H=!0),e)}function ws(e,t,n,r,i){var a=E.p;E.p=a!==0&&8>a?a:8;var o=T.T,s={};T.T=s,Is(e,!1,t,n);try{var c=i(),l=T.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Fs(e,t,ba(c,r),pu(e)):Fs(e,t,r,pu(e))}catch(n){Fs(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{E.p=a,o!==null&&s.types!==null&&(o.types=s.types),T.T=o}}function Ts(){}function Es(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ds(e).queue;ws(e,a,t,de,n===null?Ts:function(){return Os(e),n(r)})}function Ds(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:de},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Os(e){var t=Ds(e);t.next===null&&(t=e.alternate.memoizedState),Fs(e,t.next.queue,{},pu())}function ks(){return aa(Qf)}function As(){return V().memoizedState}function js(){return V().memoizedState}function Ms(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=qa(n);var r=Ja(t,e,n);r!==null&&(hu(r,t,n),Ya(r,t,n)),t={cache:fa()},e.payload=t;return}t=t.return}}function Ns(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ls(e)?Rs(t,n):(n=si(e,t,n,r),n!==null&&(hu(n,e,r),zs(n,t,r)))}function Ps(e,t,n){Fs(e,t,n,pu())}function Fs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ls(e))Rs(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))return oi(e,t,i,0),K===null&&ai(),!1}catch{}if(n=si(e,t,i,r),n!==null)return hu(n,e,r),zs(n,t,r),!0}return!1}function Is(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ls(e)){if(t)throw Error(i(479))}else t=si(e,n,r,2),t!==null&&hu(t,e,2)}function Ls(e){var t=e.alternate;return e===L||t!==null&&t===L}function Rs(e,t){vo=_o=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}var Bs={readContext:aa,use:Fo,useCallback:B,useContext:B,useEffect:B,useImperativeHandle:B,useLayoutEffect:B,useInsertionEffect:B,useMemo:B,useReducer:B,useRef:B,useState:B,useDebugValue:B,useDeferredValue:B,useTransition:B,useSyncExternalStore:B,useId:B,useHostTransitionStatus:B,useFormState:B,useActionState:B,useOptimistic:B,useMemoCache:B,useCacheRefresh:B};Bs.useEffectEvent=B;var Vs={readContext:aa,use:Fo,useCallback:function(e,t){return Mo().memoizedState=[e,t===void 0?null:t],e},useContext:aa,useEffect:ds,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ls(4194308,4,_s.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ls(4194308,4,e,t)},useInsertionEffect:function(e,t){ls(4,2,e,t)},useMemo:function(e,t){var n=Mo();t=t===void 0?null:t;var r=e();if(yo){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Mo();if(n!==void 0){var i=n(t);if(yo){Ue(!0);try{n(t)}finally{Ue(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ns.bind(null,L,e),[r.memoizedState,e]},useRef:function(e){var t=Mo();return e={current:e},t.memoizedState=e},useState:function(e){e=qo(e);var t=e.queue,n=Ps.bind(null,L,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ys,useDeferredValue:function(e,t){return Ss(Mo(),e,t)},useTransition:function(){var e=qo(!1);return e=ws.bind(null,L,e.queue,!0,!1),Mo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=L,a=Mo();if(F){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),K===null)throw Error(i(349));J&127||Ho(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ds(Wo.bind(null,r,o,e),[e]),r.flags|=2048,ss(9,{destroy:void 0},Uo.bind(null,r,o,n,t),null),n},useId:function(){var e=Mo(),t=K.identifierPrefix;if(F){var n=Mi,r=ji;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=bo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Co++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ks,useFormState:ns,useActionState:ns,useOptimistic:function(e){var t=Mo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Is.bind(null,L,!0,n),n.dispatch=t,[e,t]},useMemoCache:Io,useCacheRefresh:function(){return Mo().memoizedState=Ms.bind(null,L)},useEffectEvent:function(e){var t=Mo(),n={impl:e};return t.memoizedState=n,function(){if(G&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Hs={readContext:aa,use:Fo,useCallback:bs,useContext:aa,useEffect:fs,useImperativeHandle:vs,useInsertionEffect:hs,useLayoutEffect:gs,useMemo:xs,useReducer:Ro,useRef:cs,useState:function(){return Ro(Lo)},useDebugValue:ys,useDeferredValue:function(e,t){return Cs(V(),R.memoizedState,e,t)},useTransition:function(){var e=Ro(Lo)[0],t=V().memoizedState;return[typeof e==`boolean`?e:Po(e),t]},useSyncExternalStore:Vo,useId:As,useHostTransitionStatus:ks,useFormState:rs,useActionState:rs,useOptimistic:function(e,t){return Jo(V(),R,e,t)},useMemoCache:Io,useCacheRefresh:js};Hs.useEffectEvent=ms;var Us={readContext:aa,use:Fo,useCallback:bs,useContext:aa,useEffect:fs,useImperativeHandle:vs,useInsertionEffect:hs,useLayoutEffect:gs,useMemo:xs,useReducer:Bo,useRef:cs,useState:function(){return Bo(Lo)},useDebugValue:ys,useDeferredValue:function(e,t){var n=V();return R===null?Ss(n,e,t):Cs(n,R.memoizedState,e,t)},useTransition:function(){var e=Bo(Lo)[0],t=V().memoizedState;return[typeof e==`boolean`?e:Po(e),t]},useSyncExternalStore:Vo,useId:As,useHostTransitionStatus:ks,useFormState:os,useActionState:os,useOptimistic:function(e,t){var n=V();return R===null?(n.baseState=e,[e,n.queue.dispatch]):Jo(n,R,e,t)},useMemoCache:Io,useCacheRefresh:js};Us.useEffectEvent=ms;function Ws(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Gs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=qa(r);i.payload=t,n!=null&&(i.callback=n),t=Ja(e,i,r),t!==null&&(hu(t,e,r),Ya(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=qa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ja(e,i,r),t!==null&&(hu(t,e,r),Ya(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=qa(n);r.tag=2,t!=null&&(r.callback=t),t=Ja(e,r,n),t!==null&&(hu(t,e,n),Ya(t,e,n))}};function Ks(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 qs(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&&Gs.enqueueReplaceState(t,t.state,null)}function Js(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ys(e){ti(e)}function Xs(e){console.error(e)}function Zs(e){ti(e)}function Qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function $s(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ec(e,t,n){return n=qa(n),n.tag=3,n.payload={element:null},n.callback=function(){Qs(e,t)},n}function tc(e){return e=qa(e),e.tag=3,e}function nc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){$s(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){$s(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function rc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&na(t,n,a,!0),n=so.current,n!==null){switch(n.tag){case 31:case 13:return co===null?Du():n.alternate===null&&X===0&&(X=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ka?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,a)),!1;case 22:return n.flags|=65536,r===ka?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Gu(e,r,a)),!1}throw Error(i(435,n.tag))}return Gu(e,r,a),Du(),!1}if(F)return t=so.current,t===null?(r!==Vi&&(t=Error(i(423),{cause:r}),Ji(Ci(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ci(r,n),a=ec(e.stateNode,r,a),Xa(e,a),X!==4&&(X=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Vi&&(e=Error(i(422),{cause:r}),Ji(Ci(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ci(o,n),Xl===null?Xl=[o]:Xl.push(o),X!==4&&(X=2),t===null)return!0;r=Ci(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=ec(n.stateNode,r,e),Xa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ru===null||!ru.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=tc(a),nc(a,e,n,r),Xa(n,a),!1}n=n.return}while(n!==null);return!1}var ic=Error(i(461)),H=!1;function ac(e,t,n,r){t.child=e===null?Ua(t,null,n,r):Ha(t,e.child,n,r)}function oc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ia(t),r=To(e,t,n,o,a,i),s=ko(),e!==null&&!H?(Ao(e,t,i),Ac(e,t,i)):(F&&s&&Fi(t),t.flags|=1,ac(e,t,r,i),t.child)}function sc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!mi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,cc(e,t,a,r,i)):(e=_i(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!jc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?kr:n,n(o,r)&&e.ref===t.ref)return Ac(e,t,i)}return t.flags|=1,e=hi(a,r),e.ref=t.ref,e.return=t,t.child=e}function cc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(kr(a,r)&&e.ref===t.ref)if(H=!1,t.pendingProps=r=a,jc(e,i))e.flags&131072&&(H=!0);else return t.lanes=e.lanes,Ac(e,t,i)}return gc(e,t,n,r,i)}function lc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return dc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&wa(t,a===null?null:a.cachePool),a===null?ao():io(t,a),fo(t);else return r=t.lanes=536870912,dc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&wa(t,null),ao(),po(t)):(wa(t,a.cachePool),io(t,a),po(t),t.memoizedState=null);return ac(e,t,i,n),t.child}function uc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function dc(e,t,n,r,i){var a=Ca();return a=a===null?null:{parent:da._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&wa(t,null),ao(),fo(t),e!==null&&na(e,t,r,!0),t.childLanes=i,null}function fc(e,t){return t=Tc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function pc(e,t,n){return Ha(t,e.child,null,n),e=fc(t,t.pendingProps),e.flags|=2,mo(t),t.memoizedState=null,e}function mc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(F){if(r.mode===`hidden`)return e=fc(t,r),t.lanes=536870912,uc(null,e);if(uo(t),(e=P)?(e=rf(e,Bi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ai===null?null:{id:ji,overflow:Mi},retryLane:536870912,hydrationErrors:null},n=bi(e),n.return=t,t.child=n,Ri=t,P=null)):e=null,e===null)throw Hi(t);return t.lanes=536870912,null}return fc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(uo(t),a)if(t.flags&256)t.flags&=-257,t=pc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(H||na(e,t,n,!1),a=(n&e.childLanes)!==0,H||a){if(r=K,r!==null&&(s=st(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ci(e,s),hu(r,e,s),ic;Du(),t=pc(e,t,n)}else e=o.treeContext,P=cf(s.nextSibling),Ri=t,F=!0,zi=null,Bi=!1,e!==null&&Li(t,e),t=fc(t,r),t.flags|=4096;return t}return e=hi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function hc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function gc(e,t,n,r,i){return ia(t),n=To(e,t,n,r,void 0,i),r=ko(),e!==null&&!H?(Ao(e,t,i),Ac(e,t,i)):(F&&r&&Fi(t),t.flags|=1,ac(e,t,n,i),t.child)}function _c(e,t,n,r,i,a){return ia(t),t.updateQueue=null,n=Do(t,r,n,i),Eo(e),r=ko(),e!==null&&!H?(Ao(e,t,a),Ac(e,t,a)):(F&&r&&Fi(t),t.flags|=1,ac(e,t,n,a),t.child)}function vc(e,t,n,r,i){if(ia(t),t.stateNode===null){var a=di,o=n.contextType;typeof o==`object`&&o&&(a=aa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Gs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ga(t),o=n.contextType,a.context=typeof o==`object`&&o?aa(o):di,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ws(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Gs.enqueueReplaceState(a,a.state,null),$a(t,r,a,i),Qa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Js(n,s);a.props=c;var l=a.context,u=n.contextType;o=di,typeof u==`object`&&u&&(o=aa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&qs(t,a,r,o),Wa=!1;var f=t.memoizedState;a.state=f,$a(t,r,a,i),Qa(),l=t.memoizedState,s||f!==l||Wa?(typeof d==`function`&&(Ws(t,n,d,r),l=t.memoizedState),(c=Wa||Ks(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ka(e,t),o=t.memoizedProps,u=Js(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=di,typeof l==`object`&&l&&(c=aa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&qs(t,a,r,c),Wa=!1,f=t.memoizedState,a.state=f,$a(t,r,a,i),Qa();var p=t.memoizedState;o!==d||f!==p||Wa||e!==null&&e.dependencies!==null&&ra(e.dependencies)?(typeof s==`function`&&(Ws(t,n,s,r),p=t.memoizedState),(u=Wa||Ks(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ra(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,hc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ha(t,e.child,null,i),t.child=Ha(t,null,n,i)):ac(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ac(e,t,i),e}function yc(e,t,n,r){return Ki(),t.flags|=256,ac(e,t,n,r),t.child}var bc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xc(e){return{baseLanes:e,cachePool:Ta()}}function Sc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Jl),e}function Cc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(I.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(F){if(a?lo(t):po(t),(e=P)?(e=rf(e,Bi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ai===null?null:{id:ji,overflow:Mi},retryLane:536870912,hydrationErrors:null},n=bi(e),n.return=t,t.child=n,Ri=t,P=null)):e=null,e===null)throw Hi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(po(t),a=t.mode,c=Tc({mode:`hidden`,children:c},a),r=vi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=xc(n),r.childLanes=Sc(e,s,n),t.memoizedState=bc,uc(null,r)):(lo(t),wc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(lo(t),t.flags&=-257,t=Ec(e,t,n)):t.memoizedState===null?(po(t),c=r.fallback,a=t.mode,r=Tc({mode:`visible`,children:r.children},a),c=vi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ha(t,e.child,null,n),r=t.child,r.memoizedState=xc(n),r.childLanes=Sc(e,s,n),t.memoizedState=bc,t=uc(null,r)):(po(t),t.child=e.child,t.flags|=128,t=null);else if(lo(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ji({value:r,source:null,stack:null}),t=Ec(e,t,n)}else if(H||na(e,t,n,!1),s=(n&e.childLanes)!==0,H||s){if(s=K,s!==null&&(r=st(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ci(e,r),hu(s,e,r),ic;af(c)||Du(),t=Ec(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,P=cf(c.nextSibling),Ri=t,F=!0,zi=null,Bi=!1,e!==null&&Li(t,e),t=wc(t,r.children),t.flags|=4096);return t}return a?(po(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=hi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=vi(c,a,n,null),c.flags|=2):c=hi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,uc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=xc(n):(a=c.cachePool,a===null?a=Ta():(l=da._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Sc(e,s,n),t.memoizedState=bc,uc(e.child,r)):(lo(t),n=e.child,e=n.sibling,n=hi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function wc(e,t){return t=Tc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Tc(e,t){return e=pi(22,e,null,t),e.lanes=0,e}function Ec(e,t,n){return Ha(t,e.child,null,n),e=wc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ea(e.return,t,n)}function Oc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function kc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=I.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,D(I,o),ac(e,t,r,n),r=F?Di:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Dc(e,n,t);else if(e.tag===19)Dc(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}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ho(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Oc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ho(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Oc(t,!0,n,null,a,r);break;case`together`:Oc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ac(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(na(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=hi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=hi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function jc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&ra(e))):!0}function Mc(e,t,n){switch(t.tag){case 3:be(t,t.stateNode.containerInfo),Qi(t,da,e.memoizedState.cache),Ki();break;case 27:case 5:Se(t);break;case 4:be(t,t.stateNode.containerInfo);break;case 10:Qi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,uo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(lo(t),e=Ac(e,t,n),e===null?null:e.sibling):Cc(e,t,n):(lo(t),t.flags|=128,null);lo(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(na(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return kc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),D(I,I.current),r)break;return null;case 22:return t.lanes=0,lc(e,t,n,t.pendingProps);case 24:Qi(t,da,e.memoizedState.cache)}return Ac(e,t,n)}function Nc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)H=!0;else{if(!jc(e,n)&&!(t.flags&128))return H=!1,Mc(e,t,n);H=!!(e.flags&131072)}else H=!1,F&&t.flags&1048576&&Pi(t,Di,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ma(t.elementType),t.type=e,typeof e==`function`)mi(e)?(r=Js(e,r),t.tag=1,t=vc(null,t,e,r,n)):(t.tag=0,t=gc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===C){t.tag=11,t=oc(null,t,e,r,n);break a}else if(a===re){t.tag=14,t=sc(null,t,e,r,n);break a}}throw t=le(e)||e,Error(i(306,t,``))}}return t;case 0:return gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Js(r,t.pendingProps),vc(e,t,r,a,n);case 3:a:{if(be(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ka(e,t),$a(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Qi(t,da,r),r!==o.cache&&ta(t,[da],n,!0),Qa(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=yc(e,t,r,n);break a}else if(r!==a){a=Ci(Error(i(424)),t),Ji(a),t=yc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(P=cf(e.firstChild),Ri=t,F=!0,zi=null,Bi=!0,n=Ua(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ki(),r===a){t=Ac(e,t,n);break a}ac(e,t,r,n)}t=t.child}return t;case 26:return hc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:F||(n=t.type,e=t.pendingProps,r=Bd(ve.current).createElement(n),r[pt]=t,r[mt]=e,Pd(r,n,e),M(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Se(t),e===null&&F&&(r=t.stateNode=ff(t.type,t.pendingProps,ve.current),Ri=t,Bi=!0,a=P,Zd(t.type)?(lf=a,P=cf(r.firstChild)):P=a),ac(e,t,t.pendingProps.children,n),hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&F&&((a=r=P)&&(r=tf(r,t.type,t.pendingProps,Bi),r===null?a=!1:(t.stateNode=r,Ri=t,P=cf(r.firstChild),Bi=!1,a=!0)),a||Hi(t)),Se(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=To(e,t,Oo,null,null,n),Qf._currentValue=a),hc(e,t),ac(e,t,r,n),t.child;case 6:return e===null&&F&&((e=n=P)&&(n=nf(n,t.pendingProps,Bi),n===null?e=!1:(t.stateNode=n,Ri=t,P=null,e=!0)),e||Hi(t)),null;case 13:return Cc(e,t,n);case 4:return be(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ha(t,null,r,n):ac(e,t,r,n),t.child;case 11:return oc(e,t,t.type,t.pendingProps,n);case 7:return ac(e,t,t.pendingProps,n),t.child;case 8:return ac(e,t,t.pendingProps.children,n),t.child;case 12:return ac(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Qi(t,t.type,r.value),ac(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ia(t),a=aa(a),r=r(a),t.flags|=1,ac(e,t,r,n),t.child;case 14:return sc(e,t,t.type,t.pendingProps,n);case 15:return cc(e,t,t.type,t.pendingProps,n);case 19:return kc(e,t,n);case 31:return mc(e,t,n);case 22:return lc(e,t,n,t.pendingProps);case 24:return ia(t),r=aa(da),e===null?(a=Ca(),a===null&&(a=K,o=fa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ga(t),Qi(t,da,a)):((e.lanes&n)!==0&&(Ka(e,t),$a(t,null,null,n),Qa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Qi(t,da,r),r!==a.cache&&ta(t,[da],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Qi(t,da,r))),ac(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Pc(e){e.flags|=4}function Fc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(wu())e.flags|=8192;else throw Na=ka,Da}else e.flags&=-16777217}function Ic(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(wu())e.flags|=8192;else throw Na=ka,Da}function Lc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:tt(),e.lanes|=t,Yl|=t)}function Rc(e,t){if(!F)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 U(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&65011712,r|=i.flags&65011712,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 zc(e,t,n){var r=t.pendingProps;switch(Ii(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return U(t),null;case 1:return U(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),$i(da),xe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Gi(t)?Pc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,qi())),U(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Pc(t),o===null?(U(t),Fc(t,a,null,r,n)):(U(t),Ic(t,o))):o?o===e.memoizedState?(U(t),t.flags&=-16777217):(Pc(t),U(t),Ic(t,o)):(e=e.memoizedProps,e!==r&&Pc(t),U(t),Fc(t,a,e,r,n)),null;case 27:if(Ce(t),n=ve.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return U(t),null}e=ge.current,Gi(t)?Ui(t,e):(e=ff(a,r,n),t.stateNode=e,Pc(t))}return U(t),null;case 5:if(Ce(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return U(t),null}if(o=ge.current,Gi(t))Ui(t,o);else{var s=Bd(ve.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[pt]=t,o[mt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Pc(t)}}return U(t),Fc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ve.current,Gi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ri,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Hi(t,!0)}else e=Bd(e).createTextNode(r),e[pt]=t,t.stateNode=e}return U(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Gi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[pt]=t}else Ki(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;U(t),e=!1}else n=qi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(mo(t),t):(mo(t),null);if(t.flags&128)throw Error(i(558))}return U(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Gi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[pt]=t}else Ki(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;U(t),a=!1}else a=qi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(mo(t),t):(mo(t),null)}return mo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Lc(t,t.updateQueue),U(t),null);case 4:return xe(),e===null&&Sd(t.stateNode.containerInfo),U(t),null;case 10:return $i(t.type),U(t),null;case 19:if(he(I),r=t.memoizedState,r===null)return U(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Rc(r,!1);else{if(X!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ho(e),o!==null){for(t.flags|=128,Rc(r,!1),e=o.updateQueue,t.updateQueue=e,Lc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)gi(n,e),n=n.sibling;return D(I,I.current&1|2),F&&Ni(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Me()>tu&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304)}else{if(!a)if(e=ho(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Lc(t,e),Rc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!F)return U(t),null}else 2*Me()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(U(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Me(),e.sibling=null,n=I.current,D(I,a?n&1|2:n&1),F&&Ni(t,r.treeForkCount),e);case 22:case 23:return mo(t),oo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(U(t),t.subtreeFlags&6&&(t.flags|=8192)):U(t),n=t.updateQueue,n!==null&&Lc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&he(Sa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),$i(da),U(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Bc(e,t){switch(Ii(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $i(da),xe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ce(t),null;case 31:if(t.memoizedState!==null){if(mo(t),t.alternate===null)throw Error(i(340));Ki()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(mo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ki()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return he(I),null;case 4:return xe(),null;case 10:return $i(t.type),null;case 22:case 23:return mo(t),oo(),e!==null&&he(Sa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return $i(da),null;case 25:return null;default:return null}}function Vc(e,t){switch(Ii(t),t.tag){case 3:$i(da),xe();break;case 26:case 27:case 5:Ce(t);break;case 4:xe();break;case 31:t.memoizedState!==null&&mo(t);break;case 13:mo(t);break;case 19:he(I);break;case 10:$i(t.type);break;case 22:case 23:mo(t),oo(),e!==null&&he(Sa);break;case 24:$i(da)}}function Hc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Uc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Wc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{to(t,n)}catch(t){Z(e,e.return,t)}}}function Gc(e,t,n){n.props=Js(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Kc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function qc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}function Jc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function Yc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[mt]=t}catch(t){Z(e,e.return,t)}}function Xc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Zc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Xc(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.tag===27&&Zd(e.type)||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 Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=on));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(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&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[pt]=e,t[mt]=n}catch(t){Z(e,e.return,t)}}var tl=!1,nl=!1,rl=!1,il=typeof WeakSet==`function`?WeakSet:Set,al=null;function ol(e,t){if(e=e.containerInfo,Rd=sp,e=Nr(e),Pr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.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||r!==0&&f.nodeType!==3||(l=s+r),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===r&&(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(zd={focusedElem:e,selectionRange:n},sp=!1,al=t;al!==null;)if(t=al,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,al=e;else for(;al!==null;){switch(t=al,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Js(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Z(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,al=e;break}al=t.return}}function sl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:xl(e,n),r&4&&Hc(5,n);break;case 1:if(xl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Js(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}r&64&&Wc(n),r&512&&Kc(n,n.return);break;case 3:if(xl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{to(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&el(n);case 26:case 5:xl(e,n),t===null&&r&4&&Jc(n),r&512&&Kc(n,n.return);break;case 12:xl(e,n);break;case 31:xl(e,n),r&4&&fl(e,n);break;case 13:xl(e,n),r&4&&pl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||tl,!r){t=t!==null&&t.memoizedState!==null||nl,i=tl;var a=nl;tl=r,(nl=t)&&!a?Cl(e,n,(n.subtreeFlags&8772)!=0):xl(e,n),tl=i,nl=a}break;case 30:break;default:xl(e,n)}}function cl(e){var t=e.alternate;t!==null&&(e.alternate=null,cl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&xt(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}var W=null,ll=!1;function ul(e,t,n){for(n=n.child;n!==null;)dl(e,t,n),n=n.sibling}function dl(e,t,n){if(He&&typeof He.onCommitFiberUnmount==`function`)try{He.onCommitFiberUnmount(Ve,n)}catch{}switch(n.tag){case 26:nl||qc(n,t),ul(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:nl||qc(n,t);var r=W,i=ll;Zd(n.type)&&(W=n.stateNode,ll=!1),ul(e,t,n),pf(n.stateNode),W=r,ll=i;break;case 5:nl||qc(n,t);case 6:if(r=W,i=ll,W=null,ul(e,t,n),W=r,ll=i,W!==null)if(ll)try{(W.nodeType===9?W.body:W.nodeName===`HTML`?W.ownerDocument.body:W).removeChild(n.stateNode)}catch(e){Z(n,t,e)}else try{W.removeChild(n.stateNode)}catch(e){Z(n,t,e)}break;case 18:W!==null&&(ll?(e=W,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(W,n.stateNode));break;case 4:r=W,i=ll,W=n.stateNode.containerInfo,ll=!0,ul(e,t,n),W=r,ll=i;break;case 0:case 11:case 14:case 15:Uc(2,n,t),nl||Uc(4,n,t),ul(e,t,n);break;case 1:nl||(qc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Gc(n,t,r)),ul(e,t,n);break;case 21:ul(e,t,n);break;case 22:nl=(r=nl)||n.memoizedState!==null,ul(e,t,n),nl=r;break;default:ul(e,t,n)}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Z(t,t.return,e)}}}function pl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Z(t,t.return,e)}}function ml(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new il),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new il),t;default:throw Error(i(435,e.tag))}}function hl(e,t){var n=ml(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function gl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){W=c.stateNode,ll=!1;break a}break;case 5:W=c.stateNode,ll=!1;break a;case 3:case 4:W=c.stateNode.containerInfo,ll=!0;break a}c=c.return}if(W===null)throw Error(i(160));dl(o,s,a),W=null,ll=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)vl(t,e),t=t.sibling}var _l=null;function vl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gl(t,e),yl(e),r&4&&(Uc(3,e,e.return),Hc(3,e),Uc(5,e,e.return));break;case 1:gl(t,e),yl(e),r&512&&(nl||n===null||qc(n,n.return)),r&64&&tl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=_l;if(gl(t,e),yl(e),r&512&&(nl||n===null||qc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[bt]||o[pt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[pt]=e,M(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[pt]=e,M(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Yc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:gl(t,e),yl(e),r&512&&(nl||n===null||qc(n,n.return)),n!==null&&r&4&&Yc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(gl(t,e),yl(e),r&512&&(nl||n===null||qc(n,n.return)),e.flags&32){a=e.stateNode;try{Zt(a,``)}catch(t){Z(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Yc(e,a,n===null?a:n.memoizedProps)),r&1024&&(rl=!0);break;case 6:if(gl(t,e),yl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Z(e,e.return,t)}}break;case 3:if(Bf=null,a=_l,_l=gf(t.containerInfo),gl(t,e),_l=a,yl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Z(e,e.return,t)}rl&&(rl=!1,bl(e));break;case 4:r=_l,_l=gf(e.stateNode.containerInfo),gl(t,e),yl(e),_l=r;break;case 12:gl(t,e),yl(e);break;case 31:gl(t,e),yl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 13:gl(t,e),yl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($l=Me()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=tl,d=nl;if(tl=u||a,nl=d||l,gl(t,e),nl=d,tl=u,yl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||tl||nl||Sl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Z(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Z(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Z(l,l.return,e)}}}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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,hl(e,n))));break;case 19:gl(t,e),yl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 30:break;case 21:break;default:gl(t,e),yl(e)}}function yl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Xc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;$c(e,Zc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Zt(o,``),n.flags&=-33),$c(e,Zc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Qc(e,Zc(e),s);break;default:throw Error(i(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)sl(e,t.alternate,t),t=t.sibling}function Sl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Uc(4,t,t.return),Sl(t);break;case 1:qc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Gc(t,t.return,n),Sl(t);break;case 27:pf(t.stateNode);case 26:case 5:qc(t,t.return),Sl(t);break;case 22:t.memoizedState===null&&Sl(t);break;case 30:Sl(t);break;default:Sl(t)}e=e.sibling}}function Cl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Cl(i,a,n),Hc(4,a);break;case 1:if(Cl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)eo(c[i],s)}catch(e){Z(r,r.return,e)}}n&&o&64&&Wc(a),Kc(a,a.return);break;case 27:el(a);case 26:case 5:Cl(i,a,n),n&&r===null&&o&4&&Jc(a),Kc(a,a.return);break;case 12:Cl(i,a,n);break;case 31:Cl(i,a,n),n&&o&4&&fl(i,a);break;case 13:Cl(i,a,n),n&&o&4&&pl(i,a);break;case 22:a.memoizedState===null&&Cl(i,a,n),Kc(a,a.return);break;case 30:break;default:Cl(i,a,n)}t=t.sibling}}function wl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&pa(n))}function Tl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&pa(e))}function El(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Dl(e,t,n,r),t=t.sibling}function Dl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:El(e,t,n,r),i&2048&&Hc(9,t);break;case 1:El(e,t,n,r);break;case 3:El(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&pa(e)));break;case 12:if(i&2048){El(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else El(e,t,n,r);break;case 31:El(e,t,n,r);break;case 13:El(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?El(e,t,n,r):(a._visibility|=2,Ol(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?El(e,t,n,r):kl(e,t),i&2048&&wl(o,t);break;case 24:El(e,t,n,r),i&2048&&Tl(t.alternate,t);break;default:El(e,t,n,r)}}function Ol(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ol(a,o,s,c,i),Hc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ol(a,o,s,c,i)):u._visibility&2?Ol(a,o,s,c,i):kl(a,o),i&&l&2048&&wl(o.alternate,o);break;case 24:Ol(a,o,s,c,i),i&&l&2048&&Tl(o.alternate,o);break;default:Ol(a,o,s,c,i)}t=t.sibling}}function kl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:kl(n,r),i&2048&&wl(r.alternate,r);break;case 24:kl(n,r),i&2048&&Tl(r.alternate,r);break;default:kl(n,r)}t=t.sibling}}var Al=8192;function jl(e,t,n){if(e.subtreeFlags&Al)for(e=e.child;e!==null;)Ml(e,t,n),e=e.sibling}function Ml(e,t,n){switch(e.tag){case 26:jl(e,t,n),e.flags&Al&&e.memoizedState!==null&&Gf(n,_l,e.memoizedState,e.memoizedProps);break;case 5:jl(e,t,n);break;case 3:case 4:var r=_l;_l=gf(e.stateNode.containerInfo),jl(e,t,n),_l=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Al,Al=16777216,jl(e,t,n),Al=r):jl(e,t,n));break;default:jl(e,t,n)}}function Nl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];al=r,Ll(r,e)}Nl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Fl(e),e=e.sibling}function Fl(e){switch(e.tag){case 0:case 11:case 15:Pl(e),e.flags&2048&&Uc(9,e,e.return);break;case 3:Pl(e);break;case 12:Pl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Il(e)):Pl(e);break;default:Pl(e)}}function Il(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];al=r,Ll(r,e)}Nl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Uc(8,t,t.return),Il(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Il(t));break;default:Il(t)}e=e.sibling}}function Ll(e,t){for(;al!==null;){var n=al;switch(n.tag){case 0:case 11:case 15:Uc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:pa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,al=r;else a:for(n=e;al!==null;){r=al;var i=r.sibling,a=r.return;if(cl(r),r===n){al=null;break a}if(i!==null){i.return=a,al=i;break a}al=a}}}var Rl={getCacheForType:function(e){var t=aa(da),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return aa(da).controller.signal}},zl=typeof WeakMap==`function`?WeakMap:Map,G=0,K=null,q=null,J=0,Y=0,Bl=null,Vl=!1,Hl=!1,Ul=!1,Wl=0,X=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=null,Zl=null,Ql=!1,$l=0,eu=0,tu=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return G&2&&J!==0?J&-J:T.T===null?ut():dd()}function mu(){if(Jl===0)if(!(J&536870912)||F){var e=Ye;Ye<<=1,!(Ye&3932160)&&(Ye=262144),Jl=e}else Jl=536870912;return e=so.current,e!==null&&(e.flags|=32),Jl}function hu(e,t,n){(e===K&&(Y===2||Y===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,J,Jl,!1)),rt(e,n),(!(G&2)||e!==K)&&(e===K&&(!(G&2)&&(Kl|=n),X===4&&yu(e,J,Jl,!1)),rd(e))}function gu(e,t,n){if(G&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||$e(e,t),a=r?Au(e,t):Ou(e,t,!0),o=r;do{if(a===0){Hl&&!r&&yu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!vu(n)){a=Ou(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Xl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Ul&&!l){c.errorRecoveryDisabledLanes|=o,Kl|=o,a=4;break a}o=Zl,Zl=a,o!==null&&(Zl===null?Zl=o:Zl.push.apply(Zl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Jl,!Vl);break a;case 2:Zl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=$l+300-Me(),10<a)){if(yu(r,t,Jl,!Vl),Qe(r,0,!0)!==0)break a;su=t,r.timeoutHandle=Kd(_u.bind(null,r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Vl,o,`Throttled`,-0,0),a);break a}_u(r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Vl,o,null,-0,0)}}break}while(1);rd(e)}function _u(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:on},Ml(t,a,d);var m=(a&62914560)===a?$l-Me():(a&4194048)===a?eu-Me():0;if(m=qf(d,m),m!==null){su=a,e.cancelPendingCommit=m(Lu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Lu(e,t,a,n,r,i,o,s,c)}function vu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,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 yu(e,t,n,r){t&=~ql,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-We(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&at(e,n,t)}function bu(){return G&6?!0:(id(0,!1),!1)}function xu(){if(q!==null){if(Y===0)var e=q.return;else e=q,Zi=Xi=null,jo(e),Ia=null,La=0,e=q;for(;e!==null;)Vc(e.alternate,e),e=e.return;q=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),K=e,q=n=hi(e.current,null),J=t,Y=0,Bl=null,Vl=!1,Hl=$e(e,t),Ul=!1,Yl=Jl=ql=Kl=Gl=X=0,Zl=Xl=null,Ql=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-We(r),a=1<<i;t|=e[i],r&=~a}return Wl=t,ai(),n}function Cu(e,t){L=null,T.H=Bs,t===Ea||t===Oa?(t=Pa(),Y=3):t===Da?(t=Pa(),Y=4):Y=t===ic?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Bl=t,q===null&&(X=1,Qs(e,Ci(t,e.current)))}function wu(){var e=so.current;return e===null?!0:(J&4194048)===J?co===null:(J&62914560)===J||J&536870912?e===co:!1}function Tu(){var e=T.H;return T.H=Bs,e===null?Bs:e}function Eu(){var e=T.A;return T.A=Rl,e}function Du(){X=4,Vl||(J&4194048)!==J&&so.current!==null||(Hl=!0),!(Gl&134217727)&&!(Kl&134217727)||K===null||yu(K,J,Jl,!1)}function Ou(e,t,n){var r=G;G|=2;var i=Tu(),a=Eu();(K!==e||J!==t)&&(nu=null,Su(e,t)),t=!1;var o=X;a:do try{if(Y!==0&&q!==null){var s=q,c=Bl;switch(Y){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:so.current===null&&(t=!0);var l=Y;if(Y=0,Bl=null,Pu(e,s,c,l),n&&Hl){o=0;break a}break;default:l=Y,Y=0,Bl=null,Pu(e,s,c,l)}}ku(),o=X;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,Zi=Xi=null,G=r,T.H=i,T.A=a,q===null&&(K=null,J=0,ai()),o}function ku(){for(;q!==null;)Mu(q)}function Au(e,t){var n=G;G|=2;var r=Tu(),a=Eu();K!==e||J!==t?(nu=null,tu=Me()+500,Su(e,t)):Hl=$e(e,t);a:do try{if(Y!==0&&q!==null){t=q;var o=Bl;b:switch(Y){case 1:Y=0,Bl=null,Pu(e,t,o,1);break;case 2:case 9:if(Aa(o)){Y=0,Bl=null,Nu(t);break}t=function(){Y!==2&&Y!==9||K!==e||(Y=7),rd(e)},o.then(t,t);break a;case 3:Y=7;break a;case 4:Y=5;break a;case 7:Aa(o)?(Y=0,Bl=null,Nu(t)):(Y=0,Bl=null,Pu(e,t,o,7));break;case 5:var s=null;switch(q.tag){case 26:s=q.memoizedState;case 5:case 27:var c=q;if(s?Wf(s):c.stateNode.complete){Y=0,Bl=null;var l=c.sibling;if(l!==null)q=l;else{var u=c.return;u===null?q=null:(q=u,Fu(u))}break b}}Y=0,Bl=null,Pu(e,t,o,5);break;case 6:Y=0,Bl=null,Pu(e,t,o,6);break;case 8:xu(),X=6;break a;default:throw Error(i(462))}}ju();break}catch(t){Cu(e,t)}while(1);return Zi=Xi=null,T.H=r,T.A=a,G=n,q===null?(K=null,J=0,ai(),X):0}function ju(){for(;q!==null&&!Ae();)Mu(q)}function Mu(e){var t=Nc(e.alternate,e,Wl);e.memoizedProps=e.pendingProps,t===null?Fu(e):q=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=_c(n,t,t.pendingProps,t.type,void 0,J);break;case 11:t=_c(n,t,t.pendingProps,t.type.render,t.ref,J);break;case 5:jo(t);default:Vc(n,t),t=q=gi(t,Wl),t=Nc(n,t,Wl)}e.memoizedProps=e.pendingProps,t===null?Fu(e):q=t}function Pu(e,t,n,r){Zi=Xi=null,jo(t),Ia=null,La=0;var i=t.return;try{if(rc(e,i,t,n,J)){X=1,Qs(e,Ci(n,e.current)),q=null;return}}catch(t){if(i!==null)throw q=i,t;X=1,Qs(e,Ci(n,e.current)),q=null;return}t.flags&32768?(F||r===1?e=!0:Hl||J&536870912?e=!1:(Vl=e=!0,(r===2||r===9||r===3||r===6)&&(r=so.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Vl);return}e=t.return;var n=zc(t.alternate,t,Wl);if(n!==null){q=n;return}if(t=t.sibling,t!==null){q=t;return}q=t=e}while(t!==null);X===0&&(X=5)}function Iu(e,t){do{var n=Bc(e.alternate,e);if(n!==null){n.flags&=32767,q=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){q=e;return}q=e=n}while(e!==null);X=6,q=null}function Lu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(G&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ii,it(e,n,o,s,c,l),e===K&&(q=K=null,J=0),ou=t,au=e,su=n,cu=o,lu=a,uu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Ie,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=T.T,T.T=null,a=E.p,E.p=2,s=G,G|=4;try{ol(e,t,n)}finally{G=s,E.p=a,T.T=r}}iu=1,Ru(),zu(),Bu()}}function Ru(){if(iu===1){iu=0;var e=au,t=ou,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=T.T,T.T=null;var r=E.p;E.p=2;var i=G;G|=4;try{vl(t,e);var a=zd,o=Nr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Mr(s.ownerDocument.documentElement,s)){if(c!==null&&Pr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=jr(s,h),v=jr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{G=i,E.p=r,T.T=n}}e.current=t,iu=2}}function zu(){if(iu===2){iu=0;var e=au,t=ou,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=T.T,T.T=null;var r=E.p;E.p=2;var i=G;G|=4;try{sl(e,t.alternate,t)}finally{G=i,E.p=r,T.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,je();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),lt(n),t=t.stateNode,He&&typeof He.onCommitFiberRoot==`function`)try{He.onCommitFiberRoot(Ve,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=T.T,i=E.p,E.p=2,T.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{T.T=t,E.p=i}}su&3&&Hu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,id(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,pa(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=lt(su),r=T.T,a=E.p;try{E.p=32>n?32:n,T.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,G&6)throw Error(i(331));var c=G;if(G|=4,Fl(o.current),Dl(o,o.current,s,n),G=c,id(0,!1),He&&typeof He.onPostCommitFiberRoot==`function`)try{He.onPostCommitFiberRoot(Ve,o)}catch{}return!0}finally{E.p=a,T.T=r,Vu(e,t)}}function Wu(e,t,n){t=Ci(n,t),t=ec(e.stateNode,t,2),e=Ja(e,t,2),e!==null&&(rt(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=Ci(n,e),n=tc(2),r=Ja(t,n,2),r!==null&&(nc(n,r,t,e),rt(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zl;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)||(Ul=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,K===e&&(J&n)===n&&(X===4||X===3&&(J&62914560)===J&&300>Me()-$l?!(G&2)&&Su(e,0):ql|=n,Yl===J&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=tt()),e=ci(e,t),e!==null&&(rt(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return j(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-We(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=J,a=Qe(r,r===K?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=Me(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-We(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=et(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=K,n=J,n=Qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Y===2||Y===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ke(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||$e(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ke(r),lt(n)){case 2:case 8:n=Fe;break;case 32:n=Ie;break;case 268435456:n=Re;break;default:n=Ie}return r=cd.bind(null,e),n=j(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ke(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(iu!==0&&iu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hu()&&e.callbackNode!==n)return null;var r=J;return r=Qe(e,e===K?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),sd(e,Me()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Hu())return null;gu(e,t,!0)}function ud(){Yd(function(){G&6?j(Pe,ad):od()})}function dd(){if(nd===0){var e=ga;e===0&&(e=Je,Je<<=1,!(Je&261888)&&(Je=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:an(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[mt]||null).action),o=r.submitter;o&&(t=(t=o[mt]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Dn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);Es(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),Es(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<$r.length;hd++){var gd=$r[hd];ei(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}ei(Gr,`onAnimationEnd`),ei(Kr,`onAnimationIteration`),ei(qr,`onAnimationStart`),ei(`dblclick`,`onDoubleClick`),ei(`focusin`,`onFocus`),ei(`focusout`,`onBlur`),ei(Jr,`onTransitionRun`),ei(Yr,`onTransitionStart`),ei(Xr,`onTransitionCancel`),ei(Zr,`onTransitionEnd`),kt(`onMouseEnter`,[`mouseout`,`mouseover`]),kt(`onMouseLeave`,[`mouseout`,`mouseover`]),kt(`onPointerEnter`,[`pointerout`,`pointerover`]),kt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ot(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ot(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ot(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ot(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ot(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ot(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`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(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(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;a=s,i.currentTarget=l;try{a(i)}catch(e){ti(e)}i.currentTarget=null,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;a=s,i.currentTarget=l;try{a(i)}catch(e){ti(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[gt];n===void 0&&(n=t[gt]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,Et.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!gn||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 wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=St(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}pn(function(){var r=a,i=cn(n),s=[];a:{var c=Qr.get(e);if(c!==void 0){var l=Dn,u=e;switch(e){case`keypress`:if(Sn(n)===0)break a;case`keydown`:case`keyup`:l=Gn;break;case`focusin`:u=`focus`,l=In;break;case`focusout`:u=`blur`,l=In;break;case`beforeblur`:case`afterblur`:l=In;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`:l=Pn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Fn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=qn;break;case Gr:case Kr:case qr:l=Ln;break;case Zr:l=Jn;break;case`scroll`:case`scrollend`:l=kn;break;case`wheel`:l=Yn;break;case`copy`:case`cut`:case`paste`:l=Rn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Kn;break;case`toggle`:case`beforetoggle`:l=Xn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=mn(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==sn&&(u=n.relatedTarget||n.fromElement)&&(St(u)||u[ht]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?St(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Pn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Kn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:wt(l),h=u==null?c:wt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,St(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(s,c,l,d,!1),u!==null&&f!==null&&Od(s,f,u,d,!0)}}a:{if(c=r?wt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=gr;else if(ur(c))if(_r)v=Er;else{v=wr;var y=Cr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&tn(r.elementType)&&(v=gr):v=Tr;if(v&&=v(e,r)){dr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&qt(c,`number`,c.value)}switch(y=r?wt(r):window,e){case`focusin`:(ur(y)||y.contentEditable===`true`)&&(Ir=y,Lr=r,Rr=null);break;case`focusout`:Rr=Lr=Ir=null;break;case`mousedown`:zr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:zr=!1,Br(s,n,i);break;case`selectionchange`:if(Fr)break;case`keydown`:case`keyup`:Br(s,n,i)}var b;if(Qn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else or?ir(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(tr&&n.locale!==`ko`&&(or||x!==`onCompositionStart`?x===`onCompositionEnd`&&or&&(b=xn()):(vn=i,yn=`value`in vn?vn.value:vn.textContent,or=!0)),y=Ed(r,x),0<y.length&&(x=new zn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=ar(n),b!==null&&(x.data=b)))),(b=er?sr(e,n):cr(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new zn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=mn(e,n),i!=null&&r.unshift(Td(e,i,a)),i=mn(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(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(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=mn(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=mn(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\\r\\n?/g,Ad=/\\u0000|\\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`\n`).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Zt(e,``+r);break;case`className`:Ft(e,`class`,r);break;case`tabIndex`:Ft(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ft(e,n,r);break;case`style`:en(e,r,o);break;case`data`:if(t!==`object`){Ft(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=an(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,a.name,a,null),$(e,t,`formEncType`,a.formEncType,a,null),$(e,t,`formMethod`,a.formMethod,a,null),$(e,t,`formTarget`,a.formTarget,a,null)):($(e,t,`encType`,a.encType,a,null),$(e,t,`method`,a.method,a,null),$(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=an(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=on);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=an(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Pt(e,`popover`,r);break;case`xlinkActuate`:It(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:It(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:It(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:It(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Pt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=nn.get(n)||n,Pt(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:en(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Zt(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=on);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Dt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[mt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Pt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,o,s,n,null)}}a&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:$(e,t,r,d,n,null)}}Kt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Jt(e,!!r,n,!0):Jt(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:$(e,t,s,c,n,null)}Xt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,u,r,n,null)}return;default:if(tn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}Gt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&$(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Jt(e,!!n,n?[]:``,!1):Jt(e,!!n,t,!0)):Jt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&$(e,t,s,a,r,o)}Yt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(tn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(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===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[bt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),xt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[bt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(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===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);xt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=E.d;E.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=bu();return e||t}function yf(e){var t=Ct(e);t!==null&&t.tag===5&&t.type===`form`?Os(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Wt(t);i=`link[rel=\"`+e+`\"][href=\"`+i+`\"]`,typeof n==`string`&&(i+=`[crossorigin=\"`+n+`\"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),M(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel=\"preload\"][as=\"`+Wt(t)+`\"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset=\"`+Wt(n.imageSrcSet)+`\"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes=\"`+Wt(n.imageSizes)+`\"]`)):i+=`[href=\"`+Wt(e)+`\"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),M(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel=\"modulepreload\"][as=\"`+Wt(r)+`\"][href=\"`+Wt(e)+`\"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),M(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=Tt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,\"data-precedence\":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);M(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=Tt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),M(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=Tt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),M(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=ve.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=Tt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=Tt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=Tt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href=\"`+Wt(e)+`\"`}function jf(e){return`link[rel=\"stylesheet\"][`+e+`]`}function Mf(e){return h({},e,{\"data-precedence\":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel=\"preload\"][as=\"style\"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),M(t),e.head.appendChild(t))}function Pf(e){return`[src=\"`+Wt(e)+`\"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~=\"`+Wt(n.href)+`\"]`);if(r)return t.instance=r,M(r),r;var a=h({},n,{\"data-href\":n.href,\"data-precedence\":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),M(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,M(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),M(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,M(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),M(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel=\"stylesheet\"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[bt]||a[pt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,M(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),M(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:S,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=nt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nt(0),this.hiddenUpdates=nt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=pi(3,null,null,t),e.current=a,a.stateNode=e,t=fa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ga(a),e}function tp(e){return e?(e=di,e):di}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=qa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ja(e,r,t),n!==null&&(hu(n,e,t),Ya(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ci(e,67108864);t!==null&&hu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=pu();t=ct(t);var n=ci(e,t);n!==null&&hu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=T.T;T.T=null;var a=E.p;try{E.p=2,up(e,t,n,r)}finally{E.p=a,T.T=i}}function lp(e,t,n,r){var i=T.T;T.T=null;var a=E.p;try{E.p=8,up(e,t,n,r)}finally{E.p=a,T.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=Ct(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-We(o);s.entanglements[1]|=c,o&=~c}rd(a),!(G&6)&&(tu=Me()+500,id(0,!1))}}break;case 31:case 13:s=ci(a,2),s!==null&&hu(s,a,2),bu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=cn(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=St(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 fp=e,null}function mp(e){switch(e){case`beforetoggle`: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`toggle`: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 2;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`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ne()){case Pe:return 2;case Fe:return 8;case Ie:case Le:return 32;case Re:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(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=Ct(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=St(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,dt(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,dt(e.priority,function(){op(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 Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);sn=r,n.target.dispatchEvent(r),sn=null}else return t=Ct(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=Ct(n);a!==null&&(e.splice(t,3),t-=3,Es(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[mt]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[mt]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,pu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),bu(),t[ht]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=ut();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.7`)throw Error(i(527,Lp,`19.2.7`));E.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:T,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Ve=zp.inject(Rp),He=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ys,s=Xs,c=Zs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[ht]=t.current,Sd(e),new Fp(t)}})),g=o(((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=h()})),_=c(u(),1),v=g(),y=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),b=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),x=e=>e.replace(/^([A-Z])|[\\s-_]+(\\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),ee=e=>{let t=x(e);return t.charAt(0).toUpperCase()+t.slice(1)},S={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},C=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},te=(0,_.createContext)({}),ne=()=>(0,_.useContext)(te),re=(0,_.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=ne()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,_.createElement)(`svg`,{ref:c,...S,width:t??l??S.width,height:t??l??S.height,stroke:e??f,strokeWidth:m,className:y(`lucide`,p,i),...!a&&!C(s)&&{\"aria-hidden\":`true`},...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),w=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(re,{ref:i,iconNode:t,className:y(`lucide-${b(ee(e))}`,`lucide-${e}`,n),...r}));return n.displayName=ee(e),n},ie=w(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),ae=w(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),oe=w(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),se=w(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),ce=w(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),le=w(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),ue=w(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),T=w(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),E=w(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),de=w(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),fe=w(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),pe=w(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),me=w(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),he=w(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),D=w(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ge=w(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),_e=w(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),ve=w(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),ye=localStorage.getItem(`tinbase_service_key`)||``,be=()=>ye,xe=e=>{ye=e,localStorage.setItem(`tinbase_service_key`,e)},Se=()=>{ye=``,localStorage.removeItem(`tinbase_service_key`)};function Ce(e={}){return{apikey:ye,authorization:`Bearer ${ye}`,\"content-type\":`application/json`,...e}}async function O(e,t={}){return fetch(`${e}`,{...t,headers:{...Ce(),...t.headers}})}async function k(e){let t=await e.text(),n=t?JSON.parse(t):null;if(!e.ok)throw Error(n?.error||n?.message||n?.msg||`HTTP ${e.status}`);return n}var A={ping:()=>O(`/admin/v1/stats`).then(k),stats:()=>O(`/admin/v1/stats`).then(k),schemas:()=>O(`/admin/v1/schemas`).then(k).then(e=>e.schemas),tables:(e=`public`)=>O(`/admin/v1/tables?schema=${encodeURIComponent(e)}`).then(k).then(e=>e.tables),migrations:()=>O(`/admin/v1/migrations`).then(k).then(e=>e.migrations),policies:()=>O(`/admin/v1/policies`).then(k).then(e=>e.policies),createPolicy:e=>O(`/admin/v1/policies`,{method:`POST`,body:JSON.stringify(e)}).then(k),dropPolicy:(e,t)=>O(`/admin/v1/policies?${new URLSearchParams({table:e,name:t})}`,{method:`DELETE`}).then(k),functions:()=>O(`/admin/v1/functions`).then(k).then(e=>e.functions),triggers:()=>O(`/admin/v1/triggers`).then(k).then(e=>e.triggers),logs:()=>O(`/admin/v1/logs`).then(k).then(e=>e.logs),clearLogs:()=>O(`/admin/v1/logs`,{method:`DELETE`}).then(k),sql:e=>O(`/admin/v1/sql`,{method:`POST`,body:JSON.stringify({query:e})}).then(async e=>{let t=await e.json();return{ok:e.ok,...t}}),rows:(e,t)=>{let n=new URLSearchParams({select:`*`,limit:String(t.limit),offset:String(t.offset)});return t.order&&n.set(`order`,t.order),O(`/rest/v1/${encodeURIComponent(e)}?${n}`,{headers:{prefer:`count=exact`}}).then(async e=>{let t=await k(e),n=e.headers.get(`content-range`)||``;return{rows:t,total:parseInt(n.split(`/`)[1]||`0`,10)}})},insertRow:(e,t)=>O(`/rest/v1/${encodeURIComponent(e)}`,{method:`POST`,headers:{prefer:`return=representation`},body:JSON.stringify(t)}).then(k),updateRow:(e,t,n)=>{let r=new URLSearchParams;for(let[e,n]of Object.entries(t))r.set(e,`eq.${n}`);return O(`/rest/v1/${encodeURIComponent(e)}?${r}`,{method:`PATCH`,headers:{prefer:`return=representation`},body:JSON.stringify(n)}).then(k)},deleteRow:(e,t)=>{let n=new URLSearchParams;for(let[e,r]of Object.entries(t))n.set(e,`eq.${r}`);return O(`/rest/v1/${encodeURIComponent(e)}?${n}`,{method:`DELETE`}).then(k)},users:()=>O(`/auth/v1/admin/users`).then(k).then(e=>e.users),createUser:e=>O(`/auth/v1/admin/users`,{method:`POST`,body:JSON.stringify({email_confirm:!0,...e})}).then(k),updateUser:(e,t)=>O(`/auth/v1/admin/users/${e}`,{method:`PUT`,body:JSON.stringify(t)}).then(k),deleteUser:e=>O(`/auth/v1/admin/users/${e}`,{method:`DELETE`}).then(k),buckets:()=>O(`/storage/v1/bucket`).then(k),createBucket:e=>O(`/storage/v1/bucket`,{method:`POST`,body:JSON.stringify(e)}).then(k),deleteBucket:e=>O(`/storage/v1/bucket/${encodeURIComponent(e)}`,{method:`DELETE`}).then(k),listObjects:(e,t=``)=>O(`/storage/v1/object/list/${encodeURIComponent(e)}`,{method:`POST`,body:JSON.stringify({prefix:t,limit:100,offset:0,sortBy:{column:`name`,order:`asc`}})}).then(k),uploadObject:(e,t,n)=>{let r=new FormData;return r.append(``,n),fetch(`/storage/v1/object/${encodeURIComponent(e)}/${t}`,{method:`POST`,headers:{apikey:ye,authorization:`Bearer ${ye}`,\"x-upsert\":`true`},body:r}).then(k)},removeObject:(e,t)=>O(`/storage/v1/object/${encodeURIComponent(e)}`,{method:`DELETE`,body:JSON.stringify({prefixes:[t]})}).then(k)};typeof window<`u`&&window.document&&window.document.createElement;function we(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Te(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ee(...e){return t=>{let n=!1,r=e.map(e=>{let r=Te(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Te(e[t],null)}}}}function De(...e){return _.useCallback(Ee(...e),e)}var Oe=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),j=o(((e,t)=>{t.exports=Oe()}))();function ke(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,j.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=_.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\\`${n}\\` must be used within \\`${t}\\``)}return[o,s]}let i=()=>{let t=n.map(e=>_.createContext(e));return function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Ae(i,...t)]}function Ae(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var je=globalThis?.document?_.useLayoutEffect:()=>{},Me=_.useId||(()=>void 0),Ne=0;function Pe(e){let[t,n]=_.useState(Me());return je(()=>{e||n(e=>e??String(Ne++))},[e]),e||(t?`radix-${t}`:``)}var Fe=_.useEffectEvent,Ie=_.useInsertionEffect;function Le(e){if(typeof Fe==`function`)return Fe(e);let t=_.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Ie==`function`?Ie(()=>{t.current=e}):je(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}var Re=_.useInsertionEffect||je;function ze({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Be({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=_.useRef(e!==void 0);_.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,_.useCallback(t=>{if(s){let n=Ve(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Be({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return Re(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Ve(e){return typeof e==`function`}var He=c(m(),1);function Ue(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Xe(r)&&typeof et==`function`&&(r=et(r._payload)),_.Children.forEach(r,e=>{if(Je(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Xe(n)&&typeof et==`function`&&(n=et(n._payload)),a=Ge(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?qe(a):void 0,l=De(n,c);if(!a){if(r||r===0)throw Error(o?$e(e):Qe(e));return r}let u=Ke(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var We=Symbol.for(`radix.slottable`),Ge=(e,t)=>{if(`child`in e.props){let t=e.props.child;return _.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null}return _.isValidElement(t)?t:null};function Ke(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function qe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Je(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===We}var Ye=Symbol.for(`react.lazy`);function Xe(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Ye&&`_payload`in e&&Ze(e._payload)}function Ze(e){return typeof e==`object`&&!!e&&`then`in e}var Qe=e=>`${e} failed to slot onto its children. Expected a single React element child or \\`Slottable\\`.`,$e=e=>`${e} failed to slot onto its \\`Slottable\\`. Expected \\`Slottable\\` to receive a single React element child.`,et=_.use,tt=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Ue(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,j.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function nt(e,t){e&&He.flushSync(()=>e.dispatchEvent(t))}function rt(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}var it=`DismissableLayer`,at=`dismissableLayer.update`,ot=`dismissableLayer.pointerDownOutside`,st=`dismissableLayer.focusOutside`,ct,lt=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ut=_.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=_.useContext(lt),[d,f]=_.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=_.useState({}),h=De(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(v),b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,ee=b>=y,S=_.useRef(!1),C=mt(e=>{let t=e.target;if(!(t instanceof Node))return;let n=[...u.branches].some(e=>e.contains(t));!ee||n||(a?.(e),s?.(e),e.defaultPrevented||c?.())},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces}),te=ht(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),ne=d?b===g.length-1:!1,re=Le(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return _.useEffect(()=>{if(ne)return p.addEventListener(`keydown`,re,{capture:!0}),()=>p.removeEventListener(`keydown`,re,{capture:!0})},[p,ne]),_.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ct=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),gt(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=ct))}},[d,p,n,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),gt())},[d,u]),_.useEffect(()=>{let e=()=>m({});return document.addEventListener(at,e),()=>document.removeEventListener(at,e)},[]),(0,j.jsx)(tt.div,{...l,ref:h,style:{pointerEvents:x?ee?`auto`:`none`:void 0,...e.style},onFocusCapture:we(e.onFocusCapture,te.onFocusCapture),onBlurCapture:we(e.onBlurCapture,te.onBlurCapture),onPointerDownCapture:we(e.onPointerDownCapture,C.onPointerDownCapture)})});ut.displayName=it;var dt=`DismissableLayerBranch`,ft=_.forwardRef((e,t)=>{let n=_.useContext(lt),r=_.useRef(null),i=De(t,r);return _.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,j.jsx)(tt.div,{...e,ref:i})});ft.displayName=dt;function pt(){let e=_.useContext(lt),[t,n]=_.useState(null);return _.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function mt(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a}=t,o=rt(e),s=_.useRef(!1),c=_.useRef(!1),l=_.useRef(new Map),u=_.useRef(()=>{});return _.useEffect(()=>{function e(){c.current=!1,i.current=!1,l.current.clear()}function t(){return Array.from(l.current.values()).some(Boolean)}function d(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||l.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{c.current&&u.current()},0)}function f(e){c.current&&l.current.set(e.type,!1)}let p=a=>{if(a.target&&!s.current){let s=function(){n.removeEventListener(`click`,u.current);let r=t();e(),r||_t(ot,o,d,{discrete:!0})},d={originalEvent:a};c.current=!0,i.current=r&&a.button===0,l.current.clear(),!r||a.button!==0?s():(n.removeEventListener(`click`,u.current),u.current=s,n.addEventListener(`click`,u.current,{once:!0}))}else n.removeEventListener(`click`,u.current),e();s.current=!1},m=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of m)n.addEventListener(e,d,!0),n.addEventListener(e,f);let h=window.setTimeout(()=>{n.addEventListener(`pointerdown`,p)},0);return()=>{window.clearTimeout(h),n.removeEventListener(`pointerdown`,p),n.removeEventListener(`click`,u.current);for(let e of m)n.removeEventListener(e,d,!0),n.removeEventListener(e,f)}},[n,o,r,i,a]),{onPointerDownCapture:()=>s.current=!0}}function ht(e,t=globalThis?.document){let n=rt(e),r=_.useRef(!1);return _.useEffect(()=>{let e=e=>{e.target&&!r.current&&_t(st,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function gt(){let e=new CustomEvent(at);document.dispatchEvent(e)}function _t(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?nt(i,a):i.dispatchEvent(a)}var vt=`focusScope.autoFocusOnMount`,yt=`focusScope.autoFocusOnUnmount`,bt={bubbles:!1,cancelable:!0},xt=`FocusScope`,St=_.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=_.useState(null),l=rt(i),u=rt(a),d=_.useRef(null),f=De(t,c),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Ot(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Ot(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Ot(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),_.useEffect(()=>{if(s){kt.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(vt,bt);s.addEventListener(vt,l),s.dispatchEvent(t),t.defaultPrevented||(Ct(Mt(Tt(s)),{select:!0}),document.activeElement===e&&Ot(s))}return()=>{s.removeEventListener(vt,l),setTimeout(()=>{let t=new CustomEvent(yt,bt);s.addEventListener(yt,u),s.dispatchEvent(t),t.defaultPrevented||Ot(e??document.body,{select:!0}),s.removeEventListener(yt,u),kt.remove(p)},0)}}},[s,l,u,p]);let m=_.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=wt(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Ot(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Ot(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,j.jsx)(tt.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});St.displayName=xt;function Ct(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Ot(r,{select:t}),document.activeElement!==n)return}function wt(e){let t=Tt(e);return[M(t,e),M(t.reverse(),e)]}function Tt(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function M(e,t){for(let n of e)if(!Et(n,{upTo:t}))return n}function Et(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Dt(e){return e instanceof HTMLInputElement&&`select`in e}function Ot(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Dt(e)&&t&&e.select()}}var kt=At();function At(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=jt(e,t),e.unshift(t)},remove(t){e=jt(e,t),e[0]?.resume()}}}function jt(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Mt(e){return e.filter(e=>e.tagName!==`A`)}var Nt=`Portal`,Pt=_.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=_.useState(!1);je(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?He.createPortal((0,j.jsx)(tt.div,{...r,ref:t}),o):null});Pt.displayName=Nt;function Ft(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}var It=e=>{let{present:t,children:n}=e,r=Lt(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=zt(r.ref,Vt(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null};It.displayName=`Presence`;function Lt(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),[o,s]=Ft(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{let e=Bt(r.current);a.current=o===`mounted`?e:`none`},[o]),je(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Bt(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),je(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Bt(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Bt(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:_.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Rt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function zt(...e){let t=_.useRef(e);return t.current=e,_.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Rt(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Rt(n[e],null)}}},[])}function Bt(e){return e?.animationName||`none`}function Vt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ht=0,Ut=null;function Wt(){_.useEffect(()=>{Ut||={start:Gt(),end:Gt()};let{start:e,end:t}=Ut;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ht++,()=>{Ht===1&&(Ut?.start.remove(),Ut?.end.remove(),Ut=null),Ht=Math.max(0,Ht-1)}},[])}function Gt(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Kt=function(){return Kt=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},Kt.apply(this,arguments)};function qt(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 Jt(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))}var Yt=`right-scroll-bar-position`,Xt=`width-before-scroll-bar`,Zt=`with-scroll-bars-hidden`,Qt=`--removed-body-scroll-bar-size`;function $t(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function en(e,t){var n=(0,_.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var tn=typeof window<`u`?_.useLayoutEffect:_.useEffect,nn=new WeakMap;function rn(e,t){var n=en(t||null,function(t){return e.forEach(function(e){return $t(e,t)})});return tn(function(){var t=nn.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||$t(e,null)}),i.forEach(function(e){r.has(e)||$t(e,a)})}nn.set(n,e)},[e]),n}function an(e){return e}function on(e,t){t===void 0&&(t=an);var n=[],r=!1;return{read:function(){if(r)throw Error(\"Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.\");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function sn(e){e===void 0&&(e={});var t=on(null);return t.options=Kt({async:!0,ssr:!1},e),t}var cn=function(e){var t=e.sideCar,n=qt(e,[`sideCar`]);if(!t)throw Error(\"Sidecar: please provide `sideCar` property to import the right car\");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return _.createElement(r,Kt({},n))};cn.isSideCarExport=!0;function ln(e,t){return e.useMedium(t),cn}var un=sn(),dn=function(){},fn=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:dn,onWheelCapture:dn,onTouchMoveCapture:dn}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=qt(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),ee=f,S=rn([n,t]),C=Kt(Kt({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(ee,{sideCar:un,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),Kt(Kt({},C),{ref:S})):_.createElement(y,Kt({},C,{className:c,ref:S}),s))});fn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},fn.classNames={fullWidth:Xt,zeroRight:Yt};var pn,mn=function(){if(pn)return pn;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function hn(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=mn();return t&&e.setAttribute(`nonce`,t),e}function gn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function _n(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var vn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=hn())&&(gn(t,n),_n(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},yn=function(){var e=vn();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},bn=function(){var e=yn();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},xn={left:0,top:0,right:0,gap:0},Sn=function(e){return parseInt(e||``,10)||0},Cn=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Sn(n),Sn(r),Sn(i)]},wn=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return xn;var t=Cn(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Tn=bn(),En=`data-scroll-locked`,Dn=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`\n .${Zt} {\n overflow: hidden ${r};\n padding-right: ${s}px ${r};\n }\n body[${En}] {\n overflow: hidden ${r};\n overscroll-behavior: contain;\n ${[t&&`position: relative ${r};`,n===`margin`&&`\n padding-left: ${i}px;\n padding-top: ${a}px;\n padding-right: ${o}px;\n margin-left:0;\n margin-top:0;\n margin-right: ${s}px ${r};\n `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}\n }\n \n .${Yt} {\n right: ${s}px ${r};\n }\n \n .${Xt} {\n margin-right: ${s}px ${r};\n }\n \n .${Yt} .${Yt} {\n right: 0 ${r};\n }\n \n .${Xt} .${Xt} {\n margin-right: 0 ${r};\n }\n \n body[${En}] {\n ${Qt}: ${s}px;\n }\n`},On=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},kn=function(){_.useEffect(function(){return document.body.setAttribute(En,(On()+1).toString()),function(){var e=On()-1;e<=0?document.body.removeAttribute(En):document.body.setAttribute(En,e.toString())}},[])},An=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;kn();var a=_.useMemo(function(){return wn(i)},[i]);return _.createElement(Tn,{styles:Dn(a,!t,i,n?``:`!important`)})},jn=!1;if(typeof window<`u`)try{var Mn=Object.defineProperty({},\"passive\",{get:function(){return jn=!0,!0}});window.addEventListener(`test`,Mn,Mn),window.removeEventListener(`test`,Mn,Mn)}catch{jn=!1}var Nn=jn?{passive:!1}:!1,Pn=function(e){return e.tagName===`TEXTAREA`},Fn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Pn(e)&&n[t]===`visible`)},In=function(e){return Fn(e,`overflowY`)},Ln=function(e){return Fn(e,`overflowX`)},Rn=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Vn(e,r)){var i=Hn(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},zn=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Bn=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Vn=function(e,t){return e===`v`?In(t):Ln(t)},Hn=function(e,t){return e===`v`?zn(t):Bn(t)},Un=function(e,t){return e===`h`&&t===`rtl`?-1:1},Wn=function(e,t,n,r,i){var a=Un(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Hn(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Vn(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Gn=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Kn=function(e){return[e.deltaX,e.deltaY]},qn=function(e){return e&&`current`in e?e.current:e},Jn=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Yn=function(e){return`\n .block-interactivity-${e} {pointer-events: none;}\n .allow-interactivity-${e} {pointer-events: all;}\n`},Xn=0,Zn=[];function Qn(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Xn++)[0],a=_.useState(bn)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Jt([e.lockRef.current],(e.shards||[]).map(qn),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Gn(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Rn(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Rn(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Wn(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(!(!Zn.length||Zn[Zn.length-1]!==a)){var r=`deltaY`in n?Kn(n):Gn(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Jn(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(qn).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:$n(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=Gn(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,Kn(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,Gn(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return Zn.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Nn),document.addEventListener(`touchmove`,c,Nn),document.addEventListener(`touchstart`,u,Nn),function(){Zn=Zn.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Nn),document.removeEventListener(`touchmove`,c,Nn),document.removeEventListener(`touchstart`,u,Nn)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:Yn(i)}):null,p?_.createElement(An,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function $n(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var er=ln(un,Qn),tr=_.forwardRef(function(e,t){return _.createElement(fn,Kt({},e,{ref:t,sideCar:er}))});tr.classNames=fn.classNames;var nr=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},rr=new WeakMap,ir=new WeakMap,ar={},or=0,sr=function(e){return e&&(e.host||sr(e.parentNode))},cr=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=sr(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},lr=function(e,t,n,r){var i=cr(t,Array.isArray(e)?e:[e]);ar[n]||(ar[n]=new WeakMap);var a=ar[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(rr.get(e)||0)+1,l=(a.get(e)||0)+1;rr.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ir.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),or++,function(){o.forEach(function(e){var t=rr.get(e)-1,i=a.get(e)-1;rr.set(e,t),a.set(e,i),t||(ir.has(e)||e.removeAttribute(r),ir.delete(e)),i||e.removeAttribute(n)}),or--,or||(rr=new WeakMap,rr=new WeakMap,ir=new WeakMap,ar={})}},ur=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||nr(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),lr(r,i,n,`aria-hidden`)):function(){return null}},dr=`Dialog`,[fr,pr]=ke(dr),[mr,hr]=fr(dr),gr=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),[l,u]=ze({prop:r,defaultProp:i??!1,onChange:a,caller:dr});return(0,j.jsx)(mr,{scope:t,triggerRef:s,contentRef:c,contentId:Pe(),titleId:Pe(),descriptionId:Pe(),open:l,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};gr.displayName=dr;var _r=`DialogTrigger`,vr=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=hr(_r,n),a=De(t,i.triggerRef);return(0,j.jsx)(tt.button,{type:`button`,\"aria-haspopup\":`dialog`,\"aria-expanded\":i.open,\"aria-controls\":i.open?i.contentId:void 0,\"data-state\":Rr(i.open),...r,ref:a,onClick:we(e.onClick,i.onOpenToggle)})});vr.displayName=_r;var yr=`DialogPortal`,[br,xr]=fr(yr,{forceMount:void 0}),Sr=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=hr(yr,t);return(0,j.jsx)(br,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,j.jsx)(It,{present:n||a.open,children:(0,j.jsx)(Pt,{asChild:!0,container:i,children:e})}))})};Sr.displayName=yr;var Cr=`DialogOverlay`,wr=_.forwardRef((e,t)=>{let n=xr(Cr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=hr(Cr,e.__scopeDialog);return a.modal?(0,j.jsx)(It,{present:r||a.open,children:(0,j.jsx)(Er,{...i,ref:t})}):null});wr.displayName=Cr;var Tr=Ue(`DialogOverlay.RemoveScroll`),Er=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=hr(Cr,n),a=De(t,pt());return(0,j.jsx)(tr,{as:Tr,allowPinchZoom:!0,shards:[i.contentRef],children:(0,j.jsx)(tt.div,{\"data-state\":Rr(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})}),Dr=`DialogContent`,Or=_.forwardRef((e,t)=>{let n=xr(Dr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=hr(Dr,e.__scopeDialog);return(0,j.jsx)(It,{present:r||a.open,children:a.modal?(0,j.jsx)(kr,{...i,ref:t}):(0,j.jsx)(Ar,{...i,ref:t})})});Or.displayName=Dr;var kr=_.forwardRef((e,t)=>{let n=hr(Dr,e.__scopeDialog),r=_.useRef(null),i=De(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return ur(e)},[]),(0,j.jsx)(jr,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:we(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:we(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:we(e.onFocusOutside,e=>e.preventDefault())})}),Ar=_.forwardRef((e,t)=>{let n=hr(Dr,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,j.jsx)(jr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),jr=_.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=hr(Dr,n);return Wt(),(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(St,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,j.jsx)(ut,{role:`dialog`,id:s.contentId,\"aria-describedby\":s.descriptionId,\"aria-labelledby\":s.titleId,\"data-state\":Rr(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),Mr=`DialogTitle`,Nr=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=hr(Mr,n);return(0,j.jsx)(tt.h2,{id:i.titleId,...r,ref:t})});Nr.displayName=Mr;var Pr=`DialogDescription`,Fr=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=hr(Pr,n);return(0,j.jsx)(tt.p,{id:i.descriptionId,...r,ref:t})});Fr.displayName=Pr;var Ir=`DialogClose`,Lr=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=hr(Ir,n);return(0,j.jsx)(tt.button,{type:`button`,...r,ref:t,onClick:we(e.onClick,()=>i.onOpenChange(!1))})});Lr.displayName=Ir;function Rr(e){return e?`open`:`closed`}function zr(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=zr(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Br(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=zr(e))&&(r&&(r+=` `),r+=t);return r}function N({variant:e=`default`,size:t=`sm`,className:n,...r}){return(0,j.jsx)(`button`,{className:Br(`inline-flex items-center justify-center gap-1.5 rounded-md transition-colors disabled:opacity-50 disabled:pointer-events-none`,t===`sm`?`h-8 px-3 text-[13px]`:`h-6 px-2 text-xs`,{default:`bg-emerald-600 text-white hover:bg-emerald-500 font-medium`,outline:`border border-neutral-700 text-neutral-200 hover:bg-neutral-800 hover:border-neutral-600`,ghost:`text-neutral-300 hover:bg-neutral-800`,danger:`border border-red-900/60 text-red-400 hover:bg-red-950/40`}[e],n),...r})}function Vr({className:e,...t}){return(0,j.jsx)(`input`,{className:Br(`h-8 w-full rounded-md border border-neutral-700 bg-neutral-900 px-2.5 text-[13px] text-neutral-100`,`placeholder:text-neutral-600 focus:border-brand focus:outline-none`,e),...t})}function Hr({className:e,...t}){return(0,j.jsx)(`textarea`,{className:Br(`w-full rounded-md border border-neutral-700 bg-neutral-900 p-3 font-mono text-[13px] text-neutral-100`,`placeholder:text-neutral-600 focus:border-brand focus:outline-none`,e),...t})}function Ur({children:e}){return(0,j.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-neutral-400`,children:e})}function Wr({open:e,onClose:t,title:n,children:r,wide:i}){return(0,j.jsx)(gr,{open:e,onOpenChange:e=>!e&&t(),children:(0,j.jsxs)(Sr,{children:[(0,j.jsx)(wr,{className:`fixed inset-0 z-50 bg-black/60 backdrop-blur-sm`}),(0,j.jsxs)(Or,{className:Br(`fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2 rounded-lg border border-neutral-700 bg-neutral-850 bg-[#1f1f1f] shadow-2xl`,`max-h-[85vh] overflow-auto`,i?`w-[640px]`:`w-[440px]`),children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b border-neutral-800 px-4 py-3`,children:[(0,j.jsx)(Nr,{className:`text-sm font-semibold`,children:n}),(0,j.jsx)(Lr,{className:`text-neutral-500 hover:text-neutral-200`,children:(0,j.jsx)(ve,{size:16})})]}),(0,j.jsx)(`div`,{className:`p-4`,children:r})]})]})})}function Gr(){return(0,j.jsx)(`div`,{className:`flex items-center justify-center py-16 text-neutral-500`,children:(0,j.jsx)(`div`,{className:`size-5 animate-spin rounded-full border-2 border-neutral-700 border-t-brand`})})}function Kr({children:e}){return(0,j.jsx)(`div`,{className:`py-16 text-center text-[13px] text-neutral-500`,children:e})}var qr=50;function Jr(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)(0),[c,l]=(0,_.useState)(0),[u,d]=(0,_.useState)(!0),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(``),y=e.find(e=>e.name===n)||null,b=(0,_.useCallback)(async()=>{let e=await A.tables();t(e),r(t=>t??e[0]?.name??null)},[]);(0,_.useEffect)(()=>{b().finally(()=>d(!1))},[b]);let x=(0,_.useCallback)(async()=>{if(!n||!y)return;let e=y.primaryKey[0]?`${y.primaryKey[0]}.asc`:void 0,{rows:t,total:r}=await A.rows(n,{limit:qr,offset:c*qr,order:e});a(t),s(r)},[n,c,y]);(0,_.useEffect)(()=>{x()},[x]);function ee(e){let t={};for(let n of y.primaryKey)t[n]=e[n];return t}async function S(e){if(!y?.primaryKey.length)return alert(`Cannot delete: table has no primary key`);if(confirm(`Delete this row?`))try{await A.deleteRow(n,ee(e)),await x(),await b()}catch(e){alert(e.message)}}return u?(0,j.jsx)(Gr,{}):(0,j.jsxs)(`div`,{className:`flex h-full`,children:[(0,j.jsxs)(`div`,{className:`flex w-60 shrink-0 flex-col border-r border-neutral-800 bg-[#191919]`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2.5 text-xs font-semibold uppercase tracking-wide text-neutral-500`,children:[`Tables `,(0,j.jsx)(`span`,{className:`text-neutral-600`,children:e.length})]}),(0,j.jsxs)(`div`,{className:`flex-1 overflow-auto`,children:[e.map(e=>(0,j.jsxs)(`button`,{onClick:()=>{r(e.name),l(0)},className:`flex w-full items-center justify-between px-3 py-1.5 text-left text-[13px] `+(n===e.name?`bg-neutral-800 text-neutral-100`:`text-neutral-400 hover:bg-neutral-850 hover:bg-neutral-800/50`),children:[(0,j.jsx)(`span`,{className:`truncate font-mono`,children:e.name}),(0,j.jsx)(`span`,{className:`text-[11px] text-neutral-600`,children:e.rowCount})]},e.name)),e.length===0&&(0,j.jsx)(Kr,{children:`No tables. Create one in the SQL Editor.`})]})]}),(0,j.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:y?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-neutral-800 px-4 py-2.5`,children:[(0,j.jsx)(`span`,{className:`font-mono text-sm`,children:y.name}),(0,j.jsxs)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[11px] text-neutral-400`,children:[o,` rows`]}),(0,j.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,j.jsx)(N,{variant:`ghost`,size:`xs`,onClick:()=>void x(),children:(0,j.jsx)(fe,{size:13})}),(0,j.jsxs)(N,{size:`xs`,onClick:()=>h(!0),children:[(0,j.jsx)(de,{size:13}),` Insert`]})]})]}),(0,j.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[(0,j.jsxs)(`table`,{className:`w-full border-collapse text-[13px]`,children:[(0,j.jsx)(`thead`,{className:`sticky top-0 z-10 bg-[#1c1c1c]`,children:(0,j.jsxs)(`tr`,{className:`border-b border-neutral-800`,children:[(0,j.jsx)(`th`,{className:`w-16 px-2 py-1.5`}),y.columns.map(e=>(0,j.jsxs)(`th`,{className:`whitespace-nowrap px-3 py-1.5 text-left font-medium text-neutral-400`,children:[(0,j.jsx)(`span`,{className:`font-mono text-neutral-200`,children:e.name}),e.isPrimaryKey&&(0,j.jsx)(`span`,{className:`ml-1 text-[10px] text-brand`,children:`PK`}),(0,j.jsx)(`span`,{className:`ml-1.5 text-[11px] font-normal text-neutral-600`,children:e.type})]},e.name))]})}),(0,j.jsx)(`tbody`,{children:i.map((e,t)=>(0,j.jsxs)(`tr`,{className:`group border-b border-neutral-850 border-neutral-800/60 hover:bg-neutral-800/30`,children:[(0,j.jsx)(`td`,{className:`px-2`,children:(0,j.jsxs)(`div`,{className:`flex gap-0.5 opacity-0 group-hover:opacity-100`,children:[(0,j.jsx)(`button`,{className:`p-1 text-neutral-500 hover:text-brand`,onClick:()=>p(e),children:(0,j.jsx)(T,{size:13})}),(0,j.jsx)(`button`,{className:`p-1 text-neutral-500 hover:text-red-400`,onClick:()=>S(e),children:(0,j.jsx)(ge,{size:13})})]})}),y.columns.map(t=>(0,j.jsx)(`td`,{className:`max-w-[320px] truncate px-3 py-1.5 font-mono text-neutral-300`,children:(0,j.jsx)(Yr,{value:e[t.name]})},t.name))]},t))})]}),i.length===0&&(0,j.jsx)(Kr,{children:`No rows yet.`})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-neutral-800 px-4 py-2 text-xs text-neutral-500`,children:[(0,j.jsx)(N,{variant:`ghost`,size:`xs`,disabled:c===0,onClick:()=>l(e=>e-1),children:(0,j.jsx)(ie,{size:13})}),(0,j.jsxs)(`span`,{children:[o===0?0:c*qr+1,`\u2013`,Math.min((c+1)*qr,o),` of `,o]}),(0,j.jsx)(N,{variant:`ghost`,size:`xs`,disabled:(c+1)*qr>=o,onClick:()=>l(e=>e+1),children:(0,j.jsx)(ae,{size:13})})]})]}):(0,j.jsx)(Kr,{children:`Select a table.`})}),f&&y&&(0,j.jsx)(Xr,{table:y,initial:f,onClose:()=>p(null),onSave:async e=>{await A.updateRow(n,ee(f),e),p(null),await x()}}),m&&y&&(0,j.jsx)(Xr,{table:y,initial:{},isNew:!0,onClose:()=>h(!1),onSave:async e=>{await A.insertRow(n,e),h(!1),await x(),await b()}}),g&&(0,j.jsx)(`p`,{className:`text-red-400`,children:g})]})}function Yr({value:e}){return e==null?(0,j.jsx)(`span`,{className:`text-neutral-600`,children:`NULL`}):typeof e==`boolean`?(0,j.jsx)(`span`,{className:`text-blue-400`,children:String(e)}):typeof e==`object`?(0,j.jsx)(`span`,{className:`text-amber-300/80`,children:JSON.stringify(e)}):(0,j.jsx)(j.Fragment,{children:String(e)})}function Xr({table:e,initial:t,isNew:n,onClose:r,onSave:i}){let a=e.columns.filter(e=>!(n&&e.isPrimaryKey&&e.hasDefault)),[o,s]=(0,_.useState)(()=>{let e={};for(let n of a){let r=t[n.name];e[n.name]=r==null?``:typeof r==`object`?JSON.stringify(r):String(r)}return e}),[c,l]=(0,_.useState)({}),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(!1);async function m(){p(!0),d(``);let e={};for(let t of a){if(!n&&!c[t.name])continue;let r=o[t.name];if(r===``&&(t.nullable||t.hasDefault)){n||(e[t.name]=null);continue}e[t.name]=Zr(r,t.type)}try{await i(e)}catch(e){d(e.message),p(!1)}}return(0,j.jsx)(Wr,{open:!0,onClose:r,title:n?`Insert into ${e.name}`:`Edit row in ${e.name}`,wide:!0,children:(0,j.jsxs)(`div`,{className:`space-y-3`,children:[a.map(e=>(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(Ur,{children:[e.name,(0,j.jsxs)(`span`,{className:`ml-1.5 font-normal text-neutral-600`,children:[e.type,e.isPrimaryKey?` \u00B7 PK`:``,!e.nullable&&!e.hasDefault?` \u00B7 required`:``]})]}),(0,j.jsx)(Vr,{value:o[e.name]??``,placeholder:e.hasDefault?`default`:e.nullable?`NULL`:``,onChange:t=>{s(n=>({...n,[e.name]:t.target.value})),l(t=>({...t,[e.name]:!0}))}})]},e.name)),u&&(0,j.jsx)(`p`,{className:`text-xs text-red-400`,children:u}),(0,j.jsxs)(`div`,{className:`flex justify-end gap-2 pt-1`,children:[(0,j.jsx)(N,{variant:`outline`,onClick:r,children:`Cancel`}),(0,j.jsx)(N,{onClick:m,disabled:f,children:f?`Saving\u2026`:n?`Insert`:`Save`})]})]})})}function Zr(e,t){if(t===`bool`)return e===`true`||e===`t`||e===`1`;if([`int2`,`int4`,`int8`,`float4`,`float8`,`numeric`].includes(t)){let t=Number(e);return Number.isNaN(t)?e:t}if(t===`json`||t===`jsonb`)try{return JSON.parse(e)}catch{return e}if(t.startsWith(`_`))try{return JSON.parse(e)}catch{return e}return e}function Qr(){let[e,t]=(0,_.useState)(`select * from `),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(!1);async function o(){a(!0),r(await A.sql(e)),a(!1)}let s=n?.rows?.[0]?Object.keys(n.rows[0]):[];return(0,j.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,j.jsxs)(`div`,{className:`border-b border-neutral-800 p-3`,children:[(0,j.jsx)(Hr,{className:`h-40`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&o(),spellCheck:!1,placeholder:`select * from \u2026 (\u2318\u23CE to run)`}),(0,j.jsxs)(`div`,{className:`mt-2 flex items-center gap-3`,children:[(0,j.jsxs)(N,{onClick:o,disabled:i,children:[(0,j.jsx)(E,{size:13}),` Run`]}),(0,j.jsx)(`span`,{className:`text-xs text-neutral-500`,children:`\u2318\u23CE`}),n&&(0,j.jsx)(`span`,{className:`ml-auto text-xs text-neutral-500`,children:n.ok?`${n.rowCount} rows \u00B7 ${n.ms} ms${n.affectedRows==null?``:` \u00B7 ${n.affectedRows} affected`}`:``})]})]}),(0,j.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[!n&&(0,j.jsx)(Kr,{children:`Run a query to see results.`}),n&&!n.ok&&(0,j.jsxs)(`div`,{className:`m-4 rounded-md border border-red-900/50 bg-red-950/30 p-3 text-[13px] text-red-300`,children:[(0,j.jsx)(`div`,{className:`font-mono`,children:n.error}),n.code&&(0,j.jsxs)(`div`,{className:`mt-1 text-xs text-red-400/70`,children:[`SQLSTATE `,n.code]}),n.hint&&(0,j.jsxs)(`div`,{className:`mt-1 text-xs text-neutral-400`,children:[`Hint: `,n.hint]})]}),n?.ok&&s.length>0&&(0,j.jsxs)(`table`,{className:`w-full border-collapse text-[13px]`,children:[(0,j.jsx)(`thead`,{className:`sticky top-0 bg-[#1c1c1c]`,children:(0,j.jsx)(`tr`,{className:`border-b border-neutral-800`,children:s.map(e=>(0,j.jsx)(`th`,{className:`whitespace-nowrap px-3 py-1.5 text-left font-mono font-medium text-neutral-300`,children:e},e))})}),(0,j.jsx)(`tbody`,{children:n.rows.map((e,t)=>(0,j.jsx)(`tr`,{className:`border-b border-neutral-800/60 hover:bg-neutral-800/30`,children:s.map(t=>(0,j.jsx)(`td`,{className:`max-w-[360px] truncate px-3 py-1.5 font-mono text-neutral-300`,children:$r(e[t])},t))},t))})]}),n?.ok&&s.length===0&&(0,j.jsxs)(Kr,{children:[`Statement executed`,n.affectedRows==null?``:` \u00B7 ${n.affectedRows} rows affected`,`.`]})]})]})}function $r(e){return e==null?(0,j.jsx)(`span`,{className:`text-neutral-600`,children:`NULL`}):typeof e==`object`?JSON.stringify(e):String(e)}function ei(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(!0),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(null);async function c(){t(await A.users())}(0,_.useEffect)(()=>{c().finally(()=>r(!1))},[]);async function l(e){confirm(`Delete ${e.email||e.id}?`)&&(await A.deleteUser(e.id),await c())}return n?(0,j.jsx)(Gr,{}):(0,j.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-neutral-800 px-4 py-2.5`,children:[(0,j.jsx)(`span`,{className:`text-sm font-semibold`,children:`Users`}),(0,j.jsx)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[11px] text-neutral-400`,children:e.length}),(0,j.jsxs)(N,{size:`xs`,className:`ml-auto`,onClick:()=>a(!0),children:[(0,j.jsx)(de,{size:13}),` Add user`]})]}),(0,j.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[(0,j.jsxs)(`table`,{className:`w-full border-collapse text-[13px]`,children:[(0,j.jsx)(`thead`,{className:`sticky top-0 bg-[#1c1c1c]`,children:(0,j.jsxs)(`tr`,{className:`border-b border-neutral-800 text-left text-neutral-400`,children:[(0,j.jsx)(`th`,{className:`px-4 py-1.5 font-medium`,children:`Email`}),(0,j.jsx)(`th`,{className:`px-3 py-1.5 font-medium`,children:`UID`}),(0,j.jsx)(`th`,{className:`px-3 py-1.5 font-medium`,children:`Provider`}),(0,j.jsx)(`th`,{className:`px-3 py-1.5 font-medium`,children:`Created`}),(0,j.jsx)(`th`,{className:`px-3 py-1.5 font-medium`,children:`Last sign in`}),(0,j.jsx)(`th`,{className:`w-20`})]})}),(0,j.jsx)(`tbody`,{children:e.map(e=>(0,j.jsxs)(`tr`,{className:`group border-b border-neutral-800/60 hover:bg-neutral-800/30`,children:[(0,j.jsx)(`td`,{className:`px-4 py-1.5`,children:e.email||(0,j.jsx)(`span`,{className:`text-neutral-500`,children:e.is_anonymous?`anonymous`:`\u2014`})}),(0,j.jsxs)(`td`,{className:`px-3 py-1.5 font-mono text-[11px] text-neutral-500`,children:[e.id.slice(0,8),`\u2026`]}),(0,j.jsx)(`td`,{className:`px-3 py-1.5 text-neutral-400`,children:e.app_metadata?.provider||`\u2014`}),(0,j.jsx)(`td`,{className:`px-3 py-1.5 text-neutral-400`,children:(e.created_at||``).slice(0,10)}),(0,j.jsx)(`td`,{className:`px-3 py-1.5 text-neutral-400`,children:(e.last_sign_in_at||``).slice(0,16).replace(`T`,` `)}),(0,j.jsx)(`td`,{className:`px-3`,children:(0,j.jsxs)(`div`,{className:`flex gap-0.5 opacity-0 group-hover:opacity-100`,children:[(0,j.jsx)(`button`,{className:`p-1 text-neutral-500 hover:text-brand`,title:`Reset password`,onClick:()=>s(e),children:(0,j.jsx)(ue,{size:13})}),(0,j.jsx)(`button`,{className:`p-1 text-neutral-500 hover:text-red-400`,onClick:()=>l(e),children:(0,j.jsx)(ge,{size:13})})]})})]},e.id))})]}),e.length===0&&(0,j.jsx)(Kr,{children:`No users yet.`})]}),i&&(0,j.jsx)(ti,{onClose:()=>a(!1),onDone:async()=>{a(!1),await c()}}),o&&(0,j.jsx)(ni,{user:o,onClose:()=>s(null),onDone:async()=>{s(null),await c()}})]})}function ti({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(!1);async function u(){l(!0),s(``);try{await A.createUser({email:n,password:i||void 0,email_confirm:!0}),t()}catch(e){s(e.message),l(!1)}}return(0,j.jsx)(Wr,{open:!0,onClose:e,title:`Add user`,children:(0,j.jsxs)(`div`,{className:`space-y-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(Ur,{children:`Email`}),(0,j.jsx)(Vr,{value:n,onChange:e=>r(e.target.value),placeholder:`user@example.com`})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(Ur,{children:`Password (optional)`}),(0,j.jsx)(Vr,{type:`password`,value:i,onChange:e=>a(e.target.value)})]}),o&&(0,j.jsx)(`p`,{className:`text-xs text-red-400`,children:o}),(0,j.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,j.jsx)(N,{variant:`outline`,onClick:e,children:`Cancel`}),(0,j.jsx)(N,{onClick:u,disabled:c||!n,children:c?`Creating\u2026`:`Create`})]})]})})}function ni({user:e,onClose:t,onDone:n}){let[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(!1);async function l(){c(!0),o(``);try{await A.updateUser(e.id,{password:r}),n()}catch(e){o(e.message),c(!1)}}return(0,j.jsx)(Wr,{open:!0,onClose:t,title:`Reset password \u00B7 ${e.email||e.id}`,children:(0,j.jsxs)(`div`,{className:`space-y-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(Ur,{children:`New password`}),(0,j.jsx)(Vr,{type:`password`,value:r,onChange:e=>i(e.target.value)})]}),a&&(0,j.jsx)(`p`,{className:`text-xs text-red-400`,children:a}),(0,j.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,j.jsx)(N,{variant:`outline`,onClick:t,children:`Cancel`}),(0,j.jsx)(N,{onClick:l,disabled:s||r.length<6,children:s?`Saving\u2026`:`Update`})]})]})})}function ri(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)(!0),[c,l]=(0,_.useState)(!1),u=(0,_.useRef)(null);async function d(){let e=await A.buckets();t(e),r(t=>t??e[0]?.id??null)}async function f(e){a(await A.listObjects(e))}(0,_.useEffect)(()=>{d().finally(()=>s(!1))},[]),(0,_.useEffect)(()=>{n&&f(n)},[n]);async function p(e){n&&(await A.uploadObject(n,e.name,e),await f(n))}async function m(e){!n||!confirm(`Delete ${e}?`)||(await A.removeObject(n,e),await f(n))}async function h(e){if(confirm(`Delete bucket \"${e}\"? It must be empty.`))try{await A.deleteBucket(e),r(null),await d()}catch(e){alert(e.message)}}return o?(0,j.jsx)(Gr,{}):(0,j.jsxs)(`div`,{className:`flex h-full`,children:[(0,j.jsxs)(`div`,{className:`flex w-60 shrink-0 flex-col border-r border-neutral-800 bg-[#191919]`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2.5 text-xs font-semibold uppercase tracking-wide text-neutral-500`,children:[`Buckets`,(0,j.jsx)(`button`,{className:`text-neutral-400 hover:text-brand`,onClick:()=>l(!0),children:(0,j.jsx)(de,{size:14})})]}),(0,j.jsxs)(`div`,{className:`flex-1 overflow-auto`,children:[e.map(e=>(0,j.jsxs)(`button`,{onClick:()=>r(e.id),className:`group flex w-full items-center justify-between px-3 py-1.5 text-left text-[13px] `+(n===e.id?`bg-neutral-800 text-neutral-100`:`text-neutral-400 hover:bg-neutral-800/50`),children:[(0,j.jsxs)(`span`,{className:`truncate`,children:[e.id,e.public&&(0,j.jsx)(`span`,{className:`ml-1.5 text-[10px] text-brand`,children:`public`})]}),(0,j.jsx)(ge,{size:13,className:`opacity-0 hover:text-red-400 group-hover:opacity-100`,onClick:t=>{t.stopPropagation(),h(e.id)}})]},e.id)),e.length===0&&(0,j.jsx)(Kr,{children:`No buckets.`})]})]}),(0,j.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:n?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-neutral-800 px-4 py-2.5`,children:[(0,j.jsx)(`span`,{className:`font-mono text-sm`,children:n}),(0,j.jsx)(`input`,{ref:u,type:`file`,className:`hidden`,onChange:e=>e.target.files?.[0]&&p(e.target.files[0])}),(0,j.jsxs)(N,{size:`xs`,className:`ml-auto`,onClick:()=>u.current?.click(),children:[(0,j.jsx)(_e,{size:13}),` Upload`]})]}),(0,j.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:[i.map(e=>(0,j.jsxs)(`div`,{className:`group flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] hover:bg-neutral-800/40`,children:[(0,j.jsx)(se,{size:14,className:`text-neutral-500`}),(0,j.jsx)(`span`,{className:`font-mono`,children:e.name}),e.metadata?.size!=null&&(0,j.jsx)(`span`,{className:`text-[11px] text-neutral-500`,children:ai(e.metadata.size)}),(0,j.jsx)(`button`,{className:`ml-auto p-1 text-neutral-500 opacity-0 hover:text-red-400 group-hover:opacity-100`,onClick:()=>m(e.name),children:(0,j.jsx)(ge,{size:13})})]},e.name)),i.length===0&&(0,j.jsx)(Kr,{children:`Empty bucket. Upload a file.`})]})]}):(0,j.jsx)(Kr,{children:`Select or create a bucket.`})}),c&&(0,j.jsx)(ii,{onClose:()=>l(!1),onDone:async()=>{l(!1),await d()}})]})}function ii({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(!1);async function u(){l(!0),s(``);try{await A.createBucket({id:n,name:n,public:i}),t()}catch(e){s(e.message),l(!1)}}return(0,j.jsx)(Wr,{open:!0,onClose:e,title:`New bucket`,children:(0,j.jsxs)(`div`,{className:`space-y-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(Ur,{children:`Name`}),(0,j.jsx)(Vr,{value:n,onChange:e=>r(e.target.value),placeholder:`avatars`})]}),(0,j.jsxs)(`label`,{className:`flex items-center gap-2 text-[13px] text-neutral-300`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:i,onChange:e=>a(e.target.checked)}),`Public bucket (objects readable without auth)`]}),o&&(0,j.jsx)(`p`,{className:`text-xs text-red-400`,children:o}),(0,j.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,j.jsx)(N,{variant:`outline`,onClick:e,children:`Cancel`}),(0,j.jsx)(N,{onClick:u,disabled:c||!n,children:c?`Creating\u2026`:`Create`})]})]})})}function ai(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function oi(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)(!0);return(0,_.useEffect)(()=>{Promise.all([A.stats(),A.migrations(),A.functions(),A.triggers()]).then(([e,n,i,o])=>{t(e),r(n),a(i),s(o)}).finally(()=>l(!1))},[]),c?(0,j.jsx)(Gr,{}):(0,j.jsxs)(`div`,{className:`h-full overflow-auto p-6`,children:[(0,j.jsx)(`h1`,{className:`text-sm font-semibold text-neutral-300`,children:`Database`}),e&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`p`,{className:`mt-1 font-mono text-xs text-neutral-500`,children:e.version}),(0,j.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-6`,children:[(0,j.jsx)(si,{label:`Tables`,value:e.tables}),(0,j.jsx)(si,{label:`Users`,value:e.users}),(0,j.jsx)(si,{label:`Buckets`,value:e.buckets}),(0,j.jsx)(si,{label:`Objects`,value:e.objects}),(0,j.jsx)(si,{label:`Migrations`,value:e.migrations}),(0,j.jsx)(si,{label:`DB size`,value:e.dbSize})]})]}),(0,j.jsx)(`h2`,{className:`mb-2 mt-8 text-xs font-semibold uppercase tracking-wide text-neutral-500`,children:`Migrations`}),(0,j.jsxs)(`div`,{className:`overflow-hidden rounded-md border border-neutral-800`,children:[(0,j.jsxs)(`table`,{className:`w-full border-collapse text-[13px]`,children:[(0,j.jsx)(`thead`,{className:`bg-[#191919]`,children:(0,j.jsxs)(`tr`,{className:`border-b border-neutral-800 text-left text-neutral-400`,children:[(0,j.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Version`}),(0,j.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,j.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Applied`})]})}),(0,j.jsx)(`tbody`,{children:n.map(e=>(0,j.jsxs)(`tr`,{className:`border-b border-neutral-800/60`,children:[(0,j.jsx)(`td`,{className:`px-4 py-1.5 font-mono text-neutral-400`,children:e.version}),(0,j.jsx)(`td`,{className:`px-4 py-1.5 font-mono`,children:e.name||`\u2014`}),(0,j.jsx)(`td`,{className:`px-4 py-1.5 text-neutral-400`,children:(e.applied_at||``).slice(0,19).replace(`T`,` `)})]},e.version))})]}),n.length===0&&(0,j.jsx)(Kr,{children:`No migrations applied.`})]}),(0,j.jsx)(`h2`,{className:`mb-2 mt-8 text-xs font-semibold uppercase tracking-wide text-neutral-500`,children:`Functions`}),(0,j.jsxs)(`div`,{className:`overflow-hidden rounded-md border border-neutral-800`,children:[(0,j.jsxs)(`table`,{className:`w-full border-collapse text-[13px]`,children:[(0,j.jsx)(`thead`,{className:`bg-[#191919]`,children:(0,j.jsxs)(`tr`,{className:`border-b border-neutral-800 text-left text-neutral-400`,children:[(0,j.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,j.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Arguments`}),(0,j.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Returns`}),(0,j.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Language`})]})}),(0,j.jsx)(`tbody`,{children:i.map(e=>(0,j.jsxs)(`tr`,{className:`border-b border-neutral-800/60`,children:[(0,j.jsx)(`td`,{className:`px-4 py-1.5 font-mono text-neutral-200`,children:e.name}),(0,j.jsx)(`td`,{className:`max-w-[280px] truncate px-4 py-1.5 font-mono text-[11px] text-neutral-500`,children:e.args||`\u2014`}),(0,j.jsx)(`td`,{className:`px-4 py-1.5 font-mono text-neutral-400`,children:e.returns}),(0,j.jsx)(`td`,{className:`px-4 py-1.5 text-neutral-400`,children:e.language})]},e.name))})]}),i.length===0&&(0,j.jsx)(Kr,{children:`No user functions.`})]}),(0,j.jsx)(`h2`,{className:`mb-2 mt-8 text-xs font-semibold uppercase tracking-wide text-neutral-500`,children:`Triggers`}),(0,j.jsxs)(`div`,{className:`overflow-hidden rounded-md border border-neutral-800`,children:[(0,j.jsxs)(`table`,{className:`w-full border-collapse text-[13px]`,children:[(0,j.jsx)(`thead`,{className:`bg-[#191919]`,children:(0,j.jsxs)(`tr`,{className:`border-b border-neutral-800 text-left text-neutral-400`,children:[(0,j.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,j.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Table`}),(0,j.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Timing`}),(0,j.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Events`}),(0,j.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Function`})]})}),(0,j.jsx)(`tbody`,{children:o.map(e=>(0,j.jsxs)(`tr`,{className:`border-b border-neutral-800/60`,children:[(0,j.jsx)(`td`,{className:`px-4 py-1.5 font-mono text-neutral-200`,children:e.name}),(0,j.jsx)(`td`,{className:`px-4 py-1.5 font-mono text-neutral-400`,children:e.table}),(0,j.jsx)(`td`,{className:`px-4 py-1.5 text-neutral-400`,children:e.timing}),(0,j.jsx)(`td`,{className:`px-4 py-1.5 text-neutral-400`,children:(e.events||[]).join(`, `)}),(0,j.jsx)(`td`,{className:`px-4 py-1.5 font-mono text-[11px] text-neutral-500`,children:e.function})]},e.table+e.name))})]}),o.length===0&&(0,j.jsx)(Kr,{children:`No triggers.`})]})]})}function si({label:e,value:t}){return(0,j.jsxs)(`div`,{className:`rounded-lg border border-neutral-800 bg-[#191919] p-3`,children:[(0,j.jsx)(`div`,{className:`text-lg font-semibold text-neutral-100`,children:t}),(0,j.jsx)(`div`,{className:`text-xs text-neutral-500`,children:e})]})}function ci(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(!0),[i,a]=(0,_.useState)(!1);async function o(){t(await A.policies())}(0,_.useEffect)(()=>{o().finally(()=>r(!1))},[]);async function s(e){confirm(`Drop policy \"${e.name}\" on ${e.table}?`)&&(await A.dropPolicy(e.table,e.name),await o())}if(n)return(0,j.jsx)(Gr,{});let c=new Map;for(let t of e)c.has(t.table)||c.set(t.table,[]),c.get(t.table).push(t);return(0,j.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-neutral-800 px-4 py-2.5`,children:[(0,j.jsx)(me,{size:15,className:`text-brand`}),(0,j.jsx)(`span`,{className:`text-sm font-semibold`,children:`RLS Policies`}),(0,j.jsx)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[11px] text-neutral-400`,children:e.length}),(0,j.jsxs)(N,{size:`xs`,className:`ml-auto`,onClick:()=>a(!0),children:[(0,j.jsx)(de,{size:13}),` New policy`]})]}),(0,j.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:[[...c].map(([e,t])=>(0,j.jsxs)(`div`,{className:`mb-5`,children:[(0,j.jsx)(`div`,{className:`mb-1.5 font-mono text-[13px] text-neutral-300`,children:e}),(0,j.jsx)(`div`,{className:`overflow-hidden rounded-md border border-neutral-800`,children:(0,j.jsxs)(`table`,{className:`w-full text-[13px]`,children:[(0,j.jsx)(`thead`,{className:`bg-[#191919] text-neutral-400`,children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{className:`px-3 py-1.5 text-left font-medium`,children:`Policy`}),(0,j.jsx)(`th`,{className:`px-3 py-1.5 text-left font-medium`,children:`Command`}),(0,j.jsx)(`th`,{className:`px-3 py-1.5 text-left font-medium`,children:`Roles`}),(0,j.jsx)(`th`,{className:`px-3 py-1.5 text-left font-medium`,children:`USING / CHECK`}),(0,j.jsx)(`th`,{className:`w-10`})]})}),(0,j.jsx)(`tbody`,{children:t.map(e=>(0,j.jsxs)(`tr`,{className:`group border-t border-neutral-800/60`,children:[(0,j.jsx)(`td`,{className:`px-3 py-1.5`,children:e.name}),(0,j.jsx)(`td`,{className:`px-3 py-1.5 text-neutral-400`,children:e.cmd}),(0,j.jsx)(`td`,{className:`px-3 py-1.5 font-mono text-[11px] text-neutral-500`,children:Array.isArray(e.roles)?e.roles.join(`, `):e.roles}),(0,j.jsx)(`td`,{className:`max-w-[360px] truncate px-3 py-1.5 font-mono text-[11px] text-amber-300/70`,children:[e.using_expr&&`USING ${e.using_expr}`,e.with_check&&`CHECK ${e.with_check}`].filter(Boolean).join(` \u00B7 `)}),(0,j.jsx)(`td`,{className:`px-2`,children:(0,j.jsx)(`button`,{className:`p-1 text-neutral-500 opacity-0 hover:text-red-400 group-hover:opacity-100`,onClick:()=>s(e),children:(0,j.jsx)(ge,{size:13})})})]},e.name))})]})})]},e)),e.length===0&&(0,j.jsx)(Kr,{children:`No policies. Create one, or enable RLS on a table first.`})]}),i&&(0,j.jsx)(li,{onClose:()=>a(!1),onDone:async()=>{a(!1),await o()}})]})}function li({onClose:e,onDone:t}){let[n,r]=(0,_.useState)({table:``,name:``,command:`ALL`,roles:`authenticated`,using:``,check:``}),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(!1),c=(e,t)=>r(n=>({...n,[e]:t}));async function l(){s(!0),a(``);try{let e=await A.createPolicy(n);if(e.error)throw Error(e.error+(e.hint?` (${e.hint})`:``));t()}catch(e){a(e.message),s(!1)}}return(0,j.jsx)(Wr,{open:!0,onClose:e,title:`New RLS policy`,wide:!0,children:(0,j.jsxs)(`div`,{className:`space-y-3`,children:[(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(Ur,{children:`Table`}),(0,j.jsx)(Vr,{value:n.table,onChange:e=>c(`table`,e.target.value),placeholder:`todos`})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(Ur,{children:`Policy name`}),(0,j.jsx)(Vr,{value:n.name,onChange:e=>c(`name`,e.target.value),placeholder:`own rows`})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(Ur,{children:`Command`}),(0,j.jsx)(`select`,{className:`h-8 w-full rounded-md border border-neutral-700 bg-neutral-900 px-2 text-[13px]`,value:n.command,onChange:e=>c(`command`,e.target.value),children:[`ALL`,`SELECT`,`INSERT`,`UPDATE`,`DELETE`].map(e=>(0,j.jsx)(`option`,{children:e},e))})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(Ur,{children:`Roles`}),(0,j.jsx)(Vr,{value:n.roles,onChange:e=>c(`roles`,e.target.value),placeholder:`authenticated`})]})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(Ur,{children:`USING expression (read/visibility)`}),(0,j.jsx)(Vr,{value:n.using,onChange:e=>c(`using`,e.target.value),placeholder:`user_id = auth.uid()`})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(Ur,{children:`WITH CHECK expression (writes)`}),(0,j.jsx)(Vr,{value:n.check,onChange:e=>c(`check`,e.target.value),placeholder:`user_id = auth.uid()`})]}),i&&(0,j.jsx)(`p`,{className:`text-xs text-red-400`,children:i}),(0,j.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,j.jsx)(N,{variant:`outline`,onClick:e,children:`Cancel`}),(0,j.jsx)(N,{onClick:l,disabled:o||!n.table||!n.name,children:o?`Creating\u2026`:`Create policy`})]})]})})}var ui={info:`text-neutral-500`,warn:`text-amber-400`,error:`text-red-400`};function di(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(!0),i=(0,_.useRef)(null);async function a(){try{t(await A.logs())}catch{}}return(0,_.useEffect)(()=>{if(a(),n)return i.current=setInterval(a,2e3),()=>{i.current&&clearInterval(i.current)}},[n]),e===null?(0,j.jsx)(Gr,{}):(0,j.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b border-neutral-800 px-6 py-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h1`,{className:`text-sm font-semibold text-neutral-300`,children:`Logs`}),(0,j.jsx)(`p`,{className:`text-xs text-neutral-500`,children:`Recent requests and server events`})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(N,{className:n?``:`opacity-60`,onClick:()=>r(e=>!e),title:n?`Pause auto-refresh`:`Resume auto-refresh`,children:n?`\u23F8 Live`:`\u25B6 Paused`}),(0,j.jsx)(N,{onClick:a,children:`Refresh`}),(0,j.jsx)(N,{onClick:async()=>{await A.clearLogs(),a()},children:`Clear`})]})]}),(0,j.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3 font-mono text-[12.5px] leading-relaxed`,children:e.length===0?(0,j.jsx)(Kr,{children:`No logs yet. Make a request or trigger an email/webhook.`}):e.map((e,t)=>(0,j.jsxs)(`div`,{className:`flex gap-3 whitespace-pre-wrap break-words px-3 py-0.5 hover:bg-neutral-800/40`,children:[(0,j.jsx)(`span`,{className:`shrink-0 tabular-nums text-neutral-600`,children:e.ts.slice(11,23)}),(0,j.jsx)(`span`,{className:`shrink-0 uppercase `+ui[e.level],children:e.level}),(0,j.jsx)(`span`,{className:`text-neutral-300`,children:e.msg})]},t))})]})}var fi=[{id:`table`,label:`Table Editor`,icon:he},{id:`sql`,label:`SQL Editor`,icon:D},{id:`auth`,label:`Authentication`,icon:ue},{id:`policies`,label:`RLS Policies`,icon:me},{id:`storage`,label:`Storage`,icon:le},{id:`database`,label:`Database`,icon:ce},{id:`logs`,label:`Logs`,icon:pe}];function pi({size:e=24}){return(0,j.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 120 120`,fill:`none`,children:[(0,j.jsxs)(`defs`,{children:[(0,j.jsxs)(`linearGradient`,{id:`tbLogoBody`,x1:`30`,y1:`30`,x2:`92`,y2:`102`,gradientUnits:`userSpaceOnUse`,children:[(0,j.jsx)(`stop`,{stopColor:`#10b981`}),(0,j.jsx)(`stop`,{offset:`1`,stopColor:`#047857`})]}),(0,j.jsxs)(`linearGradient`,{id:`tbLogoLid`,x1:`26`,y1:`19`,x2:`94`,y2:`49`,gradientUnits:`userSpaceOnUse`,children:[(0,j.jsx)(`stop`,{stopColor:`#6ee7b7`}),(0,j.jsx)(`stop`,{offset:`1`,stopColor:`#34d399`})]})]}),(0,j.jsx)(`path`,{d:`M26 34v52c0 8.4 15.2 15.2 34 15.2s34-6.8 34-15.2V34Z`,fill:`url(#tbLogoBody)`}),(0,j.jsx)(`path`,{d:`M26 60c0 8.4 15.2 15.2 34 15.2S94 68.4 94 60`,stroke:`#6ee7b7`,strokeWidth:`3`,fill:`none`}),(0,j.jsx)(`ellipse`,{cx:`60`,cy:`34`,rx:`34`,ry:`15`,fill:`url(#tbLogoLid)`}),(0,j.jsx)(`ellipse`,{cx:`60`,cy:`34`,rx:`25`,ry:`10`,fill:`none`,stroke:`#059669`,strokeOpacity:`0.5`,strokeWidth:`2.5`})]})}function mi(){let[e,t]=(0,_.useState)(!!be()),[n,r]=(0,_.useState)(`table`);return(0,_.useEffect)(()=>{be()&&A.ping().catch(()=>{Se(),t(!1)})},[]),e?(0,j.jsxs)(`div`,{className:`flex h-full`,children:[(0,j.jsxs)(`nav`,{className:`flex w-14 shrink-0 flex-col items-center gap-1 border-r border-neutral-800 bg-[#171717] py-3`,children:[(0,j.jsx)(`div`,{className:`mb-3`,children:(0,j.jsx)(pi,{})}),fi.map(e=>{let t=e.icon,i=n===e.id;return(0,j.jsxs)(`button`,{title:e.label,onClick:()=>r(e.id),className:`group relative flex size-9 items-center justify-center rounded-md transition-colors `+(i?`bg-neutral-800 text-brand`:`text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`),children:[(0,j.jsx)(t,{size:18}),(0,j.jsx)(`span`,{className:`pointer-events-none absolute left-11 z-20 hidden whitespace-nowrap rounded-md border border-neutral-700 bg-neutral-900 px-2 py-1 text-xs text-neutral-200 group-hover:block`,children:e.label})]},e.id)}),(0,j.jsx)(`button`,{title:`Log out`,onClick:()=>{Se(),t(!1)},className:`mt-auto flex size-9 items-center justify-center rounded-md text-neutral-600 hover:bg-neutral-800 hover:text-neutral-300`,children:(0,j.jsx)(oe,{size:18})})]}),(0,j.jsxs)(`main`,{className:`min-w-0 flex-1`,children:[n===`table`&&(0,j.jsx)(Jr,{}),n===`sql`&&(0,j.jsx)(Qr,{}),n===`auth`&&(0,j.jsx)(ei,{}),n===`policies`&&(0,j.jsx)(ci,{}),n===`storage`&&(0,j.jsx)(ri,{}),n===`database`&&(0,j.jsx)(oi,{}),n===`logs`&&(0,j.jsx)(di,{})]})]}):(0,j.jsx)(hi,{onOk:()=>t(!0)})}function hi({onOk:e}){let[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(!1);async function s(){o(!0),i(``),xe(t.trim());try{await A.ping(),e()}catch(e){Se(),i(`Invalid service_role key: `+e.message)}finally{o(!1)}}return(0,j.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,j.jsxs)(`div`,{className:`w-[400px] text-center`,children:[(0,j.jsx)(`div`,{className:`mb-4 flex justify-center`,children:(0,j.jsx)(pi,{size:48})}),(0,j.jsx)(`h1`,{className:`text-lg font-semibold`,children:`tinbase studio`}),(0,j.jsxs)(`p`,{className:`mt-1 text-[13px] text-neutral-500`,children:[`Sign in with the `,(0,j.jsx)(`span`,{className:`text-neutral-300`,children:`service_role`}),` key printed when tinbase started.`]}),(0,j.jsxs)(`div`,{className:`mt-5 space-y-3 text-left`,children:[(0,j.jsx)(Vr,{type:`password`,placeholder:`service_role key (eyJ\u2026)`,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>e.key===`Enter`&&s()}),(0,j.jsx)(N,{className:`w-full`,onClick:s,disabled:a||!t.trim(),children:a?`Checking\u2026`:`Continue`}),r&&(0,j.jsx)(`p`,{className:`text-xs text-red-400`,children:r})]})]})})}(0,v.createRoot)(document.getElementById(`root`)).render((0,j.jsx)(_.StrictMode,{children:(0,j.jsx)(mi,{})}));</script>\n <style rel=\"stylesheet\" crossorigin>/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, -apple-system, sans-serif;--font-mono:ui-monospace, \"SF Mono\", Menlo, monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-blue-400:oklch(70.7% .165 254.624);--color-neutral-100:oklch(97% 0 0);--color-neutral-200:oklch(92.2% 0 0);--color-neutral-300:oklch(87% 0 0);--color-neutral-400:oklch(70.8% 0 0);--color-neutral-500:oklch(55.6% 0 0);--color-neutral-600:oklch(43.9% 0 0);--color-neutral-700:oklch(37.1% 0 0);--color-neutral-800:oklch(26.9% 0 0);--color-neutral-900:oklch(20.5% 0 0);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-wide:.025em;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--animate-spin:spin 1s linear infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-brand:#3ecf8e}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.top-0{top:0}.top-1\\/2{top:50%}.left-1\\/2{left:50%}.left-11{left:calc(var(--spacing) * 11)}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.m-4{margin:calc(var(--spacing) * 4)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-auto{margin-top:auto}.mb-1{margin-bottom:var(--spacing)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.ml-1{margin-left:var(--spacing)}.ml-1\\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.table{display:table}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-40{height:calc(var(--spacing) * 40)}.h-full{height:100%}.max-h-\\[85vh\\]{max-height:85vh}.min-h-0{min-height:0}.w-10{width:calc(var(--spacing) * 10)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-60{width:calc(var(--spacing) * 60)}.w-\\[400px\\]{width:400px}.w-\\[440px\\]{width:440px}.w-\\[640px\\]{width:640px}.w-full{width:100%}.max-w-\\[280px\\]{max-width:280px}.max-w-\\[320px\\]{max-width:320px}.max-w-\\[360px\\]{max-width:360px}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.animate-spin{animation:var(--animate-spin)}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-neutral-700{border-color:var(--color-neutral-700)}.border-neutral-800{border-color:var(--color-neutral-800)}.border-neutral-800\\/60{border-color:#26262699}@supports (color:color-mix(in lab, red, red)){.border-neutral-800\\/60{border-color:color-mix(in oklab, var(--color-neutral-800) 60%, transparent)}}.border-red-900\\/50{border-color:#82181a80}@supports (color:color-mix(in lab, red, red)){.border-red-900\\/50{border-color:color-mix(in oklab, var(--color-red-900) 50%, transparent)}}.border-red-900\\/60{border-color:#82181a99}@supports (color:color-mix(in lab, red, red)){.border-red-900\\/60{border-color:color-mix(in oklab, var(--color-red-900) 60%, transparent)}}.border-t-brand{border-top-color:var(--color-brand)}.bg-\\[\\#1c1c1c\\]{background-color:#1c1c1c}.bg-\\[\\#1f1f1f\\]{background-color:#1f1f1f}.bg-\\[\\#171717\\]{background-color:#171717}.bg-\\[\\#191919\\]{background-color:#191919}.bg-black\\/60{background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\\/60{background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-emerald-600{background-color:var(--color-emerald-600)}.bg-neutral-800{background-color:var(--color-neutral-800)}.bg-neutral-900{background-color:var(--color-neutral-900)}.bg-red-950\\/30{background-color:#4608094d}@supports (color:color-mix(in lab, red, red)){.bg-red-950\\/30{background-color:color-mix(in oklab, var(--color-red-950) 30%, transparent)}}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-1{padding-top:var(--spacing)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12\\.5px\\]{font-size:12.5px}.text-\\[13px\\]{font-size:13px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-300\\/70{color:#ffd236b3}@supports (color:color-mix(in lab, red, red)){.text-amber-300\\/70{color:color-mix(in oklab, var(--color-amber-300) 70%, transparent)}}.text-amber-300\\/80{color:#ffd236cc}@supports (color:color-mix(in lab, red, red)){.text-amber-300\\/80{color:color-mix(in oklab, var(--color-amber-300) 80%, transparent)}}.text-amber-400{color:var(--color-amber-400)}.text-blue-400{color:var(--color-blue-400)}.text-brand{color:var(--color-brand)}.text-neutral-100{color:var(--color-neutral-100)}.text-neutral-200{color:var(--color-neutral-200)}.text-neutral-300{color:var(--color-neutral-300)}.text-neutral-400{color:var(--color-neutral-400)}.text-neutral-500{color:var(--color-neutral-500)}.text-neutral-600{color:var(--color-neutral-600)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-red-400\\/70{color:#ff6568b3}@supports (color:color-mix(in lab, red, red)){.text-red-400\\/70{color:color-mix(in oklab, var(--color-red-400) 70%, transparent)}}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.opacity-0{opacity:0}.opacity-60{opacity:.6}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media (hover:hover){.group-hover\\:block:is(:where(.group):hover *){display:block}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\\:text-neutral-600::placeholder{color:var(--color-neutral-600)}@media (hover:hover){.hover\\:border-neutral-600:hover{border-color:var(--color-neutral-600)}.hover\\:bg-emerald-500:hover{background-color:var(--color-emerald-500)}.hover\\:bg-neutral-800:hover{background-color:var(--color-neutral-800)}.hover\\:bg-neutral-800\\/30:hover{background-color:#2626264d}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-neutral-800\\/30:hover{background-color:color-mix(in oklab, var(--color-neutral-800) 30%, transparent)}}.hover\\:bg-neutral-800\\/40:hover{background-color:#26262666}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-neutral-800\\/40:hover{background-color:color-mix(in oklab, var(--color-neutral-800) 40%, transparent)}}.hover\\:bg-neutral-800\\/50:hover{background-color:#26262680}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-neutral-800\\/50:hover{background-color:color-mix(in oklab, var(--color-neutral-800) 50%, transparent)}}.hover\\:bg-red-950\\/40:hover{background-color:#46080966}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-red-950\\/40:hover{background-color:color-mix(in oklab, var(--color-red-950) 40%, transparent)}}.hover\\:text-brand:hover{color:var(--color-brand)}.hover\\:text-neutral-200:hover{color:var(--color-neutral-200)}.hover\\:text-neutral-300:hover{color:var(--color-neutral-300)}.hover\\:text-red-400:hover{color:var(--color-red-400)}}.focus\\:border-brand:focus{border-color:var(--color-brand)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (width>=64rem){.lg\\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}}:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}html,body,#root{height:100%}body{color:#ededed;-webkit-font-smoothing:antialiased;background:#1c1c1c;margin:0;font-size:13px}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:#3a3a3a;border:2px solid #1c1c1c;border-radius:6px}::-webkit-scrollbar-thumb:hover{background:#4a4a4a}@property --tw-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\"*\";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-tracking{syntax:\"*\";inherits:false}@property --tw-ordinal{syntax:\"*\";inherits:false}@property --tw-slashed-zero{syntax:\"*\";inherits:false}@property --tw-numeric-figure{syntax:\"*\";inherits:false}@property --tw-numeric-spacing{syntax:\"*\";inherits:false}@property --tw-numeric-fraction{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-backdrop-blur{syntax:\"*\";inherits:false}@property --tw-backdrop-brightness{syntax:\"*\";inherits:false}@property --tw-backdrop-contrast{syntax:\"*\";inherits:false}@property --tw-backdrop-grayscale{syntax:\"*\";inherits:false}@property --tw-backdrop-hue-rotate{syntax:\"*\";inherits:false}@property --tw-backdrop-invert{syntax:\"*\";inherits:false}@property --tw-backdrop-opacity{syntax:\"*\";inherits:false}@property --tw-backdrop-saturate{syntax:\"*\";inherits:false}@property --tw-backdrop-sepia{syntax:\"*\";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}\n/*$vite$:1*/</style>\n </head>\n <body>\n <div id=\"root\"></div>\n </body>\n</html>\n";
9
+ export declare const ADMIN_HTML = "<!doctype html>\n<html lang=\"en\" class=\"dark\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <meta name=\"robots\" content=\"noindex\" />\n <!-- Inlined SVG favicon so it ships inside the single self-contained index.html. -->\n <link\n rel=\"icon\"\n type=\"image/svg+xml\"\n href=\"data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='120'%20height='120'%20viewBox='0%200%20120%20120'%20fill='none'%3E%3Cdefs%3E%3ClinearGradient%20id='b'%20x1='30'%20y1='30'%20x2='92'%20y2='102'%20gradientUnits='userSpaceOnUse'%3E%3Cstop%20stop-color='%2310b981'/%3E%3Cstop%20offset='1'%20stop-color='%23047857'/%3E%3C/linearGradient%3E%3ClinearGradient%20id='l'%20x1='26'%20y1='19'%20x2='94'%20y2='49'%20gradientUnits='userSpaceOnUse'%3E%3Cstop%20stop-color='%236ee7b7'/%3E%3Cstop%20offset='1'%20stop-color='%2334d399'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath%20d='M26%2034v52c0%208.4%2015.2%2015.2%2034%2015.2s34-6.8%2034-15.2V34Z'%20fill='url(%23b)'/%3E%3Cpath%20d='M26%2060c0%208.4%2015.2%2015.2%2034%2015.2S94%2068.4%2094%2060'%20stroke='%236ee7b7'%20stroke-width='3'%20fill='none'/%3E%3Cellipse%20cx='60'%20cy='34'%20rx='34'%20ry='15'%20fill='url(%23l)'/%3E%3Cellipse%20cx='60'%20cy='34'%20rx='25'%20ry='10'%20fill='none'%20stroke='%23059669'%20stroke-opacity='0.5'%20stroke-width='2.5'/%3E%3C/svg%3E\"\n />\n <title>tinbase studio</title>\n <script type=\"module\" crossorigin>var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(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 l=o((e=>{var t=Symbol.for(`react.transitional.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.consumer`),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.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={\"=\":`=0`,\":\":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(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`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);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 P(e,t,n){if(e==null)return e;var r=[],i=0;return N(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 F=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},I={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=I,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,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=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),u=o(((e,t)=>{t.exports=l()})),d=o((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(e.unstable_now=void 0,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=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(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 x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(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_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`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},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_requestPaint=function(){g=!0},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?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.7`})),m=o(((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=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var ee=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function ie(e){return{current:e}}function ae(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function L(e,t){re++,ne[re]=e.current,e.current=t}var oe=ie(null),se=ie(null),ce=ie(null),le=ie(null);function ue(e,t){switch(L(ce,t),L(se,e),L(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kd(t),e=qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(oe),L(oe,e)}function de(){ae(oe),ae(se),ae(ce)}function fe(e){e.memoizedState!==null&&L(le,e);var t=oe.current,n=qd(t,e.type);t!==n&&(L(se,e),L(oe,n))}function pe(e){se.current===e&&(ae(oe),ae(se)),le.current===e&&(ae(le),tp._currentValue=te)}var me,he;function ge(e){if(me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\\n( *(at )?)/);me=t&&t[1]||``,he=-1<e.stack.indexOf(`\n at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`\n`+me+e+he}var _e=!1;function ve(e,t){if(!e||_e)return``;_e=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,\"props\",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,\"name\",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`\n`),l=s.split(`\n`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`\n`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{_e=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ge(n):``}function ye(e,t){switch(e.tag){case 26:case 27:case 5:return ge(e.type);case 16:return ge(`Lazy`);case 13:return e.child!==t&&t!==null?ge(`Suspense Fallback`):ge(`Suspense`);case 19:return ge(`SuspenseList`);case 0:case 15:return ve(e.type,!1);case 11:return ve(e.type.render,!1);case 1:return ve(e.type,!0);case 31:return ge(`Activity`);default:return``}}function be(e){try{var t=``,n=null;do t+=ye(e,n),n=e,e=e.return;while(e);return t}catch(e){return`\nError generating stack: `+e.message+`\n`+e.stack}}var xe=Object.prototype.hasOwnProperty,Se=t.unstable_scheduleCallback,Ce=t.unstable_cancelCallback,we=t.unstable_shouldYield,Te=t.unstable_requestPaint,Ee=t.unstable_now,De=t.unstable_getCurrentPriorityLevel,Oe=t.unstable_ImmediatePriority,ke=t.unstable_UserBlockingPriority,Ae=t.unstable_NormalPriority,je=t.unstable_LowPriority,Me=t.unstable_IdlePriority,Ne=t.log,Pe=t.unstable_setDisableYieldValue,Fe=null,Ie=null;function R(e){if(typeof Ne==`function`&&Pe(e),Ie&&typeof Ie.setStrictMode==`function`)try{Ie.setStrictMode(Fe,e)}catch{}}var Le=Math.clz32?Math.clz32:Be,Re=Math.log,ze=Math.LN2;function Be(e){return e>>>=0,e===0?32:31-(Re(e)/ze|0)|0}var Ve=256,He=262144,Ue=4194304;function We(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ge(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=We(n))):i=We(o):i=We(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=We(n))):i=We(o)):i=We(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ke(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Je(){var e=Ue;return Ue<<=1,!(Ue&62914560)&&(Ue=4194304),e}function Ye(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ze(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Le(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Qe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Le(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function $e(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Le(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function et(e,t){var n=t&-t;return n=n&42?1:tt(n),(n&(e.suspendedLanes|t))===0?n:0}function tt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function nt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function rt(){var e=I.p;return e===0?(e=window.event,e===void 0?32:_p(e.type)):e}function it(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var at=Math.random().toString(36).slice(2),ot=`__reactFiber$`+at,st=`__reactProps$`+at,ct=`__reactContainer$`+at,lt=`__reactEvents$`+at,ut=`__reactListeners$`+at,dt=`__reactHandles$`+at,ft=`__reactResources$`+at,pt=`__reactMarker$`+at;function mt(e){delete e[ot],delete e[st],delete e[lt],delete e[ut],delete e[dt]}function ht(e){var t=e[ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ct]||n[ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mf(e);e!==null;){if(n=e[ot])return n;e=mf(e)}return t}e=n,n=e.parentNode}return null}function gt(e){if(e=e[ot]||e[ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _t(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function vt(e){var t=e[ft];return t||=e[ft]={hoistableStyles:new Map,hoistableScripts:new Map},t}function yt(e){e[pt]=!0}var bt=new Set,xt={};function St(e,t){Ct(e,t),Ct(e+`Capture`,t)}function Ct(e,t){for(xt[e]=t,e=0;e<t.length;e++)bt.add(t[e])}var wt=RegExp(`^[: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]*$`),Tt={},Et={};function Dt(e){return xe.call(Et,e)?!0:xe.call(Tt,e)?!1:wt.test(e)?Et[e]=!0:(Tt[e]=!0,!1)}function Ot(e,t,n){if(Dt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function kt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function At(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Mt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Nt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pt(e){if(!e._valueTracker){var t=Mt(e)?`checked`:`value`;e._valueTracker=Nt(e,t,``+e[t])}}function Ft(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Mt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function It(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Lt=/[\\n\"\\\\]/g;function Rt(e){return e.replace(Lt,function(e){return`\\\\`+e.charCodeAt(0).toString(16)+` `})}function zt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+jt(t)):e.value!==``+jt(t)&&(e.value=``+jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Vt(e,o,jt(n)):Vt(e,o,jt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+jt(s):e.removeAttribute(`name`)}function Bt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Pt(e);return}n=n==null?``:``+jt(n),t=t==null?n:``+jt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Pt(e)}function Vt(e,t,n){t===`number`&&It(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ht(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=``+jt(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 Ut(e,t,n){if(t!=null&&(t=``+jt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+jt(n)}function Wt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ee(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Pt(e)}function Gt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function z(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Kt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function qt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&z(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&z(e,o,t[o])}function Jt(e){if(e.indexOf(`-`)===-1)return!1;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 Yt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Xt=/^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*:/i;function B(e){return Xt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function V(){}var H=null;function Zt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qt=null,$t=null;function en(e){var t=gt(e);if(t&&(e=t.stateNode)){var n=e[st]||null;a:switch(e=t.stateNode,t.type){case`input`:if(zt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=\"`+Rt(``+t)+`\"][type=\"radio\"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[st]||null;if(!a)throw Error(i(90));zt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ft(r)}break a;case`textarea`:Ut(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ht(e,!!n.multiple,t,!1)}}}var tn=!1;function nn(e,t,n){if(tn)return e(t,n);tn=!0;try{return e(t)}finally{if(tn=!1,(Qt!==null||$t!==null)&&(Cu(),Qt&&(t=Qt,e=$t,$t=Qt=null,en(t),e)))for(t=0;t<e.length;t++)en(e[t])}}function rn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[st]||null;if(r===null)return null;n=r[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`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var an=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),on=!1;if(an)try{var sn={};Object.defineProperty(sn,\"passive\",{get:function(){on=!0}}),window.addEventListener(`test`,sn,sn),window.removeEventListener(`test`,sn,sn)}catch{on=!1}var cn=null,ln=null,un=null;function dn(){if(un)return un;var e,t=ln,n=t.length,r,i=`value`in cn?cn.value:cn.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 un=i.slice(e,1<r?1-r:void 0)}function fn(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 pn(){return!0}function mn(){return!1}function hn(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)?pn:mn,this.isPropagationStopped=mn,this}return h(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=pn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=pn)},persist:function(){},isPersistent:pn}),t}var gn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_n=hn(gn),vn=h({},gn,{view:0,detail:0}),yn=hn(vn),bn,xn,Sn,Cn=h({},vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pn,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!==Sn&&(Sn&&e.type===`mousemove`?(bn=e.screenX-Sn.screenX,xn=e.screenY-Sn.screenY):xn=bn=0,Sn=e),bn)},movementY:function(e){return`movementY`in e?e.movementY:xn}}),wn=hn(Cn),Tn=hn(h({},Cn,{dataTransfer:0})),En=hn(h({},vn,{relatedTarget:0})),Dn=hn(h({},gn,{animationName:0,elapsedTime:0,pseudoElement:0})),On=hn(h({},gn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),kn=hn(h({},gn,{data:0})),An={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},jn={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`},Mn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Nn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Mn[e])?!!t[e]:!1}function Pn(){return Nn}var Fn=hn(h({},vn,{key:function(e){if(e.key){var t=An[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pn,charCode:function(e){return e.type===`keypress`?fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),In=hn(h({},Cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Ln=hn(h({},vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pn})),Rn=hn(h({},gn,{propertyName:0,elapsedTime:0,pseudoElement:0})),zn=hn(h({},Cn,{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})),Bn=hn(h({},gn,{newState:0,oldState:0})),Vn=[9,13,27,32],Hn=an&&`CompositionEvent`in window,Un=null;an&&`documentMode`in document&&(Un=document.documentMode);var Wn=an&&`TextEvent`in window&&!Un,Gn=an&&(!Hn||Un&&8<Un&&11>=Un),Kn=` `,qn=!1;function Jn(e,t){switch(e){case`keyup`:return Vn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function U(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Yn=!1;function Xn(e,t){switch(e){case`compositionend`:return U(t);case`keypress`:return t.which===32?(qn=!0,Kn):null;case`textInput`:return e=t.data,e===Kn&&qn?null:e;default:return null}}function Zn(e,t){if(Yn)return e===`compositionend`||!Hn&&Jn(e,t)?(e=dn(),un=ln=cn=null,Yn=!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 Gn&&t.locale!==`ko`?null:t.data;default:return null}}var Qn={color:!0,date:!0,datetime:!0,\"datetime-local\":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Qn[e.type]:t===`textarea`}function er(e,t,n,r){Qt?$t?$t.push(r):$t=[r]:Qt=r,t=Ad(t,`onChange`),0<t.length&&(n=new _n(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var tr=null,nr=null;function W(e){Cd(e,0)}function rr(e){if(Ft(_t(e)))return e}function ir(e,t){if(e===`change`)return t}var ar=!1;if(an){var or;if(an){var sr=`oninput`in document;if(!sr){var cr=document.createElement(`div`);cr.setAttribute(`oninput`,`return;`),sr=typeof cr.oninput==`function`}or=sr}else or=!1;ar=or&&(!document.documentMode||9<document.documentMode)}function lr(){tr&&(tr.detachEvent(`onpropertychange`,ur),nr=tr=null)}function ur(e){if(e.propertyName===`value`&&rr(nr)){var t=[];er(t,nr,e,Zt(e)),nn(W,t)}}function dr(e,t,n){e===`focusin`?(lr(),tr=t,nr=n,tr.attachEvent(`onpropertychange`,ur)):e===`focusout`&&lr()}function fr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return rr(nr)}function pr(e,t){if(e===`click`)return rr(t)}function mr(e,t){if(e===`input`||e===`change`)return rr(t)}function hr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var gr=typeof Object.is==`function`?Object.is:hr;function _r(e,t){if(gr(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(!xe.call(t,i)||!gr(e[i],t[i]))return!1}return!0}function vr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yr(e,t){var n=vr(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=vr(n)}}function br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=It(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=It(e.document)}return t}function Sr(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`)}var Cr=an&&`documentMode`in document&&11>=document.documentMode,wr=null,Tr=null,Er=null,Dr=!1;function Or(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Dr||wr==null||wr!==It(r)||(r=wr,`selectionStart`in r&&Sr(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}),Er&&_r(Er,r)||(Er=r,r=Ad(Tr,`onSelect`),0<r.length&&(t=new _n(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=wr)))}function kr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ar={animationend:kr(`Animation`,`AnimationEnd`),animationiteration:kr(`Animation`,`AnimationIteration`),animationstart:kr(`Animation`,`AnimationStart`),transitionrun:kr(`Transition`,`TransitionRun`),transitionstart:kr(`Transition`,`TransitionStart`),transitioncancel:kr(`Transition`,`TransitionCancel`),transitionend:kr(`Transition`,`TransitionEnd`)},jr={},G={};an&&(G=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),`TransitionEvent`in window||delete Ar.transitionend.transition);function Mr(e){if(jr[e])return jr[e];if(!Ar[e])return e;var t=Ar[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in G)return jr[e]=t[n];return e}var Nr=Mr(`animationend`),Pr=Mr(`animationiteration`),Fr=Mr(`animationstart`),Ir=Mr(`transitionrun`),Lr=Mr(`transitionstart`),Rr=Mr(`transitioncancel`),zr=Mr(`transitionend`),Br=new Map,Vr=`abort auxClick beforeToggle 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(` `);Vr.push(`scrollEnd`);function Hr(e,t){Br.set(e,t),St(t,[e])}var Ur=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Wr=[],Gr=0,Kr=0;function qr(){for(var e=Gr,t=Kr=Gr=0;t<e;){var n=Wr[t];Wr[t++]=null;var r=Wr[t];Wr[t++]=null;var i=Wr[t];Wr[t++]=null;var a=Wr[t];if(Wr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Zr(n,i,a)}}function Jr(e,t,n,r){Wr[Gr++]=e,Wr[Gr++]=t,Wr[Gr++]=n,Wr[Gr++]=r,Kr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Yr(e,t,n,r){return Jr(e,t,n,r),Qr(e)}function Xr(e,t){return Jr(e,null,null,t),Qr(e)}function Zr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Le(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Qr(e){if(50<mu)throw mu=0,hu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var $r={};function ei(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.refCleanup=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 ti(e,t,n,r){return new ei(e,t,n,r)}function ni(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ri(e,t){var n=e.alternate;return n===null?(n=ti(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&65011712,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.refCleanup=e.refCleanup,n}function ii(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ai(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ni(e)&&(s=1);else if(typeof e==`string`)s=Kf(e,n,oe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ti(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return oi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ti(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ti(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ti(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ti(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function oi(e,t,n,r){return e=ti(7,e,r,t),e.lanes=n,e}function si(e,t,n){return e=ti(6,e,null,t),e.lanes=n,e}function ci(e){var t=ti(18,null,null,0);return t.stateNode=e,t}function li(e,t,n){return t=ti(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ui=new WeakMap;function di(e,t){if(typeof e==`object`&&e){var n=ui.get(e);return n===void 0?(t={value:e,source:t,stack:be(t)},ui.set(e,t),t):n}return{value:e,source:t,stack:be(t)}}var fi=[],pi=0,mi=null,hi=0,gi=[],_i=0,vi=null,yi=1,bi=``;function xi(e,t){fi[pi++]=hi,fi[pi++]=mi,mi=e,hi=t}function Si(e,t,n){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,vi=e;var r=yi;e=bi;var i=32-Le(r)-1;r&=~(1<<i),n+=1;var a=32-Le(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,yi=1<<32-Le(t)+i|n<<i|r,bi=a+e}else yi=1<<a|n<<i|r,bi=e}function Ci(e){e.return!==null&&(xi(e,1),Si(e,1,0))}function wi(e){for(;e===mi;)mi=fi[--pi],fi[pi]=null,hi=fi[--pi],fi[pi]=null;for(;e===vi;)vi=gi[--_i],gi[_i]=null,bi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null}function Ti(e,t){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,yi=t.id,bi=t.overflow,vi=e}var Ei=null,Di=null,Oi=!1,ki=null,Ai=!1,ji=Error(i(519));function Mi(e){throw Ri(di(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ji}function Ni(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ot]=e,t[st]=r,n){case`dialog`:J(`cancel`,t),J(`close`,t);break;case`iframe`:case`object`:case`embed`:J(`load`,t);break;case`video`:case`audio`:for(n=0;n<xd.length;n++)J(xd[n],t);break;case`source`:J(`error`,t);break;case`img`:case`image`:case`link`:J(`error`,t),J(`load`,t);break;case`details`:J(`toggle`,t);break;case`input`:J(`invalid`,t),Bt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:J(`invalid`,t);break;case`textarea`:J(`invalid`,t),Wt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Id(t.textContent,n)?(r.popover!=null&&(J(`beforetoggle`,t),J(`toggle`,t)),r.onScroll!=null&&J(`scroll`,t),r.onScrollEnd!=null&&J(`scrollend`,t),r.onClick!=null&&(t.onclick=V),t=!0):t=!1,t||Mi(e,!0)}function Pi(e){for(Ei=e.return;Ei;)switch(Ei.tag){case 5:case 31:case 13:Ai=!1;return;case 27:case 3:Ai=!0;return;default:Ei=Ei.return}}function Fi(e){if(e!==Ei)return!1;if(!Oi)return Pi(e),Oi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Jd(e.type,e.memoizedProps)),n=!n),n&&Di&&Mi(e),Pi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Di=pf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Di=pf(e)}else t===27?(t=Di,nf(e.type)?(e=ff,ff=null,Di=e):Di=t):Di=Ei?df(e.stateNode.nextSibling):null;return!0}function Ii(){Di=Ei=null,Oi=!1}function Li(){var e=ki;return e!==null&&(eu===null?eu=e:eu.push.apply(eu,e),ki=null),e}function Ri(e){ki===null?ki=[e]:ki.push(e)}var zi=ie(null),Bi=null,Vi=null;function Hi(e,t,n){L(zi,t._currentValue),t._currentValue=n}function Ui(e){e._currentValue=zi.current,ae(zi)}function Wi(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 Gi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Wi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Wi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ki(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;gr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===le.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[tp]:e.push(tp))}a=a.return}e!==null&&Gi(t,e,n,r),t.flags|=262144}function qi(e){for(e=e.firstContext;e!==null;){if(!gr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ji(e){Bi=e,Vi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yi(e){return Zi(Bi,e)}function Xi(e,t){return Bi===null&&Ji(e),Zi(e,t)}function Zi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Vi===null){if(e===null)throw Error(i(308));Vi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Vi=Vi.next=t;return n}var Qi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},$i=t.unstable_scheduleCallback,ea=t.unstable_NormalPriority,ta={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function na(){return{controller:new Qi,data:new Map,refCount:0}}function ra(e){e.refCount--,e.refCount===0&&$i(ea,function(){e.controller.abort()})}var ia=null,aa=0,oa=0,sa=null;function ca(e,t){if(ia===null){var n=ia=[];aa=0,oa=hd(),sa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return aa++,t.then(la,la),t}function la(){if(--aa===0&&ia!==null){sa!==null&&(sa.status=`fulfilled`);var e=ia;ia=null,oa=0,sa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ua(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var da=F.S;F.S=function(e,t){ru=Ee(),typeof t==`object`&&t&&typeof t.then==`function`&&ca(e,t),da!==null&&da(e,t)};var fa=ie(null);function pa(){var e=fa.current;return e===null?zl.pooledCache:e}function ma(e,t){t===null?L(fa,fa.current):L(fa,t.pool)}function ha(){var e=pa();return e===null?null:{parent:ta._currentValue,pool:e}}var ga=Error(i(460)),_a=Error(i(474)),va=Error(i(542)),ya={then:function(){}};function ba(e){return e=e.status,e===`fulfilled`||e===`rejected`}function xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(V,V),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e;default:if(typeof t.status==`string`)t.then(V,V);else{if(e=zl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e}throw Ca=t,ga}}function Sa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ca=e,ga):e}}var Ca=null;function wa(){if(Ca===null)throw Error(i(459));var e=Ca;return Ca=null,e}function Ta(e){if(e===ga||e===va)throw Error(i(483))}var Ea=null,Da=0;function Oa(e){var t=Da;return Da+=1,Ea===null&&(Ea=[]),xa(Ea,e,t)}function ka(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Aa(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ja(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){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ri(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|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=si(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===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Sa(i)===t.type)?(t=a(t,n.props),ka(t,n),t.return=e,t):(t=ai(n.type,n.key,n.props,null,e.mode,r),ka(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=li(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=oi(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`||typeof t==`bigint`)return t=si(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ai(t.type,t.key,t.props,null,e.mode,n),ka(n,t),n.return=e,n;case v:return t=li(t,e.mode,n),t.return=e,t;case O:return t=Sa(t),f(e,t,n)}if(ee(t)||M(t))return t=oi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Oa(t),n);if(t.$$typeof===C)return f(e,Xi(e,t),n);Aa(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`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Sa(n),p(e,t,n,r)}if(ee(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Oa(n),r);if(n.$$typeof===C)return p(e,t,Xi(e,n),r);Aa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Sa(r),m(e,t,n,r,i)}if(ee(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Oa(r),i);if(r.$$typeof===C)return m(e,t,n,Xi(t,r),i);Aa(t,r)}return null}function h(i,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(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Oi&&xi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Oi&&xi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,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(i,e)}),Oi&&xi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=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),Oi&&xi(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 Oi&&xi(a,g),u}for(h=r(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)}),Oi&&xi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Sa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ka(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=oi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ai(o.type,o.key,o.props,null,e.mode,c),ka(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=li(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Sa(o),b(e,r,o,c)}if(ee(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Oa(o),c);if(o.$$typeof===C)return b(e,r,Xi(e,o),c);Aa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=si(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Da=0;var i=b(e,t,n,r);return Ea=null,i}catch(t){if(t===ga||t===va)throw t;var a=ti(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ma=ja(!0),Na=ja(!1),Pa=!1;function Fa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ia(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Rl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Qr(e),Zr(e,null,n),t}return Jr(e,r,t,n),Qr(e)}function za(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}function Ba(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={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,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,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Va=!1;function Ha(){if(Va){var e=sa;if(e!==null)throw e}}function Ua(e,t,n,r){Va=!1;var i=e.updateQueue;Pa=!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&-536870913,p=f!==s.lane;if(p?(Bl&f)===f:(r&f)===f){f!==0&&f===oa&&(Va=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Pa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else 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;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Jl|=o,e.lanes=o,e.memoizedState=d}}function Wa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ga(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Wa(n[e],t)}var Ka=ie(null),qa=ie(0);function Ja(e,t){e=Kl,L(qa,e),L(Ka,t),Kl=e|t.baseLanes}function Ya(){L(qa,Kl),L(Ka,Ka.current)}function Xa(){Kl=qa.current,ae(Ka),ae(qa)}var Za=ie(null),Qa=null;function $a(e){var t=e.alternate;L(io,io.current&1),L(Za,e),Qa===null&&(t===null||Ka.current!==null||t.memoizedState!==null)&&(Qa=e)}function eo(e){L(io,io.current),L(Za,e),Qa===null&&(Qa=e)}function to(e){e.tag===22?(L(io,io.current),L(Za,e),Qa===null&&(Qa=e)):no(e)}function no(){L(io,io.current),L(Za,Za.current)}function ro(e){ae(Za),Qa===e&&(Qa=null),ae(io)}var io=ie(0);function ao(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||lf(n)||X(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){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 oo=0,K=null,so=null,co=null,lo=!1,uo=!1,fo=!1,po=0,mo=0,ho=null,go=0;function _o(){throw Error(i(321))}function vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!gr(e[n],t[n]))return!1;return!0}function yo(e,t,n,r,i,a){return oo=a,K=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?Is:Ls,fo=!1,a=n(r,i),fo=!1,uo&&(a=xo(t,n,r,i)),bo(e),a}function bo(e){F.H=Fs;var t=so!==null&&so.next!==null;if(oo=0,co=so=K=null,lo=!1,mo=0,ho=null,t)throw Error(i(300));e===null||ec||(e=e.dependencies,e!==null&&qi(e)&&(ec=!0))}function xo(e,t,n,r){K=e;var a=0;do{if(uo&&(ho=null),mo=0,uo=!1,25<=a)throw Error(i(301));if(a+=1,co=so=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=Rs,o=t(n,r)}while(uo);return o}function So(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?ko(t):t,e=e.useState()[0],(so===null?null:so.memoizedState)!==e&&(K.flags|=1024),t}function Co(){var e=po!==0;return po=0,e}function wo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function To(e){if(lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}lo=!1}oo=0,co=so=K=null,uo=!1,mo=po=0,ho=null}function Eo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return co===null?K.memoizedState=co=e:co=co.next=e,co}function Do(){if(so===null){var e=K.alternate;e=e===null?null:e.memoizedState}else e=so.next;var t=co===null?K.memoizedState:co.next;if(t!==null)co=t,so=e;else{if(e===null)throw K.alternate===null?Error(i(467)):Error(i(310));so=e,e={memoizedState:so.memoizedState,baseState:so.baseState,baseQueue:so.baseQueue,queue:so.queue,next:null},co===null?K.memoizedState=co=e:co=co.next=e}return co}function Oo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=mo;return mo+=1,ho===null&&(ho=[]),e=xa(ho,e,t),t=K,(co===null?t.memoizedState:co.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?Is:Ls),e}function Ao(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ko(e);if(e.$$typeof===C)return Yi(e)}throw Error(i(438,String(e)))}function jo(e){var t=null,n=K.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=K.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Oo(),K.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function Mo(e,t){return typeof t==`function`?t(e):t}function No(e){return Po(Do(),so,e)}function Po(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(oo&f)===f:(Bl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===oa&&(d=!0);else if((oo&p)===p){u=u.next,p===oa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,K.lanes|=p,Jl|=p;f=u.action,fo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,K.lanes|=f,Jl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!gr(o,e.memoizedState)&&(ec=!0,d&&(n=sa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Fo(e){var t=Do(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=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);gr(o,t.memoizedState)||(ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Io(e,t,n){var r=K,a=Do(),o=Oi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!gr((so||a).memoizedState,n);if(s&&(a.memoizedState=n,ec=!0),a=a.queue,ss(zo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||co!==null&&co.memoizedState.tag&1){if(r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,a,n,t),null),zl===null)throw Error(i(349));o||oo&127||Lo(r,t,n)}return n}function Lo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t=Oo(),K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ro(e,t,n,r){t.value=n,t.getSnapshot=r,Bo(t)&&Vo(e)}function zo(e,t,n){return n(function(){Bo(t)&&Vo(e)})}function Bo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gr(e,n)}catch{return!0}}function Vo(e){var t=Xr(e,2);t!==null&&vu(t,e,2)}function Ho(e){var t=Eo();if(typeof e==`function`){var n=e;if(e=n(),fo){R(!0);try{n()}finally{R(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:e},t}function Uo(e,t,n,r){return e.baseState=n,Po(e,so,typeof r==`function`?r:Mo)}function Wo(e,t,n,r,a){if(Ms(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Go(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Go(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Ko(e,t,s)}catch(n){Jo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Ko(e,t,a)}catch(n){Jo(e,t,n)}}function Ko(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){qo(e,t,n)},function(n){return Jo(e,t,n)}):qo(e,t,n)}function qo(e,t,n){t.status=`fulfilled`,t.value=n,Yo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Go(e,n)))}function Jo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Yo(t),t=t.next;while(t!==r)}e.action=null}function Yo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xo(e,t){return t}function Zo(e,t){if(Oi){var n=zl.formState;if(n!==null){a:{var r=K;if(Oi){if(Di){b:{for(var i=Di,a=Ai;i.nodeType!==8;){if(!a){i=null;break b}if(i=df(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Di=df(i.nextSibling),r=i.data===`F!`;break a}}Mi(r)}r=!1}r&&(t=n[0])}}return n=Eo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:t},n.queue=r,n=ks.bind(null,K,r),r.dispatch=n,r=Ho(!1),a=js.bind(null,K,!1,r.queue),r=Eo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Wo.bind(null,K,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Qo(e){return $o(Do(),so,e)}function $o(e,t,n){if(t=Po(e,t,Xo)[0],e=No(Mo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ko(t)}catch(e){throw e===ga?va:e}else r=t;t=Do();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(K.flags|=2048,ns(9,{destroy:void 0},es.bind(null,i,n),null)),[r,a,e]}function es(e,t){e.action=t}function ts(e){var t=Do(),n=so;if(n!==null)return $o(t,n,e);Do(),t=t.memoizedState,n=Do();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=K.updateQueue,t===null&&(t=Oo(),K.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function rs(){return Do().memoizedState}function is(e,t,n,r){var i=Eo();K.flags|=e,i.memoizedState=ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function as(e,t,n,r){var i=Do();r=r===void 0?null:r;var a=i.memoizedState.inst;so!==null&&r!==null&&vo(r,so.memoizedState.deps)?i.memoizedState=ns(t,a,n,r):(K.flags|=e,i.memoizedState=ns(1|t,a,n,r))}function os(e,t){is(8390656,8,e,t)}function ss(e,t){as(2048,8,e,t)}function cs(e){K.flags|=4;var t=K.updateQueue;if(t===null)t=Oo(),K.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ls(e){var t=Do().memoizedState;return cs({ref:t,nextImpl:e}),function(){if(Rl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function us(e,t){return as(4,2,e,t)}function ds(e,t){return as(4,4,e,t)}function fs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ps(e,t,n){n=n==null?null:n.concat([e]),as(4,4,fs.bind(null,t,e),n)}function ms(){}function hs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vo(t,r[1]))return r[0];if(r=e(),fo){R(!0);try{e()}finally{R(!1)}}return n.memoizedState=[r,t],r}function _s(e,t,n){return n===void 0||oo&1073741824&&!(Bl&261930)?e.memoizedState=t:(e.memoizedState=n,e=_u(),K.lanes|=e,Jl|=e,n)}function vs(e,t,n,r){return gr(n,t)?n:Ka.current===null?!(oo&42)||oo&1073741824&&!(Bl&261930)?(ec=!0,e.memoizedState=n):(e=_u(),K.lanes|=e,Jl|=e,t):(e=_s(e,n,r),gr(e,t)||(ec=!0),e)}function ys(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};F.T=s,js(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?As(e,t,ua(c,r),gu(e)):As(e,t,r,gu(e))}catch(n){As(e,t,{then:function(){},status:`rejected`,reason:n},gu())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function bs(){}function xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ss(e).queue;ys(e,a,t,te,n===null?bs:function(){return Cs(e),n(r)})}function Ss(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cs(e){var t=Ss(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},gu())}function ws(){return Yi(tp)}function Ts(){return Do().memoizedState}function Es(){return Do().memoizedState}function Ds(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=gu();e=La(n);var r=Ra(t,e,n);r!==null&&(vu(r,t,n),za(r,t,n)),t={cache:na()},e.payload=t;return}t=t.return}}function Os(e,t,n){var r=gu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=Yr(e,t,n,r),n!==null&&(vu(n,e,r),Ps(n,t,r)))}function ks(e,t,n){As(e,t,n,gu())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(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,gr(s,o))return Jr(e,t,i,0),zl===null&&qr(),!1}catch{}if(n=Yr(e,t,i,r),n!==null)return vu(n,e,r),Ps(n,t,r),!0}return!1}function js(e,t,n,r){if(r={lane:2,revertLane:hd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(i(479))}else t=Yr(e,n,r,2),t!==null&&vu(t,e,2)}function Ms(e){var t=e.alternate;return e===K||t!==null&&t===K}function Ns(e,t){uo=lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ps(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var Fs={readContext:Yi,use:Ao,useCallback:_o,useContext:_o,useEffect:_o,useImperativeHandle:_o,useLayoutEffect:_o,useInsertionEffect:_o,useMemo:_o,useReducer:_o,useRef:_o,useState:_o,useDebugValue:_o,useDeferredValue:_o,useTransition:_o,useSyncExternalStore:_o,useId:_o,useHostTransitionStatus:_o,useFormState:_o,useActionState:_o,useOptimistic:_o,useMemoCache:_o,useCacheRefresh:_o};Fs.useEffectEvent=_o;var Is={readContext:Yi,use:Ao,useCallback:function(e,t){return Eo().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),is(4194308,4,fs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){is(4,2,e,t)},useMemo:function(e,t){var n=Eo();t=t===void 0?null:t;var r=e();if(fo){R(!0);try{e()}finally{R(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Eo();if(n!==void 0){var i=n(t);if(fo){R(!0);try{n(t)}finally{R(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Os.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=Eo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ho(e);var t=e.queue,n=ks.bind(null,K,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(e,t){return _s(Eo(),e,t)},useTransition:function(){var e=Ho(!1);return e=ys.bind(null,K,e.queue,!0,!1),Eo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=K,a=Eo();if(Oi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),zl===null)throw Error(i(349));Bl&127||Lo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,os(zo.bind(null,r,o,e),[e]),r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,o,n,t),null),n},useId:function(){var e=Eo(),t=zl.identifierPrefix;if(Oi){var n=bi,r=yi;n=(r&~(1<<32-Le(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=po++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=go++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ws,useFormState:Zo,useActionState:Zo,useOptimistic:function(e){var t=Eo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=js.bind(null,K,!0,n),n.dispatch=t,[e,t]},useMemoCache:jo,useCacheRefresh:function(){return Eo().memoizedState=Ds.bind(null,K)},useEffectEvent:function(e){var t=Eo(),n={impl:e};return t.memoizedState=n,function(){if(Rl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ls={readContext:Yi,use:Ao,useCallback:hs,useContext:Yi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:No,useRef:rs,useState:function(){return No(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){return vs(Do(),so.memoizedState,e,t)},useTransition:function(){var e=No(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){return Uo(Do(),so,e,t)},useMemoCache:jo,useCacheRefresh:Es};Ls.useEffectEvent=ls;var Rs={readContext:Yi,use:Ao,useCallback:hs,useContext:Yi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Fo,useRef:rs,useState:function(){return Fo(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){var n=Do();return so===null?_s(n,e,t):vs(n,so.memoizedState,e,t)},useTransition:function(){var e=Fo(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){var n=Do();return so===null?(n.baseState=e,[e,n.queue.dispatch]):Uo(n,so,e,t)},useMemoCache:jo,useCacheRefresh:Es};Rs.useEffectEvent=ls;function zs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gu(),i=La(r);i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(vu(t,e,r),za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gu(),i=La(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(vu(t,e,r),za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gu(),r=La(n);r.tag=2,t!=null&&(r.callback=t),t=Ra(e,r,n),t!==null&&(vu(t,e,n),za(t,e,n))}};function Vs(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?!_r(n,r)||!_r(i,a):!0}function Hs(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&&Bs.enqueueReplaceState(t,t.state,null)}function Us(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ws(e){Ur(e)}function Gs(e){console.error(e)}function Ks(e){Ur(e)}function qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){return n=La(n),n.tag=3,n.payload={element:null},n.callback=function(){qs(e,t)},n}function Xs(e){return e=La(e),e.tag=3,e}function Zs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Js(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Js(t,n,r),typeof i!=`function`&&(ou===null?ou=new Set([this]):ou.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Qs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ki(t,n,a,!0),n=Za.current,n!==null){switch(n.tag){case 31:case 13:return Qa===null?Au():n.alternate===null&&ql===0&&(ql=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Yu(e,r,a)),!1;case 22:return n.flags|=65536,r===ya?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Yu(e,r,a)),!1}throw Error(i(435,n.tag))}return Yu(e,r,a),Au(),!1}if(Oi)return t=Za.current,t===null?(r!==ji&&(t=Error(i(423),{cause:r}),Ri(di(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=di(r,n),a=Ys(e.stateNode,r,a),Ba(e,a),ql!==4&&(ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ji&&(e=Error(i(422),{cause:r}),Ri(di(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=di(o,n),$l===null?$l=[o]:$l.push(o),ql!==4&&(ql=2),t===null)return!0;r=di(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ys(n.stateNode,r,e),Ba(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ou===null||!ou.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Xs(a),Zs(a,e,n,r),Ba(n,a),!1}n=n.return}while(n!==null);return!1}var $s=Error(i(461)),ec=!1;function tc(e,t,n,r){t.child=e===null?Na(t,null,n,r):Ma(t,e.child,n,r)}function nc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ji(t),r=yo(e,t,n,o,a,i),s=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(Oi&&s&&Ci(t),t.flags|=1,tc(e,t,r,i),t.child)}function rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ni(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ic(e,t,a,r,i)):(e=ai(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Dc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?_r:n,n(o,r)&&e.ref===t.ref)return Ec(e,t,i)}return t.flags|=1,e=ri(a,r),e.ref=t.ref,e.return=t,t.child=e}function ic(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(_r(a,r)&&e.ref===t.ref)if(ec=!1,t.pendingProps=r=a,Dc(e,i))e.flags&131072&&(ec=!0);else return t.lanes=e.lanes,Ec(e,t,i)}return fc(e,t,n,r,i)}function ac(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return sc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ma(t,a===null?null:a.cachePool),a===null?Ya():Ja(t,a),to(t);else return r=t.lanes=536870912,sc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ma(t,null),Ya(),no(t)):(ma(t,a.cachePool),Ja(t,a),no(t),t.memoizedState=null);return tc(e,t,i,n),t.child}function oc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sc(e,t,n,r,i){var a=pa();return a=a===null?null:{parent:ta._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ma(t,null),Ya(),to(t),e!==null&&Ki(e,t,r,!0),t.childLanes=i,null}function cc(e,t){return t=xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lc(e,t,n){return Ma(t,e.child,null,n),e=cc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function uc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Oi){if(r.mode===`hidden`)return e=cc(t,r),t.lanes=536870912,oc(null,e);if(eo(t),(e=Di)?(e=Y(e,Ai),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ei=t,Di=null)):e=null,e===null)throw Mi(t);return t.lanes=536870912,null}return cc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(eo(t),a)if(t.flags&256)t.flags&=-257,t=lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ec||Ki(e,t,n,!1),a=(n&e.childLanes)!==0,ec||a){if(r=zl,r!==null&&(s=et(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Xr(e,s),vu(r,e,s),$s;Au(),t=lc(e,t,n)}else e=o.treeContext,Di=df(s.nextSibling),Ei=t,Oi=!0,ki=null,Ai=!1,e!==null&&Ti(t,e),t=cc(t,r),t.flags|=4096;return t}return e=ri(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function dc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function fc(e,t,n,r,i){return Ji(t),n=yo(e,t,n,r,void 0,i),r=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(Oi&&r&&Ci(t),t.flags|=1,tc(e,t,n,i),t.child)}function pc(e,t,n,r,i,a){return Ji(t),t.updateQueue=null,n=xo(t,r,n,i),bo(e),r=Co(),e!==null&&!ec?(wo(e,t,a),Ec(e,t,a)):(Oi&&r&&Ci(t),t.flags|=1,tc(e,t,n,a),t.child)}function mc(e,t,n,r,i){if(Ji(t),t.stateNode===null){var a=$r,o=n.contextType;typeof o==`object`&&o&&(a=Yi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Bs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Fa(t),o=n.contextType,a.context=typeof o==`object`&&o?Yi(o):$r,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(zs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Bs.enqueueReplaceState(a,a.state,null),Ua(t,r,a,i),Ha(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Us(n,s);a.props=c;var l=a.context,u=n.contextType;o=$r,typeof u==`object`&&u&&(o=Yi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Hs(t,a,r,o),Pa=!1;var f=t.memoizedState;a.state=f,Ua(t,r,a,i),Ha(),l=t.memoizedState,s||f!==l||Pa?(typeof d==`function`&&(zs(t,n,d,r),l=t.memoizedState),(c=Pa||Vs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ia(e,t),o=t.memoizedProps,u=Us(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=$r,typeof l==`object`&&l&&(c=Yi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Hs(t,a,r,c),Pa=!1,f=t.memoizedState,a.state=f,Ua(t,r,a,i),Ha();var p=t.memoizedState;o!==d||f!==p||Pa||e!==null&&e.dependencies!==null&&qi(e.dependencies)?(typeof s==`function`&&(zs(t,n,s,r),p=t.memoizedState),(u=Pa||Vs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&qi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,dc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ma(t,e.child,null,i),t.child=Ma(t,null,n,i)):tc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ec(e,t,i),e}function hc(e,t,n,r){return Ii(),t.flags|=256,tc(e,t,n,r),t.child}var gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _c(e){return{baseLanes:e,cachePool:ha()}}function vc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Zl),e}function yc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(io.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Oi){if(a?$a(t):no(t),(e=Di)?(e=Y(e,Ai),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ei=t,Di=null)):e=null,e===null)throw Mi(t);return X(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(no(t),a=t.mode,c=xc({mode:`hidden`,children:c},a),r=oi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(null,r)):($a(t),bc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?($a(t),t.flags&=-257,t=Sc(e,t,n)):t.memoizedState===null?(no(t),c=r.fallback,a=t.mode,r=xc({mode:`visible`,children:r.children},a),c=oi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ma(t,e.child,null,n),r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,t=oc(null,r)):(no(t),t.child=e.child,t.flags|=128,t=null);else if($a(t),X(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ri({value:r,source:null,stack:null}),t=Sc(e,t,n)}else if(ec||Ki(e,t,n,!1),s=(n&e.childLanes)!==0,ec||s){if(s=zl,s!==null&&(r=et(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Xr(e,r),vu(s,e,r),$s;lf(c)||Au(),t=Sc(e,t,n)}else lf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Di=df(c.nextSibling),Ei=t,Oi=!0,ki=null,Ai=!1,e!==null&&Ti(t,e),t=bc(t,r.children),t.flags|=4096);return t}return a?(no(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ri(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=oi(c,a,n,null),c.flags|=2):c=ri(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,oc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=_c(n):(a=c.cachePool,a===null?a=ha():(l=ta._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(e.child,r)):($a(t),n=e.child,e=n.sibling,n=ri(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function bc(e,t){return t=xc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function xc(e,t){return e=ti(22,e,null,t),e.lanes=0,e}function Sc(e,t,n){return Ma(t,e.child,null,n),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wi(e.return,t,n)}function wc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Tc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=io.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,L(io,o),tc(e,t,r,n),r=Oi?hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cc(e,n,t);else if(e.tag===19)Cc(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}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ao(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),wc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ao(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}wc(t,!0,n,null,a,r);break;case`together`:wc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ec(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ki(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ri(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ri(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Dc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&qi(e))):!0}function Oc(e,t,n){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),Hi(t,ta,e.memoizedState.cache),Ii();break;case 27:case 5:fe(t);break;case 4:ue(t,t.stateNode.containerInfo);break;case 10:Hi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?($a(t),e=Ec(e,t,n),e===null?null:e.sibling):yc(e,t,n):($a(t),t.flags|=128,null);$a(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ki(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Tc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),L(io,io.current),r)break;return null;case 22:return t.lanes=0,ac(e,t,n,t.pendingProps);case 24:Hi(t,ta,e.memoizedState.cache)}return Ec(e,t,n)}function kc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ec=!0;else{if(!Dc(e,n)&&!(t.flags&128))return ec=!1,Oc(e,t,n);ec=!!(e.flags&131072)}else ec=!1,Oi&&t.flags&1048576&&Si(t,hi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Sa(t.elementType),t.type=e,typeof e==`function`)ni(e)?(r=Us(e,r),t.tag=1,t=mc(null,t,e,r,n)):(t.tag=0,t=fc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=nc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=rc(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,``))}}return t;case 0:return fc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Us(r,t.pendingProps),mc(e,t,r,a,n);case 3:a:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ia(e,t),Ua(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Hi(t,ta,r),r!==o.cache&&Gi(t,[ta],n,!0),Ha(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=hc(e,t,r,n);break a}else if(r!==a){a=di(Error(i(424)),t),Ri(a),t=hc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Di=df(e.firstChild),Ei=t,Oi=!0,ki=null,Ai=!0,n=Na(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ii(),r===a){t=Ec(e,t,n);break a}tc(e,t,r,n)}t=t.child}return t;case 26:return dc(e,t),e===null?(n=Mf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Oi||(n=t.type,e=t.pendingProps,r=Gd(ce.current).createElement(n),r[ot]=t,r[st]=e,zd(r,n,e),yt(r),t.stateNode=r):t.memoizedState=Mf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fe(t),e===null&&Oi&&(r=t.stateNode=hf(t.type,t.pendingProps,ce.current),Ei=t,Ai=!0,a=Di,nf(t.type)?(ff=a,Di=df(r.firstChild)):Di=a),tc(e,t,t.pendingProps.children,n),dc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Oi&&((a=r=Di)&&(r=sf(r,t.type,t.pendingProps,Ai),r===null?a=!1:(t.stateNode=r,Ei=t,Di=df(r.firstChild),Ai=!1,a=!0)),a||Mi(t)),fe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Jd(a,o)?r=null:s!==null&&Jd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=yo(e,t,So,null,null,n),tp._currentValue=a),dc(e,t),tc(e,t,r,n),t.child;case 6:return e===null&&Oi&&((e=n=Di)&&(n=cf(n,t.pendingProps,Ai),n===null?e=!1:(t.stateNode=n,Ei=t,Di=null,e=!0)),e||Mi(t)),null;case 13:return yc(e,t,n);case 4:return ue(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ma(t,null,r,n):tc(e,t,r,n),t.child;case 11:return nc(e,t,t.type,t.pendingProps,n);case 7:return tc(e,t,t.pendingProps,n),t.child;case 8:return tc(e,t,t.pendingProps.children,n),t.child;case 12:return tc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Hi(t,t.type,r.value),tc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ji(t),a=Yi(a),r=r(a),t.flags|=1,tc(e,t,r,n),t.child;case 14:return rc(e,t,t.type,t.pendingProps,n);case 15:return ic(e,t,t.type,t.pendingProps,n);case 19:return Tc(e,t,n);case 31:return uc(e,t,n);case 22:return ac(e,t,n,t.pendingProps);case 24:return Ji(t),r=Yi(ta),e===null?(a=pa(),a===null&&(a=zl,o=na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Fa(t),Hi(t,ta,a)):((e.lanes&n)!==0&&(Ia(e,t),Ua(t,null,null,n),Ha()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Hi(t,ta,r),r!==a.cache&&Gi(t,[ta],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Hi(t,ta,r))),tc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ac(e){e.flags|=4}function jc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Du())e.flags|=8192;else throw Ca=ya,_a}else e.flags&=-16777217}function Mc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!qf(t))if(Du())e.flags|=8192;else throw Ca=ya,_a}function Nc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Je(),e.lanes|=t,Ql|=t)}function Pc(e,t){if(!Oi)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 Fc(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&65011712,r|=i.flags&65011712,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 Ic(e,t,n){var r=t.pendingProps;switch(wi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fc(t),null;case 1:return Fc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ui(ta),de(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?Ac(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Li())),Fc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ac(t),o===null?(Fc(t),jc(t,a,null,r,n)):(Fc(t),Mc(t,o))):o?o===e.memoizedState?(Fc(t),t.flags&=-16777217):(Ac(t),Fc(t),Mc(t,o)):(e=e.memoizedProps,e!==r&&Ac(t),Fc(t),jc(t,a,e,r,n)),null;case 27:if(pe(t),n=ce.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}e=oe.current,Fi(t)?Ni(t,e):(e=hf(a,r,n),t.stateNode=e,Ac(t))}return Fc(t),null;case 5:if(pe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}if(o=oe.current,Fi(t))Ni(t,o);else{var s=Gd(ce.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ot]=t,o[st]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(zd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ac(t)}}return Fc(t),jc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ce.current,Fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ei,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Id(e.nodeValue,n)),e||Mi(t,!0)}else e=Gd(e).createTextNode(r),e[ot]=t,t.stateNode=e}return Fc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Fi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ot]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),e=!1}else n=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ro(t),t):(ro(t),null);if(t.flags&128)throw Error(i(558))}return Fc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Fi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ot]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),a=!1}else a=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ro(t),t):(ro(t),null)}return ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Nc(t,t.updateQueue),Fc(t),null);case 4:return de(),e===null&&Ed(t.stateNode.containerInfo),Fc(t),null;case 10:return Ui(t.type),Fc(t),null;case 19:if(ae(io),r=t.memoizedState,r===null)return Fc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Pc(r,!1);else{if(ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ao(e),o!==null){for(t.flags|=128,Pc(r,!1),e=o.updateQueue,t.updateQueue=e,Nc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ii(n,e),n=n.sibling;return L(io,io.current&1|2),Oi&&xi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ee()>iu&&(t.flags|=128,a=!0,Pc(r,!1),t.lanes=4194304)}else{if(!a)if(e=ao(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Nc(t,e),Pc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Oi)return Fc(t),null}else 2*Ee()-r.renderingStartTime>iu&&n!==536870912&&(t.flags|=128,a=!0,Pc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Fc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ee(),e.sibling=null,n=io.current,L(io,a?n&1|2:n&1),Oi&&xi(t,r.treeForkCount),e);case 22:case 23:return ro(t),Xa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Fc(t),t.subtreeFlags&6&&(t.flags|=8192)):Fc(t),n=t.updateQueue,n!==null&&Nc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ae(fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ui(ta),Fc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Lc(e,t){switch(wi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(ta),de(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(t.memoizedState!==null){if(ro(t),t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(io),null;case 4:return de(),null;case 10:return Ui(t.type),null;case 22:case 23:return ro(t),Xa(),e!==null&&ae(fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ui(ta),null;case 25:return null;default:return null}}function Rc(e,t){switch(wi(t),t.tag){case 3:Ui(ta),de();break;case 26:case 27:case 5:pe(t);break;case 4:de();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:ae(io);break;case 10:Ui(t.type);break;case 22:case 23:ro(t),Xa(),e!==null&&ae(fa);break;case 24:Ui(ta)}}function zc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ju(t,t.return,e)}}function Bc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Ju(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ju(t,t.return,e)}}function Vc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){Ju(e,e.return,t)}}}function Hc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ju(e,t,n)}}function Uc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ju(e,t,n)}}function Wc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Ju(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ju(e,t,n)}else n.current=null}function Gc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ju(e,e.return,t)}}function Kc(e,t,n){try{var r=e.stateNode;Bd(r,e.type,n,t),r[st]=t}catch(t){Ju(e,e.return,t)}}function qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&nf(e.type)||e.tag===4}function Jc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||qc(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.tag===27&&nf(e.type)||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 Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=V));else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(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&&(r===27&&nf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zd(t,r,n),t[ot]=e,t[st]=n}catch(t){Ju(e,e.return,t)}}var Qc=!1,$c=!1,el=!1,tl=typeof WeakSet==`function`?WeakSet:Set,nl=null;function rl(e,t){if(e=e.containerInfo,Ud=up,e=xr(e),Sr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.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||r!==0&&f.nodeType!==3||(l=s+r),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===r&&(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(Wd={focusedElem:e,selectionRange:n},up=!1,nl=t;nl!==null;)if(t=nl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,nl=e;else for(;nl!==null;){switch(t=nl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Us(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ju(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)of(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:of(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,nl=e;break}nl=t.return}}function il(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:yl(e,n),r&4&&zc(5,n);break;case 1:if(yl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ju(n,n.return,e)}else{var i=Us(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ju(n,n.return,e)}}r&64&&Vc(n),r&512&&Uc(n,n.return);break;case 3:if(yl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ga(e,t)}catch(e){Ju(n,n.return,e)}}break;case 27:t===null&&r&4&&Zc(n);case 26:case 5:yl(e,n),t===null&&r&4&&Gc(n),r&512&&Uc(n,n.return);break;case 12:yl(e,n);break;case 31:yl(e,n),r&4&&ul(e,n);break;case 13:yl(e,n),r&4&&dl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Qu.bind(null,n),uf(e,n))));break;case 22:if(r=n.memoizedState!==null||Qc,!r){t=t!==null&&t.memoizedState!==null||$c,i=Qc;var a=$c;Qc=r,($c=t)&&!a?xl(e,n,(n.subtreeFlags&8772)!=0):yl(e,n),Qc=i,$c=a}break;case 30:break;default:yl(e,n)}}function al(e){var t=e.alternate;t!==null&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mt(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}var ol=null,sl=!1;function cl(e,t,n){for(n=n.child;n!==null;)ll(e,t,n),n=n.sibling}function ll(e,t,n){if(Ie&&typeof Ie.onCommitFiberUnmount==`function`)try{Ie.onCommitFiberUnmount(Fe,n)}catch{}switch(n.tag){case 26:$c||Wc(n,t),cl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$c||Wc(n,t);var r=ol,i=sl;nf(n.type)&&(ol=n.stateNode,sl=!1),cl(e,t,n),gf(n.stateNode),ol=r,sl=i;break;case 5:$c||Wc(n,t);case 6:if(r=ol,i=sl,ol=null,cl(e,t,n),ol=r,sl=i,ol!==null)if(sl)try{(ol.nodeType===9?ol.body:ol.nodeName===`HTML`?ol.ownerDocument.body:ol).removeChild(n.stateNode)}catch(e){Ju(n,t,e)}else try{ol.removeChild(n.stateNode)}catch(e){Ju(n,t,e)}break;case 18:ol!==null&&(sl?(e=ol,rf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Ip(e)):rf(ol,n.stateNode));break;case 4:r=ol,i=sl,ol=n.stateNode.containerInfo,sl=!0,cl(e,t,n),ol=r,sl=i;break;case 0:case 11:case 14:case 15:Bc(2,n,t),$c||Bc(4,n,t),cl(e,t,n);break;case 1:$c||(Wc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Hc(n,t,r)),cl(e,t,n);break;case 21:cl(e,t,n);break;case 22:$c=(r=$c)||n.memoizedState!==null,cl(e,t,n),$c=r;break;default:cl(e,t,n)}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ip(e)}catch(e){Ju(t,t.return,e)}}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ip(e)}catch(e){Ju(t,t.return,e)}}function fl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tl),t;default:throw Error(i(435,e.tag))}}function pl(e,t){var n=fl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=$u.bind(null,e,t);t.then(r,r)}})}function ml(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(nf(c.type)){ol=c.stateNode,sl=!1;break a}break;case 5:ol=c.stateNode,sl=!1;break a;case 3:case 4:ol=c.stateNode.containerInfo,sl=!0;break a}c=c.return}if(ol===null)throw Error(i(160));ll(o,s,a),ol=null,sl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gl(t,e),t=t.sibling}var hl=null;function gl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ml(t,e),_l(e),r&4&&(Bc(3,e,e.return),zc(3,e),Bc(5,e,e.return));break;case 1:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),r&64&&Qc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=hl;if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[pt]||o[ot]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),zd(o,r,n),o[ot]=e,yt(o),r=o;break a;case`link`:var s=Wf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Wf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ot]=e,yt(o),r=o}e.stateNode=r}else Gf(a,e.type,e.stateNode);else e.stateNode=zf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Kc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Gf(a,e.type,e.stateNode):zf(a,r,e.memoizedProps))}break;case 27:ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),n!==null&&r&4&&Kc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ml(t,e),_l(e),r&512&&($c||n===null||Wc(n,n.return)),e.flags&32){a=e.stateNode;try{Gt(a,``)}catch(t){Ju(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Kc(e,a,n===null?a:n.memoizedProps)),r&1024&&(el=!0);break;case 6:if(ml(t,e),_l(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ju(e,e.return,t)}}break;case 3:if(Uf=null,a=hl,hl=yf(t.containerInfo),ml(t,e),hl=a,_l(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ip(t.containerInfo)}catch(t){Ju(e,e.return,t)}el&&(el=!1,vl(e));break;case 4:r=hl,hl=yf(e.stateNode.containerInfo),ml(t,e),_l(e),hl=r;break;case 12:ml(t,e),_l(e);break;case 31:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 13:ml(t,e),_l(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(nu=Ee()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Qc,d=$c;if(Qc=u||a,$c=d||l,ml(t,e),$c=d,Qc=u,_l(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Qc||$c||bl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ju(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ju(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?af(m,!0):af(l.stateNode,!1)}catch(e){Ju(l,l.return,e)}}}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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,pl(e,n))));break;case 19:ml(t,e),_l(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,pl(e,r)));break;case 30:break;case 21:break;default:ml(t,e),_l(e)}}function _l(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(qc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Xc(e,Jc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Gt(o,``),n.flags&=-33),Xc(e,Jc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Yc(e,Jc(e),s);break;default:throw Error(i(161))}}catch(t){Ju(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function yl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)il(e,t.alternate,t),t=t.sibling}function bl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Bc(4,t,t.return),bl(t);break;case 1:Wc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Hc(t,t.return,n),bl(t);break;case 27:gf(t.stateNode);case 26:case 5:Wc(t,t.return),bl(t);break;case 22:t.memoizedState===null&&bl(t);break;case 30:bl(t);break;default:bl(t)}e=e.sibling}}function xl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:xl(i,a,n),zc(4,a);break;case 1:if(xl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ju(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Wa(c[i],s)}catch(e){Ju(r,r.return,e)}}n&&o&64&&Vc(a),Uc(a,a.return);break;case 27:Zc(a);case 26:case 5:xl(i,a,n),n&&r===null&&o&4&&Gc(a),Uc(a,a.return);break;case 12:xl(i,a,n);break;case 31:xl(i,a,n),n&&o&4&&ul(i,a);break;case 13:xl(i,a,n),n&&o&4&&dl(i,a);break;case 22:a.memoizedState===null&&xl(i,a,n),Uc(a,a.return);break;case 30:break;default:xl(i,a,n)}t=t.sibling}}function Sl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ra(n))}function Cl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e))}function wl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tl(e,t,n,r),t=t.sibling}function Tl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:wl(e,t,n,r),i&2048&&zc(9,t);break;case 1:wl(e,t,n,r);break;case 3:wl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e)));break;case 12:if(i&2048){wl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ju(t,t.return,e)}}else wl(e,t,n,r);break;case 31:wl(e,t,n,r);break;case 13:wl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?wl(e,t,n,r):(a._visibility|=2,El(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?wl(e,t,n,r):Dl(e,t),i&2048&&Sl(o,t);break;case 24:wl(e,t,n,r),i&2048&&Cl(t.alternate,t);break;default:wl(e,t,n,r)}}function El(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:El(a,o,s,c,i),zc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,El(a,o,s,c,i)):u._visibility&2?El(a,o,s,c,i):Dl(a,o),i&&l&2048&&Sl(o.alternate,o);break;case 24:El(a,o,s,c,i),i&&l&2048&&Cl(o.alternate,o);break;default:El(a,o,s,c,i)}t=t.sibling}}function Dl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Dl(n,r),i&2048&&Sl(r.alternate,r);break;case 24:Dl(n,r),i&2048&&Cl(r.alternate,r);break;default:Dl(n,r)}t=t.sibling}}var Ol=8192;function kl(e,t,n){if(e.subtreeFlags&Ol)for(e=e.child;e!==null;)Al(e,t,n),e=e.sibling}function Al(e,t,n){switch(e.tag){case 26:kl(e,t,n),e.flags&Ol&&e.memoizedState!==null&&Jf(n,hl,e.memoizedState,e.memoizedProps);break;case 5:kl(e,t,n);break;case 3:case 4:var r=hl;hl=yf(e.stateNode.containerInfo),kl(e,t,n),hl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ol,Ol=16777216,kl(e,t,n),Ol=r):kl(e,t,n));break;default:kl(e,t,n)}}function jl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nl(e),e=e.sibling}function Nl(e){switch(e.tag){case 0:case 11:case 15:Ml(e),e.flags&2048&&Bc(9,e,e.return);break;case 3:Ml(e);break;case 12:Ml(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Pl(e)):Ml(e);break;default:Ml(e)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,Fl(r,e)}jl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Bc(8,t,t.return),Pl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Pl(t));break;default:Pl(t)}e=e.sibling}}function Fl(e,t){for(;nl!==null;){var n=nl;switch(n.tag){case 0:case 11:case 15:Bc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ra(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,nl=r;else a:for(n=e;nl!==null;){r=nl;var i=r.sibling,a=r.return;if(al(r),r===n){nl=null;break a}if(i!==null){i.return=a,nl=i;break a}nl=a}}}var Il={getCacheForType:function(e){var t=Yi(ta),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Yi(ta).controller.signal}},Ll=typeof WeakMap==`function`?WeakMap:Map,Rl=0,zl=null,q=null,Bl=0,Vl=0,Hl=null,Ul=!1,Wl=!1,Gl=!1,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=null,eu=null,tu=!1,nu=0,ru=0,iu=1/0,au=null,ou=null,su=0,cu=null,lu=null,uu=0,du=0,fu=null,pu=null,mu=0,hu=null;function gu(){return Rl&2&&Bl!==0?Bl&-Bl:F.T===null?rt():hd()}function _u(){if(Zl===0)if(!(Bl&536870912)||Oi){var e=He;He<<=1,!(He&3932160)&&(He=262144),Zl=e}else Zl=536870912;return e=Za.current,e!==null&&(e.flags|=32),Zl}function vu(e,t,n){(e===zl&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)&&(Tu(e,0),Su(e,Bl,Zl,!1)),Xe(e,n),(!(Rl&2)||e!==zl)&&(e===zl&&(!(Rl&2)&&(Yl|=n),ql===4&&Su(e,Bl,Zl,!1)),sd(e))}function yu(e,t,n){if(Rl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ke(e,t),a=r?Nu(e,t):ju(e,t,!0),o=r;do{if(a===0){Wl&&!r&&Su(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!xu(n)){a=ju(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=$l;var l=c.current.memoizedState.isDehydrated;if(l&&(Tu(c,s).flags|=256),s=ju(c,s,!1),s!==2){if(Gl&&!l){c.errorRecoveryDisabledLanes|=o,Yl|=o,a=4;break a}o=eu,eu=a,o!==null&&(eu===null?eu=o:eu.push.apply(eu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Tu(e,0),Su(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Su(r,t,Zl,!Ul);break a;case 2:eu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=nu+300-Ee(),10<a)){if(Su(r,t,Zl,!Ul),Ge(r,0,!0)!==0)break a;uu=t,r.timeoutHandle=Zd(bu.bind(null,r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,`Throttled`,-0,0),a);break a}bu(r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,null,-0,0)}}break}while(1);sd(e)}function bu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:V},Al(t,a,d);var m=(a&62914560)===a?nu-Ee():(a&4194048)===a?ru-Ee():0;if(m=Xf(d,m),m!==null){uu=a,e.cancelPendingCommit=m(Bu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Su(e,a,o,!l);return}}Bu(e,t,a,n,r,i,o,s,c)}function xu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,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(!gr(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 Su(e,t,n,r){t&=~Xl,t&=~Yl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Le(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Qe(e,n,t)}function Cu(){return Rl&6?!0:(cd(0,!1),!1)}function wu(){if(q!==null){if(Vl===0)var e=q.return;else e=q,Vi=Bi=null,To(e),Ea=null,Da=0,e=q;for(;e!==null;)Rc(e.alternate,e),e=e.return;q=null}}function Tu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),uu=0,wu(),zl=e,q=n=ri(e.current,null),Bl=t,Vl=0,Hl=null,Ul=!1,Wl=Ke(e,t),Gl=!1,Ql=Zl=Xl=Yl=Jl=ql=0,eu=$l=null,tu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Le(r),a=1<<i;t|=e[i],r&=~a}return Kl=t,qr(),n}function Eu(e,t){K=null,F.H=Fs,t===ga||t===va?(t=wa(),Vl=3):t===_a?(t=wa(),Vl=4):Vl=t===$s?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Hl=t,q===null&&(ql=1,qs(e,di(t,e.current)))}function Du(){var e=Za.current;return e===null?!0:(Bl&4194048)===Bl?Qa===null:(Bl&62914560)===Bl||Bl&536870912?e===Qa:!1}function Ou(){var e=F.H;return F.H=Fs,e===null?Fs:e}function ku(){var e=F.A;return F.A=Il,e}function Au(){ql=4,Ul||(Bl&4194048)!==Bl&&Za.current!==null||(Wl=!0),!(Jl&134217727)&&!(Yl&134217727)||zl===null||Su(zl,Bl,Zl,!1)}function ju(e,t,n){var r=Rl;Rl|=2;var i=Ou(),a=ku();(zl!==e||Bl!==t)&&(au=null,Tu(e,t)),t=!1;var o=ql;a:do try{if(Vl!==0&&q!==null){var s=q,c=Hl;switch(Vl){case 8:wu(),o=6;break a;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var l=Vl;if(Vl=0,Hl=null,Lu(e,s,c,l),n&&Wl){o=0;break a}break;default:l=Vl,Vl=0,Hl=null,Lu(e,s,c,l)}}Mu(),o=ql;break}catch(t){Eu(e,t)}while(1);return t&&e.shellSuspendCounter++,Vi=Bi=null,Rl=r,F.H=i,F.A=a,q===null&&(zl=null,Bl=0,qr()),o}function Mu(){for(;q!==null;)Fu(q)}function Nu(e,t){var n=Rl;Rl|=2;var r=Ou(),a=ku();zl!==e||Bl!==t?(au=null,iu=Ee()+500,Tu(e,t)):Wl=Ke(e,t);a:do try{if(Vl!==0&&q!==null){t=q;var o=Hl;b:switch(Vl){case 1:Vl=0,Hl=null,Lu(e,t,o,1);break;case 2:case 9:if(ba(o)){Vl=0,Hl=null,Iu(t);break}t=function(){Vl!==2&&Vl!==9||zl!==e||(Vl=7),sd(e)},o.then(t,t);break a;case 3:Vl=7;break a;case 4:Vl=5;break a;case 7:ba(o)?(Vl=0,Hl=null,Iu(t)):(Vl=0,Hl=null,Lu(e,t,o,7));break;case 5:var s=null;switch(q.tag){case 26:s=q.memoizedState;case 5:case 27:var c=q;if(s?qf(s):c.stateNode.complete){Vl=0,Hl=null;var l=c.sibling;if(l!==null)q=l;else{var u=c.return;u===null?q=null:(q=u,Ru(u))}break b}}Vl=0,Hl=null,Lu(e,t,o,5);break;case 6:Vl=0,Hl=null,Lu(e,t,o,6);break;case 8:wu(),ql=6;break a;default:throw Error(i(462))}}Pu();break}catch(t){Eu(e,t)}while(1);return Vi=Bi=null,F.H=r,F.A=a,Rl=n,q===null?(zl=null,Bl=0,qr(),ql):0}function Pu(){for(;q!==null&&!we();)Fu(q)}function Fu(e){var t=kc(e.alternate,e,Kl);e.memoizedProps=e.pendingProps,t===null?Ru(e):q=t}function Iu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=pc(n,t,t.pendingProps,t.type,void 0,Bl);break;case 11:t=pc(n,t,t.pendingProps,t.type.render,t.ref,Bl);break;case 5:To(t);default:Rc(n,t),t=q=ii(t,Kl),t=kc(n,t,Kl)}e.memoizedProps=e.pendingProps,t===null?Ru(e):q=t}function Lu(e,t,n,r){Vi=Bi=null,To(t),Ea=null,Da=0;var i=t.return;try{if(Qs(e,i,t,n,Bl)){ql=1,qs(e,di(n,e.current)),q=null;return}}catch(t){if(i!==null)throw q=i,t;ql=1,qs(e,di(n,e.current)),q=null;return}t.flags&32768?(Oi||r===1?e=!0:Wl||Bl&536870912?e=!1:(Ul=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.current,r!==null&&r.tag===13&&(r.flags|=16384))),zu(t,e)):Ru(t)}function Ru(e){var t=e;do{if(t.flags&32768){zu(t,Ul);return}e=t.return;var n=Ic(t.alternate,t,Kl);if(n!==null){q=n;return}if(t=t.sibling,t!==null){q=t;return}q=t=e}while(t!==null);ql===0&&(ql=5)}function zu(e,t){do{var n=Lc(e.alternate,e);if(n!==null){n.flags&=32767,q=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){q=e;return}q=e=n}while(e!==null);ql=6,q=null}function Bu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Gu();while(su!==0);if(Rl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Kr,Ze(e,n,o,s,c,l),e===zl&&(q=zl=null,Bl=0),lu=t,cu=e,uu=n,du=o,fu=a,pu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ed(Ae,function(){return Ku(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=F.T,F.T=null,a=I.p,I.p=2,s=Rl,Rl|=4;try{rl(e,t,n)}finally{Rl=s,I.p=a,F.T=r}}su=1,Vu(),Hu(),Uu()}}function Vu(){if(su===1){su=0;var e=cu,t=lu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Rl;Rl|=4;try{gl(t,e);var a=Wd,o=xr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&br(s.ownerDocument.documentElement,s)){if(c!==null&&Sr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=yr(s,h),v=yr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}up=!!Ud,Wd=Ud=null}finally{Rl=i,I.p=r,F.T=n}}e.current=t,su=2}}function Hu(){if(su===2){su=0;var e=cu,t=lu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Rl;Rl|=4;try{il(e,t.alternate,t)}finally{Rl=i,I.p=r,F.T=n}}su=3}}function Uu(){if(su===4||su===3){su=0,Te();var e=cu,t=lu,n=uu,r=pu;t.subtreeFlags&10256||t.flags&10256?su=5:(su=0,lu=cu=null,Wu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ou=null),nt(n),t=t.stateNode,Ie&&typeof Ie.onCommitFiberRoot==`function`)try{Ie.onCommitFiberRoot(Fe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=F.T,i=I.p,I.p=2,F.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{F.T=t,I.p=i}}uu&3&&Gu(),sd(e),i=e.pendingLanes,n&261930&&i&42?e===hu?mu++:(mu=0,hu=e):mu=0,cd(0,!1)}}function Wu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ra(t)))}function Gu(){return Vu(),Hu(),Uu(),Ku()}function Ku(){if(su!==5)return!1;var e=cu,t=du;du=0;var n=nt(uu),r=F.T,a=I.p;try{I.p=32>n?32:n,F.T=null,n=fu,fu=null;var o=cu,s=uu;if(su=0,lu=cu=null,uu=0,Rl&6)throw Error(i(331));var c=Rl;if(Rl|=4,Nl(o.current),Tl(o,o.current,s,n),Rl=c,cd(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot==`function`)try{Ie.onPostCommitFiberRoot(Fe,o)}catch{}return!0}finally{I.p=a,F.T=r,Wu(e,t)}}function qu(e,t,n){t=di(n,t),t=Ys(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(Xe(e,2),sd(e))}function Ju(e,t,n){if(e.tag===3)qu(e,e,n);else for(;t!==null;){if(t.tag===3){qu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ou===null||!ou.has(r))){e=di(n,e),n=Xs(2),r=Ra(t,n,2),r!==null&&(Zs(n,r,t,e),Xe(r,2),sd(r));break}}t=t.return}}function Yu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ll;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)||(Gl=!0,i.add(n),e=Xu.bind(null,e,t,n),t.then(e,e))}function Xu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,zl===e&&(Bl&n)===n&&(ql===4||ql===3&&(Bl&62914560)===Bl&&300>Ee()-nu?!(Rl&2)&&Tu(e,0):Xl|=n,Ql===Bl&&(Ql=0)),sd(e)}function Zu(e,t){t===0&&(t=Je()),e=Xr(e,t),e!==null&&(Xe(e,t),sd(e))}function Qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zu(e,n)}function $u(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Zu(e,n)}function ed(e,t){return Se(e,t)}var td=null,nd=null,rd=!1,id=!1,ad=!1,od=0;function sd(e){e!==nd&&e.next===null&&(nd===null?td=nd=e:nd=nd.next=e),id=!0,rd||(rd=!0,md())}function cd(e,t){if(!ad&&id){ad=!0;do for(var n=!1,r=td;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Le(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,pd(r,a))}else a=Bl,a=Ge(r,r===zl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ke(r,a)||(n=!0,pd(r,a));r=r.next}while(n);ad=!1}}function ld(){ud()}function ud(){id=rd=!1;var e=0;od!==0&&Xd()&&(e=od);for(var t=Ee(),n=null,r=td;r!==null;){var i=r.next,a=dd(r,t);a===0?(r.next=null,n===null?td=i:n.next=i,i===null&&(nd=n)):(n=r,(e!==0||a&3)&&(id=!0)),r=i}su!==0&&su!==5||cd(e,!1),od!==0&&(od=0)}function dd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Le(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=qe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=zl,n=Bl,n=Ge(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ce(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ke(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ce(r),nt(n)){case 2:case 8:n=ke;break;case 32:n=Ae;break;case 268435456:n=Me;break;default:n=Ae}return r=fd.bind(null,e),n=Se(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ce(r),e.callbackPriority=2,e.callbackNode=null,2}function fd(e,t){if(su!==0&&su!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Gu()&&e.callbackNode!==n)return null;var r=Bl;return r=Ge(e,e===zl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(yu(e,r,t),dd(e,Ee()),e.callbackNode!=null&&e.callbackNode===n?fd.bind(null,e):null)}function pd(e,t){if(Gu())return null;yu(e,t,!0)}function md(){ef(function(){Rl&6?Se(Oe,ld):ud()})}function hd(){if(od===0){var e=oa;e===0&&(e=Ve,Ve<<=1,!(Ve&261888)&&(Ve=256)),od=e}return od}function gd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:B(``+e)}function _d(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function vd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=gd((i[st]||null).action),o=r.submitter;o&&(t=(t=o[st]||null)?gd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new _n(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(od!==0){var e=o?_d(i,o):new FormData(i);xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?_d(i,o):new FormData(i),xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var yd=0;yd<Vr.length;yd++){var bd=Vr[yd];Hr(bd.toLowerCase(),`on`+(bd[0].toUpperCase()+bd.slice(1)))}Hr(Nr,`onAnimationEnd`),Hr(Pr,`onAnimationIteration`),Hr(Fr,`onAnimationStart`),Hr(`dblclick`,`onDoubleClick`),Hr(`focusin`,`onFocus`),Hr(`focusout`,`onBlur`),Hr(Ir,`onTransitionRun`),Hr(Lr,`onTransitionStart`),Hr(Rr,`onTransitionCancel`),Hr(zr,`onTransitionEnd`),Ct(`onMouseEnter`,[`mouseout`,`mouseover`]),Ct(`onMouseLeave`,[`mouseout`,`mouseover`]),Ct(`onPointerEnter`,[`pointerout`,`pointerover`]),Ct(`onPointerLeave`,[`pointerout`,`pointerover`]),St(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),St(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),St(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),St(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var xd=`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(` `),Sd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(xd));function Cd(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;a=s,i.currentTarget=l;try{a(i)}catch(e){Ur(e)}i.currentTarget=null,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;a=s,i.currentTarget=l;try{a(i)}catch(e){Ur(e)}i.currentTarget=null,a=c}}}}function J(e,t){var n=t[lt];n===void 0&&(n=t[lt]=new Set);var r=e+`__bubble`;n.has(r)||(Dd(t,e,2,!1),n.add(r))}function wd(e,t,n){var r=0;t&&(r|=4),Dd(n,e,r,t)}var Td=`_reactListening`+Math.random().toString(36).slice(2);function Ed(e){if(!e[Td]){e[Td]=!0,bt.forEach(function(t){t!==`selectionchange`&&(Sd.has(t)||wd(t,!1,e),wd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Td]||(t[Td]=!0,wd(`selectionchange`,!1,t))}}function Dd(e,t,n,r){switch(_p(t)){case 2:var i=dp;break;case 8:i=fp;break;default:i=pp}n=i.bind(null,t,n,e),i=void 0,!on||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 Od(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ht(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}nn(function(){var r=a,i=Zt(n),s=[];a:{var c=Br.get(e);if(c!==void 0){var l=_n,u=e;switch(e){case`keypress`:if(fn(n)===0)break a;case`keydown`:case`keyup`:l=Fn;break;case`focusin`:u=`focus`,l=En;break;case`focusout`:u=`blur`,l=En;break;case`beforeblur`:case`afterblur`:l=En;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`:l=wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Tn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Ln;break;case Nr:case Pr:case Fr:l=Dn;break;case zr:l=Rn;break;case`scroll`:case`scrollend`:l=yn;break;case`wheel`:l=zn;break;case`copy`:case`cut`:case`paste`:l=On;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=In;break;case`toggle`:case`beforetoggle`:l=Bn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=rn(m,p),g!=null&&d.push(kd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==H&&(u=n.relatedTarget||n.fromElement)&&(ht(u)||u[ct]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ht(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=In,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:_t(l),h=u==null?c:_t(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ht(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=jd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Md(s,c,l,d,!1),u!==null&&f!==null&&Md(s,f,u,d,!0)}}a:{if(c=r?_t(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ir;else if($n(c))if(ar)v=mr;else{v=fr;var y=dr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Jt(r.elementType)&&(v=ir):v=pr;if(v&&=v(e,r)){er(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Vt(c,`number`,c.value)}switch(y=r?_t(r):window,e){case`focusin`:($n(y)||y.contentEditable===`true`)&&(wr=y,Tr=r,Er=null);break;case`focusout`:Er=Tr=wr=null;break;case`mousedown`:Dr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Dr=!1,Or(s,n,i);break;case`selectionchange`:if(Cr)break;case`keydown`:case`keyup`:Or(s,n,i)}var b;if(Hn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Yn?Jn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Gn&&n.locale!==`ko`&&(Yn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Yn&&(b=dn()):(cn=i,ln=`value`in cn?cn.value:cn.textContent,Yn=!0)),y=Ad(r,x),0<y.length&&(x=new kn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=U(n),b!==null&&(x.data=b)))),(b=Wn?Xn(e,n):Zn(e,n))&&(x=Ad(r,`onBeforeInput`),0<x.length&&(y=new kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),vd(s,e,r,n,i)}Cd(s,t)})}function kd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ad(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=rn(e,n),i!=null&&r.unshift(kd(e,i,a)),i=rn(e,t),i!=null&&r.push(kd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function jd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Md(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(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=rn(n,a),l!=null&&o.unshift(kd(n,l,c))):i||(l=rn(n,a),l!=null&&o.push(kd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Nd=/\\r\\n?/g,Pd=/\\u0000|\\uFFFD/g;function Fd(e){return(typeof e==`string`?e:``+e).replace(Nd,`\n`).replace(Pd,``)}function Id(e,t){return t=Fd(t),Fd(e)===t}function Ld(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Gt(e,``+r);break;case`className`:kt(e,`class`,r);break;case`tabIndex`:kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:kt(e,n,r);break;case`style`:qt(e,r,o);break;case`data`:if(t!==`object`){kt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=B(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Ld(e,t,`name`,a.name,a,null),Ld(e,t,`formEncType`,a.formEncType,a,null),Ld(e,t,`formMethod`,a.formMethod,a,null),Ld(e,t,`formTarget`,a.formTarget,a,null)):(Ld(e,t,`encType`,a.encType,a,null),Ld(e,t,`method`,a.method,a,null),Ld(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=B(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=V);break;case`onScroll`:r!=null&&J(`scroll`,e);break;case`onScrollEnd`:r!=null&&J(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=B(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:J(`beforetoggle`,e),J(`toggle`,e),Ot(e,`popover`,r);break;case`xlinkActuate`:At(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:At(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:At(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:At(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ot(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Yt.get(n)||n,Ot(e,n,r))}}function Rd(e,t,n,r,a,o){switch(n){case`style`:qt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Gt(e,``+r);break;case`onScroll`:r!=null&&J(`scroll`,e);break;case`onScrollEnd`:r!=null&&J(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=V);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!xt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[st]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ot(e,n,r)}}}function zd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:J(`error`,e),J(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ld(e,t,o,s,n,null)}}a&&Ld(e,t,`srcSet`,n.srcSet,n,null),r&&Ld(e,t,`src`,n.src,n,null);return;case`input`:J(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Ld(e,t,r,d,n,null)}}Bt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in J(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Ld(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ht(e,!!r,n,!0):Ht(e,!!r,t,!1);return;case`textarea`:for(s in J(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Ld(e,t,s,c,n,null)}Wt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Ld(e,t,l,r,n,null)}return;case`dialog`:J(`beforetoggle`,e),J(`toggle`,e),J(`cancel`,e),J(`close`,e);break;case`iframe`:case`object`:J(`load`,e);break;case`video`:case`audio`:for(r=0;r<xd.length;r++)J(xd[r],e);break;case`image`:J(`error`,e),J(`load`,e);break;case`details`:J(`toggle`,e);break;case`embed`:case`source`:case`link`:J(`error`,e),J(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ld(e,t,u,r,n,null)}return;default:if(Jt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Rd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Ld(e,t,c,r,n,null))}function Bd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Ld(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Ld(e,t,p,m,r,f)}}zt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Ld(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Ld(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ht(e,!!n,n?[]:``,!1):Ht(e,!!n,t,!0)):Ht(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Ld(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Ld(e,t,s,a,r,o)}Ut(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Ld(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Ld(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Ld(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Ld(e,t,u,p,r,m)}return;default:if(Jt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Rd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Rd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Ld(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Ld(e,t,f,p,r,m)}function Vd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Hd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Vd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Vd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Ud=null,Wd=null;function Gd(e){return e.nodeType===9?e:e.ownerDocument}function Kd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function qd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Jd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Yd=null;function Xd(){var e=window.event;return e&&e.type===`popstate`?e===Yd?!1:(Yd=e,!0):(Yd=null,!1)}var Zd=typeof setTimeout==`function`?setTimeout:void 0,Qd=typeof clearTimeout==`function`?clearTimeout:void 0,$d=typeof Promise==`function`?Promise:void 0,ef=typeof queueMicrotask==`function`?queueMicrotask:$d===void 0?Zd:function(e){return $d.resolve(null).then(e).catch(tf)};function tf(e){setTimeout(function(){throw e})}function nf(e){return e===`head`}function rf(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===`/$`||n===`/&`){if(r===0){e.removeChild(i),Ip(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)gf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,gf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[pt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&gf(e.ownerDocument.body);n=i}while(n);Ip(t)}function af(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function of(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:of(n),mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[pt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=df(e.nextSibling),e===null)break}return null}function cf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=df(e.nextSibling),e===null))return null;return e}function Y(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=df(e.nextSibling),e===null))return null;return e}function lf(e){return e.data===`$?`||e.data===`$~`}function X(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function uf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function df(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===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var ff=null;function pf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return df(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function mf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function hf(e,t,n){switch(t=Gd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function gf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mt(e)}var _f=new Map,vf=new Set;function yf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var bf=I.d;I.d={f:xf,r:Sf,D:Tf,C:Ef,L:Df,m:Of,X:Af,S:kf,M:jf};function xf(){var e=bf.f(),t=Cu();return e||t}function Sf(e){var t=gt(e);t!==null&&t.tag===5&&t.type===`form`?Cs(t):bf.r(e)}var Cf=typeof document>`u`?null:document;function wf(e,t,n){var r=Cf;if(r&&typeof t==`string`&&t){var i=Rt(t);i=`link[rel=\"`+e+`\"][href=\"`+i+`\"]`,typeof n==`string`&&(i+=`[crossorigin=\"`+n+`\"]`),vf.has(i)||(vf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),zd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Tf(e){bf.D(e),wf(`dns-prefetch`,e,null)}function Ef(e,t){bf.C(e,t),wf(`preconnect`,e,t)}function Df(e,t,n){bf.L(e,t,n);var r=Cf;if(r&&e&&t){var i=`link[rel=\"preload\"][as=\"`+Rt(t)+`\"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset=\"`+Rt(n.imageSrcSet)+`\"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes=\"`+Rt(n.imageSizes)+`\"]`)):i+=`[href=\"`+Rt(e)+`\"]`;var a=i;switch(t){case`style`:a=Nf(e);break;case`script`:a=Lf(e)}_f.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),_f.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Pf(a))||t===`script`&&r.querySelector(Rf(a))||(t=r.createElement(`link`),zd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Of(e,t){bf.m(e,t);var n=Cf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel=\"modulepreload\"][as=\"`+Rt(r)+`\"][href=\"`+Rt(e)+`\"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Lf(e)}if(!_f.has(a)&&(e=h({rel:`modulepreload`,href:e},t),_f.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Rf(a)))return}r=n.createElement(`link`),zd(r,`link`,e),yt(r),n.head.appendChild(r)}}}function kf(e,t,n){bf.S(e,t,n);var r=Cf;if(r&&e){var i=vt(r).hoistableStyles,a=Nf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Pf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,\"data-precedence\":t},n),(n=_f.get(a))&&Vf(e,n);var c=o=r.createElement(`link`);yt(c),zd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Bf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Af(e,t){bf.X(e,t);var n=Cf;if(n&&e){var r=vt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=h({src:e,async:!0},t),(t=_f.get(i))&&Hf(e,t),a=n.createElement(`script`),yt(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t){bf.M(e,t);var n=Cf;if(n&&e){var r=vt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=_f.get(i))&&Hf(e,t),a=n.createElement(`script`),yt(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t,n,r){var a=(a=ce.current)?yf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Nf(n.href),n=vt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Nf(n.href);var o=vt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Pf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),_f.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},_f.set(e,n),o||If(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Lf(n),n=vt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Nf(e){return`href=\"`+Rt(e)+`\"`}function Pf(e){return`link[rel=\"stylesheet\"][`+e+`]`}function Ff(e){return h({},e,{\"data-precedence\":e.precedence,precedence:null})}function If(e,t,n,r){e.querySelector(`link[rel=\"preload\"][as=\"style\"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),zd(t,`link`,n),yt(t),e.head.appendChild(t))}function Lf(e){return`[src=\"`+Rt(e)+`\"]`}function Rf(e){return`script[async]`+e}function zf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~=\"`+Rt(n.href)+`\"]`);if(r)return t.instance=r,yt(r),r;var a=h({},n,{\"data-href\":n.href,\"data-precedence\":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),yt(r),zd(r,`style`,a),Bf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Nf(n.href);var o=e.querySelector(Pf(a));if(o)return t.state.loading|=4,t.instance=o,yt(o),o;r=Ff(n),(a=_f.get(a))&&Vf(r,a),o=(e.ownerDocument||e).createElement(`link`),yt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),zd(o,`link`,r),t.state.loading|=4,Bf(o,n.precedence,e),t.instance=o;case`script`:return o=Lf(n.src),(a=e.querySelector(Rf(o)))?(t.instance=a,yt(a),a):(r=n,(a=_f.get(o))&&(r=h({},n),Hf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),yt(a),zd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Bf(r,n.precedence,e));return t.instance}function Bf(e,t,n){for(var r=n.querySelectorAll(`link[rel=\"stylesheet\"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Uf=null;function Wf(e,t,n){if(Uf===null){var r=new Map,i=Uf=new Map;i.set(n,r)}else i=Uf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[pt]||a[ot]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Gf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Kf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function qf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Jf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Nf(r.href),a=t.querySelector(Pf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Zf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,yt(a);return}a=t.ownerDocument||t,r=Ff(r),(i=_f.get(i))&&Vf(r,i),a=a.createElement(`link`),yt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),zd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Zf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Yf=0;function Xf(e,t){return e.stylesheets&&e.count===0&&$f(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&$f(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Yf===0&&(Yf=62500*Hd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&$f(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Yf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Zf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$f(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qf=null;function $f(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qf=new Map,t.forEach(ep,e),Qf=null,Zf.call(e))}function ep(e,t){if(!(t.state.loading&4)){var n=Qf.get(e);if(n)var r=n.get(null);else{n=new Map,Qf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Zf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var tp={$$typeof:C,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function np(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ye(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ye(0),this.hiddenUpdates=Ye(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function rp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new np(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ti(3,null,null,t),e.current=a,a.stateNode=e,t=na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Fa(a),e}function ip(e){return e?(e=$r,e):$r}function ap(e,t,n,r,i,a){i=ip(i),r.context===null?r.context=i:r.pendingContext=i,r=La(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ra(e,r,t),n!==null&&(vu(n,e,t),za(n,e,t))}function op(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function sp(e,t){op(e,t),(e=e.alternate)&&op(e,t)}function cp(e){if(e.tag===13||e.tag===31){var t=Xr(e,67108864);t!==null&&vu(t,e,67108864),sp(e,67108864)}}function lp(e){if(e.tag===13||e.tag===31){var t=gu();t=tt(t);var n=Xr(e,t);n!==null&&vu(n,e,t),sp(e,t)}}var up=!0;function dp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,pp(e,t,n,r)}finally{I.p=a,F.T=i}}function fp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,pp(e,t,n,r)}finally{I.p=a,F.T=i}}function pp(e,t,n,r){if(up){var i=mp(r);if(i===null)Od(e,t,r,hp,n),Ep(e,r);else if(Op(i,e,t,n,r))r.stopPropagation();else if(Ep(e,r),t&4&&-1<Tp.indexOf(e)){for(;i!==null;){var a=gt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=We(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Le(o);s.entanglements[1]|=c,o&=~c}sd(a),!(Rl&6)&&(iu=Ee()+500,cd(0,!1))}}break;case 31:case 13:s=Xr(a,2),s!==null&&vu(s,a,2),Cu(),sp(a,2)}if(a=mp(r),a===null&&Od(e,t,r,hp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Od(e,t,r,null,n)}}function mp(e){return e=Zt(e),gp(e)}var hp=null;function gp(e){if(hp=null,e=ht(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 hp=e,null}function _p(e){switch(e){case`beforetoggle`: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`toggle`: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 2;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`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(De()){case Oe:return 2;case ke:return 8;case Ae:case je:return 32;case Me:return 268435456;default:return 32}default:return 32}}var vp=!1,yp=null,bp=null,xp=null,Sp=new Map,Cp=new Map,wp=[],Tp=`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`.split(` `);function Ep(e,t){switch(e){case`focusin`:case`focusout`:yp=null;break;case`dragenter`:case`dragleave`:bp=null;break;case`mouseover`:case`mouseout`:xp=null;break;case`pointerover`:case`pointerout`:Sp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Cp.delete(t.pointerId)}}function Dp(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=gt(t),t!==null&&cp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Op(e,t,n,r,i){switch(t){case`focusin`:return yp=Dp(yp,e,t,n,r,i),!0;case`dragenter`:return bp=Dp(bp,e,t,n,r,i),!0;case`mouseover`:return xp=Dp(xp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Sp.set(a,Dp(Sp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Cp.set(a,Dp(Cp.get(a)||null,e,t,n,r,i)),!0}return!1}function kp(e){var t=ht(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,it(e.priority,function(){lp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,it(e.priority,function(){lp(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 Ap(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=mp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);H=r,n.target.dispatchEvent(r),H=null}else return t=gt(n),t!==null&&cp(t),e.blockedOn=n,!1;t.shift()}return!0}function jp(e,t,n){Ap(e)&&n.delete(t)}function Mp(){vp=!1,yp!==null&&Ap(yp)&&(yp=null),bp!==null&&Ap(bp)&&(bp=null),xp!==null&&Ap(xp)&&(xp=null),Sp.forEach(jp),Cp.forEach(jp)}function Np(e,n){e.blockedOn===n&&(e.blockedOn=null,vp||(vp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Mp)))}var Pp=null;function Fp(e){Pp!==e&&(Pp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Pp===e&&(Pp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(gp(r||n)===null)continue;break}var a=gt(n);a!==null&&(e.splice(t,3),t-=3,xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Ip(e){function t(t){return Np(t,e)}yp!==null&&Np(yp,e),bp!==null&&Np(bp,e),xp!==null&&Np(xp,e),Sp.forEach(t),Cp.forEach(t);for(var n=0;n<wp.length;n++){var r=wp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<wp.length&&(n=wp[0],n.blockedOn===null);)kp(n),n.blockedOn===null&&wp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[st]||null;if(typeof a==`function`)o||Fp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[st]||null)s=o.formAction;else if(gp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Fp(n)}}}function Lp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Rp(e){this._internalRoot=e}zp.prototype.render=Rp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ap(n,gu(),e,t,null,null)},zp.prototype.unmount=Rp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ap(e.current,2,null,e,null,null),Cu(),t[ct]=null}};function zp(e){this._internalRoot=e}zp.prototype.unstable_scheduleHydration=function(e){if(e){var t=rt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<wp.length&&t!==0&&t<wp[n].priority;n++);wp.splice(n,0,e),n===0&&kp(e)}};var Bp=n.version;if(Bp!==`19.2.7`)throw Error(i(527,Bp,`19.2.7`));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Vp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Hp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hp.isDisabled&&Hp.supportsFiber)try{Fe=Hp.inject(Vp),Ie=Hp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ws,s=Gs,c=Ks;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=rp(e,1,!1,null,null,n,r,null,o,s,c,Lp),e[ct]=t.current,Ed(e),new Rp(t)}})),g=o(((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=h()})),_=c(u(),1),v=g(),y=`tinbase_service_key`,b=sessionStorage.getItem(y)||``,x=()=>b,S=e=>{b=e,sessionStorage.setItem(y,e)},C=()=>{b=``,sessionStorage.removeItem(y)},w=null,T=e=>{w=e};function E(e={}){return{apikey:b,authorization:`Bearer ${b}`,\"content-type\":`application/json`,...e}}function D(e={}){let t=w??b;return{apikey:t,authorization:`Bearer ${t}`,\"content-type\":`application/json`,...e}}async function O(e,t={}){return fetch(`${e}`,{...t,headers:{...E(),...t.headers}})}async function k(e,t={},n){let r=(t.method??`GET`).toUpperCase(),i=n&&n!==`public`?{[r===`GET`||r===`HEAD`?`accept-profile`:`content-profile`]:n}:{};return fetch(`${e}`,{...t,headers:{...D(),...i,...t.headers}})}var A=class extends Error{status;constructor(e,t){super(e),this.status=t,this.name=`ApiError`}};function j(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}async function M(e){let t=j(await e.text());if(!e.ok)throw new A(t?.error||t?.message||t?.msg||`HTTP ${e.status}`,e.status);return t}var N={ping:()=>O(`/admin/v1/stats`).then(M),stats:()=>O(`/admin/v1/stats`).then(M),keys:()=>O(`/admin/v1/keys`).then(M),impersonate:(e,t)=>{let n=new URLSearchParams({role:e});return t&&(n.set(`sub`,t.sub),t.email&&n.set(`email`,t.email)),O(`/admin/v1/impersonate?${n}`).then(M)},schemas:()=>O(`/admin/v1/schemas`).then(M).then(e=>e.schemas),tables:(e=`public`)=>O(`/admin/v1/tables?schema=${encodeURIComponent(e)}`).then(M).then(e=>e.tables),migrations:()=>O(`/admin/v1/migrations`).then(M).then(e=>e.migrations),policies:(e=`public`)=>O(`/admin/v1/policies?schema=${encodeURIComponent(e)}`).then(M).then(e=>e.policies),createPolicy:e=>O(`/admin/v1/policies`,{method:`POST`,body:JSON.stringify(e)}).then(M),dropPolicy:(e,t,n=`public`)=>O(`/admin/v1/policies?${new URLSearchParams({table:e,name:t,schema:n})}`,{method:`DELETE`}).then(M),functions:(e=`public`)=>O(`/admin/v1/functions?schema=${encodeURIComponent(e)}`).then(M).then(e=>e.functions),triggers:(e=`public`)=>O(`/admin/v1/triggers?schema=${encodeURIComponent(e)}`).then(M).then(e=>e.triggers),logs:()=>O(`/admin/v1/logs`).then(M).then(e=>e.logs),clearLogs:()=>O(`/admin/v1/logs`,{method:`DELETE`}).then(M),sql:(e,t)=>O(`/admin/v1/sql`,{method:`POST`,body:JSON.stringify({query:e,role:t?.role,claims:t?.claims})}).then(async e=>{let t=j(await e.text())??{error:`HTTP ${e.status}`};return{ok:e.ok,...t}}),edgeFunctions:()=>O(`/admin/v1/edge-functions`).then(M),putSecrets:e=>O(`/admin/v1/edge-functions/secrets`,{method:`PUT`,body:JSON.stringify({secrets:e})}).then(M),deleteSecret:e=>O(`/admin/v1/edge-functions/secrets?name=${encodeURIComponent(e)}`,{method:`DELETE`}).then(M),authConfig:()=>O(`/admin/v1/auth-config`).then(M),updateAuthSettings:e=>O(`/admin/v1/auth-config`,{method:`PATCH`,body:JSON.stringify(e)}).then(M).then(e=>e.settings),webhooksConfig:()=>O(`/admin/v1/webhooks`).then(M).then(e=>e.webhooks),rows:(e,t)=>{let n=new URLSearchParams({select:`*`,limit:String(t.limit),offset:String(t.offset)});t.order&&n.set(`order`,t.order);for(let[e,r]of t.filters??[])n.append(e,r);return k(`/rest/v1/${encodeURIComponent(e)}?${n}`,{headers:{prefer:`count=exact`}},t.schema).then(async e=>{let t=await M(e),n=e.headers.get(`content-range`)||``;return{rows:t,total:parseInt(n.split(`/`)[1]||`0`,10)}})},insertRow:(e,t,n)=>k(`/rest/v1/${encodeURIComponent(e)}`,{method:`POST`,headers:{prefer:`return=representation`},body:JSON.stringify(t)},n).then(M),updateRow:(e,t,n,r)=>{let i=new URLSearchParams;for(let[e,n]of Object.entries(t))i.set(e,`eq.${n}`);return k(`/rest/v1/${encodeURIComponent(e)}?${i}`,{method:`PATCH`,headers:{prefer:`return=representation`},body:JSON.stringify(n)},r).then(M)},deleteRow:(e,t,n)=>{let r=new URLSearchParams;for(let[e,n]of Object.entries(t))r.set(e,`eq.${n}`);return k(`/rest/v1/${encodeURIComponent(e)}?${r}`,{method:`DELETE`},n).then(M)},deleteRows:(e,t,n,r)=>{let i=n.map(e=>{let t=String(e);return/^-?\\d+(\\.\\d+)?$/.test(t)?t:`\"${t.replace(/\"/g,`\\\\\"`)}\"`}),a=new URLSearchParams;return a.set(t,`in.(${i.join(`,`)})`),k(`/rest/v1/${encodeURIComponent(e)}?${a}`,{method:`DELETE`},r).then(M)},users:()=>O(`/auth/v1/admin/users`).then(M).then(e=>e.users),createUser:e=>O(`/auth/v1/admin/users`,{method:`POST`,body:JSON.stringify({email_confirm:!0,...e})}).then(M),updateUser:(e,t)=>O(`/auth/v1/admin/users/${e}`,{method:`PUT`,body:JSON.stringify(t)}).then(M),deleteUser:e=>O(`/auth/v1/admin/users/${e}`,{method:`DELETE`}).then(M),sendMagicLink:e=>O(`/auth/v1/otp`,{method:`POST`,body:JSON.stringify({email:e,create_user:!0})}).then(M),buckets:()=>O(`/storage/v1/bucket`).then(M),createBucket:e=>O(`/storage/v1/bucket`,{method:`POST`,body:JSON.stringify(e)}).then(M),deleteBucket:e=>O(`/storage/v1/bucket/${encodeURIComponent(e)}`,{method:`DELETE`}).then(M),listObjects:(e,t=``)=>O(`/storage/v1/object/list/${encodeURIComponent(e)}`,{method:`POST`,body:JSON.stringify({prefix:t,limit:100,offset:0,sortBy:{column:`name`,order:`asc`}})}).then(M),uploadObject:(e,t,n)=>{let r=new FormData;return r.append(``,n),fetch(`/storage/v1/object/${encodeURIComponent(e)}/${t}`,{method:`POST`,headers:{apikey:b,authorization:`Bearer ${b}`,\"x-upsert\":`true`},body:r}).then(M)},removeObject:(e,t)=>O(`/storage/v1/object/${encodeURIComponent(e)}`,{method:`DELETE`,body:JSON.stringify({prefixes:[t]})}).then(M),removeObjects:(e,t)=>O(`/storage/v1/object/${encodeURIComponent(e)}`,{method:`DELETE`,body:JSON.stringify({prefixes:t})}).then(M),signUrl:(e,t,n=3600)=>O(`/storage/v1/object/sign/${encodeURIComponent(e)}/${t}`,{method:`POST`,body:JSON.stringify({expiresIn:n})}).then(M).then(e=>`/storage/v1${e.signedURL??e.signedUrl??``}`),downloadObject:(e,t)=>O(`/storage/v1/object/${encodeURIComponent(e)}/${t}`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.blob()})},P=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ee=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),F=e=>e.replace(/^([A-Z])|[\\s-_]+(\\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),I=e=>{let t=F(e);return t.charAt(0).toUpperCase()+t.slice(1)},te={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ne=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},re=(0,_.createContext)({}),ie=()=>(0,_.useContext)(re),ae=(0,_.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=ie()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,_.createElement)(`svg`,{ref:c,...te,width:t??l??te.width,height:t??l??te.height,stroke:e??f,strokeWidth:m,className:P(`lucide`,p,i),...!a&&!ne(s)&&{\"aria-hidden\":`true`},...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),L=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(ae,{ref:i,iconNode:t,className:P(`lucide-${ee(I(e))}`,`lucide-${e}`,n),...r}));return n.displayName=I(e),n},oe=L(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),se=L(`arrow-down-up`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`m21 8-4-4-4 4`,key:`1c9v7m`}],[`path`,{d:`M17 4v16`,key:`7dpous`}]]),ce=L(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),le=L(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),ue=L(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),de=L(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),fe=L(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),pe=L(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),me=L(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),he=L(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),ge=L(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),_e=L(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ve=L(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),ye=L(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),be=L(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),xe=L(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Se=L(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),Ce=L(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),we=L(`diamond`,[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]),Te=L(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Ee=L(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),De=L(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Oe=L(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),ke=L(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Ae=L(`file-clock`,[[`path`,{d:`M16 22h2a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v2.85`,key:`ryk6xj`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 14v2.2l1.6 1`,key:`6m4bie`}],[`circle`,{cx:`8`,cy:`16`,r:`6`,key:`10v15b`}]]),je=L(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),Me=L(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),Ne=L(`files`,[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]),Pe=L(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Fe=L(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Ie=L(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),R=L(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Le=L(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Re=L(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),ze=L(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),Be=L(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),Ve=L(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),He=L(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),Ue=L(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),We=L(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Ge=L(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Ke=L(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),qe=L(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),Je=L(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),Ye=L(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),Xe=L(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Ze=L(`lock-open`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]]),Qe=L(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),$e=L(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),et=L(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),tt=L(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),nt=L(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),rt=L(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),it=L(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),at=L(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),ot=L(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),st=L(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),ct=L(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),lt=L(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),ut=L(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),dt=L(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),ft=L(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),pt=L(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),mt=L(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),ht=L(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),gt=L(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),_t=L(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),vt=L(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),yt=L(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),bt=L(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),xt=L(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),St=L(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),Ct=L(`shield-plus`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M9 12h6`,key:`1c52cq`}],[`path`,{d:`M12 9v6`,key:`199k2o`}]]),wt=L(`square-function`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`path`,{d:`M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3`,key:`m1af9g`}],[`path`,{d:`M9 11.2h5.7`,key:`3zgcl2`}]]),Tt=L(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Et=L(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),Dt=L(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Ot=L(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),kt=L(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),At=L(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),jt=L(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),Mt=L(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Nt=L(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),Pt=L(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),Ft=L(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),It=L(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);function Lt(e){if(Array.isArray(e))return e.map(e=>e==null?``:String(e));if(typeof e!=`string`)return e==null?[]:[String(e)];let t=e.trim();if(!(t.startsWith(`{`)&&t.endsWith(`}`)))return t===``?[]:[t];let n=t.slice(1,-1);if(n===``)return[];let r=[],i=``,a=!1;for(let e=0;e<n.length;e++){let t=n[e];a?t===`\\\\`?i+=n[++e]??``:t===`\"`?a=!1:i+=t:t===`\"`?a=!0:t===`,`?(r.push(i),i=``):i+=t}return r.push(i),r.map(e=>e===`NULL`?``:e)}var Rt=[{title:null,items:[{id:`home`,label:`Project overview`,icon:He}]},{title:`Database`,items:[{id:`table`,label:`Table Editor`,icon:Et},{id:`sql`,label:`SQL Editor`,icon:Dt},{id:`database`,label:`Database`,icon:Le}]},{title:`Manage`,items:[{id:`auth`,label:`Authentication`,icon:Ge},{id:`storage`,label:`Storage`,icon:ze},{id:`functions`,label:`Edge Functions`,icon:It},{id:`realtime`,label:`Realtime`,icon:mt}]},{title:`Automations`,items:[{id:`automations`,label:`Automations`,icon:Pt}]},{title:`Observe`,items:[{id:`logs`,label:`Logs`,icon:gt}]},{title:`Project`,items:[{id:`settings`,label:`Project Settings`,icon:yt}]}];function zt(){try{return new URL(document.URL).pathname}catch{return window.location.pathname}}var Bt=zt().startsWith(`/_`)?`/_`:``,Vt=new Set(Rt.flatMap(e=>e.items.map(e=>e.id)));function Ht(){let e=zt().slice(Bt.length).split(`/`).filter(Boolean);return{tab:Vt.has(e[0])?e[0]:`home`,section:e[1]?decodeURIComponent(e[1]):null}}function Ut(e,t){return e===`home`?`${Bt}/`:t?`${Bt}/${e}/${encodeURIComponent(t)}`:`${Bt}/${e}`}var Wt=Ht(),Gt=new Set;function Kt(){let e=Ht();(e.tab!==Wt.tab||e.section!==Wt.section)&&(Wt=e,Gt.forEach(e=>e()))}window.addEventListener(`popstate`,Kt);function z(e,t=null,n={}){let r=Ut(e,t);zt()!==r&&(n.replace?window.history.replaceState(null,``,r):window.history.pushState(null,``,r)),Kt()}function qt(){return(0,_.useSyncExternalStore)(e=>(Gt.add(e),()=>Gt.delete(e)),()=>Wt)}function Jt(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Jt(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Yt(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Jt(e))&&(r&&(r+=` `),r+=t);return r}var Xt=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),B=o(((e,t)=>{t.exports=Xt()}))();function V({variant:e=`neutral`,className:t,children:n}){return(0,B.jsx)(`span`,{className:Yt(`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] leading-none`,{neutral:`bg-accent text-muted-foreground`,brand:`bg-brand/15 text-brand`,amber:`bg-warning/15 text-warning`,red:`bg-destructive/15 text-destructive`,blue:`bg-info/15 text-info`,outline:`border border-input text-muted-foreground`}[e],t),children:n})}function H({variant:e=`default`,size:t=`sm`,className:n,...r}){return(0,B.jsx)(`button`,{className:Yt(`inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md transition-colors disabled:opacity-50 disabled:pointer-events-none`,{sm:`h-8 px-3 text-[13px]`,xs:`h-6 px-2 text-xs`,icon:`size-8`,iconXs:`size-6`}[t],{default:`bg-primary text-primary-foreground hover:bg-primary/90 font-medium`,outline:`border border-input text-foreground hover:bg-accent hover:border-muted-foreground`,ghost:`text-foreground/80 hover:bg-accent`,danger:`border border-destructive/30 text-destructive hover:bg-destructive/10`,dangerSolid:`bg-destructive text-primary-foreground hover:bg-destructive/90 font-medium`}[e],n),...r})}function Zt({checked:e,indeterminate:t,onChange:n,disabled:r,title:i,className:a}){return(0,B.jsx)(`button`,{type:`button`,role:`checkbox`,\"aria-checked\":t?`mixed`:e,disabled:r,title:i,onClick:t=>{t.stopPropagation(),n?.(!e,t)},className:Yt(`flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors`,e||t?`border-brand bg-brand text-primary-foreground`:`border-muted-foreground bg-transparent hover:border-foreground`,r&&`pointer-events-none opacity-40`,a),children:t?(0,B.jsx)(tt,{size:11,strokeWidth:3}):e?(0,B.jsx)(fe,{size:11,strokeWidth:3}):null})}var Qt=o(((e,t)=>{(function(){var e=`ace`,t=(function(){return this})();if(!t&&typeof window<`u`&&(t=window),!e&&typeof requirejs<`u`)return;var n=function(e,t,r){if(typeof e!=`string`){n.original?n.original.apply(this,arguments):(console.error(`dropping module because define wasn't a string.`),console.trace());return}arguments.length==2&&(r=t),n.modules[e]||(n.payloads[e]=r,n.modules[e]=null)};n.modules={},n.payloads={};var r=function(e,t,n){if(typeof t==`string`){var r=o(e,t);if(r!=null)return n&&n(),r}else if(Object.prototype.toString.call(t)===`[object Array]`){for(var a=[],s=0,c=t.length;s<c;++s){var l=o(e,t[s]);if(l==null&&i.original)return;a.push(l)}return n&&n.apply(null,a)||!0}},i=function(e,t){var n=r(``,e,t);return n==null&&i.original?i.original.apply(this,arguments):n},a=function(e,t){if(t.indexOf(`!`)!==-1){var n=t.split(`!`);return a(e,n[0])+`!`+a(e,n[1])}if(t.charAt(0)==`.`)for(t=e.split(`/`).slice(0,-1).join(`/`)+`/`+t;t.indexOf(`.`)!==-1&&r!=t;){var r=t;t=t.replace(/\\/\\.\\//,`/`).replace(/[^\\/]+\\/\\.\\.\\//,``)}return t},o=function(e,t){t=a(e,t);var i=n.modules[t];if(!i){if(i=n.payloads[t],typeof i==`function`){var o={},s={id:t,uri:``,exports:o,packaged:!0};o=i(function(e,n){return r(t,e,n)},o,s)||s.exports,n.modules[t]=o,delete n.payloads[t]}i=n.modules[t]=o||i}return i};function s(e){var r=t;e&&(t[e]||(t[e]={}),r=t[e]),(!r.define||!r.define.packaged)&&(n.original=r.define,r.define=n,r.define.packaged=!0),(!r.require||!r.require.packaged)&&(i.original=r.require,r.require=i,r.require.packaged=!0)}s(e)})(),ace.define(`ace/lib/es6-shim`,[`require`,`exports`,`module`],function(e,t,n){function r(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||r(String.prototype,`startsWith`,function(e,t){return t||=0,this.lastIndexOf(e,t)===t}),String.prototype.endsWith||r(String.prototype,`endsWith`,function(e,t){var n=this;(t===void 0||t>n.length)&&(t=n.length),t-=e.length;var r=n.indexOf(e,t);return r!==-1&&r===t}),String.prototype.repeat||r(String.prototype,`repeat`,function(e){for(var t=``,n=this;e>0;)e&1&&(t+=n),(e>>=1)&&(n+=n);return t}),String.prototype.includes||r(String.prototype,`includes`,function(e,t){return this.indexOf(e,t)!=-1}),Object.assign||(Object.assign=function(e){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];r!=null&&Object.keys(r).forEach(function(e){t[e]=r[e]})}return t}),Object.values||(Object.values=function(e){return Object.keys(e).map(function(t){return e[t]})}),Array.prototype.find||r(Array.prototype,`find`,function(e){for(var t=this.length,n=arguments[1],r=0;r<t;r++){var i=this[r];if(e.call(n,i,r,this))return i}}),Array.prototype.findIndex||r(Array.prototype,`findIndex`,function(e){for(var t=this.length,n=arguments[1],r=0;r<t;r++){var i=this[r];if(e.call(n,i,r,this))return r}}),Array.prototype.includes||r(Array.prototype,`includes`,function(e,t){return this.indexOf(e,t)!=-1}),Array.prototype.fill||r(Array.prototype,`fill`,function(e){for(var t=this,n=t.length>>>0,r=arguments[1]>>0,i=r<0?Math.max(n+r,0):Math.min(r,n),a=arguments[2],o=a===void 0?n:a>>0,s=o<0?Math.max(n+o,0):Math.min(o,n);i<s;)t[i]=e,i++;return t}),Array.of||r(Array,`of`,function(){return Array.prototype.slice.call(arguments)})}),ace.define(`ace/lib/fixoldbrowsers`,[`require`,`exports`,`module`,`ace/lib/es6-shim`],function(e,t,n){e(\"./es6-shim\")}),ace.define(`ace/lib/deep_copy`,[`require`,`exports`,`module`],function(e,t,n){t.deepCopy=function e(t){if(typeof t!=`object`||!t)return t;var n;if(Array.isArray(t)){n=[];for(var r=0;r<t.length;r++)n[r]=e(t[r]);return n}if(Object.prototype.toString.call(t)!==`[object Object]`)return t;for(var r in n={},t)n[r]=e(t[r]);return n}}),ace.define(`ace/lib/lang`,[`require`,`exports`,`module`,`ace/lib/deep_copy`],function(e,t,n){t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split(``).reverse().join(``)},t.stringRepeat=function(e,t){for(var n=``;t>0;)t&1&&(n+=e),(t>>=1)&&(e+=e);return n};var r=/^\\s\\s*/,i=/\\s\\s*$/;t.stringTrimLeft=function(e){return e.replace(r,``)},t.stringTrimRight=function(e){return e.replace(i,``)},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,r=e.length;n<r;n++)e[n]&&typeof e[n]==`object`?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=e(\"./deep_copy\").deepCopy,t.arrayToMap=function(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var n in e)t[n]=e[n];return t},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\\]\\/\\\\])/g,`\\\\$1`)},t.escapeHTML=function(e){return(``+e).replace(/&/g,`&#38;`).replace(/\"/g,`&#34;`).replace(/'/g,`&#39;`).replace(/</g,`&#60;`)},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,function(e){n.push({offset:arguments[arguments.length-2],length:e.length})}),n},t.deferredCall=function(e){var t=null,n=function(){t=null,e()},r=function(e){return r.cancel(),t=setTimeout(n,e||0),r};return r.schedule=r,r.call=function(){return this.cancel(),e(),r},r.cancel=function(){return clearTimeout(t),t=null,r},r.isPending=function(){return t},r},t.delayedCall=function(e,t){var n=null,r=function(){n=null,e()},i=function(e){n??=setTimeout(r,e||t)};return i.delay=function(e){n&&clearTimeout(n),n=setTimeout(r,e||t)},i.schedule=i,i.call=function(){this.cancel(),e()},i.cancel=function(){n&&clearTimeout(n),n=null},i.isPending=function(){return n},i},t.sleep=function(e){return new Promise(function(t){setTimeout(t,e)})},t.supportsLookbehind=function(){return!0},t.skipEmptyMatch=function(e,t,n){return n&&e.codePointAt(t)>65535?2:1}}),ace.define(`ace/lib/useragent`,[`require`,`exports`,`module`],function(e,t,n){t.OS={LINUX:`LINUX`,MAC:`MAC`,WINDOWS:`WINDOWS`},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var r=typeof navigator==`object`?navigator:{},i=(/mac|win|linux/i.exec(r.platform)||[`other`])[0].toLowerCase(),a=r.userAgent||``,o=r.appName||``;t.isWin=i==`win`,t.isMac=i==`mac`,t.isLinux=i==`linux`,t.isIE=o==`Microsoft Internet Explorer`||o.indexOf(`MSAppHost`)>=0?parseFloat((a.match(/(?:MSIE |Trident\\/[0-9]+[\\.0-9]+;.*rv:)([0-9]+[\\.0-9]+)/)||[])[1]):parseFloat((a.match(/(?:Trident\\/[0-9]+[\\.0-9]+;.*rv:)([0-9]+[\\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=a.match(/ Gecko\\/\\d+/),t.isOpera=typeof opera==`object`&&Object.prototype.toString.call(window.opera)==`[object Opera]`,t.isWebKit=parseFloat(a.split(`WebKit/`)[1])||void 0,t.isChrome=parseFloat(a.split(` Chrome/`)[1])||void 0,t.isSafari=parseFloat(a.split(` Safari/`)[1])&&!t.isChrome||void 0,t.isEdge=parseFloat(a.split(` Edge/`)[1])||void 0,t.isAIR=a.indexOf(`AdobeAIR`)>=0,t.isAndroid=a.indexOf(`Android`)>=0,t.isChromeOS=a.indexOf(` CrOS `)>=0,t.isIOS=/iPad|iPhone|iPod/.test(a)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define(`ace/lib/dom`,[`require`,`exports`,`module`,`ace/lib/useragent`],function(e,t,n){var r=e(\"./useragent\"),i=`http://www.w3.org/1999/xhtml`;t.buildDom=function e(t,n,r){if(typeof t==`string`&&t){var i=document.createTextNode(t);return n&&n.appendChild(i),i}if(!Array.isArray(t))return t&&t.appendChild&&n&&n.appendChild(t),t;if(typeof t[0]!=`string`||!t[0]){for(var a=[],o=0;o<t.length;o++){var s=e(t[o],n,r);s&&a.push(s)}return a}var c=document.createElement(t[0]),l=t[1],u=1;l&&typeof l==`object`&&!Array.isArray(l)&&(u=2);for(var o=u;o<t.length;o++)e(t[o],c,r);return u==2&&Object.keys(l).forEach(function(e){var t=l[e];e===`class`?c.className=Array.isArray(t)?t.join(` `):t:typeof t==`function`||e==`value`||e[0]==`$`?c[e]=t:e===`ref`?r&&(r[t]=c):e===`style`?typeof t==`string`&&(c.style.cssText=t):t!=null&&c.setAttribute(e,t)}),n&&n.appendChild(c),c},t.getDocumentHead=function(e){return e||=document,e.head||e.getElementsByTagName(`head`)[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||i,e):document.createElement(e)},t.removeChildren=function(e){e.innerHTML=``},t.createTextNode=function(e,t){return(t?t.ownerDocument:document).createTextNode(e)},t.createFragment=function(e){return(e?e.ownerDocument:document).createDocumentFragment()},t.hasCssClass=function(e,t){return(e.className+``).split(/\\s+/g).indexOf(t)!==-1},t.addCssClass=function(e,n){t.hasCssClass(e,n)||(e.className+=` `+n)},t.removeCssClass=function(e,t){for(var n=e.className.split(/\\s+/g);;){var r=n.indexOf(t);if(r==-1)break;n.splice(r,1)}e.className=n.join(` `)},t.toggleCssClass=function(e,t){for(var n=e.className.split(/\\s+/g),r=!0;;){var i=n.indexOf(t);if(i==-1)break;r=!1,n.splice(i,1)}return r&&n.push(t),e.className=n.join(` `),r},t.setCssClass=function(e,n,r){r?t.addCssClass(e,n):t.removeCssClass(e,n)},t.hasCssString=function(e,t){var n=0,r;if(t||=document,r=t.querySelectorAll(`style`)){for(;n<r.length;)if(r[n++].id===e)return!0}},t.removeElementById=function(e,t){t||=document,t.getElementById(e)&&t.getElementById(e).remove()};var a,o=[];t.useStrictCSP=function(e){a=e,e==0?s():o||=[]};function s(){var e=o;o=null,e&&e.forEach(function(e){c(e[0],e[1])})}function c(e,n,r){if(!(typeof document>`u`)){if(o){if(r)s();else if(r===!1)return o.push([e,n])}if(!a){var i=r;!r||!r.getRootNode?i=document:(i=r.getRootNode(),(!i||i==r)&&(i=document));var c=i.ownerDocument||i;if(n&&t.hasCssString(n,i))return null;n&&(e+=`\n/*# sourceURL=ace/css/`+n+` */`);var l=t.createElement(`style`);l.appendChild(c.createTextNode(e)),n&&(l.id=n),i==c&&(i=t.getDocumentHead(c)),i.insertBefore(l,i.firstChild)}}}if(t.importCssString=c,t.importCssStylsheet=function(e,n){t.buildDom([`link`,{rel:`stylesheet`,href:e}],t.getDocumentHead(n))},t.$fixPositionBug=function(e){var t=e.getBoundingClientRect();if(e.style.left){var n=parseFloat(e.style.left),r=+t.left;Math.abs(n-r)>1&&(e.style.left=2*n-r+`px`)}if(e.style.right){var n=parseFloat(e.style.right),r=window.innerWidth-t.right;Math.abs(n-r)>1&&(e.style.right=2*n-r+`px`)}if(e.style.top){var n=parseFloat(e.style.top),r=+t.top;Math.abs(n-r)>1&&(e.style.top=2*n-r+`px`)}if(e.style.bottom){var n=parseFloat(e.style.bottom),r=window.innerHeight-t.bottom;Math.abs(n-r)>1&&(e.style.bottom=2*n-r+`px`)}},t.scrollbarWidth=function(e){var n=t.createElement(`ace_inner`);n.style.width=`100%`,n.style.minWidth=`0px`,n.style.height=`200px`,n.style.display=`block`;var r=t.createElement(`ace_outer`),i=r.style;i.position=`absolute`,i.left=`-10000px`,i.overflow=`hidden`,i.width=`200px`,i.minWidth=`0px`,i.height=`150px`,i.display=`block`,r.appendChild(n);var a=e&&e.documentElement||document&&document.documentElement;if(!a)return 0;a.appendChild(r);var o=n.offsetWidth;i.overflow=`scroll`;var s=n.offsetWidth;return o===s&&(s=r.clientWidth),a.removeChild(r),o-s},t.computedStyle=function(e,t){return window.getComputedStyle(e,``)||{}},t.setStyle=function(e,t,n){e[t]!==n&&(e[t]=n)},t.HAS_CSS_ANIMATION=!1,t.HAS_CSS_TRANSFORMS=!1,t.HI_DPI=r.isWin?typeof window<`u`&&window.devicePixelRatio>=1.5:!0,r.isChromeOS&&(t.HI_DPI=!1),typeof document<`u`){var l=document.createElement(`div`);t.HI_DPI&&l.style.transform!==void 0&&(t.HAS_CSS_TRANSFORMS=!0),!r.isEdge&&l.style.animationName!==void 0&&(t.HAS_CSS_ANIMATION=!0),l=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform=`translate(`+Math.round(t)+`px, `+Math.round(n)+`px)`}:t.translate=function(e,t,n){e.style.top=Math.round(n)+`px`,e.style.left=Math.round(t)+`px`}}),ace.define(`ace/lib/net`,[`require`,`exports`,`module`,`ace/lib/dom`],function(e,t,n){var r=e(\"./dom\");t.get=function(e,t){var n=new XMLHttpRequest;n.open(`GET`,e,!0),n.onreadystatechange=function(){n.readyState===4&&t(n.responseText)},n.send(null)},t.loadScript=function(e,t){var n=r.getDocumentHead(),i=document.createElement(`script`);i.src=e,n.appendChild(i),i.onload=i.onreadystatechange=function(e,n){(n||!i.readyState||i.readyState==`loaded`||i.readyState==`complete`)&&(i=i.onload=i.onreadystatechange=null,n||t())}},t.qualifyURL=function(e){var t=document.createElement(`a`);return t.href=e,t.href}}),ace.define(`ace/lib/oop`,[`require`,`exports`,`module`],function(e,t,n){t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define(`ace/lib/event_emitter`,[`require`,`exports`,`module`],function(e,t,n){var r={},i=function(){this.propagationStopped=!0},a=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||={},this._defaultHandlers||={};var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!(!n.length&&!r)){(typeof t!=`object`||!t)&&(t={}),t.type||=e,t.stopPropagation||=i,t.preventDefault||=a,n=n.slice();for(var o=0;o<n.length&&(n[o](t,this),!t.propagationStopped);o++);if(r&&!t.defaultPrevented)return r(t,this)}},r._signal=function(e,t){var n=(this._eventRegistry||{})[e];if(n){n=n.slice();for(var r=0;r<n.length;r++)n[r](t,this)}},r.once=function(e,t){var n=this;if(this.on(e,function r(){n.off(e,r),t.apply(null,arguments)}),!t)return new Promise(function(e){t=e})},r.setDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n||=this._defaultHandlers={_disabled_:{}},n[e]){var r=n[e],i=n._disabled_[e];i||(n._disabled_[e]=i=[]),i.push(r);var a=i.indexOf(t);a!=-1&&i.splice(a,1)}n[e]=t},r.removeDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n){var r=n._disabled_[e];if(n[e]==t)r&&this.setDefaultHandler(e,r.pop());else if(r){var i=r.indexOf(t);i!=-1&&r.splice(i,1)}}},r.on=r.addEventListener=function(e,t,n){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[e];return r||=this._eventRegistry[e]=[],r.indexOf(t)==-1&&r[n?`unshift`:`push`](t),t},r.off=r.removeListener=r.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(n){var r=n.indexOf(t);r!==-1&&n.splice(r,1)}},r.removeAllListeners=function(e){e||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[e]=void 0),this._defaultHandlers&&(this._defaultHandlers[e]=void 0)},t.EventEmitter=r}),ace.define(`ace/lib/report_error`,[`require`,`exports`,`module`],function(e,t,n){t.reportError=function(e,t){var n=Error(e);n.data=t,typeof console==`object`&&console.error&&console.error(n),setTimeout(function(){throw n})}}),ace.define(`ace/lib/default_english_messages`,[`require`,`exports`,`module`],function(e,t,n){t.defaultEnglishMessages={\"autocomplete.popup.aria-roledescription\":`Autocomplete suggestions`,\"autocomplete.popup.aria-label\":`Autocomplete suggestions`,\"autocomplete.popup.item.aria-roledescription\":`item`,\"autocomplete.loading\":`Loading...`,\"editor.scroller.aria-roledescription\":`editor`,\"editor.scroller.aria-label\":`Editor content, press Enter to start editing, press Escape to exit`,\"editor.gutter.aria-roledescription\":`editor gutter`,\"editor.gutter.aria-label\":`Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit`,\"error-marker.good-state\":`Looks good!`,\"prompt.recently-used\":`Recently used`,\"prompt.other-commands\":`Other commands`,\"prompt.no-matching-commands\":`No matching commands`,\"search-box.find.placeholder\":`Search for`,\"search-box.find-all.text\":`All`,\"search-box.replace.placeholder\":`Replace with`,\"search-box.replace-next.text\":`Replace`,\"search-box.replace-all.text\":`All`,\"search-box.toggle-replace.title\":`Toggle Replace mode`,\"search-box.toggle-regexp.title\":`RegExp Search`,\"search-box.toggle-case.title\":`CaseSensitive Search`,\"search-box.toggle-whole-word.title\":`Whole Word Search`,\"search-box.toggle-in-selection.title\":`Search In Selection`,\"search-box.search-counter\":`$0 of $1`,\"text-input.aria-roledescription\":`editor`,\"text-input.aria-label\":`Cursor at row $0`,\"gutter.code-folding.range.aria-label\":`Toggle code folding, rows $0 through $1`,\"gutter.code-folding.closed.aria-label\":`Toggle code folding, rows $0 through $1`,\"gutter.code-folding.open.aria-label\":`Toggle code folding, row $0`,\"gutter.code-folding.closed.title\":`Unfold code`,\"gutter.code-folding.open.title\":`Fold code`,\"gutter.annotation.aria-label.error\":`Error, read annotations row $0`,\"gutter.annotation.aria-label.warning\":`Warning, read annotations row $0`,\"gutter.annotation.aria-label.info\":`Info, read annotations row $0`,\"inline-fold.closed.title\":`Unfold code`,\"gutter-tooltip.aria-label.error.singular\":`error`,\"gutter-tooltip.aria-label.error.plural\":`errors`,\"gutter-tooltip.aria-label.warning.singular\":`warning`,\"gutter-tooltip.aria-label.warning.plural\":`warnings`,\"gutter-tooltip.aria-label.info.singular\":`information message`,\"gutter-tooltip.aria-label.info.plural\":`information messages`,\"gutter.annotation.aria-label.security\":`Security finding, read annotations row $0`,\"gutter.annotation.aria-label.hint\":`Suggestion, read annotations row $0`,\"gutter-tooltip.aria-label.security.singular\":`security finding`,\"gutter-tooltip.aria-label.security.plural\":`security findings`,\"gutter-tooltip.aria-label.hint.singular\":`suggestion`,\"gutter-tooltip.aria-label.hint.plural\":`suggestions`,\"editor.tooltip.disable-editing\":`Editing is disabled`}}),ace.define(`ace/lib/app_config`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/event_emitter`,`ace/lib/report_error`,`ace/lib/default_english_messages`],function(e,t,n){\"no use strict\";var r=e(\"./oop\"),i=e(\"./event_emitter\").EventEmitter,a=e(\"./report_error\").reportError,o=e(\"./default_english_messages\").defaultEnglishMessages,s={setOptions:function(e){Object.keys(e).forEach(function(t){this.setOption(t,e[t])},this)},getOptions:function(e){var t={};if(e)Array.isArray(e)||(e=Object.keys(e));else{var n=this.$options;e=Object.keys(n).filter(function(e){return!n[e].hidden})}return e.forEach(function(e){t[e]=this.getOption(e)},this),t},setOption:function(e,t){if(this[`$`+e]!==t){var n=this.$options[e];if(!n)return c(`misspelled option \"`+e+`\"`);if(n.forwardTo)return this[n.forwardTo]&&this[n.forwardTo].setOption(e,t);n.handlesSet||(this[`$`+e]=t),n&&n.set&&n.set.call(this,t)}},getOption:function(e){var t=this.$options[e];return t?t.forwardTo?this[t.forwardTo]&&this[t.forwardTo].getOption(e):t&&t.get?t.get.call(this):this[`$`+e]:c(`misspelled option \"`+e+`\"`)}};function c(e){typeof console<`u`&&console.warn&&console.warn.apply(console,arguments)}var l,u,d=function(){function e(){this.$defaultOptions={},l=o,u=`dollarSigns`}return e.prototype.defineOptions=function(e,t,n){return e.$options||(this.$defaultOptions[t]=e.$options={}),Object.keys(n).forEach(function(t){var r=n[t];typeof r==`string`&&(r={forwardTo:r}),r.name||=t,e.$options[r.name]=r,`initialValue`in r&&(e[`$`+r.name]=r.initialValue)}),r.implement(e,s),this},e.prototype.resetOptions=function(e){Object.keys(e.$options).forEach(function(t){var n=e.$options[t];`value`in n&&e.setOption(t,n.value)})},e.prototype.setDefaultValue=function(e,t,n){if(!e){for(e in this.$defaultOptions)if(this.$defaultOptions[e][t])break;if(!this.$defaultOptions[e][t])return!1}var r=this.$defaultOptions[e]||(this.$defaultOptions[e]={});r[t]&&(r.forwardTo?this.setDefaultValue(r.forwardTo,t,n):r[t].value=n)},e.prototype.setDefaultValues=function(e,t){Object.keys(t).forEach(function(n){this.setDefaultValue(e,n,t[n])},this)},e.prototype.setMessages=function(e,t){l=e,t&&t.placeholders&&(u=t.placeholders)},e.prototype.nls=function(e,t,n){l[e]||(c(`No message found for the key '`+e+`' in messages with id `+l.$id+`, trying to find a translation for the default string '`+t+`'.`),l[t]||c(`No message found for the default string '`+t+`' in the provided messages. Falling back to the default English message.`));var r=l[e]||l[t]||t;return n&&(u===`dollarSigns`&&(r=r.replace(/\\$(\\$|[\\d]+)/g,function(e,t){return t==`$`?`$`:n[t]})),u===`curlyBrackets`&&(r=r.replace(/\\{([^\\}]+)\\}/g,function(e,t){return n[t]}))),r},e}();d.prototype.warn=c,d.prototype.reportError=a,r.implement(d.prototype,i),t.AppConfig=d}),ace.define(`ace/theme/textmate-css`,[`require`,`exports`,`module`],function(e,t,n){n.exports=`.ace-tm .ace_gutter {\n background: #f0f0f0;\n color: #333;\n}\n\n.ace-tm .ace_print-margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-tm .ace_fold {\n background-color: #6B72E6;\n}\n\n.ace-tm {\n background-color: #FFFFFF;\n color: black;\n}\n\n.ace-tm .ace_cursor {\n color: black;\n}\n \n.ace-tm .ace_invisible {\n color: rgb(191, 191, 191);\n}\n\n.ace-tm .ace_storage,\n.ace-tm .ace_keyword {\n color: blue;\n}\n\n.ace-tm .ace_constant {\n color: rgb(197, 6, 11);\n}\n\n.ace-tm .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-tm .ace_constant.ace_language {\n color: rgb(88, 92, 246);\n}\n\n.ace-tm .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_invalid {\n background-color: rgba(255, 0, 0, 0.1);\n color: red;\n}\n\n.ace-tm .ace_support.ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-tm .ace_support.ace_constant {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_support.ace_type,\n.ace-tm .ace_support.ace_class {\n color: rgb(109, 121, 222);\n}\n\n.ace-tm .ace_keyword.ace_operator {\n color: rgb(104, 118, 135);\n}\n\n.ace-tm .ace_string {\n color: rgb(3, 106, 7);\n}\n\n.ace-tm .ace_comment {\n color: rgb(76, 136, 107);\n}\n\n.ace-tm .ace_comment.ace_doc {\n color: rgb(0, 102, 255);\n}\n\n.ace-tm .ace_comment.ace_doc.ace_tag {\n color: rgb(128, 159, 191);\n}\n\n.ace-tm .ace_constant.ace_numeric {\n color: rgb(0, 0, 205);\n}\n\n.ace-tm .ace_variable {\n color: rgb(49, 132, 149);\n}\n\n.ace-tm .ace_xml-pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-tm .ace_entity.ace_name.ace_function {\n color: #0000A2;\n}\n\n\n.ace-tm .ace_heading {\n color: rgb(12, 7, 255);\n}\n\n.ace-tm .ace_list {\n color:rgb(185, 6, 144);\n}\n\n.ace-tm .ace_meta.ace_tag {\n color:rgb(0, 22, 142);\n}\n\n.ace-tm .ace_string.ace_regex {\n color: rgb(255, 0, 0)\n}\n\n.ace-tm .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n.ace-tm.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px white;\n}\n.ace-tm .ace_marker-layer .ace_step {\n background: rgb(252, 255, 0);\n}\n\n.ace-tm .ace_marker-layer .ace_stack {\n background: rgb(164, 229, 101);\n}\n\n.ace-tm .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-tm .ace_marker-layer .ace_active-line {\n background: rgba(0, 0, 0, 0.07);\n}\n\n.ace-tm .ace_gutter-active-line {\n background-color : #dcdcdc;\n}\n\n.ace-tm .ace_marker-layer .ace_selected-word {\n background: rgb(250, 250, 255);\n border: 1px solid rgb(200, 200, 250);\n}\n\n.ace-tm .ace_indent-guide {\n background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\n}\n\n.ace-tm .ace_indent-guide-active {\n background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC\") right repeat-y;\n}\n`}),ace.define(`ace/theme/textmate`,[`require`,`exports`,`module`,`ace/theme/textmate-css`,`ace/lib/dom`],function(e,t,n){t.isDark=!1,t.cssClass=`ace-tm`,t.cssText=e(\"./textmate-css\"),t.$id=`ace/theme/textmate`,e(\"../lib/dom\").importCssString(t.cssText,t.cssClass,!1)}),ace.define(`ace/config`,[`require`,`exports`,`module`,`ace/lib/lang`,`ace/lib/net`,`ace/lib/dom`,`ace/lib/app_config`,`ace/theme/textmate`],function(e,t,n){\"no use strict\";var r=e(\"./lib/lang\"),i=e(\"./lib/net\"),a=e(\"./lib/dom\"),o=e(\"./lib/app_config\").AppConfig;n.exports=t=new o;var s={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:``,suffix:`.js`,$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};t.get=function(e){if(!s.hasOwnProperty(e))throw Error(`Unknown config key: `+e);return s[e]},t.set=function(e,t){if(s.hasOwnProperty(e))s[e]=t;else if(this.setDefaultValue(``,e,t)==0)throw Error(`Unknown config key: `+e);e==`useStrictCSP`&&a.useStrictCSP(t)},t.all=function(){return r.copyObject(s)},t.$modes={},t.moduleUrl=function(e,t){if(s.$moduleUrls[e])return s.$moduleUrls[e];var n=e.split(`/`);t=t||n[n.length-2]||``;var r=t==`snippets`?`/`:`-`,i=n[n.length-1];if(t==`worker`&&r==`-`){var a=RegExp(`^`+t+`[\\\\-_]|[\\\\-_]`+t+`$`,`g`);i=i.replace(a,``)}(!i||i==t)&&n.length>1&&(i=n[n.length-2]);var o=s[t+`Path`];return o==null?o=s.basePath:r==`/`&&(t=r=``),o&&o.slice(-1)!=`/`&&(o+=`/`),o+t+r+i+this.get(`suffix`)},t.setModuleUrl=function(e,t){return s.$moduleUrls[e]=t};var c=function(t,n){if(t===`ace/theme/textmate`||t===`./theme/textmate`)return n(null,e(\"./theme/textmate\"));if(l)return l(t,n);console.error(`loader is not configured`)},l;t.setLoader=function(e){l=e},t.dynamicModules=Object.create(null),t.$loading={},t.$loaded={},t.loadModule=function(e,n){var r;if(Array.isArray(e))var a=e[0],o=e[1];else if(typeof e==`string`)var o=e;var s=function(e){if(e&&!t.$loading[o])return n&&n(e);if(t.$loading[o]||(t.$loading[o]=[]),t.$loading[o].push(n),!(t.$loading[o].length>1)){var r=function(){c(o,function(e,n){n&&(t.$loaded[o]=n),t._emit(`load.module`,{name:o,module:n});var r=t.$loading[o];t.$loading[o]=null,r.forEach(function(e){e&&e(n)})})};if(!t.get(`packaged`))return r();i.loadScript(t.moduleUrl(o,a),r),u()}};if(t.dynamicModules[o])t.dynamicModules[o]().then(function(e){e.default?s(e.default):s(e)});else{try{r=this.$require(o)}catch{}s(r||t.$loaded[o])}},t.$require=function(e){if(typeof n.require==`function`)return n.require(e)},t.setModuleLoader=function(e,n){t.dynamicModules[e]=n};var u=function(){!s.basePath&&!s.workerPath&&!s.modePath&&!s.themePath&&!Object.keys(s.$moduleUrls).length&&(console.error(`Unable to infer path to ace from script src,`,`use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes`,`or with webpack use ace/webpack-resolver`),u=function(){})};t.version=`1.44.0`}),ace.define(`ace/loader_build`,[`require`,`exports`,`module`,`ace/lib/fixoldbrowsers`,`ace/config`],function(e,t,n){e(\"./lib/fixoldbrowsers\");var r=e(\"./config\");r.setLoader(function(t,n){e([t],function(e){n(null,e)})});var i=(function(){return this||typeof window<`u`&&window})();n.exports=function(t){r.init=a,r.$require=e,t.require=e,typeof define==`function`&&(t.define=define)},a(!0);function a(t){if(!(!i||!i.document)){r.set(`packaged`,t||e.packaged||n.packaged||i.define&&define.packaged);var a={},s=``,c=document.currentScript||document._currentScript,l=c&&c.ownerDocument||document;c&&c.src&&(s=c.src.split(/[?#]/)[0].split(`/`).slice(0,-1).join(`/`)||``);for(var u=l.getElementsByTagName(`script`),d=0;d<u.length;d++){var f=u[d],p=f.src||f.getAttribute(`src`);if(p){for(var m=f.attributes,h=0,g=m.length;h<g;h++){var _=m[h];_.name.indexOf(`data-ace-`)===0&&(a[o(_.name.replace(/^data-ace-/,``))]=_.value)}var v=p.match(/^(.*)\\/ace([\\-.]\\w+)?\\.js(\\?|$)/);v&&(s=v[1])}}for(var y in s&&(a.base=a.base||s,a.packaged=!0),a.basePath=a.base,a.workerPath=a.workerPath||a.base,a.modePath=a.modePath||a.base,a.themePath=a.themePath||a.base,delete a.base,a)a[y]!==void 0&&r.set(y,a[y])}}function o(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}}),ace.define(`ace/range`,[`require`,`exports`,`module`],function(e,t,n){var r=function(){function e(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}}return e.prototype.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},e.prototype.toString=function(){return`Range: [`+this.start.row+`/`+this.start.column+`] -> [`+this.end.row+`/`+this.end.column+`]`},e.prototype.contains=function(e,t){return this.compare(e,t)==0},e.prototype.compareRange=function(e){var t,n=e.end,r=e.start;return t=this.compare(n.row,n.column),t==1?(t=this.compare(r.row,r.column),t==1?2:+(t==0)):t==-1?-2:(t=this.compare(r.row,r.column),t==-1?-1:t==1?42:0)},e.prototype.comparePoint=function(e){return this.compare(e.row,e.column)},e.prototype.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},e.prototype.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},e.prototype.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},e.prototype.isStart=function(e,t){return this.start.row==e&&this.start.column==t},e.prototype.setStart=function(e,t){typeof e==`object`?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},e.prototype.setEnd=function(e,t){typeof e==`object`?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},e.prototype.inside=function(e,t){return this.compare(e,t)==0?!(this.isEnd(e,t)||this.isStart(e,t)):!1},e.prototype.insideStart=function(e,t){return this.compare(e,t)==0?!this.isEnd(e,t):!1},e.prototype.insideEnd=function(e,t){return this.compare(e,t)==0?!this.isStart(e,t):!1},e.prototype.compare=function(e,t){return!this.isMultiLine()&&e===this.start.row?t<this.start.column?-1:+(t>this.end.column):e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0},e.prototype.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},e.prototype.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},e.prototype.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},e.prototype.clipRows=function(t,n){if(this.end.row>n)var r={row:n+1,column:0};else if(this.end.row<t)var r={row:t,column:0};if(this.start.row>n)var i={row:n+1,column:0};else if(this.start.row<t)var i={row:t,column:0};return e.fromPoints(i||this.start,r||this.end)},e.prototype.extend=function(t,n){var r=this.compare(t,n);if(r==0)return this;if(r==-1)var i={row:t,column:n};else var a={row:t,column:n};return e.fromPoints(i||this.start,a||this.end)},e.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},e.prototype.isMultiLine=function(){return this.start.row!==this.end.row},e.prototype.clone=function(){return e.fromPoints(this.start,this.end)},e.prototype.collapseRows=function(){return this.end.column==0?new e(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new e(this.start.row,0,this.end.row,0)},e.prototype.toScreenRange=function(t){var n=t.documentToScreenPosition(this.start),r=t.documentToScreenPosition(this.end);return new e(n.row,n.column,r.row,r.column)},e.prototype.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t},e}();r.fromPoints=function(e,t){return new r(e.row,e.column,t.row,t.column)},r.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=r}),ace.define(`ace/lib/keys`,[`require`,`exports`,`module`,`ace/lib/oop`],function(e,t,n){for(var r=e(\"./oop\"),i={MODIFIER_KEYS:{16:`Shift`,17:`Ctrl`,18:`Alt`,224:`Meta`,91:`MetaLeft`,92:`MetaRight`,93:`ContextMenu`},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:`Backspace`,9:`Tab`,13:`Return`,19:`Pause`,27:`Esc`,32:`Space`,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`Left`,38:`Up`,39:`Right`,40:`Down`,44:`Print`,45:`Insert`,46:`Delete`,\"-13\":`NumpadEnter`,144:`Numlock`,145:`Scrolllock`},PRINTABLE_KEYS:{32:` `,59:`;`,61:`=`,107:`+`,109:`-`,110:`.`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:\"`\",219:`[`,220:`\\\\`,221:`]`,222:`'`,111:`/`,106:`*`}},a={Command:224,Backspace:8,Tab:9,Return:13,Enter:13,Pause:19,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Delete:46,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Backquote:192,Minus:189,Equal:187,BracketLeft:219,Backslash:220,BracketRight:221,Semicolon:186,Quote:222,Comma:188,Period:190,Slash:191,Space:32,NumpadAdd:107,NumpadDecimal:110,NumpadSubtract:109,NumpadDivide:111,NumpadMultiply:106},o=0;o<10;o++)a[`Digit`+o]=48+o,a[`Numpad`+o]=96+o,i.PRINTABLE_KEYS[48+o]=``+o,i.FUNCTION_KEYS[96+o]=`Numpad`+o;for(var o=65;o<91;o++){var s=String.fromCharCode(o+32);a[`Key`+s.toUpperCase()]=o,i.PRINTABLE_KEYS[o]=s}for(var o=1;o<13;o++)a[`F`+o]=111+o,i.FUNCTION_KEYS[111+o]=`F`+o;var c={Shift:16,Control:17,Alt:18,Meta:224};for(var l in c)a[l]=a[l+`Left`]=a[l+`Right`]=c[l];for(var u in t.$codeToKeyCode=a,i.PRINTABLE_KEYS[173]=`-`,i.FUNCTION_KEYS){var d=i.FUNCTION_KEYS[u].toLowerCase();i[d]=parseInt(u,10)}for(var u in i.PRINTABLE_KEYS){var d=i.PRINTABLE_KEYS[u].toLowerCase();i[d]=parseInt(u,10)}r.mixin(i,i.MODIFIER_KEYS),r.mixin(i,i.PRINTABLE_KEYS),r.mixin(i,i.FUNCTION_KEYS),i.enter=i.return,i.escape=i.esc,i.del=i.delete,(function(){for(var e=[`cmd`,`ctrl`,`alt`,`shift`],t=2**e.length;t--;)i.KEY_MODS[t]=e.filter(function(e){return t&i.KEY_MODS[e]}).join(`-`)+`-`})(),i.KEY_MODS[0]=``,i.KEY_MODS[-1]=`input-`,r.mixin(t,i),t.default=t,t.keyCodeToString=function(e){var t=i[e];return typeof t!=`string`&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define(`ace/lib/event`,[`require`,`exports`,`module`,`ace/lib/keys`,`ace/lib/useragent`],function(e,t,n){var r=e(\"./keys\"),i=e(\"./useragent\"),a=null,o=0,s;function c(){s=!1;try{document.createComment(``).addEventListener(`test`,function(){},{get passive(){return s={passive:!1},!0}})}catch{}}function l(){return s??c(),s}function u(e,t,n){this.elem=e,this.type=t,this.callback=n}u.prototype.destroy=function(){f(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var d=t.addListener=function(e,t,n,r){e.addEventListener(t,n,l()),r&&r.$toDestroy.push(new u(e,t,n))},f=t.removeListener=function(e,t,n){e.removeEventListener(t,n,l())};t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation&&e.stopPropagation()},t.preventDefault=function(e){e.preventDefault&&e.preventDefault()},t.getButton=function(e){return e.type==`dblclick`?0:e.type==`contextmenu`||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.button},t.capture=function(e,t,n){var r=e&&e.ownerDocument||document;function i(e){t&&t(e),n&&n(e),f(r,`mousemove`,t),f(r,`mouseup`,i),f(r,`dragstart`,i)}return d(r,`mousemove`,t),d(r,`mouseup`,i),d(r,`dragstart`,i),i},t.addMouseWheelListener=function(e,t,n){d(e,`wheel`,function(e){var n=.15,r=e.deltaX||0,i=e.deltaY||0;switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=r*n,e.wheelY=i*n;break;case e.DOM_DELTA_LINE:var a=15;e.wheelX=r*a,e.wheelY=i*a;break;case e.DOM_DELTA_PAGE:var o=150;e.wheelX=r*o,e.wheelY=i*o;break}t(e)},n)},t.addMultiMouseDownListener=function(e,n,r,a,o){var s=0,c,l,u,f={2:`dblclick`,3:`tripleclick`,4:`quadclick`};function p(e){if(t.getButton(e)===0?e.detail>1?(s++,s>4&&(s=1)):s=1:s=0,i.isIE){var o=Math.abs(e.clientX-c)>5||Math.abs(e.clientY-l)>5;(!u||o)&&(s=1),u&&clearTimeout(u),u=setTimeout(function(){u=null},n[s-1]||600),s==1&&(c=e.clientX,l=e.clientY)}if(e._clicks=s,r[a](`mousedown`,e),s>4)s=0;else if(s>1)return r[a](f[s],e)}Array.isArray(e)||(e=[e]),e.forEach(function(e){d(e,`mousedown`,p,o)})};function p(e){return 0|!!e.ctrlKey|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}t.getModifierString=function(e){return r.KEY_MODS[p(e)]};function m(e,t,n){var s=p(t);if(!n&&t.code&&(n=r.$codeToKeyCode[t.code]||n),!i.isMac&&a){if(t.getModifierState&&(t.getModifierState(`OS`)||t.getModifierState(`Win`))&&(s|=8),a.altGr)if((3&s)!=3)a.altGr=0;else return;if(n===18||n===17){var c=t.location;n===17&&c===1?a[n]==1&&(o=t.timeStamp):n===18&&s===3&&c===2&&t.timeStamp-o<50&&(a.altGr=!0)}}if(n in r.MODIFIER_KEYS&&(n=-1),!(!s&&n===13&&t.location===3&&(e(t,s,-n),t.defaultPrevented))){if(i.isChromeOS&&s&8){if(e(t,s,n),t.defaultPrevented)return;s&=-9}return!s&&!(n in r.FUNCTION_KEYS)&&!(n in r.PRINTABLE_KEYS)?!1:e(t,s,n)}}t.addCommandKeyListener=function(e,n,r){var i=null;d(e,`keydown`,function(e){a[e.keyCode]=(a[e.keyCode]||0)+1;var t=m(n,e,e.keyCode);return i=e.defaultPrevented,t},r),d(e,`keypress`,function(e){i&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),i=null)},r),d(e,`keyup`,function(e){a[e.keyCode]=null},r),a||(h(),d(window,`focus`,h))};function h(){a=Object.create(null)}if(typeof window==`object`&&window.postMessage&&!i.isOldIE){var g=1;t.nextTick=function(e,n){n||=window;var r=`zero-timeout-message-`+g++,i=function(a){a.data==r&&(t.stopPropagation(a),f(n,`message`,i),e())};d(n,`message`,i),n.postMessage(r,`*`)}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function n(){t.$idleBlocked?setTimeout(n,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame=typeof window==`object`&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define(`ace/clipboard`,[`require`,`exports`,`module`],function(e,t,n){var r;n.exports={lineMode:!1,pasteCancelled:function(){return r&&r>Date.now()-50?!0:r=!1},cancel:function(){r=Date.now()}}}),ace.define(`ace/keyboard/textinput`,[`require`,`exports`,`module`,`ace/lib/event`,`ace/config`,`ace/lib/useragent`,`ace/lib/dom`,`ace/lib/lang`,`ace/clipboard`,`ace/lib/keys`],function(e,t,n){var r=e(\"../lib/event\"),i=e(\"../config\").nls,a=e(\"../lib/useragent\"),o=e(\"../lib/dom\"),s=e(\"../lib/lang\"),c=e(\"../clipboard\"),l=a.isChrome<18,u=a.isIE,d=a.isChrome>63,f=400,p=e(\"../lib/keys\"),m=p.KEY_MODS,h=a.isIOS,g=h?/\\s/:/\\n/,_=a.isMobile;t.TextInput=function(){function e(e,t){var n=this;this.host=t,this.text=o.createElement(`textarea`),this.text.className=`ace_text-input`,this.text.setAttribute(`wrap`,`off`),this.text.setAttribute(`autocomplete`,`off`),this.text.setAttribute(`autocorrect`,`off`),this.text.setAttribute(`autocapitalize`,`off`),this.text.setAttribute(`spellcheck`,`false`),this.text.style.opacity=`0`,e.insertBefore(this.text,e.firstChild),this.copied=!1,this.pasted=!1,this.inComposition=!1,this.sendingText=!1,this.tempStyle=``,_||(this.text.style.fontSize=`1px`),this.commandMode=!1,this.ignoreFocusEvents=!1,this.lastValue=``,this.lastSelectionStart=0,this.lastSelectionEnd=0,this.lastRestoreEnd=0,this.rowStart=2**53-1,this.rowEnd=-(2**53-1),this.numberOfExtraLines=0;try{this.$isFocused=document.activeElement===this.text}catch{}this.cancelComposition=this.cancelComposition.bind(this),this.setAriaOptions({role:`textbox`}),r.addListener(this.text,`blur`,function(e){n.ignoreFocusEvents||(t.onBlur(e),n.$isFocused=!1)},t),r.addListener(this.text,`focus`,function(e){if(!n.ignoreFocusEvents){if(n.$isFocused=!0,a.isEdge)try{if(!document.hasFocus())return}catch{}t.onFocus(e),a.isEdge?setTimeout(n.resetSelection.bind(n)):n.resetSelection()}},t),this.$focusScroll=!1,t.on(`beforeEndOperation`,function(){var e=t.curOp,r=e&&e.command&&e.command.name;if(r!=`insertstring`){var i=r&&(e.docChanged||e.selectionChanged);n.inComposition&&i&&(n.lastValue=n.text.value=``,n.onCompositionEnd()),n.resetSelection()}}),t.on(`changeSelection`,this.setAriaLabel.bind(this)),this.resetSelection=h?this.$resetSelectionIOS:this.$resetSelection,this.$isFocused&&t.onFocus(),this.inputHandler=null,this.afterContextMenu=!1,r.addCommandKeyListener(this.text,function(e,r,i){if(!n.inComposition)return t.onCommandKey(e,r,i)},t),r.addListener(this.text,`select`,this.onSelect.bind(this),t),r.addListener(this.text,`input`,this.onInput.bind(this),t),r.addListener(this.text,`cut`,this.onCut.bind(this),t),r.addListener(this.text,`copy`,this.onCopy.bind(this),t),r.addListener(this.text,`paste`,this.onPaste.bind(this),t),(!(`oncut`in this.text)||!(`oncopy`in this.text)||!(`onpaste`in this.text))&&r.addListener(e,`keydown`,function(e){if(!(a.isMac&&!e.metaKey||!e.ctrlKey))switch(e.keyCode){case 67:n.onCopy(e);break;case 86:n.onPaste(e);break;case 88:n.onCut(e);break}},t),this.syncComposition=s.delayedCall(this.onCompositionUpdate.bind(this),50).schedule.bind(null,null),r.addListener(this.text,`compositionstart`,this.onCompositionStart.bind(this),t),r.addListener(this.text,`compositionupdate`,this.onCompositionUpdate.bind(this),t),r.addListener(this.text,`keyup`,this.onKeyup.bind(this),t),r.addListener(this.text,`keydown`,this.syncComposition.bind(this),t),r.addListener(this.text,`compositionend`,this.onCompositionEnd.bind(this),t),this.closeTimeout,r.addListener(this.text,`mouseup`,this.$onContextMenu.bind(this),t),r.addListener(this.text,`mousedown`,function(e){e.preventDefault(),n.onContextMenuClose()},t),r.addListener(t.renderer.scroller,`contextmenu`,this.$onContextMenu.bind(this),t),r.addListener(this.text,`contextmenu`,this.$onContextMenu.bind(this),t),h&&this.addIosSelectionHandler(e,t,this.text)}return e.prototype.addIosSelectionHandler=function(e,t,n){var r=this,i=null,a=!1;n.addEventListener(`keydown`,function(e){i&&clearTimeout(i),a=!0},!0),n.addEventListener(`keyup`,function(e){i=setTimeout(function(){a=!1},100)},!0);var o=function(e){if(document.activeElement===n&&!(a||r.inComposition||t.$mouseHandler.isMousePressed)&&!r.copied){var i=n.selectionStart,o=n.selectionEnd,s=null,c=0;if(i==0?s=p.up:i==1?s=p.home:o>r.lastSelectionEnd&&r.lastValue[o]==`\n`?s=p.end:i<r.lastSelectionStart&&r.lastValue[i-1]==` `?(s=p.left,c=m.option):i<r.lastSelectionStart||i==r.lastSelectionStart&&r.lastSelectionEnd!=r.lastSelectionStart&&i==o?s=p.left:o>r.lastSelectionEnd&&r.lastValue.slice(0,o).split(`\n`).length>2?s=p.down:o>r.lastSelectionEnd&&r.lastValue[o-1]==` `?(s=p.right,c=m.option):(o>r.lastSelectionEnd||o==r.lastSelectionEnd&&r.lastSelectionEnd!=r.lastSelectionStart&&i==o)&&(s=p.right),i!==o&&(c|=m.shift),s){if(!t.onCommandKey({},c,s)&&t.commands){s=p.keyCodeToString(s);var l=t.commands.findKeyCommand(c,s);l&&t.execCommand(l)}r.lastSelectionStart=i,r.lastSelectionEnd=o,r.resetSelection(``)}}};document.addEventListener(`selectionchange`,o),t.on(`destroy`,function(){document.removeEventListener(`selectionchange`,o)})},e.prototype.onContextMenuClose=function(){var e=this;clearTimeout(this.closeTimeout),this.closeTimeout=setTimeout(function(){e.tempStyle&&=(e.text.style.cssText=e.tempStyle,``),e.host.renderer.$isMousePressed=!1,e.host.renderer.$keepTextAreaAtCursor&&e.host.renderer.$moveTextAreaToCursor()},0)},e.prototype.$onContextMenu=function(e){this.host.textInput.onContextMenu(e),this.onContextMenuClose()},e.prototype.onKeyup=function(e){e.keyCode==27&&this.text.value.length<this.text.selectionStart&&(this.inComposition||(this.lastValue=this.text.value),this.lastSelectionStart=this.lastSelectionEnd=-1,this.resetSelection()),this.syncComposition()},e.prototype.cancelComposition=function(){this.ignoreFocusEvents=!0,this.text.blur(),this.text.focus(),this.ignoreFocusEvents=!1},e.prototype.onCompositionStart=function(e){if(!(this.inComposition||!this.host.onCompositionStart||this.host.$readOnly)&&(this.inComposition={},!this.commandMode)){e.data&&(this.inComposition.useTextareaForIME=!1),setTimeout(this.onCompositionUpdate.bind(this),0),this.host._signal(`compositionStart`),this.host.on(`mousedown`,this.cancelComposition);var t=this.host.getSelectionRange();t.end.row=t.start.row,t.end.column=t.start.column,this.inComposition.markerRange=t,this.inComposition.selectionStart=this.lastSelectionStart,this.host.onCompositionStart(this.inComposition),this.inComposition.useTextareaForIME?(this.lastValue=this.text.value=``,this.lastSelectionStart=0,this.lastSelectionEnd=0):(this.text.msGetInputContext&&(this.inComposition.context=this.text.msGetInputContext()),this.text.getInputContext&&(this.inComposition.context=this.text.getInputContext()))}},e.prototype.onCompositionUpdate=function(){if(!(!this.inComposition||!this.host.onCompositionUpdate||this.host.$readOnly)){if(this.commandMode)return this.cancelComposition();if(this.inComposition.useTextareaForIME)this.host.onCompositionUpdate(this.text.value);else{var e=this.text.value;this.sendText(e),this.inComposition.markerRange&&(this.inComposition.context&&(this.inComposition.markerRange.start.column=this.inComposition.selectionStart=this.inComposition.context.compositionStartOffset),this.inComposition.markerRange.end.column=this.inComposition.markerRange.start.column+this.lastSelectionEnd-this.inComposition.selectionStart+this.lastRestoreEnd)}}},e.prototype.onCompositionEnd=function(e){!this.host.onCompositionEnd||this.host.$readOnly||(this.inComposition=!1,this.host.onCompositionEnd(),this.host.off(`mousedown`,this.cancelComposition),e&&this.onInput())},e.prototype.onCut=function(e){this.doCopy(e,!0)},e.prototype.onCopy=function(e){this.doCopy(e,!1)},e.prototype.onPaste=function(e){var t=this.handleClipboardData(e);c.pasteCancelled()||(typeof t==`string`?(t&&this.host.onPaste(t,e),a.isIE&&setTimeout(this.resetSelection),r.preventDefault(e)):(this.text.value=``,this.pasted=!0))},e.prototype.doCopy=function(e,t){var n=this,i=this.host.getCopyText();if(!i)return r.preventDefault(e);this.handleClipboardData(e,i)?(h&&(this.resetSelection(i),this.copied=i,setTimeout(function(){n.copied=!1},10)),t?this.host.onCut():this.host.onCopy(),r.preventDefault(e)):(this.copied=!0,this.text.value=i,this.text.select(),setTimeout(function(){n.copied=!1,n.resetSelection(),t?n.host.onCut():n.host.onCopy()}))},e.prototype.handleClipboardData=function(e,t,n){var r=e.clipboardData||window.clipboardData;if(!(!r||l)){var i=u||n?`Text`:`text/plain`;try{return t?r.setData(i,t)!==!1:r.getData(i)}catch(e){if(!n)return this.handleClipboardData(e,t,!0)}}},e.prototype.onInput=function(e){if(this.inComposition)return this.onCompositionUpdate();if(e&&e.inputType){if(e.inputType==`historyUndo`)return this.host.execCommand(`undo`);if(e.inputType==`historyRedo`)return this.host.execCommand(`redo`)}var t=this.text.value,n=this.sendText(t,!0);(t.length>f+100||g.test(n)||_&&this.lastSelectionStart<1&&this.lastSelectionStart==this.lastSelectionEnd)&&this.resetSelection()},e.prototype.sendText=function(e,t){if(this.afterContextMenu&&=!1,this.pasted)return this.resetSelection(),e&&this.host.onPaste(e),this.pasted=!1,``;for(var n=this.text.selectionStart,r=this.text.selectionEnd,i=this.lastSelectionStart,o=this.lastValue.length-this.lastSelectionEnd,s=e,c=e.length-n,l=e.length-r,u=0;i>0&&this.lastValue[u]==e[u];)u++,i--;for(s=s.slice(u),u=1;o>0&&this.lastValue.length-u>this.lastSelectionStart-1&&this.lastValue[this.lastValue.length-u]==e[e.length-u];)u++,o--;c-=u-1,l-=u-1;var d=s.length-u+1;if(d<0&&(i=-d,d=0),s=s.slice(0,d),!t&&!s&&!c&&!i&&!o&&!l)return``;this.sendingText=!0;var f=!1;return a.isAndroid&&s==`. `&&(s=` `,f=!0),s&&!i&&!o&&!c&&!l||this.commandMode?this.host.onTextInput(s):this.host.onTextInput(s,{extendLeft:i,extendRight:o,restoreStart:c,restoreEnd:l}),this.sendingText=!1,this.lastValue=e,this.lastSelectionStart=n,this.lastSelectionEnd=r,this.lastRestoreEnd=l,f?`\n`:s},e.prototype.onSelect=function(e){var t=this;this.inComposition||(this.copied?this.copied=!1:function(e){return e.selectionStart===0&&e.selectionEnd>=t.lastValue.length&&e.value===t.lastValue&&t.lastValue&&e.selectionEnd!==t.lastSelectionEnd}(this.text)?(this.host.selectAll(),this.resetSelection()):_&&this.text.selectionStart!=this.lastSelectionStart&&this.resetSelection())},e.prototype.$resetSelectionIOS=function(e){if(!(!this.$isFocused||this.copied&&!e||this.sendingText)){e||=``;var t=`\n ab`+e+`cde fg\n`;t!=this.text.value&&(this.text.value=this.lastValue=t);var n=4,r=4+(e.length||+!this.host.selection.isEmpty());(this.lastSelectionStart!=n||this.lastSelectionEnd!=r)&&this.text.setSelectionRange(n,r),this.lastSelectionStart=n,this.lastSelectionEnd=r}},e.prototype.$resetSelection=function(){var e=this;if(!(this.inComposition||this.sendingText)&&!(!this.$isFocused&&!this.afterContextMenu)){this.inComposition=!0;var t=0,n=0,r=``,i=function(t,n){for(var r=n,i=1;i<=t-e.rowStart&&i<2*e.numberOfExtraLines+1;i++)r+=e.host.session.getLine(t-i).length+1;return r};if(this.host.session){var a=this.host.selection,o=a.getRange(),s=a.cursor.row;s===this.rowEnd+1?(this.rowStart=this.rowEnd+1,this.rowEnd=this.rowStart+2*this.numberOfExtraLines):s===this.rowStart-1?(this.rowEnd=this.rowStart-1,this.rowStart=this.rowEnd-2*this.numberOfExtraLines):(s<this.rowStart-1||s>this.rowEnd+1)&&(this.rowStart=s>this.numberOfExtraLines?s-this.numberOfExtraLines:0,this.rowEnd=s>this.numberOfExtraLines?s+this.numberOfExtraLines:2*this.numberOfExtraLines);for(var c=[],l=this.rowStart;l<=this.rowEnd;l++)c.push(this.host.session.getLine(l));if(r=c.join(`\n`),t=i(o.start.row,o.start.column),n=i(o.end.row,o.end.column),o.start.row<this.rowStart){var u=this.host.session.getLine(this.rowStart-1);t=o.start.row<this.rowStart-1?0:t,n+=u.length+1,r=u+`\n`+r}else if(o.end.row>this.rowEnd){var d=this.host.session.getLine(this.rowEnd+1);n=o.end.row>this.rowEnd+1?d.length:o.end.column,n+=r.length+1,r=r+`\n`+d}else _&&s>0&&(r=`\n`+r,n+=1,t+=1);r.length>f&&(t<f&&n<f?r=r.slice(0,f):(r=`\n`,t==n?t=n=0:(t=0,n=1)));var p=r+`\n\n`;p!=this.lastValue&&(this.text.value=this.lastValue=p,this.lastSelectionStart=this.lastSelectionEnd=p.length)}if(this.afterContextMenu&&(this.lastSelectionStart=this.text.selectionStart,this.lastSelectionEnd=this.text.selectionEnd),this.lastSelectionEnd!=n||this.lastSelectionStart!=t||this.text.selectionEnd!=this.lastSelectionEnd)try{this.text.setSelectionRange(t,n),this.lastSelectionStart=t,this.lastSelectionEnd=n}catch{}this.inComposition=!1}},e.prototype.setHost=function(e){this.host=e},e.prototype.setNumberOfExtraLines=function(e){if(this.rowStart=2**53-1,this.rowEnd=-(2**53-1),e<0){this.numberOfExtraLines=0;return}this.numberOfExtraLines=e},e.prototype.setAriaLabel=function(){var e=``;if(this.host.$textInputAriaLabel&&(e+=`${this.host.$textInputAriaLabel}, `),this.host.session){var t=this.host.session.selection.cursor.row;e+=i(`text-input.aria-label`,`Cursor at row $0`,[t+1])}this.text.setAttribute(`aria-label`,e)},e.prototype.setAriaOptions=function(e){e.activeDescendant?(this.text.setAttribute(`aria-haspopup`,`true`),this.text.setAttribute(`aria-autocomplete`,e.inline?`both`:`list`),this.text.setAttribute(`aria-activedescendant`,e.activeDescendant)):(this.text.setAttribute(`aria-haspopup`,`false`),this.text.setAttribute(`aria-autocomplete`,`both`),this.text.removeAttribute(`aria-activedescendant`)),e.role&&this.text.setAttribute(`role`,e.role),e.setLabel&&(this.text.setAttribute(`aria-roledescription`,i(`text-input.aria-roledescription`,`editor`)),this.setAriaLabel())},e.prototype.focus=function(){var e=this;if(this.setAriaOptions({setLabel:this.host.renderer.enableKeyboardAccessibility}),this.tempStyle||d||this.$focusScroll==`browser`)return this.text.focus({preventScroll:!0});var t=this.text.style.top;this.text.style.position=`fixed`,this.text.style.top=`0px`;try{var n=this.text.getBoundingClientRect().top!=0}catch{return}var r=[];if(n)for(var i=this.text.parentElement;i&&i.nodeType==1;)r.push(i),i.setAttribute(`ace_nocontext`,`true`),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;this.text.focus({preventScroll:!0}),n&&r.forEach(function(e){e.removeAttribute(`ace_nocontext`)}),setTimeout(function(){e.text.style.position=``,e.text.style.top==`0px`&&(e.text.style.top=t)},0)},e.prototype.blur=function(){this.text.blur()},e.prototype.isFocused=function(){return this.$isFocused},e.prototype.setInputHandler=function(e){this.inputHandler=e},e.prototype.getInputHandler=function(){return this.inputHandler},e.prototype.getElement=function(){return this.text},e.prototype.setCommandMode=function(e){this.commandMode=e,this.text.readOnly=!1},e.prototype.setReadOnly=function(e){this.commandMode||(this.text.readOnly=e)},e.prototype.setCopyWithEmptySelection=function(e){},e.prototype.onContextMenu=function(e){this.afterContextMenu=!0,this.resetSelection(),this.host._emit(`nativecontextmenu`,{target:this.host,domEvent:e}),this.moveToMouse(e,!0)},e.prototype.moveToMouse=function(e,t){var n=this;this.tempStyle||=this.text.style.cssText,this.text.style.cssText=(t?`z-index:100000;`:``)+(a.isIE?`opacity:0.1;`:``)+`text-indent: -`+(this.lastSelectionStart+this.lastSelectionEnd)*this.host.renderer.characterWidth*.5+`px;`;var i=this.host.container.getBoundingClientRect(),s=o.computedStyle(this.host.container),c=i.top+(parseInt(s.borderTopWidth)||0),l=i.left+(parseInt(s.borderLeftWidth)||0),u=i.bottom-c-this.text.clientHeight-2,d=function(e){o.translate(n.text,e.clientX-l-2,Math.min(e.clientY-c-2,u))};d(e),e.type==`mousedown`&&(this.host.renderer.$isMousePressed=!0,clearTimeout(this.closeTimeout),a.isWin&&r.capture(this.host.container,d,this.onContextMenuClose.bind(this)))},e.prototype.destroy=function(){this.text.parentElement&&this.text.parentElement.removeChild(this.text)},e}(),t.$setUserAgentForTests=function(e,t){_=e,h=t}}),ace.define(`ace/mouse/default_handlers`,[`require`,`exports`,`module`,`ace/lib/useragent`],function(e,t,n){var r=e(\"../lib/useragent\"),i=0,a=550,o=function(){function e(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler(`mousedown`,this.onMouseDown.bind(e)),t.setDefaultHandler(`dblclick`,this.onDoubleClick.bind(e)),t.setDefaultHandler(`tripleclick`,this.onTripleClick.bind(e)),t.setDefaultHandler(`quadclick`,this.onQuadClick.bind(e)),t.setDefaultHandler(`mousewheel`,this.onMouseWheel.bind(e)),[`select`,`startSelect`,`selectEnd`,`selectAllEnd`,`selectByWordsEnd`,`selectByLinesEnd`,`dragWait`,`dragWaitEnd`,`focusWait`].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,`getLineRange`),e.selectByWords=this.extendSelectionBy.bind(e,`getWordRange`)}return e.prototype.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,a=e.getButton();if(a!==0){(i.getSelectionRange().isEmpty()||a==1)&&i.selection.moveToPosition(n),a==2&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault());return}if(this.mousedownEvent.time=Date.now(),t&&!i.isFocused()&&(i.focus(),this.$focusTimeout&&!this.$clickSelection&&!i.inMultiSelectMode)){this.setState(`focusWait`),this.captureMouse(e);return}return this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()},e.prototype.startSelect=function(e,t){e||=this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.setStyle(`ace_selecting`),this.setState(`select`))},e.prototype.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(r==-1)e=this.$clickSelection.end;else if(r==1)e=this.$clickSelection.start;else{var i=c(this.$clickSelection,n,t.session);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},e.prototype.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var a=this.$clickSelection.comparePoint(i.start),o=this.$clickSelection.comparePoint(i.end);if(a==-1&&o<=0)t=this.$clickSelection.end,(i.end.row!=r.row||i.end.column!=r.column)&&(r=i.start);else if(o==1&&a>=0)t=this.$clickSelection.start,(i.start.row!=r.row||i.start.column!=r.column)&&(r=i.end);else if(a==-1&&o==1)r=i.end,t=i.start;else{var s=c(this.$clickSelection,r,n.session);r=s.cursor,t=s.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},e.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle(`ace_selecting`)},e.prototype.focusWait=function(){(s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>i||Date.now()-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},e.prototype.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session.getBracketRange(t);r?(r.isEmpty()&&(r.start.column--,r.end.column++),this.setState(`select`)):(r=n.selection.getWordRange(t.row,t.column),this.setState(`selectByWords`)),this.$clickSelection=r,this.select()},e.prototype.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState(`selectByLines`);var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},e.prototype.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState(`selectAll`)},e.prototype.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||={t:0,vx:0,vy:0,allowed:0};var n=this.$lastScroll,r=e.domEvent.timeStamp,i=r-n.t,o=i?e.wheelX/i:n.vx,s=i?e.wheelY/i:n.vy;i<a&&(o=(o+n.vx)/2,s=(s+n.vy)/2);var c=Math.abs(o/s),l=!1;if(c>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),c<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=r:r-n.allowed<a&&(Math.abs(o)<=1.5*Math.abs(n.vx)&&Math.abs(s)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=r):n.allowed=0),n.t=r,n.vx=o,n.vy=s,l)return t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()}},e}();o.prototype.selectEnd=o.prototype.selectByLinesEnd,o.prototype.selectAllEnd=o.prototype.selectByLinesEnd,o.prototype.selectByWordsEnd=o.prototype.selectByLinesEnd,t.DefaultHandlers=o;function s(e,t,n,r){return Math.sqrt((n-e)**2+(r-t)**2)}function c(e,t,n){if(e.start.row==e.end.row)var r=2*t.column-e.start.column-e.end.column;else if(e.start.row==e.end.row-1&&!e.start.column&&!e.end.column)var r=3*t.column-2*n.getLine(e.start.row).length;else var r=2*t.row-e.start.row-e.end.row;return r<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}}),ace.define(`ace/mouse/mouse_event`,[`require`,`exports`,`module`,`ace/lib/event`,`ace/lib/useragent`],function(e,t,n){var r=e(\"../lib/event\"),i=e(\"../lib/useragent\");t.MouseEvent=function(){function e(e,t){this.speed,this.wheelX,this.wheelY,this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return e.prototype.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},e.prototype.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},e.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},e.prototype.getDocumentPosition=function(){return this.$pos||=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos},e.prototype.getGutterRow=function(){var e=this.getDocumentPosition().row;return this.editor.session.documentToScreenRow(e,0)-this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0)},e.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},e.prototype.getButton=function(){return r.getButton(this.domEvent)},e.prototype.getShiftKey=function(){return this.domEvent.shiftKey},e.prototype.getAccelKey=function(){return i.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},e}()}),ace.define(`ace/lib/scroll`,[`require`,`exports`,`module`],function(e,t,n){t.preventParentScroll=function(e){e.stopPropagation();var t=e.currentTarget;t.scrollHeight>t.clientHeight||e.preventDefault()}}),ace.define(`ace/tooltip`,[`require`,`exports`,`module`,`ace/lib/dom`,`ace/lib/event`,`ace/range`,`ace/lib/scroll`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=this&&this.__values||function(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.`)},a=e(\"./lib/dom\");e(\"./lib/event\");var o=e(\"./range\").Range,s=e(\"./lib/scroll\").preventParentScroll,c=`ace_tooltip`,l=function(){function e(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}return e.prototype.$init=function(){return this.$element=a.createElement(`div`),this.$element.className=c,this.$element.style.display=`none`,this.$parentNode.appendChild(this.$element),this.$element},e.prototype.getElement=function(){return this.$element||this.$init()},e.prototype.setText=function(e){this.getElement().textContent=e},e.prototype.setHtml=function(e){this.getElement().innerHTML=e},e.prototype.setPosition=function(e,t){this.getElement().style.left=e+`px`,this.getElement().style.top=t+`px`},e.prototype.setClassName=function(e){a.addCssClass(this.getElement(),e)},e.prototype.setTheme=function(e){this.theme&&(this.theme.isDark&&a.removeCssClass(this.getElement(),`ace_dark`),this.theme.cssClass&&a.removeCssClass(this.getElement(),this.theme.cssClass)),e.isDark&&a.addCssClass(this.getElement(),`ace_dark`),e.cssClass&&a.addCssClass(this.getElement(),e.cssClass),this.theme={isDark:e.isDark,cssClass:e.cssClass}},e.prototype.show=function(e,t,n){e!=null&&this.setText(e),t!=null&&n!=null&&this.setPosition(t,n),this.isOpen||=(this.getElement().style.display=`block`,!0)},e.prototype.hide=function(e){this.isOpen&&=(this.getElement().style.display=`none`,this.getElement().className=c,!1)},e.prototype.getHeight=function(){return this.getElement().offsetHeight},e.prototype.getWidth=function(){return this.getElement().offsetWidth},e.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},e}(),u=new(function(){function e(){this.popups=[]}return e.prototype.addPopup=function(e){this.popups.push(e),this.updatePopups()},e.prototype.removePopup=function(e){var t=this.popups.indexOf(e);t!==-1&&(this.popups.splice(t,1),this.updatePopups())},e.prototype.updatePopups=function(){var e,t,n,r;this.popups.sort(function(e,t){return t.priority-e.priority});var a=[];try{for(var o=i(this.popups),s=o.next();!s.done;s=o.next()){var c=s.value,l=!0;try{for(var u=(n=void 0,i(a)),d=u.next();!d.done;d=u.next()){var f=d.value;if(this.doPopupsOverlap(f,c)){l=!1;break}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}l?a.push(c):c.hide()}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}},e.prototype.doPopupsOverlap=function(e,t){var n=e.getElement().getBoundingClientRect(),r=t.getElement().getBoundingClientRect();return n.left<r.right&&n.right>r.left&&n.top<r.bottom&&n.bottom>r.top},e}());t.popupManager=u,t.Tooltip=l,t.HoverTooltip=function(e){r(t,e);function t(t){t===void 0&&(t=document.body);var n=e.call(this,t)||this;n.timeout=void 0,n.lastT=0,n.idleTime=350,n.lastEvent=void 0,n.onMouseOut=n.onMouseOut.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.waitForHover=n.waitForHover.bind(n),n.hide=n.hide.bind(n);var r=n.getElement();return r.style.whiteSpace=`pre-wrap`,r.style.pointerEvents=`auto`,r.addEventListener(`mouseout`,n.onMouseOut),r.tabIndex=-1,r.addEventListener(`blur`,function(){r.contains(document.activeElement)||this.hide()}.bind(n)),r.addEventListener(`wheel`,s),n}return t.prototype.addToEditor=function(e){e.on(`mousemove`,this.onMouseMove),e.on(`mousedown`,this.hide);var t=e.renderer.getMouseEventTarget();t&&typeof t.removeEventListener==`function`&&t.addEventListener(`mouseout`,this.onMouseOut,!0)},t.prototype.removeFromEditor=function(e){e.off(`mousemove`,this.onMouseMove),e.off(`mousedown`,this.hide);var t=e.renderer.getMouseEventTarget();t&&typeof t.removeEventListener==`function`&&t.removeEventListener(`mouseout`,this.onMouseOut,!0),this.timeout&&=(clearTimeout(this.timeout),null)},t.prototype.onMouseMove=function(e,t){this.lastEvent=e,this.lastT=Date.now();var n=t.$mouseHandler.isMousePressed;if(this.isOpen){var r=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains(r.row,r.column)||n||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||n||(this.lastEvent=e,this.timeout=setTimeout(this.waitForHover,this.idleTime))},t.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var e=Date.now()-this.lastT;if(this.idleTime-e>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-e);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},t.prototype.isOutsideOfText=function(e){var t=e.editor,n=e.getDocumentPosition(),r=t.session.getLine(n.row);if(n.column==r.length){var i=t.renderer.pixelToScreenCoordinates(e.clientX,e.clientY),a=t.session.documentToScreenPosition(n.row,n.column);if(a.column!=i.column||a.row!=i.row)return!0}return!1},t.prototype.setDataProvider=function(e){this.$gatherData=e},t.prototype.showForRange=function(e,t,n,r){if(!(r&&r!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var i=e.renderer;this.isOpen||(u.addPopup(this),this.$registerCloseEvents(),this.setTheme(i.theme)),this.isOpen=!0,this.range=o.fromPoints(t.start,t.end);var s=i.textToScreenCoordinates(t.start.row,t.start.column),c=i.scroller.getBoundingClientRect();s.pageX<c.left&&(s.pageX=c.left);var l=this.getElement();l.innerHTML=``,l.appendChild(n),l.style.maxHeight=``,l.style.display=`block`,this.$setPosition(e,s,!0,t),a.$fixPositionBug(l)}},t.prototype.$setPosition=function(e,t,n,r){var i=10;n&&this.addMarker(r,e.session);var a=e.renderer,o=this.getElement(),s=o.offsetHeight,c=o.offsetWidth,l=t.pageY,u=t.pageX,d=window.innerHeight-l-a.lineHeight,f=this.$shouldPlaceAbove(s,l,d-i);o.style.maxHeight=(f?l:d)-i+`px`,o.style.top=f?``:l+a.lineHeight+`px`,o.style.bottom=f?window.innerHeight-l+`px`:``,o.style.left=Math.min(u,window.innerWidth-c-i)+`px`},t.prototype.$shouldPlaceAbove=function(e,t,n){return!(t-e<0&&t<n)},t.prototype.addMarker=function(e,t){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=t,this.marker=t&&t.addMarker(e,`ace_highlight-marker`,`text`)},t.prototype.hide=function(e){e&&this.$fromKeyboard&&e.type==`keydown`&&e.code==`Escape`||!e&&document.activeElement==this.getElement()||e&&e.target&&(e.type!=`keydown`||e.ctrlKey||e.metaKey)&&this.$element.contains(e.target)||(this.lastEvent=null,this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.addMarker(null),this.isOpen&&(this.$fromKeyboard=!1,this.$removeCloseEvents(),this.getElement().style.display=`none`,this.isOpen=!1,u.removePopup(this)))},t.prototype.$registerCloseEvents=function(){window.addEventListener(`keydown`,this.hide,!0),window.addEventListener(`wheel`,this.hide,!0),window.addEventListener(`mousedown`,this.hide,!0)},t.prototype.$removeCloseEvents=function(){window.removeEventListener(`keydown`,this.hide,!0),window.removeEventListener(`wheel`,this.hide,!0),window.removeEventListener(`mousedown`,this.hide,!0)},t.prototype.onMouseOut=function(e){this.timeout&&=(clearTimeout(this.timeout),null),this.lastEvent=null,this.isOpen&&(!e.relatedTarget||this.getElement().contains(e.relatedTarget)||e&&e.currentTarget.contains(e.relatedTarget)||e.relatedTarget.classList.contains(`ace_content`)||this.hide())},t}(l)}),ace.define(`ace/mouse/default_gutter_handler`,[`require`,`exports`,`module`,`ace/lib/dom`,`ace/mouse/mouse_event`,`ace/tooltip`,`ace/config`,`ace/range`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=this&&this.__values||function(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.`)},a=e(\"../lib/dom\"),o=e(\"./mouse_event\").MouseEvent,s=e(\"../tooltip\").HoverTooltip,c=e(\"../config\").nls,l=e(\"../range\").Range;function u(e){var t=e.editor,n=t.renderer.$gutterLayer;e.$tooltip=new d(t),e.$tooltip.addToEditor(t),e.$tooltip.setDataProvider(function(t,n){var r=t.getDocumentPosition().row;e.$tooltip.showTooltip(r)}),e.editor.setDefaultHandler(`guttermousedown`,function(r){if(!(!t.isFocused()||r.getButton()!=0)&&n.getRegion(r)!=`foldWidgets`){var i=r.getDocumentPosition().row,a=t.session.selection;if(r.getShiftKey())a.selectTo(i,0);else{if(r.domEvent.detail==2)return t.selectAll(),r.preventDefault();e.$clickSelection=t.selection.getLineRange(i)}return e.setState(`selectByLines`),e.captureMouse(r),r.preventDefault()}})}t.GutterHandler=u;var d=function(e){r(t,e);function t(n){var r=e.call(this,n.container)||this;r.id=`gt`+ ++t.$uid,r.editor=n,r.visibleTooltipRow;var i=r.getElement();return i.setAttribute(`role`,`tooltip`),i.setAttribute(`id`,r.id),i.style.pointerEvents=`auto`,r.idleTime=50,r.onDomMouseMove=r.onDomMouseMove.bind(r),r.onDomMouseOut=r.onDomMouseOut.bind(r),r.setClassName(`ace_gutter-tooltip`),r}return t.prototype.onDomMouseMove=function(e){var t=new o(e,this.editor);this.onMouseMove(t,this.editor)},t.prototype.onDomMouseOut=function(e){var t=new o(e,this.editor);this.onMouseOut(t)},t.prototype.addToEditor=function(t){var n=t.renderer.$gutter;n.addEventListener(`mousemove`,this.onDomMouseMove),n.addEventListener(`mouseout`,this.onDomMouseOut),e.prototype.addToEditor.call(this,t)},t.prototype.removeFromEditor=function(t){var n=t.renderer.$gutter;n.removeEventListener(`mousemove`,this.onDomMouseMove),n.removeEventListener(`mouseout`,this.onDomMouseOut),e.prototype.removeFromEditor.call(this,t)},t.prototype.destroy=function(){this.editor&&this.removeFromEditor(this.editor),e.prototype.destroy.call(this)},Object.defineProperty(t,\"annotationLabels\",{get:function(){return{error:{singular:c(`gutter-tooltip.aria-label.error.singular`,`error`),plural:c(`gutter-tooltip.aria-label.error.plural`,`errors`)},security:{singular:c(`gutter-tooltip.aria-label.security.singular`,`security finding`),plural:c(`gutter-tooltip.aria-label.security.plural`,`security findings`)},warning:{singular:c(`gutter-tooltip.aria-label.warning.singular`,`warning`),plural:c(`gutter-tooltip.aria-label.warning.plural`,`warnings`)},info:{singular:c(`gutter-tooltip.aria-label.info.singular`,`information message`),plural:c(`gutter-tooltip.aria-label.info.plural`,`information messages`)},hint:{singular:c(`gutter-tooltip.aria-label.hint.singular`,`suggestion`),plural:c(`gutter-tooltip.aria-label.hint.plural`,`suggestions`)}}},enumerable:!1,configurable:!0}),t.prototype.showTooltip=function(e){var n,r=this.editor.renderer.$gutterLayer,i=r.$annotations[e],o=i?{displayText:Array.from(i.displayText),type:Array.from(i.type)}:{displayText:[],type:[]},s=r.session.getFoldLine(e);if(s&&r.$showFoldedAnnotations){for(var c={error:[],security:[],warning:[],info:[],hint:[]},u={error:1,security:2,warning:3,info:4,hint:5},d,f=e+1;f<=s.end.row;f++)if(r.$annotations[f])for(var p=0;p<r.$annotations[f].text.length;p++){var m=r.$annotations[f].type[p];c[m].push(r.$annotations[f].text[p]),(!d||u[m]<u[d])&&(d=m)}if([`error`,`security`,`warning`].includes(d)){var h=`${t.annotationsToSummaryString(c)} in folded code.`;o.displayText.push(h),o.type.push(d+`_fold`)}}if(o.displayText.length===0)return this.hide();for(var g={error:[],security:[],warning:[],info:[],hint:[]},_=r.$useSvgGutterIcons?`ace_icon_svg`:`ace_icon`,f=0;f<o.displayText.length;f++){var v=a.createElement(`span`),y=a.createElement(`span`);(n=y.classList).add.apply(n,[`ace_${o.type[f]}`,_]),y.setAttribute(`aria-label`,`${t.annotationLabels[o.type[f].replace(`_fold`,``)].singular}`),y.setAttribute(`role`,`img`),y.appendChild(a.createTextNode(` `)),v.appendChild(y),v.appendChild(a.createTextNode(o.displayText[f])),v.appendChild(a.createElement(`br`)),g[o.type[f].replace(`_fold`,``)].push(v)}var b=a.createElement(`span`);g.error.forEach(function(e){return b.appendChild(e)}),g.security.forEach(function(e){return b.appendChild(e)}),g.warning.forEach(function(e){return b.appendChild(e)}),g.info.forEach(function(e){return b.appendChild(e)}),g.hint.forEach(function(e){return b.appendChild(e)}),b.setAttribute(`aria-live`,`polite`);var x=this.$findLinkedAnnotationNode(e);x&&x.setAttribute(`aria-describedby`,this.id);var S=l.fromPoints({row:e,column:0},{row:e,column:0});this.showForRange(this.editor,S,b),this.visibleTooltipRow=e,this.editor._signal(`showGutterTooltip`,this)},t.prototype.$setPosition=function(t,n,r,i){var a=this.$findCellByRow(i.start.row);if(a){var o=a&&a.element,s=o&&o.querySelector(`.ace_gutter_annotation`);if(s){var c=s.getBoundingClientRect();if(c){var l={pageX:c.right,pageY:c.top};return e.prototype.$setPosition.call(this,t,l,!1,i)}}}},t.prototype.$shouldPlaceAbove=function(e,t,n){return n<e},t.prototype.$findLinkedAnnotationNode=function(e){var t=this.$findCellByRow(e);if(t){var n=t.element;if(n.childNodes.length>2)return n.childNodes[2]}},t.prototype.$findCellByRow=function(e){return this.editor.renderer.$gutterLayer.$lines.cells.find(function(t){return t.row===e})},t.prototype.hide=function(t){if(this.isOpen){if(this.$element.removeAttribute(`aria-live`),this.visibleTooltipRow!=null){var n=this.$findLinkedAnnotationNode(this.visibleTooltipRow);n&&n.removeAttribute(`aria-describedby`)}this.visibleTooltipRow=void 0,this.editor._signal(`hideGutterTooltip`,this),e.prototype.hide.call(this,t)}},t.annotationsToSummaryString=function(e){var n,r,a=[],o=[`error`,`security`,`warning`,`info`,`hint`];try{for(var s=i(o),c=s.next();!c.done;c=s.next()){var l=c.value;if(e[l].length){var u=e[l].length===1?t.annotationLabels[l].singular:t.annotationLabels[l].plural;a.push(`${e[l].length} ${u}`)}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return a.join(`, `)},t.prototype.isOutsideOfText=function(e){var t=e.editor.renderer.$gutter.getBoundingClientRect();return!(e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom)},t}(s);d.$uid=0,t.GutterTooltip=d}),ace.define(`ace/mouse/dragdrop_handler`,[`require`,`exports`,`module`,`ace/lib/dom`,`ace/lib/event`,`ace/lib/useragent`],function(e,t,n){var r=e(\"../lib/dom\"),i=e(\"../lib/event\"),a=e(\"../lib/useragent\"),o=200,s=200,c=5;function l(e){var t=e.editor,n=r.createElement(`div`);n.style.cssText=`top:-100px;position:absolute;z-index:2147483647;opacity:0.5`,n.textContent=`\\xA0`,[`dragWait`,`dragWaitEnd`,`startDrag`,`dragReadyEnd`,`onMouseDrag`].forEach(function(t){e[t]=this[t]},this),t.on(`mousedown`,this.onMouseDown.bind(e));var l=t.container,d,f,p,m,h,g,_=0,v,y,b,x,S;this.onDragStart=function(e){if(this.cancelDrag||!l.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}h=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?`copy`:`copyMove`,t.container.appendChild(n),i.setDragImage&&i.setDragImage(n,0,0),setTimeout(function(){t.container.removeChild(n)}),i.clearData(),i.setData(`Text`,t.session.getTextRange()),y=!0,this.setState(`drag`)},this.onDragEnd=function(e){if(l.draggable=!1,y=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;!v&&n==`move`&&t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle(`ace_dragging`),this.editor.renderer.setCursorStyle(``)},this.onDragEnter=function(e){if(!(t.getReadOnly()||!A(e.dataTransfer)))return f=e.clientX,p=e.clientY,d||E(),_++,e.dataTransfer.dropEffect=v=j(e),i.preventDefault(e)},this.onDragOver=function(e){if(!(t.getReadOnly()||!A(e.dataTransfer)))return f=e.clientX,p=e.clientY,d||(E(),_++),O!==null&&(O=null),e.dataTransfer.dropEffect=v=j(e),i.preventDefault(e)},this.onDragLeave=function(e){if(_--,_<=0&&d)return D(),v=null,i.preventDefault(e)},this.onDrop=function(e){if(g){var n=e.dataTransfer;if(y)switch(v){case`move`:h=h.contains(g.row,g.column)?{start:g,end:g}:t.moveText(h,g);break;case`copy`:h=t.moveText(h,g,!0);break}else{var r=n.getData(`Text`);h={start:g,end:t.session.insert(g,r)},t.focus(),v=null}return D(),i.preventDefault(e)}},i.addListener(l,`dragstart`,this.onDragStart.bind(e),t),i.addListener(l,`dragend`,this.onDragEnd.bind(e),t),i.addListener(l,`dragenter`,this.onDragEnter.bind(e),t),i.addListener(l,`dragover`,this.onDragOver.bind(e),t),i.addListener(l,`dragleave`,this.onDragLeave.bind(e),t),i.addListener(l,`drop`,this.onDrop.bind(e),t);function C(e,n){var r=Date.now(),i=!n||e.row!=n.row,a=!n||e.column!=n.column;!x||i||a?(t.moveCursorToPosition(e),x=r,S={x:f,y:p}):u(S.x,S.y,f,p)>c?x=null:r-x>=s&&(t.renderer.scrollCursorIntoView(),x=null)}function w(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,a=t.renderer.layerConfig.characterWidth,s=t.renderer.scroller.getBoundingClientRect(),c={x:{left:f-s.left,right:s.right-f},y:{top:p-s.top,bottom:s.bottom-p}},l=Math.min(c.x.left,c.x.right),u=Math.min(c.y.top,c.y.bottom),d={row:e.row,column:e.column};l/a<=2&&(d.column+=c.x.left<c.x.right?-3:2),u/i<=1&&(d.row+=c.y.top<c.y.bottom?-1:1);var m=e.row!=d.row,h=e.column!=d.column,g=!n||e.row!=n.row;m||h&&!g?b?r-b>=o&&t.renderer.scrollCursorIntoView(d):b=r:b=null}function T(){var e=g;g=t.renderer.screenToTextCoordinates(f,p),C(g,e),w(g,e)}function E(){h=t.selection.toOrientedRange(),d=t.session.addMarker(h,`ace_selection`,t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(m),T(),m=setInterval(T,20),_=0,i.addListener(document,`mousemove`,k)}function D(){clearInterval(m),t.session.removeMarker(d),d=null,t.selection.fromOrientedRange(h),t.isFocused()&&!y&&t.$resetCursorStyle(),h=null,g=null,_=0,b=null,x=null,i.removeListener(document,`mousemove`,k)}var O=null;function k(){O??=setTimeout(function(){O!=null&&d&&D()},20)}function A(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return e==`text/plain`||e==`Text`})}function j(e){var t=[`copy`,`copymove`,`all`,`uninitialized`],n=[`move`,`copymove`,`linkmove`,`all`,`uninitialized`],r=a.isMac?e.altKey:e.ctrlKey,i=`uninitialized`;try{i=e.dataTransfer.effectAllowed.toLowerCase()}catch{}var o=`none`;return r&&t.indexOf(i)>=0?o=`copy`:n.indexOf(i)>=0?o=`move`:t.indexOf(i)>=0&&(o=`copy`),o}}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var e=this.editor.container;e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle(`ace_dragging`),this.editor.renderer.setCursorStyle(``),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor,t=e.container;t.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle(`ace_dragging`);var n=a.isWin?`default`:`move`;e.renderer.setCursorStyle(n),this.setState(`dragReady`)},this.onMouseDrag=function(e){var t=this.editor.container;if(a.isIE&&this.state==`dragReady`){var n=u(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>3&&t.dragDrop()}if(this.state===`dragWait`){var n=u(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton();if((e.domEvent.detail||1)===1&&r===0&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var i=e.domEvent.target||e.domEvent.srcElement;if(`unselectable`in i&&(i.unselectable=`on`),t.getDragDelay()){if(a.isWebKit){this.cancelDrag=!0;var o=t.container;o.draggable=!0}this.setState(`dragWait`)}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(l.prototype);function u(e,t,n,r){return Math.sqrt((n-e)**2+(r-t)**2)}t.DragdropHandler=l}),ace.define(`ace/mouse/touch_handler`,[`require`,`exports`,`module`,`ace/mouse/mouse_event`,`ace/lib/event`,`ace/lib/dom`],function(e,t,n){var r=e(\"./mouse_event\").MouseEvent,i=e(\"../lib/event\"),a=e(\"../lib/dom\");t.addTouchListeners=function(e,t){var n=`scroll`,o,s,c,l,u,d,f=0,p,m=0,h=0,g=0,_,v;function y(){var e=window.navigator&&window.navigator.clipboard,r=!1,i=function(){var n=t.getCopyText(),i=t.session.getUndoManager().hasUndo();v.replaceChild(a.buildDom(r?[`span`,!n&&o(`selectall`)&&[`span`,{class:`ace_mobile-button`,action:`selectall`},`Select All`],n&&o(`copy`)&&[`span`,{class:`ace_mobile-button`,action:`copy`},`Copy`],n&&o(`cut`)&&[`span`,{class:`ace_mobile-button`,action:`cut`},`Cut`],e&&o(`paste`)&&[`span`,{class:`ace_mobile-button`,action:`paste`},`Paste`],i&&o(`undo`)&&[`span`,{class:`ace_mobile-button`,action:`undo`},`Undo`],o(`find`)&&[`span`,{class:`ace_mobile-button`,action:`find`},`Find`],o(`openCommandPalette`)&&[`span`,{class:`ace_mobile-button`,action:`openCommandPalette`},`Palette`]]:[`span`]),v.firstChild)},o=function(e){return t.commands.canExecute(e,t)},s=function(n){var a=n.target.getAttribute(`action`);if(a==`more`||!r)return r=!r,i();a==`paste`?e.readText().then(function(e){t.execCommand(a,e)}):a&&((a==`cut`||a==`copy`)&&(e?e.writeText(t.getCopyText()):document.execCommand(`copy`)),t.execCommand(a)),v.firstChild.style.display=`none`,r=!1,a!=`openCommandPalette`&&t.focus()};v=a.buildDom([`div`,{class:`ace_mobile-menu`,onclick:s},[`span`],[`span`,{class:`ace_mobile-button`,action:`more`},`...`]],t.container),v.addEventListener(`touchstart`,function(e){n=`menu`,e.stopPropagation(),e.preventDefault(),t.textInput.focus()}),v.addEventListener(`touchend`,function(e){e.stopPropagation(),e.preventDefault(),s(e)})}function b(){if(!t.getOption(`enableMobileMenu`)){v&&x();return}v||y();var e=t.selection.cursor,n=t.renderer.textToScreenCoordinates(e.row,e.column),r=t.renderer.textToScreenCoordinates(0,0).pageX,i=t.renderer.scrollLeft,a=t.container.getBoundingClientRect();v.style.top=n.pageY-a.top-3+`px`,n.pageX-a.left<a.width-70?(v.style.left=``,v.style.right=`10px`):(v.style.right=``,v.style.left=r+i-a.left+`px`),v.style.display=``,v.firstChild.style.display=`none`,t.on(`input`,x)}function x(e){v&&(v.style.display=`none`),t.off(`input`,x)}function S(){u=null,clearTimeout(u);var e=t.selection.getRange(),r=e.contains(p.row,p.column);(e.isEmpty()||!r)&&(t.selection.moveToPosition(p),t.selection.selectWord()),n=`wait`,b()}function C(){u=null,clearTimeout(u),t.selection.moveToPosition(p);var e=m>=2?t.selection.getLineRange(p.row):t.session.getBracketRange(p);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),n=`wait`}i.addListener(e,`contextmenu`,function(e){_&&t.textInput.getElement().focus()},t),i.addListener(e,`touchstart`,function(e){var i=e.touches;if(u||i.length>1){clearTimeout(u),u=null,c=-1,n=`zoom`;return}_=t.$mouseHandler.isMousePressed=!0;var a=t.renderer.layerConfig.lineHeight,d=t.renderer.layerConfig.lineHeight,v=e.timeStamp;l=v;var y=i[0],b=y.clientX,x=y.clientY;if(Math.abs(o-b)+Math.abs(s-x)>a&&(c=-1),o=e.clientX=b,s=e.clientY=x,h=g=0,p=new r(e,t).getDocumentPosition(),v-c<500&&i.length==1&&!f)m++,e.preventDefault(),e.button=0,C();else{m=0;var w=t.selection.cursor,T=t.selection.isEmpty()?w:t.selection.anchor,E=t.renderer.$cursorLayer.getPixelPosition(w,!0),D=t.renderer.$cursorLayer.getPixelPosition(T,!0),O=t.renderer.scroller.getBoundingClientRect(),k=t.renderer.layerConfig.offset,A=t.renderer.scrollLeft,j=function(e,t){return e/=d,t=t/a-.75,e*e+t*t};if(e.clientX<O.left){n=`zoom`;return}var M=j(e.clientX-O.left-E.left+A,e.clientY-O.top-E.top+k),N=j(e.clientX-O.left-D.left+A,e.clientY-O.top-D.top+k);M<3.5&&N<3.5&&(n=M>N?`cursor`:`anchor`),n=N<3.5?`anchor`:M<3.5?`cursor`:`scroll`,u=setTimeout(S,450)}c=v},t),i.addListener(e,`touchend`,function(e){_=t.$mouseHandler.isMousePressed=!1,d&&clearInterval(d),n==`zoom`?(n=``,f=0):u?(t.selection.moveToPosition(p),f=0,b()):n==`scroll`?(w(),x()):b(),clearTimeout(u),u=null},t),i.addListener(e,`touchmove`,function(e){u&&=(clearTimeout(u),null);var i=e.touches;if(!(i.length>1||n==`zoom`)){var a=i[0],c=o-a.clientX,d=s-a.clientY;if(n==`wait`)if(c*c+d*d>4)n=`cursor`;else return e.preventDefault();o=a.clientX,s=a.clientY,e.clientX=a.clientX,e.clientY=a.clientY;var f=e.timeStamp,p=f-l;if(l=f,n==`scroll`){var m=new r(e,t);m.speed=1,m.wheelX=c,m.wheelY=d,10*Math.abs(c)<Math.abs(d)&&(c=0),10*Math.abs(d)<Math.abs(c)&&(d=0),p!=0&&(h=c/p,g=d/p),t._emit(`mousewheel`,m),m.propagationStopped||(h=g=0)}else{var _=new r(e,t).getDocumentPosition();n==`cursor`?t.selection.moveCursorToPosition(_):n==`anchor`&&t.selection.setSelectionAnchor(_.row,_.column),t.renderer.scrollCursorIntoView(_),e.preventDefault()}}},t);function w(){f+=60,d=setInterval(function(){f--<=0&&(clearInterval(d),d=null),Math.abs(h)<.01&&(h=0),Math.abs(g)<.01&&(g=0),f<20&&(h=.9*h),f<20&&(g=.9*g);var e=t.session.getScrollTop();t.renderer.scrollBy(10*h,10*g),e==t.session.getScrollTop()&&(f=0)},10)}}}),ace.define(`ace/mouse/mouse_handler`,[`require`,`exports`,`module`,`ace/lib/event`,`ace/lib/useragent`,`ace/mouse/default_handlers`,`ace/mouse/default_gutter_handler`,`ace/mouse/mouse_event`,`ace/mouse/dragdrop_handler`,`ace/mouse/touch_handler`,`ace/config`],function(e,t,n){var r=e(\"../lib/event\"),i=e(\"../lib/useragent\"),a=e(\"./default_handlers\").DefaultHandlers,o=e(\"./default_gutter_handler\").GutterHandler,s=e(\"./mouse_event\").MouseEvent,c=e(\"./dragdrop_handler\").DragdropHandler,l=e(\"./touch_handler\").addTouchListeners,u=e(\"../config\"),d=function(){function e(e){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var t=this;this.editor=e,new a(this),new o(this),new c(this);var n=function(t){(!document.hasFocus||!document.hasFocus()||!e.isFocused()&&document.activeElement==(e.textInput&&e.textInput.getElement()))&&window.focus(),e.focus(),setTimeout(function(){e.isFocused()||e.focus()})},s=e.renderer.getMouseEventTarget();r.addListener(s,`click`,this.onMouseEvent.bind(this,`click`),e),r.addListener(s,`mousemove`,this.onMouseMove.bind(this,`mousemove`),e),r.addMultiMouseDownListener([s,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,`onMouseEvent`,e),r.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,`mousewheel`),e),l(e.container,e);var u=e.renderer.$gutter;r.addListener(u,`mousedown`,this.onMouseEvent.bind(this,`guttermousedown`),e),r.addListener(u,`click`,this.onMouseEvent.bind(this,`gutterclick`),e),r.addListener(u,`dblclick`,this.onMouseEvent.bind(this,`gutterdblclick`),e),r.addListener(u,`mousemove`,this.onMouseEvent.bind(this,`guttermousemove`),e),r.addListener(s,`mousedown`,n,e),r.addListener(u,`mousedown`,n,e),i.isIE&&e.renderer.scrollBarV&&(r.addListener(e.renderer.scrollBarV.element,`mousedown`,n,e),r.addListener(e.renderer.scrollBarH.element,`mousedown`,n,e)),e.on(`mousemove`,function(n){if(!(t.state||t.$dragDelay||!t.$dragEnabled)){var r=e.renderer.screenToTextCoordinates(n.x,n.y),i=e.session.selection.getRange(),a=e.renderer;!i.isEmpty()&&i.insideStart(r.row,r.column)?a.setCursorStyle(`default`):a.setCursorStyle(``)}},e)}return e.prototype.onMouseEvent=function(e,t){this.editor.session&&this.editor._emit(e,new s(t,this.editor))},e.prototype.onMouseMove=function(e,t){var n=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!n||!n.length||this.editor._emit(e,new s(t,this.editor))},e.prototype.onMouseWheel=function(e,t){var n=new s(t,this.editor);n.speed=this.$scrollSpeed*2,n.wheelX=t.wheelX,n.wheelY=t.wheelY,this.editor._emit(e,n)},e.prototype.setState=function(e){this.state=e},e.prototype.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var n=this.editor,a=this.editor.renderer;a.$isMousePressed=!0;var o=this,c=!0,l=function(e){if(e){if(i.isWebKit&&!e.which&&o.releaseMouse)return o.releaseMouse();o.x=e.clientX,o.y=e.clientY,t&&t(e),o.mouseEvent=new s(e,o.editor),o.$mouseMoved=!0}},u=function(e){n.off(`beforeEndOperation`,p),c=!1,n.session&&d(),o[o.state+`End`]&&o[o.state+`End`](e),o.state=``,o.isMousePressed=a.$isMousePressed=!1,a.$keepTextAreaAtCursor&&a.$moveTextAreaToCursor(),o.$onCaptureMouseMove=o.releaseMouse=null,e&&o.onMouseEvent(`mouseup`,e),n.endOperation()},d=function(){o[o.state]&&o[o.state](),o.$mouseMoved=!1},f=function(){c&&(d(),r.nextFrame(f))};if(i.isOldIE&&e.domEvent.type==`dblclick`)return setTimeout(function(){u(e)});var p=function(e){o.releaseMouse&&n.curOp.command.name&&n.curOp.selectionChanged&&(o[o.state+`End`]&&o[o.state+`End`](),o.state=``,o.releaseMouse())};n.on(`beforeEndOperation`,p),n.startOperation({command:{name:`mouse`}}),o.$onCaptureMouseMove=l,o.releaseMouse=r.capture(this.editor.container,l,u),f()},e.prototype.cancelContextMenu=function(){var e=function(t){t&&t.domEvent&&t.domEvent.type!=`contextmenu`||(this.editor.off(`nativecontextmenu`,e),t&&t.domEvent&&r.stopEvent(t.domEvent))}.bind(this);setTimeout(e,10),this.editor.on(`nativecontextmenu`,e)},e.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse(),this.$tooltip&&this.$tooltip.destroy()},e}();d.prototype.releaseMouse=null,u.defineOptions(d.prototype,`mouseHandler`,{scrollSpeed:{initialValue:2},dragDelay:{initialValue:i.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0}}),t.MouseHandler=d}),ace.define(`ace/mouse/fold_handler`,[`require`,`exports`,`module`,`ace/lib/dom`],function(e,t,n){var r=e(\"../lib/dom\");t.FoldHandler=function(){function e(e){e.on(`click`,function(t){var n=t.getDocumentPosition(),i=e.session,a=i.getFoldAt(n.row,n.column,1);a&&(t.getAccelKey()?i.removeFold(a):i.expandFold(a),t.stop());var o=t.domEvent&&t.domEvent.target;o&&r.hasCssClass(o,`ace_inline_button`)&&r.hasCssClass(o,`ace_toggle_wrap`)&&(i.setOption(`wrap`,!i.getUseWrapMode()),e.renderer.scrollCursorIntoView())}),e.on(`gutterclick`,function(t){if(e.renderer.$gutterLayer.getRegion(t)==`foldWidgets`){var n=t.getDocumentPosition().row,r=e.session;r.foldWidgets&&r.foldWidgets[n]&&e.session.onFoldWidgetClick(n,t),e.isFocused()||e.focus(),t.stop()}}),e.on(`gutterdblclick`,function(t){if(e.renderer.$gutterLayer.getRegion(t)==`foldWidgets`){var n=t.getDocumentPosition().row,r=e.session,i=r.getParentFoldRangeData(n,!0),a=i.range||i.firstRange;if(a){n=a.start.row;var o=r.getFoldAt(n,r.getLine(n).length,1);o?r.removeFold(o):(r.addFold(`...`,a),e.renderer.scrollCursorIntoView({row:a.start.row,column:0}))}t.stop()}})}return e}()}),ace.define(`ace/keyboard/keybinding`,[`require`,`exports`,`module`,`ace/lib/keys`,`ace/lib/event`],function(e,t,n){var r=e(\"../lib/keys\"),i=e(\"../lib/event\");t.KeyBinding=function(){function e(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)}return e.prototype.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},e.prototype.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},e.prototype.addKeyboardHandler=function(e,t){if(e){typeof e==`function`&&!e.handleKeyboard&&(e.handleKeyboard=e);var n=this.$handlers.indexOf(e);n!=-1&&this.$handlers.splice(n,1),t==null?this.$handlers.push(e):this.$handlers.splice(t,0,e),n==-1&&e.attach&&e.attach(this.$editor)}},e.prototype.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return t==-1?!1:(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},e.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},e.prototype.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map(function(n){return n.getStatusText&&n.getStatusText(t,e)||``}).filter(Boolean).join(` `)},e.prototype.$callKeyboardHandlers=function(e,t,n,r){for(var a,o=!1,s=this.$editor.commands,c=this.$handlers.length;c--&&(a=this.$handlers[c].handleKeyboard(this.$data,e,t,n,r),!(!(!a||!a.command)&&(o=a.command==`null`?!0:s.exec(a.command,this.$editor,a.args,r),o&&r&&e!=-1&&a.passEvent!=1&&a.command.passEvent!=1&&i.stopEvent(r),o))););return!o&&e==-1&&(a={command:`insertstring`},o=s.exec(`insertstring`,this.$editor,t)),o&&this.$editor._signal&&this.$editor._signal(`keyboardActivity`,a),o},e.prototype.onCommandKey=function(e,t,n){var i=r.keyCodeToString(n);return this.$callKeyboardHandlers(t,i,n,e)},e.prototype.onTextInput=function(e){return this.$callKeyboardHandlers(-1,e)},e}()}),ace.define(`ace/lib/bidiutil`,[`require`,`exports`,`module`],function(e,t,n){var r=0,i=0,a=!1,o=!1,s=!1,c=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],l=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],u=0,d=1,f=0,p=1,m=2,h=3,g=4,_=5,v=6,y=7,b=8,x=9,S=10,C=11,w=12,T=13,E=14,D=15,O=16,k=17,A=18,j=[A,A,A,A,A,A,A,A,A,v,_,v,b,_,A,A,A,A,A,A,A,A,A,A,A,A,A,A,_,_,_,v,b,g,g,C,C,C,g,g,g,g,g,S,x,S,x,x,m,m,m,m,m,m,m,m,m,m,x,g,g,g,g,g,g,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,g,g,g,g,g,g,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,g,g,g,g,A,A,A,A,A,A,_,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,x,g,C,C,C,C,g,g,g,g,f,g,g,A,g,g,C,C,m,m,g,f,g,g,g,m,f,g,g,g,g,g],M=[b,b,b,b,b,b,b,b,b,b,b,A,A,A,f,p,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,b,_,T,E,D,O,k,x,C,C,C,C,C,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,x,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,g,b];function N(e,t,n,u){var d=r?l:c,f=null,p=null,m=null,h=0,g=null,y=null,x=-1,S=null,C=null,w=[];if(!u)for(S=0,u=[];S<n;S++)u[S]=F(e[S]);for(i=r,a=!1,o=!1,s=!1,C=0;C<n;C++){if(f=h,w[C]=p=ee(e,u,w,C),h=d[f][p],g=h&240,h&=15,t[C]=m=d[h][5],g>0)if(g==16){for(S=x;S<C;S++)t[S]=1;x=-1}else x=-1;if(y=d[h][6],y)x==-1&&(x=C);else if(x>-1){for(S=x;S<C;S++)t[S]=m;x=-1}u[C]==_&&(t[C]=0),i|=m}if(s){for(S=0;S<n;S++)if(u[S]==v){t[S]=r;for(var T=S-1;T>=0&&u[T]==b;T--)t[T]=r}}}function P(e,t,n){if(!(i<e)){if(e==1&&r==d&&!o){n.reverse();return}for(var a=n.length,s=0,c,l,u,f;s<a;){if(t[s]>=e){for(c=s+1;c<a&&t[c]>=e;)c++;for(l=s,u=c-1;l<u;l++,u--)f=n[l],n[l]=n[u],n[u]=f;s=c}s++}}}function ee(e,t,n,i){var c=t[i],l,u,d,j;switch(c){case f:case p:a=!1;case g:case h:return c;case m:return a?h:m;case y:return a=!0,p;case b:return g;case x:return i<1||i+1>=t.length||(l=n[i-1])!=m&&l!=h||(u=t[i+1])!=m&&u!=h?g:(a&&(u=h),u==l?u:g);case S:return l=i>0?n[i-1]:_,l==m&&i+1<t.length&&t[i+1]==m?m:g;case C:if(i>0&&n[i-1]==m)return m;if(a)return g;for(j=i+1,d=t.length;j<d&&t[j]==C;)j++;return j<d&&t[j]==m?m:g;case w:for(d=t.length,j=i+1;j<d&&t[j]==w;)j++;if(j<d){var M=e[i],N=M>=1425&&M<=2303||M==64286;if(l=t[j],N&&(l==p||l==y))return p}return i<1||(l=t[i-1])==_?g:n[i-1];case _:return a=!1,o=!0,r;case v:return s=!0,g;case T:case E:case O:case k:case D:a=!1;case A:return g}}function F(e){var t=e.charCodeAt(0),n=t>>8;return n==0?t>191?f:j[t]:n==5?/[\\u0591-\\u05f4]/.test(e)?p:f:n==6?/[\\u0610-\\u061a\\u064b-\\u065f\\u06d6-\\u06e4\\u06e7-\\u06ed]/.test(e)?w:/[\\u0660-\\u0669\\u066b-\\u066c]/.test(e)?h:t==1642?C:/[\\u06f0-\\u06f9]/.test(e)?m:y:n==32&&t<=8287?M[t&255]:n==254&&t>=65136?y:g}t.L=f,t.R=p,t.EN=m,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT=`\u00B7`,t.doBidiReorder=function(e,n,i){if(e.length<2)return{};var a=e.split(``),o=Array(a.length),s=Array(a.length),c=[];r=i?d:u,N(a,c,a.length,n);for(var l=0;l<o.length;o[l]=l,l++);P(2,c,o),P(1,c,o);for(var l=0;l<o.length-1;l++)n[l]===h?c[l]=t.AN:c[l]===p&&(n[l]>y&&n[l]<T||n[l]===g||n[l]===A)?c[l]=t.ON_R:l>0&&a[l-1]===`\u0644`&&/\\u0622|\\u0623|\\u0625|\\u0627/.test(a[l])&&(c[l-1]=c[l]=t.R_H,l++);a[a.length-1]===t.DOT&&(c[a.length-1]=t.B),a[0]===`\u202B`&&(c[0]=t.RLE);for(var l=0;l<o.length;l++)s[l]=c[o[l]];return{logicalFromVisual:o,bidiLevels:s}},t.hasBidiCharacters=function(e,t){for(var n=!1,r=0;r<e.length;r++)t[r]=F(e.charAt(r)),!n&&(t[r]==p||t[r]==y||t[r]==h)&&(n=!0);return n},t.getVisualFromLogicalIdx=function(e,t){for(var n=0;n<t.logicalFromVisual.length;n++)if(t.logicalFromVisual[n]==e)return n;return 0}}),ace.define(`ace/bidihandler`,[`require`,`exports`,`module`,`ace/lib/bidiutil`,`ace/lib/lang`],function(e,t,n){var r=e(\"./lib/bidiutil\"),i=e(\"./lib/lang\"),a=/[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac\\u202B]/;t.BidiHandler=function(){function e(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=r,this.charWidths=[],this.EOL=`\u00AC`,this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line=``,this.wrapIndent=0,this.EOF=`\u00B6`,this.RLE=`\u202B`,this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=a.test(e.getValue())}return e.prototype.isBidiRow=function(e,t,n){return this.seenBidi?(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(t,n),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},e.prototype.onChange=function(e){this.seenBidi?this.currentRow=null:e.action==`insert`&&a.test(e.lines.join(`\n`))&&(this.seenBidi=!0,this.currentRow=null)},e.prototype.getDocumentRow=function(){var e=0,t=this.session.$screenRowCache;if(t.length){var n=this.session.$getRowCacheIndex(t,this.currentRow);n>=0&&(e=this.session.$docRowCache[n])}return e},e.prototype.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,r=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1),n===r);)r=n,e++;else e=this.currentRow;return e},e.prototype.updateRowLine=function(e,t){e===void 0&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var a=this.session.$wrapData[e];a&&(t===void 0&&(t=this.getSplitIndex()),t>0&&a.length?(this.wrapIndent=a.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=t<a.length?this.line.substring(a[t-1],a[t]):this.line.substring(a[a.length-1])):this.line=this.line.substring(0,a[t]),t==a.length&&(this.line+=this.showInvisibles?n:r.DOT))}else this.line+=this.showInvisibles?n:r.DOT;var o=this.session,s=0,c;this.line=this.line.replace(/\\t|[\\u1100-\\u2029, \\u202F-\\uFFE6]/g,function(e,t){return e===`\t`||o.isFullWidth(e.charCodeAt(0))?(c=e===`\t`?o.getScreenTabSize(t+s):2,s+=c-1,i.stringRepeat(r.DOT,c)):e}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==r.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},e.prototype.updateBidiMap=function(){var e=[];r.hasBidiCharacters(this.line,e)||this.isRtlDir?this.bidiMap=r.doBidiReorder(this.line,e,this.isRtlDir):this.bidiMap={}},e.prototype.markAsDirty=function(){this.currentRow=null},e.prototype.updateCharacterWidths=function(e){if(this.characterWidth!==e.$characterSize.width){this.fontMetrics=e;var t=this.characterWidth=e.$characterSize.width,n=e.$measureCharWidth(`\u05D4`);this.charWidths[r.L]=this.charWidths[r.EN]=this.charWidths[r.ON_R]=t,this.charWidths[r.R]=this.charWidths[r.AN]=n,this.charWidths[r.R_H]=n*.45,this.charWidths[r.B]=this.charWidths[r.RLE]=0,this.currentRow=null}},e.prototype.setShowInvisibles=function(e){this.showInvisibles=e,this.currentRow=null},e.prototype.setEolChar=function(e){this.EOL=e},e.prototype.setContentWidth=function(e){this.contentWidth=e},e.prototype.isRtlLine=function(e){return this.$isRtl?!0:e==null?this.isRtlDir:this.session.getLine(e).charAt(0)==this.RLE},e.prototype.setRtlDirection=function(e,t){for(var n=e.getCursorPosition(),r=e.selection.getSelectionAnchor().row;r<=n.row;r++)!t&&e.session.getLine(r).charAt(0)===e.session.$bidiHandler.RLE?e.session.doc.removeInLine(r,0,1):t&&e.session.getLine(r).charAt(0)!==e.session.$bidiHandler.RLE&&e.session.doc.insert({column:0,row:r},e.session.$bidiHandler.RLE)},e.prototype.getPosLeft=function(e){e-=this.wrapIndent;var t=+(this.line.charAt(0)===this.RLE),n=e>t?this.session.getOverwrite()?e:e-1:t,i=r.getVisualFromLogicalIdx(n,this.bidiMap),a=this.bidiMap.bidiLevels,o=0;!this.session.getOverwrite()&&e<=t&&a[i]%2!=0&&i++;for(var s=0;s<i;s++)o+=this.charWidths[a[s]];return!this.session.getOverwrite()&&e>t&&a[i]%2==0&&(o+=this.charWidths[a[i]]),this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(o+=this.rtlLineOffset),o},e.prototype.getSelections=function(e,t){var n=this.bidiMap,r=n.bidiLevels,i,a=[],o=0,s=Math.min(e,t)-this.wrapIndent,c=Math.max(e,t)-this.wrapIndent,l=!1,u=!1,d=0;this.wrapIndent&&(o+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var f,p=0;p<r.length;p++)f=n.logicalFromVisual[p],i=r[p],l=f>=s&&f<c,l&&!u?d=o:!l&&u&&a.push({left:d,width:o-d}),o+=this.charWidths[i],u=l;if(l&&p===r.length&&a.push({left:d,width:o-d}),this.isRtlDir)for(var m=0;m<a.length;m++)a[m].left+=this.rtlLineOffset;return a},e.prototype.offsetToCol=function(e){this.isRtlDir&&(e-=this.rtlLineOffset);var t=0,e=Math.max(e,0),n=0,r=0,i=this.bidiMap.bidiLevels,a=this.charWidths[i[r]];for(this.wrapIndent&&(e-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);e>n+a/2;){if(n+=a,r===i.length-1){a=0;break}a=this.charWidths[i[++r]]}return r>0&&i[r-1]%2!=0&&i[r]%2==0?(e<n&&r--,t=this.bidiMap.logicalFromVisual[r]):r>0&&i[r-1]%2==0&&i[r]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[r]:this.bidiMap.logicalFromVisual[r-1]):this.isRtlDir&&r===i.length-1&&a===0&&i[r-1]%2==0||!this.isRtlDir&&r===0&&i[r]%2!=0?t=1+this.bidiMap.logicalFromVisual[r]:(r>0&&i[r-1]%2!=0&&a!==0&&r--,t=this.bidiMap.logicalFromVisual[r]),t===0&&this.isRtlDir&&t++,t+this.wrapIndent},e}()}),ace.define(`ace/selection`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/lang`,`ace/lib/event_emitter`,`ace/range`],function(e,t,n){var r=e(\"./lib/oop\"),i=e(\"./lib/lang\"),a=e(\"./lib/event_emitter\").EventEmitter,o=e(\"./range\").Range,s=function(){function e(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on(`change`,function(e){t.$cursorChanged=!0,t.$silent||t._emit(`changeCursor`),!t.$isEmpty&&!t.$silent&&t._emit(`changeSelection`),!t.$keepDesiredColumnOnChange&&e.old.column!=e.value.column&&(t.$desiredColumn=null)}),this.anchor.on(`change`,function(){t.$anchorChanged=!0,!t.$isEmpty&&!t.$silent&&t._emit(`changeSelection`)})}return e.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},e.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},e.prototype.getCursor=function(){return this.lead.getPosition()},e.prototype.setAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},e.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},e.prototype.getSelectionLead=function(){return this.lead.getPosition()},e.prototype.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},e.prototype.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},e.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit(`changeSelection`))},e.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},e.prototype.setRange=function(e,t){var n=t?e.end:e.start,r=t?e.start:e.end;this.$setSelection(n.row,n.column,r.row,r.column)},e.prototype.$setSelection=function(e,t,n,r){if(!this.$silent){var i=this.$isEmpty,a=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,r),this.$isEmpty=!o.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit(`changeCursor`),(this.$cursorChanged||this.$anchorChanged||i!=this.$isEmpty||a)&&this._emit(`changeSelection`)}},e.prototype.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},e.prototype.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},e.prototype.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},e.prototype.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},e.prototype.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},e.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},e.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},e.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},e.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},e.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},e.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},e.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},e.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},e.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},e.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},e.prototype.getWordRange=function(e,t){if(t===void 0){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},e.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},e.prototype.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},e.prototype.getLineRange=function(e,t){var n=typeof e==`number`?e:this.lead.row,r,i=this.session.getFoldLine(n);return i?(n=i.start.row,r=i.end.row):r=n,t===!0?new o(n,0,r,this.session.getLine(r).length):new o(n,0,r+1,0)},e.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},e.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},e.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},e.prototype.wouldMoveIntoSoftTab=function(e,t,n){var r=e.column,i=e.column+t;return n<0&&(r=e.column-t,i=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(r,i).split(` `).length-1==t},e.prototype.moveCursorLeft=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,-1))this.moveCursorTo(t.start.row,t.start.column);else if(e.column===0)e.row>0&&this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(e,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},e.prototype.moveCursorRight=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,1))this.moveCursorTo(t.end.row,t.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var n=this.session.getTabSize(),e=this.lead;this.wouldMoveIntoSoftTab(e,n,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,n):this.moveCursorBy(0,1)}},e.prototype.moveCursorLineStart=function(){var e=this.lead.row,t=this.lead.column,n=this.session.documentToScreenRow(e,t),r=this.session.screenToDocumentPosition(n,0),i=this.session.getDisplayLine(e,null,r.row,r.column).match(/^\\s*/);i[0].length!=t&&!this.session.$useEmacsStyleLineStart&&(r.column+=i[0].length),this.moveCursorToPosition(r)},e.prototype.moveCursorLineEnd=function(){var e=this.lead,t=this.session.getDocumentLastRowColumnPosition(e.row,e.column);if(this.lead.column==t.column){var n=this.session.getLine(t.row);if(t.column==n.length){var r=n.search(/\\s+$/);r>0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},e.prototype.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},e.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},e.prototype.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var i=this.session.getFoldAt(e,t,1);if(i){this.moveCursorTo(i.end.row,i.end.column);return}if(this.session.nonTokenRe.exec(r)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t)),t>=n.length){this.moveCursorTo(e,n.length),this.moveCursorRight(),e<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(r)&&(t+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)},e.prototype.moveCursorLongWordLeft=function(){var e=this.lead.row,t=this.lead.column,n;if(n=this.session.getFoldAt(e,t,-1)){this.moveCursorTo(n.start.row,n.start.column);return}var r=this.session.getFoldStringAt(e,t,-1);r??=this.doc.getLine(e).substring(0,t);var a=i.stringReverse(r);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(a)&&(t-=this.session.nonTokenRe.lastIndex,a=a.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),t<=0){this.moveCursorTo(e,0),this.moveCursorLeft(),e>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(a)&&(t-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)},e.prototype.$shortWordEndIndex=function(e){var t=0,n,r=/\\s/,i=this.session.tokenRe;if(i.lastIndex=0,this.session.tokenRe.exec(e))t=this.session.tokenRe.lastIndex;else{for(;(n=e[t])&&r.test(n);)t++;if(t<1){for(i.lastIndex=0;(n=e[t])&&!i.test(n);)if(i.lastIndex=0,t++,r.test(n))if(t>2){t--;break}else{for(;(n=e[t])&&r.test(n);)t++;if(t>2)break}}}return i.lastIndex=0,t},e.prototype.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var a=this.doc.getLength();do e++,r=this.doc.getLine(e);while(e<a&&/^\\s*$/.test(r));/^\\s+/.test(r)||(r=``),t=0}var o=this.$shortWordEndIndex(r);this.moveCursorTo(e,t+o)},e.prototype.moveCursorShortWordLeft=function(){var e=this.lead.row,t=this.lead.column,n;if(n=this.session.getFoldAt(e,t,-1))return this.moveCursorTo(n.start.row,n.start.column);var r=this.session.getLine(e).substring(0,t);if(t===0){do e--,r=this.doc.getLine(e);while(e>0&&/^\\s*$/.test(r));t=r.length,/\\s+$/.test(r)||(r=``)}var a=i.stringReverse(r),o=this.$shortWordEndIndex(a);return this.moveCursorTo(e,t-o)},e.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},e.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},e.prototype.moveCursorBy=function(e,t){var n=this.session.documentToScreenPosition(this.lead.row,this.lead.column),r;if(t===0&&(e!==0&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(r=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(r/this.session.$bidiHandler.charWidths[0])):r=n.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column),e!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var i=this.session.lineWidgets[this.lead.row];e<0?e-=i.rowsAbove||0:e>0&&(e+=i.rowCount-(i.rowsAbove||0))}var a=this.session.screenToDocumentPosition(n.row+e,n.column,r);e!==0&&t===0&&a.row===this.lead.row&&(a.column,this.lead.column),this.moveCursorTo(a.row,a.column+t,t===0)},e.prototype.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},e.prototype.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0;var i=this.session.getLine(e);/[\\uDC00-\\uDFFF]/.test(i.charAt(t))&&i.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?--t:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},e.prototype.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},e.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},e.prototype.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},e.prototype.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},e.prototype.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return o.fromPoints(t,n)}catch{return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},e.prototype.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else{var e=this.getRange();e.isBackwards=this.isBackwards()}return e},e.prototype.fromJSON=function(e){if(e.start==null)if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}else e=e[0];this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},e.prototype.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0},e}();s.prototype.setSelectionAnchor=s.prototype.setAnchor,s.prototype.getSelectionAnchor=s.prototype.getAnchor,s.prototype.setSelectionRange=s.prototype.setRange,r.implement(s.prototype,a),t.Selection=s}),ace.define(`ace/tokenizer`,[`require`,`exports`,`module`,`ace/lib/report_error`],function(e,t,n){var r=e(\"./lib/report_error\").reportError,i=2e3,a=function(){function e(e){for(var t in this.splitRegex,this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],r=[],i=0,a=this.matchMappings[t]={defaultToken:`text`},o=`g`,s=[],c=0;c<n.length;c++){var l=n[c];if(l.defaultToken&&(a.defaultToken=l.defaultToken),l.caseInsensitive&&o.indexOf(`i`)===-1&&(o+=`i`),l.unicode&&o.indexOf(`u`)===-1&&(o+=`u`),l.regex!=null){l.regex instanceof RegExp&&(l.regex=l.regex.toString().slice(1,-1));var u=l.regex,d=RegExp(`(?:(`+u+`)|(.))`).exec(`a`).length-2;Array.isArray(l.token)?l.token.length==1||d==1?l.token=l.token[0]:d-1==l.token.length?(l.tokenArray=l.token,l.token=null,l.onMatch=this.$arrayTokens):(this.reportError(`number of classes and regexp groups doesn't match`,{rule:l,groupCount:d-1}),l.token=l.token[0]):typeof l.token==`function`&&!l.onMatch&&(d>1?l.onMatch=this.$applyToken:l.onMatch=l.token),d>1&&(/\\\\\\d/.test(l.regex)?u=l.regex.replace(/\\\\([0-9]+)/g,function(e,t){return`\\\\`+(parseInt(t,10)+i+1)}):(d=1,u=this.removeCapturingGroups(l.regex)),!l.splitRegex&&typeof l.token!=`string`&&s.push(l)),a[i]=c,i+=d,r.push(u),l.onMatch||=null}}r.length||(a[0]=0,r.push(`$`)),s.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=RegExp(`(`+r.join(`)|(`)+`)|($)`,o)}}return e.prototype.$setMaxTokenCount=function(e){i=e|0},e.prototype.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if(typeof n==`string`)return[{type:n,value:e}];for(var r=[],i=0,a=n.length;i<a;i++)t[i]&&(r[r.length]={type:n[i],value:t[i]});return r},e.prototype.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return`text`;for(var n=[],r=this.tokenArray,i=0,a=r.length;i<a;i++)t[i+1]&&(n[n.length]={type:r[i],value:t[i+1]});return n},e.prototype.removeCapturingGroups=function(e){return e.replace(/\\\\.|\\[(?:\\\\.|[^\\\\\\]])*|\\(\\?[:=!<]|(\\()/g,function(e,t){return t?`(?:`:e})},e.prototype.createSplitterRegexp=function(e,t){if(e.indexOf(`(?=`)!=-1){var n=0,r=!1,i={};e.replace(/(\\\\.)|(\\((?:\\?[=!])?)|(\\))|([\\[\\]])/g,function(e,t,a,o,s,c){return r?r=s!=`]`:s?r=!0:o?(n==i.stack&&(i.end=c+1,i.stack=-1),n--):a&&(n++,a.length!=1&&(i.stack=n,i.start=c)),e}),i.end!=null&&/^\\)*$/.test(e.substr(i.end))&&(e=e.substring(0,i.start)+e.substr(i.end))}return e.charAt(0)!=`^`&&(e=`^`+e),e.charAt(e.length-1)!=`$`&&(e+=`$`),new RegExp(e,(t||``).replace(`g`,``))},e.prototype.getLineTokens=function(e,t){if(t&&typeof t!=`string`){var n=t.slice(0);t=n[0],t===`#tmp`&&(n.shift(),t=n.shift())}else var n=[];var r=t||`start`,a=this.states[r];a||=(r=`start`,this.states[r]);var o=this.matchMappings[r],s=this.regExps[r];s.lastIndex=0;for(var c,l=[],u=0,d=0,f={type:null,value:``};c=s.exec(e);){var p=o.defaultToken,m=null,h=c[0],g=s.lastIndex;if(g-h.length>u){var _=e.substring(u,g-h.length);f.type==p?f.value+=_:(f.type&&l.push(f),f={type:p,value:_})}for(var v=0;v<c.length-2;v++)if(c[v+1]!==void 0){m=a[o[v]],p=m.onMatch?m.onMatch(h,r,n,e):m.token,m.next&&(r=typeof m.next==`string`?m.next:m.next(r,n),a=this.states[r],a||=(this.reportError(`state doesn't exist`,r),r=`start`,this.states[r]),o=this.matchMappings[r],u=g,s=this.regExps[r],s.lastIndex=g),m.consumeLineEnd&&(u=g);break}if(h){if(typeof p==`string`)(!m||m.merge!==!1)&&f.type===p?f.value+=h:(f.type&&l.push(f),f={type:p,value:h});else if(p){f.type&&l.push(f),f={type:null,value:``};for(var v=0;v<p.length;v++)l.push(p[v])}}if(u==e.length)break;if(u=g,d++>i){for(d>2*e.length&&this.reportError(`infinite loop with in ace tokenizer`,{startState:t,line:e});u<e.length;)f.type&&l.push(f),f={value:e.substring(u,u+=500),type:`overflow`};r=`start`,n=[];break}}return f.type&&l.push(f),n.length>1&&n[0]!==r&&n.unshift(`#tmp`,r),{tokens:l,state:n.length?n:r}},e}();a.prototype.reportError=r,t.Tokenizer=a}),ace.define(`ace/mode/text_highlight_rules`,[`require`,`exports`,`module`,`ace/lib/deep_copy`],function(e,t,n){var r=e(\"../lib/deep_copy\").deepCopy,i=function(){this.$rules={start:[{token:`empty_line`,regex:`^$`},{defaultToken:`text`}]}};(function(){this.addRules=function(e,t){if(!t){for(var n in e)this.$rules[n]=e[n];return}for(var n in e){for(var r=e[n],i=0;i<r.length;i++){var a=r[i];(a.next||a.onMatch)&&(typeof a.next==`string`&&a.next.indexOf(t)!==0&&(a.next=t+a.next),a.nextState&&a.nextState.indexOf(t)!==0&&(a.nextState=t+a.nextState))}this.$rules[t+n]=r}},this.getRules=function(){return this.$rules},this.embedRules=function(e,t,n,i,a){var o=typeof e==`function`?new e().getRules():e;if(i)for(var s=0;s<i.length;s++)i[s]=t+i[s];else for(var c in i=[],o)i.push(t+c);if(this.addRules(o,t),n)for(var l=Array.prototype[a?`push`:`unshift`],s=0;s<i.length;s++)l.apply(this.$rules[i[s]],r(n));this.$embeds||=[],this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds};var e=function(e,t){return(e!=`start`||t.length)&&t.unshift(this.nextState,e),this.nextState},t=function(e,t){return t.shift(),t.shift()||`start`};this.normalizeRules=function(){var n=0,r=this.$rules;function i(a){var o=r[a];o.processed=!0;for(var s=0;s<o.length;s++){var c=o[s],l=null;Array.isArray(c)&&(l=c,c={}),!c.regex&&c.start&&(c.regex=c.start,c.next||=[],c.next.push({defaultToken:c.token},{token:c.token+`.end`,regex:c.end||c.start,next:`pop`}),c.token+=`.start`,c.push=!0);var u=c.next||c.push;if(u&&Array.isArray(u)){var d=c.stateName;d||(d=c.token,typeof d!=`string`&&(d=d[0]||``),r[d]&&(d+=n++)),r[d]=u,c.next=d,i(d)}else u==`pop`&&(c.next=t);if(c.push&&(c.nextState=c.next||c.push,c.next=e,delete c.push),c.rules)for(var f in c.rules)r[f]?r[f].push&&r[f].push.apply(r[f],c.rules[f]):r[f]=c.rules[f];var p=typeof c==`string`?c:c.include;if(p&&(p===`$self`&&(p=`start`),l=Array.isArray(p)?p.map(function(e){return r[e]}):r[p]),l){var m=[s,1].concat(l);c.noEscape&&(m=m.filter(function(e){return!e.next})),o.splice.apply(o,m),s--}c.keywordMap&&(c.token=this.createKeywordMapper(c.keywordMap,c.defaultToken||`text`,c.caseInsensitive),delete c.defaultToken)}}Object.keys(r).forEach(i,this)},this.createKeywordMapper=function(e,t,n,r){var i=Object.create(null);return this.$keywordList=[],Object.keys(e).forEach(function(t){for(var a=e[t].split(r||`|`),o=a.length;o--;){var s=a[o];this.$keywordList.push(s),n&&(s=s.toLowerCase()),i[s]=t}},this),e=null,n?function(e){return i[e.toLowerCase()]||t}:function(e){return i[e]||t}},this.getKeywords=function(){return this.$keywords}}).call(i.prototype),t.TextHighlightRules=i}),ace.define(`ace/mode/behaviour`,[`require`,`exports`,`module`],function(e,t,n){var r=function(){this.$behaviours={}};(function(){this.add=function(e,t,n){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=n},this.addBehaviours=function(e){for(var t in e)for(var n in e[t])this.add(t,n,e[t][n])},this.remove=function(e){this.$behaviours&&this.$behaviours[e]&&delete this.$behaviours[e]},this.inherit=function(e,t){if(typeof e==`function`)var n=new e().getBehaviours(t);else var n=e.getBehaviours(t);this.addBehaviours(n)},this.getBehaviours=function(e){if(e){for(var t={},n=0;n<e.length;n++)this.$behaviours[e[n]]&&(t[e[n]]=this.$behaviours[e[n]]);return t}else return this.$behaviours}}).call(r.prototype),t.Behaviour=r}),ace.define(`ace/token_iterator`,[`require`,`exports`,`module`,`ace/range`],function(e,t,n){var r=e(\"./range\").Range;t.TokenIterator=function(){function e(e,t,n){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t);var r=e.getTokenAt(t,n);this.$tokenIndex=r?r.index:-1}return e.prototype.stepBackward=function(){for(--this.$tokenIndex;this.$tokenIndex<0;){if(--this.$row,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},e.prototype.stepForward=function(){this.$tokenIndex+=1;for(var e;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,e||=this.$session.getLength(),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},e.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},e.prototype.getCurrentTokenRow=function(){return this.$row},e.prototype.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(n!==void 0)return n;for(n=0;t>0;)--t,n+=e[t].value.length;return n},e.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},e.prototype.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)},e}()}),ace.define(`ace/mode/behaviour/cstyle`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/mode/behaviour`,`ace/token_iterator`,`ace/lib/lang`],function(e,t,n){var r=e(\"../../lib/oop\"),i=e(\"../behaviour\").Behaviour,a=e(\"../../token_iterator\").TokenIterator,o=e(\"../../lib/lang\"),s=[`text`,`paren.rparen`,`rparen`,`paren`,`punctuation.operator`],c=[`text`,`paren.rparen`,`rparen`,`paren`,`punctuation.operator`,`comment`],l,u={},d={'\"':`\"`,\"'\":`'`},f=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,u.rangeCount!=e.multiSelect.rangeCount&&(u={rangeCount:e.multiSelect.rangeCount})),u[t])return l=u[t];l=u[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:``,maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:``,maybeInsertedLineEnd:``}},p=function(e,t,n,r){var i=e.end.row-e.start.row;return{text:n+t+r,selection:[0,e.start.column+1,i,e.end.column+ +!i]}},m=function(e){e||={},this.add(`braces`,`insertion`,function(t,n,r,i,a){var s=r.getCursorPosition(),c=i.doc.getLine(s.row);if(a==`{`){f(r);var u=r.getSelectionRange(),d=i.doc.getTextRange(u),h=i.getTokenAt(s.row,s.column);if(d!==``&&d!==`{`&&r.getWrapBehavioursEnabled())return p(u,d,`{`,`}`);if(h&&/(?:string)\\.quasi|\\.xml/.test(h.type))return[/tag\\-(?:open|name)/,/attribute\\-name/].some(function(e){return e.test(h.type)})||/(string)\\.quasi/.test(h.type)&&h.value[s.column-h.start-1]!==`$`?void 0:(m.recordAutoInsert(r,i,`}`),{text:`{}`,selection:[1,1]});if(m.isSaneInsertion(r,i))return/[\\]\\}\\)]/.test(c[s.column])||r.inMultiSelectMode||e.braces?(m.recordAutoInsert(r,i,`}`),{text:`{}`,selection:[1,1]}):(m.recordMaybeInsert(r,i,`{`),{text:`{`,selection:[1,1]})}else if(a==`}`){f(r);var g=c.substring(s.column,s.column+1);if(g==`}`&&i.$findOpeningBracket(`}`,{column:s.column+1,row:s.row})!==null&&m.isAutoInsertedClosing(s,c,a))return m.popAutoInsertedClosing(),{text:``,selection:[1,1]}}else if(a==`\n`||a==`\\r\n`){f(r);var _=``;m.isMaybeInsertedClosing(s,c)&&(_=o.stringRepeat(`}`,l.maybeInsertedBrackets),m.clearMaybeInsertedClosing());var g=c.substring(s.column,s.column+1);if(g===`}`){var v=i.findMatchingBracket({row:s.row,column:s.column+1},`}`);if(!v)return null;var y=this.$getIndent(i.getLine(v.row))}else if(_)var y=this.$getIndent(c);else{m.clearMaybeInsertedClosing();return}var b=y+i.getTabString();return{text:`\n`+b+`\n`+y+_,selection:[1,b.length,1,b.length]}}else m.clearMaybeInsertedClosing()}),this.add(`braces`,`deletion`,function(e,t,n,r,i){var a=r.doc.getTextRange(i);if(!i.isMultiLine()&&a==`{`){if(f(n),r.doc.getLine(i.start.row).substring(i.end.column,i.end.column+1)==`}`)return i.end.column++,i;l.maybeInsertedBrackets--}}),this.add(`parens`,`insertion`,function(e,t,n,r,i){if(i==`(`){f(n);var a=n.getSelectionRange(),o=r.doc.getTextRange(a);if(o!==``&&n.getWrapBehavioursEnabled())return p(a,o,`(`,`)`);if(m.isSaneInsertion(n,r))return m.recordAutoInsert(n,r,`)`),{text:`()`,selection:[1,1]}}else if(i==`)`){f(n);var s=n.getCursorPosition(),c=r.doc.getLine(s.row);if(c.substring(s.column,s.column+1)==`)`&&r.$findOpeningBracket(`)`,{column:s.column+1,row:s.row})!==null&&m.isAutoInsertedClosing(s,c,i))return m.popAutoInsertedClosing(),{text:``,selection:[1,1]}}}),this.add(`parens`,`deletion`,function(e,t,n,r,i){var a=r.doc.getTextRange(i);if(!i.isMultiLine()&&a==`(`&&(f(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==`)`))return i.end.column++,i}),this.add(`brackets`,`insertion`,function(e,t,n,r,i){if(i==`[`){f(n);var a=n.getSelectionRange(),o=r.doc.getTextRange(a);if(o!==``&&n.getWrapBehavioursEnabled())return p(a,o,`[`,`]`);if(m.isSaneInsertion(n,r))return m.recordAutoInsert(n,r,`]`),{text:`[]`,selection:[1,1]}}else if(i==`]`){f(n);var s=n.getCursorPosition(),c=r.doc.getLine(s.row);if(c.substring(s.column,s.column+1)==`]`&&r.$findOpeningBracket(`]`,{column:s.column+1,row:s.row})!==null&&m.isAutoInsertedClosing(s,c,i))return m.popAutoInsertedClosing(),{text:``,selection:[1,1]}}}),this.add(`brackets`,`deletion`,function(e,t,n,r,i){var a=r.doc.getTextRange(i);if(!i.isMultiLine()&&a==`[`&&(f(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==`]`))return i.end.column++,i}),this.add(`string_dquotes`,`insertion`,function(e,t,n,r,i){var a=r.$mode.$quotes||d;if(i.length==1&&a[i]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(i)!=-1)return;f(n);var o=i,s=n.getSelectionRange(),c=r.doc.getTextRange(s);if(c!==``&&(c.length!=1||!a[c])&&n.getWrapBehavioursEnabled())return p(s,c,o,o);if(!c){var l=n.getCursorPosition(),u=r.doc.getLine(l.row),m=u.substring(l.column-1,l.column),h=u.substring(l.column,l.column+1),g=r.getTokenAt(l.row,l.column),_=r.getTokenAt(l.row,l.column+1);if(m==`\\\\`&&g&&/escape/.test(g.type))return null;var v=g&&/string|escape/.test(g.type),y=!_||/string|escape/.test(_.type),b;if(h==o)b=v!==y,b&&/string\\.end/.test(_.type)&&(b=!1);else{if(v&&!y||v&&y)return null;var x=r.$mode.tokenRe;x.lastIndex=0;var S=x.test(m);x.lastIndex=0;var C=x.test(h),w=r.$mode.$pairQuotesAfter;if(!(w&&w[o]&&w[o].test(m))&&S||C||h&&!/[\\s;,.})\\]\\\\]/.test(h))return null;var T=u[l.column-2];if(m==o&&(T==o||x.test(T)))return null;b=!0}return{text:b?o+o:``,selection:[1,1]}}}}),this.add(`string_dquotes`,`deletion`,function(e,t,n,r,i){var a=r.$mode.$quotes||d,o=r.doc.getTextRange(i);if(!i.isMultiLine()&&a.hasOwnProperty(o)&&(f(n),r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==o))return i.end.column++,i}),e.closeDocComment!==!1&&this.add(`doc comment end`,`insertion`,function(e,t,n,r,i){if(e===`doc-start`&&(i===`\n`||i===`\\r\n`)&&n.selection.isEmpty()){var a=n.getCursorPosition();if(a.column===0)return;for(var o=r.doc.getLine(a.row),s=r.doc.getLine(a.row+1),c=r.getTokens(a.row),l=0,u=0;u<c.length;u++){l+=c[u].value.length;var d=c[u];if(l>=a.column){if(l===a.column){if(!/\\.doc/.test(d.type))return;if(/\\*\\//.test(d.value)){var f=c[u+1];if(!f||!/\\.doc/.test(f.type))return}}var p=a.column-(l-d.value.length),m=d.value.indexOf(`*/`),h=d.value.indexOf(`/**`,m>-1?m+2:0);if(h!==-1&&p>h&&p<h+3||m!==-1&&h!==-1&&p>=m&&p<=h||!/\\.doc/.test(d.type))return;break}}var g=this.$getIndent(o);if(/\\s*\\*/.test(s))return/^\\s*\\*/.test(o)?{text:i+g+`* `,selection:[1,2+g.length,1,2+g.length]}:{text:i+g+` * `,selection:[1,3+g.length,1,3+g.length]};if(/\\/\\*\\*/.test(o.substring(0,a.column)))return{text:i+g+` * `+i+` `+g+`*/`,selection:[1,4+g.length,1,4+g.length]}}})};m.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new a(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||`text`,s)){if(/[)}\\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var i=new a(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||`text`,s))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||`text`,c)},m.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},m.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,l.autoInsertedLineEnd[0])||(l.autoInsertedBrackets=0),l.autoInsertedRow=r.row,l.autoInsertedLineEnd=n+i.substr(r.column),l.autoInsertedBrackets++},m.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(l.maybeInsertedBrackets=0),l.maybeInsertedRow=r.row,l.maybeInsertedLineStart=i.substr(0,r.column)+n,l.maybeInsertedLineEnd=i.substr(r.column),l.maybeInsertedBrackets++},m.isAutoInsertedClosing=function(e,t,n){return l.autoInsertedBrackets>0&&e.row===l.autoInsertedRow&&n===l.autoInsertedLineEnd[0]&&t.substr(e.column)===l.autoInsertedLineEnd},m.isMaybeInsertedClosing=function(e,t){return l.maybeInsertedBrackets>0&&e.row===l.maybeInsertedRow&&t.substr(e.column)===l.maybeInsertedLineEnd&&t.substr(0,e.column)==l.maybeInsertedLineStart},m.popAutoInsertedClosing=function(){l.autoInsertedLineEnd=l.autoInsertedLineEnd.substr(1),l.autoInsertedBrackets--},m.clearMaybeInsertedClosing=function(){l&&(l.maybeInsertedBrackets=0,l.maybeInsertedRow=-1)},r.inherits(m,i),t.CstyleBehaviour=m}),ace.define(`ace/unicode`,[`require`,`exports`,`module`],function(e,t,n){for(var r=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,a=[],o=0;o<r.length;o+=2)a.push(i+=r[o]),r[o+1]&&a.push(45,i+=r[o+1]);t.wordChars=String.fromCharCode.apply(null,a)}),ace.define(`ace/mode/text`,[`require`,`exports`,`module`,`ace/config`,`ace/tokenizer`,`ace/mode/text_highlight_rules`,`ace/mode/behaviour/cstyle`,`ace/unicode`,`ace/lib/lang`,`ace/token_iterator`,`ace/range`],function(e,t,n){var r=e(\"../config\"),i=e(\"../tokenizer\").Tokenizer,a=e(\"./text_highlight_rules\").TextHighlightRules,o=e(\"./behaviour/cstyle\").CstyleBehaviour,s=e(\"../unicode\"),c=e(\"../lib/lang\"),l=e(\"../token_iterator\").TokenIterator,u=e(\"../range\").Range,d=function(){this.HighlightRules=a};(function(){this.$defaultBehaviour=new o,this.tokenRe=RegExp(`^[`+s.wordChars+`\\\\$_]+`,`g`),this.nonTokenRe=RegExp(`^(?:[^`+s.wordChars+`\\\\$_]|\\\\s])+`,`g`),this.getTokenizer=function(){return this.$tokenizer||=(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),new i(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart=``,this.blockComment=``,this.toggleCommentLines=function(e,t,n,r){var i=t.doc,a=!0,o=!0,s=1/0,l=t.getTabSize(),u=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var d=this.lineCommentStart.map(c.escapeRegExp).join(`|`),f=this.lineCommentStart[0];else var d=c.escapeRegExp(this.lineCommentStart),f=this.lineCommentStart;d=RegExp(`^(\\\\s*)(?:`+d+`) ?`),u=t.getUseSoftTabs();var p=function(e,t){var n=e.match(d);if(n){var r=n[1].length,a=n[0].length;!_(e,r,a)&&n[0][a-1]==` `&&a--,i.removeInLine(t,r,a)}},m=f+` `,h=function(e,t){(!a||/\\S/.test(e))&&(_(e,s,s)?i.insertInLine({row:t,column:s},m):i.insertInLine({row:t,column:s},f))},g=function(e,t){return d.test(e)},_=function(e,t,n){for(var r=0;t--&&e.charAt(t)==` `;)r++;if(r%l!=0)return!1;for(var r=0;e.charAt(n++)==` `;)r++;return l>2?r%l!=l-1:r%l==0}}else{if(!this.blockComment)return!1;var f=this.blockComment.start,v=this.blockComment.end,d=RegExp(`^(\\\\s*)(?:`+c.escapeRegExp(f)+`)`),y=RegExp(`(?:`+c.escapeRegExp(v)+`)\\\\s*$`),h=function(e,t){g(e,t)||(!a||/\\S/.test(e))&&(i.insertInLine({row:t,column:e.length},v),i.insertInLine({row:t,column:s},f))},p=function(e,t){var n;(n=e.match(y))&&i.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(d))&&i.removeInLine(t,n[1].length,n[0].length)},g=function(e,n){if(d.test(e))return!0;for(var r=t.getTokens(n),i=0;i<r.length;i++)if(r[i].type===`comment`)return!0}}function b(e){for(var t=n;t<=r;t++)e(i.getLine(t),t)}var x=1/0;b(function(e,t){var n=e.search(/\\S/);n===-1?x>e.length&&(x=e.length):(n<s&&(s=n),o&&!g(e,t)&&(o=!1))}),s==1/0&&(s=x,a=!1,o=!1),u&&s%l!=0&&(s=Math.floor(s/l)*l),b(o?p:h)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(i){!i.start&&i[0]&&(i=i[0]);var a=new l(t,r.row,r.column),o=a.getCurrentToken();t.selection;var s=t.selection.toOrientedRange(),c,d;if(o&&/comment/.test(o.type)){for(var f,p;o&&/comment/.test(o.type);){var m=o.value.indexOf(i.start);if(m!=-1){var h=a.getCurrentTokenRow(),g=a.getCurrentTokenColumn()+m;f=new u(h,g,h,g+i.start.length);break}o=a.stepBackward()}for(var a=new l(t,r.row,r.column),o=a.getCurrentToken();o&&/comment/.test(o.type);){var m=o.value.indexOf(i.end);if(m!=-1){var h=a.getCurrentTokenRow(),g=a.getCurrentTokenColumn()+m;p=new u(h,g,h,g+i.end.length);break}o=a.stepForward()}p&&t.remove(p),f&&(t.remove(f),c=f.start.row,d=-i.start.length)}else d=i.start.length,c=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);s.start.row==c&&(s.start.column+=d),s.end.row==c&&(s.end.column+=d),t.selection.fromOrientedRange(s)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var n=e[t],i=n.prototype.$id,a=r.$modes[i];a||(r.$modes[i]=a=new n),r.$modes[t]||(r.$modes[t]=a),this.$embeds.push(t),this.$modes[t]=a}for(var o=[`toggleBlockComment`,`toggleCommentLines`,`getNextLineIndent`,`checkOutdent`,`autoOutdent`,`transformAction`,`getCompletions`],s=function(e){(function(t){var n=o[e],r=t[n];t[o[e]]=function(){return this.$delegator(n,arguments,r)}})(c)},c=this,t=0;t<o.length;t++)s(t)},this.$delegator=function(e,t,n){var r=t[0]||`start`;if(typeof r!=`string`){if(Array.isArray(r[2])){var i=r[2][r[2].length-1],a=this.$modes[i];if(a)return a[e].apply(a,[r[1]].concat([].slice.call(t,1)))}r=r[0]||`start`}for(var o=0;o<this.$embeds.length;o++)if(this.$modes[this.$embeds[o]]){var s=r.split(this.$embeds[o]);if(!s[0]&&s[1]){t[0]=s[1];var a=this.$modes[this.$embeds[o]];return a[e].apply(a,t)}}var c=n.apply(this,t);return n?c:void 0},this.transformAction=function(e,t,n,r,i){if(this.$behaviour){var a=this.$behaviour.getBehaviours();for(var o in a)if(a[o][t]){var s=a[o][t].apply(this,arguments);if(s)return s}}},this.getKeywords=function(e){if(!this.completionKeywords){var t=this.$tokenizer.rules,n=[];for(var r in t)for(var i=t[r],a=0,o=i.length;a<o;a++)if(typeof i[a].token==`string`)/keyword|support|storage/.test(i[a].token)&&n.push(i[a].regex);else if(typeof i[a].token==`object`){for(var s=0,c=i[a].token.length;s<c;s++)if(/keyword|support|storage/.test(i[a].token[s])){var r=i[a].regex.match(/\\(.+?\\)/g)[s];n.push(r.substr(1,r.length-2))}}this.completionKeywords=n}return e?n.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,t,n,r){return(this.$keywordList||this.$createKeywordList()).map(function(e){return{name:e,value:e,score:0,meta:`keyword`}})},this.$id=`ace/mode/text`}).call(d.prototype),t.Mode=d}),ace.define(`ace/line_widgets`,[`require`,`exports`,`module`,`ace/lib/dom`],function(e,t,n){var r=e(\"./lib/dom\");t.LineWidgets=function(){function e(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on(`change`,this.updateOnChange),this.session.on(`changeFold`,this.updateOnFold),this.session.on(`changeEditor`,this.$onChangeEditor)}return e.prototype.getRowLength=function(e){var t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;return!this.$useWrapMode||!this.$wrapData[e]?1+t:this.$wrapData[e].length+1+t},e.prototype.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},e.prototype.$onChangeEditor=function(e){this.attach(e.editor)},e.prototype.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on(`beforeRender`,this.measureWidgets),e.renderer.on(`afterRender`,this.renderWidgets)))},e.prototype.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off(`beforeRender`,this.measureWidgets),t.renderer.off(`afterRender`,this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},e.prototype.updateOnFold=function(e,t){var n=t.lineWidgets;if(!(!n||!e.action)){for(var r=e.data,i=r.start.row,a=r.end.row,o=e.action==`add`,s=i+1;s<a;s++)n[s]&&(n[s].hidden=o);n[a]&&(o?n[i]?n[a].hidden=o:n[i]=n[a]:(n[i]==n[a]&&(n[i]=void 0),n[a].hidden=o))}},e.prototype.updateOnChange=function(e){var t=this.session.lineWidgets;if(t){var n=e.start.row,r=e.end.row-n;if(r!==0)if(e.action==`remove`){var i=t.splice(n+1,r);!t[n]&&i[i.length-1]&&(t[n]=i.pop()),i.forEach(function(e){e&&this.removeLineWidget(e)},this),this.$updateRows()}else{var a=Array(r);t[n]&&t[n].column!=null&&e.start.column>t[n].column&&n++,a.unshift(n,0),t.splice.apply(t,a),this.$updateRows()}}},e.prototype.$updateRows=function(){var e=this.session.lineWidgets;if(e){var t=!0;e.forEach(function(e,n){if(e)for(t=!1,e.row=n;e.$oldWidget;)e.$oldWidget.row=n,e=e.$oldWidget}),t&&(this.session.lineWidgets=null)}},e.prototype.$registerLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];return t&&(e.$oldWidget=t,t.el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1)),this.session.lineWidgets[e.row]=e,e},e.prototype.addLineWidget=function(e){if(this.$registerLineWidget(e),e.session=this.session,!this.editor)return e;var t=this.editor.renderer;e.html&&!e.el&&(e.el=r.createElement(`div`),e.el.innerHTML=e.html),e.text&&!e.el&&(e.el=r.createElement(`div`),e.el.textContent=e.text),e.el&&(r.addCssClass(e.el,`ace_lineWidgetContainer`),e.className&&r.addCssClass(e.el,e.className),e.el.style.position=`absolute`,e.el.style.zIndex=`5`,t.container.appendChild(e.el),e._inDocument=!0,e.coverGutter||(e.el.style.zIndex=`3`),e.pixelHeight??=e.el.offsetHeight),e.rowCount??=e.pixelHeight/t.layerConfig.lineHeight;var n=this.session.getFoldAt(e.row,0);if(e.$fold=n,n){var i=this.session.lineWidgets;e.row==n.end.row&&!i[n.start.row]?i[n.start.row]=e:e.hidden=!0}return this.session._emit(`changeFold`,{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),this.onWidgetChanged(e),e},e.prototype.removeLineWidget=function(e){if(e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),e.editor&&e.editor.destroy)try{e.editor.destroy()}catch{}if(this.session.lineWidgets){var t=this.session.lineWidgets[e.row];if(t==e)this.session.lineWidgets[e.row]=e.$oldWidget,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else for(;t;){if(t.$oldWidget==e){t.$oldWidget=e.$oldWidget;break}t=t.$oldWidget}}this.session._emit(`changeFold`,{data:{start:{row:e.row}}}),this.$updateRows()},e.prototype.getWidgetsAtRow=function(e){for(var t=this.session.lineWidgets,n=t&&t[e],r=[];n;)r.push(n),n=n.$oldWidget;return r},e.prototype.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},e.prototype.measureWidgets=function(e,t){var n=this.session._changedWidgets,r=t.layerConfig;if(!(!n||!n.length)){for(var i=1/0,a=0;a<n.length;a++){var o=n[a];if(!(!o||!o.el)&&o.session==this.session){if(!o._inDocument){if(this.session.lineWidgets[o.row]!=o)continue;o._inDocument=!0,t.container.appendChild(o.el)}o.h=o.el.offsetHeight,o.fixedWidth||(o.w=o.el.offsetWidth,o.screenWidth=Math.ceil(o.w/r.characterWidth));var s=o.h/r.lineHeight;o.coverLine&&(s-=this.session.getRowLineCount(o.row),s<0&&(s=0)),o.rowCount!=s&&(o.rowCount=s,o.row<i&&(i=o.row))}}i!=1/0&&(this.session._emit(`changeFold`,{data:{start:{row:i}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},e.prototype.renderWidgets=function(e,t){var n=t.layerConfig,r=this.session.lineWidgets;if(r){for(var i=Math.min(this.firstRow,n.firstRow),a=Math.max(this.lastRow,n.lastRow,r.length);i>0&&!r[i];)i--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var o=i;o<=a;o++){var s=r[o];if(!(!s||!s.el)){if(s.hidden){s.el.style.top=-100-(s.pixelHeight||0)+`px`;continue}s._inDocument||(s._inDocument=!0,t.container.appendChild(s.el));var c=t.$cursorLayer.getPixelPosition({row:o,column:0},!0).top;s.coverLine||(c+=n.lineHeight*this.session.getRowLineCount(s.row)),s.el.style.top=c-n.offset+`px`;var l=s.coverGutter?0:t.gutterWidth;s.fixedWidth||(l-=t.scrollLeft),s.el.style.left=l+`px`,s.fullWidth&&s.screenWidth&&(s.el.style.minWidth=n.width+2*n.padding+`px`),s.fixedWidth?s.el.style.right=t.scrollBar.getWidth()+`px`:s.el.style.right=``}}}},e}()}),ace.define(`ace/apply_delta`,[`require`,`exports`,`module`],function(e,t,n){t.applyDelta=function(e,t,n){var r=t.start.row,i=t.start.column,a=e[r]||``;switch(t.action){case`insert`:if(t.lines.length===1)e[r]=a.substring(0,i)+t.lines[0]+a.substring(i);else{var o=[r,1].concat(t.lines);e.splice.apply(e,o),e[r]=a.substring(0,i)+e[r],e[r+t.lines.length-1]+=a.substring(i)}break;case`remove`:var s=t.end.column,c=t.end.row;r===c?e[r]=a.substring(0,i)+a.substring(s):e.splice(r,c-r+1,a.substring(0,i)+e[c].substring(s));break}}}),ace.define(`ace/anchor`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/event_emitter`],function(e,t,n){var r=e(\"./lib/oop\"),i=e(\"./lib/event_emitter\").EventEmitter,a=function(){function e(e,t,n){this.$onChange=this.onChange.bind(this),this.attach(e),typeof t==`number`?this.setPosition(t,n):this.setPosition(t.row,t.column)}return e.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},e.prototype.getDocument=function(){return this.document},e.prototype.onChange=function(e){if(!(e.start.row==e.end.row&&e.start.row!=this.row)&&!(e.start.row>this.row)){var t=s(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(t.row,t.column,!0)}},e.prototype.setPosition=function(e,t,n){var r=n?{row:e,column:t}:this.$clipPositionToDocument(e,t);if(!(this.row==r.row&&this.column==r.column)){var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal(`change`,{old:i,value:r})}},e.prototype.detach=function(){this.document.off(`change`,this.$onChange)},e.prototype.attach=function(e){this.document=e||this.document,this.document.on(`change`,this.$onChange)},e.prototype.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n},e}();a.prototype.$insertRight=!1,r.implement(a.prototype,i);function o(e,t,n){var r=n?e.column<=t.column:e.column<t.column;return e.row<t.row||e.row==t.row&&r}function s(e,t,n){var r=e.action==`insert`,i=(r?1:-1)*(e.end.row-e.start.row),a=(r?1:-1)*(e.end.column-e.start.column),s=e.start,c=r?s:e.end;return o(t,s,n)?{row:t.row,column:t.column}:o(c,t,!n)?{row:t.row+i,column:t.column+(t.row==c.row?a:0)}:{row:s.row,column:s.column}}t.Anchor=a}),ace.define(`ace/document`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/apply_delta`,`ace/lib/event_emitter`,`ace/range`,`ace/anchor`],function(e,t,n){var r=e(\"./lib/oop\"),i=e(\"./apply_delta\").applyDelta,a=e(\"./lib/event_emitter\").EventEmitter,o=e(\"./range\").Range,s=e(\"./anchor\").Anchor,c=function(){function e(e){this.$lines=[``],e.length===0?this.$lines=[``]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)}return e.prototype.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e||``)},e.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},e.prototype.createAnchor=function(e,t){return new s(this,e,t)},e.prototype.$detectNewLine=function(e){var t=e.match(/^.*?(\\r\\n|\\r|\\n)/m);this.$autoNewLine=t?t[1]:`\n`,this._signal(`changeNewLineMode`)},e.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case`windows`:return`\\r\n`;case`unix`:return`\n`;default:return this.$autoNewLine||`\n`}},e.prototype.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal(`changeNewLineMode`))},e.prototype.getNewLineMode=function(){return this.$newLineMode},e.prototype.isNewLine=function(e){return e==`\\r\n`||e==`\\r`||e==`\n`},e.prototype.getLine=function(e){return this.$lines[e]||``},e.prototype.getLines=function(e,t){return this.$lines.slice(e,t+1)},e.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},e.prototype.getLength=function(){return this.$lines.length},e.prototype.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},e.prototype.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{t=this.getLines(e.start.row,e.end.row),t[0]=(t[0]||``).substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},e.prototype.insertLines=function(e,t){return console.warn(`Use of document.insertLines is deprecated. Use the insertFullLines method instead.`),this.insertFullLines(e,t)},e.prototype.removeLines=function(e,t){return console.warn(`Use of document.removeLines is deprecated. Use the removeFullLines method instead.`),this.removeFullLines(e,t)},e.prototype.insertNewLine=function(e){return console.warn(`Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.`),this.insertMergedLines(e,[``,``])},e.prototype.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},e.prototype.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),r=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:r,action:`insert`,lines:[t]},!0),this.clonePos(r)},e.prototype.clippedPos=function(e,t){var n=this.getLength();e===void 0?e=n:e<0?e=0:e>=n&&(e=n-1,t=void 0);var r=this.getLine(e);return t??=r.length,t=Math.min(Math.max(t,0),r.length),{row:e,column:t}},e.prototype.clonePos=function(e){return{row:e.row,column:e.column}},e.prototype.pos=function(e,t){return{row:e,column:t}},e.prototype.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},e.prototype.insertFullLines=function(e,t){e=Math.min(Math.max(e,0),this.getLength());var n=0;e<this.getLength()?(t=t.concat([``]),n=0):(t=[``].concat(t),e--,n=this.$lines[e].length),this.insertMergedLines({row:e,column:n},t)},e.prototype.insertMergedLines=function(e,t){var n=this.clippedPos(e.row,e.column),r={row:n.row+t.length-1,column:(t.length==1?n.column:0)+t[t.length-1].length};return this.applyDelta({start:n,end:r,action:`insert`,lines:t}),this.clonePos(r)},e.prototype.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column),n=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:t,end:n,action:`remove`,lines:this.getLinesForRange({start:t,end:n})}),this.clonePos(t)},e.prototype.removeInLine=function(e,t,n){var r=this.clippedPos(e,t),i=this.clippedPos(e,n);return this.applyDelta({start:r,end:i,action:`remove`,lines:this.getLinesForRange({start:r,end:i})},!0),this.clonePos(r)},e.prototype.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1),t=Math.min(Math.max(0,t),this.getLength()-1);var n=t==this.getLength()-1&&e>0,r=t<this.getLength()-1,i=n?e-1:e,a=n?this.getLine(i).length:0,s=r?t+1:t,c=new o(i,a,s,r?0:this.getLine(s).length),l=this.$lines.slice(e,t+1);return this.applyDelta({start:c.start,end:c.end,action:`remove`,lines:this.getLinesForRange(c)}),l},e.prototype.removeNewLine=function(e){e<this.getLength()-1&&e>=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:`remove`,lines:[``,``]})},e.prototype.replace=function(e,t){return e instanceof o||(e=o.fromPoints(e.start,e.end)),t.length===0&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},e.prototype.applyDeltas=function(e){for(var t=0;t<e.length;t++)this.applyDelta(e[t])},e.prototype.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--)this.revertDelta(e[t])},e.prototype.applyDelta=function(e,t){var n=e.action==`insert`;(n?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal(`change`,e)))},e.prototype.$safeApplyDelta=function(e){var t=this.$lines.length;(e.action==`remove`&&e.start.row<t&&e.end.row<t||e.action==`insert`&&e.start.row<=t)&&this.applyDelta(e)},e.prototype.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,r=n.length-t+1,i=e.start.row,a=e.start.column,o=0,s=0;o<r;o=s){s+=t-1;var c=n.slice(o,s);c.push(``),this.applyDelta({start:this.pos(i+o,a),end:this.pos(i+s,a=0),action:e.action,lines:c},!0)}e.lines=n.slice(o),e.start.row=i+o,e.start.column=a,this.applyDelta(e,!0)},e.prototype.revertDelta=function(e){this.$safeApplyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:e.action==`insert`?`remove`:`insert`,lines:e.lines.slice()})},e.prototype.indexToPosition=function(e,t){for(var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,i=t||0,a=n.length;i<a;i++)if(e-=n[i].length+r,e<0)return{row:i,column:e+n[i].length+r};return{row:a-1,column:e+n[a-1].length+r}},e.prototype.positionToIndex=function(e,t){for(var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,i=0,a=Math.min(e.row,n.length),o=t||0;o<a;++o)i+=n[o].length+r;return i+e.column},e.prototype.$split=function(e){return e.split(/\\r\\n|\\r|\\n/)},e}();c.prototype.$autoNewLine=``,c.prototype.$newLineMode=`auto`,r.implement(c.prototype,a),t.Document=c}),ace.define(`ace/background_tokenizer`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/event_emitter`],function(e,t,n){var r=e(\"./lib/oop\"),i=e(\"./lib/event_emitter\").EventEmitter,a=function(){function e(e,t){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=e;var n=this;this.$worker=function(){if(n.running){for(var e=new Date,t=n.currentLine,r=-1,i=n.doc,a=t;n.lines[t];)t++;var o=i.getLength(),s=0;for(n.running=!1;t<o;){n.$tokenizeRow(t),r=t;do t++;while(n.lines[t]);if(s++,s%5==0&&new Date-e>20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,r==-1&&(r=t),a<=r&&n.fireUpdateEvent(a,r)}}}return e.prototype.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},e.prototype.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},e.prototype.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal(`update`,{data:n})},e.prototype.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},e.prototype.scheduleStart=function(){this.running||=setTimeout(this.$worker,700)},e.prototype.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(n===0)this.lines[t]=null;else if(e.action==`remove`)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.lines.splice.apply(this.lines,r),this.states.splice.apply(this.states,r)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},e.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},e.prototype.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},e.prototype.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||`start`},e.prototype.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],r=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+``==r.state+``?this.currentLine==e&&(this.currentLine=e+1):(this.states[e]=r.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)),this.lines[e]=r.tokens},e.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},e}();r.implement(a.prototype,i),t.BackgroundTokenizer=a}),ace.define(`ace/search_highlight`,[`require`,`exports`,`module`,`ace/lib/lang`,`ace/range`],function(e,t,n){var r=e(\"./lib/lang\"),i=e(\"./range\").Range,a=function(){function e(e,t,n){n===void 0&&(n=`text`),this.setRegexp(e),this.clazz=t,this.type=n,this.docLen=0}return e.prototype.setRegexp=function(e){this.regExp+``!=e+``&&(this.regExp=e,this.cache=[])},e.prototype.update=function(e,t,n,a){if(this.regExp){for(var o=a.firstRow,s=a.lastRow,c={},l=n.$editor&&n.$editor.$search,u=l&&l.$isMultilineSearch(n.$editor.getLastSearchOptions()),d=o;d<=s;d++){var f=this.cache[d];if(f==null||n.getValue().length!=this.docLen){if(u){f=[];var p=l.$multiLineForward(n,this.regExp,d,s);if(p){var m=p.endRow<=s?p.endRow-1:s;m>d&&(d=m),f.push(new i(p.startRow,p.startCol,p.endRow,p.endCol))}f.length>this.MAX_RANGES&&(f=f.slice(0,this.MAX_RANGES))}else f=r.getMatchOffsets(n.getLine(d),this.regExp),f.length>this.MAX_RANGES&&(f=f.slice(0,this.MAX_RANGES)),f=f.map(function(e){return new i(d,e.offset,d,e.offset+e.length)});this.cache[d]=f.length?f:``}if(f.length!==0)for(var h=f.length;h--;){var g=f[h].toScreenRange(n),_=g.toString();c[_]||(c[_]=!0,t.drawSingleLineMarker(e,g,this.clazz,a))}}this.docLen=n.getValue().length}},e}();a.prototype.MAX_RANGES=500,t.SearchHighlight=a}),ace.define(`ace/undomanager`,[`require`,`exports`,`module`,`ace/range`],function(e,t,n){var r=function(){function e(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return e.prototype.addSession=function(e){this.$session=e},e.prototype.add=function(e,t,n){if(!this.$fromUndo&&e!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),t===!1||!this.lastDeltas){this.lastDeltas=[];var r=this.$undoStack.length;r>this.$undoDepth-1&&this.$undoStack.splice(0,r-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev}(e.action==`remove`||e.action==`insert`)&&(this.$lastDelta=e),this.lastDeltas.push(e)}},e.prototype.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},e.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},e.prototype.markIgnored=function(e,t){t??=this.$rev+1;for(var n=this.$undoStack,r=n.length;r--;){var i=n[r][0];if(i.id<=e)break;i.id<t&&(i.ignore=!0)}this.lastDeltas=null},e.prototype.getSelection=function(e,t){for(var n=this.selections,r=n.length;r--;){var i=n[r];if(i.rev<e)return t&&(i=n[r+1]),i}},e.prototype.getRevision=function(){return this.$rev},e.prototype.getDeltas=function(e,t){t??=this.$rev+1;for(var n=this.$undoStack,r=null,i=0,a=n.length;a--;){var o=n[a][0];if(o.id<t&&!r&&(r=a+1),o.id<=e){i=a+1;break}}return n.slice(i,r)},e.prototype.getChangedRanges=function(e,t){t??=this.$rev+1},e.prototype.getChangedLines=function(e,t){t??=this.$rev+1},e.prototype.undo=function(e,t){this.lastDeltas=null;var n=this.$undoStack;if(i(n,n.length)){e||=this.$session,this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var r=n.pop(),a=null;return r&&(a=e.undoChanges(r,t),this.$redoStack.push(r),this.$syncRev()),this.$fromUndo=!1,a}},e.prototype.redo=function(e,t){if(this.lastDeltas=null,e||=this.$session,this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var n=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);v(this.$redoStack,n),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(e){e[0].id=++this.$maxRev},this)}var r=this.$redoStack.pop(),i=null;return r&&(i=e.redoChanges(r,t),this.$undoStack.push(r),this.$syncRev()),this.$fromUndo=!1,i},e.prototype.$syncRev=function(){var e=this.$undoStack,t=e[e.length-1],n=t&&t[0].id||0;this.$redoStackBaseRev=n,this.$rev=n},e.prototype.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},e.prototype.canUndo=function(){return this.$undoStack.length>0},e.prototype.canRedo=function(){return this.$redoStack.length>0},e.prototype.bookmark=function(e){e??=this.$rev,this.mark=e},e.prototype.isAtBookmark=function(){return this.$rev===this.mark},e.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},e.prototype.fromJSON=function(e){this.reset(),this.$undoStack=e.$undoStack,this.$redoStack=e.$redoStack},e.prototype.$prettyPrint=function(e){return e?l(e):l(this.$undoStack)+`\n---\n`+l(this.$redoStack)},e}();r.prototype.hasUndo=r.prototype.canUndo,r.prototype.hasRedo=r.prototype.canRedo,r.prototype.isClean=r.prototype.isAtBookmark,r.prototype.markClean=r.prototype.bookmark;function i(e,t){for(var n=t;n--;){var r=e[n];if(r&&!r[0].ignore){for(;n<t-1;){var i=f(e[n],e[n+1]);e[n]=i[0],e[n+1]=i[1],n++}return!0}}}var a=e(\"./range\").Range,o=a.comparePoints;a.comparePoints;function s(e){return{row:e.row,column:e.column}}function c(e){return{start:s(e.start),end:s(e.end),action:e.action,lines:e.lines.slice()}}function l(e){if(e||=this,Array.isArray(e))return e.map(l).join(`\n`);var t=``;return e.action?(t=e.action==`insert`?`+`:`-`,t+=`[`+e.lines+`]`):e.value&&(t=Array.isArray(e.value)?e.value.map(u).join(`\n`):u(e.value)),e.start&&(t+=u(e)),(e.id||e.rev)&&(t+=`\t(`+(e.id||e.rev)+`)`),t}function u(e){return e.start.row+`:`+e.start.column+`=>`+e.end.row+`:`+e.end.column}function d(e,t){var n=e.action==`insert`,r=t.action==`insert`;if(n&&r)if(o(t.start,e.end)>=0)m(t,e,-1);else if(o(t.start,e.start)<=0)m(e,t,1);else return null;else if(n&&!r)if(o(t.start,e.end)>=0)m(t,e,-1);else if(o(t.end,e.start)<=0)m(e,t,-1);else return null;else if(!n&&r)if(o(t.start,e.start)>=0)m(t,e,1);else if(o(t.start,e.start)<=0)m(e,t,1);else return null;else if(!n&&!r)if(o(t.start,e.start)>=0)m(t,e,1);else if(o(t.end,e.start)<=0)m(e,t,-1);else return null;return[t,e]}function f(e,t){for(var n=e.length;n--;)for(var r=0;r<t.length;r++)if(!d(e[n],t[r])){for(;n<e.length;){for(;r--;)d(t[r],e[n]);r=t.length,n++}return[e,t]}return e.selectionBefore=t.selectionBefore=e.selectionAfter=t.selectionAfter=null,[t,e]}function p(e,t){var n=e.action==`insert`,r=t.action==`insert`;if(n&&r)o(e.start,t.start)<0?m(t,e,1):m(e,t,1);else if(n&&!r)o(e.start,t.end)>=0?m(e,t,-1):(o(e.start,t.start)<=0||m(e,a.fromPoints(t.start,e.start),-1),m(t,e,1));else if(!n&&r)o(t.start,e.end)>=0?m(t,e,-1):(o(t.start,e.start)<=0||m(t,a.fromPoints(e.start,t.start),-1),m(e,t,1));else if(!n&&!r)if(o(t.start,e.end)>=0)m(t,e,-1);else if(o(t.end,e.start)<=0)m(e,t,-1);else{var i,s;return o(e.start,t.start)<0&&(i=e,e=g(e,t.start)),o(e.end,t.end)>0&&(s=g(e,t.end)),h(t.end,e.start,e.end,-1),s&&!i&&(e.lines=s.lines,e.start=s.start,e.end=s.end,s=e),[t,i,s].filter(Boolean)}return[t,e]}function m(e,t,n){h(e.start,t.start,t.end,n),h(e.end,t.start,t.end,n)}function h(e,t,n,r){e.row==(r==1?t:n).row&&(e.column+=r*(n.column-t.column)),e.row+=r*(n.row-t.row)}function g(e,t){var n=e.lines,r=e.end;e.end=s(t);var i=e.end.row-e.start.row,a=n.splice(i,n.length),o=i?t.column:t.column-e.start.column;return n.push(a[0].substring(0,o)),a[0]=a[0].substr(o),{start:s(t),end:r,lines:a,action:e.action}}function _(e,t){t=c(t);for(var n=e.length;n--;){for(var r=e[n],i=0;i<r.length;i++){var a=r[i],o=p(a,t);t=o[0],o.length!=2&&(o[2]?(r.splice(i+1,1,o[1],o[2]),i++):o[1]||(r.splice(i,1),i--))}r.length||e.splice(n,1)}return e}function v(e,t){for(var n=0;n<t.length;n++)for(var r=t[n],i=0;i<r.length;i++)_(e,r[i])}t.UndoManager=r}),ace.define(`ace/edit_session/fold_line`,[`require`,`exports`,`module`,`ace/range`],function(e,t,n){var r=e(\"../range\").Range;t.FoldLine=function(){function e(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new r(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}return e.prototype.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},e.prototype.addFold=function(e){if(e.sameRow){if(e.start.row<this.startRow||e.endRow>this.endRow)throw Error(`Can't add a fold to this FoldLine as it has no connection`);this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else if(e.end.row==this.start.row)this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column;else throw Error(`Trying to add fold to FoldRow that doesn't have a matching row`);e.foldLine=this},e.prototype.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},e.prototype.walk=function(e,t,n){var r=0,i=this.folds,a,o,s,c=!0;t??(t=this.end.row,n=this.end.column);for(var l=0;l<i.length;l++){if(a=i[l],o=a.range.compareStart(t,n),o==-1){e(null,t,n,r,c);return}if(s=e(null,a.start.row,a.start.column,r,c),s=!s&&e(a.placeholder,a.start.row,a.start.column,r),s||o===0)return;c=!a.sameRow,r=a.end.column}e(null,t,n,r,c)},e.prototype.getNextFoldTo=function(e,t){for(var n,r,i=0;i<this.folds.length;i++){if(n=this.folds[i],r=n.range.compareEnd(e,t),r==-1)return{fold:n,kind:`after`};if(r===0)return{fold:n,kind:`inside`}}return null},e.prototype.addRemoveChars=function(e,t,n){var r=this.getNextFoldTo(e,t),i,a;if(r){if(i=r.fold,r.kind==`inside`&&i.start.column!=t&&i.start.row!=e)window.console&&window.console.log(e,t,i);else if(i.start.row==e){a=this.folds;var o=a.indexOf(i);for(o===0&&(this.start.column+=n);o<a.length;o++){if(i=a[o],i.start.column+=n,!i.sameRow)return;i.end.column+=n}this.end.column+=n}}},e.prototype.split=function(t,n){var r=this.getNextFoldTo(t,n);if(!r||r.kind==`inside`)return null;var i=r.fold,a=this.folds,o=this.foldData,s=a.indexOf(i),c=a[s-1];this.end.row=c.end.row,this.end.column=c.end.column,a=a.splice(s,a.length-s);var l=new e(o,a);return o.splice(o.indexOf(this)+1,0,l),l},e.prototype.merge=function(e){for(var t=e.folds,n=0;n<t.length;n++)this.addFold(t[n]);var r=this.foldData;r.splice(r.indexOf(e),1)},e.prototype.toString=function(){var e=[this.range.toString()+`: [`];return this.folds.forEach(function(t){e.push(` `+t.toString())}),e.push(`]`),e.join(`\n`)},e.prototype.idxToPosition=function(e){for(var t=0,n=0;n<this.folds.length;n++){var r=this.folds[n];if(e-=r.start.column-t,e<0)return{row:r.start.row,column:r.start.column+e};if(e-=r.placeholder.length,e<0)return r.start;t=r.end.column}return{row:this.end.row,column:this.end.column+e}},e}()}),ace.define(`ace/range_list`,[`require`,`exports`,`module`,`ace/range`],function(e,t,n){var r=e(\"./range\").Range.comparePoints,i=function(){function e(){this.ranges=[],this.$bias=1}return e.prototype.pointIndex=function(e,t,n){for(var i=this.ranges,a=n||0;a<i.length;a++){var o=i[a],s=r(e,o.end);if(!(s>0)){var c=r(e,o.start);return s===0?t&&c!==0?-a-2:a:c>0||c===0&&!t?a:-a-1}}return-a-1},e.prototype.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var r=this.pointIndex(e.end,t,n);return r<0?r=-r-1:r++,this.ranges.splice(n,r-n,e)},e.prototype.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},e.prototype.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},e.prototype.merge=function(){var e=[],t=this.ranges;t=t.sort(function(e,t){return r(e.start,t.start)});for(var n=t[0],i,a=1;a<t.length;a++){i=n,n=t[a];var o=r(i.end,n.start);o<0||o==0&&!i.isEmpty()&&!n.isEmpty()||(r(i.end,n.end)<0&&(i.end.row=n.end.row,i.end.column=n.end.column),t.splice(a,1),e.push(n),n=i,a--)}return this.ranges=t,e},e.prototype.contains=function(e,t){return this.pointIndex({row:e,column:t})>=0},e.prototype.containsPoint=function(e){return this.pointIndex(e)>=0},e.prototype.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},e.prototype.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row<e)return[];var r=this.pointIndex({row:e,column:0});r<0&&(r=-r-1);var i=this.pointIndex({row:t,column:0},r);i<0&&(i=-i-1);for(var a=[],o=r;o<i;o++)a.push(n[o]);return a},e.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},e.prototype.attach=function(e){this.session&&this.detach(),this.session=e,this.onChange=this.$onChange.bind(this),this.session.on(`change`,this.onChange)},e.prototype.detach=function(){this.session&&=(this.session.removeListener(`change`,this.onChange),null)},e.prototype.$onChange=function(e){for(var t=e.start,n=e.end,r=t.row,i=n.row,a=this.ranges,o=0,s=a.length;o<s;o++){var c=a[o];if(c.end.row>=r)break}if(e.action==`insert`)for(var l=i-r,u=-t.column+n.column;o<s;o++){var c=a[o];if(c.start.row>r)break;if(c.start.row==r&&c.start.column>=t.column&&(c.start.column==t.column&&this.$bias<=0||(c.start.column+=u,c.start.row+=l)),c.end.row==r&&c.end.column>=t.column){if(c.end.column==t.column&&this.$bias<0)continue;c.end.column==t.column&&u>0&&o<s-1&&c.end.column>c.start.column&&c.end.column==a[o+1].start.column&&(c.end.column-=u),c.end.column+=u,c.end.row+=l}}else for(var l=r-i,u=t.column-n.column;o<s;o++){var c=a[o];if(c.start.row>i)break;c.end.row<i&&(r<c.end.row||r==c.end.row&&t.column<c.end.column)?(c.end.row=r,c.end.column=t.column):c.end.row==i?c.end.column<=n.column?(l||c.end.column>t.column)&&(c.end.column=t.column,c.end.row=t.row):(c.end.column+=u,c.end.row+=l):c.end.row>i&&(c.end.row+=l),c.start.row<i&&(r<c.start.row||r==c.start.row&&t.column<c.start.column)?(c.start.row=r,c.start.column=t.column):c.start.row==i?c.start.column<=n.column?(l||c.start.column>t.column)&&(c.start.column=t.column,c.start.row=t.row):(c.start.column+=u,c.start.row+=l):c.start.row>i&&(c.start.row+=l)}if(l!=0&&o<s)for(;o<s;o++){var c=a[o];c.start.row+=l,c.end.row+=l}},e}();i.prototype.comparePoints=r,t.RangeList=i}),ace.define(`ace/edit_session/fold`,[`require`,`exports`,`module`,`ace/range_list`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=function(e){r(t,e);function t(t,n){var r=e.call(this)||this;return r.foldLine=null,r.placeholder=n,r.range=t,r.start=t.start,r.end=t.end,r.sameRow=t.start.row==t.end.row,r.subFolds=r.ranges=[],r}return t.prototype.toString=function(){return`\"`+this.placeholder+`\" `+this.range.toString()},t.prototype.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach(function(t){t.setFoldLine(e)})},t.prototype.clone=function(){var e=new t(this.range.clone(),this.placeholder);return this.subFolds.forEach(function(t){e.subFolds.push(t.clone())}),e.collapseChildren=this.collapseChildren,e},t.prototype.addSubFold=function(e){if(!this.range.isEqual(e)){o(e,this.start);for(var t=e.start.row,n=e.start.column,r=0,i=-1;r<this.subFolds.length&&(i=this.subFolds[r].range.compare(t,n),i==1);r++);var a=this.subFolds[r],s=0;if(i==0){if(a.range.containsRange(e))return a.addSubFold(e);s=1}for(var t=e.range.end.row,n=e.range.end.column,c=r,i=-1;c<this.subFolds.length&&(i=this.subFolds[c].range.compare(t,n),i==1);c++);i==0&&c++;for(var l=this.subFolds.splice(r,c-r,e),u=i==0?l.length-1:l.length,d=s;d<u;d++)e.addSubFold(l[d]);return e.setFoldLine(this.foldLine),e}},t.prototype.restoreRange=function(e){return c(e,this.start)},t}(e(\"../range_list\").RangeList);function a(e,t){e.row-=t.row,e.row==0&&(e.column-=t.column)}function o(e,t){a(e.start,t),a(e.end,t)}function s(e,t){e.row==0&&(e.column+=t.column),e.row+=t.row}function c(e,t){s(e.start,t),s(e.end,t)}t.Fold=i}),ace.define(`ace/edit_session/folding`,[`require`,`exports`,`module`,`ace/range`,`ace/edit_session/fold_line`,`ace/edit_session/fold`,`ace/token_iterator`,`ace/mouse/mouse_event`],function(e,t,n){var r=e(\"../range\").Range,i=e(\"./fold_line\").FoldLine,a=e(\"./fold\").Fold,o=e(\"../token_iterator\").TokenIterator,s=e(\"../mouse/mouse_event\").MouseEvent;function c(){this.getFoldAt=function(e,t,n){var r=this.getFoldLine(e);if(!r)return null;for(var i=r.folds,a=0;a<i.length;a++){var o=i[a].range;if(o.contains(e,t)){if(n==1&&o.isEnd(e,t)&&!o.isEmpty()||n==-1&&o.isStart(e,t)&&!o.isEmpty())continue;return i[a]}}},this.getFoldsInRange=function(e){var t=e.start,n=e.end,r=this.$foldData,i=[];t.column+=1,--n.column;for(var a=0;a<r.length;a++){var o=r[a].range.compareRange(e);if(o!=2){if(o==-2)break;for(var s=r[a].folds,c=0;c<s.length;c++){var l=s[c];if(o=l.range.compareRange(e),o==-2)break;if(o!=2){if(o==42)break;i.push(l)}}}}return--t.column,n.column+=1,i},this.getFoldsInRangeList=function(e){if(Array.isArray(e)){var t=[];e.forEach(function(e){t=t.concat(this.getFoldsInRange(e))},this)}else var t=this.getFoldsInRange(e);return t},this.getAllFolds=function(){for(var e=[],t=this.$foldData,n=0;n<t.length;n++)for(var r=0;r<t[n].folds.length;r++)e.push(t[n].folds[r]);return e},this.getFoldStringAt=function(e,t,n,r){if(r||=this.getFoldLine(e),!r)return null;for(var i={end:{column:0}},a,o,s=0;s<r.folds.length;s++){o=r.folds[s];var c=o.range.compareEnd(e,t);if(c==-1){a=this.getLine(o.start.row).substring(i.end.column,o.start.column);break}else if(c===0)return null;i=o}return a||=this.getLine(o.start.row).substring(i.end.column),n==-1?a.substring(0,t-i.end.column):n==1?a.substring(t-i.end.column):a},this.getFoldLine=function(e,t){var n=this.$foldData,r=0;for(t&&(r=n.indexOf(t)),r==-1&&(r=0);r<n.length;r++){var i=n[r];if(i.start.row<=e&&i.end.row>=e)return i;if(i.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,r=0;for(t&&(r=n.indexOf(t)),r==-1&&(r=0);r<n.length;r++){var i=n[r];if(i.end.row>=e)return i}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,r=t-e+1,i=0;i<n.length;i++){var a=n[i],o=a.end.row,s=a.start.row;if(o>=t){s<t&&(s>=e?r-=t-s:r=0);break}else o>=e&&(s>=e?r-=o-s:r-=o-e+1)}return r},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n=this.$foldData,r=!1,o;e instanceof a?o=e:(o=new a(t,e),o.collapseChildren=t.collapseChildren),this.$clipRangeToDocument(o.range);var s=o.start.row,c=o.start.column,l=o.end.row,u=o.end.column,d=this.getFoldAt(s,c,1),f=this.getFoldAt(l,u,-1);if(d&&f==d)return d.addSubFold(o);d&&!d.range.isStart(s,c)&&this.removeFold(d),f&&!f.range.isEnd(l,u)&&this.removeFold(f);var p=this.getFoldsInRange(o.range);p.length>0&&(this.removeFolds(p),o.collapseChildren||p.forEach(function(e){o.addSubFold(e)}));for(var m=0;m<n.length;m++){var h=n[m];if(l==h.start.row){h.addFold(o),r=!0;break}else if(s==h.end.row){if(h.addFold(o),r=!0,!o.sameRow){var g=n[m+1];if(g&&g.start.row==l){h.merge(g);break}}break}else if(l<=h.start.row)break}return r||(h=this.$addFoldLine(new i(this.$foldData,o))),this.$useWrapMode?this.$updateWrapData(h.start.row,h.start.row):this.$updateRowLengthCache(h.start.row,h.start.row),this.$modified=!0,this._signal(`changeFold`,{data:o,action:`add`}),o},this.addFolds=function(e){e.forEach(function(e){this.addFold(e)},this)},this.removeFold=function(e){var t=e.foldLine,n=t.start.row,r=t.end.row,i=this.$foldData,a=t.folds;if(a.length==1)i.splice(i.indexOf(t),1);else if(t.range.isEnd(e.end.row,e.end.column))a.pop(),t.end.row=a[a.length-1].end.row,t.end.column=a[a.length-1].end.column;else if(t.range.isStart(e.start.row,e.start.column))a.shift(),t.start.row=a[0].start.row,t.start.column=a[0].start.column;else if(e.sameRow)a.splice(a.indexOf(e),1);else{var o=t.split(e.start.row,e.start.column);a=o.folds,a.shift(),o.start.row=a[0].start.row,o.start.column=a[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(n,r):this.$updateRowLengthCache(n,r)),this.$modified=!0,this._signal(`changeFold`,{data:e,action:`remove`})},this.removeFolds=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);t.forEach(function(e){this.removeFold(e)},this),this.$modified=!0},this.expandFold=function(e){this.removeFold(e),e.subFolds.forEach(function(t){e.restoreRange(t),this.addFold(t)},this),e.collapseChildren>0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,i;if(e==null)n=new r(0,0,this.getLength(),0),t??=!0;else if(typeof e==`number`)n=new r(e,0,e,this.getLine(e).length);else if(`row`in e)n=r.fromPoints(e,e);else if(Array.isArray(e))return i=[],e.forEach(function(e){i=i.concat(this.unfold(e))},this),i;else n=e;i=this.getFoldsInRangeList(n);for(var a=i;i.length==1&&r.comparePoints(i[0].start,n.start)<0&&r.comparePoints(i[0].end,n.end)>0;)this.expandFolds(i),i=this.getFoldsInRangeList(n);if(t==0?this.expandFolds(i):this.removeFolds(i),a.length)return a},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,r,i){r??=e.start.row,i??=0,t??=e.end.row,n??=this.getLine(t).length;var a=this.doc,o=``;return e.walk(function(e,t,n,s){if(!(t<r)){if(t==r){if(n<i)return;s=Math.max(i,s)}e==null?o+=a.getLine(t).substring(s,n):o+=e}},t,n),o},this.getDisplayLine=function(e,t,n,r){var i=this.getFoldLine(e);if(i)return this.getFoldDisplayLine(i,e,t,n,r);var a=this.doc.getLine(e);return a.substring(r||0,t||a.length)},this.$cloneFoldData=function(){var e=[];return e=this.$foldData.map(function(t){var n=t.folds.map(function(e){return e.clone()});return new i(e,n)}),e},this.toggleFold=function(e){var t=this.selection.getRange(),n,r;if(t.isEmpty()){var i=t.start;if(n=this.getFoldAt(i.row,i.column),n){this.expandFold(n);return}else if(e){var a=this.getFoldLine(i.row);a&&this.expandFolds(a.folds);return}else(r=this.findMatchingBracket(i))?t.comparePoint(r)==1?t.end=r:(t.start=r,t.start.column++,t.end.column--):(r=this.findMatchingBracket({row:i.row,column:i.column+1}))?(t.comparePoint(r)==1?t.end=r:t.start=r,t.start.column++):t=this.getCommentFoldRange(i.row,i.column)||t}else{var o=this.getFoldsInRange(t);if(e&&o.length){this.expandFolds(o);return}else o.length==1&&(n=o[0])}if(n||=this.getFoldAt(t.start.row,t.start.column),n&&n.range.toString()==t.toString()){this.expandFold(n);return}var s=`...`;if(!t.isMultiLine()){if(s=this.getTextRange(t),s.length<4)return;s=s.trim().substring(0,2)+`..`}this.addFold(s,t)},this.getCommentFoldRange=function(e,t,n){var i=new o(this,e,t),a=i.getCurrentToken(),s=a&&a.type;if(a&&/^comment|string/.test(s)){s=s.match(/comment|string/)[0],s==`comment`&&(s+=`|doc-start|\\\\.doc`);var c=new RegExp(s),l=new r;if(n!=1){do a=i.stepBackward();while(a&&c.test(a.type));a=i.stepForward()}l.start.row=i.getCurrentTokenRow(),l.start.column=i.getCurrentTokenColumn()+a.value.length,i=new o(this,e,t);var u=this.getState(i.$row);if(n!=-1){var d=-1;do if(a=i.stepForward(),d==-1){var f=this.getState(i.$row);u.toString()!==f.toString()&&(d=i.$row)}else if(i.$row>d)break;while(a&&c.test(a.type));a=i.stepBackward()}else a=i.getCurrentToken();return l.end.row=i.getCurrentTokenRow(),l.end.column=i.getCurrentTokenColumn(),l.start.row==l.end.row&&l.start.column>l.end.column?void 0:l}},this.foldAll=function(e,t,n,r){n??=1e5;var i=this.foldWidgets;if(i){t||=this.getLength(),e||=0;for(var a=e;a<t;a++)if(i[a]??(i[a]=this.getFoldWidget(a)),i[a]==`start`&&!(r&&!r(a))){var o=this.getFoldWidgetRange(a);o&&o.isMultiLine()&&o.end.row<=t&&o.start.row>=e&&(a=o.end.row,o.collapseChildren=n,this.addFold(`...`,o))}}},this.foldToLevel=function(e){for(this.foldAll();e-->0;)this.unfold(null,!1)},this.foldAllComments=function(){var e=this;this.foldAll(null,null,null,function(t){for(var n=e.getTokens(t),r=0;r<n.length;r++){var i=n[r];if(!(i.type==`text`&&/^\\s+$/.test(i.value)))return!!/comment/.test(i.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle=`markbegin`,this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw Error(`invalid fold style: `+e+`[`+Object.keys(this.$foldStyles).join(`, `)+`]`);if(this.$foldStyle!=e){this.$foldStyle=e,e==`manual`&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){if(this.$foldMode!=e){if(this.$foldMode=e,this.off(`change`,this.$updateFoldWidgets),this.off(`tokenizerUpdate`,this.$tokenizerUpdateFoldWidgets),this._signal(`changeAnnotation`),!e||this.$foldStyle==`manual`){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on(`change`,this.$updateFoldWidgets),this.on(`tokenizerUpdate`,this.$tokenizerUpdateFoldWidgets)}},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var r=e-1,i;r>=0;){var a=n[r];if(a??=n[r]=this.getFoldWidget(r),a==`start`){var o=this.getFoldWidgetRange(r);if(i||=o,o&&o.end.row>=e)break}r--}return{range:r!==-1&&o,firstRange:i}},this.onFoldWidgetClick=function(e,t){t instanceof s&&(t=t.domEvent);var n={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var r=t.target||t.srcElement;r&&/ace_fold-widget/.test(r.className)&&(r.className+=` ace_invalid`)}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),r=this.getLine(e),i=n===`end`?-1:1,a=this.getFoldAt(e,i===-1?0:r.length,i);if(a)return t.children||t.all?this.removeFold(a):this.expandFold(a),a;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(a=this.getFoldAt(o.start.row,o.start.column,1),a&&o.isEqual(a.range)))return this.removeFold(a),a;if(t.siblings){var s=this.getParentFoldRangeData(e);if(s.range)var c=s.range.start.row+1,l=s.range.end.row;this.foldAll(c,l,t.all?1e4:0)}else t.children?(l=o?o.end.row:this.getLength(),this.foldAll(e+1,l,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold(`...`,o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var r=this.getParentFoldRangeData(t,!0);if(n=r.range||r.firstRange,n){t=n.start.row;var i=this.getFoldAt(t,this.getLine(t).length,1);i?this.removeFold(i):this.addFold(`...`,n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(n===0)this.foldWidgets[t]=null;else if(e.action==`remove`)this.foldWidgets.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,r)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}t.Folding=c}),ace.define(`ace/edit_session/bracket_match`,[`require`,`exports`,`module`,`ace/token_iterator`,`ace/range`],function(e,t,n){var r=e(\"../token_iterator\").TokenIterator,i=e(\"../range\").Range;function a(){this.findMatchingBracket=function(e,t){if(e.column==0)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(n==``)return null;var r=n.match(/([\\(\\[\\{])|([\\)\\]\\}])/);return r?r[1]?this.$findClosingBracket(r[1],e):this.$findOpeningBracket(r[2],e):null},this.getBracketRange=function(e){var t=this.getLine(e.row),n=!0,r,a=t.charAt(e.column-1),o=a&&a.match(/([\\(\\[\\{])|([\\)\\]\\}])/);if(o||(a=t.charAt(e.column),e={row:e.row,column:e.column+1},o=a&&a.match(/([\\(\\[\\{])|([\\)\\]\\}])/),n=!1),!o)return null;if(o[1]){var s=this.$findClosingBracket(o[1],e);if(!s)return null;r=i.fromPoints(e,s),n||(r.end.column++,r.start.column--),r.cursor=r.end}else{var s=this.$findOpeningBracket(o[2],e);if(!s)return null;r=i.fromPoints(s,e),n||(r.start.column++,r.end.column--),r.cursor=r.start}return r},this.getMatchingBracketRanges=function(e,t){var n=this.getLine(e.row),r=/([\\(\\[\\{])|([\\)\\]\\}])/,a=!t&&n.charAt(e.column-1),o=a&&a.match(r);if(o||=(a=(t===void 0||t)&&n.charAt(e.column),e={row:e.row,column:e.column+1},a&&a.match(r)),!o)return null;var s=new i(e.row,e.column-1,e.row,e.column),c=o[1]?this.$findClosingBracket(o[1],e):this.$findOpeningBracket(o[2],e);return c?[s,new i(c.row,c.column,c.row,c.column+1)]:[s]},this.$brackets={\")\":`(`,\"(\":`)`,\"]\":`[`,\"[\":`]`,\"{\":`}`,\"}\":`{`,\"<\":`>`,\">\":`<`},this.$findOpeningBracket=function(e,t,n){var i=this.$brackets[e],a=1,o=new r(this,t.row,t.column),s=o.getCurrentToken();if(s||=o.stepForward(),s){n||=RegExp(`(\\\\.?`+s.type.replace(`.`,`\\\\.`).replace(`rparen`,`.paren`).replace(/\\b(?:end)\\b/,`(?:start|begin|end)`).replace(/-close\\b/,`-(close|open)`)+`)+`);for(var c=t.column-o.getCurrentTokenColumn()-2,l=s.value;;){for(;c>=0;){var u=l.charAt(c);if(u==i){if(--a,a==0)return{row:o.getCurrentTokenRow(),column:c+o.getCurrentTokenColumn()}}else u==e&&(a+=1);--c}do s=o.stepBackward();while(s&&!n.test(s.type));if(s==null)break;l=s.value,c=l.length-1}return null}},this.$findClosingBracket=function(e,t,n){var i=this.$brackets[e],a=1,o=new r(this,t.row,t.column),s=o.getCurrentToken();if(s||=o.stepForward(),s){n||=RegExp(`(\\\\.?`+s.type.replace(`.`,`\\\\.`).replace(`lparen`,`.paren`).replace(/\\b(?:start|begin)\\b/,`(?:start|begin|end)`).replace(/-open\\b/,`-(close|open)`)+`)+`);for(var c=t.column-o.getCurrentTokenColumn();;){for(var l=s.value,u=l.length;c<u;){var d=l.charAt(c);if(d==i){if(--a,a==0)return{row:o.getCurrentTokenRow(),column:c+o.getCurrentTokenColumn()}}else d==e&&(a+=1);c+=1}do s=o.stepForward();while(s&&!n.test(s.type));if(s==null)break;c=0}return null}},this.getMatchingTags=function(e){var t=new r(this,e.row,e.column),n=this.$findTagName(t);if(n)return t.stepBackward().value===`<`?this.$findClosingTag(t,n):this.$findOpeningTag(t,n)},this.$findTagName=function(e){var t=e.getCurrentToken(),n=!1,r=!1;if(t&&t.type.indexOf(`tag-name`)===-1)do t=r?e.stepBackward():e.stepForward(),t&&(t.value===`/>`?r=!0:t.type.indexOf(`tag-name`)!==-1&&(n=!0));while(t&&!n);return t},this.$findClosingTag=function(e,t){var n,r=t.value,a=t.value,o=0,s=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);t=e.stepForward();var c=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length),l=!1;do{if(n=t,n.type.indexOf(`tag-close`)!==-1&&!l){var u=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);l=!0}if(t=e.stepForward(),t){if(t.value===`>`&&!l){var u=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);l=!0}if(t.type.indexOf(`tag-name`)!==-1){if(r=t.value,a===r){if(n.value===`<`)o++;else if(n.value===`</`&&(o--,o<0)){e.stepBackward();var d=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+2);t=e.stepForward();var f=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length);if(t.type.indexOf(`tag-close`)===-1&&(t=e.stepForward()),t&&t.value===`>`)var p=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);else return}}}else if(a===r&&t.value===`/>`&&(o--,o<0))var d=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+2),f=d,p=f,u=new i(c.end.row,c.end.column,c.end.row,c.end.column+1)}}while(t&&o>=0);if(s&&u&&d&&p&&c&&f)return{openTag:new i(s.start.row,s.start.column,u.end.row,u.end.column),closeTag:new i(d.start.row,d.start.column,p.end.row,p.end.column),openTagName:c,closeTagName:f}},this.$findOpeningTag=function(e,t){var n=e.getCurrentToken(),r=t.value,a=0,o=e.getCurrentTokenRow(),s=e.getCurrentTokenColumn(),c=s+2,l=new i(o,s,o,c);e.stepForward();var u=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length);if(t.type.indexOf(`tag-close`)===-1&&(t=e.stepForward()),!(!t||t.value!==`>`)){var d=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);e.stepBackward(),e.stepBackward();do if(t=n,o=e.getCurrentTokenRow(),s=e.getCurrentTokenColumn(),c=s+t.value.length,n=e.stepBackward(),t){if(t.type.indexOf(`tag-name`)!==-1){if(r===t.value)if(n.value===`<`){if(a++,a>0){var f=new i(o,s,o,c),p=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);do t=e.stepForward();while(t&&t.value!==`>`);var m=new i(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else n.value===`</`&&a--}else if(t.value===`/>`){for(var h=0,g=n;g;){if(g.type.indexOf(`tag-name`)!==-1&&g.value===r){a--;break}else if(g.value===`<`)break;g=e.stepBackward(),h++}for(var _=0;_<h;_++)e.stepForward()}}while(n&&a<=0);if(p&&m&&l&&d&&f&&u)return{openTag:new i(p.start.row,p.start.column,m.end.row,m.end.column),closeTag:new i(l.start.row,l.start.column,d.end.row,d.end.column),openTagName:f,closeTagName:u}}}}t.BracketMatch=a}),ace.define(`ace/edit_session`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/lang`,`ace/bidihandler`,`ace/config`,`ace/lib/event_emitter`,`ace/selection`,`ace/mode/text`,`ace/range`,`ace/line_widgets`,`ace/document`,`ace/background_tokenizer`,`ace/search_highlight`,`ace/undomanager`,`ace/edit_session/folding`,`ace/edit_session/bracket_match`],function(e,t,n){var r=e(\"./lib/oop\"),i=e(\"./lib/lang\"),a=e(\"./bidihandler\").BidiHandler,o=e(\"./config\"),s=e(\"./lib/event_emitter\").EventEmitter,c=e(\"./selection\").Selection,l=e(\"./mode/text\").Mode,u=e(\"./range\").Range,d=e(\"./line_widgets\").LineWidgets,f=e(\"./document\").Document,p=e(\"./background_tokenizer\").BackgroundTokenizer,m=e(\"./search_highlight\").SearchHighlight,h=e(\"./undomanager\").UndoManager,g=function(){function e(t,n){this.doc,this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$editor=null,this.prevOp={},this.$foldData=[],this.id=`session`+ ++e.$uid,this.$foldData.toString=function(){return this.join(`\n`)},this.$gutterCustomWidgets={},this.bgTokenizer=new p(new l().getTokenizer(),this);var r=this;this.bgTokenizer.on(`update`,function(e){r._signal(`tokenizerUpdate`,e)}),this.on(`changeFold`,this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof t!=`object`||!t.getLine)&&(t=new f(t)),this.setDocument(t),this.selection=new c(this),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on(`changeSelection`,this.$onSelectionChange),this.selection.on(`changeCursor`,this.$onSelectionChange),this.$bidiHandler=new a(this),o.resetOptions(this),this.setMode(n),o._signal(`session`,this),this.destroyed=!1,this.$initOperationListeners()}return e.prototype.$initOperationListeners=function(){var e=this;this.curOp=null,this.on(`change`,function(){e.curOp||(e.startOperation(),e.curOp.selectionBefore=e.$lastSel),e.curOp.docChanged=!0},!0),this.on(`changeSelection`,function(){e.curOp||(e.startOperation(),e.curOp.selectionBefore=e.$lastSel),e.curOp.selectionChanged=!0},!0),this.$operationResetTimer=i.delayedCall(this.endOperation.bind(this,!0))},e.prototype.startOperation=function(e){if(this.curOp){if(!e||this.curOp.command)return;this.prevOp=this.curOp}e||={},this.$operationResetTimer.schedule(),this.curOp={command:e.command||{},args:e.args},this.curOp.selectionBefore=this.selection.toJSON(),this._signal(`startOperation`,e)},e.prototype.endOperation=function(e){if(this.curOp){if(e&&e.returnValue===!1){this.curOp=null,this._signal(`endOperation`,e);return}if(e==1&&this.curOp.command&&this.curOp.command.name==`mouse`)return;var t=this.selection.toJSON();this.curOp.selectionAfter=t,this.$lastSel=this.selection.toJSON(),this.getUndoManager().addSelection(t),this._signal(`beforeEndOperation`),this.prevOp=this.curOp,this.curOp=null,this._signal(`endOperation`,e)}},e.prototype.setDocument=function(e){this.doc&&this.doc.off(`change`,this.$onChange),this.doc=e,e.on(`change`,this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},e.prototype.getDocument=function(){return this.doc},Object.defineProperty(e.prototype,\"widgetManager\",{get:function(){var e=new d(this);return this.widgetManager=e,this.$editor&&e.attach(this.$editor),e},set:function(e){Object.defineProperty(this,\"widgetManager\",{writable:!0,enumerable:!0,configurable:!0,value:e})},enumerable:!1,configurable:!0}),e.prototype.$resetRowCache=function(e){if(!e){this.$docRowCache=[],this.$screenRowCache=[];return}var t=this.$docRowCache.length,n=this.$getRowCacheIndex(this.$docRowCache,e)+1;t>n&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},e.prototype.$getRowCacheIndex=function(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>1,a=e[i];if(t>a)n=i+1;else if(t<a)r=i-1;else return i}return n-1},e.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},e.prototype.onChangeFold=function(e){var t=e.data;this.$resetRowCache(t.start.row)},e.prototype.onChange=function(e){this.$modified=!0,this.$bidiHandler.onChange(e),this.$resetRowCache(e.start.row);var t=this.$updateInternalDataOnChange(e);!this.$fromUndo&&this.$undoManager&&(t&&t.length&&(this.$undoManager.add({action:`removeFolds`,folds:t},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(e,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(e),this._signal(`change`,e)},e.prototype.onSelectionChange=function(){this._signal(`changeSelection`)},e.prototype.setValue=function(e){this.doc.setValue(e),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},e.fromJSON=function(t){typeof t==`string`&&(t=JSON.parse(t));var n=new h;n.$undoStack=t.history.$undoStack,n.$redoStack=t.history.$redoStack,n.mark=t.history.mark,n.$rev=t.history.rev;var r=new e(t.value);return t.folds.forEach(function(e){r.addFold(`...`,u.fromPoints(e.start,e.end))}),r.setAnnotations(t.annotations),r.setBreakpoints(t.breakpoints),r.setMode(t.mode),r.setScrollLeft(t.scrollLeft),r.setScrollTop(t.scrollTop),r.setUndoManager(n),r.selection.fromJSON(t.selection),r},e.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function(e){return e.range}),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},e.prototype.toString=function(){return this.doc.getValue()},e.prototype.getSelection=function(){return this.selection},e.prototype.getState=function(e){return this.bgTokenizer.getState(e)},e.prototype.getTokens=function(e){return this.bgTokenizer.getTokens(e)},e.prototype.getTokenAt=function(e,t){var n=this.bgTokenizer.getTokens(e),r,i=0;if(t==null){var a=n.length-1;i=this.getLine(e).length}else for(var a=0;a<n.length&&(i+=n[a].value.length,!(i>=t));a++);return r=n[a],r?(r.index=a,r.start=i-r.value.length,r):null},e.prototype.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},e.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},e.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},e.prototype.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(` `,this.getTabSize()):`\t`},e.prototype.setUseSoftTabs=function(e){this.setOption(`useSoftTabs`,e)},e.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},e.prototype.setTabSize=function(e){this.setOption(`tabSize`,e)},e.prototype.getTabSize=function(){return this.$tabSize},e.prototype.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize===0},e.prototype.setNavigateWithinSoftTabs=function(e){this.setOption(`navigateWithinSoftTabs`,e)},e.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},e.prototype.setOverwrite=function(e){this.setOption(`overwrite`,e)},e.prototype.getOverwrite=function(){return this.$overwrite},e.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},e.prototype.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=``),this.$decorations[e]+=` `+t,this._signal(`changeBreakpoint`,{})},e.prototype.removeGutterCustomWidget=function(e){this.$editor&&this.$editor.renderer.$gutterLayer.$removeCustomWidget(e)},e.prototype.addGutterCustomWidget=function(e,t){this.$editor&&this.$editor.renderer.$gutterLayer.$addCustomWidget(e,t)},e.prototype.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||``).replace(` `+t,``),this._signal(`changeBreakpoint`,{})},e.prototype.getBreakpoints=function(){return this.$breakpoints},e.prototype.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t<e.length;t++)this.$breakpoints[e[t]]=`ace_breakpoint`;this._signal(`changeBreakpoint`,{})},e.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal(`changeBreakpoint`,{})},e.prototype.setBreakpoint=function(e,t){t===void 0&&(t=`ace_breakpoint`),t?this.$breakpoints[e]=t:delete this.$breakpoints[e],this._signal(`changeBreakpoint`,{})},e.prototype.clearBreakpoint=function(e){delete this.$breakpoints[e],this._signal(`changeBreakpoint`,{})},e.prototype.addMarker=function(e,t,n,r){var i=this.$markerId++,a={range:e,type:n||`line`,renderer:typeof n==`function`?n:null,clazz:t,inFront:!!r,id:i};return r?(this.$frontMarkers[i]=a,this._signal(`changeFrontMarker`)):(this.$backMarkers[i]=a,this._signal(`changeBackMarker`)),i},e.prototype.addDynamicMarker=function(e,t){if(e.update){var n=this.$markerId++;return e.id=n,e.inFront=!!t,t?(this.$frontMarkers[n]=e,this._signal(`changeFrontMarker`)):(this.$backMarkers[n]=e,this._signal(`changeBackMarker`)),e}},e.prototype.removeMarker=function(e){var t=this.$frontMarkers[e]||this.$backMarkers[e];if(t){var n=t.inFront?this.$frontMarkers:this.$backMarkers;delete n[e],this._signal(t.inFront?`changeFrontMarker`:`changeBackMarker`)}},e.prototype.getMarkers=function(e){return e?this.$frontMarkers:this.$backMarkers},e.prototype.highlight=function(e){if(!this.$searchHighlight){var t=new m(null,`ace_selected-word`,`text`);this.$searchHighlight=this.addDynamicMarker(t)}this.$searchHighlight.setRegexp(e)},e.prototype.highlightLines=function(e,t,n,r){typeof t!=`number`&&(n=t,t=e),n||=`ace_step`;var i=new u(e,0,t,1/0);return i.id=this.addMarker(i,n,`fullLine`,r),i},e.prototype.setAnnotations=function(e){this.$annotations=e,this._signal(`changeAnnotation`,{})},e.prototype.getAnnotations=function(){return this.$annotations||[]},e.prototype.clearAnnotations=function(){this.setAnnotations([])},e.prototype.$detectNewLine=function(e){var t=e.match(/^.*?(\\r?\\n)/m);t?this.$autoNewLine=t[1]:this.$autoNewLine=`\n`},e.prototype.getWordRange=function(e,t){var n=this.getLine(e),r=!1;if(t>0&&(r=!!n.charAt(t-1).match(this.tokenRe)),r||=!!n.charAt(t).match(this.tokenRe),r)var i=this.tokenRe;else if(/^\\s+$/.test(n.slice(t-1,t+1)))var i=/\\s/;else var i=this.nonTokenRe;var a=t;if(a>0){do a--;while(a>=0&&n.charAt(a).match(i));a++}for(var o=t;o<n.length&&n.charAt(o).match(i);)o++;return new u(e,a,e,o)},e.prototype.getAWordRange=function(e,t){for(var n=this.getWordRange(e,t),r=this.getLine(n.end.row);r.charAt(n.end.column).match(/[ \\t]/);)n.end.column+=1;return n},e.prototype.setNewLineMode=function(e){this.doc.setNewLineMode(e)},e.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},e.prototype.setUseWorker=function(e){this.setOption(`useWorker`,e)},e.prototype.getUseWorker=function(){return this.$useWorker},e.prototype.onReloadTokenizer=function(e){var t=e.data;this.bgTokenizer.start(t.first),this._signal(`tokenizerUpdate`,e)},e.prototype.setMode=function(e,t){if(e&&typeof e==`object`){if(e.getTokenizer)return this.$onChangeMode(e);var n=e,r=n.path}else r=e||`ace/mode/text`;if(this.$modes[`ace/mode/text`]||(this.$modes[`ace/mode/text`]=new l),this.$modes[r]&&!n){this.$onChangeMode(this.$modes[r]),t&&t();return}this.$modeId=r,o.loadModule([`mode`,r],function(e){if(!this.destroyed){if(this.$modeId!==r)return t&&t();this.$modes[r]&&!n?this.$onChangeMode(this.$modes[r]):e&&e.Mode&&(e=new e.Mode(n),n||(this.$modes[r]=e,e.$id=r),this.$onChangeMode(e)),t&&t()}}.bind(this)),this.$mode||this.$onChangeMode(this.$modes[`ace/mode/text`],!0)},e.prototype.$onChangeMode=function(e,t){if(t||(this.$modeId=e.$id),this.$mode!==e){var n=this.$mode;this.$mode=e,this.$stopWorker(),this.$useWorker&&this.$startWorker();var r=e.getTokenizer();if(r.on!==void 0){var i=this.onReloadTokenizer.bind(this);r.on(`update`,i)}this.bgTokenizer.setTokenizer(r),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=e.tokenRe,this.nonTokenRe=e.nonTokenRe,t||(e.attachToSession&&e.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(e.foldingRules),this.bgTokenizer.start(0),this._emit(`changeMode`,{oldMode:n,mode:e}))}},e.prototype.$stopWorker=function(){this.$worker&&=(this.$worker.terminate(),null)},e.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(e){o.warn(`Could not load worker`,e),this.$worker=null}},e.prototype.getMode=function(){return this.$mode},e.prototype.setScrollTop=function(e){this.$scrollTop===e||isNaN(e)||(this.$scrollTop=e,this._signal(`changeScrollTop`,e))},e.prototype.getScrollTop=function(){return this.$scrollTop},e.prototype.setScrollLeft=function(e){this.$scrollLeft===e||isNaN(e)||(this.$scrollLeft=e,this._signal(`changeScrollLeft`,e))},e.prototype.getScrollLeft=function(){return this.$scrollLeft},e.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},e.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var e=0;return this.lineWidgets.forEach(function(t){t&&t.screenWidth>e&&(e=t.screenWidth)}),this.lineWidgetWidth=e},e.prototype.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,r=0,i=0,a=this.$foldData[i],o=a?a.start.row:1/0,s=t.length,c=0;c<s;c++){if(c>o){if(c=a.end.row+1,c>=s)break;a=this.$foldData[i++],o=a?a.start.row:1/0}n[c]??(n[c]=this.$getStringScreenWidth(t[c])[0]),n[c]>r&&(r=n[c])}this.screenWidth=r}},e.prototype.getLine=function(e){return this.doc.getLine(e)},e.prototype.getLines=function(e,t){return this.doc.getLines(e,t)},e.prototype.getLength=function(){return this.doc.getLength()},e.prototype.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},e.prototype.insert=function(e,t){return this.doc.insert(e,t)},e.prototype.remove=function(e){return this.doc.remove(e)},e.prototype.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},e.prototype.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;n!=-1;n--){var r=e[n];r.action==`insert`||r.action==`remove`?this.doc.revertDelta(r):r.folds&&this.addFolds(r.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},e.prototype.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;n<e.length;n++){var r=e[n];(r.action==`insert`||r.action==`remove`)&&this.doc.$safeApplyDelta(r)}!t&&this.$undoSelect&&(e.selectionAfter?this.selection.fromJSON(e.selectionAfter):this.selection.setRange(this.$getUndoSelection(e,!1))),this.$fromUndo=!1}},e.prototype.setUndoSelect=function(e){this.$undoSelect=e},e.prototype.$getUndoSelection=function(e,t){function n(e){return t?e.action!==`insert`:e.action===`insert`}for(var r,i,a=0;a<e.length;a++){var o=e[a];if(o.start){if(!r){r=n(o)?u.fromPoints(o.start,o.end):u.fromPoints(o.start,o.start);continue}n(o)?(i=o.start,r.compare(i.row,i.column)==-1&&r.setStart(i),i=o.end,r.compare(i.row,i.column)==1&&r.setEnd(i)):(i=o.start,r.compare(i.row,i.column)==-1&&(r=u.fromPoints(o.start,o.start)))}}return r},e.prototype.replace=function(e,t){return this.doc.replace(e,t)},e.prototype.moveText=function(e,t,n){var r=this.getTextRange(e),i=this.getFoldsInRange(e),a=u.fromPoints(t,t);if(!n){this.remove(e);var o=e.start.row-e.end.row,s=o?-e.end.column:e.start.column-e.end.column;s&&(a.start.row==e.end.row&&a.start.column>e.end.column&&(a.start.column+=s),a.end.row==e.end.row&&a.end.column>e.end.column&&(a.end.column+=s)),o&&a.start.row>=e.end.row&&(a.start.row+=o,a.end.row+=o)}if(a.end=this.insert(a.start,r),i.length){var c=e.start,l=a.start,o=l.row-c.row,s=l.column-c.column;this.addFolds(i.map(function(e){return e=e.clone(),e.start.row==c.row&&(e.start.column+=s),e.end.row==c.row&&(e.end.column+=s),e.start.row+=o,e.end.row+=o,e}))}return a},e.prototype.indentRows=function(e,t,n){n=n.replace(/\\t/g,this.getTabString());for(var r=e;r<=t;r++)this.doc.insertInLine({row:r,column:0},n)},e.prototype.outdentRows=function(e){for(var t=e.collapseRows(),n=new u(0,0,0,0),r=this.getTabSize(),i=t.start.row;i<=t.end.row;++i){var a=this.getLine(i);n.start.row=i,n.end.row=i;for(var o=0;o<r&&a.charAt(o)==` `;++o);o<r&&a.charAt(o)==`\t`?(n.start.column=o,n.end.column=o+1):(n.start.column=0,n.end.column=o),this.remove(n)}},e.prototype.$moveLines=function(e,t,n){if(e=this.getRowFoldStart(e),t=this.getRowFoldEnd(t),n<0){var r=this.getRowFoldStart(e+n);if(r<0)return 0;var i=r-e}else if(n>0){var r=this.getRowFoldEnd(t+n);if(r>this.doc.getLength()-1)return 0;var i=r-t}else{e=this.$clipRowToDocument(e),t=this.$clipRowToDocument(t);var i=t-e+1}var a=new u(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(a).map(function(e){return e=e.clone(),e.start.row+=i,e.end.row+=i,e}),s=n==0?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+i,s),o.length&&this.addFolds(o),i},e.prototype.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},e.prototype.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},e.prototype.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},e.prototype.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},e.prototype.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},e.prototype.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},e.prototype.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},e.prototype.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal(`changeWrapMode`)}},e.prototype.getUseWrapMode=function(){return this.$useWrapMode},e.prototype.setWrapLimitRange=function(e,t){(this.$wrapLimitRange.min!==e||this.$wrapLimitRange.max!==t)&&(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal(`changeWrapMode`))},e.prototype.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var r=this.$constrainWrapLimit(e,n.min,n.max);return r!=this.$wrapLimit&&r>1?(this.$wrapLimit=r,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal(`changeWrapLimit`)),!0):!1},e.prototype.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},e.prototype.getWrapLimit=function(){return this.$wrapLimit},e.prototype.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},e.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},e.prototype.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,r=e.start,i=e.end,a=r.row,o=i.row,s=o-a,c=null;if(this.$updating=!0,s!=0)if(n===`remove`){this[t?`$wrapData`:`$rowLengthCache`].splice(a,s);var l=this.$foldData;c=this.getFoldsInRange(e),this.removeFolds(c);var u=this.getFoldLine(i.row),d=0;if(u){u.addRemoveChars(i.row,i.column,r.column-i.column),u.shiftRow(-s);var f=this.getFoldLine(a);f&&f!==u&&(f.merge(u),u=f),d=l.indexOf(u)+1}for(;d<l.length;d++){var u=l[d];u.start.row>=i.row&&u.shiftRow(-s)}o=a}else{var p=Array(s);p.unshift(a,0);var m=t?this.$wrapData:this.$rowLengthCache;m.splice.apply(m,p);var l=this.$foldData,u=this.getFoldLine(a),d=0;if(u){var h=u.range.compareInside(r.row,r.column);h==0?(u=u.split(r.row,r.column),u&&(u.shiftRow(s),u.addRemoveChars(o,0,i.column-r.column))):h==-1&&(u.addRemoveChars(a,0,i.column-r.column),u.shiftRow(s)),d=l.indexOf(u)+1}for(;d<l.length;d++){var u=l[d];u.start.row>=a&&u.shiftRow(s)}}else{s=Math.abs(e.start.column-e.end.column),n===`remove`&&(c=this.getFoldsInRange(e),this.removeFolds(c),s=-s);var u=this.getFoldLine(a);u&&u.addRemoveChars(a,r.column,s)}return t&&this.$wrapData.length!=this.doc.getLength()&&console.error(`doc.getLength() and $wrapData.length have to be the same!`),this.$updating=!1,t?this.$updateWrapData(a,o):this.$updateRowLengthCache(a,o),c},e.prototype.$updateRowLengthCache=function(e,t){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},e.prototype.$updateWrapData=function(e,t){var n=this.doc.getAllLines(),r=this.getTabSize(),i=this.$wrapData,a=this.$wrapLimit,o,s,c=e;for(t=Math.min(t,n.length-1);c<=t;)s=this.getFoldLine(c,s),s?(o=[],s.walk(function(e,t,r,i){var a;if(e!=null){a=this.$getDisplayTokens(e,o.length),a[0]=y;for(var s=1;s<a.length;s++)a[s]=b}else a=this.$getDisplayTokens(n[t].substring(i,r),o.length);o=o.concat(a)}.bind(this),s.end.row,n[s.end.row].length+1),i[s.start.row]=this.$computeWrapSplits(o,a,r),c=s.end.row+1):(o=this.$getDisplayTokens(n[c]),i[c]=this.$computeWrapSplits(o,a,r),c++)},e.prototype.$computeWrapSplits=function(e,t,n){if(e.length==0)return[];var r=[],i=e.length,a=0,o=0,s=this.$wrapAsCode,c=this.$indentedSoftWrap,l=t<=Math.max(2*n,8)||c===!1?0:Math.floor(t/2);function u(){var t=0;if(l===0)return t;if(c)for(var r=0;r<e.length;r++){var i=e[r];if(i==S)t+=1;else if(i==C)t+=n;else if(i==w)continue;else break}return s&&c!==!1&&(t+=n),Math.min(t,l)}function d(t){for(var n=t-a,i=a;i<t;i++){var s=e[i];(s===12||s===2)&&--n}r.length||(f=u(),r.indent=f),o+=n,r.push(o),a=t}for(var f=0;i-a>t-f;){var p=a+t-f;if(e[p-1]>=S&&e[p]>=S){d(p);continue}if(e[p]==y||e[p]==b){for(;p!=a-1&&e[p]!=y;p--);if(p>a){d(p);continue}for(p=a+t;p<e.length&&e[p]==b;p++);if(p==e.length)break;d(p);continue}for(var m=Math.max(p-(t-(t>>2)),a-1);p>m&&e[p]<y;)p--;if(s){for(;p>m&&e[p]<y;)p--;for(;p>m&&e[p]==x;)p--}else for(;p>m&&e[p]<S;)p--;if(p>m){d(++p);continue}p=a+t,e[p]==v&&p--,d(p-f)}return r},e.prototype.$getDisplayTokens=function(e,t){var n=[],r;t||=0;for(var i=0;i<e.length;i++){var a=e.charCodeAt(i);if(a==9){r=this.getScreenTabSize(n.length+t),n.push(C);for(var o=1;o<r;o++)n.push(w)}else a==32?n.push(S):a>39&&a<48||a>57&&a<64?n.push(x):a>=4352&&T(a)?n.push(_,v):n.push(_)}return n},e.prototype.$getStringScreenWidth=function(e,t,n){if(t==0)return[0,0];t??=1/0,n||=0;var r,i;for(i=0;i<e.length&&(r=e.charCodeAt(i),r==9?n+=this.getScreenTabSize(n):r>=4352&&T(r)?n+=2:n+=1,!(n>t));i++);return[n,i]},e.prototype.getRowLength=function(e){var t=1;return this.lineWidgets&&(t+=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0),!this.$useWrapMode||!this.$wrapData[e]?t:this.$wrapData[e].length+t},e.prototype.getRowLineCount=function(e){return!this.$useWrapMode||!this.$wrapData[e]?1:this.$wrapData[e].length+1},e.prototype.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]<t.column?n.indent:0}else return 0},e.prototype.getScreenLastRowColumn=function(e){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE);return this.documentToScreenColumn(t.row,t.column)},e.prototype.getDocumentLastRowColumn=function(e,t){var n=this.documentToScreenRow(e,t);return this.getScreenLastRowColumn(n)},e.prototype.getDocumentLastRowColumnPosition=function(e,t){var n=this.documentToScreenRow(e,t);return this.screenToDocumentPosition(n,Number.MAX_VALUE/10)},e.prototype.getRowSplitData=function(e){if(this.$useWrapMode)return this.$wrapData[e]},e.prototype.getScreenTabSize=function(e){return this.$tabSize-(e%this.$tabSize|0)},e.prototype.screenToDocumentRow=function(e,t){return this.screenToDocumentPosition(e,t).row},e.prototype.screenToDocumentColumn=function(e,t){return this.screenToDocumentPosition(e,t).column},e.prototype.screenToDocumentPosition=function(e,t,n){if(e<0)return{row:0,column:0};var r,i=0,a=0,o,s=0,c=0,l=this.$screenRowCache,u=this.$getRowCacheIndex(l,e),d=l.length;if(d&&u>=0)var s=l[u],i=this.$docRowCache[u],f=e>l[d-1];else var f=!d;for(var p=this.getLength()-1,m=this.getNextFoldLine(i),h=m?m.start.row:1/0;s<=e&&(c=this.getRowLength(i),!(s+c>e||i>=p));)s+=c,i++,i>h&&(i=m.end.row+1,m=this.getNextFoldLine(i,m),h=m?m.start.row:1/0),f&&(this.$docRowCache.push(i),this.$screenRowCache.push(s));if(m&&m.start.row<=i)r=this.getFoldDisplayLine(m),i=m.start.row;else if(s+c<=e||i>p)return{row:p,column:this.getLine(p).length};else r=this.getLine(i),m=null;var g=0,_=Math.floor(e-s);if(this.$useWrapMode){var v=this.$wrapData[i];v&&(o=v[_],_>0&&v.length&&(g=v.indent,a=v[_-1]||v[v.length-1],r=r.substring(a)))}return n!==void 0&&this.$bidiHandler.isBidiRow(s+_,i,_)&&(t=this.$bidiHandler.offsetToCol(n)),a+=this.$getStringScreenWidth(r,t-g)[1],this.$useWrapMode&&a>=o&&(a=o-1),m?m.idxToPosition(a):{row:i,column:a}},e.prototype.documentToScreenPosition=function(e,t){if(t===void 0)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var r=0,i=null,a=null;a=this.getFoldAt(e,t,1),a&&(e=a.start.row,t=a.start.column);var o,s=0,c=this.$docRowCache,l=this.$getRowCacheIndex(c,e),u=c.length;if(u&&l>=0)var s=c[l],r=this.$screenRowCache[l],d=e>c[u-1];else var d=!u;for(var f=this.getNextFoldLine(s),p=f?f.start.row:1/0;s<e;){if(s>=p){if(o=f.end.row+1,o>e)break;f=this.getNextFoldLine(o,f),p=f?f.start.row:1/0}else o=s+1;r+=this.getRowLength(s),s=o,d&&(this.$docRowCache.push(s),this.$screenRowCache.push(r))}var m=``;f&&s>=p?(m=this.getFoldDisplayLine(f,e,t),i=f.start.row):(m=this.getLine(e).substring(0,t),i=e);var h=0;if(this.$useWrapMode){var g=this.$wrapData[i];if(g){for(var _=0;m.length>=g[_];)r++,_++;m=m.substring(g[_-1]||0,m.length),h=_>0?g.indent:0}}return this.lineWidgets&&this.lineWidgets[s]&&this.lineWidgets[s].rowsAbove&&(r+=this.lineWidgets[s].rowsAbove),{row:r,column:h+this.$getStringScreenWidth(m)[0]}},e.prototype.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},e.prototype.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},e.prototype.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,r=0,i=0,t=this.$foldData[i++],a=t?t.start.row:1/0;r<n;){var o=this.$wrapData[r];e+=o?o.length+1:1,r++,r>a&&(r=t.end.row+1,t=this.$foldData[i++],a=t?t.start.row:1/0)}else{e=this.getLength();for(var s=this.$foldData,i=0;i<s.length;i++)t=s[i],e-=t.end.row-t.start.row}return this.lineWidgets&&(e+=this.$getWidgetScreenLength()),e},e.prototype.$setFontMetrics=function(e){this.$enableVarChar&&(this.$getStringScreenWidth=function(t,n,r){if(n===0)return[0,0];n||=1/0,r||=0;var i,a;for(a=0;a<t.length&&(i=t.charAt(a),i===`\t`?r+=this.getScreenTabSize(r):r+=e.getCharacterWidth(i),!(r>n));a++);return[r,a]})},e.prototype.getPrecedingCharacter=function(){var e=this.selection.getCursor();return e.column===0?e.row===0?``:this.doc.getNewLineCharacter():this.getLine(e.row)[e.column-1]},e.prototype.destroy=function(){this.destroyed||=(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),!0),this.endOperation(),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off(`change`,this.$onChange),this.selection&&(this.selection.off(`changeCursor`,this.$onSelectionChange),this.selection.off(`changeSelection`,this.$onSelectionChange)),this.selection.detach()},e}();g.$uid=0,g.prototype.$modes=o.$modes,g.prototype.getValue=g.prototype.toString,g.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},g.prototype.$overwrite=!1,g.prototype.$mode=null,g.prototype.$modeId=null,g.prototype.$scrollTop=0,g.prototype.$scrollLeft=0,g.prototype.$wrapLimit=80,g.prototype.$useWrapMode=!1,g.prototype.$wrapLimitRange={min:null,max:null},g.prototype.lineWidgets=null,g.prototype.isFullWidth=T,r.implement(g.prototype,s);var _=1,v=2,y=3,b=4,x=9,S=10,C=11,w=12;function T(e){return e<4352?!1:e>=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510}e(\"./edit_session/folding\").Folding.call(g.prototype),e(\"./edit_session/bracket_match\").BracketMatch.call(g.prototype),o.defineOptions(g.prototype,`session`,{wrap:{set:function(e){if(!e||e==`off`?e=!1:e==`free`?e=!0:e==`printMargin`?e=-1:typeof e==`string`&&(e=parseInt(e,10)||!1),this.$wrap!=e)if(this.$wrap=e,!e)this.setUseWrapMode(!1);else{var t=typeof e==`number`?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?`printMargin`:this.getWrapLimitRange().min?this.$wrap:`free`:`off`},handlesSet:!0},wrapMethod:{set:function(e){e=e==`auto`?this.$mode.type!=`text`:e!=`text`,e!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:`auto`},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal(`changeBreakpoint`)},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){e=parseInt(e),e>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal(`changeTabSize`))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal(`changeOverwrite`)},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=g}),ace.define(`ace/search`,[`require`,`exports`,`module`,`ace/lib/lang`,`ace/lib/oop`,`ace/range`],function(e,t,n){var r=e(\"./lib/lang\"),i=e(\"./lib/oop\"),a=e(\"./range\").Range,o=function(){function e(){this.$options={}}return e.prototype.set=function(e){return i.mixin(this.$options,e),this},e.prototype.getOptions=function(){return r.copyObject(this.$options)},e.prototype.setOptions=function(e){this.$options=e},e.prototype.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var r=null;return n.forEach(function(e,n,i,o){return r=new a(e,n,i,o),n==o&&t.start&&t.start.start&&t.skipCurrent!=0&&r.isEqual(t.start)?(r=null,!1):!0}),r},e.prototype.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,i=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),o=[],s=t.re;if(t.$isMultiLine){var c=s.length,l=i.length-c,u;outer:for(var d=s.offset||0;d<=l;d++){for(var f=0;f<c;f++)if(i[d+f].search(s[f])==-1)continue outer;var p=i[d],m=i[d+c-1],h=p.length-p.match(s[0])[0].length,g=m.match(s[c-1])[0].length;u&&u.end.row===d&&u.end.column>h||(o.push(u=new a(d,h,d+c-1,g)),c>2&&(d=d+c-2))}}else for(var _,v=0;v<i.length;v++)if(this.$isMultilineSearch(t)){var y=i.length-1;if(_=this.$multiLineForward(e,s,v,y),_){var b=_.endRow<=y?_.endRow-1:y;b>v&&(v=b),o.push(new a(_.startRow,_.startCol,_.endRow,_.endCol))}}else{_=r.getMatchOffsets(i[v],s);for(var f=0;f<_.length;f++){var x=_[f];o.push(new a(v,x.offset,v,x.offset+x.length))}}if(n){for(var S=n.start.column,C=n.end.column,v=0,f=o.length-1;v<f&&o[v].start.column<S&&o[v].start.row==0;)v++;for(var w=n.end.row-n.start.row;v<f&&o[f].end.column>C&&o[f].end.row==w;)f--;for(o=o.slice(v,f+1),v=0,f=o.length;v<f;v++)o[v].start.row+=n.start.row,o[v].end.row+=n.start.row}return o},e.prototype.parseReplaceString=function(e){for(var t={DollarSign:36,Ampersand:38,Digit0:48,Digit1:49,Digit9:57,Backslash:92,n:110,t:116},n=``,r=0,i=e.length;r<i;r++){var a=e.charCodeAt(r);if(a===t.Backslash){if(r++,r>=i){n+=`\\\\`;break}switch(e.charCodeAt(r)){case t.Backslash:n+=`\\\\`;break;case t.n:n+=`\n`;break;case t.t:n+=`\t`;break}continue}if(a===t.DollarSign){if(r++,r>=i){n+=`$`;break}var o=e.charCodeAt(r);if(o===t.DollarSign){n+=`$$`;continue}if(o===t.Digit0||o===t.Ampersand){n+=`$&`;continue}if(t.Digit1<=o&&o<=t.Digit9){n+=`$`+e[r];continue}}n+=e[r]}return n||e},e.prototype.replace=function(e,t){var n=this.$options,r=this.$assembleRegExp(n);if(n.$isMultiLine)return t;if(r){var i=this.$isMultilineSearch(n);i&&(e=e.replace(/\\r\\n|\\r|\\n/g,`\n`));var a=r.exec(e);if(!a||!i&&a[0].length!=e.length)return null;if(t=n.regExp?this.parseReplaceString(t):t.replace(/\\$/g,`$$$$`),t=e.replace(r,t),n.preserveCase){t=t.split(``);for(var o=Math.min(e.length,e.length);o--;){var s=e[o];s&&s.toLowerCase()!=s?t[o]=t[o].toUpperCase():t[o]=t[o].toLowerCase()}t=t.join(``)}return t}},e.prototype.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var n=e.needle;if(!e.needle)return e.re=!1;e.regExp||(n=r.escapeRegExp(n));var i=e.caseSensitive?`gm`:`gmi`;try{new RegExp(n,`u`),e.$supportsUnicodeFlag=!0,i+=`u`}catch{e.$supportsUnicodeFlag=!1}if(e.wholeWord&&(n=s(n,e)),e.$isMultiLine=!t&&/[\\n\\r]/.test(n),e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(n,i);try{var a=new RegExp(n,i)}catch{a=!1}return e.re=a},e.prototype.$assembleMultilineRegExp=function(e,t){for(var n=e.replace(/\\r\\n|\\r|\\n/g,`$\n^`).split(`\n`),r=[],i=0;i<n.length;i++)try{r.push(new RegExp(n[i],t))}catch{return!1}return r},e.prototype.$isMultilineSearch=function(e){return e.re&&/\\\\r\\\\n|\\\\r|\\\\n/.test(e.re.source)&&e.regExp&&!e.$isMultiLine},e.prototype.$multiLineForward=function(e,t,n,r){for(var i,a=l(e,n),o=n;o<=r;){for(var s=0;s<a&&!(o>r);s++){var c=e.getLine(o++);i=i==null?c:i+`\n`+c}var u=t.exec(i);if(t.lastIndex=0,u){var d=i.slice(0,u.index).split(`\n`),f=u[0].split(`\n`),p=n+d.length-1,m=d[d.length-1].length;return{startRow:p,startCol:m,endRow:p+f.length-1,endCol:f.length==1?m+f[0].length:f[f.length-1].length}}}return null},e.prototype.$multiLineBackward=function(e,t,n,r,i){for(var a,o=l(e,r),s=e.getLine(r).length-n,u=r;u>=i;){for(var d=0;d<o&&u>=i;d++){var f=e.getLine(u--);a=a==null?f:f+`\n`+a}var p=c(a,t,s);if(p){var m=a.slice(0,p.index).split(`\n`),h=p[0].split(`\n`),g=u+m.length,_=m[m.length-1].length;return{startRow:g,startCol:_,endRow:g+h.length-1,endCol:h.length==1?_+h[0].length:h[h.length-1].length}}}return null},e.prototype.$matchIterator=function(e,t){var n=this.$assembleRegExp(t);if(!n)return!1;var i=this.$isMultilineSearch(t),a=this.$multiLineForward,o=this.$multiLineBackward,s=t.backwards==1,c=t.skipCurrent!=0,l=n.unicode,u=t.range,d=t.start;d||=u?u[s?`end`:`start`]:e.selection.getRange(),d.start&&(d=d[c==s?`start`:`end`]);var f=u?u.start.row:0,p=u?u.end.row:e.getLength()-1;if(s)var m=function(e){var n=d.row;if(!g(n,d.column,e)){for(n--;n>=f;n--)if(g(n,Number.MAX_VALUE,e))return;if(t.wrap!=0){for(n=p,f=d.row;n>=f;n--)if(g(n,Number.MAX_VALUE,e))return}}};else var m=function(e){var n=d.row;if(!g(n,d.column,e)){for(n+=1;n<=p;n++)if(g(n,0,e))return;if(t.wrap!=0){for(n=f,p=d.row;n<=p;n++)if(g(n,0,e))return}}};if(t.$isMultiLine)var h=n.length,g=function(t,r,i){var a=s?t-h+1:t;if(!(a<0||a+h>e.getLength())){var o=e.getLine(a),c=o.search(n[0]);if(!(!s&&c<r||c===-1)){for(var l=1;l<h;l++)if(o=e.getLine(a+l),o.search(n[l])==-1)return;var u=o.match(n[h-1])[0].length;if(!(s&&u>r)&&i(a,c,a+h-1,u))return!0}}};else if(s)var g=function(t,a,s){if(i){var c=o(e,n,a,t,f);if(!c)return!1;if(s(c.startRow,c.startCol,c.endRow,c.endCol))return!0}else{var u=e.getLine(t),d=[],p,m=0;for(n.lastIndex=0;p=n.exec(u);){var h=p[0].length;if(m=p.index,!h){if(m>=u.length)break;n.lastIndex=m+=r.skipEmptyMatch(u,m,l)}if(p.index+h>a)break;d.push(p.index,h)}for(var g=d.length-1;g>=0;g-=2){var _=d[g-1],h=d[g];if(s(t,_,t,_+h))return!0}}};else var g=function(t,o,s){if(n.lastIndex=o,i){var c=a(e,n,t,p);if(c){var u=c.endRow<=p?c.endRow-1:p;u>t&&(t=u)}if(!c)return!1;if(s(c.startRow,c.startCol,c.endRow,c.endCol))return!0}else for(var d=e.getLine(t),f,m;m=n.exec(d);){var h=m[0].length;if(f=m.index,s(t,f,t,f+h))return!0;if(!h&&(n.lastIndex=f+=r.skipEmptyMatch(d,f,l),f>=d.length))return!1}};return{forEach:m}},e}();function s(e,t){var n=r.supportsLookbehind();function i(e,r){return r===void 0&&(r=!0),(n&&t.$supportsUnicodeFlag?RegExp(`[\\\\p{L}\\\\p{N}_]`,`u`):RegExp(`\\\\w`)).test(e)||t.regExp?n&&t.$supportsUnicodeFlag?r?`(?<=^|[^\\\\p{L}\\\\p{N}_])`:`(?=[^\\\\p{L}\\\\p{N}_]|$)`:`\\\\b`:``}var a=Array.from(e),o=a[0],s=a[a.length-1];return i(o)+e+i(s,!1)}function c(e,t,n){for(var r=null,i=0;i<=e.length;){t.lastIndex=i;var a=t.exec(e);if(!a)break;var o=a.index+a[0].length;if(o>e.length-n)break;(!r||o>r.index+r[0].length)&&(r=a),i=a.index+1}return r}function l(e,t){var n=5e3,r={row:t,column:0},i=e.doc.positionToIndex(r)+n;return e.doc.indexToPosition(i).row+1}t.Search=o}),ace.define(`ace/keyboard/hash_handler`,[`require`,`exports`,`module`,`ace/lib/keys`,`ace/lib/useragent`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=e(\"../lib/keys\"),a=e(\"../lib/useragent\"),o=i.KEY_MODS,s=function(){function e(e,t){this.$init(e,t,!1)}return e.prototype.$init=function(e,t,n){this.platform=t||(a.isMac?`mac`:`win`),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=n},e.prototype.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},e.prototype.removeCommand=function(e,t){var n=e&&(typeof e==`string`?e:e.name);e=this.commands[n],t||delete this.commands[n];var r=this.commandKeyBinding;for(var i in r){var a=r[i];if(a==e)delete r[i];else if(Array.isArray(a)){var o=a.indexOf(e);o!=-1&&(a.splice(o,1),a.length==1&&(r[i]=a[0]))}}},e.prototype.bindKey=function(e,t,n){if(typeof e==`object`&&e&&(n??=e.position,e=e[this.platform]),e){if(typeof t==`function`)return this.addCommand({exec:t,bindKey:e,name:t.name||e});e.split(`|`).forEach(function(e){var r=``;if(e.indexOf(` `)!=-1){var i=e.split(/\\s+/);e=i.pop(),i.forEach(function(e){var t=this.parseKeys(e),n=o[t.hashId]+t.key;r+=(r?` `:``)+n,this._addCommandToBinding(r,`chainKeys`)},this),r+=` `}var a=this.parseKeys(e),s=o[a.hashId]+a.key;this._addCommandToBinding(r+s,t,n)},this)}},e.prototype._addCommandToBinding=function(e,t,n){var r=this.commandKeyBinding,i;if(!t)delete r[e];else if(!r[e]||this.$singleCommand)r[e]=t;else{Array.isArray(r[e])?(i=r[e].indexOf(t))!=-1&&r[e].splice(i,1):r[e]=[r[e]],typeof n!=`number`&&(n=c(t));var a=r[e];for(i=0;i<a.length;i++){var o=a[i];if(c(o)>n)break}a.splice(i,0,t)}},e.prototype.addCommands=function(e){e&&Object.keys(e).forEach(function(t){var n=e[t];if(n){if(typeof n==`string`)return this.bindKey(n,t);typeof n==`function`&&(n={exec:n}),typeof n==`object`&&(n.name||=t,this.addCommand(n))}},this)},e.prototype.removeCommands=function(e){Object.keys(e).forEach(function(t){this.removeCommand(e[t])},this)},e.prototype.bindKeys=function(e){Object.keys(e).forEach(function(t){this.bindKey(t,e[t])},this)},e.prototype._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},e.prototype.parseKeys=function(e){var t=e.toLowerCase().split(/[\\-\\+]([\\-\\+])?/).filter(function(e){return e}),n=t.pop(),r=i[n];if(i.FUNCTION_KEYS[r])n=i.FUNCTION_KEYS[r].toLowerCase();else if(!t.length)return{key:n,hashId:-1};else if(t.length==1&&t[0]==`shift`)return{key:n.toUpperCase(),hashId:-1};for(var a=0,o=t.length;o--;){var s=i.KEY_MODS[t[o]];if(s==null)return typeof console<`u`&&console.error(`invalid modifier `+t[o]+` in `+e),!1;a|=s}return{key:n,hashId:a}},e.prototype.findKeyCommand=function(e,t){var n=o[e]+t;return this.commandKeyBinding[n]},e.prototype.handleKeyboard=function(e,t,n,r){if(!(r<0)){var i=o[t]+n,a=this.commandKeyBinding[i];return e.$keyChain&&(e.$keyChain+=` `+i,a=this.commandKeyBinding[e.$keyChain]||a),a&&(a==`chainKeys`||a[a.length-1]==`chainKeys`)?(e.$keyChain=e.$keyChain||i,{command:`null`}):(e.$keyChain&&((!t||t==4)&&n.length==1?e.$keyChain=e.$keyChain.slice(0,-i.length-1):(t==-1||r>0)&&(e.$keyChain=``)),{command:a})}},e.prototype.getStatusText=function(e,t){return t.$keyChain||``},e}();function c(e){return typeof e==`object`&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}var l=function(e){r(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.$singleCommand=!0,r}return t}(s);l.call=function(e,t,n){s.prototype.$init.call(e,t,n,!0)},s.call=function(e,t,n){s.prototype.$init.call(e,t,n,!1)},t.HashHandler=l,t.MultiHashHandler=s}),ace.define(`ace/commands/command_manager`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/keyboard/hash_handler`,`ace/lib/event_emitter`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=e(\"../lib/oop\"),a=e(\"../keyboard/hash_handler\").MultiHashHandler,o=e(\"../lib/event_emitter\").EventEmitter,s=function(e){r(t,e);function t(t,n){var r=e.call(this,n,t)||this;return r.byName=r.commands,r.setDefaultHandler(`exec`,function(e){return e.args?e.command.exec(e.editor,e.args,e.event,!1):e.command.exec(e.editor,{},e.event,!0)}),r}return t.prototype.exec=function(e,t,n){if(Array.isArray(e)){for(var r=e.length;r--;)if(this.exec(e[r],t,n))return!0;return!1}typeof e==`string`&&(e=this.commands[e]);var i={editor:t,command:e,args:n};return this.canExecute(e,t)?(i.returnValue=this._emit(`exec`,i),this._signal(`afterExec`,i),i.returnValue!==!1):(this._signal(`commandUnavailable`,i),!1)},t.prototype.canExecute=function(e,t){return typeof e==`string`&&(e=this.commands[e]),!(!e||t&&t.$readOnly&&!e.readOnly||this.$checkCommandState!=0&&e.isAvailable&&!e.isAvailable(t))},t.prototype.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit(`changeStatus`),this.recording?(this.macro.pop(),this.off(`exec`,this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||=function(e){this.macro.push([e.command,e.args])}.bind(this),this.oldMacro=this.macro,this.macro=[],this.on(`exec`,this.$addCommandToMacro),this.recording=!0)},t.prototype.replay=function(e){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach(function(t){typeof t==`string`?this.exec(t,e):this.exec(t[0],e,t[1])},this)}finally{this.$inReplay=!1}}},t.prototype.trimMacro=function(e){return e.map(function(e){return typeof e[0]!=`string`&&(e[0]=e[0].name),e[1]||(e=e[0]),e})},t}(a);i.implement(s.prototype,o),t.CommandManager=s}),ace.define(`ace/commands/default_commands`,[`require`,`exports`,`module`,`ace/lib/lang`,`ace/config`,`ace/range`],function(e,t,n){var r=e(\"../lib/lang\"),i=e(\"../config\"),a=e(\"../range\").Range;function o(e,t){return{win:e,mac:t}}t.commands=[{name:`showSettingsMenu`,description:`Show settings menu`,bindKey:o(`Ctrl-,`,`Command-,`),exec:function(e){i.loadModule(`ace/ext/settings_menu`,function(t){t.init(e),e.showSettingsMenu()})},readOnly:!0},{name:`goToNextError`,description:`Go to next error`,bindKey:o(`Alt-E`,`F4`),exec:function(e){i.loadModule(`ace/ext/error_marker`,function(t){t.showErrorMarker(e,1)})},scrollIntoView:`animate`,readOnly:!0},{name:`goToPreviousError`,description:`Go to previous error`,bindKey:o(`Alt-Shift-E`,`Shift-F4`),exec:function(e){i.loadModule(`ace/ext/error_marker`,function(t){t.showErrorMarker(e,-1)})},scrollIntoView:`animate`,readOnly:!0},{name:`selectall`,description:`Select all`,bindKey:o(`Ctrl-A`,`Command-A`),exec:function(e){e.selectAll()},readOnly:!0},{name:`centerselection`,description:`Center selection`,bindKey:o(null,`Ctrl-L`),exec:function(e){e.centerSelection()},readOnly:!0},{name:`gotoline`,description:`Go to line...`,bindKey:o(`Ctrl-L`,`Command-L`),exec:function(e,t){typeof t==`number`&&!isNaN(t)&&e.gotoLine(t),e.prompt({$type:`gotoLine`})},readOnly:!0},{name:`fold`,bindKey:o(`Alt-L|Ctrl-F1`,`Command-Alt-L|Command-F1`),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:`forEach`,scrollIntoView:`center`,readOnly:!0},{name:`unfold`,bindKey:o(`Alt-Shift-L|Ctrl-Shift-F1`,`Command-Alt-Shift-L|Command-Shift-F1`),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:`forEach`,scrollIntoView:`center`,readOnly:!0},{name:`toggleFoldWidget`,description:`Toggle fold widget`,bindKey:o(`F2`,`F2`),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:`forEach`,scrollIntoView:`center`,readOnly:!0},{name:`toggleParentFoldWidget`,description:`Toggle parent fold widget`,bindKey:o(`Alt-F2`,`Alt-F2`),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:`forEach`,scrollIntoView:`center`,readOnly:!0},{name:`foldall`,description:`Fold all`,bindKey:o(null,`Ctrl-Command-Option-0`),exec:function(e){e.session.foldAll()},scrollIntoView:`center`,readOnly:!0},{name:`foldAllComments`,description:`Fold all comments`,bindKey:o(null,`Ctrl-Command-Option-0`),exec:function(e){e.session.foldAllComments()},scrollIntoView:`center`,readOnly:!0},{name:`foldOther`,description:`Fold other`,bindKey:o(`Alt-0`,`Command-Option-0`),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:`center`,readOnly:!0},{name:`unfoldall`,description:`Unfold all`,bindKey:o(`Alt-Shift-0`,`Command-Option-Shift-0`),exec:function(e){e.session.unfold()},scrollIntoView:`center`,readOnly:!0},{name:`findnext`,description:`Find next`,bindKey:o(`Ctrl-K`,`Command-G`),exec:function(e){e.findNext()},multiSelectAction:`forEach`,scrollIntoView:`center`,readOnly:!0},{name:`findprevious`,description:`Find previous`,bindKey:o(`Ctrl-Shift-K`,`Command-Shift-G`),exec:function(e){e.findPrevious()},multiSelectAction:`forEach`,scrollIntoView:`center`,readOnly:!0},{name:`selectOrFindNext`,description:`Select or find next`,bindKey:o(`Alt-K`,`Ctrl-G`),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:`selectOrFindPrevious`,description:`Select or find previous`,bindKey:o(`Alt-Shift-K`,`Ctrl-Shift-G`),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:`find`,description:`Find`,bindKey:o(`Ctrl-F`,`Command-F`),exec:function(e){i.loadModule(`ace/ext/searchbox`,function(t){t.Search(e)})},readOnly:!0},{name:`overwrite`,description:`Overwrite`,bindKey:`Insert`,exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:`selecttostart`,description:`Select to start`,bindKey:o(`Ctrl-Shift-Home`,`Command-Shift-Home|Command-Shift-Up`),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:`forEach`,readOnly:!0,scrollIntoView:`animate`,aceCommandGroup:`fileJump`},{name:`gotostart`,description:`Go to start`,bindKey:o(`Ctrl-Home`,`Command-Home|Command-Up`),exec:function(e){e.navigateFileStart()},multiSelectAction:`forEach`,readOnly:!0,scrollIntoView:`animate`,aceCommandGroup:`fileJump`},{name:`selectup`,description:`Select up`,bindKey:o(`Shift-Up`,`Shift-Up|Ctrl-Shift-P`),exec:function(e){e.getSelection().selectUp()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`golineup`,description:`Go line up`,bindKey:o(`Up`,`Up|Ctrl-P`),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selecttoend`,description:`Select to end`,bindKey:o(`Ctrl-Shift-End`,`Command-Shift-End|Command-Shift-Down`),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:`forEach`,readOnly:!0,scrollIntoView:`animate`,aceCommandGroup:`fileJump`},{name:`gotoend`,description:`Go to end`,bindKey:o(`Ctrl-End`,`Command-End|Command-Down`),exec:function(e){e.navigateFileEnd()},multiSelectAction:`forEach`,readOnly:!0,scrollIntoView:`animate`,aceCommandGroup:`fileJump`},{name:`selectdown`,description:`Select down`,bindKey:o(`Shift-Down`,`Shift-Down|Ctrl-Shift-N`),exec:function(e){e.getSelection().selectDown()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`golinedown`,description:`Go line down`,bindKey:o(`Down`,`Down|Ctrl-N`),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selectwordleft`,description:`Select word left`,bindKey:o(`Ctrl-Shift-Left`,`Option-Shift-Left`),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`gotowordleft`,description:`Go to word left`,bindKey:o(`Ctrl-Left`,`Option-Left`),exec:function(e){e.navigateWordLeft()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selecttolinestart`,description:`Select to line start`,bindKey:o(`Alt-Shift-Left`,`Command-Shift-Left|Ctrl-Shift-A`),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`gotolinestart`,description:`Go to line start`,bindKey:o(`Alt-Left|Home`,`Command-Left|Home|Ctrl-A`),exec:function(e){e.navigateLineStart()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selectleft`,description:`Select left`,bindKey:o(`Shift-Left`,`Shift-Left|Ctrl-Shift-B`),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`gotoleft`,description:`Go to left`,bindKey:o(`Left`,`Left|Ctrl-B`),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selectwordright`,description:`Select word right`,bindKey:o(`Ctrl-Shift-Right`,`Option-Shift-Right`),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`gotowordright`,description:`Go to word right`,bindKey:o(`Ctrl-Right`,`Option-Right`),exec:function(e){e.navigateWordRight()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selecttolineend`,description:`Select to line end`,bindKey:o(`Alt-Shift-Right`,`Command-Shift-Right|Shift-End|Ctrl-Shift-E`),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`gotolineend`,description:`Go to line end`,bindKey:o(`Alt-Right|End`,`Command-Right|End|Ctrl-E`),exec:function(e){e.navigateLineEnd()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selectright`,description:`Select right`,bindKey:o(`Shift-Right`,`Shift-Right`),exec:function(e){e.getSelection().selectRight()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`gotoright`,description:`Go to right`,bindKey:o(`Right`,`Right|Ctrl-F`),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selectpagedown`,description:`Select page down`,bindKey:`Shift-PageDown`,exec:function(e){e.selectPageDown()},readOnly:!0},{name:`pagedown`,description:`Page down`,bindKey:o(null,`Option-PageDown`),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:`gotopagedown`,description:`Go to page down`,bindKey:o(`PageDown`,`PageDown|Ctrl-V`),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:`selectpageup`,description:`Select page up`,bindKey:`Shift-PageUp`,exec:function(e){e.selectPageUp()},readOnly:!0},{name:`pageup`,description:`Page up`,bindKey:o(null,`Option-PageUp`),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:`gotopageup`,description:`Go to page up`,bindKey:`PageUp`,exec:function(e){e.gotoPageUp()},readOnly:!0},{name:`scrollup`,description:`Scroll up`,bindKey:o(`Ctrl-Up`,null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:`scrolldown`,description:`Scroll down`,bindKey:o(`Ctrl-Down`,null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:`selectlinestart`,description:`Select line start`,bindKey:`Shift-Home`,exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`selectlineend`,description:`Select line end`,bindKey:`Shift-End`,exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`togglerecording`,description:`Toggle recording`,bindKey:o(`Ctrl-Alt-E`,`Command-Option-E`),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:`replaymacro`,description:`Replay macro`,bindKey:o(`Ctrl-Shift-E`,`Command-Shift-E`),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:`jumptomatching`,description:`Jump to matching`,bindKey:o(`Ctrl-\\\\|Ctrl-P`,`Command-\\\\`),exec:function(e){e.jumpToMatching()},multiSelectAction:`forEach`,scrollIntoView:`animate`,readOnly:!0},{name:`selecttomatching`,description:`Select to matching`,bindKey:o(`Ctrl-Shift-\\\\|Ctrl-Shift-P`,`Command-Shift-\\\\`),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:`forEach`,scrollIntoView:`animate`,readOnly:!0},{name:`expandToMatching`,description:`Expand to matching`,bindKey:o(`Ctrl-Shift-M`,`Ctrl-Shift-M`),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:`forEach`,scrollIntoView:`animate`,readOnly:!0},{name:`passKeysToBrowser`,description:`Pass keys to browser`,bindKey:o(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:`copy`,description:`Copy`,exec:function(e){},readOnly:!0},{name:`cut`,description:`Cut`,exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit(`cut`,t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:`cursor`,multiSelectAction:`forEach`},{name:`paste`,description:`Paste`,exec:function(e,t){e.$handlePaste(t)},scrollIntoView:`cursor`},{name:`removeline`,description:`Remove line`,bindKey:o(`Ctrl-D`,`Command-D`),exec:function(e){e.removeLines()},scrollIntoView:`cursor`,multiSelectAction:`forEachLine`},{name:`duplicateSelection`,description:`Duplicate selection`,bindKey:o(`Ctrl-Shift-D`,`Command-Shift-D`),exec:function(e){e.duplicateSelection()},scrollIntoView:`cursor`,multiSelectAction:`forEach`},{name:`sortlines`,description:`Sort lines`,bindKey:o(`Ctrl-Alt-S`,`Command-Alt-S`),exec:function(e){e.sortLines()},scrollIntoView:`selection`,multiSelectAction:`forEachLine`},{name:`togglecomment`,description:`Toggle comment`,bindKey:o(`Ctrl-/`,`Command-/`),exec:function(e){e.toggleCommentLines()},multiSelectAction:`forEachLine`,scrollIntoView:`selectionPart`},{name:`toggleBlockComment`,description:`Toggle block comment`,bindKey:o(`Ctrl-Shift-/`,`Command-Shift-/`),exec:function(e){e.toggleBlockComment()},multiSelectAction:`forEach`,scrollIntoView:`selectionPart`},{name:`modifyNumberUp`,description:`Modify number up`,bindKey:o(`Ctrl-Shift-Up`,`Alt-Shift-Up`),exec:function(e){e.modifyNumber(1)},scrollIntoView:`cursor`,multiSelectAction:`forEach`},{name:`modifyNumberDown`,description:`Modify number down`,bindKey:o(`Ctrl-Shift-Down`,`Alt-Shift-Down`),exec:function(e){e.modifyNumber(-1)},scrollIntoView:`cursor`,multiSelectAction:`forEach`},{name:`replace`,description:`Replace`,bindKey:o(`Ctrl-H`,`Command-Option-F`),exec:function(e){i.loadModule(`ace/ext/searchbox`,function(t){t.Search(e,!0)})}},{name:`undo`,description:`Undo`,bindKey:o(`Ctrl-Z`,`Command-Z`),exec:function(e){e.undo()}},{name:`redo`,description:`Redo`,bindKey:o(`Ctrl-Shift-Z|Ctrl-Y`,`Command-Shift-Z|Command-Y`),exec:function(e){e.redo()}},{name:`copylinesup`,description:`Copy lines up`,bindKey:o(`Alt-Shift-Up`,`Command-Option-Up`),exec:function(e){e.copyLinesUp()},scrollIntoView:`cursor`},{name:`movelinesup`,description:`Move lines up`,bindKey:o(`Alt-Up`,`Option-Up`),exec:function(e){e.moveLinesUp()},scrollIntoView:`cursor`},{name:`copylinesdown`,description:`Copy lines down`,bindKey:o(`Alt-Shift-Down`,`Command-Option-Down`),exec:function(e){e.copyLinesDown()},scrollIntoView:`cursor`},{name:`movelinesdown`,description:`Move lines down`,bindKey:o(`Alt-Down`,`Option-Down`),exec:function(e){e.moveLinesDown()},scrollIntoView:`cursor`},{name:`del`,description:`Delete`,bindKey:o(`Delete`,`Delete|Ctrl-D|Shift-Delete`),exec:function(e){e.remove(`right`)},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`backspace`,description:`Backspace`,bindKey:o(`Shift-Backspace|Backspace`,`Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H`),exec:function(e){e.remove(`left`)},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`cut_or_delete`,description:`Cut or delete`,bindKey:o(`Shift-Delete`,null),exec:function(e){if(e.selection.isEmpty())e.remove(`left`);else return!1},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`removetolinestart`,description:`Remove to line start`,bindKey:o(`Alt-Backspace`,`Command-Backspace`),exec:function(e){e.removeToLineStart()},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`removetolineend`,description:`Remove to line end`,bindKey:o(`Alt-Delete`,`Ctrl-K|Command-Delete`),exec:function(e){e.removeToLineEnd()},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`removetolinestarthard`,description:`Remove to line start hard`,bindKey:o(`Ctrl-Shift-Backspace`,null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`removetolineendhard`,description:`Remove to line end hard`,bindKey:o(`Ctrl-Shift-Delete`,null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`removewordleft`,description:`Remove word left`,bindKey:o(`Ctrl-Backspace`,`Alt-Backspace|Ctrl-Alt-Backspace`),exec:function(e){e.removeWordLeft()},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`removewordright`,description:`Remove word right`,bindKey:o(`Ctrl-Delete`,`Alt-Delete`),exec:function(e){e.removeWordRight()},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`outdent`,description:`Outdent`,bindKey:o(`Shift-Tab`,`Shift-Tab`),exec:function(e){e.blockOutdent()},multiSelectAction:`forEach`,scrollIntoView:`selectionPart`},{name:`indent`,description:`Indent`,bindKey:o(`Tab`,`Tab`),exec:function(e){e.indent()},multiSelectAction:`forEach`,scrollIntoView:`selectionPart`},{name:`blockoutdent`,description:`Block outdent`,bindKey:o(`Ctrl-[`,`Ctrl-[`),exec:function(e){e.blockOutdent()},multiSelectAction:`forEachLine`,scrollIntoView:`selectionPart`},{name:`blockindent`,description:`Block indent`,bindKey:o(`Ctrl-]`,`Ctrl-]`),exec:function(e){e.blockIndent()},multiSelectAction:`forEachLine`,scrollIntoView:`selectionPart`},{name:`insertstring`,description:`Insert string`,exec:function(e,t){e.insert(t)},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`inserttext`,description:`Insert text`,exec:function(e,t){e.insert(r.stringRepeat(t.text||``,t.times||1))},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`splitline`,description:`Split line`,bindKey:o(null,`Ctrl-O`),exec:function(e){e.splitLine()},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`transposeletters`,description:`Transpose letters`,bindKey:o(`Alt-Shift-X`,`Ctrl-T`),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:`cursor`},{name:`touppercase`,description:`To uppercase`,bindKey:o(`Ctrl-U`,`Ctrl-U`),exec:function(e){e.toUpperCase()},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`tolowercase`,description:`To lowercase`,bindKey:o(`Ctrl-Shift-U`,`Ctrl-Shift-U`),exec:function(e){e.toLowerCase()},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`autoindent`,description:`Auto Indent`,bindKey:o(null,null),exec:function(e){e.autoIndent()},scrollIntoView:`animate`},{name:`expandtoline`,description:`Expand to line`,bindKey:o(`Ctrl-Shift-L`,`Command-Shift-L`),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:`forEach`,scrollIntoView:`cursor`,readOnly:!0},{name:`openlink`,bindKey:o(`Ctrl+F3`,`F3`),exec:function(e){e.openLink()}},{name:`joinlines`,description:`Join lines`,bindKey:o(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),o=e.session.doc.getLine(n.row).length,s=e.session.doc.getTextRange(e.selection.getRange()).replace(/\\n\\s*/,` `).length,c=e.session.doc.getLine(n.row),l=n.row+1;l<=i.row+1;l++){var u=r.stringTrimLeft(r.stringTrimRight(e.session.doc.getLine(l)));u.length!==0&&(u=` `+u),c+=u}i.row+1<e.session.doc.getLength()-1&&(c+=e.session.doc.getNewLineCharacter()),e.clearSelection(),e.session.doc.replace(new a(n.row,0,i.row+2,0),c),s>0?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+s)):(o=e.session.doc.getLine(n.row).length>o?o+1:o,e.selection.moveCursorTo(n.row,o))},multiSelectAction:`forEach`,readOnly:!0},{name:`invertSelection`,description:`Invert selection`,bindKey:o(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,r=e.selection.rangeList.ranges,i=[];r.length<1&&(r=[e.selection.getRange()]);for(var o=0;o<r.length;o++)o==r.length-1&&(r[o].end.row===t&&r[o].end.column===n||i.push(new a(r[o].end.row,r[o].end.column,t,n))),o===0?r[o].start.row===0&&r[o].start.column===0||i.push(new a(0,0,r[o].start.row,r[o].start.column)):i.push(new a(r[o-1].end.row,r[o-1].end.column,r[o].start.row,r[o].start.column));e.exitMultiSelectMode(),e.clearSelection();for(var o=0;o<i.length;o++)e.selection.addRange(i[o],!1)},readOnly:!0,scrollIntoView:`none`},{name:`addLineAfter`,description:`Add new line after the current line`,exec:function(e){e.selection.clearSelection(),e.navigateLineEnd(),e.insert(`\n`)},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`addLineBefore`,description:`Add new line before the current line`,exec:function(e){e.selection.clearSelection();var t=e.getCursorPosition();e.selection.moveTo(t.row-1,Number.MAX_VALUE),e.insert(`\n`),t.row===0&&e.navigateUp()},multiSelectAction:`forEach`,scrollIntoView:`cursor`},{name:`openCommandPallete`,exec:function(e){console.warn(\"This is an obsolete command. Please use `openCommandPalette` instead.\"),e.prompt({$type:`commands`})},readOnly:!0},{name:`openCommandPalette`,description:`Open command palette`,bindKey:o(`F1`,`F1`),exec:function(e){e.prompt({$type:`commands`})},readOnly:!0},{name:`modeSelect`,description:`Change language mode...`,bindKey:o(null,null),exec:function(e){e.prompt({$type:`modes`})},readOnly:!0}];for(var s=1;s<9;s++)t.commands.push({name:`foldToLevel`+s,description:`Fold To Level `+s,level:s,exec:function(e){e.session.foldToLevel(this.level)},scrollIntoView:`center`,readOnly:!0})}),ace.define(`ace/keyboard/gutter_handler`,[`require`,`exports`,`module`,`ace/lib/keys`],function(e,t,n){var r=e(\"../lib/keys\");t.GutterKeyboardHandler=function(){function e(e){this.editor=e,this.gutterLayer=e.renderer.$gutterLayer,this.element=e.renderer.$gutter,this.lines=e.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=this.editor.$mouseHandler.$tooltip}return e.prototype.addListener=function(){this.element.addEventListener(`keydown`,this.$onGutterKeyDown.bind(this)),this.element.addEventListener(`focusout`,this.$blurGutter.bind(this)),this.editor.on(`mousewheel`,this.$blurGutter.bind(this))},e.prototype.removeListener=function(){this.element.removeEventListener(`keydown`,this.$onGutterKeyDown.bind(this)),this.element.removeEventListener(`focusout`,this.$blurGutter.bind(this)),this.editor.off(`mousewheel`,this.$blurGutter.bind(this))},e.prototype.$onGutterKeyDown=function(e){if(this.annotationTooltip.isOpen){e.preventDefault(),e.keyCode===r.escape&&this.annotationTooltip.hide();return}if(e.target===this.element){if(e.keyCode!=r.enter)return;e.preventDefault();var t=this.editor.getCursorPosition().row;this.editor.isRowVisible(t)||this.editor.scrollToLine(t,!0,!0),setTimeout(function(){var e=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),t=this.$findNearestFoldLaneWidget(e),n=this.$findNearestAnnotation(e);if(!(t===null&&n===null))if(this.$findClosestNumber(t,n,e)===t)if(this.activeLane=`fold`,this.activeRowIndex=t,this.$isCustomWidgetVisible(t)){this.$focusCustomWidget(this.activeRowIndex);return}else{this.$focusFoldWidget(this.activeRowIndex);return}else{this.activeRowIndex=n,this.activeLane=`annotation`,this.$focusAnnotation(this.activeRowIndex);return}}.bind(this),10);return}this.$handleGutterKeyboardInteraction(e),setTimeout(function(){this.editor._signal(`gutterkeydown`,new i(e,this))}.bind(this),10)},e.prototype.$handleGutterKeyboardInteraction=function(e){if(e.keyCode===r.tab){e.preventDefault();return}if(e.keyCode===r.escape){e.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(e.keyCode===r.up){switch(e.preventDefault(),this.activeLane){case`fold`:this.$moveFoldWidgetUp();break;case`annotation`:this.$moveAnnotationUp();break}return}if(e.keyCode===r.down){switch(e.preventDefault(),this.activeLane){case`fold`:this.$moveFoldWidgetDown();break;case`annotation`:this.$moveAnnotationDown();break}return}if(e.keyCode===r.left){e.preventDefault(),this.$switchLane(`annotation`);return}if(e.keyCode===r.right){e.preventDefault(),this.$switchLane(`fold`);return}if(e.keyCode===r.enter||e.keyCode===r.space){switch(e.preventDefault(),this.activeLane){case`fold`:var t=this.$rowIndexToRow(this.activeRowIndex),n=this.editor.session.$gutterCustomWidgets[t];if(n)n.callbacks&&n.callbacks.onClick&&n.callbacks.onClick(e,t);else if(this.gutterLayer.session.foldWidgets[t]===`start`){this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),e),setTimeout(function(){this.$rowIndexToRow(this.activeRowIndex)!==t&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(t),this.$focusFoldWidget(this.activeRowIndex))}.bind(this),10);break}else if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]===`end`)break;return;case`annotation`:this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex)),this.annotationTooltip.$fromKeyboard=!0;break}return}},e.prototype.$blurGutter=function(){if(this.activeRowIndex!==null)switch(this.activeLane){case`fold`:this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex);break;case`annotation`:this.$blurAnnotation(this.activeRowIndex);break}this.annotationTooltip.isOpen&&this.annotationTooltip.hide()},e.prototype.$isFoldWidgetVisible=function(e){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(e)),n=this.$getFoldWidget(e).style.display!==`none`;return t&&n},e.prototype.$isCustomWidgetVisible=function(e){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(e)),n=!!this.$getCustomWidget(e);return t&&n},e.prototype.$isAnnotationVisible=function(e){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(e)),n=this.$getAnnotation(e).style.display!==`none`;return t&&n},e.prototype.$getFoldWidget=function(e){return this.lines.get(e).element.childNodes[1]},e.prototype.$getCustomWidget=function(e){return this.lines.get(e).element.childNodes[3]},e.prototype.$getAnnotation=function(e){return this.lines.get(e).element.childNodes[2]},e.prototype.$findNearestFoldLaneWidget=function(e){if(this.$isCustomWidgetVisible(e)||this.$isFoldWidgetVisible(e))return e;for(var t=0;e-t>0||e+t<this.lines.getLength()-1;){if(t++,e-t>=0&&this.$isCustomWidgetVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isCustomWidgetVisible(e+t))return e+t;if(e-t>=0&&this.$isFoldWidgetVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(e+t))return e+t}return null},e.prototype.$findNearestAnnotation=function(e){if(this.$isAnnotationVisible(e))return e;for(var t=0;e-t>0||e+t<this.lines.getLength()-1;){if(t++,e-t>=0&&this.$isAnnotationVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isAnnotationVisible(e+t))return e+t}return null},e.prototype.$focusFoldWidget=function(e){if(e!=null){var t=this.$getFoldWidget(e);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus()}},e.prototype.$focusCustomWidget=function(e){if(e!=null){var t=this.$getCustomWidget(e);t&&(t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus())}},e.prototype.$focusAnnotation=function(e){if(e!=null){var t=this.$getAnnotation(e);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus()}},e.prototype.$blurFoldWidget=function(e){var t=this.$getFoldWidget(e);t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur()},e.prototype.$blurCustomWidget=function(e){var t=this.$getCustomWidget(e);t&&(t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur())},e.prototype.$blurAnnotation=function(e){var t=this.$getAnnotation(e);t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur()},e.prototype.$moveFoldWidgetUp=function(){for(var e=this.activeRowIndex;e>0;)if(e--,this.$isFoldWidgetVisible(e)||this.$isCustomWidgetVisible(e)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=e,this.$isFoldWidgetVisible(e)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},e.prototype.$moveFoldWidgetDown=function(){for(var e=this.activeRowIndex;e<this.lines.getLength()-1;)if(e++,this.$isFoldWidgetVisible(e)||this.$isCustomWidgetVisible(e)){this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=e,this.$isFoldWidgetVisible(e)?this.$focusFoldWidget(this.activeRowIndex):this.$focusCustomWidget(this.activeRowIndex);return}},e.prototype.$moveAnnotationUp=function(){for(var e=this.activeRowIndex;e>0;)if(e--,this.$isAnnotationVisible(e)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=e,this.$focusAnnotation(this.activeRowIndex);return}},e.prototype.$moveAnnotationDown=function(){for(var e=this.activeRowIndex;e<this.lines.getLength()-1;)if(e++,this.$isAnnotationVisible(e)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=e,this.$focusAnnotation(this.activeRowIndex);return}},e.prototype.$findClosestNumber=function(e,t,n){return e===null?t:t===null||Math.abs(n-e)<=Math.abs(n-t)?e:t},e.prototype.$switchLane=function(e){switch(e){case`annotation`:if(this.activeLane===`annotation`)break;var t=this.$findNearestAnnotation(this.activeRowIndex);if(t==null)break;this.activeLane=`annotation`,this.$blurFoldWidget(this.activeRowIndex),this.$blurCustomWidget(this.activeRowIndex),this.activeRowIndex=t,this.$focusAnnotation(this.activeRowIndex);break;case`fold`:if(this.activeLane===`fold`)break;var n=this.$findNearestFoldLaneWidget(this.activeRowIndex);if(n===null)break;this.activeLane=`fold`,this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=n,this.$isCustomWidgetVisible(n)?this.$focusCustomWidget(this.activeRowIndex):this.$focusFoldWidget(this.activeRowIndex);break}},e.prototype.$rowIndexToRow=function(e){var t=this.lines.get(e);return t?t.row:null},e.prototype.$rowToRowIndex=function(e){for(var t=0;t<this.lines.getLength();t++)if(this.lines.get(t).row==e)return t;return null},e}();var i=function(){function e(e,t){this.gutterKeyboardHandler=t,this.domEvent=e}return e.prototype.getKey=function(){return r.keyCodeToString(this.domEvent.keyCode)},e.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},e.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane===`annotation`},e.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane===`fold`},e}();t.GutterKeyboardEvent=i}),ace.define(`ace/editor`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/dom`,`ace/lib/lang`,`ace/lib/useragent`,`ace/keyboard/textinput`,`ace/mouse/mouse_handler`,`ace/mouse/fold_handler`,`ace/keyboard/keybinding`,`ace/edit_session`,`ace/search`,`ace/range`,`ace/lib/event_emitter`,`ace/commands/command_manager`,`ace/commands/default_commands`,`ace/config`,`ace/token_iterator`,`ace/keyboard/gutter_handler`,`ace/config`,`ace/clipboard`,`ace/lib/keys`,`ace/lib/event`,`ace/tooltip`],function(e,t,n){var r=this&&this.__values||function(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.`)},i=e(\"./lib/oop\"),a=e(\"./lib/dom\"),o=e(\"./lib/lang\"),s=e(\"./lib/useragent\"),c=e(\"./keyboard/textinput\").TextInput,l=e(\"./mouse/mouse_handler\").MouseHandler,u=e(\"./mouse/fold_handler\").FoldHandler,d=e(\"./keyboard/keybinding\").KeyBinding,f=e(\"./edit_session\").EditSession,p=e(\"./search\").Search,m=e(\"./range\").Range,h=e(\"./lib/event_emitter\").EventEmitter,g=e(\"./commands/command_manager\").CommandManager,_=e(\"./commands/default_commands\").commands,v=e(\"./config\"),y=e(\"./token_iterator\").TokenIterator,b=e(\"./keyboard/gutter_handler\").GutterKeyboardHandler,x=e(\"./config\").nls,S=e(\"./clipboard\"),C=e(\"./lib/keys\"),w=e(\"./lib/event\"),T=e(\"./tooltip\").HoverTooltip,E=function(){function e(t,n,r){this.id=`editor`+ ++e.$uid,this.session,this.$toDestroy=[];var i=t.getContainerElement();this.container=i,this.renderer=t,this.commands=new g(s.isMac?`mac`:`win`,_),typeof document==`object`&&(this.textInput=new c(t.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new l(this),new u(this)),this.keyBinding=new d(this),this.$search=new p().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on(`exec`,this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=o.delayedCall(function(){this._signal(`input`,{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on(`change`,function(e,t){t._$emitInputEvent.schedule(31)}),this.setSession(n||r&&r.session||new f(``)),v.resetOptions(this),r&&this.setOptions(r),v._signal(`editor`,this)}return e.prototype.$initOperationListeners=function(){this.commands.on(`exec`,this.startOperation.bind(this),!0),this.commands.on(`afterExec`,this.endOperation.bind(this),!0)},e.prototype.startOperation=function(e){this.session.startOperation(e)},e.prototype.endOperation=function(e){this.session.endOperation(e)},e.prototype.onStartOperation=function(e){this.curOp=this.session.curOp,this.curOp.scrollTop=this.renderer.scrollTop,this.prevOp=this.session.prevOp,e||(this.previousCommand=null)},e.prototype.onEndOperation=function(e){if(this.curOp&&this.session){if(e&&e.returnValue===!1){this.curOp=null;return}if(this._signal(`beforeEndOperation`),!this.curOp)return;var t=this.curOp.command,n=t&&t.scrollIntoView;if(n){switch(n){case`center-animate`:n=`animate`;case`center`:this.renderer.scrollCursorIntoView(null,.5);break;case`animate`:case`cursor`:this.renderer.scrollCursorIntoView();break;case`selectionPart`:var r=this.selection.getRange(),i=this.renderer.layerConfig;(r.start.row>=i.lastRow||r.end.row<=i.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break;default:break}n==`animate`&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.$lastSel=this.session.selection.toJSON(),this.prevOp=this.curOp,this.curOp=null}},e.prototype.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,r=t.command&&e.command.name==t.command.name;if(e.command.name==`insertstring`){var i=e.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),r=r&&this.mergeNextCommand&&(!/\\s/.test(i)||/\\s/.test(t.args)),this.mergeNextCommand=!0}else r&&=n.indexOf(e.command.name)!==-1;this.$mergeUndoDeltas!=`always`&&Date.now()-this.sequenceStartTime>2e3&&(r=!1),r?this.session.mergeUndoDeltas=!0:n.indexOf(e.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},e.prototype.setKeyboardHandler=function(e,t){if(e&&typeof e==`string`&&e!=`ace`){this.$keybindingId=e;var n=this;v.loadModule([`keybinding`,e],function(r){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(r&&r.handler),t&&t()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},e.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},e.prototype.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off(`change`,this.$onDocumentChange),this.session.off(`changeMode`,this.$onChangeMode),this.session.off(`tokenizerUpdate`,this.$onTokenizerUpdate),this.session.off(`changeTabSize`,this.$onChangeTabSize),this.session.off(`changeWrapLimit`,this.$onChangeWrapLimit),this.session.off(`changeWrapMode`,this.$onChangeWrapMode),this.session.off(`changeFold`,this.$onChangeFold),this.session.off(`changeFrontMarker`,this.$onChangeFrontMarker),this.session.off(`changeBackMarker`,this.$onChangeBackMarker),this.session.off(`changeBreakpoint`,this.$onChangeBreakpoint),this.session.off(`changeAnnotation`,this.$onChangeAnnotation),this.session.off(`changeOverwrite`,this.$onCursorChange),this.session.off(`changeScrollTop`,this.$onScrollTopChange),this.session.off(`changeScrollLeft`,this.$onScrollLeftChange),this.session.off(`startOperation`,this.$onStartOperation),this.session.off(`endOperation`,this.$onEndOperation);var n=this.session.getSelection();n.off(`changeCursor`,this.$onCursorChange),n.off(`changeSelection`,this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on(`change`,this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on(`changeMode`,this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on(`tokenizerUpdate`,this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on(`changeTabSize`,this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on(`changeWrapLimit`,this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on(`changeWrapMode`,this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on(`changeFold`,this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on(`changeFrontMarker`,this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on(`changeBackMarker`,this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on(`changeBreakpoint`,this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on(`changeAnnotation`,this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on(`changeOverwrite`,this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on(`changeScrollTop`,this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on(`changeScrollLeft`,this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on(`changeCursor`,this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on(`changeSelection`,this.$onSelectionChange),this.$onStartOperation=this.onStartOperation.bind(this),this.session.on(`startOperation`,this.$onStartOperation),this.$onEndOperation=this.onEndOperation.bind(this),this.session.on(`endOperation`,this.$onEndOperation),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal(`changeSession`,{session:e,oldSession:t}),this.curOp=null,t&&t._signal(`changeEditor`,{oldEditor:this}),t&&(t.$editor=null),e&&e._signal(`changeEditor`,{editor:this}),e&&(e.$editor=this),e&&!e.destroyed&&e.bgTokenizer.scheduleStart()}},e.prototype.getSession=function(){return this.session},e.prototype.setValue=function(e,t){return this.session.doc.setValue(e),t?t==1?this.navigateFileEnd():t==-1&&this.navigateFileStart():this.selectAll(),e},e.prototype.getValue=function(){return this.session.getValue()},e.prototype.getSelection=function(){return this.selection},e.prototype.resize=function(e){this.renderer.onResize(e)},e.prototype.setTheme=function(e,t){this.renderer.setTheme(e,t)},e.prototype.getTheme=function(){return this.renderer.getTheme()},e.prototype.setStyle=function(e,t){this.renderer.setStyle(e,t)},e.prototype.unsetStyle=function(e){this.renderer.unsetStyle(e)},e.prototype.getFontSize=function(){return this.getOption(`fontSize`)||a.computedStyle(this.container).fontSize},e.prototype.setFontSize=function(e){this.setOption(`fontSize`,e)},e.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout(function(){e.$highlightPending=!1;var t=e.session;if(!(!t||t.destroyed)){t.$bracketHighlight&&=(t.$bracketHighlight.markerIds.forEach(function(e){t.removeMarker(e)}),null);var n=e.getCursorPosition(),r=e.getKeyboardHandler(),i=r&&r.$getDirectionForHighlight&&r.$getDirectionForHighlight(e),a=t.getMatchingBracketRanges(n,i);if(!a){var o=new y(t,n.row,n.column).getCurrentToken();if(o&&/\\b(?:tag-open|tag-name)/.test(o.type)){var s=t.getMatchingTags(n);s&&(a=[s.openTagName.isEmpty()?s.openTag:s.openTagName,s.closeTagName.isEmpty()?s.closeTag:s.closeTagName])}}if(!a&&t.$mode.getMatching&&(a=t.$mode.getMatching(e.session)),!a){e.getHighlightIndentGuides()&&e.renderer.$textLayer.$highlightIndentGuide();return}var c=`ace_bracket`;Array.isArray(a)?a.length==1&&(c=`ace_error_bracket`):a=[a],a.length==2&&(m.comparePoints(a[0].end,a[1].start)==0?a=[m.fromPoints(a[0].start,a[1].end)]:m.comparePoints(a[0].start,a[1].end)==0&&(a=[m.fromPoints(a[1].start,a[0].end)])),t.$bracketHighlight={ranges:a,markerIds:a.map(function(e){return t.addMarker(e,c,`text`)})},e.getHighlightIndentGuides()&&e.renderer.$textLayer.$highlightIndentGuide()}},50)}},e.prototype.focus=function(){this.textInput.focus()},e.prototype.isFocused=function(){return this.textInput.isFocused()},e.prototype.blur=function(){this.textInput.blur()},e.prototype.onFocus=function(e){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit(`focus`,e))},e.prototype.onBlur=function(e){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit(`blur`,e))},e.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},e.prototype.onDocumentChange=function(e){var t=this.session.$useWrapMode,n=e.start.row==e.end.row?e.end.row:1/0;this.renderer.updateLines(e.start.row,n,t),this._signal(`change`,e),this.$cursorChange()},e.prototype.onTokenizerUpdate=function(e){var t=e.data;this.renderer.updateLines(t.first,t.last)},e.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},e.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},e.prototype.onCursorChange=function(){this.$cursorChange(),this._signal(`changeSelection`)},e.prototype.$updateHighlightActiveLine=function(){var e=this.getSession(),t;if(this.$highlightActiveLine&&((this.$selectionStyle!=`line`||!this.selection.isMultiLine())&&(t=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(t=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(t=!1)),e.$highlightLineMarker&&!t)e.removeMarker(e.$highlightLineMarker.id),e.$highlightLineMarker=null;else if(!e.$highlightLineMarker&&t){var n=new m(t.row,t.column,t.row,1/0);n.id=e.addMarker(n,`ace_active-line`,`screenLine`),e.$highlightLineMarker=n}else t&&(e.$highlightLineMarker.start.row=t.row,e.$highlightLineMarker.end.row=t.row,e.$highlightLineMarker.start.column=t.column,e._signal(`changeBackMarker`))},e.prototype.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),r=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,`ace_selection`,r)}var i=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(i),this._signal(`changeSelection`)},e.prototype.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!(t.isEmpty()||t.isMultiLine())){var n=t.start.column,r=t.end.column,i=e.getLine(t.start.row),a=i.substring(n,r);if(!(a.length>5e3||!/[\\w\\d]/.test(a))){var o=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:a}),s=i.substring(n-1,r+1);if(o.test(s))return o}}},e.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},e.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},e.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},e.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},e.prototype.onChangeMode=function(e){this.renderer.updateText(),this._emit(`changeMode`,e)},e.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},e.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},e.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},e.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},e.prototype.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var r=this.selection.getAllRanges(),i=0;i<r.length;i++){var a=r[i];i&&r[i-1].start.row==a.start.row||(e+=this.session.getLine(a.start.row)+t)}}var o={text:e};return this._signal(`copy`,o),S.lineMode=n?o.text:!1,o.text},e.prototype.onCopy=function(){this.commands.exec(`copy`,this)},e.prototype.onCut=function(){this.commands.exec(`cut`,this)},e.prototype.onPaste=function(e,t){var n={text:e,event:t};this.commands.exec(`paste`,this,n)},e.prototype.$handlePaste=function(e){typeof e==`string`&&(e={text:e}),this._signal(`paste`,e);var t=e.text,n=t===S.lineMode,r=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)n?r.insert({row:this.selection.lead.row,column:0},t):this.insert(t);else if(n)this.selection.rangeList.ranges.forEach(function(e){r.insert({row:e.start.row,column:0},t)});else{var i=t.split(/\\r\\n|\\r|\\n/),a=this.selection.rangeList.ranges,o=i.length==2&&(!i[0]||!i[1]);if(i.length!=a.length||o)return this.commands.exec(`insertstring`,this,t);for(var s=a.length;s--;){var c=a[s];c.isEmpty()||r.remove(c),r.insert(c.start,i[s])}}},e.prototype.execCommand=function(e,t){return this.commands.exec(e,this,t)},e.prototype.insert=function(e,t){var n=this.session,r=n.getMode(),i=this.getCursorPosition();if(this.getBehavioursEnabled()&&!t){var a=r.transformAction(n.getState(i.row),`insertion`,this,n,e);a&&(e!==a.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),e=a.text)}if(e==`\t`&&(e=this.session.getTabString()),!this.selection.isEmpty()){var o=this.getSelectionRange();i=this.session.remove(o),this.clearSelection()}else if(this.session.getOverwrite()&&e.indexOf(`\n`)==-1){var o=m.fromPoints(i,i);o.end.column+=e.length,this.session.remove(o)}if(e==`\n`||e==`\\r\n`){var s=n.getLine(i.row);if(i.column>s.search(/\\S|$/)){var c=s.substr(i.column).search(/\\S|$/);n.doc.removeInLine(i.row,i.column,i.column+c)}}this.clearSelection();var l=i.column,u=n.getState(i.row),s=n.getLine(i.row),d=r.checkOutdent(u,s,e);if(n.insert(i,e),a&&a.selection&&(a.selection.length==2?this.selection.setSelectionRange(new m(i.row,l+a.selection[0],i.row,l+a.selection[1])):this.selection.setSelectionRange(new m(i.row+a.selection[0],a.selection[1],i.row+a.selection[2],a.selection[3]))),this.$enableAutoIndent){if(n.getDocument().isNewLine(e)){var f=r.getNextLineIndent(u,s.slice(0,i.column),n.getTabString());n.insert({row:i.row+1,column:0},f)}d&&r.autoOutdent(u,n,i.row)}},e.prototype.autoIndent=function(){for(var e=this.session,t=e.getMode(),n=this.selection.isEmpty()?[new m(0,0,e.doc.getLength()-1,0)]:this.selection.getAllRanges(),r=``,i=``,a=``,o=e.getTabString(),s=0;s<n.length;s++)for(var c=n[s].start.row,l=n[s].end.row,u=c;u<=l;u++){u>0&&(r=e.getState(u-1),i=e.getLine(u-1),a=t.getNextLineIndent(r,i,o));var d=e.getLine(u),f=t.$getIndent(d);if(a!==f){if(f.length>0){var p=new m(u,0,u,f.length);e.remove(p)}a.length>0&&e.insert({row:u,column:0},a)}t.autoOutdent(r,e,u)}},e.prototype.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:`insertstring`}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},e.prototype.applyComposition=function(e,t){if(t.extendLeft||t.extendRight){var n=this.selection.getRange();n.start.column-=t.extendLeft,n.end.column+=t.extendRight,n.start.column<0&&(n.start.row--,n.start.column+=this.session.getLine(n.start.row).length+1),this.selection.setRange(n),!e&&!n.isEmpty()&&this.remove()}if((e||!this.selection.isEmpty())&&this.insert(e,!0),t.restoreStart||t.restoreEnd){var n=this.selection.getRange();n.start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n)}},e.prototype.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},e.prototype.setOverwrite=function(e){this.session.setOverwrite(e)},e.prototype.getOverwrite=function(){return this.session.getOverwrite()},e.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},e.prototype.setScrollSpeed=function(e){this.setOption(`scrollSpeed`,e)},e.prototype.getScrollSpeed=function(){return this.getOption(`scrollSpeed`)},e.prototype.setDragDelay=function(e){this.setOption(`dragDelay`,e)},e.prototype.getDragDelay=function(){return this.getOption(`dragDelay`)},e.prototype.setSelectionStyle=function(e){this.setOption(`selectionStyle`,e)},e.prototype.getSelectionStyle=function(){return this.getOption(`selectionStyle`)},e.prototype.setHighlightActiveLine=function(e){this.setOption(`highlightActiveLine`,e)},e.prototype.getHighlightActiveLine=function(){return this.getOption(`highlightActiveLine`)},e.prototype.setHighlightGutterLine=function(e){this.setOption(`highlightGutterLine`,e)},e.prototype.getHighlightGutterLine=function(){return this.getOption(`highlightGutterLine`)},e.prototype.setHighlightSelectedWord=function(e){this.setOption(`highlightSelectedWord`,e)},e.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},e.prototype.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},e.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},e.prototype.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},e.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},e.prototype.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},e.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},e.prototype.setHighlightIndentGuides=function(e){this.renderer.setHighlightIndentGuides(e)},e.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},e.prototype.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},e.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},e.prototype.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},e.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},e.prototype.setReadOnly=function(e){this.setOption(`readOnly`,e)},e.prototype.getReadOnly=function(){return this.getOption(`readOnly`)},e.prototype.setBehavioursEnabled=function(e){this.setOption(`behavioursEnabled`,e)},e.prototype.getBehavioursEnabled=function(){return this.getOption(`behavioursEnabled`)},e.prototype.setWrapBehavioursEnabled=function(e){this.setOption(`wrapBehavioursEnabled`,e)},e.prototype.getWrapBehavioursEnabled=function(){return this.getOption(`wrapBehavioursEnabled`)},e.prototype.setShowFoldWidgets=function(e){this.setOption(`showFoldWidgets`,e)},e.prototype.getShowFoldWidgets=function(){return this.getOption(`showFoldWidgets`)},e.prototype.setFadeFoldWidgets=function(e){this.setOption(`fadeFoldWidgets`,e)},e.prototype.getFadeFoldWidgets=function(){return this.getOption(`fadeFoldWidgets`)},e.prototype.remove=function(e){this.selection.isEmpty()&&(e==`left`?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,r=n.getState(t.start.row),i=n.getMode().transformAction(r,`deletion`,this,n,t);if(t.end.column===0){var a=n.getTextRange(t);if(a[a.length-1]==`\n`){var o=n.getLine(t.end.row);/^\\s+$/.test(o)&&(t.end.column=o.length)}}i&&(t=i)}this.session.remove(t),this.clearSelection()},e.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},e.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert(`\n`),this.moveCursorToPosition(e)},e.prototype.setGhostText=function(e,t){this.renderer.setGhostText(e,t)},e.prototype.removeGhostText=function(){this.renderer.removeGhostText()},e.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(t!==0){var n=this.session.getLine(e.row),r,i;t<n.length?(r=n.charAt(t)+n.charAt(t-1),i=new m(e.row,t-1,e.row,t+1)):(r=n.charAt(t-1)+n.charAt(t-2),i=new m(e.row,t-2,e.row,t)),this.session.replace(i,r),this.session.selection.moveToPosition(i.end)}}},e.prototype.toLowerCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),n=this.session.getTextRange(t);this.session.replace(t,n.toLowerCase()),this.selection.setSelectionRange(e)},e.prototype.toUpperCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),n=this.session.getTextRange(t);this.session.replace(t,n.toUpperCase()),this.selection.setSelectionRange(e)},e.prototype.indent=function(){var e=this.session,t=this.getSelectionRange();if(t.start.row<t.end.row){var n=this.$getSelectedRows();e.indentRows(n.first,n.last,`\t`);return}else if(t.start.column<t.end.column){var r=e.getTextRange(t);if(!/^\\s+$/.test(r)){var n=this.$getSelectedRows();e.indentRows(n.first,n.last,`\t`);return}}var i=e.getLine(t.start.row),a=t.start,s=e.getTabSize(),c=e.documentToScreenColumn(a.row,a.column);if(this.session.getUseSoftTabs())var l=s-c%s,u=o.stringRepeat(` `,l);else{for(var l=c%s;i[t.start.column-1]==` `&&l;)t.start.column--,l--;this.selection.setSelectionRange(t),u=`\t`}return this.insert(u)},e.prototype.blockIndent=function(){var e=this.$getSelectedRows();this.session.indentRows(e.first,e.last,`\t`)},e.prototype.blockOutdent=function(){var e=this.session.getSelection();this.session.outdentRows(e.getRange())},e.prototype.sortLines=function(){for(var e=this.$getSelectedRows(),t=this.session,n=[],r=e.first;r<=e.last;r++)n.push(t.getLine(r));n.sort(function(e,t){return e.toLowerCase()<t.toLowerCase()?-1:+(e.toLowerCase()>t.toLowerCase())});for(var i=new m(0,0,0,0),r=e.first;r<=e.last;r++){var a=t.getLine(r);i.start.row=r,i.end.row=r,i.end.column=a.length,t.replace(i,n[r-e.first])}},e.prototype.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},e.prototype.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},e.prototype.getNumberAt=function(e,t){var n=/[\\-]?[0-9]+(?:\\.[0-9]+)?/g;n.lastIndex=0;for(var r=this.session.getLine(e);n.lastIndex<t;){var i=n.exec(r);if(i.index<=t&&i.index+i[0].length>=t)return{value:i[0],start:i.index,end:i.index+i[0].length}}return null},e.prototype.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,r=new m(t,n-1,t,n),i=this.session.getTextRange(r);if(!isNaN(parseFloat(i))&&isFinite(i)){var a=this.getNumberAt(t,n);if(a){var o=a.value.indexOf(`.`)>=0?a.start+a.value.indexOf(`.`)+1:a.end,s=a.start+a.value.length-o,c=parseFloat(a.value);c*=10**s,o!==a.end&&n<o?e*=10**(a.end-n-1):e*=10**(a.end-n),c+=e,c/=10**s;var l=c.toFixed(s),u=new m(t,a.start,t,a.end);this.session.replace(u,l),this.moveCursorTo(t,Math.max(a.start+1,n+l.length-a.value.length))}}else this.toggleWord()},e.prototype.toggleWord=function(){var e=this.selection.getCursor().row,t=this.selection.getCursor().column;this.selection.selectWord();var n=this.getSelectedText(),r=this.selection.getWordRange().start.column,i=n.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,`$1 `).split(/\\s/),a=t-r-1;a<0&&(a=0);var s=0,c=0,l=this;n.match(/[A-Za-z0-9_]+/)&&i.forEach(function(t,i){c=s+t.length,a>=s&&a<=c&&(n=t,l.selection.clearSelection(),l.moveCursorTo(e,s+r),l.selection.selectTo(e,c+r)),s=c});for(var u=this.$toggleWordPairs,d,f=0;f<u.length;f++)for(var p=u[f],m=0;m<=1;m++){var h=+!m,g=n.match(RegExp(`^\\\\s?_?(`+o.escapeRegExp(p[m])+`)\\\\s?$`,`i`));g&&n.match(RegExp(`([_]|^|\\\\s)(`+o.escapeRegExp(g[1])+`)($|\\\\s)`,`g`))&&(d=n.replace(new RegExp(o.escapeRegExp(p[m]),`i`),function(e){var t=p[h];return e.toUpperCase()==e?t=t.toUpperCase():e.charAt(0).toUpperCase()==e.charAt(0)&&(t=t.substr(0,0)+p[h].charAt(0).toUpperCase()+t.substr(1)),t}),this.insert(d),d=``)}},e.prototype.findLinkAt=function(e,t){var n,i,a=this.session.getLine(e).split(/((?:https?|ftp):\\/\\/[\\S]+)/),o=t;o<0&&(o=0);var s=0,c=0,l;try{for(var u=r(a),d=u.next();!d.done;d=u.next()){var f=d.value;if(c=s+f.length,o>=s&&o<=c&&f.match(/((?:https?|ftp):\\/\\/[\\S]+)/)){l=f.replace(/[\\s:.,'\";}\\]]+$/,``);break}s=c}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}return l},e.prototype.openLink=function(){var e=this.selection.getCursor(),t=this.findLinkAt(e.row,e.column);return t&&window.open(t,`_blank`),t!=null},e.prototype.removeLines=function(){var e=this.$getSelectedRows();this.session.removeFullLines(e.first,e.last),this.clearSelection()},e.prototype.duplicateSelection=function(){var e=this.selection,t=this.session,n=e.getRange(),r=e.isBackwards();if(n.isEmpty()){var i=n.start.row;t.duplicateLines(i,i)}else{var a=r?n.start:n.end,o=t.insert(a,t.getTextRange(n));n.start=a,n.end=o,e.setSelectionRange(n,r)}},e.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},e.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},e.prototype.moveText=function(e,t,n){return this.session.moveText(e,t,n)},e.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},e.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},e.prototype.$moveLines=function(e,t){var n,r,i=this.selection;if(!i.inMultiSelectMode||this.inVirtualSelectionMode){var a=i.toOrientedRange();n=this.$getSelectedRows(a),r=this.session.$moveLines(n.first,n.last,t?0:e),t&&e==-1&&(r=0),a.moveBy(r,0),i.fromOrientedRange(a)}else{var o=i.rangeList.ranges;i.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var s=0,c=0,l=o.length,u=0;u<l;u++){var d=u;o[u].moveBy(s,0),n=this.$getSelectedRows(o[u]);for(var f=n.first,p=n.last;++u<l;){c&&o[u].moveBy(c,0);var m=this.$getSelectedRows(o[u]);if(t&&m.first!=p||!t&&m.first>p+1)break;p=m.last}for(u--,s=this.session.$moveLines(f,p,t?0:e),t&&e==-1&&(d=u+1);d<=u;)o[d].moveBy(s,0),d++;t||(s=0),c+=s}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},e.prototype.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},e.prototype.onCompositionStart=function(e){this.renderer.showComposition(e)},e.prototype.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},e.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},e.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},e.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},e.prototype.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},e.prototype.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},e.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},e.prototype.$moveByPage=function(e,t){var n=this.renderer,r=this.renderer.layerConfig,i=e*Math.floor(r.height/r.lineHeight);t===!0?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):t===!1&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection());var a=n.scrollTop;n.scrollBy(0,i*r.lineHeight),t!=null&&n.scrollCursorIntoView(null,.5),n.animateScrolling(a)},e.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},e.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},e.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},e.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},e.prototype.scrollPageDown=function(){this.$moveByPage(1)},e.prototype.scrollPageUp=function(){this.$moveByPage(-1)},e.prototype.scrollToRow=function(e){this.renderer.scrollToRow(e)},e.prototype.scrollToLine=function(e,t,n,r){this.renderer.scrollToLine(e,t,n,r)},e.prototype.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},e.prototype.getCursorPosition=function(){return this.selection.getCursor()},e.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},e.prototype.getSelectionRange=function(){return this.selection.getRange()},e.prototype.selectAll=function(){this.selection.selectAll()},e.prototype.clearSelection=function(){this.selection.clearSelection()},e.prototype.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},e.prototype.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},e.prototype.jumpToMatching=function(e,t){var n=this.getCursorPosition(),r=new y(this.session,n.row,n.column),i=r.getCurrentToken(),a=0;i&&i.type.indexOf(`tag-name`)!==-1&&(i=r.stepBackward());var o=i||r.stepForward();if(o){var s,c=!1,l={},u=n.column-o.start,d,f={\")\":`(`,\"(\":`(`,\"]\":`[`,\"[\":`[`,\"{\":`{`,\"}\":`{`};do{if(o.value.match(/[{}()\\[\\]]/g)){for(;u<o.value.length&&!c;u++)if(f[o.value[u]])switch(d=f[o.value[u]]+`.`+o.type.replace(`rparen`,`lparen`),isNaN(l[d])&&(l[d]=0),o.value[u]){case`(`:case`[`:case`{`:l[d]++;break;case`)`:case`]`:case`}`:l[d]--,l[d]===-1&&(s=`bracket`,c=!0);break}}else o.type.indexOf(`tag-name`)!==-1&&(isNaN(l[o.value])&&(l[o.value]=0),i.value===`<`&&a>1?l[o.value]++:i.value===`</`&&l[o.value]--,l[o.value]===-1&&(s=`tag`,c=!0));c||(i=o,a++,o=r.stepForward(),u=0)}while(o&&!c);if(s){var p,h;if(s===`bracket`)p=this.session.getBracketRange(n),p||(p=new m(r.getCurrentTokenRow(),r.getCurrentTokenColumn()+u-1,r.getCurrentTokenRow(),r.getCurrentTokenColumn()+u-1),h=p.start,(t||h.row===n.row&&Math.abs(h.column-n.column)<2)&&(p=this.session.getBracketRange(h)));else if(s===`tag`){if(!o||o.type.indexOf(`tag-name`)===-1)return;if(p=new m(r.getCurrentTokenRow(),r.getCurrentTokenColumn()-2,r.getCurrentTokenRow(),r.getCurrentTokenColumn()-2),p.compare(n.row,n.column)===0){var g=this.session.getMatchingTags(n);g&&(g.openTag.contains(n.row,n.column)?(p=g.closeTag,h=p.start):(p=g.openTag,h=g.closeTag.start.row===n.row&&g.closeTag.start.column===n.column?p.end:p.start))}h||=p.start}h=p&&p.cursor||h,h&&(e?p&&t?this.selection.setRange(p):p&&p.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(h.row,h.column):this.selection.moveTo(h.row,h.column))}}},e.prototype.gotoLine=function(e,t,n){this.selection.clearSelection(),this.session.unfold({row:e-1,column:t||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(e-1,t||0),this.isRowFullyVisible(e-1)||this.scrollToLine(e-1,!0,n)},e.prototype.navigateTo=function(e,t){this.selection.moveTo(e,t)},e.prototype.navigateUp=function(e){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),this.selection.moveCursorBy(-e||-1,0)},e.prototype.navigateDown=function(e){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),this.selection.moveCursorBy(e||1,0)},e.prototype.navigateLeft=function(e){if(this.selection.isEmpty())for(e||=1;e--;)this.selection.moveCursorLeft();else{var t=this.getSelectionRange().start;this.moveCursorToPosition(t)}this.clearSelection()},e.prototype.navigateRight=function(e){if(this.selection.isEmpty())for(e||=1;e--;)this.selection.moveCursorRight();else{var t=this.getSelectionRange().end;this.moveCursorToPosition(t)}this.clearSelection()},e.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},e.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},e.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},e.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},e.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},e.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},e.prototype.replace=function(e,t){t&&this.$search.set(t);var n=this.$search.find(this.session),r=0;return n?(this.$tryReplace(n,e)&&(r=1),this.selection.setSelectionRange(n),this.renderer.scrollSelectionIntoView(n.start,n.end),r):r},e.prototype.replaceAll=function(e,t){t&&this.$search.set(t);var n=this.$search.findAll(this.session),r=0;if(!n.length)return r;var i=this.getSelectionRange();this.selection.moveTo(0,0);for(var a=n.length-1;a>=0;--a)this.$tryReplace(n[a],e)&&r++;return this.selection.setSelectionRange(i),r},e.prototype.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return t=this.$search.replace(n,t),t===null?null:(e.end=this.session.replace(e,t),e)},e.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},e.prototype.find=function(e,t,n){t||={},typeof e==`string`||e instanceof RegExp?t.needle=e:typeof e==`object`&&i.mixin(t,e);var r=this.selection.getRange();t.needle??(e=this.session.getTextRange(r)||this.$search.$options.needle,e||=(r=this.session.getWordRange(r.start.row,r.start.column),this.session.getTextRange(r)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:r});var a=this.$search.find(this.session);if(t.preventScroll)return a;if(a)return this.revealRange(a,n),a;t.backwards?r.start=r.end:r.end=r.start,this.selection.setRange(r)},e.prototype.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},e.prototype.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},e.prototype.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),t!==!1&&this.renderer.animateScrolling(n)},e.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},e.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},e.prototype.destroy=function(){this.destroyed=!0,this.$toDestroy&&=(this.$toDestroy.forEach(function(e){e.destroy()}),[]),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal(`destroy`,this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},e.prototype.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,r=!1;this.$scrollAnchor||=document.createElement(`div`);var i=this.$scrollAnchor;i.style.cssText=`position:absolute`,this.container.insertBefore(i,this.container.firstChild);var a=this.on(`changeSelection`,function(){r=!0}),o=this.renderer.on(`beforeRender`,function(){r&&(t=n.renderer.container.getBoundingClientRect())}),s=this.renderer.on(`afterRender`,function(){if(r&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,a=e.$cursorLayer.$pixelPos,o=e.layerConfig,s=a.top-o.offset;r=a.top>=0&&s+t.top<0?!0:a.top<o.height&&a.top+t.top+o.lineHeight>window.innerHeight?!1:null,r!=null&&(i.style.top=s+`px`,i.style.left=a.left+`px`,i.style.height=o.lineHeight+`px`,i.scrollIntoView(r)),r=t=null}});this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off(`changeSelection`,a),this.renderer.off(`afterRender`,s),this.renderer.off(`beforeRender`,o))}}},e.prototype.$resetCursorStyle=function(){var e=this.$cursorStyle||`ace`,t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&e!=`wide`,a.setCssClass(t.element,`ace_slim-cursors`,/slim/.test(e)))},e.prototype.prompt=function(e,t,n){var r=this;v.loadModule(`ace/ext/prompt`,function(i){i.prompt(r,e,t,n)})},Object.defineProperty(e.prototype,\"hoverTooltip\",{get:function(){return this.$hoverTooltip||=new T(this.container)},set:function(e){this.$hoverTooltip&&this.$hoverTooltip.destroy(),this.$hoverTooltip=e},enumerable:!1,configurable:!0}),e}();E.$uid=0,E.prototype.curOp=null,E.prototype.prevOp={},E.prototype.$mergeableCommands=[`backspace`,`del`,`insertstring`],E.prototype.$toggleWordPairs=[[`first`,`last`],[`true`,`false`],[`yes`,`no`],[`width`,`height`],[`top`,`bottom`],[`right`,`left`],[`on`,`off`],[`x`,`y`],[`get`,`set`],[`max`,`min`],[`horizontal`,`vertical`],[`show`,`hide`],[`add`,`remove`],[`up`,`down`],[`before`,`after`],[`even`,`odd`],[`in`,`out`],[`inside`,`outside`],[`next`,`previous`],[`increase`,`decrease`],[`attach`,`detach`],[`&&`,`||`],[`==`,`!=`]],i.implement(E.prototype,h),v.defineOptions(E.prototype,`editor`,{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal(`changeSelectionStyle`,{data:e})},initialValue:`line`},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){var t=this;if(this.textInput.setReadOnly(e),!this.destroyed){this.$resetCursorStyle(),this.$readOnlyCallback||=function(e){var n=!1;if(e&&e.type==`keydown`){if(e&&e.key&&!e.ctrlKey&&!e.metaKey&&(e.key==` `&&e.preventDefault(),n=e.key.length==1),!n)return}else e&&e.type!==`exec`&&(n=!0);if(n){var r=a.createElement(`div`);r.textContent=x(`editor.tooltip.disable-editing`,`Editing is disabled`),t.hoverTooltip.isOpen||t.hoverTooltip.showForRange(t,t.getSelectionRange(),r)}else t.hoverTooltip&&t.hoverTooltip.isOpen&&t.hoverTooltip.hide()};var n=this.textInput.getElement();e?(w.addListener(n,`keydown`,this.$readOnlyCallback,this),this.commands.on(`exec`,this.$readOnlyCallback),this.commands.on(`commandUnavailable`,this.$readOnlyCallback)):(w.removeListener(n,`keydown`,this.$readOnlyCallback),this.commands.off(`exec`,this.$readOnlyCallback),this.commands.off(`commandUnavailable`,this.$readOnlyCallback))}},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:[`ace`,`slim`,`smooth`,`wide`],initialValue:`ace`},mergeUndoDeltas:{values:[!1,!0,`always`],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?D.attach(this):D.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?D.attach(this):D.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(e&&this.renderer.placeholderNode)this.renderer.off(`afterRender`,this.$updatePlaceholder),a.removeCssClass(this.container,`ace_hasPlaceholder`),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!e&&!this.renderer.placeholderNode){this.renderer.on(`afterRender`,this.$updatePlaceholder),a.addCssClass(this.container,`ace_hasPlaceholder`);var t=a.createElement(`div`);t.className=`ace_placeholder`,t.textContent=this.$placeholder||``,this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!e&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||``)}.bind(this),this.on(`input`,this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(e){var t={name:`blurTextInput`,description:`Set focus to the editor content div to allow tabbing through the page`,bindKey:`Esc`,exec:function(e){e.blur(),e.renderer.scroller.focus()},readOnly:!0},n=function(e){if(e.target==this.renderer.scroller&&e.keyCode===C.enter){e.preventDefault();var t=this.getCursorPosition().row;this.isRowVisible(t)||this.scrollToLine(t,!0,!0),this.focus()}},r;e?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName=`ace_keyboard-focus`,this.textInput.getElement().setAttribute(`tabindex`,-1),this.textInput.setNumberOfExtraLines(s.isWin?3:0),this.renderer.scroller.setAttribute(`tabindex`,0),this.renderer.scroller.setAttribute(`role`,`group`),this.renderer.scroller.setAttribute(`aria-roledescription`,x(`editor.scroller.aria-roledescription`,`editor`)),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute(`aria-label`,x(`editor.scroller.aria-label`,`Editor content, press Enter to start editing, press Escape to exit`)),this.renderer.scroller.addEventListener(`keyup`,n.bind(this)),this.commands.addCommand(t),this.renderer.$gutter.setAttribute(`tabindex`,0),this.renderer.$gutter.setAttribute(`aria-hidden`,!1),this.renderer.$gutter.setAttribute(`role`,`group`),this.renderer.$gutter.setAttribute(`aria-roledescription`,x(`editor.gutter.aria-roledescription`,`editor gutter`)),this.renderer.$gutter.setAttribute(`aria-label`,x(`editor.gutter.aria-label`,`Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit`)),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute(`aria-hidden`,!0),r||=new b(this),r.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute(`tabindex`,0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute(`tabindex`,-1),this.renderer.scroller.removeAttribute(`role`),this.renderer.scroller.removeAttribute(`aria-roledescription`),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute(`aria-label`),this.renderer.scroller.removeEventListener(`keyup`,n.bind(this)),this.commands.removeCommand(t),this.renderer.content.removeAttribute(`aria-hidden`),this.renderer.$gutter.setAttribute(`tabindex`,-1),this.renderer.$gutter.setAttribute(`aria-hidden`,!0),this.renderer.$gutter.removeAttribute(`role`),this.renderer.$gutter.removeAttribute(`aria-roledescription`),this.renderer.$gutter.removeAttribute(`aria-label`),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),r&&r.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(e){this.$textInputAriaLabel=e},initialValue:``},enableMobileMenu:{set:function(e){this.$enableMobileMenu=e},initialValue:!0},customScrollbar:`renderer`,hScrollBarAlwaysVisible:`renderer`,vScrollBarAlwaysVisible:`renderer`,highlightGutterLine:`renderer`,animatedScroll:`renderer`,showInvisibles:`renderer`,showPrintMargin:`renderer`,printMarginColumn:`renderer`,printMargin:`renderer`,fadeFoldWidgets:`renderer`,showFoldWidgets:`renderer`,displayIndentGuides:`renderer`,highlightIndentGuides:`renderer`,showGutter:`renderer`,fontSize:`renderer`,fontFamily:`renderer`,maxLines:`renderer`,minLines:`renderer`,scrollPastEnd:`renderer`,fixedWidthGutter:`renderer`,theme:`renderer`,hasCssTransforms:`renderer`,maxPixelHeight:`renderer`,useTextareaForIME:`renderer`,useResizeObserver:`renderer`,useSvgGutterIcons:`renderer`,showFoldedAnnotations:`renderer`,scrollSpeed:`$mouseHandler`,dragDelay:`$mouseHandler`,dragEnabled:`$mouseHandler`,focusTimeout:`$mouseHandler`,firstLineNumber:`session`,overwrite:`session`,newLineMode:`session`,useWorker:`session`,useSoftTabs:`session`,navigateWithinSoftTabs:`session`,tabSize:`session`,wrap:`session`,indentedSoftWrap:`session`,foldStyle:`session`,mode:`session`});var D={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?`\u00B7`:``))+``},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on(`changeSelection`,this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off(`changeSelection`,this.update),this.update(null,e)}};t.Editor=E}),ace.define(`ace/layer/lines`,[`require`,`exports`,`module`,`ace/lib/dom`],function(e,t,n){var r=e(\"../lib/dom\");t.Lines=function(){function e(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=this.canvasHeight*2+`px`,this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return e.prototype.moveContainer=function(e){r.translate(this.element,0,-(e.firstRowScreen*e.lineHeight%this.canvasHeight)-e.offset*this.$offsetCoefficient)},e.prototype.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},e.prototype.computeLineTop=function(e,t,n){var r=t.firstRowScreen*t.lineHeight,i=Math.floor(r/this.canvasHeight);return n.documentToScreenRow(e,0)*t.lineHeight-i*this.canvasHeight},e.prototype.computeLineHeight=function(e,t,n){return t.lineHeight*n.getRowLineCount(e)},e.prototype.getLength=function(){return this.cells.length},e.prototype.get=function(e){return this.cells[e]},e.prototype.shift=function(){this.$cacheCell(this.cells.shift())},e.prototype.pop=function(){this.$cacheCell(this.cells.pop())},e.prototype.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);for(var t=r.createFragment(this.element),n=0;n<e.length;n++)t.appendChild(e[n].element);this.element.appendChild(t)}else this.cells.push(e),this.element.appendChild(e.element)},e.prototype.unshift=function(e){if(Array.isArray(e)){this.cells.unshift.apply(this.cells,e);for(var t=r.createFragment(this.element),n=0;n<e.length;n++)t.appendChild(e[n].element);this.element.firstChild?this.element.insertBefore(t,this.element.firstChild):this.element.appendChild(t)}else this.cells.unshift(e),this.element.insertAdjacentElement(`afterbegin`,e.element)},e.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},e.prototype.$cacheCell=function(e){e&&(e.element.remove(),this.cellCache.push(e))},e.prototype.createCell=function(e,t,n,i){var a=this.cellCache.pop();if(!a){var o=r.createElement(`div`);i&&i(o),this.element.appendChild(o),a={element:o,text:``,row:e}}return a.row=e,a},e}()}),ace.define(`ace/layer/gutter`,[`require`,`exports`,`module`,`ace/lib/dom`,`ace/lib/oop`,`ace/lib/lang`,`ace/lib/event_emitter`,`ace/layer/lines`,`ace/config`],function(e,t,n){var r=e(\"../lib/dom\"),i=e(\"../lib/oop\"),a=e(\"../lib/lang\"),o=e(\"../lib/event_emitter\").EventEmitter,s=e(\"./lines\").Lines,c=e(\"../config\").nls,l=function(){function e(e){this.$showCursorMarker=null,this.element=r.createElement(`div`),this.element.className=`ace_layer ace_gutter-layer`,e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new s(this.element),this.$lines.$offsetCoefficient=1}return e.prototype.setSession=function(e){this.session&&this.session.off(`change`,this.$updateAnnotations),this.session=e,e&&e.on(`change`,this.$updateAnnotations)},e.prototype.addGutterDecoration=function(e,t){window.console&&console.warn&&console.warn(`deprecated use session.addGutterDecoration`),this.session.addGutterDecoration(e,t)},e.prototype.removeGutterDecoration=function(e,t){window.console&&console.warn&&console.warn(`deprecated use session.removeGutterDecoration`),this.session.removeGutterDecoration(e,t)},e.prototype.setAnnotations=function(e){this.$annotations=[];for(var t=0;t<e.length;t++){var n=e[t],r=n.row,i=this.$annotations[r];i||=this.$annotations[r]={text:[],type:[],displayText:[]};var o=n.text,s=n.text,c=n.type;o=o?a.escapeHTML(o):n.html||``,s=s||n.html||``,i.text.indexOf(o)===-1&&(i.text.push(o),i.type.push(c),i.displayText.push(s));var l=n.className;l?i.className=l:c===`error`?i.className=` ace_error`:c===`security`&&!/\\bace_error\\b/.test(i.className)?i.className=` ace_security`:c===`warning`&&!/\\bace_(error|security)\\b/.test(i.className)?i.className=` ace_warning`:c===`info`&&!i.className?i.className=` ace_info`:c===`hint`&&!i.className&&(i.className=` ace_hint`)}},e.prototype.$updateAnnotations=function(e){if(this.$annotations.length){var t=e.start.row,n=e.end.row-t;if(n!==0)if(e.action==`remove`)this.$annotations.splice(t,n+1,null);else{var r=Array(n+1);r.unshift(t,1),this.$annotations.splice.apply(this.$annotations,r)}}},e.prototype.update=function(e){this.config=e;var t=this.session,n=e.firstRow,r=Math.min(e.lastRow+e.gutterOffset,t.getLength()-1);this.oldLastRow=r,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow();for(var i=t.getNextFoldLine(n),a=i?i.start.row:1/0,o=null,s=-1,c=n;;){if(c>a&&(c=i.end.row+1,i=t.getNextFoldLine(c,i),a=i?i.start.row:1/0),c>r){for(;this.$lines.getLength()>s+1;)this.$lines.pop();break}o=this.$lines.get(++s),o?o.row=c:(o=this.$lines.createCell(c,e,this.session,u),this.$lines.push(o)),this.$renderCell(o,e,i,c),c++}this._signal(`afterRender`),this.$updateGutterWidth(e),this.$showCursorMarker&&this.$highlightGutterLine&&this.$updateCursorMarker()},e.prototype.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,r=t.$firstLineNumber,i=this.$lines.last()?this.$lines.last().text:``;(this.$fixedWidth||t.$useWrapMode)&&(i=t.getLength()+r-1);var a=n?n.getWidth(t,i,e):i.toString().length*e.characterWidth,o=this.$padding||this.$computePadding();a+=o.left+o.right,a!==this.gutterWidth&&!isNaN(a)&&(this.gutterWidth=a,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+`px`,this._signal(`changeGutterWidth`,a))},e.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},e.prototype.updateLineHighlight=function(){if(this.$showCursorMarker&&this.$updateCursorMarker(),this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!(this.$cursorCell&&this.$cursorCell.row==e)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace(`ace_gutter-active-line `,``));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n<t.length;n++){var r=t[n];if(r.row>=this.$cursorRow){if(r.row>this.$cursorRow){var i=this.session.getFoldLine(this.$cursorRow);if(n>0&&i&&i.start.row==t[n-1].row)r=t[n-1];else break}r.element.className=`ace_gutter-active-line `+r.element.className,this.$cursorCell=r;break}}}}},e.prototype.$updateCursorMarker=function(){if(this.session){var e=this.session;this.$highlightElement||(this.$highlightElement=r.createElement(`div`),this.$highlightElement.className=`ace_gutter-cursor`,this.$highlightElement.style.pointerEvents=`none`,this.element.appendChild(this.$highlightElement));var t=e.selection.cursor,n=this.config,i=this.$lines,a=n.firstRowScreen*n.lineHeight,o=Math.floor(a/i.canvasHeight),s=e.documentToScreenRow(t)*n.lineHeight-o*i.canvasHeight;r.setStyle(this.$highlightElement.style,`height`,n.lineHeight+`px`),r.setStyle(this.$highlightElement.style,`top`,s+`px`)}},e.prototype.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),r=this.oldLastRow;if(this.oldLastRow=n,!t||r<e.firstRow||n<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var i=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);i>0;i--)this.$lines.shift();if(r>n)for(var i=this.session.getFoldedRowCount(n+1,r);i>0;i--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,t.firstRow-1)),n>r&&this.$lines.push(this.$renderLines(e,r+1,n)),this.updateLineHighlight(),this._signal(`afterRender`),this.$updateGutterWidth(e)},e.prototype.$renderLines=function(e,t,n){for(var r=[],i=t,a=this.session.getNextFoldLine(i),o=a?a.start.row:1/0;i>o&&(i=a.end.row+1,a=this.session.getNextFoldLine(i,a),o=a?a.start.row:1/0),!(i>n);){var s=this.$lines.createCell(i,e,this.session,u);this.$renderCell(s,e,a,i),r.push(s),i++}return r},e.prototype.$renderCell=function(e,t,n,i){var a=e.element,o=this.session,s=a.childNodes[0],l=a.childNodes[1],u=a.childNodes[2],d=a.childNodes[3],f=u.firstChild,p=o.$firstLineNumber,m=o.$breakpoints,h=o.$decorations,g=o.gutterRenderer||this.$renderer,_=this.$showFoldWidgets&&o.foldWidgets,v=n?n.start.row:Number.MAX_VALUE,y=t.lineHeight+`px`,b=this.$useSvgGutterIcons?`ace_gutter-cell_svg-icons `:`ace_gutter-cell `,x=this.$useSvgGutterIcons?`ace_icon_svg`:`ace_icon`,S=(g?g.getText(o,i):i+p).toString();if(this.$highlightGutterLine&&(i==this.$cursorRow||n&&i<this.$cursorRow&&i>=v&&this.$cursorRow<=n.end.row)&&(b+=`ace_gutter-active-line `,this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace(`ace_gutter-active-line `,``)),this.$cursorCell=e)),m[i]&&(b+=m[i]),h[i]&&(b+=h[i]),this.$annotations[i]&&i!==v&&(b+=this.$annotations[i].className),_){var C=_[i];C??=_[i]=o.getFoldWidget(i)}if(C){var w=`ace_fold-widget ace_`+C,T=C==`start`&&i==v&&i<n.end.row;if(T){w+=` ace_closed`;for(var E=``,D=!1,O=i+1;O<=n.end.row;O++)if(this.$annotations[O]){if(this.$annotations[O].className===` ace_error`){D=!0,E=` ace_error_fold`;break}this.$annotations[O].className===` ace_security`?(D=!0,E=` ace_security_fold`):this.$annotations[O].className===` ace_warning`&&E!==` ace_security_fold`&&(D=!0,E=` ace_warning_fold`)}b+=E}else w+=` ace_open`;l.className!=w&&(l.className=w),r.setStyle(l.style,`height`,y),r.setStyle(l.style,`display`,`inline-block`),l.setAttribute(`role`,`button`),l.setAttribute(`tabindex`,`-1`);var k=o.getFoldWidgetRange(i);k?l.setAttribute(`aria-label`,c(`gutter.code-folding.range.aria-label`,`Toggle code folding, rows $0 through $1`,[k.start.row+1,k.end.row+1])):n?l.setAttribute(`aria-label`,c(`gutter.code-folding.closed.aria-label`,`Toggle code folding, rows $0 through $1`,[n.start.row+1,n.end.row+1])):l.setAttribute(`aria-label`,c(`gutter.code-folding.open.aria-label`,`Toggle code folding, row $0`,[i+1])),T?(l.setAttribute(`aria-expanded`,`false`),l.setAttribute(`title`,c(`gutter.code-folding.closed.title`,`Unfold code`))):(l.setAttribute(`aria-expanded`,`true`),l.setAttribute(`title`,c(`gutter.code-folding.open.title`,`Fold code`)))}else l&&(r.setStyle(l.style,`display`,`none`),l.setAttribute(`tabindex`,`0`),l.removeAttribute(`role`),l.removeAttribute(`aria-label`));var A=this.session.$gutterCustomWidgets[i];if(A?this.$addCustomWidget(i,A,e):d&&this.$removeCustomWidget(i,e),D&&this.$showFoldedAnnotations){u.className=`ace_gutter_annotation`,f.className=x,f.className+=E,r.setStyle(f.style,`height`,y),r.setStyle(u.style,`display`,`block`),r.setStyle(u.style,`height`,y);var j;switch(E){case` ace_error_fold`:j=c(`gutter.annotation.aria-label.error`,`Error, read annotations row $0`,[S]);break;case` ace_security_fold`:j=c(`gutter.annotation.aria-label.security`,`Security finding, read annotations row $0`,[S]);break;case` ace_warning_fold`:j=c(`gutter.annotation.aria-label.warning`,`Warning, read annotations row $0`,[S]);break}u.setAttribute(`aria-label`,j),u.setAttribute(`tabindex`,`-1`),u.setAttribute(`role`,`button`)}else if(this.$annotations[i]){u.className=`ace_gutter_annotation`,f.className=x,this.$useSvgGutterIcons?f.className+=this.$annotations[i].className:a.classList.add(this.$annotations[i].className.replace(` `,``)),r.setStyle(f.style,`height`,y),r.setStyle(u.style,`display`,`block`),r.setStyle(u.style,`height`,y);var j;switch(this.$annotations[i].className){case` ace_error`:j=c(`gutter.annotation.aria-label.error`,`Error, read annotations row $0`,[S]);break;case` ace_security`:j=c(`gutter.annotation.aria-label.security`,`Security finding, read annotations row $0`,[S]);break;case` ace_warning`:j=c(`gutter.annotation.aria-label.warning`,`Warning, read annotations row $0`,[S]);break;case` ace_info`:j=c(`gutter.annotation.aria-label.info`,`Info, read annotations row $0`,[S]);break;case` ace_hint`:j=c(`gutter.annotation.aria-label.hint`,`Suggestion, read annotations row $0`,[S]);break}u.setAttribute(`aria-label`,j),u.setAttribute(`tabindex`,`-1`),u.setAttribute(`role`,`button`)}else r.setStyle(u.style,`display`,`none`),u.removeAttribute(`aria-label`),u.removeAttribute(`role`),u.setAttribute(`tabindex`,`0`);return S!==s.data&&(s.data=S),a.className!=b&&(a.className=b),r.setStyle(e.element.style,`height`,this.$lines.computeLineHeight(i,t,o)+`px`),r.setStyle(e.element.style,`top`,this.$lines.computeLineTop(i,t,o)+`px`),e.text=S,u.style.display===`none`&&l.style.display===`none`&&!A?e.element.setAttribute(`aria-hidden`,!0):e.element.setAttribute(`aria-hidden`,!1),e},e.prototype.setHighlightGutterLine=function(e){this.$highlightGutterLine=e,!e&&this.$highlightElement&&(this.$highlightElement.remove(),this.$highlightElement=null)},e.prototype.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return``}}},e.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},e.prototype.setShowFoldWidgets=function(e){e?r.addCssClass(this.element,`ace_folding-enabled`):r.removeCssClass(this.element,`ace_folding-enabled`),this.$showFoldWidgets=e,this.$padding=null},e.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},e.prototype.$hideFoldWidget=function(e,t){var n=t||this.$getGutterCell(e);if(n&&n.element){var i=n.element.childNodes[1];i&&r.setStyle(i.style,`display`,`none`)}},e.prototype.$showFoldWidget=function(e,t){var n=t||this.$getGutterCell(e);if(n&&n.element){var i=n.element.childNodes[1];i&&this.session.foldWidgets&&this.session.foldWidgets[n.row]&&r.setStyle(i.style,`display`,`inline-block`)}},e.prototype.$getGutterCell=function(e){var t=this.$lines.cells,n=0,r=t.length-1;if(!(e<t[0].row||e>t[r].row)){for(;n<=r;){var i=Math.floor((n+r)/2),a=t[i];if(a.row>e)r=i-1;else if(a.row<e)n=i+1;else return a}return a}},e.prototype.$addCustomWidget=function(e,t,n){var i=t.className,a=t.label,o=t.title,s=t.callbacks;this.session.$gutterCustomWidgets[e]={className:i,label:a,title:o,callbacks:s},this.$hideFoldWidget(e,n);var c=n||this.$getGutterCell(e);if(c&&c.element){var l=c.element.querySelector(`.ace_custom-widget`);l&&l.remove(),l=r.createElement(`span`),l.className=`ace_custom-widget ${i}`,l.setAttribute(`tabindex`,`-1`),l.setAttribute(`role`,`button`),l.setAttribute(`aria-label`,a),l.setAttribute(`title`,o),r.setStyle(l.style,`display`,`inline-block`),r.setStyle(l.style,`height`,`inherit`),s&&s.onClick&&l.addEventListener(`click`,function(t){s.onClick(t,e),t.stopPropagation()}),c.element.appendChild(l)}},e.prototype.$removeCustomWidget=function(e,t){delete this.session.$gutterCustomWidgets[e],this.$showFoldWidget(e,t);var n=t||this.$getGutterCell(e);if(n&&n.element){var r=n.element.querySelector(`.ace_custom-widget`);r&&n.element.removeChild(r)}},e.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=r.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding},e.prototype.getRegion=function(e){var t=this.$padding||this.$computePadding(),n=this.element.getBoundingClientRect();if(e.x<t.left+n.left)return`markers`;if(this.$showFoldWidgets&&e.x>n.right-t.right)return`foldWidgets`},e}();l.prototype.$fixedWidth=!1,l.prototype.$highlightGutterLine=!0,l.prototype.$renderer=void 0,l.prototype.$showLineNumbers=!0,l.prototype.$showFoldWidgets=!0,i.implement(l.prototype,o);function u(e){var t=document.createTextNode(``);e.appendChild(t);var n=r.createElement(`span`);e.appendChild(n);var i=r.createElement(`span`);e.appendChild(i);var a=r.createElement(`span`);return i.appendChild(a),e}t.Gutter=l}),ace.define(`ace/layer/marker`,[`require`,`exports`,`module`,`ace/range`,`ace/lib/dom`],function(e,t,n){var r=e(\"../range\").Range,i=e(\"../lib/dom\"),a=function(){function e(e){this.element=i.createElement(`div`),this.element.className=`ace_layer ace_marker-layer`,e.appendChild(this.element)}return e.prototype.setPadding=function(e){this.$padding=e},e.prototype.setSession=function(e){this.session=e},e.prototype.setMarkers=function(e){this.markers=e},e.prototype.elt=function(e,t){var n=this.i!=-1&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement(`div`),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},e.prototype.update=function(e){if(e){this.config=e,this.i=0;var t;for(var n in this.markers){var r=this.markers[n];if(!r.range){r.update(t,this,this.session,e);continue}var i=r.range.clipRows(e.firstRow,e.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),r.renderer){var a=this.$getTop(i.start.row,e),o=this.$padding+i.start.column*e.characterWidth;r.renderer(t,i,o,a,e)}else r.type==`fullLine`?this.drawFullLineMarker(t,i,r.clazz,e):r.type==`screenLine`?this.drawScreenLineMarker(t,i,r.clazz,e):i.isMultiLine()?r.type==`text`?this.drawTextMarker(t,i,r.clazz,e):this.drawMultiLineMarker(t,i,r.clazz,e):this.drawSingleLineMarker(t,i,r.clazz+` ace_start ace_br15`,e)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},e.prototype.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},e.prototype.drawTextMarker=function(e,t,n,i,a){for(var s=this.session,c=t.start.row,l=t.end.row,u=c,d=0,f=0,p=s.getScreenLastRowColumn(u),m=new r(u,t.start.column,u,f);u<=l;u++)m.start.row=m.end.row=u,m.start.column=u==c?t.start.column:s.getRowWrapIndent(u),m.end.column=p,d=f,f=p,p=u+1<l?s.getScreenLastRowColumn(u+1):u==l?0:t.end.column,this.drawSingleLineMarker(e,m,n+(u==c?` ace_start`:``)+` ace_br`+o(u==c||u==c+1&&t.start.column,d<f,f>p,u==l),i,u==l?0:1,a)},e.prototype.drawMultiLineMarker=function(e,t,n,r,i){var a=this.$padding,o=r.lineHeight,s=this.$getTop(t.start.row,r),c=a+t.start.column*r.characterWidth;if(i||=``,this.session.$bidiHandler.isBidiRow(t.start.row)){var l=t.clone();l.end.row=l.start.row,l.end.column=this.session.getLine(l.start.row).length,this.drawBidiSingleLineMarker(e,l,n+` ace_br1 ace_start`,r,null,i)}else this.elt(n+` ace_br1 ace_start`,`height:`+o+`px;right:`+a+`px;top:`+s+`px;left:`+c+`px;`+(i||``));if(this.session.$bidiHandler.isBidiRow(t.end.row)){var l=t.clone();l.start.row=l.end.row,l.start.column=0,this.drawBidiSingleLineMarker(e,l,n+` ace_br12`,r,null,i)}else{s=this.$getTop(t.end.row,r);var u=t.end.column*r.characterWidth;this.elt(n+` ace_br12`,`height:`+o+`px;width:`+u+`px;top:`+s+`px;left:`+a+`px;`+(i||``))}if(o=(t.end.row-t.start.row-1)*r.lineHeight,!(o<=0)){s=this.$getTop(t.start.row+1,r);var d=!!t.start.column|(t.end.column?0:8);this.elt(n+(d?` ace_br`+d:``),`height:`+o+`px;right:`+a+`px;top:`+s+`px;left:`+a+`px;`+(i||``))}},e.prototype.drawSingleLineMarker=function(e,t,n,r,i,a){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,r,i,a);var o=r.lineHeight,s=(t.end.column+(i||0)-t.start.column)*r.characterWidth,c=this.$getTop(t.start.row,r),l=this.$padding+t.start.column*r.characterWidth;this.elt(n,`height:`+o+`px;width:`+s+`px;top:`+c+`px;left:`+l+`px;`+(a||``))},e.prototype.drawBidiSingleLineMarker=function(e,t,n,r,i,a){var o=r.lineHeight,s=this.$getTop(t.start.row,r),c=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach(function(e){this.elt(n,`height:`+o+`px;width:`+(e.width+(i||0))+`px;top:`+s+`px;left:`+(c+e.left)+`px;`+(a||``))},this)},e.prototype.drawFullLineMarker=function(e,t,n,r,i){var a=this.$getTop(t.start.row,r),o=r.lineHeight;t.start.row!=t.end.row&&(o+=this.$getTop(t.end.row,r)-a),this.elt(n,`height:`+o+`px;top:`+a+`px;left:0;right:0;`+(i||``))},e.prototype.drawScreenLineMarker=function(e,t,n,r,i){var a=this.$getTop(t.start.row,r),o=r.lineHeight;this.elt(n,`height:`+o+`px;top:`+a+`px;left:0;right:0;`+(i||``))},e}();a.prototype.$padding=0;function o(e,t,n,r){return!!e|(t?2:0)|(n?4:0)|(r?8:0)}t.Marker=a}),ace.define(`ace/layer/text_util`,[`require`,`exports`,`module`],function(e,t,n){var r=new Set([`text`,`rparen`,`lparen`]);t.isTextToken=function(e){return r.has(e)}}),ace.define(`ace/layer/text`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/dom`,`ace/lib/lang`,`ace/layer/lines`,`ace/lib/event_emitter`,`ace/config`,`ace/layer/text_util`],function(e,t,n){var r=e(\"../lib/oop\"),i=e(\"../lib/dom\"),a=e(\"../lib/lang\"),o=e(\"./lines\").Lines,s=e(\"../lib/event_emitter\").EventEmitter,c=e(\"../config\").nls,l=e(\"./text_util\").isTextToken,u=function(){function e(e){this.dom=i,this.element=this.dom.createElement(`div`),this.element.className=`ace_layer ace_text-layer`,e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new o(this.element)}return e.prototype.$updateEolChar=function(){var e=this.session.doc,t=e.getNewLineCharacter()==`\n`&&e.getNewLineMode()!=`windows`?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},e.prototype.setPadding=function(e){this.$padding=e,this.element.style.margin=`0 `+e+`px`},e.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},e.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},e.prototype.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on(`changeCharacterSize`,function(e){this._signal(`changeCharacterSize`,e)}.bind(this)),this.$pollSizeChanges()},e.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},e.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},e.prototype.setSession=function(e){this.session=e,e&&this.$computeTabString()},e.prototype.setShowInvisibles=function(e){return this.showInvisibles==e?!1:(this.showInvisibles=e,typeof e==`string`?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},e.prototype.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},e.prototype.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides===e?!1:(this.$highlightIndentGuides=e,e)},e.prototype.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;n<e+1;n++)if(this.showTabs){var r=this.dom.createElement(`span`);r.className=`ace_invisible ace_invisible_tab`,r.textContent=a.stringRepeat(this.TAB_CHAR,n),t.push(r)}else t.push(this.dom.createTextNode(a.stringRepeat(` `,n),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\\s\\S| \\t|\\t |\\s$/;var i=`ace_indent-guide`,o=this.showSpaces?` ace_invisible ace_invisible_space`:``,s=this.showSpaces?a.stringRepeat(this.SPACE_CHAR,this.tabSize):a.stringRepeat(` `,this.tabSize),c=this.showTabs?` ace_invisible ace_invisible_tab`:``,l=this.showTabs?a.stringRepeat(this.TAB_CHAR,this.tabSize):s,r=this.dom.createElement(`span`);r.className=i+o,r.textContent=s,this.$tabStrings[` `]=r;var r=this.dom.createElement(`span`);r.className=i+c,r.textContent=l,this.$tabStrings[`\t`]=r}},e.prototype.updateLines=function(e,t,n){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var r=Math.max(t,e.firstRow),i=Math.min(n,e.lastRow),a=this.element.childNodes,o=0,s=e.firstRow;s<r;s++){var c=this.session.getFoldLine(s);if(c)if(c.containsRow(r)){r=c.start.row;break}else s=c.end.row;o++}for(var l=!1,s=r,c=this.session.getNextFoldLine(s),u=c?c.start.row:1/0;s>u&&(s=c.end.row+1,c=this.session.getNextFoldLine(s,c),u=c?c.start.row:1/0),!(s>i);){var d=a[o++];if(d){this.dom.removeChildren(d),this.$renderLine(d,s,s==u?c:!1),l&&(d.style.top=this.$lines.computeLineTop(s,e,this.session)+`px`);var f=e.lineHeight*this.session.getRowLength(s)+`px`;d.style.height!=f&&(l=!0,d.style.height=f)}s++}if(l)for(;o<this.$lines.cells.length;){var p=this.$lines.cells[o++];p.element.style.top=this.$lines.computeLineTop(p.row,e,this.session)+`px`}},e.prototype.scrollLines=function(e){var t=this.config;if(this.config=e,this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=e.lastRow,r=t?t.lastRow:-1;if(!t||r<e.firstRow||n<t.firstRow||!t||t.lastRow<e.firstRow||e.lastRow<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var i=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);i>0;i--)this.$lines.shift();if(t.lastRow>e.lastRow)for(var i=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);i>0;i--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,t.firstRow-1)),e.lastRow>t.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow)),this.$highlightIndentGuide()},e.prototype.$renderLinesFragment=function(e,t,n){for(var r=[],a=t,o=this.session.getNextFoldLine(a),s=o?o.start.row:1/0;a>s&&(a=o.end.row+1,o=this.session.getNextFoldLine(a,o),s=o?o.start.row:1/0),!(a>n);){var c=this.$lines.createCell(a,e,this.session),l=c.element;this.dom.removeChildren(l),i.setStyle(l.style,`height`,this.$lines.computeLineHeight(a,e,this.session)+`px`),i.setStyle(l.style,`top`,this.$lines.computeLineTop(a,e,this.session)+`px`),this.$renderLine(l,a,a==s?o:!1),this.$useLineGroups()?l.className=`ace_line_group`:l.className=`ace_line`,r.push(c),a++}return r},e.prototype.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,r=this.$lines;r.getLength();)r.pop();r.push(this.$renderLinesFragment(e,t,n))},e.prototype.$renderToken=function(e,t,n,r){for(var i=this,o=/(\\t)|( +)|([\\x00-\\x1f\\x80-\\xa0\\xad\\u1680\\u180E\\u2000-\\u200f\\u2028\\u2029\\u202F\\u205F\\uFEFF\\uFFF9-\\uFFFC\\u2066\\u2067\\u2068\\u202A\\u202B\\u202D\\u202E\\u202C\\u2069\\u2060\\u2061\\u2062\\u2063\\u2064\\u206A\\u206B\\u206B\\u206C\\u206D\\u206E\\u206F]+)|(\\u3000)|([\\u1100-\\u115F\\u11A3-\\u11A7\\u11FA-\\u11FF\\u2329-\\u232A\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFB\\u3001-\\u303E\\u3041-\\u3096\\u3099-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u3190-\\u31BA\\u31C0-\\u31E3\\u31F0-\\u321E\\u3220-\\u3247\\u3250-\\u32FE\\u3300-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uA960-\\uA97C\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFAFF\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE66\\uFE68-\\uFE6B\\uFF01-\\uFF60\\uFFE0-\\uFFE6]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])/g,s=this.dom.createFragment(this.element),u,d=0;u=o.exec(r);){var f=u[1],p=u[2],m=u[3],h=u[4],g=u[5];if(!(!i.showSpaces&&p)){var _=d==u.index?``:r.slice(d,u.index);if(d=u.index+u[0].length,_&&s.appendChild(this.dom.createTextNode(_,this.element)),f){var v=i.session.getScreenTabSize(t+u.index),y=i.$tabStrings[v].cloneNode(!0);y.charCount=1,s.appendChild(y),t+=v-1}else if(p)if(i.showSpaces){var b=this.dom.createElement(`span`);b.className=`ace_invisible ace_invisible_space`,b.textContent=a.stringRepeat(i.SPACE_CHAR,p.length),s.appendChild(b)}else s.appendChild(this.dom.createTextNode(p,this.element));else if(m){var b=this.dom.createElement(`span`);b.className=`ace_invisible ace_invisible_space ace_invalid`,b.textContent=a.stringRepeat(i.SPACE_CHAR,m.length),s.appendChild(b)}else if(h){t+=1;var b=this.dom.createElement(`span`);b.style.width=i.config.characterWidth*2+`px`,b.className=i.showSpaces?`ace_cjk ace_invisible ace_invisible_space`:`ace_cjk`,b.textContent=i.showSpaces?i.SPACE_CHAR:h,s.appendChild(b)}else if(g){t+=1;var b=this.dom.createElement(`span`);b.style.width=i.config.characterWidth*2+`px`,b.className=`ace_cjk`,b.textContent=g,s.appendChild(b)}}}if(s.appendChild(this.dom.createTextNode(d?r.slice(d):r,this.element)),l(n.type))e.appendChild(s);else{var x=`ace_`+n.type.replace(/\\./g,` ace_`),b=this.dom.createElement(`span`);n.type==`fold`&&(b.style.width=n.value.length*this.config.characterWidth+`px`,b.setAttribute(`title`,c(`inline-fold.closed.title`,`Unfold code`))),b.className=x,b.appendChild(s),e.appendChild(b)}return t+r.length},e.prototype.renderIndentGuide=function(e,t,n){var r=t.search(this.$indentGuideRe);if(r<=0||r>=n)return t;if(t[0]==` `){r-=r%this.tabSize;for(var i=r/this.tabSize,a=0;a<i;a++)e.appendChild(this.$tabStrings[` `].cloneNode(!0));return this.$highlightIndentGuide(),t.substr(r)}else if(t[0]==`\t`){for(var a=0;a<r;a++){var o=this.$tabStrings[`\t`].cloneNode(!0);o.charCount=1,e.appendChild(o)}return this.$highlightIndentGuide(),t.substr(r)}return this.$highlightIndentGuide(),t},e.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var e=this.session.doc.$lines;if(e){var t=this.session.selection.getCursor(),n=/^\\s*/.exec(this.session.doc.getLine(t.row))[0].length,r=Math.floor(n/this.tabSize);if(this.$highlightIndentGuideMarker={indentLevel:r,start:t.row},this.session.$bracketHighlight){for(var i=this.session.$bracketHighlight.ranges,a=0;a<i.length;a++)if(t.row!==i[a].start.row){this.$highlightIndentGuideMarker.end=i[a].start.row+1,t.row>i[a].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&e[t.row]!==``&&t.column===e[t.row].length){this.$highlightIndentGuideMarker.dir=1;for(var a=t.row+1;a<e.length;a++){var o=e[a],s=/^\\s*/.exec(o)[0].length;if(o!==``&&(this.$highlightIndentGuideMarker.end=a,s<=n))break}}this.$renderHighlightIndentGuide()}}},e.prototype.$clearActiveIndentGuide=function(){for(var e=this.element.querySelectorAll(`.ace_indent-guide-active`),t=0;t<e.length;t++)e[t].classList.remove(`ace_indent-guide-active`)},e.prototype.$setIndentGuideActive=function(e,t){if(this.session.doc.getLine(e.row)!==``){var n=e.element;if(e.element.classList&&e.element.classList.contains(`ace_line_group`))if(e.element.childNodes.length>0)n=e.element.childNodes[0];else return;var r=n.childNodes;if(r){var i=r[t-1];i&&i.classList&&i.classList.contains(`ace_indent-guide`)&&i.classList.add(`ace_indent-guide-active`)}}},e.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var e=this.$lines.cells;this.$clearActiveIndentGuide();var t=this.$highlightIndentGuideMarker.indentLevel;if(t!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var n=0;n<e.length;n++){var r=e[n];if(this.$highlightIndentGuideMarker.end&&r.row>=this.$highlightIndentGuideMarker.start+1){if(r.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(r,t)}}else for(var n=e.length-1;n>=0;n--){var r=e[n];if(this.$highlightIndentGuideMarker.end&&r.row<this.$highlightIndentGuideMarker.start){if(r.row<this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(r,t)}}}},e.prototype.$createLineElement=function(e){var t=this.dom.createElement(`div`);return t.className=`ace_line`,t.style.height=this.config.lineHeight+`px`,t},e.prototype.$renderWrappedLine=function(e,t,n){var r=0,i=0,o=n[0],s=0,c=this.$createLineElement();e.appendChild(c);for(var l=0;l<t.length;l++){var u=t[l],d=u.value;if(l==0&&this.displayIndentGuides){if(r=d.length,d=this.renderIndentGuide(c,d,o),!d)continue;r-=d.length}if(r+d.length<o)s=this.$renderToken(c,s,u,d),r+=d.length;else{for(;r+d.length>=o;){s=this.$renderToken(c,s,u,d.substring(0,o-r)),d=d.substring(o-r),r=o,c=this.$createLineElement(),e.appendChild(c);var f=this.dom.createTextNode(a.stringRepeat(`\\xA0`,n.indent),this.element);f.charCount=0,c.appendChild(f),i++,s=0,o=n[i]||Number.MAX_VALUE}d.length!=0&&(r+=d.length,s=this.$renderToken(c,s,u,d))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(c,s,null,``,!0)},e.prototype.$renderSimpleLine=function(e,t){for(var n=0,r=0;r<t.length;r++){var i=t[r],a=i.value;if(!(r==0&&this.displayIndentGuides&&(a=this.renderIndentGuide(e,a),!a))){if(n+a.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,i,a);n=this.$renderToken(e,n,i,a)}}},e.prototype.$renderOverflowMessage=function(e,t,n,r,i){n&&this.$renderToken(e,t,n,r.slice(0,this.MAX_LINE_LENGTH-t));var a=this.dom.createElement(`span`);a.className=`ace_inline_button ace_keyword ace_toggle_wrap`,a.textContent=i?`<hide>`:`<click to see more...>`,e.appendChild(a)},e.prototype.$renderLine=function(e,t,n){if(!n&&n!=0&&(n=this.session.getFoldLine(t)),n)var r=this.$getFoldLineTokens(t,n);else var r=this.session.getTokens(t);var i=e;if(r.length){var a=this.session.getRowSplitData(t);if(a&&a.length){this.$renderWrappedLine(e,r,a);var i=e.lastChild}else{var i=e;this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i)),this.$renderSimpleLine(i,r)}}else this.$useLineGroups()&&(i=this.$createLineElement(),e.appendChild(i));if(this.showEOL&&i){n&&(t=n.end.row);var o=this.dom.createElement(`span`);o.className=`ace_invisible ace_invisible_eol`,o.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,i.appendChild(o)}},e.prototype.$getFoldLineTokens=function(e,t){var n=this.session,r=[];function i(e,t,n){for(var i=0,a=0;a+e[i].value.length<t;)if(a+=e[i].value.length,i++,i==e.length)return;if(a!=t){var o=e[i].value.substring(t-a);o.length>n-t&&(o=o.substring(0,n-t)),r.push({type:e[i].type,value:o}),a=t+o.length,i+=1}for(;a<n&&i<e.length;){var o=e[i].value;o.length+a>n?r.push({type:e[i].type,value:o.substring(0,n-a)}):r.push(e[i]),a+=o.length,i+=1}}var a=n.getTokens(e);return t.walk(function(e,t,o,s,c){e==null?(c&&(a=n.getTokens(t)),a.length&&i(a,s,o)):r.push({type:`fold`,value:e})},t.end.row,this.session.getLine(t.end.row).length),r},e.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},e}();u.prototype.EOF_CHAR=`\u00B6`,u.prototype.EOL_CHAR_LF=`\u00AC`,u.prototype.EOL_CHAR_CRLF=`\u00A4`,u.prototype.EOL_CHAR=u.prototype.EOL_CHAR_LF,u.prototype.TAB_CHAR=`\u2014`,u.prototype.SPACE_CHAR=`\u00B7`,u.prototype.$padding=0,u.prototype.MAX_LINE_LENGTH=1e4,u.prototype.showInvisibles=!1,u.prototype.showSpaces=!1,u.prototype.showTabs=!1,u.prototype.showEOL=!1,u.prototype.displayIndentGuides=!0,u.prototype.$highlightIndentGuides=!0,u.prototype.$tabStrings=[],u.prototype.destroy={},u.prototype.onChangeTabSize=u.prototype.$computeTabString,r.implement(u.prototype,s),t.Text=u}),ace.define(`ace/layer/cursor`,[`require`,`exports`,`module`,`ace/lib/dom`],function(e,t,n){var r=e(\"../lib/dom\"),i=function(){function e(e){this.element=r.createElement(`div`),this.element.className=`ace_layer ace_cursor-layer`,e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),r.addCssClass(this.element,`ace_hidden-cursors`),this.$updateCursors=this.$updateOpacity.bind(this)}return e.prototype.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)r.setStyle(t[n].style,`opacity`,e?``:`0`)},e.prototype.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+`ms`;this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&r.addCssClass(this.element,`ace_animate-blinking`)}.bind(this))},e.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,r.removeCssClass(this.element,`ace_animate-blinking`)},e.prototype.setPadding=function(e){this.$padding=e},e.prototype.setSession=function(e){this.session=e},e.prototype.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},e.prototype.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},e.prototype.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,`ace_smooth-blinking`,e),this.$updateCursors(!0),this.restartTimer())},e.prototype.addCursor=function(){var e=r.createElement(`div`);return e.className=`ace_cursor`,this.element.appendChild(e),this.cursors.push(e),e},e.prototype.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},e.prototype.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,`ace_hidden-cursors`),this.restartTimer()},e.prototype.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,`ace_hidden-cursors`),this.restartTimer()},e.prototype.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,r.removeCssClass(this.element,`ace_smooth-blinking`)),e(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&r.addCssClass(this.element,`ace_smooth-blinking`)}.bind(this))),r.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout(function(){e(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){e(!0),t()},this.blinkInterval),t()}},e.prototype.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||=this.session.selection.getCursor();var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},e.prototype.isCursorInView=function(e,t){return e.top>=0&&e.top<t.maxHeight},e.prototype.update=function(e){this.config=e;var t=this.session.$selectionMarkers,n=0,i=0;(t===void 0||t.length===0)&&(t=[{cursor:null}]);for(var n=0,a=t.length;n<a;n++){var o=this.getPixelPosition(t[n].cursor,!0);if(!((o.top>e.height+e.offset||o.top<0)&&n>1)){var s=this.cursors[i++]||this.addCursor(),c=s.style;this.drawCursor?this.drawCursor(s,o,e,t[n],this.session):this.isCursorInView(o,e)?(r.setStyle(c,`display`,`block`),r.translate(s,o.left,o.top),r.setStyle(c,`width`,Math.round(e.characterWidth)+`px`),r.setStyle(c,`height`,e.lineHeight+`px`)):r.setStyle(c,`display`,`none`)}}for(;this.cursors.length>i;)this.removeCursor();var l=this.session.getOverwrite();this.$setOverwrite(l),this.$pixelPos=o,this.restartTimer()},e.prototype.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?r.addCssClass(this.element,`ace_overwrite-cursors`):r.removeCssClass(this.element,`ace_overwrite-cursors`))},e.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},e}();i.prototype.$padding=0,i.prototype.drawCursor=null,t.Cursor=i}),ace.define(`ace/scrollbar`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/dom`,`ace/lib/event`,`ace/lib/event_emitter`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=e(\"./lib/oop\"),a=e(\"./lib/dom\"),o=e(\"./lib/event\"),s=e(\"./lib/event_emitter\").EventEmitter,c=32768,l=function(){function e(e,t){this.element=a.createElement(`div`),this.element.className=`ace_scrollbar ace_scrollbar`+t,this.element.tabIndex=-1,this.inner=a.createElement(`div`),this.inner.className=`ace_scrollbar-inner`,this.inner.textContent=`\\xA0`,this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,o.addListener(this.element,`scroll`,this.onScroll.bind(this)),o.addListener(this.element,`mousedown`,o.preventDefault)}return e.prototype.setVisible=function(e){this.element.style.display=e?``:`none`,this.isVisible=e,this.coeff=1},e}();i.implement(l.prototype,s);var u=function(e){r(t,e);function t(t,n){var r=e.call(this,t,`-v`)||this;return r.scrollTop=0,r.scrollHeight=0,n.$scrollbarWidth=r.width=a.scrollbarWidth(t.ownerDocument),r.inner.style.width=r.element.style.width=(r.width||15)+5+`px`,r.$minWidth=0,r}return t.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit(`scroll`,{data:this.scrollTop})}this.skipEvent=!1},t.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},t.prototype.setHeight=function(e){this.element.style.height=e+`px`},t.prototype.setScrollHeight=function(e){this.scrollHeight=e,e>c?(this.coeff=c/e,e=c):this.coeff!=1&&(this.coeff=1),this.inner.style.height=e+`px`},t.prototype.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)},t}(l);u.prototype.setInnerHeight=u.prototype.setScrollHeight;var d=function(e){r(t,e);function t(t,n){var r=e.call(this,t,`-h`)||this;return r.scrollLeft=0,r.height=n.$scrollbarWidth,r.inner.style.height=r.element.style.height=(r.height||15)+5+`px`,r}return t.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit(`scroll`,{data:this.scrollLeft})),this.skipEvent=!1},t.prototype.getHeight=function(){return this.isVisible?this.height:0},t.prototype.setWidth=function(e){this.element.style.width=e+`px`},t.prototype.setInnerWidth=function(e){this.inner.style.width=e+`px`},t.prototype.setScrollWidth=function(e){this.inner.style.width=e+`px`},t.prototype.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)},t}(l);t.ScrollBar=u,t.ScrollBarV=u,t.ScrollBarH=d,t.VScrollBar=u,t.HScrollBar=d}),ace.define(`ace/scrollbar_custom`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/dom`,`ace/lib/event`,`ace/lib/event_emitter`],function(e,t,n){var r=this&&this.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),i=e(\"./lib/oop\"),a=e(\"./lib/dom\"),o=e(\"./lib/event\"),s=e(\"./lib/event_emitter\").EventEmitter;a.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{\n position: absolute;\n background: rgba(128, 128, 128, 0.6);\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n border: 1px solid #bbb;\n border-radius: 2px;\n z-index: 8;\n}\n.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {\n position: absolute;\n z-index: 6;\n background: none;\n overflow: hidden!important;\n}\n.ace_editor>.ace_sb-v {\n z-index: 6;\n right: 0;\n top: 0;\n width: 12px;\n}\n.ace_editor>.ace_sb-v div {\n z-index: 8;\n right: 0;\n width: 100%;\n}\n.ace_editor>.ace_sb-h {\n bottom: 0;\n left: 0;\n height: 12px;\n}\n.ace_editor>.ace_sb-h div {\n bottom: 0;\n height: 100%;\n}\n.ace_editor>.ace_sb_grabbed {\n z-index: 8;\n background: #000;\n}`,`ace_scrollbar.css`,!1);var c=function(){function e(e,t){this.element=a.createElement(`div`),this.element.className=`ace_sb`+t,this.inner=a.createElement(`div`),this.inner.className=``,this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,o.addMultiMouseDownListener(this.element,[500,300,300],this,`onMouseDown`)}return e.prototype.setVisible=function(e){this.element.style.display=e?``:`none`,this.isVisible=e,this.coeff=1},e}();i.implement(c.prototype,s);var l=function(e){r(t,e);function t(t,n){var r=e.call(this,t,`-v`)||this;return r.scrollTop=0,r.scrollHeight=0,r.parent=t,r.width=r.VScrollWidth,r.renderer=n,r.inner.style.width=r.element.style.width=(r.width||15)+`px`,r.$minWidth=0,r}return t.prototype.onMouseDown=function(e,t){if(e===`mousedown`&&!(o.getButton(t)!==0||t.detail===2)){if(t.target===this.inner){var n=this,r=t.clientY,i=function(e){r=e.clientY},a=function(){clearInterval(u)},s=t.clientY,c=this.thumbTop,l=function(){if(r!==void 0){var e=n.scrollTopFromThumbTop(c+r-s);e!==n.scrollTop&&n._emit(`scroll`,{data:e})}};o.capture(this.inner,i,a);var u=setInterval(l,20);return o.preventDefault(t)}var d=t.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit(`scroll`,{data:this.scrollTopFromThumbTop(d)}),o.preventDefault(t)}},t.prototype.getHeight=function(){return this.height},t.prototype.scrollTopFromThumbTop=function(e){var t=e*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return t>>=0,t<0?t=0:t>this.pageHeight-this.viewHeight&&(t=this.pageHeight-this.viewHeight),t},t.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},t.prototype.setHeight=function(e){this.height=Math.max(0,e),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},t.prototype.setScrollHeight=function(e,t){this.pageHeight===e&&!t||(this.pageHeight=e,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+`px`,this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit(`scroll`,{data:this.scrollTop})))},t.prototype.setScrollTop=function(e){this.scrollTop=e,e<0&&(e=0),this.thumbTop=e*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+`px`},t}(c);l.prototype.setInnerHeight=l.prototype.setScrollHeight;var u=function(e){r(t,e);function t(t,n){var r=e.call(this,t,`-h`)||this;return r.scrollLeft=0,r.scrollWidth=0,r.height=r.HScrollHeight,r.inner.style.height=r.element.style.height=(r.height||12)+`px`,r.renderer=n,r}return t.prototype.onMouseDown=function(e,t){if(e===`mousedown`&&!(o.getButton(t)!==0||t.detail===2)){if(t.target===this.inner){var n=this,r=t.clientX,i=function(e){r=e.clientX},a=function(){clearInterval(u)},s=t.clientX,c=this.thumbLeft,l=function(){if(r!==void 0){var e=n.scrollLeftFromThumbLeft(c+r-s);e!==n.scrollLeft&&n._emit(`scroll`,{data:e})}};o.capture(this.inner,i,a);var u=setInterval(l,20);return o.preventDefault(t)}var d=t.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit(`scroll`,{data:this.scrollLeftFromThumbLeft(d)}),o.preventDefault(t)}},t.prototype.getHeight=function(){return this.isVisible?this.height:0},t.prototype.scrollLeftFromThumbLeft=function(e){var t=e*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return t>>=0,t<0?t=0:t>this.pageWidth-this.viewWidth&&(t=this.pageWidth-this.viewWidth),t},t.prototype.setWidth=function(e){this.width=Math.max(0,e),this.element.style.width=this.width+`px`,this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},t.prototype.setScrollWidth=function(e,t){this.pageWidth===e&&!t||(this.pageWidth=e,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+`px`,this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit(`scroll`,{data:this.scrollLeft})))},t.prototype.setScrollLeft=function(e){this.scrollLeft=e,e<0&&(e=0),this.thumbLeft=e*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+`px`},t}(c);u.prototype.setInnerWidth=u.prototype.setScrollWidth,t.ScrollBar=l,t.ScrollBarV=l,t.ScrollBarH=u,t.VScrollBar=l,t.HScrollBar=u}),ace.define(`ace/renderloop`,[`require`,`exports`,`module`,`ace/lib/event`],function(e,t,n){var r=e(\"./lib/event\");t.RenderLoop=function(){function e(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(r.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}}return e.prototype.schedule=function(e){this.changes|=e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},e.prototype.clear=function(e){var t=this.changes;return this.changes=0,t},e}()}),ace.define(`ace/layer/font_metrics`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/dom`,`ace/lib/lang`,`ace/lib/event`,`ace/lib/useragent`,`ace/lib/event_emitter`],function(e,t,n){var r=e(\"../lib/oop\"),i=e(\"../lib/dom\"),a=e(\"../lib/lang\"),o=e(\"../lib/event\"),s=e(\"../lib/useragent\"),c=e(\"../lib/event_emitter\").EventEmitter,l=512,u=typeof ResizeObserver==`function`,d=200,f=function(){function e(e){this.el=i.createElement(`div`),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=i.createElement(`div`),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=i.createElement(`div`),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.textContent=a.stringRepeat(`X`,l),this.$characterSize={width:0,height:0},u?this.$addObserver():this.checkForSizeChanges()}return e.prototype.$setMeasureNodeStyles=function(e,t){e.width=e.height=`auto`,e.left=e.top=`0px`,e.visibility=`hidden`,e.position=`absolute`,e.whiteSpace=`pre`,s.isIE<8?e[`font-family`]=`inherit`:e.font=`inherit`,e.overflow=t?`hidden`:`visible`},e.prototype.checkForSizeChanges=function(e){if(e===void 0&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight=`bold`;var t=this.$measureSizes();this.$measureNode.style.fontWeight=``,this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit(`changeCharacterSize`,{data:e})}},e.prototype.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver(function(t){e.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},e.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=o.onIdle(function t(){e.checkForSizeChanges(),o.onIdle(t,500)},500)},e.prototype.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&=(clearInterval(this.$pollSizeChangesTimer),0)},e.prototype.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/l};return t.width===0||t.height===0?null:t},e.prototype.$measureCharWidth=function(e){return this.$main.textContent=a.stringRepeat(e,l),this.$main.getBoundingClientRect().width/l},e.prototype.getCharacterWidth=function(e){var t=this.charSizes[e];return t===void 0&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},e.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.$getZoom=function(e){return!e||!e.parentElement?1:(Number(window.getComputedStyle(e).zoom)||1)*this.$getZoom(e.parentElement)},e.prototype.$initTransformMeasureNodes=function(){var e=function(e,t){return[`div`,{style:`position: absolute;top:`+e+`px;left:`+t+`px;`}]};this.els=i.buildDom([e(0,0),e(d,0),e(0,d),e(d,d)],this.el)},e.prototype.transformCoordinates=function(e,t){e&&=a(1/this.$getZoom(this.el),e);function n(e,t,n){var r=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/r,(+e[1]*n[0]-e[0]*n[1])/r]}function r(e,t){return[e[0]-t[0],e[1]-t[1]]}function i(e,t){return[e[0]+t[0],e[1]+t[1]]}function a(e,t){return[e*t[0],e*t[1]]}this.els||this.$initTransformMeasureNodes();function o(e){var t=e.getBoundingClientRect();return[t.left,t.top]}var s=o(this.els[0]),c=o(this.els[1]),l=o(this.els[2]),u=o(this.els[3]),f=n(r(u,c),r(u,l),r(i(c,l),i(u,s))),p=a(1+f[0],r(c,s)),m=a(1+f[1],r(l,s));if(t){var h=t,g=f[0]*h[0]/d+f[1]*h[1]/d+1,_=i(a(h[0],p),a(h[1],m));return i(a(1/g/d,_),s)}var v=r(e,s);return a(d,n(r(p,a(f[0],v)),r(m,a(f[1],v)),v))},e}();f.prototype.$characterSize={width:0,height:0},r.implement(f.prototype,c),t.FontMetrics=f}),ace.define(`ace/css/editor-css`,[`require`,`exports`,`module`],function(e,t,n){n.exports=`\n.ace_br1 {border-top-left-radius : 3px;}\n.ace_br2 {border-top-right-radius : 3px;}\n.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}\n.ace_br4 {border-bottom-right-radius: 3px;}\n.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}\n.ace_br8 {border-bottom-left-radius : 3px;}\n.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n\n\n.ace_editor {\n position: relative;\n overflow: hidden;\n padding: 0;\n font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', monospace;\n direction: ltr;\n text-align: left;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n forced-color-adjust: none;\n}\n\n.ace_scroller {\n position: absolute;\n overflow: hidden;\n top: 0;\n bottom: 0;\n background-color: inherit;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n cursor: text;\n}\n\n.ace_content {\n position: absolute;\n box-sizing: border-box;\n min-width: 100%;\n contain: style size layout;\n font-variant-ligatures: no-common-ligatures;\n}\n.ace_invisible {\n font-variant-ligatures: none;\n}\n\n.ace_keyboard-focus:focus {\n box-shadow: inset 0 0 0 2px #5E9ED6;\n outline: none;\n}\n\n.ace_dragging .ace_scroller:before{\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n content: '';\n background: rgba(250, 250, 250, 0.01);\n z-index: 1000;\n}\n.ace_dragging.ace_dark .ace_scroller:before{\n background: rgba(0, 0, 0, 0.01);\n}\n\n.ace_gutter {\n position: absolute;\n overflow : hidden;\n width: auto;\n top: 0;\n bottom: 0;\n left: 0;\n cursor: default;\n z-index: 4;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n contain: style size layout;\n}\n\n.ace_gutter-active-line {\n position: absolute;\n left: 0;\n right: 0;\n}\n\n.ace_scroller.ace_scroll-left:after {\n content: \"\";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\n pointer-events: none;\n}\n\n.ace_gutter-cell, .ace_gutter-cell_svg-icons {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-left: 19px;\n padding-right: 6px;\n background-repeat: no-repeat;\n}\n\n.ace_gutter-cell_svg-icons .ace_gutter_annotation {\n margin-left: -14px;\n float: left;\n}\n\n.ace_gutter-cell .ace_gutter_annotation {\n margin-left: -19px;\n float: left;\n}\n\n.ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold, .ace_gutter-cell.ace_security, .ace_icon.ace_security, .ace_icon.ace_security_fold {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_info, .ace_icon.ace_info, .ace_gutter-cell.ace_hint, .ace_icon.ace_hint {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=\");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info, .ace_dark .ace_gutter-cell.ace_hint, .ace_dark .ace_icon.ace_hint {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC\");\n}\n\n.ace_icon_svg.ace_error {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_security {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0iZGFya29yYW5nZSIgZmlsbD0ibm9uZSIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iPgogICAgICAgIDxwYXRoIGNsYXNzPSJzdHJva2UtbGluZWpvaW4tcm91bmQiIGQ9Ik04IDE0LjgzMDdDOCAxNC44MzA3IDIgMTIuOTA0NyAyIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOEM3Ljk4OTk5IDEuMzQ5MTggMTAuNjkgMy4yNjU0OCAxNCAzLjI2NTQ4VjguMDg5OTJDMTQgMTIuOTA0NyA4IDE0LjgzMDcgOCAxNC44MzA3WiIvPgogICAgICAgIDxwYXRoIGQ9Ik0yIDguMDg5OTJWMy4yNjU0OEM1LjMxIDMuMjY1NDggNy45ODk5OSAxLjM0OTE4IDcuOTg5OTkgMS4zNDkxOCIvPgogICAgICAgIDxwYXRoIGQ9Ik0xMy45OSA4LjA4OTkyVjMuMjY1NDhDMTAuNjggMy4yNjU0OCA4IDEuMzQ5MTggOCAxLjM0OTE4Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggNFY5Ii8+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTggMTBWMTIiLz4KICAgIDwvZz4KPC9zdmc+\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==\");\n background-color: darkorange;\n}\n.ace_icon_svg.ace_info {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==\");\n background-color: royalblue;\n}\n.ace_icon_svg.ace_hint {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZT0ic2lsdmVyIiBmaWxsPSJub25lIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CiAgICAgICAgPHBhdGggY2xhc3M9InN0cm9rZS1saW5lam9pbi1yb3VuZCIgZD0iTTYgMTRIMTAiLz4KICAgICAgICA8cGF0aCBkPSJNOCAxMUg5QzkgOS40NzAwMiAxMiA4LjU0MDAyIDEyIDUuNzYwMDJDMTIuMDIgNC40MDAwMiAxMS4zOSAzLjM2MDAyIDEwLjQzIDIuNjcwMDJDOSAxLjY0MDAyIDcuMDAwMDEgMS42NDAwMiA1LjU3MDAxIDIuNjcwMDJDNC42MTAwMSAzLjM2MDAyIDMuOTggNC40MDAwMiA0IDUuNzYwMDJDNCA4LjU0MDAyIDcuMDAwMDEgOS40NzAwMiA3LjAwMDAxIDExSDhaIi8+CiAgICA8L2c+Cjwvc3ZnPg==\");\n background-color: silver;\n}\n\n.ace_icon_svg.ace_error_fold {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_security_fold {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTcgMTQiIGZpbGw9Im5vbmUiPgogICAgPHBhdGggZD0iTTEwLjAwMDEgMTMuNjk5MkMxMC4wMDAxIDEzLjY5OTIgMTEuOTI0MSAxMy40NzYzIDEzIDEyLjY5OTJDMTQuNDEzOSAxMS42NzgxIDE2IDEwLjUgMTYuMTI1MSA2LjgxMTI2VjIuNTg5ODdDMTYuMTI1MSAyLjU0NzY4IDE2LjEyMjEgMi41MDYxOSAxNi4xMTY0IDIuNDY1NTlWMS43MTQ4NUgxNS4yNDE0TDE1LjIzMDcgMS43MTQ4NEwxNC42MjUxIDEuNjk5MjJWNi44MTEyM0MxNC42MjUxIDguNTEwNjEgMTQuNjI1MSA5LjQ2NDYxIDEyLjc4MjQgMTEuNzIxQzEyLjE1ODYgMTIuNDg0OCAxMC4wMDAxIDEzLjY5OTIgMTAuMDAwMSAxMy42OTkyWiIgZmlsbD0iY3JpbXNvbiIgc3Ryb2tlLXdpZHRoPSIyIi8+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuMzM2MDkgMC4zNjc0NzVDNy4wMzIxNCAwLjE1MjY1MiA2LjYyNTQ4IDAuMTUzNjE0IDYuMzIyNTMgMC4zNjk5OTdMNi4zMDg2OSAwLjM3OTU1NEM2LjI5NTUzIDAuMzg4NTg4IDYuMjczODggMC40MDMyNjYgNi4yNDQxNyAwLjQyMjc4OUM2LjE4NDcxIDAuNDYxODYgNi4wOTMyMSAwLjUyMDE3MSA1Ljk3MzEzIDAuNTkxMzczQzUuNzMyNTEgMC43MzQwNTkgNS4zNzk5IDAuOTI2ODY0IDQuOTQyNzkgMS4xMjAwOUM0LjA2MTQ0IDEuNTA5NyAyLjg3NTQxIDEuODgzNzcgMS41ODk4NCAxLjg4Mzc3SDAuNzE0ODQ0VjIuNzU4NzdWNi45ODAxNUMwLjcxNDg0NCA5LjQ5Mzc0IDIuMjg4NjYgMTEuMTk3MyAzLjcwMjU0IDEyLjIxODVDNC40MTg0NSAxMi43MzU1IDUuMTI4NzQgMTMuMTA1MyA1LjY1NzMzIDEzLjM0NTdDNS45MjI4NCAxMy40NjY0IDYuMTQ1NjYgMTMuNTU1OSA2LjMwNDY1IDEzLjYxNjFDNi4zODQyMyAxMy42NDYyIDYuNDQ4MDUgMTMuNjY5IDYuNDkzNDkgMTMuNjg0OEM2LjUxNjIyIDEzLjY5MjcgNi41MzQzOCAxMy42OTg5IDYuNTQ3NjQgMTMuNzAzM0w2LjU2MzgyIDEzLjcwODdMNi41NjkwOCAxMy43MTA0TDYuNTcwOTkgMTMuNzExTDYuODM5ODQgMTMuNzUzM0w2LjU3MjQyIDEzLjcxMTVDNi43NDYzMyAxMy43NjczIDYuOTMzMzUgMTMuNzY3MyA3LjEwNzI3IDEzLjcxMTVMNy4xMDg3IDEzLjcxMUw3LjExMDYxIDEzLjcxMDRMNy4xMTU4NyAxMy43MDg3TDcuMTMyMDUgMTMuNzAzM0M3LjE0NTMxIDEzLjY5ODkgNy4xNjM0NiAxMy42OTI3IDcuMTg2MTkgMTMuNjg0OEM3LjIzMTY0IDEzLjY2OSA3LjI5NTQ2IDEzLjY0NjIgNy4zNzUwMyAxMy42MTYxQzcuNTM0MDMgMTMuNTU1OSA3Ljc1Njg1IDEzLjQ2NjQgOC4wMjIzNiAxMy4zNDU3QzguNTUwOTUgMTMuMTA1MyA5LjI2MTIzIDEyLjczNTUgOS45NzcxNSAxMi4yMTg1QzExLjM5MSAxMS4xOTczIDEyLjk2NDggOS40OTM3NyAxMi45NjQ4IDYuOTgwMThWMi43NTg4QzEyLjk2NDggMi43MTY2IDEyLjk2MTkgMi42NzUxMSAxMi45NTYxIDIuNjM0NTFWMS44ODM3N0gxMi4wODExQzEyLjA3NzUgMS44ODM3NyAxMi4wNzQgMS44ODM3NyAxMi4wNzA0IDEuODgzNzdDMTAuNzk3OSAxLjg4MDA0IDkuNjE5NjIgMS41MTEwMiA4LjczODk0IDEuMTI0ODZDOC43MzUzNCAxLjEyMzI3IDguNzMxNzQgMS4xMjE2OCA4LjcyODE0IDEuMTIwMDlDOC4yOTEwMyAwLjkyNjg2NCA3LjkzODQyIDAuNzM0MDU5IDcuNjk3NzkgMC41OTEzNzNDNy41Nzc3MiAwLjUyMDE3MSA3LjQ4NjIyIDAuNDYxODYgNy40MjY3NiAwLjQyMjc4OUM3LjM5NzA1IDAuNDAzMjY2IDcuMzc1MzkgMC4zODg1ODggNy4zNjIyNCAwLjM3OTU1NEw3LjM0ODk2IDAuMzcwMzVDNy4zNDg5NiAwLjM3MDM1IDcuMzQ4NDcgMC4zNzAwMiA3LjM0NTYzIDAuMzc0MDU0TDcuMzM3NzkgMC4zNjg2NTlMNy4zMzYwOSAwLjM2NzQ3NVpNOC4wMzQ3MSAyLjcyNjkxQzguODYwNCAzLjA5MDYzIDkuOTYwNjYgMy40NjMwOSAxMS4yMDYxIDMuNTg5MDdWNi45ODAxNUgxMS4yMTQ4QzExLjIxNDggOC42Nzk1MyAxMC4xNjM3IDkuOTI1MDcgOC45NTI1NCAxMC43OTk4QzguMzU1OTUgMTEuMjMwNiA3Ljc1Mzc0IDExLjU0NTQgNy4yOTc5NiAxMS43NTI3QzcuMTE2NzEgMTEuODM1MSA2Ljk2MDYyIDExLjg5OTYgNi44Mzk4NCAxMS45NDY5QzYuNzE5MDYgMTEuODk5NiA2LjU2Mjk3IDExLjgzNTEgNi4zODE3MyAxMS43NTI3QzUuOTI1OTUgMTEuNTQ1NCA1LjMyMzczIDExLjIzMDYgNC43MjcxNSAxMC43OTk4QzMuNTE2MDMgOS45MjUwNyAyLjQ2NDg0IDguNjc5NTUgMi40NjQ4NCA2Ljk4MDE4VjMuNTg5MDlDMy43MTczOCAzLjQ2MjM5IDQuODIzMDggMy4wODYzOSA1LjY1MDMzIDIuNzIwNzFDNi4xNDIyOCAyLjUwMzI0IDYuNTQ0ODUgMi4yODUzNyA2LjgzMjU0IDIuMTE2MjRDNy4xMjE4MSAyLjI4NTM1IDcuNTI3IDIuNTAzNTIgOC4wMjE5NiAyLjcyMTMxQzguMDI2MiAyLjcyMzE3IDguMDMwNDUgMi43MjUwNCA4LjAzNDcxIDIuNzI2OTFaTTUuOTY0ODQgMy40MDE0N1Y3Ljc3NjQ3SDcuNzE0ODRWMy40MDE0N0g1Ljk2NDg0Wk01Ljk2NDg0IDEwLjQwMTVWOC42NTE0N0g3LjcxNDg0VjEwLjQwMTVINS45NjQ4NFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=\");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning_fold {\n -webkit-mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=\");\n background-color: darkorange;\n}\n\n.ace_scrollbar {\n contain: strict;\n position: absolute;\n right: 0;\n bottom: 0;\n z-index: 6;\n}\n\n.ace_scrollbar-inner {\n position: absolute;\n cursor: text;\n left: 0;\n top: 0;\n}\n\n.ace_scrollbar-v{\n overflow-x: hidden;\n overflow-y: scroll;\n top: 0;\n}\n\n.ace_scrollbar-h {\n overflow-x: scroll;\n overflow-y: hidden;\n left: 0;\n}\n\n.ace_print-margin {\n position: absolute;\n height: 100%;\n}\n\n.ace_text-input {\n position: absolute;\n z-index: 0;\n width: 0.5em;\n height: 1em;\n opacity: 0;\n background: transparent;\n -moz-appearance: none;\n appearance: none;\n border: none;\n resize: none;\n outline: none;\n overflow: hidden;\n font: inherit;\n padding: 0 1px;\n margin: 0 -1px;\n contain: strict;\n -ms-user-select: text;\n -moz-user-select: text;\n -webkit-user-select: text;\n user-select: text;\n /*with \\`pre-line\\` chrome inserts &nbsp; instead of space*/\n white-space: pre!important;\n}\n.ace_text-input.ace_composition {\n background: transparent;\n color: inherit;\n z-index: 1000;\n opacity: 1;\n}\n.ace_composition_placeholder { color: transparent }\n.ace_composition_marker { \n border-bottom: 1px solid;\n position: absolute;\n border-radius: 0;\n margin-top: 1px;\n}\n\n[ace_nocontext=true] {\n transform: none!important;\n filter: none!important;\n clip-path: none!important;\n mask : none!important;\n contain: none!important;\n perspective: none!important;\n mix-blend-mode: initial!important;\n z-index: auto;\n}\n\n.ace_layer {\n z-index: 1;\n position: absolute;\n overflow: hidden;\n /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/\n word-wrap: normal;\n white-space: pre;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n /* setting pointer-events: auto; on node under the mouse, which changes\n during scroll, will break mouse wheel scrolling in Safari */\n pointer-events: none;\n}\n\n.ace_gutter-layer {\n position: relative;\n width: auto;\n text-align: right;\n pointer-events: auto;\n height: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer {\n font: inherit !important;\n position: absolute;\n height: 1000000px;\n width: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {\n contain: style size layout;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n}\n\n.ace_hidpi .ace_text-layer,\n.ace_hidpi .ace_gutter-layer,\n.ace_hidpi .ace_content,\n.ace_hidpi .ace_gutter {\n contain: strict;\n}\n.ace_hidpi .ace_text-layer > .ace_line, \n.ace_hidpi .ace_text-layer > .ace_line_group {\n contain: strict;\n}\n\n.ace_cjk {\n display: inline-block;\n text-align: center;\n}\n\n.ace_cursor-layer {\n z-index: 4;\n}\n\n.ace_cursor {\n z-index: 4;\n position: absolute;\n box-sizing: border-box;\n border-left: 2px solid;\n /* workaround for smooth cursor repaintng whole screen in chrome */\n transform: translatez(0);\n}\n\n.ace_multiselect .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_slim-cursors .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_overwrite-cursors .ace_cursor {\n border-left-width: 0;\n border-bottom: 1px solid;\n}\n\n.ace_hidden-cursors .ace_cursor {\n opacity: 0.2;\n}\n\n.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\n opacity: 0;\n}\n\n.ace_smooth-blinking .ace_cursor {\n transition: opacity 0.18s;\n}\n\n.ace_animate-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: step-end;\n animation-name: blink-ace-animate;\n animation-iteration-count: infinite;\n}\n\n.ace_animate-blinking.ace_smooth-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: ease-in-out;\n animation-name: blink-ace-animate-smooth;\n}\n \n@keyframes blink-ace-animate {\n from, to { opacity: 1; }\n 60% { opacity: 0; }\n}\n\n@keyframes blink-ace-animate-smooth {\n from, to { opacity: 1; }\n 45% { opacity: 1; }\n 60% { opacity: 0; }\n 85% { opacity: 0; }\n}\n\n.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 5;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 6;\n}\n\n.ace_marker-layer .ace_error_bracket {\n position: absolute;\n border-bottom: 1px solid #DE5555;\n border-radius: 0;\n}\n\n.ace_marker-layer .ace_active-line {\n position: absolute;\n z-index: 2;\n}\n\n.ace_marker-layer .ace_selected-word {\n position: absolute;\n z-index: 4;\n box-sizing: border-box;\n}\n\n.ace_line .ace_fold {\n box-sizing: border-box;\n\n display: inline-block;\n height: 11px;\n margin-top: -2px;\n vertical-align: middle;\n\n background-image:\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=\");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n color: transparent;\n\n border: 1px solid black;\n border-radius: 2px;\n\n cursor: pointer;\n pointer-events: auto;\n}\n\n.ace_dark .ace_fold {\n}\n\n.ace_fold:hover{\n background-image:\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),\n url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC\");\n}\n\n.ace_tooltip {\n background-color: #f5f5f5;\n border: 1px solid gray;\n border-radius: 1px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n color: black;\n padding: 3px 4px;\n position: fixed;\n z-index: 999999;\n box-sizing: border-box;\n cursor: default;\n white-space: pre-wrap;\n word-wrap: break-word;\n line-height: normal;\n font-style: normal;\n font-weight: normal;\n letter-spacing: normal;\n pointer-events: none;\n overflow: auto;\n max-width: min(33em, 66vw);\n overscroll-behavior: contain;\n}\n.ace_tooltip pre {\n white-space: pre-wrap;\n}\n\n.ace_tooltip.ace_dark {\n background-color: #636363;\n color: #fff;\n}\n\n.ace_tooltip:focus {\n outline: 1px solid #5E9ED6;\n}\n\n.ace_icon {\n display: inline-block;\n width: 18px;\n vertical-align: top;\n}\n\n.ace_icon_svg {\n display: inline-block;\n width: 12px;\n vertical-align: top;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: 12px;\n -webkit-mask-position: center;\n}\n\n.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {\n padding-right: 13px;\n}\n\n.ace_fold-widget, .ace_custom-widget {\n box-sizing: border-box;\n\n margin: 0 -12px 0 1px;\n display: none;\n width: 11px;\n vertical-align: top;\n\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==\");\n background-repeat: no-repeat;\n background-position: center;\n\n border-radius: 3px;\n \n border: 1px solid transparent;\n cursor: pointer;\n pointer-events: auto;\n}\n\n.ace_custom-widget {\n background: none;\n}\n\n.ace_folding-enabled .ace_fold-widget {\n display: inline-block; \n}\n\n.ace_fold-widget.ace_end {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==\");\n}\n\n.ace_fold-widget.ace_closed {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==\");\n}\n\n.ace_fold-widget:hover {\n border: 1px solid rgba(0, 0, 0, 0.3);\n background-color: rgba(255, 255, 255, 0.2);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n}\n\n.ace_fold-widget:active {\n border: 1px solid rgba(0, 0, 0, 0.4);\n background-color: rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n}\n/**\n * Dark version for fold widgets\n */\n.ace_dark .ace_fold-widget {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC\");\n}\n.ace_dark .ace_fold-widget.ace_end {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==\");\n}\n.ace_dark .ace_fold-widget.ace_closed {\n background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==\");\n}\n.ace_dark .ace_fold-widget:hover {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n background-color: rgba(255, 255, 255, 0.1);\n}\n.ace_dark .ace_fold-widget:active {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n}\n\n.ace_inline_button {\n border: 1px solid lightgray;\n display: inline-block;\n margin: -1px 8px;\n padding: 0 5px;\n pointer-events: auto;\n cursor: pointer;\n}\n.ace_inline_button:hover {\n border-color: gray;\n background: rgba(200,200,200,0.2);\n display: inline-block;\n pointer-events: auto;\n}\n\n.ace_fold-widget.ace_invalid {\n background-color: #FFB4B4;\n border-color: #DE5555;\n}\n\n.ace_fade-fold-widgets .ace_fold-widget {\n transition: opacity 0.4s ease 0.05s;\n opacity: 0;\n}\n\n.ace_fade-fold-widgets:hover .ace_fold-widget {\n transition: opacity 0.05s ease 0.05s;\n opacity:1;\n}\n\n.ace_underline {\n text-decoration: underline;\n}\n\n.ace_bold {\n font-weight: bold;\n}\n\n.ace_nobold .ace_bold {\n font-weight: normal;\n}\n\n.ace_italic {\n font-style: italic;\n}\n\n\n.ace_error-marker {\n background-color: rgba(255, 0, 0,0.2);\n position: absolute;\n z-index: 9;\n}\n\n.ace_highlight-marker {\n background-color: rgba(255, 255, 0,0.2);\n position: absolute;\n z-index: 8;\n}\n\n.ace_mobile-menu {\n position: absolute;\n line-height: 1.5;\n border-radius: 4px;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n background: white;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #dcdcdc;\n color: black;\n}\n.ace_dark > .ace_mobile-menu {\n background: #333;\n color: #ccc;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #444;\n\n}\n.ace_mobile-button {\n padding: 2px;\n cursor: pointer;\n overflow: hidden;\n}\n.ace_mobile-button:hover {\n background-color: #eee;\n opacity:1;\n}\n.ace_mobile-button:active {\n background-color: #ddd;\n}\n\n.ace_placeholder {\n position: relative;\n font-family: arial;\n transform: scale(0.9);\n transform-origin: left;\n white-space: pre;\n opacity: 0.7;\n margin: 0 10px;\n z-index: 1;\n}\n\n.ace_ghost_text {\n opacity: 0.5;\n font-style: italic;\n}\n\n.ace_ghost_text_container > div {\n white-space: pre;\n}\n\n.ghost_text_line_wrapped::after {\n content: \"\u21A9\";\n position: absolute;\n}\n\n.ace_lineWidgetContainer.ace_ghost_text {\n margin: 0px 4px\n}\n\n.ace_screenreader-only {\n position:absolute;\n left:-10000px;\n top:auto;\n width:1px;\n height:1px;\n overflow:hidden;\n}\n\n.ace_hidden_token {\n display: none;\n}`}),ace.define(`ace/layer/decorators`,[`require`,`exports`,`module`,`ace/lib/dom`,`ace/lib/oop`,`ace/lib/event_emitter`],function(e,t,n){var r=e(\"../lib/dom\"),i=e(\"../lib/oop\"),a=e(\"../lib/event_emitter\").EventEmitter,o=function(){function e(e,t){this.renderer=t,this.pixelRatio=1,this.maxHeight=t.layerConfig.maxHeight,this.lineHeight=t.layerConfig.lineHeight,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.colors={},this.colors.dark={error:`rgba(255, 18, 18, 1)`,warning:`rgba(18, 136, 18, 1)`,info:`rgba(18, 18, 136, 1)`},this.colors.light={error:`rgb(255,51,51)`,warning:`rgb(32,133,72)`,info:`rgb(35,68,138)`},this.setScrollBarV(e)}return e.prototype.$createCanvas=function(){this.canvas=r.createElement(`canvas`),this.canvas.style.top=`0px`,this.canvas.style.right=`0px`,this.canvas.style.zIndex=`7`,this.canvas.style.position=`absolute`},e.prototype.setScrollBarV=function(e){this.$createCanvas(),this.scrollbarV=e,e.element.appendChild(this.canvas),this.setDimensions()},e.prototype.$updateDecorators=function(e){if(typeof this.canvas.getContext!=`function`)return;var t=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;this.setDimensions(e);var n=this.canvas.getContext(`2d`);function r(e,t){return e.priority<t.priority?-1:+(e.priority>t.priority)}var i=this.renderer.session.$annotations;if(n.clearRect(0,0,this.canvas.width,this.canvas.height),i){var a={info:1,warning:2,error:3};i.forEach(function(e){e.priority=a[e.type]||null}),i=i.sort(r);for(var o=0;o<i.length;o++){var s=i[o].row,c=this.getVerticalOffsetForRow(s),l=c+this.lineHeight,u=Math.round(this.heightRatio*c),d=Math.round(this.heightRatio*l),f=Math.round((u+d)/2),p=d-f;p<this.halfMinDecorationHeight&&(p=this.halfMinDecorationHeight),f-p<0&&(f=p),f+p>this.canvasHeight&&(f=this.canvasHeight-p);var m=f-p,h=f+p-m;n.fillStyle=t[i[o].type]||null,n.fillRect(0,m,Math.round(this.oneZoneWidth-1),h)}}var g=this.renderer.session.selection.getCursor();if(g){var _=Math.round(this.getVerticalOffsetForRow(g.row)*this.heightRatio);n.fillStyle=`rgba(0, 0, 0, 0.5)`,n.fillRect(0,_,this.canvasWidth,2)}},e.prototype.getVerticalOffsetForRow=function(e){return e|=0,this.renderer.session.documentToScreenRow(e,0)*this.lineHeight},e.prototype.setDimensions=function(e){e||=this.renderer.layerConfig,this.maxHeight=e.maxHeight,this.lineHeight=e.lineHeight,this.canvasHeight=e.height,this.canvasWidth=this.scrollbarV.width||this.canvasWidth,this.setZoneWidth(),this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.maxHeight<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight},e.prototype.setZoneWidth=function(){this.oneZoneWidth=this.canvasWidth},e.prototype.destroy=function(){this.canvas.parentNode.removeChild(this.canvas)},e}();i.implement(o.prototype,a),t.Decorator=o}),ace.define(`ace/virtual_renderer`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/dom`,`ace/lib/lang`,`ace/config`,`ace/layer/gutter`,`ace/layer/marker`,`ace/layer/text`,`ace/layer/cursor`,`ace/scrollbar`,`ace/scrollbar`,`ace/scrollbar_custom`,`ace/scrollbar_custom`,`ace/renderloop`,`ace/layer/font_metrics`,`ace/lib/event_emitter`,`ace/css/editor-css`,`ace/layer/decorators`,`ace/lib/useragent`,`ace/layer/text_util`],function(e,t,n){var r=e(\"./lib/oop\"),i=e(\"./lib/dom\"),a=e(\"./lib/lang\"),o=e(\"./config\"),s=e(\"./layer/gutter\").Gutter,c=e(\"./layer/marker\").Marker,l=e(\"./layer/text\").Text,u=e(\"./layer/cursor\").Cursor,d=e(\"./scrollbar\").HScrollBar,f=e(\"./scrollbar\").VScrollBar,p=e(\"./scrollbar_custom\").HScrollBar,m=e(\"./scrollbar_custom\").VScrollBar,h=e(\"./renderloop\").RenderLoop,g=e(\"./layer/font_metrics\").FontMetrics,_=e(\"./lib/event_emitter\").EventEmitter,v=e(\"./css/editor-css\"),y=e(\"./layer/decorators\").Decorator,b=e(\"./lib/useragent\"),x=e(\"./layer/text_util\").isTextToken;i.importCssString(v,`ace_editor.css`,!1);var S=function(){function e(e,t){var n=this;this.container=e||i.createElement(`div`),i.addCssClass(this.container,`ace_editor`),i.HI_DPI&&i.addCssClass(this.container,`ace_hidpi`),this.setTheme(t),o.get(`useStrictCSP`)??o.set(`useStrictCSP`,!1),this.$gutter=i.createElement(`div`),this.$gutter.className=`ace_gutter`,this.container.appendChild(this.$gutter),this.$gutter.setAttribute(`aria-hidden`,`true`),this.scroller=i.createElement(`div`),this.scroller.className=`ace_scroller`,this.container.appendChild(this.scroller),this.content=i.createElement(`div`),this.content.className=`ace_content`,this.scroller.appendChild(this.content),this.$gutterLayer=new s(this.$gutter),this.$gutterLayer.on(`changeGutterWidth`,this.onGutterResize.bind(this)),this.$markerBack=new c(this.content);var r=this.$textLayer=new l(this.content);this.canvas=r.element,this.$markerFront=new c(this.content),this.$cursorLayer=new u(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new f(this.container,this),this.scrollBarH=new d(this.container,this),this.scrollBarV.on(`scroll`,function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)}),this.scrollBarH.on(`scroll`,function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new g(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on(`changeCharacterSize`,function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal(`changeCharacterSize`,e)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!b.isIOS,this.$loop=new h(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),o.resetOptions(this),o._signal(`renderer`,this)}return e.prototype.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle(`ace_nobold`,!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),i.setStyle(this.scroller.style,`line-height`,this.lineHeight+`px`)},e.prototype.setSession=function(e){this.session&&this.session.doc.off(`changeNewLineMode`,this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on(`changeNewLineMode`,this.onChangeNewLineMode))},e.prototype.updateLines=function(e,t,n){if(t===void 0&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRow<t&&(this.$changedLines.lastRow=t)):this.$changedLines={firstRow:e,lastRow:t},this.$changedLines.lastRow<this.layerConfig.firstRow)if(n)this.$changedLines.lastRow=this.layerConfig.lastRow;else return;this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},e.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},e.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},e.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},e.prototype.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},e.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},e.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},e.prototype.onResize=function(e,t,n,r){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=+!!e;var i=this.container;r||=i.clientHeight||i.scrollHeight,!r&&this.$maxLines&&this.lineHeight>1&&(!i.style.height||i.style.height==`0px`)&&(i.style.height=`1px`,r=i.clientHeight||i.scrollHeight),n||=i.clientWidth||i.scrollWidth;var a=this.$updateCachedSize(e,t,n,r);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!n&&!r)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(a|this.$changes,!0):this.$loop.schedule(a|this.$changes),this.resizing&&=0,this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},e.prototype.$updateCachedSize=function(e,t,n,r){r-=this.$extraHeight||0;var a=0,o=this.$size,s={width:o.width,height:o.height,scrollerHeight:o.scrollerHeight,scrollerWidth:o.scrollerWidth};if(r&&(e||o.height!=r)&&(o.height=r,a|=this.CHANGE_SIZE,o.scrollerHeight=o.height,this.$horizScroll&&(o.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(o.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+`px`,a|=this.CHANGE_SCROLL),n&&(e||o.width!=n)){a|=this.CHANGE_SIZE,o.width=n,t??=this.$showGutter?this.$gutter.offsetWidth:0,this.gutterWidth=t,i.setStyle(this.scrollBarH.element.style,`left`,t+`px`),i.setStyle(this.scroller.style,`left`,t+this.margin.left+`px`),o.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),i.setStyle(this.$gutter.style,`left`,this.margin.left+`px`);var c=this.scrollBarV.getWidth()+`px`;i.setStyle(this.scrollBarH.element.style,`right`,c),i.setStyle(this.scroller.style,`right`,c),i.setStyle(this.scroller.style,`bottom`,this.scrollBarH.getHeight()),this.scrollBarH.setWidth(o.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(a|=this.CHANGE_FULL)}return o.$dirty=!n||!r,a&&this._signal(`resize`,s),a},e.prototype.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},e.prototype.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-this.$padding*2,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},e.prototype.setAnimatedScroll=function(e){this.setOption(`animatedScroll`,e)},e.prototype.getAnimatedScroll=function(){return this.$animatedScroll},e.prototype.setShowInvisibles=function(e){this.setOption(`showInvisibles`,e),this.session.$bidiHandler.setShowInvisibles(e)},e.prototype.getShowInvisibles=function(){return this.getOption(`showInvisibles`)},e.prototype.getDisplayIndentGuides=function(){return this.getOption(`displayIndentGuides`)},e.prototype.setDisplayIndentGuides=function(e){this.setOption(`displayIndentGuides`,e)},e.prototype.getHighlightIndentGuides=function(){return this.getOption(`highlightIndentGuides`)},e.prototype.setHighlightIndentGuides=function(e){this.setOption(`highlightIndentGuides`,e)},e.prototype.setShowPrintMargin=function(e){this.setOption(`showPrintMargin`,e)},e.prototype.getShowPrintMargin=function(){return this.getOption(`showPrintMargin`)},e.prototype.setPrintMarginColumn=function(e){this.setOption(`printMarginColumn`,e)},e.prototype.getPrintMarginColumn=function(){return this.getOption(`printMarginColumn`)},e.prototype.getShowGutter=function(){return this.getOption(`showGutter`)},e.prototype.setShowGutter=function(e){return this.setOption(`showGutter`,e)},e.prototype.getFadeFoldWidgets=function(){return this.getOption(`fadeFoldWidgets`)},e.prototype.setFadeFoldWidgets=function(e){this.setOption(`fadeFoldWidgets`,e)},e.prototype.setHighlightGutterLine=function(e){this.setOption(`highlightGutterLine`,e)},e.prototype.getHighlightGutterLine=function(){return this.getOption(`highlightGutterLine`)},e.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var e=i.createElement(`div`);e.className=`ace_layer ace_print-margin-layer`,this.$printMarginEl=i.createElement(`div`),this.$printMarginEl.className=`ace_print-margin`,e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+`px`,t.visibility=this.$showPrintMargin?`visible`:`hidden`,this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},e.prototype.getContainerElement=function(){return this.container},e.prototype.getMouseEventTarget=function(){return this.scroller},e.prototype.getTextAreaContainer=function(){return this.container},e.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(!this.$keepTextAreaAtCursor&&!t){i.translate(this.textarea,-100,0);return}var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var r=this.layerConfig,a=n.top,o=n.left;a-=r.offset;var s=t&&t.useTextareaForIME||b.isMobile?this.lineHeight:1;if(a<0||a>r.height-s){i.translate(this.textarea,0,0);return}var c=1,l=this.$size.height-s;if(!t)a+=this.lineHeight;else if(t.useTextareaForIME){var u=this.textarea.value;c=this.characterWidth*this.session.$getStringScreenWidth(u)[0]}else a+=this.lineHeight+2;o-=this.scrollLeft,o>this.$size.scrollerWidth-c&&(o=this.$size.scrollerWidth-c),o+=this.gutterWidth+this.margin.left,i.setStyle(e,`height`,s+`px`),i.setStyle(e,`width`,c+`px`),i.translate(this.textarea,Math.min(o,this.$size.scrollerWidth-c),Math.min(a,l))}}},e.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},e.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},e.prototype.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},e.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},e.prototype.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},e.prototype.setScrollMargin=function(e,t,n,r){var i=this.scrollMargin;i.top=e|0,i.bottom=t|0,i.right=r|0,i.left=n|0,i.v=i.top+i.bottom,i.h=i.left+i.right,i.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-i.top),this.updateFull()},e.prototype.setMargin=function(e,t,n,r){var i=this.margin;i.top=e|0,i.bottom=t|0,i.right=r|0,i.left=n|0,i.v=i.top+i.bottom,i.h=i.left+i.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},e.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},e.prototype.setHScrollBarAlwaysVisible=function(e){this.setOption(`hScrollBarAlwaysVisible`,e)},e.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},e.prototype.setVScrollBarAlwaysVisible=function(e){this.setOption(`vScrollBarAlwaysVisible`,e)},e.prototype.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},e.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},e.prototype.freeze=function(){this.$frozen=!0},e.prototype.unfreeze=function(){this.$frozen=!1},e.prototype.$renderChanges=function(e,t){if(this.$changes&&=(e|=this.$changes,0),!this.session||!this.container.offsetWidth||this.$frozen||!e&&!t){this.$changes|=e;return}if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal(`beforeRender`,e),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var r=this.scrollTop+(n.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;r>0&&(this.scrollTop=r,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),i.translate(this.content,-this.scrollLeft,-n.offset);var a=n.width+2*this.$padding+`px`,o=n.minHeight+`px`;i.setStyle(this.content.style,`width`,a),i.setStyle(this.content.style,`height`,o)}if(e&this.CHANGE_H_SCROLL&&(i.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?`ace_scroller `:`ace_scroller ace_scroll-left `,this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),e&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),this._signal(`afterRender`,e);return}if(e&this.CHANGE_SCROLL){this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),this._signal(`afterRender`,e);return}e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)):e&this.CHANGE_LINES?((this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)):e&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal(`afterRender`,e)},e.prototype.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var r=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||r!=this.$vScroll){r!=this.$vScroll&&(this.$vScroll=r,this.scrollBarV.setVisible(r));var i=this.container.clientWidth;this.container.style.height=n+`px`,this.$updateCachedSize(!0,this.$gutterWidth,i,n),this.desiredHeight=n,this._signal(`autosize`)}},e.prototype.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,r=this.session.getScreenLength()*this.lineHeight,i=this.$getLongestLine(),a=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-i-2*this.$padding<0),o=this.$horizScroll!==a;o&&(this.$horizScroll=a,this.scrollBarH.setVisible(a));var s=this.$vScroll;this.$maxLines&&this.lineHeight>1&&(this.$autosize(),n=t.height<=2*this.lineHeight);var c=t.scrollerHeight+this.lineHeight,l=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;r+=l;var u=this.scrollMargin;this.session.setScrollTop(Math.max(-u.top,Math.min(this.scrollTop,r-t.scrollerHeight+u.bottom))),this.session.setScrollLeft(Math.max(-u.left,Math.min(this.scrollLeft,i+2*this.$padding-t.scrollerWidth+u.right)));var d=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-r+l<0||this.scrollTop>u.top),f=s!==d;f&&(this.$vScroll=d,this.scrollBarV.setVisible(d));var p=this.scrollTop%this.lineHeight,m=Math.ceil(c/this.lineHeight)-1,h=Math.max(0,Math.round((this.scrollTop-p)/this.lineHeight)),g=h+m,_,v,y=this.lineHeight;h=e.screenToDocumentRow(h,0);var b=e.getFoldLine(h);b&&(h=b.start.row),_=e.documentToScreenRow(h,0),v=e.getRowLength(h)*y,g=Math.min(e.screenToDocumentRow(g,0),e.getLength()-1),c=t.scrollerHeight+e.getRowLength(g)*y+v,p=this.scrollTop-_*y,p<0&&_>0&&(_=Math.max(0,_+Math.floor(p/y)),p=this.scrollTop-_*y);var x=0;return(this.layerConfig.width!=i||o)&&(x=this.CHANGE_H_SCROLL),(o||f)&&(x|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal(`scrollbarVisibilityChanged`),f&&(i=this.$getLongestLine())),this.layerConfig={width:i,padding:this.$padding,firstRow:h,firstRowScreen:_,lastRow:g,lineHeight:y,characterWidth:this.characterWidth,minHeight:c,maxHeight:r,offset:p,gutterOffset:y?Math.max(0,Math.ceil((p+t.height-t.scrollerHeight)/y)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(i-this.$padding),x},e.prototype.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1)&&!(t<n.firstRow)){if(t===1/0){this.$showGutter&&this.$gutterLayer.update(n),this.$textLayer.update(n);return}return this.$textLayer.updateLines(n,e,t),!0}}},e.prototype.$getLongestLine=function(){var e=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(e+=1),this.$textLayer&&e>this.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},e.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},e.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},e.prototype.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},e.prototype.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},e.prototype.updateBreakpoints=function(e){this._rows=e,this.$loop.schedule(this.CHANGE_GUTTER)},e.prototype.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},e.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},e.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},e.prototype.showCursor=function(){this.$cursorLayer.showCursor()},e.prototype.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},e.prototype.scrollCursorIntoView=function(e,t,n){if(this.$size.scrollerHeight!==0){var r=this.$cursorLayer.getPixelPosition(e),i=r.left,a=r.top,o=n&&n.top||0,s=n&&n.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var c=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;c+o>a?(t&&c+o>a+this.lineHeight&&(a-=t*this.$size.scrollerHeight),a===0&&(a=-this.scrollMargin.top),this.session.setScrollTop(a)):c+this.$size.scrollerHeight-s<a+this.lineHeight&&(t&&c+this.$size.scrollerHeight-s<a-this.lineHeight&&(a+=t*this.$size.scrollerHeight),this.session.setScrollTop(a+this.lineHeight+s-this.$size.scrollerHeight));var l=this.scrollLeft,u=2*this.layerConfig.characterWidth;i-u<l?(i-=u,i<this.$padding+u&&(i=-this.scrollMargin.left),this.session.setScrollLeft(i)):(i+=u,l+this.$size.scrollerWidth<i+this.characterWidth?this.session.setScrollLeft(Math.round(i+this.characterWidth-this.$size.scrollerWidth)):l<=this.$padding&&i-l<this.characterWidth&&this.session.setScrollLeft(0))}},e.prototype.getScrollTop=function(){return this.session.getScrollTop()},e.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},e.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},e.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},e.prototype.scrollToRow=function(e){this.session.setScrollTop(e*this.lineHeight)},e.prototype.alignCursor=function(e,t){typeof e==`number`&&(e={row:e,column:0});var n=this.$cursorLayer.getPixelPosition(e),r=this.$size.scrollerHeight-this.lineHeight,i=n.top-r*(t||0);return this.session.setScrollTop(i),i},e.prototype.$calcSteps=function(e,t){var n=0,r=this.STEPS,i=[],a=function(e,t,n){return n*((e-1)**3+1)+t};for(n=0;n<r;++n)i.push(a(n/this.STEPS,e,t-e));return i},e.prototype.scrollToLine=function(e,t,n,r){var i=this.$cursorLayer.getPixelPosition({row:e,column:0}).top;t&&(i-=this.$size.scrollerHeight/2);var a=this.scrollTop;this.session.setScrollTop(i),n!==!1&&this.animateScrolling(a,r)},e.prototype.animateScrolling=function(e,t){var n=this.scrollTop;if(!this.$animatedScroll)return;var r=this;if(e==n)return;if(this.$scrollAnimation){var i=this.$scrollAnimation.steps;if(i.length&&(e=i[0],e==n))return}var a=r.$calcSteps(e,n);this.$scrollAnimation={from:e,to:n,steps:a},clearInterval(this.$timer),r.session.setScrollTop(a.shift()),r.session.$scrollTop=n;function o(){r.$timer=clearInterval(r.$timer),r.$scrollAnimation=null,r.$stopAnimation=!1,t&&t()}this.$timer=setInterval(function(){if(r.$stopAnimation){o();return}if(!r.session)return clearInterval(r.$timer);a.length?(r.session.setScrollTop(a.shift()),r.session.$scrollTop=n):n==null?o():(r.session.$scrollTop=-1,r.session.setScrollTop(n),n=null)},10)},e.prototype.scrollToY=function(e){this.scrollTop!==e&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=e)},e.prototype.scrollToX=function(e){this.scrollLeft!==e&&(this.scrollLeft=e),this.$loop.schedule(this.CHANGE_H_SCROLL)},e.prototype.scrollTo=function(e,t){this.session.setScrollTop(t),this.session.setScrollLeft(e)},e.prototype.scrollBy=function(e,t){t&&this.session.setScrollTop(this.session.getScrollTop()+t),e&&this.session.setScrollLeft(this.session.getScrollLeft()+e)},e.prototype.isScrollableBy=function(e,t){if(t<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},e.prototype.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,a=i/this.characterWidth,o=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),s=this.$blockCursor?Math.floor(a):Math.round(a);return{row:o,column:s,side:a-s>0?1:-1,offsetX:i}},e.prototype.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var r=this.$fontMetrics.transformCoordinates([e,t]);e=r[1]-this.gutterWidth-this.margin.left,t=r[0]}else n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,a=i/this.characterWidth,o=this.$blockCursor?Math.floor(a):Math.round(a),s=(t+this.scrollTop-n.top)/this.lineHeight;return this.session.screenToDocumentPosition(s,Math.max(o,0),i)},e.prototype.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),r=this.session.documentToScreenPosition(e,t),i=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,e)?this.session.$bidiHandler.getPosLeft(r.column):Math.round(r.column*this.characterWidth)),a=r.row*this.lineHeight;return{pageX:n.left+i-this.scrollLeft,pageY:n.top+a-this.scrollTop}},e.prototype.visualizeFocus=function(){i.addCssClass(this.container,`ace_focus`)},e.prototype.visualizeBlur=function(){i.removeCssClass(this.container,`ace_focus`)},e.prototype.showComposition=function(e){this.$composition=e,e.cssText||=this.textarea.style.cssText,e.useTextareaForIME??=this.$useTextareaForIME,this.$useTextareaForIME?(i.addCssClass(this.textarea,`ace_composition`),this.textarea.style.cssText=``,this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display=`none`):e.markerId=this.session.addMarker(e.markerRange,`ace_composition_marker`,`text`)},e.prototype.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,`composition_placeholder`,t.row,t.column),this.$moveTextAreaToCursor()},e.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),i.removeCssClass(this.textarea,`ace_composition`),this.textarea.style.cssText=this.$composition.cssText;var e=this.session.selection.cursor;this.removeExtraToken(e.row,e.column),this.$composition=null,this.$cursorLayer.element.style.display=``}},e.prototype.setGhostText=function(e,t){var n=this.session.selection.cursor,r=t||{row:n.row,column:n.column};this.removeGhostText();var a=this.$calculateWrappedTextChunks(e,r);this.addToken(a[0].text,`ghost_text`,r.row,r.column),this.$ghostText={text:e,position:{row:r.row,column:r.column}};var o=i.createElement(`div`);if(a.length>1){var s=this.hideTokensAfterPosition(r.row,r.column),c;a.slice(1).forEach(function(e){var t=i.createElement(`div`),n=i.createElement(`span`);n.className=`ace_ghost_text`,e.wrapped&&(t.className=`ghost_text_line_wrapped`),e.text.length===0&&(e.text=` `),n.appendChild(i.createTextNode(e.text)),t.appendChild(n),o.appendChild(t),c=t}),s.forEach(function(e){var t=i.createElement(`span`);x(e.type)||(t.className=`ace_`+e.type.replace(/\\./g,` ace_`)),t.appendChild(i.createTextNode(e.value)),c.appendChild(t)}),this.$ghostTextWidget={el:o,row:r.row,column:r.column,className:`ace_ghost_text_container`},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var l=this.$cursorLayer.getPixelPosition(r,!0),u=this.container.getBoundingClientRect().height,d=a.length*this.lineHeight;if(d<u-l.top)return;d<u?this.scrollBy(0,(a.length-1)*this.lineHeight):this.scrollToRow(r.row)}},e.prototype.$calculateWrappedTextChunks=function(e,t){var n=this.$size.scrollerWidth-this.$padding*2,r=Math.floor(n/this.characterWidth)-2;r=r<=0?60:r;for(var i=e.split(/\\r?\\n/),a=[],o=0;o<i.length;o++){var s=this.session.$getDisplayTokens(i[o],t.column),c=this.session.$computeWrapSplits(s,r,this.session.$tabSize);if(c.length>0){var l=0;c.push(i[o].length);for(var u=0;u<c.length;u++){var d=i[o].slice(l,c[u]);a.push({text:d,wrapped:!0}),l=c[u]}}else a.push({text:i[o],wrapped:!1})}return a},e.prototype.removeGhostText=function(){if(this.$ghostText){var e=this.$ghostText.position;this.removeExtraToken(e.row,e.column),this.$ghostTextWidget&&=(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),null),this.$ghostText=null}},e.prototype.addToken=function(e,t,n,r){var i=this.session;i.bgTokenizer.lines[n]=null;var a={type:t,value:e},o=i.getTokens(n);if(r==null||!o.length)o.push(a);else for(var s=0,c=0;c<o.length;c++){var l=o[c];if(s+=l.value.length,r<=s){var u=l.value.length-(s-r),d=l.value.slice(0,u),f=l.value.slice(u);o.splice(c,1,{type:l.type,value:d},a,{type:l.type,value:f});break}}this.updateLines(n,n)},e.prototype.hideTokensAfterPosition=function(e,t){for(var n=this.session.getTokens(e),r=0,i=!1,a=[],o=0;o<n.length;o++){var s=n[o];if(r+=s.value.length,s.type!==`ghost_text`){if(i){a.push({type:s.type,value:s.value}),s.type=`hidden_token`;continue}r===t&&(i=!0)}}return this.updateLines(e,e),a},e.prototype.removeExtraToken=function(e,t){this.session.bgTokenizer.lines[e]=null,this.updateLines(e,e)},e.prototype.setTheme=function(e,t){var n=this;if(this.$themeId=e,n._dispatchEvent(`themeChange`,{theme:e}),!e||typeof e==`string`){var r=e||this.$options.theme.initialValue;o.loadModule([`theme`,r],a)}else a(e);function a(r){if(n.$themeId!=e)return t&&t();if(!r||!r.cssClass)throw Error(`couldn't load module `+e+` or it didn't call define`);r.$id&&(n.$themeId=r.$id),i.importCssString(r.cssText,r.cssClass,n.container),n.theme&&i.removeCssClass(n.container,n.theme.cssClass);var a=`padding`in r?r.padding:`padding`in(n.theme||{})?4:n.$padding;if(n.$padding&&a!=n.$padding&&n.setPadding(a),n.$gutterLayer){var o=r.$showGutterCursorMarker;o&&!n.$gutterLayer.$showCursorMarker?n.$gutterLayer.$showCursorMarker=`theme`:!o&&n.$gutterLayer.$showCursorMarker==`theme`&&(n.$gutterLayer.$showCursorMarker=null)}n.$theme=r.cssClass,n.theme=r,i.addCssClass(n.container,r.cssClass),i.setCssClass(n.container,`ace_dark`,r.isDark),n.$size&&(n.$size.width=0,n.$updateSizeAsync()),n._dispatchEvent(`themeLoaded`,{theme:r}),t&&t(),b.isSafari&&n.scroller&&(n.scroller.style.background=`red`,n.scroller.style.background=``)}},e.prototype.getTheme=function(){return this.$themeId},e.prototype.setStyle=function(e,t){i.setCssClass(this.container,e,t!==!1)},e.prototype.unsetStyle=function(e){i.removeCssClass(this.container,e)},e.prototype.setCursorStyle=function(e){i.setStyle(this.scroller.style,`cursor`,e)},e.prototype.setMouseCursor=function(e){i.setStyle(this.scroller.style,`cursor`,e)},e.prototype.attachToShadowRoot=function(){i.importCssString(v,`ace_editor.css`,this.container)},e.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent=``,this.setOption(`useResizeObserver`,!1)},e.prototype.$updateCustomScrollbar=function(e){var t=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),e===!0?(this.scrollBarV=new m(this.container,this),this.scrollBarH=new p(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener(`scroll`,function(e){t.$scrollAnimation||t.session.setScrollTop(e.data-t.scrollMargin.top)}),this.scrollBarH.addEventListener(`scroll`,function(e){t.$scrollAnimation||t.session.setScrollLeft(e.data-t.scrollMargin.left)}),this.$scrollDecorator?(this.$scrollDecorator.setScrollBarV(this.scrollBarV),this.$scrollDecorator.$updateDecorators()):(this.$scrollDecorator=new y(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators())):(this.scrollBarV=new f(this.container,this),this.scrollBarH=new d(this.container,this),this.scrollBarV.addEventListener(`scroll`,function(e){t.$scrollAnimation||t.session.setScrollTop(e.data-t.scrollMargin.top)}),this.scrollBarH.addEventListener(`scroll`,function(e){t.$scrollAnimation||t.session.setScrollLeft(e.data-t.scrollMargin.left)}))},e.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var e=this;this.$resizeTimer=a.delayedCall(function(){e.destroyed||e.onResize()},50),this.$resizeObserver=new window.ResizeObserver(function(t){var n=t[0].contentRect.width,r=t[0].contentRect.height;Math.abs(e.$size.width-n)>1||Math.abs(e.$size.height-r)>1?e.$resizeTimer.delay():e.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},e}();S.prototype.CHANGE_CURSOR=1,S.prototype.CHANGE_MARKER=2,S.prototype.CHANGE_GUTTER=4,S.prototype.CHANGE_SCROLL=8,S.prototype.CHANGE_LINES=16,S.prototype.CHANGE_TEXT=32,S.prototype.CHANGE_SIZE=64,S.prototype.CHANGE_MARKER_BACK=128,S.prototype.CHANGE_MARKER_FRONT=256,S.prototype.CHANGE_FULL=512,S.prototype.CHANGE_H_SCROLL=1024,S.prototype.$changes=0,S.prototype.$padding=null,S.prototype.$frozen=!1,S.prototype.STEPS=8,r.implement(S.prototype,_),o.defineOptions(S.prototype,`renderer`,{useResizeObserver:{set:function(e){!e&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):e&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){typeof e==`number`&&(this.$printMarginColumn=e),this.$showPrintMargin=!!e,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(e){this.$gutter.style.display=e?`block`:`none`,this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(e){this.$gutterLayer.$useSvgGutterIcons=e},initialValue:!1},showFoldedAnnotations:{set:function(e){this.$gutterLayer.$showFoldedAnnotations=e},initialValue:!1},fadeFoldWidgets:{set:function(e){i.setCssClass(this.$gutter,`ace_fade-fold-widgets`,e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(e){this.$textLayer.setHighlightIndentGuides(e)==1?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(e){this.$gutterLayer.setHighlightGutterLine(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(e){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(e){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){typeof e==`number`&&(e+=`px`),this.container.style.fontSize=e,this.updateFontSize()},initialValue:12},fontFamily:{set:function(e){this.container.style.fontFamily=e,this.updateFontSize()}},maxLines:{set:function(e){this.updateFull()}},minLines:{set:function(e){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(e){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(e){e=+e||0,this.$scrollPastEnd!=e&&(this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(e){this.$updateCustomScrollbar(e)},initialValue:!1},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:`./theme/textmate`,handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!b.isMobile&&!b.isIE}}),t.VirtualRenderer=S}),ace.define(`ace/worker/worker_client`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/lib/net`,`ace/lib/event_emitter`,`ace/config`],function(e,t,n){var r=e(\"../lib/oop\"),i=e(\"../lib/net\"),a=e(\"../lib/event_emitter\").EventEmitter,o=e(\"../config\");function s(e){var t=`importScripts('`+i.qualifyURL(e)+`');`;try{return new Blob([t],{type:`application/javascript`})}catch{var n=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder);return n.append(t),n.getBlob(`application/javascript`)}}function c(e){if(typeof Worker>`u`)return{postMessage:function(){},terminate:function(){}};if(o.get(`loadWorkerFromBlob`)){var t=s(e),n=(window.URL||window.webkitURL).createObjectURL(t);return new Worker(n)}return new Worker(e)}var l=function(e){e.postMessage||(e=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=e,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){r.implement(this,a),this.$createWorkerFromOldConfig=function(t,n,r,i,a){if(e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl),o.get(`packaged`)||!e.toUrl)i||=o.moduleUrl(n,`worker`);else{var s=this.$normalizePath;i||=s(e.toUrl(`ace/worker/worker.js`,null,`_`));var l={};t.forEach(function(t){l[t]=s(e.toUrl(t,null,`_`).replace(/(\\.js)?(\\?.*)?$/,``))})}return this.$worker=c(i),a&&this.send(`importScripts`,a),this.$worker.postMessage({init:!0,tlns:l,module:n,classname:r}),this.$worker},this.onMessage=function(e){var t=e.data;switch(t.type){case`event`:this._signal(t.name,{data:t.data});break;case`call`:var n=this.callbacks[t.id];n&&(n(t.data),delete this.callbacks[t.id]);break;case`error`:this.reportError(t.data);break;case`log`:window.console&&console.log&&console.log.apply(console,t.data);break}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return i.qualifyURL(e)},this.terminate=function(){this._signal(`terminate`,{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(e){e.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off(`change`,this.changeListener),this.$doc=null},this.send=function(e,t){this.$worker.postMessage({command:e,args:t})},this.call=function(e,t,n){if(n){var r=this.callbackId++;this.callbacks[r]=n,t.push(r)}this.send(e,t)},this.emit=function(e,t){try{t.data&&t.data.err&&(t.data.err={message:t.data.err.message,stack:t.data.err.stack,code:t.data.err.code}),this.$worker&&this.$worker.postMessage({event:e,data:{data:t.data}})}catch(e){console.error(e.stack)}},this.attachToDocument=function(e){this.$doc&&this.terminate(),this.$doc=e,this.call(`setValue`,[e.getValue()]),e.on(`change`,this.changeListener,!0)},this.changeListener=function(e){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),e.action==`insert`?this.deltaQueue.push(e.start,e.lines):this.deltaQueue.push(e.start,e.end)},this.$sendDeltaQueue=function(){var e=this.deltaQueue;e&&(this.deltaQueue=null,e.length>50&&e.length>this.$doc.getLength()>>1?this.call(`setValue`,[this.$doc.getValue()]):this.emit(`change`,{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,n){var r=null,i=!1,s=Object.create(a),c=[],u=new l({messageBuffer:c,terminate:function(){},postMessage:function(e){c.push(e),r&&(i?setTimeout(d):d())}});u.setEmitSync=function(e){i=e};var d=function(){var e=c.shift();e.command?r[e.command].apply(r,e.args):e.event&&s._signal(e.event,e.data)};return s.postMessage=function(e){u.onMessage({data:e})},s.callback=function(e,t){this.postMessage({type:`call`,id:t,data:e})},s.emit=function(e,t){this.postMessage({type:`event`,name:e,data:t})},o.loadModule([`worker`,t],function(e){for(r=new e[n](s);c.length;)d()}),u},t.WorkerClient=l,t.createWorker=c}),ace.define(`ace/placeholder`,[`require`,`exports`,`module`,`ace/range`,`ace/lib/event_emitter`,`ace/lib/oop`],function(e,t,n){var r=e(\"./range\").Range,i=e(\"./lib/event_emitter\").EventEmitter,a=e(\"./lib/oop\"),o=function(){function e(e,t,n,r,i,a){var o=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=i,this.othersClass=a,this.$onUpdate=this.onUpdate.bind(this),this.doc.on(`change`,this.$onUpdate,!0),this.$others=r,this.$onCursorChange=function(){setTimeout(function(){o.onCursorChange()})},this.$pos=n;var s=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=s.length,this.setup(),e.selection.on(`changeCursor`,this.$onCursorChange)}return e.prototype.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var i=this.pos;i.$insertRight=!0,i.detach(),i.markerId=n.addMarker(new r(i.row,i.column,i.row,i.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(n){var r=t.createAnchor(n.row,n.column);r.$insertRight=!0,r.detach(),e.others.push(r)}),n.setUndoSelect(!1)},e.prototype.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach(function(n){n.markerId=e.addMarker(new r(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)})}},e.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e<this.others.length;e++)this.session.removeMarker(this.others[e].markerId)}},e.prototype.onUpdate=function(e){if(this.$updating)return this.updateAnchors(e);var t=e;if(t.start.row===t.end.row&&t.start.row===this.pos.row){this.$updating=!0;var n=e.action===`insert`?t.end.column-t.start.column:t.start.column-t.end.column,i=t.start.column>=this.pos.column&&t.start.column<=this.pos.column+this.length+1,a=t.start.column-this.pos.column;if(this.updateAnchors(e),i&&(this.length+=n),i&&!this.session.$fromUndo){if(e.action===`insert`)for(var o=this.others.length-1;o>=0;o--){var s=this.others[o],c={row:s.row,column:s.column+a};this.doc.insertMergedLines(c,e.lines)}else if(e.action===`remove`)for(var o=this.others.length-1;o>=0;o--){var s=this.others[o],c={row:s.row,column:s.column+a};this.doc.remove(new r(c.row,c.column,c.row,c.column-n))}}this.$updating=!1,this.updateMarkers()}},e.prototype.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},e.prototype.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,i){t.removeMarker(n.markerId),n.markerId=t.addMarker(new r(n.row,n.column,n.row,n.column+e.length),i,null,!1)};n(this.pos,this.mainClass);for(var i=this.others.length;i--;)n(this.others[i],this.othersClass)}},e.prototype.onCursorChange=function(e){if(!(this.$updating||!this.session)){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit(`cursorEnter`,e)):(this.hideOtherMarkers(),this._emit(`cursorLeave`,e))}},e.prototype.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off(`change`,this.$onUpdate),this.session.selection.off(`changeCursor`,this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},e.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n<t;n++)e.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},e}();a.implement(o.prototype,i),t.PlaceHolder=o}),ace.define(`ace/mouse/multi_select_handler`,[`require`,`exports`,`module`,`ace/lib/event`,`ace/lib/useragent`],function(e,t,n){var r=e(\"../lib/event\"),i=e(\"../lib/useragent\");function a(e,t){return e.row==t.row&&e.column==t.column}function o(e){var t=e.domEvent,n=t.altKey,o=t.shiftKey,s=t.ctrlKey,c=e.getAccelKey(),l=e.getButton();if(s&&i.isMac&&(l=t.button),e.editor.inMultiSelectMode&&l==2){e.editor.textInput.onContextMenu(e.domEvent);return}if(!s&&!n&&!c){l===0&&e.editor.inMultiSelectMode&&e.editor.exitMultiSelectMode();return}if(l===0){var u=e.editor,d=u.selection,f=u.inMultiSelectMode,p=e.getDocumentPosition(),m=d.getCursor(),h=e.inSelection()||d.isEmpty()&&a(p,m),g=e.x,_=e.y,v=function(e){g=e.clientX,_=e.clientY},y=u.session,b=u.renderer.pixelToScreenCoordinates(g,_),x=b,S;if(u.$mouseHandler.$enableJumpToDef)s&&n||c&&n?S=o?`block`:`add`:n&&u.$blockSelectEnabled&&(S=`block`);else if(c&&!n){if(S=`add`,!f&&o)return}else n&&u.$blockSelectEnabled&&(S=`block`);if(S&&i.isMac&&t.ctrlKey&&u.$mouseHandler.cancelContextMenu(),S==`add`){if(!f&&h)return;if(!f){var C=d.toOrientedRange();u.addSelectionMarker(C)}var w=d.rangeList.rangeAtPoint(p);u.inVirtualSelectionMode=!0,o&&(w=null,C=d.ranges[0]||C,u.removeSelectionMarker(C)),u.once(`mouseup`,function(){var e=d.toOrientedRange();w&&e.isEmpty()&&a(w.cursor,e.cursor)?d.substractPoint(e.cursor):(o?d.substractPoint(C.cursor):C&&(u.removeSelectionMarker(C),d.addRange(C)),d.addRange(e)),u.inVirtualSelectionMode=!1})}else if(S==`block`){e.stop(),u.inVirtualSelectionMode=!0;var T,E=[],D=function(){var e=u.renderer.pixelToScreenCoordinates(g,_),t=y.screenToDocumentPosition(e.row,e.column,e.offsetX);a(x,e)&&a(t,d.lead)||(x=e,u.selection.moveToPosition(t),u.renderer.scrollCursorIntoView(),u.removeSelectionMarkers(E),E=d.rectangularRangeBlock(x,b),u.$mouseHandler.$clickSelection&&E.length==1&&E[0].isEmpty()&&(E[0]=u.$mouseHandler.$clickSelection.clone()),E.forEach(u.addSelectionMarker,u),u.updateSelectionMarkers())};f&&!c?d.toSingleRange():!f&&c&&(T=d.toOrientedRange(),u.addSelectionMarker(T)),o?b=y.documentToScreenPosition(d.lead):d.moveToPosition(p),x={row:-1,column:-1};var O=function(e){D(),clearInterval(A),u.removeSelectionMarkers(E),E.length||(E=[d.toOrientedRange()]),T&&(u.removeSelectionMarker(T),d.toSingleRange(T));for(var t=0;t<E.length;t++)d.addRange(E[t]);u.inVirtualSelectionMode=!1,u.$mouseHandler.$clickSelection=null},k=D;r.capture(u.container,v,O);var A=setInterval(function(){k()},20);return e.preventDefault()}}}t.onMouseDown=o}),ace.define(`ace/commands/multi_select_commands`,[`require`,`exports`,`module`,`ace/keyboard/hash_handler`],function(e,t,n){t.defaultCommands=[{name:`addCursorAbove`,description:`Add cursor above`,exec:function(e){e.selectMoreLines(-1)},bindKey:{win:`Ctrl-Alt-Up`,mac:`Ctrl-Alt-Up`},scrollIntoView:`cursor`,readOnly:!0},{name:`addCursorBelow`,description:`Add cursor below`,exec:function(e){e.selectMoreLines(1)},bindKey:{win:`Ctrl-Alt-Down`,mac:`Ctrl-Alt-Down`},scrollIntoView:`cursor`,readOnly:!0},{name:`addCursorAboveSkipCurrent`,description:`Add cursor above (skip current)`,exec:function(e){e.selectMoreLines(-1,!0)},bindKey:{win:`Ctrl-Alt-Shift-Up`,mac:`Ctrl-Alt-Shift-Up`},scrollIntoView:`cursor`,readOnly:!0},{name:`addCursorBelowSkipCurrent`,description:`Add cursor below (skip current)`,exec:function(e){e.selectMoreLines(1,!0)},bindKey:{win:`Ctrl-Alt-Shift-Down`,mac:`Ctrl-Alt-Shift-Down`},scrollIntoView:`cursor`,readOnly:!0},{name:`selectMoreBefore`,description:`Select more before`,exec:function(e){e.selectMore(-1)},bindKey:{win:`Ctrl-Alt-Left`,mac:`Ctrl-Alt-Left`},scrollIntoView:`cursor`,readOnly:!0},{name:`selectMoreAfter`,description:`Select more after`,exec:function(e){e.selectMore(1)},bindKey:{win:`Ctrl-Alt-Right`,mac:`Ctrl-Alt-Right`},scrollIntoView:`cursor`,readOnly:!0},{name:`selectNextBefore`,description:`Select next before`,exec:function(e){e.selectMore(-1,!0)},bindKey:{win:`Ctrl-Alt-Shift-Left`,mac:`Ctrl-Alt-Shift-Left`},scrollIntoView:`cursor`,readOnly:!0},{name:`selectNextAfter`,description:`Select next after`,exec:function(e){e.selectMore(1,!0)},bindKey:{win:`Ctrl-Alt-Shift-Right`,mac:`Ctrl-Alt-Shift-Right`},scrollIntoView:`cursor`,readOnly:!0},{name:`toggleSplitSelectionIntoLines`,description:`Split selection into lines`,exec:function(e){e.multiSelect.rangeCount>1?e.multiSelect.joinSelections():e.multiSelect.splitIntoLines()},bindKey:{win:`Ctrl-Alt-L`,mac:`Ctrl-Alt-L`},readOnly:!0},{name:`splitSelectionIntoLines`,description:`Split into lines`,exec:function(e){e.multiSelect.splitIntoLines()},readOnly:!0},{name:`alignCursors`,description:`Align cursors`,exec:function(e){e.alignCursors()},bindKey:{win:`Ctrl-Alt-A`,mac:`Ctrl-Alt-A`},scrollIntoView:`cursor`},{name:`findAll`,description:`Find all`,exec:function(e){e.findAll()},bindKey:{win:`Ctrl-Alt-K`,mac:`Ctrl-Alt-G`},scrollIntoView:`cursor`,readOnly:!0}],t.multiSelectCommands=[{name:`singleSelection`,description:`Single selection`,bindKey:`esc`,exec:function(e){e.exitMultiSelectMode()},scrollIntoView:`cursor`,readOnly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}];var r=e(\"../keyboard/hash_handler\").HashHandler;t.keyboardHandler=new r(t.multiSelectCommands)}),ace.define(`ace/multi_select`,[`require`,`exports`,`module`,`ace/range_list`,`ace/range`,`ace/selection`,`ace/mouse/multi_select_handler`,`ace/lib/event`,`ace/lib/lang`,`ace/commands/multi_select_commands`,`ace/search`,`ace/edit_session`,`ace/editor`,`ace/config`],function(e,t,n){var r=e(\"./range_list\").RangeList,i=e(\"./range\").Range,a=e(\"./selection\").Selection,o=e(\"./mouse/multi_select_handler\").onMouseDown,s=e(\"./lib/event\"),c=e(\"./lib/lang\"),l=e(\"./commands/multi_select_commands\");t.commands=l.defaultCommands.concat(l.multiSelectCommands);var u=e(\"./search\").Search,d=new u;function f(e,t,n){return d.$options.wrap=!0,d.$options.needle=t,d.$options.backwards=n==-1,d.find(e)}var p=e(\"./edit_session\").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(p.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&this.rangeCount===0){var n=this.toOrientedRange();if(this.rangeList.add(n),this.rangeList.add(e),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(n),this.$onAddRange(n)}e.cursor||=e.end;var r=this.rangeList.add(e);return this.$onAddRange(e),r.length&&this.$onRemoveRange(r),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal(`multiSelect`),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e||=this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal(`addRange`,{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var r=this.ranges.indexOf(e[n]);this.ranges.splice(r,1)}this._signal(`removeRange`,{ranges:e}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal(`singleSelect`),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),t||=this.ranges[0],t&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new r,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var e=this.ranges.length?this.ranges:[this.getRange()],t=[],n=0;n<e.length;n++){var r=e[n],a=r.start.row,o=r.end.row;if(a===o)t.push(r.clone());else{for(t.push(new i(a,r.start.column,a,this.session.getLine(a).length));++a<o;)t.push(this.getLineRange(a,!0));t.push(new i(o,0,o,r.end.column))}n==0&&!this.isBackwards()&&(t=t.reverse())}this.toSingleRange();for(var n=t.length;n--;)this.addRange(t[n])},this.joinSelections=function(){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=i.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var r=this.session.documentToScreenPosition(this.cursor),a=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(r,a).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var r=[],a=e.column<t.column;if(a)var o=e.column,s=t.column,c=e.offsetX,l=t.offsetX;else var o=t.column,s=e.column,c=t.offsetX,l=e.offsetX;var u=e.row<t.row;if(u)var d=e.row,f=t.row;else var d=t.row,f=e.row;o<0&&(o=0),d<0&&(d=0),d==f&&(n=!0);for(var p,m=d;m<=f;m++){var g=i.fromPoints(this.session.screenToDocumentPosition(m,o,c),this.session.screenToDocumentPosition(m,s,l));if(g.isEmpty()){if(p&&h(g.end,p))break;p=g.end}g.cursor=a?g.start:g.end,r.push(g)}if(u&&r.reverse(),!n){for(var _=r.length-1;r[_].isEmpty()&&_>0;)_--;if(_>0)for(var v=0;r[v].isEmpty();)v++;for(var y=_;y>=v;y--)r[y].isEmpty()&&r.splice(y,1)}return r}}).call(a.prototype);var m=e(\"./editor\").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||=e.end;var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,`ace_selection`,t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);t!=-1&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var r=e[n];if(r.marker){this.session.removeMarker(r.marker);var i=t.indexOf(r);i!=-1&&t.splice(i,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle(`ace_multiselect`),this.keyBinding.addKeyboardHandler(l.keyboardHandler),this.commands.setDefaultHandler(`exec`,this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle(`ace_multiselect`),this.keyBinding.removeKeyboardHandler(l.keyboardHandler),this.commands.removeDefaultHandler(`exec`,this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit(`changeSelection`))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)t.multiSelectAction==`forEach`?r=n.forEachSelection(t,e.args):t.multiSelectAction==`forEachLine`?r=n.forEachSelection(t,e.args,!0):t.multiSelectAction==`single`?(n.exitMultiSelectMode(),r=t.exec(n,e.args||{})):r=t.multiSelectAction(n,e.args||{});else{var r=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return r}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var r=n&&n.keepOrder,i=n==1||n&&n.$byLines,o=this.session,s=this.selection,c=s.rangeList,l=(r?s:c).ranges,u;if(!l.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var d=s._eventRegistry;s._eventRegistry={};var f=new a(o);this.inVirtualSelectionMode=!0;for(var p=l.length;p--;){if(i)for(;p>0&&l[p].start.row==l[p-1].end.row;)p--;f.fromOrientedRange(l[p]),f.index=p,this.selection=o.selection=f;var m=e.exec?e.exec(this,t||{}):e(this,t||{});!u&&m!==void 0&&(u=m),f.toOrientedRange(l[p])}f.detach(),this.selection=o.selection=s,this.inVirtualSelectionMode=!1,s._eventRegistry=d,s.mergeOverlappingRanges(),s.ranges[0]&&s.fromOrientedRange(s.ranges[0]);var h=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),h&&h.from==h.to&&this.renderer.animateScrolling(h.from),u}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e=``;if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],r=0;r<t.length;r++)n.push(this.session.getTextRange(t[r]));var i=this.session.getDocument().getNewLineCharacter();e=n.join(i),e.length==(n.length-1)*i.length&&(e=``)}else this.selection.isEmpty()||(e=this.session.getTextRange(this.getSelectionRange()));return e},this.$checkMultiselectChange=function(e,t){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var n=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&t==this.multiSelect.anchor)return;var r=t==this.multiSelect.anchor?n.cursor==n.start?n.end:n.start:n.cursor;r.row!=t.row||this.session.$clipPositionToDocument(r.row,r.column).column!=t.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(e,t,n){if(t||={},t.needle=e||t.needle,t.needle==null){var r=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();t.needle=this.session.getTextRange(r)}this.$search.set(t);var i=this.$search.findAll(this.session);if(!i.length)return 0;var a=this.multiSelect;n||a.toSingleRange(i[0]);for(var o=i.length;o--;)a.addRange(i[o],!0);return r&&a.rangeList.rangeAtPoint(r.start)&&a.addRange(r,!0),i.length},this.selectMoreLines=function(e,t){var n=this.selection.toOrientedRange(),r=n.cursor==n.end,a=this.session.documentToScreenPosition(n.cursor);this.selection.$desiredColumn&&(a.column=this.selection.$desiredColumn);var o=this.session.screenToDocumentPosition(a.row+e,a.column);if(n.isEmpty())var s=o;else var c=this.session.documentToScreenPosition(r?n.end:n.start),s=this.session.screenToDocumentPosition(c.row+e,c.column);if(r){var l=i.fromPoints(o,s);l.cursor=l.start}else{var l=i.fromPoints(s,o);l.cursor=l.end}if(l.desiredColumn=a.column,!this.selection.inMultiSelectMode)this.selection.addRange(n);else if(t)var u=n.cursor;this.selection.addRange(l),u&&this.selection.substractPoint(u)},this.transposeSelections=function(e){for(var t=this.session,n=t.multiSelect,r=n.ranges,i=r.length;i--;){var a=r[i];if(a.isEmpty()){var o=t.getWordRange(a.start.row,a.start.column);a.start.row=o.start.row,a.start.column=o.start.column,a.end.row=o.end.row,a.end.column=o.end.column}}n.mergeOverlappingRanges();for(var s=[],i=r.length;i--;){var a=r[i];s.unshift(t.getTextRange(a))}e<0?s.unshift(s.pop()):s.push(s.shift());for(var i=r.length;i--;){var a=r[i],c=a.clone();t.replace(a,s[i]),a.start.row=c.start.row,a.start.column=c.start.column}n.fromOrientedRange(n.ranges[0])},this.selectMore=function(e,t,n){var r=this.session,i=r.multiSelect.toOrientedRange();if(!(i.isEmpty()&&(i=r.getWordRange(i.start.row,i.start.column),i.cursor=e==-1?i.start:i.end,this.multiSelect.addRange(i),n))){var a=f(r,r.getTextRange(i),e);a&&(a.cursor=e==-1?a.start:a.end,this.session.unfold(a),this.multiSelect.addRange(a),this.renderer.scrollCursorIntoView(null,.5)),t&&this.multiSelect.substractPoint(i.cursor)}},this.alignCursors=function(){var e=this.session,t=e.multiSelect,n=t.ranges,r=-1,a=n.filter(function(e){if(e.cursor.row==r)return!0;r=e.cursor.row});if(!n.length||a.length==n.length-1){var o=this.selection.getRange(),s=o.start.row,l=o.end.row,u=s==l;if(u){var d=this.session.getLength(),f;do f=this.session.getLine(l);while(/[=:]/.test(f)&&++l<d);do f=this.session.getLine(s);while(/[=:]/.test(f)&&--s>0);s<0&&(s=0),l>=d&&(l=d-1)}var p=this.session.removeFullLines(s,l);p=this.$reAlignText(p,u),this.session.insert({row:s,column:0},p.join(`\n`)+`\n`),u||(o.start.column=0,o.end.column=p[p.length-1].length),this.selection.setRange(o)}else{a.forEach(function(e){t.substractPoint(e.cursor)});var m=0,h=1/0,g=n.map(function(t){var n=t.cursor,r=e.getLine(n.row).substr(n.column).search(/\\S/g);return r==-1&&(r=0),n.column>m&&(m=n.column),r<h&&(h=r),r});n.forEach(function(t,n){var r=t.cursor,a=m-r.column,o=g[n]-h;a>o?e.insert(r,c.stringRepeat(` `,a-o)):e.remove(new i(r.row,r.column,r.row,r.column-a+o)),t.start.column=t.end.column=m,t.start.row=t.end.row=r.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function(e,t){var n=!0,r=!0,i,a,o;return e.map(function(e){var t=e.match(/(\\s*)(.*?)(\\s*)([=:].*)/);return t?i==null?(i=t[1].length,a=t[2].length,o=t[3].length,t):(i+a+o!=t[1].length+t[2].length+t[3].length&&(r=!1),i!=t[1].length&&(n=!1),i>t[1].length&&(i=t[1].length),a<t[2].length&&(a=t[2].length),o>t[3].length&&(o=t[3].length),t):[e]}).map(t?l:n?r?u:l:d);function s(e){return c.stringRepeat(` `,e)}function l(e){return e[2]?s(i)+e[2]+s(a-e[2].length+o)+e[4].replace(/^([=:])\\s+/,`$1 `):e[0]}function u(e){return e[2]?s(i+a-e[2].length)+e[2]+s(o)+e[4].replace(/^([=:])\\s+/,`$1 `):e[0]}function d(e){return e[2]?s(i)+e[2]+s(o)+e[4].replace(/^([=:])\\s+/,`$1 `):e[0]}}}).call(m.prototype);function h(e,t){return e.row==t.row&&e.column==t.column}t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off(`addRange`,this.$onAddRange),n.multiSelect.off(`removeRange`,this.$onRemoveRange),n.multiSelect.off(`multiSelect`,this.$onMultiSelect),n.multiSelect.off(`singleSelect`,this.$onSingleSelect),n.multiSelect.lead.off(`change`,this.$checkMultiselectChange),n.multiSelect.anchor.off(`change`,this.$checkMultiselectChange)),t&&(t.multiSelect.on(`addRange`,this.$onAddRange),t.multiSelect.on(`removeRange`,this.$onRemoveRange),t.multiSelect.on(`multiSelect`,this.$onMultiSelect),t.multiSelect.on(`singleSelect`,this.$onSingleSelect),t.multiSelect.lead.on(`change`,this.$checkMultiselectChange),t.multiSelect.anchor.on(`change`,this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function g(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on(`changeSession`,e.$multiselectOnSessionChange),e.on(`mousedown`,o),e.commands.addCommands(l.defaultCommands),_(e))}function _(e){if(!e.textInput)return;var t=e.textInput.getElement(),n=!1;s.addListener(t,`keydown`,function(t){var i=t.keyCode==18&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&i?n||=(e.renderer.setMouseCursor(`crosshair`),!0):n&&r()},e),s.addListener(t,`keyup`,r,e),s.addListener(t,`blur`,r,e);function r(t){n&&=(e.renderer.setMouseCursor(``),!1)}}t.MultiSelect=g,e(\"./config\").defineOptions(m.prototype,`editor`,{enableMultiselect:{set:function(e){g(this),e?this.on(`mousedown`,o):this.off(`mousedown`,o)},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define(`ace/mode/folding/fold_mode`,[`require`,`exports`,`module`,`ace/range`],function(e,t,n){var r=e(\"../../range\").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?`start`:t==`markbeginend`&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?`end`:``},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var i=/\\S/,a=e.getLine(t),o=a.search(i);if(o!=-1){for(var s=n||a.length,c=e.getLength(),l=t,u=t;++t<c;){var d=e.getLine(t).search(i);if(d!=-1){if(d<=o){var f=e.getTokenAt(t,0);if(!f||f.type!==`string`)break}u=t}}if(u>l){var p=e.getLine(u).length;return new r(l,s,u,p)}}},this.openingBracketBlock=function(e,t,n,i,a){var o={row:n,column:i+1},s=e.$findClosingBracket(t,o,a);if(s){var c=e.foldWidgets[s.row];return c??=e.getFoldWidget(s.row),c==`start`&&s.row>o.row&&(s.row--,s.column=e.getLine(s.row).length),r.fromPoints(o,s)}},this.closingBracketBlock=function(e,t,n,i,a){var o={row:n,column:i},s=e.$findOpeningBracket(t,o);if(s)return s.column++,o.column--,r.fromPoints(s,o)}}).call(i.prototype)}),ace.define(`ace/ext/error_marker`,[`require`,`exports`,`module`,`ace/lib/dom`,`ace/range`,`ace/config`],function(e,t,n){var r=e(\"../lib/dom\"),i=e(\"../range\").Range,a=e(\"../config\").nls;function o(e,t,n){for(var r=0,i=e.length-1;r<=i;){var a=r+i>>1,o=n(t,e[a]);if(o>0)r=a+1;else if(o<0)i=a-1;else return a}return-(r+1)}function s(e,t,n){var r=e.getAnnotations().sort(i.comparePoints);if(r.length){var a=o(r,{row:t,column:-1},i.comparePoints);a<0&&(a=-a-1),a>=r.length?a=n>0?0:r.length-1:a===0&&n<0&&(a=r.length-1);var s=r[a];if(!(!s||!n)){if(s.row===t){do s=r[a+=n];while(s&&s.row===t);if(!s)return r.slice()}var c=[];t=s.row;do c[n<0?`unshift`:`push`](s),s=r[a+=n];while(s&&s.row==t);return c.length&&c}}}t.showErrorMarker=function(e,t){var n=e.session,i=e.getCursorPosition(),o=i.row,c=n.widgetManager.getWidgetsAtRow(o).filter(function(e){return e.type==`errorMarker`})[0];c?c.destroy():o-=t;var l=s(n,o,t),u;if(l){var d=l[0];i.column=(d.pos&&typeof d.column!=`number`?d.pos.sc:d.column)||0,i.row=d.row,u=e.renderer.$gutterLayer.$annotations[i.row]}else if(c)return;else u={displayText:[a(`error-marker.good-state`,`Looks good!`)],className:`ace_ok`};e.session.unfold(i.row),e.selection.moveToPosition(i);var f={row:i.row,fixedWidth:!0,coverGutter:!0,el:r.createElement(`div`),type:`errorMarker`},p=f.el.appendChild(r.createElement(`div`)),m=f.el.appendChild(r.createElement(`div`));m.className=`error_widget_arrow `+u.className;var h=e.renderer.$cursorLayer.getPixelPosition(i).left;m.style.left=h+e.renderer.gutterWidth-5+`px`,f.el.className=`error_widget_wrapper`,p.className=`error_widget `+u.className,u.displayText.forEach(function(e,t){p.appendChild(r.createTextNode(e)),t<u.displayText.length-1&&p.appendChild(r.createElement(`br`))}),p.appendChild(r.createElement(`div`));var g=function(e,t,n){if(t===0&&(n===`esc`||n===`return`))return f.destroy(),{command:`null`}};f.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(g),n.widgetManager.removeLineWidget(f),e.off(`changeSelection`,f.destroy),e.off(`changeSession`,f.destroy),e.off(`mouseup`,f.destroy),e.off(`change`,f.destroy))},e.keyBinding.addKeyboardHandler(g),e.on(`changeSelection`,f.destroy),e.on(`changeSession`,f.destroy),e.on(`mouseup`,f.destroy),e.on(`change`,f.destroy),e.session.widgetManager.addLineWidget(f),f.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:f.el.offsetHeight})},r.importCssString(`\n .error_widget_wrapper {\n background: inherit;\n color: inherit;\n border:none\n }\n .error_widget {\n border-top: solid 2px;\n border-bottom: solid 2px;\n margin: 5px 0;\n padding: 10px 40px;\n white-space: pre-wrap;\n }\n .error_widget.ace_error, .error_widget_arrow.ace_error{\n border-color: #ff5a5a\n }\n .error_widget.ace_warning, .error_widget_arrow.ace_warning{\n border-color: #F1D817\n }\n .error_widget.ace_info, .error_widget_arrow.ace_info{\n border-color: #5a5a5a\n }\n .error_widget.ace_ok, .error_widget_arrow.ace_ok{\n border-color: #5aaa5a\n }\n .error_widget_arrow {\n position: absolute;\n border: solid 5px;\n border-top-color: transparent!important;\n border-right-color: transparent!important;\n border-left-color: transparent!important;\n top: -5px;\n }\n`,`error_marker.css`,!1)}),ace.define(`ace/ace`,[`require`,`exports`,`module`,`ace/lib/dom`,`ace/range`,`ace/editor`,`ace/edit_session`,`ace/undomanager`,`ace/virtual_renderer`,`ace/worker/worker_client`,`ace/keyboard/hash_handler`,`ace/placeholder`,`ace/multi_select`,`ace/mode/folding/fold_mode`,`ace/theme/textmate`,`ace/ext/error_marker`,`ace/config`,`ace/loader_build`],function(e,t,n){e(\"./loader_build\")(t);var r=e(\"./lib/dom\"),i=e(\"./range\").Range,a=e(\"./editor\").Editor,o=e(\"./edit_session\").EditSession,s=e(\"./undomanager\").UndoManager,c=e(\"./virtual_renderer\").VirtualRenderer;e(\"./worker/worker_client\"),e(\"./keyboard/hash_handler\"),e(\"./placeholder\"),e(\"./multi_select\"),e(\"./mode/folding/fold_mode\"),e(\"./theme/textmate\"),e(\"./ext/error_marker\"),t.config=e(\"./config\"),t.edit=function(e,n){if(typeof e==`string`){var i=e;if(e=document.getElementById(i),!e)throw Error(`ace.edit can't find div #`+i)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;var o=``;if(e&&/input|textarea/i.test(e.tagName)){var s=e;o=s.value,e=r.createElement(`pre`),s.parentNode.replaceChild(e,s)}else e&&(o=e.textContent,e.innerHTML=``);var l=t.createEditSession(o),u=new a(new c(e),l,n),d={document:l,editor:u,onResize:u.resize.bind(u,null)};return s&&(d.textarea=s),u.on(`destroy`,function(){d.editor.container.env=null}),u.container.env=u.env=d,u},t.createEditSession=function(e,t){var n=new o(e,t);return n.setUndoManager(new s),n},t.Range=i,t.Editor=a,t.EditSession=o,t.UndoManager=s,t.VirtualRenderer=c,t.version=t.config.version}),(function(){ace.require([`ace/ace`],function(n){n&&(n.config.init(!0),n.define=ace.define);var r=(function(){return this})();for(var i in!r&&typeof window<`u`&&(r=window),!r&&typeof self<`u`&&(r=self),r.ace||=n,n)n.hasOwnProperty(i)&&(r.ace[i]=n[i]);r.ace.default=r.ace,typeof t==`object`&&typeof e==`object`&&t&&(t.exports=r.ace)})})()})),$t=o(((e,t)=>{ace.define(`ace/snippets`,[`require`,`exports`,`module`,`ace/lib/dom`,`ace/lib/oop`,`ace/lib/event_emitter`,`ace/lib/lang`,`ace/range`,`ace/range_list`,`ace/keyboard/hash_handler`,`ace/tokenizer`,`ace/clipboard`,`ace/editor`],function(e,t,n){var r=e(\"./lib/dom\"),i=e(\"./lib/oop\"),a=e(\"./lib/event_emitter\").EventEmitter,o=e(\"./lib/lang\"),s=e(\"./range\").Range,c=e(\"./range_list\").RangeList,l=e(\"./keyboard/hash_handler\").HashHandler,u=e(\"./tokenizer\").Tokenizer,d=e(\"./clipboard\"),f={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,t,n){var r=e.session.getTextRange();return n?r.replace(/\\n\\r?([ \\t]*\\S)/g,`\n`+n+`$1`):r},CURRENT_LINE:function(e){return e.session.getLine(e.getCursorPosition().row)},PREV_LINE:function(e){return e.session.getLine(e.getCursorPosition().row-1)},LINE_INDEX:function(e){return e.getCursorPosition().row},LINE_NUMBER:function(e){return e.getCursorPosition().row+1},SOFT_TABS:function(e){return e.session.getUseSoftTabs()?`YES`:`NO`},TAB_SIZE:function(e){return e.session.getTabSize()},CLIPBOARD:function(e){return d.getText&&d.getText()},FILENAME:function(e){return/[^/\\\\]*$/.exec(this.FILEPATH(e))[0]},FILENAME_BASE:function(e){return/[^/\\\\]*$/.exec(this.FILEPATH(e))[0].replace(/\\.[^.]*$/,``)},DIRECTORY:function(e){return this.FILEPATH(e).replace(/[^/\\\\]*$/,``)},FILEPATH:function(e){return`/not implemented.txt`},WORKSPACE_NAME:function(){return`Unknown`},FULLNAME:function(){return`Unknown`},BLOCK_COMMENT_START:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.start||``},BLOCK_COMMENT_END:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.end||``},LINE_COMMENT:function(e){return(e.session.$mode||{}).lineCommentStart||``},CURRENT_YEAR:p.bind(null,{year:`numeric`}),CURRENT_YEAR_SHORT:p.bind(null,{year:`2-digit`}),CURRENT_MONTH:p.bind(null,{month:`numeric`}),CURRENT_MONTH_NAME:p.bind(null,{month:`long`}),CURRENT_MONTH_NAME_SHORT:p.bind(null,{month:`short`}),CURRENT_DATE:p.bind(null,{day:`2-digit`}),CURRENT_DAY_NAME:p.bind(null,{weekday:`long`}),CURRENT_DAY_NAME_SHORT:p.bind(null,{weekday:`short`}),CURRENT_HOUR:p.bind(null,{hour:`2-digit`,hour12:!1}),CURRENT_MINUTE:p.bind(null,{minute:`2-digit`}),CURRENT_SECOND:p.bind(null,{second:`2-digit`})};f.SELECTED_TEXT=f.SELECTION;function p(e){var t=new Date().toLocaleString(`en-us`,e);return t.length==1?`0`+t:t}var m=function(){function e(){this.snippetMap={},this.snippetNameMap={},this.variables=f}return e.prototype.getTokenizer=function(){return e.$tokenizer||this.createTokenizer()},e.prototype.createTokenizer=function(){function t(e){return e=e.substr(1),/^\\d+$/.test(e)?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function n(e){return`(?:[^\\\\\\\\`+e+`]|\\\\\\\\.)`}var r={regex:`/(`+n(`/`)+`+)/`,onMatch:function(e,t,n){var r=n[0];return r.fmtString=!0,r.guard=e.slice(1,-1),r.flag=``,``},next:`formatString`};return e.$tokenizer=new u({start:[{regex:/\\\\./,onMatch:function(e,t,n){var r=e[1];return(r==`}`&&n.length||\"`$\\\\\".indexOf(r)!=-1)&&(e=r),[e]}},{regex:/}/,onMatch:function(e,t,n){return[n.length?n.shift():e]}},{regex:/\\$(?:\\d+|\\w+)/,onMatch:t},{regex:/\\$\\{[\\dA-Z_a-z]+/,onMatch:function(e,n,r){var i=t(e.substr(1));return r.unshift(i[0]),i},next:`snippetVar`},{regex:/\\n/,token:`newline`,merge:!1}],snippetVar:[{regex:`\\\\|`+n(`\\\\|`)+`*\\\\|`,onMatch:function(e,t,n){var r=e.slice(1,-1).replace(/\\\\[,|\\\\]|,/g,function(e){return e.length==2?e[1]:`\\0`}).split(`\\0`).map(function(e){return{value:e}});return n[0].choices=r,[r[0]]},next:`start`},r,{regex:`([^:}\\\\\\\\]|\\\\\\\\.)*:?`,token:``,next:`start`}],formatString:[{regex:/:/,onMatch:function(e,t,n){return n.length&&n[0].expectElse?(n[0].expectElse=!1,n[0].ifEnd={elseEnd:n[0]},[n[0].ifEnd]):`:`}},{regex:/\\\\./,onMatch:function(e,t,n){var r=e[1];return r==`}`&&n.length?e=r:\"`$\\\\\".indexOf(r)==-1?r==`n`?e=`\n`:r==`t`?e=`\t`:`ulULE`.indexOf(r)!=-1&&(e={changeCase:r,local:r>`a`}):e=r,[e]}},{regex:`/\\\\w*}`,onMatch:function(e,t,n){var r=n.shift();return r&&(r.flag=e.slice(1,-1)),this.next=r&&r.tabstopId?`start`:``,[r||e]},next:`start`},{regex:/\\$(?:\\d+|\\w+)/,onMatch:function(e,t,n){return[{text:e.slice(1)}]}},{regex:/\\${\\w+/,onMatch:function(e,t,n){var r={text:e.slice(2)};return n.unshift(r),[r]},next:`formatStringVar`},{regex:/\\n/,token:`newline`,merge:!1},{regex:/}/,onMatch:function(e,t,n){var r=n.shift();return this.next=r&&r.tabstopId?`start`:``,[r||e]},next:`start`}],formatStringVar:[{regex:/:\\/\\w+}/,onMatch:function(e,t,n){var r=n[0];return r.formatFunction=e.slice(2,-1),[n.shift()]},next:`formatString`},r,{regex:/:[\\?\\-+]?/,onMatch:function(e,t,n){e[1]==`+`&&(n[0].ifEnd=n[0]),e[1]==`?`&&(n[0].expectElse=!0)},next:`formatString`},{regex:`([^:}\\\\\\\\]|\\\\\\\\.)*:?`,token:``,next:`formatString`}]}),e.$tokenizer},e.prototype.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map(function(e){return e.value||e})},e.prototype.getVariableValue=function(e,t,n){if(/^\\d+$/.test(t))return(this.variables.__||{})[t]||``;if(/^[A-Z]\\d+$/.test(t))return(this.variables[t[0]+`__`]||{})[t.substr(1)]||``;if(t=t.replace(/^TM_/,``),!this.variables.hasOwnProperty(t))return``;var r=this.variables[t];return typeof r==`function`&&(r=this.variables[t](e,t,n)),r??``},e.prototype.tmStrFormat=function(e,t,n){if(!t.fmt)return e;var r=t.flag||``,i=t.guard;i=new RegExp(i,r.replace(/[^gim]/g,``));var a=typeof t.fmt==`string`?this.tokenizeTmSnippet(t.fmt,`formatString`):t.fmt,o=this;return e.replace(i,function(){var e=o.variables.__;o.variables.__=[].slice.call(arguments);for(var t=o.resolveVariables(a,n),r=`E`,i=0;i<t.length;i++){var s=t[i];if(typeof s==`object`)if(t[i]=``,s.changeCase&&s.local){var c=t[i+1];c&&typeof c==`string`&&(s.changeCase==`u`?t[i]=c[0].toUpperCase():t[i]=c[0].toLowerCase(),t[i+1]=c.substr(1))}else s.changeCase&&(r=s.changeCase);else r==`U`?t[i]=s.toUpperCase():r==`L`&&(t[i]=s.toLowerCase())}return o.variables.__=e,t.join(``)})},e.prototype.tmFormatFunction=function(e,t,n){return t.formatFunction==`upcase`?e.toUpperCase():t.formatFunction==`downcase`?e.toLowerCase():e},e.prototype.resolveVariables=function(e,t){for(var n=[],r=``,i=!0,a=0;a<e.length;a++){var o=e[a];if(typeof o==`string`){n.push(o),o==`\n`?(i=!0,r=``):i&&=(r=/^\\t*/.exec(o)[0],/\\S/.test(o));continue}if(o){if(i=!1,o.fmtString){var s=e.indexOf(o,a+1);s==-1&&(s=e.length),o.fmt=e.slice(a+1,s),a=s}if(o.text){var c=this.getVariableValue(t,o.text,r)+``;o.fmtString&&(c=this.tmStrFormat(c,o,t)),o.formatFunction&&(c=this.tmFormatFunction(c,o,t)),c&&!o.ifEnd?(n.push(c),l(o)):!c&&o.ifEnd&&l(o.ifEnd)}else o.elseEnd?l(o.elseEnd):o.tabstopId==null?o.changeCase!=null&&n.push(o):n.push(o)}}function l(t){var n=e.indexOf(t,a+1);n!=-1&&(a=n)}return n},e.prototype.getDisplayTextForSnippet=function(e,t){return h.call(this,e,t).text},e.prototype.insertSnippetForSelection=function(e,t,n){n===void 0&&(n={});var r=h.call(this,e,t,n),i=e.getSelectionRange(),a=e.session.replace(i,r.text),o=new g(e),s=e.inVirtualSelectionMode&&e.selection.index;o.addTabstops(r.tabstops,i.start,a,s)},e.prototype.insertSnippet=function(e,t,n){n===void 0&&(n={});var r=this;if(e.inVirtualSelectionMode)return r.insertSnippetForSelection(e,t,n);e.forEachSelection(function(){r.insertSnippetForSelection(e,t,n)},null,{keepOrder:!0}),e.tabstopManager&&e.tabstopManager.tabNext()},e.prototype.$getScope=function(e){var t=e.session.$mode.$id||``;if(t=t.split(`/`).pop(),t===`html`||t===`php`){t===`php`&&!e.session.$mode.inlinePhp&&(t=`html`);var n=e.getCursorPosition(),r=e.session.getState(n.row);typeof r==`object`&&(r=r[0]),r.substring&&(r.substring(0,3)==`js-`?t=`javascript`:r.substring(0,4)==`css-`?t=`css`:r.substring(0,4)==`php-`&&(t=`php`))}return t},e.prototype.getActiveScopes=function(e){var t=this.$getScope(e),n=[t],r=this.snippetMap;return r[t]&&r[t].includeScopes&&n.push.apply(n,r[t].includeScopes),n.push(`_`),n},e.prototype.expandWithTab=function(e,t){var n=this,r=e.forEachSelection(function(){return n.expandSnippetForSelection(e,t)},null,{keepOrder:!0});return r&&e.tabstopManager&&e.tabstopManager.tabNext(),r},e.prototype.expandSnippetForSelection=function(e,t){var n=e.getCursorPosition(),r=e.session.getLine(n.row),i=r.substring(0,n.column),a=r.substr(n.column),o=this.snippetMap,s;return this.getActiveScopes(e).some(function(e){var t=o[e];return t&&(s=this.findMatchingSnippet(t,i,a)),!!s},this),s?t&&t.dryRun?!0:(e.session.doc.removeInLine(n.row,n.column-s.replaceBefore.length,n.column+s.replaceAfter.length),this.variables.M__=s.matchBefore,this.variables.T__=s.matchAfter,this.insertSnippetForSelection(e,s.content),this.variables.M__=this.variables.T__=null,!0):!1},e.prototype.findMatchingSnippet=function(e,t,n){for(var r=e.length;r--;){var i=e[r];if(!(i.startRe&&!i.startRe.test(t))&&!(i.endRe&&!i.endRe.test(n))&&!(!i.startRe&&!i.endRe))return i.matchBefore=i.startRe?i.startRe.exec(t):[``],i.matchAfter=i.endRe?i.endRe.exec(n):[``],i.replaceBefore=i.triggerRe?i.triggerRe.exec(t)[0]:``,i.replaceAfter=i.endTriggerRe?i.endTriggerRe.exec(n)[0]:``,i}},e.prototype.register=function(e,t){var n=this.snippetMap,r=this.snippetNameMap,i=this;e||=[];function a(e){return e&&!/^\\^?\\(.*\\)\\$?$|^\\\\b$/.test(e)&&(e=`(?:`+e+`)`),e||``}function s(e,t,n){return e=a(e),t=a(t),n?(e=t+e,e&&e[e.length-1]!=`$`&&(e+=`$`)):(e+=t,e&&e[0]!=`^`&&(e=`^`+e)),new RegExp(e)}function c(e){e.scope||=t||`_`,t=e.scope,n[t]||(n[t]=[],r[t]={});var a=r[t];if(e.name){var c=a[e.name];c&&i.unregister(c),a[e.name]=e}n[t].push(e),e.prefix&&(e.tabTrigger=e.prefix),!e.content&&e.body&&(e.content=Array.isArray(e.body)?e.body.join(`\n`):e.body),e.tabTrigger&&!e.trigger&&(!e.guard&&/^\\w/.test(e.tabTrigger)&&(e.guard=`\\\\b`),e.trigger=o.escapeRegExp(e.tabTrigger)),!(!e.trigger&&!e.guard&&!e.endTrigger&&!e.endGuard)&&(e.startRe=s(e.trigger,e.guard,!0),e.triggerRe=new RegExp(e.trigger),e.endRe=s(e.endTrigger,e.endGuard,!0),e.endTriggerRe=new RegExp(e.endTrigger))}Array.isArray(e)?e.forEach(c):Object.keys(e).forEach(function(t){c(e[t])}),this._signal(`registerSnippets`,{scope:t})},e.prototype.unregister=function(e,t){var n=this.snippetMap,r=this.snippetNameMap;function i(e){var i=r[e.scope||t];if(i&&i[e.name]){delete i[e.name];var a=n[e.scope||t],o=a&&a.indexOf(e);o>=0&&a.splice(o,1)}}e.content?i(e):Array.isArray(e)&&e.forEach(i)},e.prototype.parseSnippetFile=function(e){e=e.replace(/\\r/g,``);for(var t=[],n={},r=/^#.*|^({[\\s\\S]*})\\s*$|^(\\S+) (.*)$|^((?:\\n*\\t.*)+)/gm,i;i=r.exec(e);){if(i[1])try{n=JSON.parse(i[1]),t.push(n)}catch{}if(i[4])n.content=i[4].replace(/^\\t/gm,``),t.push(n),n={};else{var a=i[2],o=i[3];if(a==`regex`){var s=/\\/((?:[^\\/\\\\]|\\\\.)*)|$/g;n.guard=s.exec(o)[1],n.trigger=s.exec(o)[1],n.endTrigger=s.exec(o)[1],n.endGuard=s.exec(o)[1]}else a==`snippet`?(n.tabTrigger=o.match(/^\\S*/)[0],n.name||=o):a&&(n[a]=o)}}return t},e.prototype.getSnippetByName=function(e,t){var n=this.snippetNameMap,r;return this.getActiveScopes(t).some(function(t){var i=n[t];return i&&(r=i[e]),!!r},this),r},e}();i.implement(m.prototype,a);var h=function(e,t,n){n===void 0&&(n={});var r=e.getCursorPosition(),i=e.session.getLine(r.row),a=e.session.getTabString(),o=i.match(/^\\s*/)[0];r.column<o.length&&(o=o.slice(0,r.column)),t=t.replace(/\\r/g,``);var s=this.tokenizeTmSnippet(t);s=this.resolveVariables(s,e),s=s.map(function(e){return e==`\n`&&!n.excludeExtraIndent?e+o:typeof e==`string`?e.replace(/\\t/g,a):e});var c=[];s.forEach(function(e,t){if(typeof e==`object`){var n=e.tabstopId,r=c[n];if(r||(r=c[n]=[],r.index=n,r.value=``,r.parents={}),r.indexOf(e)===-1){e.choices&&!r.choices&&(r.choices=e.choices),r.push(e);var i=s.indexOf(e,t+1);if(i!==-1){var a=s.slice(t+1,i);a.some(function(e){return typeof e==`object`})&&!r.value?r.value=a:a.length&&(!r.value||typeof r.value!=`string`)&&(r.value=a.join(``))}}}}),c.forEach(function(e){e.length=0});var l={};function u(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];if(typeof r==`object`){if(l[r.tabstopId])continue;r=t[e.lastIndexOf(r,n-1)]||{tabstopId:r.tabstopId}}t[n]=r}return t}for(var d=0;d<s.length;d++){var f=s[d];if(typeof f==`object`){var p=f.tabstopId,m=c[p],h=s.indexOf(f,d+1);if(l[p]){l[p]===f&&(delete l[p],Object.keys(l).forEach(function(e){m.parents[e]=!0}));continue}l[p]=f;var g=m.value;typeof g==`string`?f.fmt&&(g=this.tmStrFormat(g,f,e)):g=u(g),s.splice.apply(s,[d+1,Math.max(0,h-d)].concat(g,f)),m.indexOf(f)===-1&&m.push(f)}}var _=0,v=0,y=``;return s.forEach(function(e){if(typeof e==`string`){var t=e.split(`\n`);t.length>1?(v=t[t.length-1].length,_+=t.length-1):v+=e.length,y+=e}else e&&(e.start?e.end={row:_,column:v}:e.start={row:_,column:v})}),{text:y,tabstops:c,tokens:s}},g=function(){function e(e){if(this.index=0,this.ranges=[],this.tabstops=[],e.tabstopManager)return e.tabstopManager;e.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=o.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)}return e.prototype.attach=function(e){this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,this.session=e.session,this.editor.on(`change`,this.$onChange),this.editor.on(`changeSelection`,this.$onChangeSelection),this.editor.on(`changeSession`,this.$onChangeSession),this.editor.commands.on(`afterExec`,this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},e.prototype.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges.length=0,this.tabstops.length=0,this.selectedTabstop=null,this.editor.off(`change`,this.$onChange),this.editor.off(`changeSelection`,this.$onChangeSelection),this.editor.off(`changeSession`,this.$onChangeSession),this.editor.commands.off(`afterExec`,this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.session=null,this.editor=null},e.prototype.onChange=function(e){for(var t=e.action[0]==`r`,n=this.selectedTabstop||{},r=n.parents||{},i=this.tabstops.slice(),a=0;a<i.length;a++){var o=i[a],s=o==n||r[o.index];if(o.rangeList.$bias=+!s,e.action==`remove`&&o!==n){var c=o.parents&&o.parents[n.index],l=o.rangeList.pointIndex(e.start,c);l=l<0?-l-1:l+1;var u=o.rangeList.pointIndex(e.end,c);u=u<0?-u-1:u-1;for(var d=o.rangeList.ranges.slice(l,u),f=0;f<d.length;f++)this.removeRange(d[f])}o.rangeList.$onChange(e)}var p=this.session;!this.$inChange&&t&&p.getLength()==1&&!p.getValue()&&this.detach()},e.prototype.updateLinkedFields=function(){var e=this.selectedTabstop;if(!(!e||!e.hasLinkedRanges||!e.firstNonLinked)){this.$inChange=!0;for(var n=this.session,r=n.getTextRange(e.firstNonLinked),i=0;i<e.length;i++){var a=e[i];if(a.linked){var o=a.original,s=t.snippetManager.tmStrFormat(r,o,this.editor);n.replace(a,s)}}this.$inChange=!1}},e.prototype.onAfterExec=function(e){e.command&&!e.command.readOnly&&this.updateLinkedFields()},e.prototype.onChangeSelection=function(){if(this.editor){for(var e=this.editor.selection.lead,t=this.editor.selection.anchor,n=this.editor.selection.isEmpty(),r=0;r<this.ranges.length;r++)if(!this.ranges[r].linked){var i=this.ranges[r].contains(e.row,e.column),a=n||this.ranges[r].contains(t.row,t.column);if(i&&a)return}this.detach()}},e.prototype.onChangeSession=function(){this.detach()},e.prototype.tabNext=function(e){var t=this.tabstops.length,n=this.index+(e||1);n=Math.min(Math.max(n,1),t),n==t&&(n=0),this.selectTabstop(n),this.updateTabstopMarkers(),n===0&&this.detach()},e.prototype.selectTabstop=function(e){this.$openTabstops=null;var t=this.tabstops[this.index];if(t&&this.addTabstopMarkers(t),this.index=e,t=this.tabstops[this.index],!(!t||!t.length)){this.selectedTabstop=t;var n=t.firstNonLinked||t;if(t.choices&&(n.cursor=n.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange(n);else{var r=this.editor.multiSelect;r.toSingleRange(n);for(var i=0;i<t.length;i++)t.hasLinkedRanges&&t[i].linked||r.addRange(t[i].clone(),!0)}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand(`startAutocomplete`,{matches:this.selectedTabstop.choices})}},e.prototype.addTabstops=function(e,t,n){var r=this.useLink||!this.editor.getOption(`enableMultiselect`);if(this.$openTabstops||=[],!e[0]){var i=s.fromPoints(n,n);v(i.start,t),v(i.end,t),e[0]=[i],e[0].index=0}var a=[this.index+1,0],o=this.ranges,l=this.snippetId=(this.snippetId||0)+1;e.forEach(function(e,n){var i=this.$openTabstops[n]||e;i.snippetId=l;for(var u=0;u<e.length;u++){var d=e[u],f=s.fromPoints(d.start,d.end||d.start);_(f.start,t),_(f.end,t),f.original=d,f.tabstop=i,o.push(f),i==e?i[u]=f:i.unshift(f),d.fmtString||i.firstNonLinked&&r?(f.linked=!0,i.hasLinkedRanges=!0):i.firstNonLinked||=f}i.firstNonLinked||(i.hasLinkedRanges=!1),i===e&&(a.push(i),this.$openTabstops[n]=i),this.addTabstopMarkers(i),i.rangeList=i.rangeList||new c,i.rangeList.$bias=0,i.rangeList.addList(i)},this),a.length>2&&(this.tabstops.length&&a.push(a.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,a))},e.prototype.addTabstopMarkers=function(e){var t=this.session;e.forEach(function(e){e.markerId||=t.addMarker(e,`ace_snippet-marker`,`text`)})},e.prototype.removeTabstopMarkers=function(e){var t=this.session;e.forEach(function(e){t.removeMarker(e.markerId),e.markerId=null})},e.prototype.updateTabstopMarkers=function(){if(this.selectedTabstop){var e=this.selectedTabstop.snippetId;this.selectedTabstop.index===0&&e--,this.tabstops.forEach(function(t){t.snippetId===e?this.addTabstopMarkers(t):this.removeTabstopMarkers(t)},this)}},e.prototype.removeRange=function(e){var t=e.tabstop.indexOf(e);t!=-1&&e.tabstop.splice(t,1),t=this.ranges.indexOf(e),t!=-1&&this.ranges.splice(t,1),t=e.tabstop.rangeList.ranges.indexOf(e),t!=-1&&e.tabstop.splice(t,1),this.session.removeMarker(e.markerId),e.tabstop.length||(t=this.tabstops.indexOf(e.tabstop),t!=-1&&this.tabstops.splice(t,1),this.tabstops.length||this.detach())},e}();g.prototype.keyboardHandler=new l,g.prototype.keyboardHandler.bindKeys({Tab:function(e){t.snippetManager&&t.snippetManager.expandWithTab(e)||(e.tabstopManager.tabNext(1),e.renderer.scrollCursorIntoView())},\"Shift-Tab\":function(e){e.tabstopManager.tabNext(-1),e.renderer.scrollCursorIntoView()},Esc:function(e){e.tabstopManager.detach()}});var _=function(e,t){e.row==0&&(e.column+=t.column),e.row+=t.row},v=function(e,t){e.row==t.row&&(e.column-=t.column),e.row-=t.row};r.importCssString(`\n.ace_snippet-marker {\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n background: rgba(194, 193, 208, 0.09);\n border: 1px dotted rgba(211, 208, 235, 0.62);\n position: absolute;\n}`,`snippets.css`,!1),t.snippetManager=new m;var y=e(\"./editor\").Editor;(function(){this.insertSnippet=function(e,n){return t.snippetManager.insertSnippet(this,e,n)},this.expandSnippet=function(e){return t.snippetManager.expandWithTab(this,e)}}).call(y.prototype)}),ace.define(`ace/autocomplete/popup`,[`require`,`exports`,`module`,`ace/virtual_renderer`,`ace/editor`,`ace/range`,`ace/lib/event`,`ace/lib/lang`,`ace/lib/dom`,`ace/config`,`ace/lib/useragent`],function(e,t,n){var r=e(\"../virtual_renderer\").VirtualRenderer,i=e(\"../editor\").Editor,a=e(\"../range\").Range,o=e(\"../lib/event\"),s=e(\"../lib/lang\"),c=e(\"../lib/dom\"),l=e(\"../config\").nls,u=e(\"./../lib/useragent\"),d=function(e){return`suggest-aria-id:${e}`},f=u.isSafari?`menu`:`listbox`,p=u.isSafari?`menuitem`:`option`,m=u.isSafari?`aria-current`:`aria-selected`,h=function(e){var t=new r(e);t.$maxLines=4;var n=new i(t);return n.setHighlightActiveLine(!1),n.setShowPrintMargin(!1),n.renderer.setShowGutter(!1),n.renderer.setHighlightGutterLine(!1),n.$mouseHandler.$focusTimeout=0,n.$highlightTagPending=!0,n},g=function(){function e(e){var t=c.createElement(`div`),n=h(t);e&&e.appendChild(t),t.style.display=`none`,n.renderer.content.style.cursor=`default`,n.renderer.setStyle(`ace_autocomplete`),n.renderer.$textLayer.element.setAttribute(`role`,f),n.renderer.$textLayer.element.setAttribute(`aria-roledescription`,l(`autocomplete.popup.aria-roledescription`,`Autocomplete suggestions`)),n.renderer.$textLayer.element.setAttribute(`aria-label`,l(`autocomplete.popup.aria-label`,`Autocomplete suggestions`)),n.renderer.textarea.setAttribute(`aria-hidden`,`true`),n.setOption(`displayIndentGuides`,!1),n.setOption(`dragDelay`,150);var r=function(){};n.focus=r,n.$isFocused=!0,n.renderer.$cursorLayer.restartTimer=r,n.renderer.$cursorLayer.element.style.opacity=`0`,n.renderer.$maxLines=8,n.renderer.$keepTextAreaAtCursor=!1,n.setHighlightActiveLine(!1),n.session.highlight(``),n.session.$searchHighlight.clazz=`ace_highlight-marker`,n.on(`mousedown`,function(e){var t=e.getDocumentPosition();n.selection.moveToPosition(t),g.start.row=g.end.row=t.row,e.stop()});var i,u=new a(-1,0,-1,1/0),g=new a(-1,0,-1,1/0);g.id=n.session.addMarker(g,`ace_active-line`,`fullLine`),n.setSelectOnHover=function(e){e?u.id&&=(n.session.removeMarker(u.id),null):u.id=n.session.addMarker(u,`ace_line-hover`,`fullLine`)},n.setSelectOnHover(!1),n.on(`mousemove`,function(e){if(!i){i=e;return}if(!(i.x==e.x&&i.y==e.y)){i=e,i.scrollTop=n.renderer.scrollTop,n.isMouseOver=!0;var t=i.getDocumentPosition().row;u.start.row!=t&&(u.id||n.setRow(t),v(t))}}),n.renderer.on(`beforeRender`,function(){if(i&&u.start.row!=-1){i.$pos=null;var e=i.getDocumentPosition().row;u.id||n.setRow(e),v(e,!0)}}),n.renderer.on(`afterRender`,function(){for(var e=n.renderer.$textLayer,t=e.config.firstRow,r=e.config.lastRow;t<=r;t++){var i=e.element.childNodes[t-e.config.firstRow];i.setAttribute(`role`,p),i.setAttribute(`aria-roledescription`,l(`autocomplete.popup.item.aria-roledescription`,`item`)),i.setAttribute(`aria-setsize`,n.data.length),i.setAttribute(`aria-describedby`,`doc-tooltip`),i.setAttribute(`aria-posinset`,t+1);var a=n.getData(t);if(a){var o=`${a.caption||a.value}${a.meta?`, ${a.meta}`:``}`;i.setAttribute(`aria-label`,o)}i.querySelectorAll(`.ace_completion-highlight`).forEach(function(e){e.setAttribute(`role`,`mark`)})}}),n.renderer.on(`afterRender`,function(){var e=n.getRow(),t=n.renderer.$textLayer,r=t.element.childNodes[e-t.config.firstRow],i=document.activeElement;if(r!==n.selectedNode&&n.selectedNode&&(c.removeCssClass(n.selectedNode,`ace_selected`),n.selectedNode.removeAttribute(m),n.selectedNode.removeAttribute(`id`)),i.removeAttribute(`aria-activedescendant`),n.selectedNode=r,r){var a=d(e);c.addCssClass(r,`ace_selected`),r.id=a,t.element.setAttribute(`aria-activedescendant`,a),i.setAttribute(`aria-activedescendant`,a),r.setAttribute(m,`true`)}});var _=function(){v(-1)},v=function(e,t){e!==u.start.row&&(u.start.row=u.end.row=e,t||n.session._emit(`changeBackMarker`),n._emit(`changeHoverMarker`))};n.getHoveredRow=function(){return u.start.row},o.addListener(n.container,`mouseout`,function(){n.isMouseOver=!1,_()}),n.on(`hide`,_),n.on(`changeSelection`,_),n.session.doc.getLength=function(){return n.data.length},n.session.doc.getLine=function(e){var t=n.data[e];return typeof t==`string`?t:t&&t.value||``};var y=n.session.bgTokenizer;return y.$tokenizeRow=function(e){var t=n.data[e],r=[];if(!t)return r;typeof t==`string`&&(t={value:t});var i=t.caption||t.value||t.name;function a(e,n){e&&r.push({type:(t.className||``)+(n||``),value:e})}for(var o=i.toLowerCase(),s=(n.filterText||``).toLowerCase(),c=0,l=0,u=0;u<=s.length;u++)if(u!=l&&(t.matchMask&1<<u||u==s.length)){var d=s.slice(l,u);l=u;var f=o.indexOf(d,c);if(f==-1)continue;a(i.slice(c,f),``),c=f+d.length,a(i.slice(f,c),`completion-highlight`)}return a(i.slice(c,i.length),``),r.push({type:`completion-spacer`,value:` `}),t.meta&&r.push({type:`completion-meta`,value:t.meta}),t.message&&r.push({type:`completion-message`,value:t.message}),r},y.$updateOnChange=r,y.start=r,n.session.$computeWidth=function(){return this.screenWidth=0},n.isOpen=!1,n.isTopdown=!1,n.autoSelect=!0,n.filterText=``,n.isMouseOver=!1,n.data=[],n.setData=function(e,t){n.filterText=t||``,n.setValue(s.stringRepeat(`\n`,e.length),-1),n.data=e||[],n.setRow(0)},n.getData=function(e){return n.data[e]},n.getRow=function(){return g.start.row},n.setRow=function(e){e=Math.max(this.autoSelect?0:-1,Math.min(this.data.length-1,e)),g.start.row!=e&&(n.selection.clearSelection(),g.start.row=g.end.row=e||0,n.session._emit(`changeBackMarker`),n.moveCursorTo(e||0,0),n.isOpen&&n._signal(`select`))},n.on(`changeSelection`,function(){n.isOpen&&n.setRow(n.selection.lead.row),n.renderer.scrollCursorIntoView()}),n.hide=function(){this.container.style.display=`none`,n.anchorPos=null,n.anchor=null,n.isOpen&&(n.isOpen=!1,this._signal(`hide`))},n.tryShow=function(e,t,r,a){if(!a&&n.isOpen&&n.anchorPos&&n.anchor&&n.anchorPos.top===e.top&&n.anchorPos.left===e.left&&n.anchor===r)return!0;var o=this.container,s=this.renderer.scrollBar.width||10,l=window.innerHeight-s,u=window.innerWidth-s,d=this.renderer,f=d.$maxLines*t*1.4,p={top:0,bottom:0,left:0},m=l-e.top-3*this.$borderSize-t,h=e.top-3*this.$borderSize;r||=h<=m||m>=f?`bottom`:`top`,r===`top`?(p.bottom=e.top-this.$borderSize,p.top=p.bottom-f):r===`bottom`&&(p.top=e.top+t+this.$borderSize,p.bottom=p.top+f);var g=p.top>=0&&p.bottom<=l;if(!a&&!g)return!1;g?d.$maxPixelHeight=null:r===`top`?d.$maxPixelHeight=h:d.$maxPixelHeight=m,r===`top`?(o.style.top=``,o.style.bottom=l+s-p.bottom+`px`,n.isTopdown=!1):(o.style.top=p.top+`px`,o.style.bottom=``,n.isTopdown=!0),o.style.display=``;var _=e.left;return _+o.offsetWidth>u&&(_=u-o.offsetWidth),o.style.left=_+`px`,o.style.right=``,c.$fixPositionBug(o),n.isOpen||(n.isOpen=!0,this._signal(`show`),i=null),n.anchorPos=e,n.anchor=r,!0},n.show=function(e,t,n){this.tryShow(e,t,n?`bottom`:void 0,!0)},n.goTo=function(e){var t=this.getRow(),n=this.session.getLength()-1;switch(e){case`up`:t=t<=0?n:t-1;break;case`down`:t=t>=n?-1:t+1;break;case`start`:t=0;break;case`end`:t=n;break}this.setRow(t)},n.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},n.$imageSize=0,n.$borderSize=1,n}return e}();c.importCssString(`\n.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #CAD6FA;\n z-index: 1;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #3a674e;\n}\n.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid #abbffe;\n margin-top: -1px;\n background: rgba(233,233,253,0.4);\n position: absolute;\n z-index: 2;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid rgba(109, 150, 13, 0.8);\n background: rgba(58, 103, 78, 0.62);\n}\n.ace_completion-meta {\n opacity: 0.5;\n margin-left: 0.9em;\n}\n.ace_completion-message {\n margin-left: 0.9em;\n color: blue;\n}\n.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #2d69c7;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #93ca12;\n}\n.ace_editor.ace_autocomplete {\n width: 300px;\n z-index: 200000;\n border: 1px lightgray solid;\n position: fixed;\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n line-height: 1.4;\n background: #fefefe;\n color: #111;\n}\n.ace_dark.ace_editor.ace_autocomplete {\n border: 1px #484747 solid;\n box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);\n line-height: 1.4;\n background: #25282c;\n color: #c1c1c1;\n}\n.ace_autocomplete .ace_text-layer {\n width: calc(100% - 8px);\n}\n.ace_autocomplete .ace_line {\n display: flex;\n align-items: center;\n}\n.ace_autocomplete .ace_line > * {\n min-width: 0;\n flex: 0 0 auto;\n}\n.ace_autocomplete .ace_line .ace_ {\n flex: 0 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ace_autocomplete .ace_completion-spacer {\n flex: 1;\n}\n.ace_autocomplete.ace_loading:after {\n content: \"\";\n position: absolute;\n top: 0px;\n height: 2px;\n width: 8%;\n background: blue;\n z-index: 100;\n animation: ace_progress 3s infinite linear;\n animation-delay: 300ms;\n transform: translateX(-100%) scaleX(1);\n}\n@keyframes ace_progress {\n 0% { transform: translateX(-100%) scaleX(1) }\n 50% { transform: translateX(625%) scaleX(2) } \n 100% { transform: translateX(1500%) scaleX(3) } \n}\n@media (prefers-reduced-motion) {\n .ace_autocomplete.ace_loading:after {\n transform: translateX(625%) scaleX(2);\n animation: none;\n }\n}\n`,`autocompletion.css`,!1),t.AcePopup=g,t.$singleLineEditor=h,t.getAriaId=d}),ace.define(`ace/autocomplete/inline_screenreader`,[`require`,`exports`,`module`],function(e,t,n){t.AceInlineScreenReader=function(){function e(e){this.editor=e,this.screenReaderDiv=document.createElement(`div`),this.screenReaderDiv.classList.add(`ace_screenreader-only`),this.editor.container.appendChild(this.screenReaderDiv)}return e.prototype.setScreenReaderContent=function(e){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on(`afterRender`,function(){var e=this.popup.getRow(),t=this.popup.renderer.$textLayer,n=t.element.childNodes[e-t.config.firstRow];if(n){for(var r=`doc-tooltip `,i=0;i<this._lines.length;i++)r+=`ace-inline-screenreader-line-${i} `;n.setAttribute(`aria-describedby`,r)}}.bind(this)));this.screenReaderDiv.firstChild;)this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);this._lines=e.split(/\\r\\n|\\r|\\n/);var t=this.createCodeBlock();this.screenReaderDiv.appendChild(t)},e.prototype.destroy=function(){this.screenReaderDiv.remove()},e.prototype.createCodeBlock=function(){var e=document.createElement(`pre`);e.setAttribute(`id`,`ace-inline-screenreader`);for(var t=0;t<this._lines.length;t++){var n=document.createElement(`code`);n.setAttribute(`id`,`ace-inline-screenreader-line-${t}`);var r=document.createTextNode(this._lines[t]);n.appendChild(r),e.appendChild(n)}return e},e}()}),ace.define(`ace/autocomplete/inline`,[`require`,`exports`,`module`,`ace/snippets`,`ace/autocomplete/inline_screenreader`],function(e,t,n){var r=e(\"../snippets\").snippetManager,i=e(\"./inline_screenreader\").AceInlineScreenReader;t.AceInline=function(){function e(){this.editor=null}return e.prototype.show=function(e,t,n){if(n||=``,e&&this.editor&&this.editor!==e&&(this.hide(),this.editor=null,this.inlineScreenReader=null),!e||!t)return!1;this.inlineScreenReader||=new i(e);var a=t.snippet?r.getDisplayTextForSnippet(e,t.snippet):t.value;return t.hideInlinePreview||!a||!a.startsWith(n)?!1:(this.editor=e,this.inlineScreenReader.setScreenReaderContent(a),a=a.slice(n.length),a===``?e.removeGhostText():e.setGhostText(a),!0)},e.prototype.isOpen=function(){return this.editor?!!this.editor.renderer.$ghostText:!1},e.prototype.hide=function(){return this.editor?(this.editor.removeGhostText(),!0):!1},e.prototype.destroy=function(){this.hide(),this.editor=null,this.inlineScreenReader&&=(this.inlineScreenReader.destroy(),null)},e}()}),ace.define(`ace/autocomplete/util`,[`require`,`exports`,`module`],function(e,t,n){t.parForEach=function(e,t,n){var r=0,i=e.length;i===0&&n();for(var a=0;a<i;a++)t(e[a],function(e,t){r++,r===i&&n(e,t)})};var r=/[a-zA-Z_0-9\\$\\-\\u00A2-\\u2000\\u2070-\\uFFFF]/;t.retrievePrecedingIdentifier=function(e,t,n){n||=r;for(var i=[],a=t-1;a>=0&&n.test(e[a]);a--)i.push(e[a]);return i.reverse().join(``)},t.retrieveFollowingIdentifier=function(e,t,n){n||=r;for(var i=[],a=t;a<e.length&&n.test(e[a]);a++)i.push(e[a]);return i},t.getCompletionPrefix=function(e){var t=e.getCursorPosition(),n=e.session.getLine(t.row),r;return e.completers.forEach(function(e){e.identifierRegexps&&e.identifierRegexps.forEach(function(e){!r&&e&&(r=this.retrievePrecedingIdentifier(n,t.column,e))}.bind(this))}.bind(this)),r||this.retrievePrecedingIdentifier(n,t.column)},t.triggerAutocomplete=function(e,t){var t=t??e.session.getPrecedingCharacter();return e.completers.some(function(e){if(e.triggerCharacters&&Array.isArray(e.triggerCharacters))return e.triggerCharacters.includes(t)})}}),ace.define(`ace/autocomplete`,[`require`,`exports`,`module`,`ace/keyboard/hash_handler`,`ace/autocomplete/popup`,`ace/autocomplete/inline`,`ace/autocomplete/popup`,`ace/autocomplete/util`,`ace/lib/lang`,`ace/lib/dom`,`ace/snippets`,`ace/config`,`ace/lib/event`,`ace/lib/scroll`],function(e,t,n){var r=e(\"./keyboard/hash_handler\").HashHandler,i=e(\"./autocomplete/popup\").AcePopup,a=e(\"./autocomplete/inline\").AceInline,o=e(\"./autocomplete/popup\").getAriaId,s=e(\"./autocomplete/util\"),c=e(\"./lib/lang\"),l=e(\"./lib/dom\"),u=e(\"./snippets\").snippetManager,d=e(\"./config\"),f=e(\"./lib/event\"),p=e(\"./lib/scroll\").preventParentScroll,m=function(e,t){t.completer&&t.completer.destroy()},h=function(){function e(){this.autoInsert=!1,this.autoSelect=!0,this.autoShown=!1,this.exactMatch=!1,this.inlineEnabled=!1,this.keyboardHandler=new r,this.keyboardHandler.bindKeys(this.commands),this.parentNode=null,this.setSelectOnHover=!1,this.hasSeen=new Set,this.showLoadingState=!1,this.stickySelectionDelay=500,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.onLayoutChange=this.onLayoutChange.bind(this),this.changeTimer=c.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=c.delayedCall(this.updateDocTooltip.bind(this),50),this.popupTimer=c.delayedCall(this.$updatePopupPosition.bind(this),50),this.stickySelectionTimer=c.delayedCall(function(){this.stickySelection=!0}.bind(this),this.stickySelectionDelay),this.$firstOpenTimer=c.delayedCall(function(){var t=this.completionProvider&&this.completionProvider.initialPosition;this.autoShown||this.popup&&this.popup.isOpen||!t||this.editor.completers.length===0||(this.completions=new _(e.completionsForLoading),this.openPopup(this.editor,t.prefix,!1),this.popup.renderer.setStyle(`ace_loading`,!0))}.bind(this),this.stickySelectionDelay)}return Object.defineProperty(e,\"completionsForLoading\",{get:function(){return[{caption:d.nls(`autocomplete.loading`,`Loading...`),value:``}]},enumerable:!1,configurable:!0}),e.prototype.$init=function(){return this.popup=new i(this.parentNode||document.body||document.documentElement),this.popup.on(`click`,function(e){this.insertMatch(),e.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on(`show`,this.$onPopupShow.bind(this)),this.popup.on(`hide`,this.$onHidePopup.bind(this)),this.popup.on(`select`,this.$onPopupChange.bind(this)),f.addListener(this.popup.container,`mouseout`,this.mouseOutListener.bind(this)),this.popup.on(`changeHoverMarker`,this.tooltipTimer.bind(null,null)),this.popup.renderer.on(`afterRender`,this.$onPopupRender.bind(this)),this.popup},e.prototype.$initInline=function(){if(!(!this.inlineEnabled||this.inlineRenderer))return this.inlineRenderer=new a,this.inlineRenderer},e.prototype.getPopup=function(){return this.popup||this.$init()},e.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip(),this.stickySelectionTimer.cancel(),this.popupTimer.cancel(),this.stickySelection=!1},e.prototype.$seen=function(e){!this.hasSeen.has(e)&&e&&e.completer&&e.completer.onSeen&&typeof e.completer.onSeen==`function`&&(e.completer.onSeen(this.editor,e),this.hasSeen.add(e))},e.prototype.$onPopupChange=function(e){if(this.inlineRenderer&&this.inlineEnabled){var t=e?null:this.popup.getData(this.popup.getRow());if(this.$updateGhostText(t),this.popup.isMouseOver&&this.setSelectOnHover){this.tooltipTimer.call(null,null);return}this.popupTimer.schedule(),this.tooltipTimer.schedule()}else this.popupTimer.call(null,null),this.tooltipTimer.call(null,null)},e.prototype.$updateGhostText=function(e){var t=this.base.row,n=this.base.column,r=this.editor.getCursorPosition().column,i=this.editor.session.getLine(t).slice(n,r);this.inlineRenderer.show(this.editor,e,i)?this.$seen(e):this.inlineRenderer.hide()},e.prototype.$onPopupRender=function(){var e=this.inlineRenderer&&this.inlineEnabled;if(this.completions&&this.completions.filtered&&this.completions.filtered.length>0)for(var t=this.popup.getFirstVisibleRow();t<=this.popup.getLastVisibleRow();t++){var n=this.popup.getData(t);n&&(!e||n.hideInlinePreview)&&this.$seen(n)}},e.prototype.$onPopupShow=function(e){this.$onPopupChange(e),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},e.prototype.observeLayoutChanges=function(){if(!(this.$elements||!this.editor)){window.addEventListener(`resize`,this.onLayoutChange,{passive:!0}),window.addEventListener(`wheel`,this.mousewheelListener);for(var e=this.editor.container.parentNode,t=[];e;)t.push(e),e.addEventListener(`scroll`,this.onLayoutChange,{passive:!0}),e=e.parentNode;this.$elements=t}},e.prototype.unObserveLayoutChanges=function(){var e=this;window.removeEventListener(`resize`,this.onLayoutChange,{passive:!0}),window.removeEventListener(`wheel`,this.mousewheelListener),this.$elements&&this.$elements.forEach(function(t){t.removeEventListener(`scroll`,e.onLayoutChange,{passive:!0})}),this.$elements=null},e.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},e.prototype.$updatePopupPosition=function(){var e=this.editor,t=e.renderer,n=t.layerConfig.lineHeight,r=t.$cursorLayer.getPixelPosition(this.base,!0);r.left-=this.popup.getTextLeftOffset();var i=e.container.getBoundingClientRect();r.top+=i.top-t.layerConfig.offset,r.left+=i.left-e.renderer.scrollLeft,r.left+=t.gutterWidth;var a={top:r.top,left:r.left};t.$ghostText&&t.$ghostTextWidget&&this.base.row===t.$ghostText.position.row&&(a.top+=t.$ghostTextWidget.el.offsetHeight);var o=e.container.getBoundingClientRect().bottom-n,s=o<a.top?{top:o,left:a.left}:a;this.popup.tryShow(s,n,`bottom`)||this.popup.tryShow(r,n,`top`)||this.popup.show(r,n)},e.prototype.openPopup=function(e,t,n){this.$firstOpenTimer.cancel(),this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setSelectOnHover(this.setSelectOnHover);var r=this.popup.getRow(),i=this.popup.data[r];this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:o(this.popup.getRow()),inline:this.inlineEnabled}),e.keyBinding.addKeyboardHandler(this.keyboardHandler);var a;this.stickySelection&&(a=this.popup.data.indexOf(i)),(!a||a===-1)&&(a=0),this.popup.setRow(this.autoSelect?a:-1),a===r&&i!==this.completions.filtered[a]&&this.$onPopupChange();var s=this.inlineRenderer&&this.inlineEnabled;if(a===r&&s){var c=this.popup.getData(this.popup.getRow());this.$updateGhostText(c)}n||(this.popup.setTheme(e.getTheme()),this.popup.setFontSize(e.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges()},e.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off(`changeSelection`,this.changeListener),this.editor.off(`blur`,this.blurListener),this.editor.off(`mousedown`,this.mousedownListener),this.editor.off(`mousewheel`,this.mousewheelListener)),this.$firstOpenTimer.cancel(),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.popup&&this.popup.renderer&&this.popup.renderer.off(`afterRender`,this.$onPopupRender),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges()},e.prototype.changeListener=function(e){var t=this.editor.selection.lead;(t.row!=this.base.row||t.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},e.prototype.blurListener=function(e){var t=document.activeElement,n=this.editor.textInput.getElement(),r=e.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(e.relatedTarget),i=this.popup&&this.popup.container;t!=n&&t.parentNode!=i&&!r&&t!=this.tooltipNode&&e.relatedTarget!=n&&this.detach()},e.prototype.mousedownListener=function(e){this.detach()},e.prototype.mousewheelListener=function(e){this.popup&&!this.popup.isMouseOver&&this.detach()},e.prototype.mouseOutListener=function(e){this.popup.isOpen&&this.$updatePopupPosition()},e.prototype.goTo=function(e){this.popup.goTo(e)},e.prototype.insertMatch=function(e,t){if(e||=this.popup.getData(this.popup.getRow()),!e)return!1;if(e.value===``)return this.detach();var n=this.completions,r=this.getCompletionProvider().insertMatch(this.editor,e,n.filterText,t);return this.completions==n&&this.detach(),r},e.prototype.showPopup=function(e,t){this.editor&&this.detach(),this.activated=!0,this.editor=e,e.completer!=this&&(e.completer&&e.completer.detach(),e.completer=this),e.on(`changeSelection`,this.changeListener),e.on(`blur`,this.blurListener),e.on(`mousedown`,this.mousedownListener),e.on(`mousewheel`,this.mousewheelListener),this.updateCompletions(!1,t)},e.prototype.getCompletionProvider=function(e){return this.completionProvider||=new g(e),this.completionProvider},e.prototype.gatherCompletions=function(e,t){return this.getCompletionProvider().gatherCompletions(e,t)},e.prototype.updateCompletions=function(t,n){if(t&&this.base&&this.completions){var r=this.editor.getCursorPosition(),i=this.editor.session.getTextRange({start:this.base,end:r});if(i==this.completions.filterText)return;if(this.completions.setFilter(i),!this.completions.filtered.length||this.completions.filtered.length==1&&this.completions.filtered[0].value==i&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,i,t);return}if(n&&n.matches){var r=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(r.row,r.column),this.base.$insertRight=!0,this.completions=new _(n.matches),this.getCompletionProvider().completions=this.completions,this.openPopup(this.editor,``,t)}var a=this.editor.getSession(),r=this.editor.getCursorPosition(),i=s.getCompletionPrefix(this.editor);this.base=a.doc.createAnchor(r.row,r.column-i.length),this.base.$insertRight=!0;var o={exactMatch:this.exactMatch,ignoreCaption:this.ignoreCaption};this.getCompletionProvider({prefix:i,pos:r}).provideCompletions(this.editor,o,function(n,r,i){var a=r.filtered,o=s.getCompletionPrefix(this.editor);if(this.$firstOpenTimer.cancel(),i){if(!a.length){var c=!this.autoShown&&this.emptyMessage;if(typeof c==`function`&&(c=this.emptyMessage(o)),c){var l=[{caption:c,value:``}];this.completions=new _(l),this.openPopup(this.editor,o,t),this.popup.renderer.setStyle(`ace_loading`,!1),this.popup.renderer.setStyle(`ace_empty-message`,!0);return}return this.detach()}if(a.length==1&&a[0].value==o&&!a[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&a.length==1)return this.insertMatch(a[0])}this.completions=!i&&this.showLoadingState?new _(e.completionsForLoading.concat(a),r.filterText):r,this.openPopup(this.editor,o,t),this.popup.renderer.setStyle(`ace_empty-message`,!1),this.popup.renderer.setStyle(`ace_loading`,!i)}.bind(this)),this.showLoadingState&&!this.autoShown&&!(this.popup&&this.popup.isOpen)&&this.$firstOpenTimer.delay(this.stickySelectionDelay/2)},e.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},e.prototype.updateDocTooltip=function(){var e=this.popup,t=this.completions&&this.completions.filtered,n=t&&(t[e.getHoveredRow()]||t[e.getRow()]),r=null;if(!n||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var i=this.editor.completers.length,a=0;a<i;a++){var o=this.editor.completers[a];if(o.getDocTooltip&&n.completerId===o.id){r=o.getDocTooltip(n);break}}if(!r&&typeof n!=`string`&&(r=n),typeof r==`string`&&(r={docText:r}),!r||!(r.docHTML||r.docText))return this.hideDocTooltip();this.showDocTooltip(r)},e.prototype.showDocTooltip=function(e){this.tooltipNode||(this.tooltipNode=l.createElement(`div`),this.tooltipNode.style.margin=`0`,this.tooltipNode.style.pointerEvents=`auto`,this.tooltipNode.style.overscrollBehavior=`contain`,this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this),this.tooltipNode.id=`doc-tooltip`,this.tooltipNode.setAttribute(`role`,`tooltip`),this.tooltipNode.addEventListener(`wheel`,p));var t=this.editor.renderer.theme;this.tooltipNode.className=`ace_tooltip ace_doc-tooltip `+(t.isDark?`ace_dark `:``)+(t.cssClass||``);var n=this.tooltipNode;e.docHTML?n.innerHTML=e.docHTML:e.docText&&(n.textContent=e.docText),n.parentNode||this.popup.container.appendChild(this.tooltipNode);var r=this.popup,i=r.container.getBoundingClientRect(),a=400,o=300,s=r.renderer.scrollBar.width||10,c=i.left,u=window.innerWidth-i.right-s,d=r.isTopdown?window.innerHeight-s-i.bottom:i.top,f=[Math.min(u/a,1),Math.min(c/a,1),Math.min(d/o,1)*.9],m=Math.max.apply(Math,f),h=n.style;h.display=`block`,m==f[0]||f[0]>=1?(h.left=i.right+1+`px`,h.right=``,h.maxWidth=a*m+`px`,h.top=i.top+`px`,h.bottom=``,h.maxHeight=Math.min(window.innerHeight-s-i.top,o)+`px`):m==f[1]||f[1]>=1?(h.right=window.innerWidth-i.left+`px`,h.left=``,h.maxWidth=a*m+`px`,h.top=i.top+`px`,h.bottom=``,h.maxHeight=Math.min(window.innerHeight-s-i.top,o)+`px`):m==f[2]&&(h.left=i.left+`px`,h.right=``,h.maxWidth=Math.min(a,window.innerWidth-i.left)+`px`,r.isTopdown?(h.top=i.bottom+`px`,h.bottom=``,h.maxHeight=Math.min(window.innerHeight-s-i.bottom,o)+`px`):(h.top=``,h.bottom=window.innerHeight-i.top+`px`,h.maxHeight=Math.min(i.top,o)+`px`)),l.$fixPositionBug(n)},e.prototype.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),this.tooltipNode){var e=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==e&&this.editor.focus(),this.tooltipNode=null,e.parentNode&&e.parentNode.removeChild(e)}},e.prototype.onTooltipClick=function(e){for(var t=e.target;t&&t!=this.tooltipNode;){if(t.nodeName==`A`&&t.href){t.rel=`noreferrer`,t.target=`_blank`;break}t=t.parentNode}},e.prototype.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var e=this.popup.container;e&&e.parentNode&&e.parentNode.removeChild(e)}this.editor&&this.editor.completer==this&&(this.editor.off(`destroy`,m),this.editor.completer=null),this.inlineRenderer=this.popup=this.editor=null},e.for=function(t){return t.completer instanceof e?t.completer:(t.completer&&=(t.completer.destroy(),null),d.get(`sharedPopups`)?(e.$sharedInstance||=new e,t.completer=e.$sharedInstance):(t.completer=new e,t.once(`destroy`,m)),t.completer)},e}();h.prototype.commands={Up:function(e){e.completer.goTo(`up`)},Down:function(e){e.completer.goTo(`down`)},\"Ctrl-Up|Ctrl-Home\":function(e){e.completer.goTo(`start`)},\"Ctrl-Down|Ctrl-End\":function(e){e.completer.goTo(`end`)},Esc:function(e){e.completer.detach()},Return:function(e){return e.completer.insertMatch()},\"Shift-Return\":function(e){e.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(e){var t=e.completer.insertMatch();if(!t&&!e.tabstopManager)e.completer.goTo(`down`);else return t},Backspace:function(e){e.execCommand(`backspace`),!s.getCompletionPrefix(e)&&e.completer&&e.completer.detach()},PageUp:function(e){e.completer.popup.gotoPageUp()},PageDown:function(e){e.completer.popup.gotoPageDown()}},h.startCommand={name:`startAutocomplete`,exec:function(e,t){var n=h.for(e);n.autoInsert=!1,n.autoSelect=!0,n.autoShown=!1,n.showPopup(e,t),n.cancelContextMenu()},bindKey:`Ctrl-Space|Ctrl-Shift-Space|Alt-Space`};var g=function(){function e(e){this.initialPosition=e,this.active=!0}return e.prototype.insertByIndex=function(e,t,n){return!this.completions||!this.completions.filtered?!1:this.insertMatch(e,this.completions.filtered[t],n)},e.prototype.insertMatch=function(e,t,n){if(!t)return!1;if(e.startOperation({command:{name:`insertMatch`}}),t.completer&&t.completer.insertMatch)t.completer.insertMatch(e,t);else{if(!this.completions)return!1;var r=this.completions.filterText.length,i=0;if(t.range&&t.range.start.row===t.range.end.row&&(r-=this.initialPosition.prefix.length,r+=this.initialPosition.pos.column-t.range.start.column,i+=t.range.end.column-this.initialPosition.pos.column),r||i)for(var a=e.selection.getAllRanges?e.selection.getAllRanges():[e.getSelectionRange()],o=0,s;s=a[o];o++)s.start.column-=r,s.end.column+=i,e.session.remove(s);t.snippet?u.insertSnippet(e,t.snippet):this.$insertString(e,t),t.completer&&t.completer.onInsert&&typeof t.completer.onInsert==`function`&&t.completer.onInsert(e,t),t.command&&t.command===`startAutocomplete`&&e.execCommand(t.command)}return e.endOperation(),!0},e.prototype.$insertString=function(e,t){var n=t.value||t;e.execCommand(`insertstring`,n)},e.prototype.gatherCompletions=function(e,t){var n=e.getSession(),r=e.getCursorPosition(),i=s.getCompletionPrefix(e),a=[];this.completers=e.completers;var o=e.completers.length;return e.completers.forEach(function(c,l){c.getCompletions(e,n,r,i,function(n,r){c.hideInlinePreview&&(r=r.map(function(e){return Object.assign(e,{hideInlinePreview:c.hideInlinePreview})})),!n&&r&&(a=a.concat(r)),t(null,{prefix:s.getCompletionPrefix(e),matches:a,finished:--o===0})})}),!0},e.prototype.provideCompletions=function(e,t,n){var r=function(e){var r=e.prefix,i=e.matches;this.completions=new _(i),t.exactMatch&&(this.completions.exactMatch=!0),t.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter(r),(e.finished||this.completions.filtered.length)&&n(null,this.completions,e.finished)}.bind(this),i=!0,a=null;if(this.gatherCompletions(e,function(e,t){if(this.active&&(e&&(n(e,[],!0),this.detach()),t.prefix.indexOf(t.prefix)===0)){if(i){a=t;return}r(t)}}.bind(this)),i=!1,a){var o=a;a=null,r(o)}},e.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach(function(e){typeof e.cancel==`function`&&e.cancel()})},e}(),_=function(){function e(e,t){this.all=e,this.filtered=e,this.filterText=t||``,this.exactMatch=!1,this.ignoreCaption=!1}return e.prototype.setFilter=function(e){if(e.length>this.filterText&&e.lastIndexOf(this.filterText,0)===0)var t=this.filtered;else var t=this.all;this.filterText=e,t=this.filterCompletions(t,this.filterText),t=t.sort(function(e,t){return t.exactMatch-e.exactMatch||t.$score-e.$score||(e.caption||e.value).localeCompare(t.caption||t.value)});var n=null;t=t.filter(function(e){var t=e.snippet||e.caption||e.value;return t===n?!1:(n=t,!0)}),this.filtered=t},e.prototype.filterCompletions=function(e,t){var n=[],r=t.toUpperCase(),i=t.toLowerCase();loop:for(var a=0,o;o=e[a];a++){if(o.skipFilter){o.$score=o.score,n.push(o);continue}var s=!this.ignoreCaption&&o.caption||o.value||o.snippet;if(s){var c=-1,l=0,u=0,d,f;if(this.exactMatch){if(t!==s.substr(0,t.length))continue loop}else{var p=s.toLowerCase().indexOf(i);if(p>-1)u=p;else for(var m=0;m<t.length;m++){var h=s.indexOf(i[m],c+1),g=s.indexOf(r[m],c+1);if(d=h>=0&&(g<0||h<g)?h:g,d<0)continue loop;f=d-c-1,f>0&&(c===-1&&(u+=10),u+=f,l|=1<<m),c=d}}o.matchMask=l,o.exactMatch=+!u,o.$score=(o.score||0)-u,n.push(o)}}return n},e}();t.Autocomplete=h,t.CompletionProvider=g,t.FilteredList=_}),ace.define(`ace/marker_group`,[`require`,`exports`,`module`],function(e,t,n){var r=function(){function e(e,t){t&&(this.markerType=t.markerType),this.markers=[],this.session=e,e.addDynamicMarker(this)}return e.prototype.getMarkerAtPosition=function(e){return this.markers.find(function(t){return t.range.contains(e.row,e.column)})},e.prototype.markersComparator=function(e,t){return e.range.start.row-t.range.start.row},e.prototype.setMarkers=function(e){this.markers=e.sort(this.markersComparator).slice(0,this.MAX_MARKERS),this.session._signal(`changeBackMarker`)},e.prototype.update=function(e,t,n,r){if(!(!this.markers||!this.markers.length))for(var i=r.firstRow,a=r.lastRow,o,s=0,c=0,l=0;l<this.markers.length;l++){var u=this.markers[l];if(!(u.range.end.row<i)&&!(u.range.start.row>a)&&(u.range.start.row===c?s++:(c=u.range.start.row,s=0),!(s>200))){var d=u.range.clipRows(i,a);if(!(d.start.row===d.end.row&&d.start.column===d.end.column)){var f=d.toScreenRange(n);if(f.isEmpty()){o=n.getNextFoldLine(d.end.row,o),o&&o.end.row>d.end.row&&(i=o.end.row);continue}this.markerType===`fullLine`?t.drawFullLineMarker(e,f,u.className,r):f.isMultiLine()?this.markerType===`line`?t.drawMultiLineMarker(e,f,u.className,r):t.drawTextMarker(e,f,u.className,r):t.drawSingleLineMarker(e,f,u.className+` ace_br15`,r)}}}},e}();r.prototype.MAX_MARKERS=1e4,t.MarkerGroup=r}),ace.define(`ace/autocomplete/text_completer`,[`require`,`exports`,`module`,`ace/range`],function(e,t,n){var r=e(\"../range\").Range,i=/[^a-zA-Z_0-9\\$\\-\\u00C0-\\u1FFF\\u2C00-\\uD7FF\\w]+/;function a(e,t){return e.getTextRange(r.fromPoints({row:0,column:0},t)).split(i).length-1}function o(e,t){var n=a(e,t),r=e.getValue().split(i),o=Object.create(null),s=r[n];return r.forEach(function(e,t){if(!(!e||e===s)){var i=Math.abs(n-t),a=r.length-i;o[e]?o[e]=Math.max(a,o[e]):o[e]=a}}),o}t.id=`textCompleter`,t.getCompletions=function(e,t,n,r,i){var a=o(t,n);i(null,Object.keys(a).map(function(e){return{caption:e,value:e,score:a[e],meta:`local`}}))}}),ace.define(`ace/ext/language_tools`,[`require`,`exports`,`module`,`ace/snippets`,`ace/autocomplete`,`ace/config`,`ace/lib/lang`,`ace/autocomplete/util`,`ace/marker_group`,`ace/autocomplete/text_completer`,`ace/editor`,`ace/config`],function(e,t,n){var r=e(\"../snippets\").snippetManager,i=e(\"../autocomplete\").Autocomplete,a=e(\"../config\"),o=e(\"../lib/lang\"),s=e(\"../autocomplete/util\"),c=e(\"../marker_group\").MarkerGroup,l=e(\"../autocomplete/text_completer\"),u={getCompletions:function(e,t,n,r,i){if(t.$mode.completer)return t.$mode.completer.getCompletions(e,t,n,r,i);var a=e.session.getState(n.row),o=t.$mode.getCompletions(a,t,n,r);o=o.map(function(e){return e.completerId=u.id,e}),i(null,o)},id:`keywordCompleter`},d=function(e){var t={};return e.replace(/\\${(\\d+)(:(.*?))?}/g,function(e,n,r,i){return t[n]=i||``}).replace(/\\$(\\d+?)/g,function(e,n){return t[n]})},f={getCompletions:function(e,t,n,i,a){var o=[],s=t.getTokenAt(n.row,n.column);s&&s.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\\.xml$/)?o.push(`html-tag`):o=r.getActiveScopes(e);var c=r.snippetMap,l=[];o.forEach(function(e){for(var t=c[e]||[],n=t.length;n--;){var r=t[n],i=r.name||r.tabTrigger;i&&l.push({caption:i,snippet:r.content,meta:r.tabTrigger&&!r.name?r.tabTrigger+`\u21E5 `:`snippet`,completerId:f.id})}},this),a(null,l)},getDocTooltip:function(e){e.snippet&&!e.docHTML&&(e.docHTML=[`<b>`,o.escapeHTML(e.caption),`</b>`,`<hr></hr>`,o.escapeHTML(d(e.snippet))].join(``))},id:`snippetCompleter`},p=[f,l,u];t.setCompleters=function(e){p.length=0,e&&p.push.apply(p,e)},t.addCompleter=function(e){p.push(e)},t.textCompleter=l,t.keyWordCompleter=u,t.snippetCompleter=f;var m={name:`expandSnippet`,exec:function(e){return r.expandWithTab(e)},bindKey:`Tab`},h=function(e,t){g(t.session.$mode)},g=function(e){typeof e==`string`&&(e=a.$modes[e]),e&&(r.files||={},_(e.$id,e.snippetFileId),e.modes&&e.modes.forEach(g))},_=function(e,t){!t||!e||r.files[e]||(r.files[e]={},a.loadModule(t,function(t){t&&(r.files[e]=t,!t.snippets&&t.snippetText&&(t.snippets=r.parseSnippetFile(t.snippetText)),r.register(t.snippets||[],t.scope),t.includeScopes&&(r.snippetMap[t.scope].includeScopes=t.includeScopes,t.includeScopes.forEach(function(e){g(`ace/mode/`+e)})))}))},v=function(e){var t=e.editor,n=t.completer&&t.completer.activated;if(e.command.name===`backspace`)n&&!s.getCompletionPrefix(t)&&t.completer.detach();else if(e.command.name===`insertstring`&&!n){y=e;var r=e.editor.$liveAutocompletionDelay;r?b.delay(r):x(e)}},y,b=o.delayedCall(function(){x(y)},0),x=function(e){var t=e.editor,n=s.getCompletionPrefix(t),r=e.args,a=s.triggerAutocomplete(t,r);if(n&&n.length>=t.$liveAutocompletionThreshold||a){var o=i.for(t);o.autoShown=!0,o.showPopup(t)}},S=e(\"../editor\").Editor;e(\"../config\").defineOptions(S.prototype,`editor`,{enableBasicAutocompletion:{set:function(e){e?(i.for(this),this.completers||=Array.isArray(e)?e:p,this.commands.addCommand(i.startCommand)):this.commands.removeCommand(i.startCommand)},value:!1},enableLiveAutocompletion:{set:function(e){e?(this.completers||=Array.isArray(e)?e:p,this.commands.on(`afterExec`,v)):this.commands.off(`afterExec`,v)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(e){e?(this.commands.addCommand(m),this.on(`changeMode`,h),h(null,this)):(this.commands.removeCommand(m),this.off(`changeMode`,h))},value:!1}}),t.MarkerGroup=c}),(function(){ace.require([`ace/ext/language_tools`],function(n){typeof t==`object`&&typeof e==`object`&&t&&(t.exports=n)})})()})),en=o(((e,t)=>{ace.define(`ace/mode/jsdoc_comment_highlight_rules`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/mode/text_highlight_rules`],function(e,t,n){var r=e(\"../lib/oop\"),i=e(\"./text_highlight_rules\").TextHighlightRules,a=function(){this.$rules={start:[{token:[`comment.doc.tag`,`comment.doc.text`,`lparen.doc`],regex:`(@(?:param|member|typedef|property|namespace|var|const|callback))(\\\\s*)({)`,push:[{token:`lparen.doc`,regex:`{`,push:[{include:`doc-syntax`},{token:`rparen.doc`,regex:`}|(?=$)`,next:`pop`}]},{token:[`rparen.doc`,`text.doc`,`variable.parameter.doc`,`lparen.doc`,`variable.parameter.doc`,`rparen.doc`],regex:/(})(\\s*)(?:([\\w=:\\/\\.]+)|(?:(\\[)([\\w=:\\/\\.\\-\\'\\\" ]+)(\\])))/,next:`pop`},{token:`rparen.doc`,regex:`}|(?=$)`,next:`pop`},{include:`doc-syntax`},{defaultToken:`text.doc`}]},{token:[`comment.doc.tag`,`text.doc`,`lparen.doc`],regex:`(@(?:returns?|yields|type|this|suppress|public|protected|private|package|modifies|implements|external|exception|throws|enum|define|extends))(\\\\s*)({)`,push:[{token:`lparen.doc`,regex:`{`,push:[{include:`doc-syntax`},{token:`rparen.doc`,regex:`}|(?=$)`,next:`pop`}]},{token:`rparen.doc`,regex:`}|(?=$)`,next:`pop`},{include:`doc-syntax`},{defaultToken:`text.doc`}]},{token:[`comment.doc.tag`,`text.doc`,`variable.parameter.doc`],regex:`(@(?:alias|memberof|instance|module|name|lends|namespace|external|this|template|requires|param|implements|function|extends|typedef|mixes|constructor|var|memberof\\\\!|event|listens|exports|class|constructs|interface|emits|fires|throws|const|callback|borrows|augments))(\\\\s+)(\\\\w[\\\\w#.:/~\"\\\\-]*)?`},{token:[`comment.doc.tag`,`text.doc`,`variable.parameter.doc`],regex:`(@method)(\\\\s+)(\\\\w[\\\\w.\\\\(\\\\)]*)`},{token:`comment.doc.tag`,regex:`@access\\\\s+(?:private|public|protected)`},{token:`comment.doc.tag`,regex:`@kind\\\\s+(?:class|constant|event|external|file|function|member|mixin|module|namespace|typedef)`},{token:`comment.doc.tag`,regex:`@\\\\w+(?=\\\\s|$)`},a.getTagRule(),{defaultToken:`comment.doc.body`,caseInsensitive:!0}],\"doc-syntax\":[{token:`operator.doc`,regex:/[|:]/},{token:`paren.doc`,regex:/[\\[\\]]/}]},this.normalizeRules()};r.inherits(a,i),a.getTagRule=function(e){return{token:`comment.doc.tag.storage.type`,regex:`\\\\b(?:TODO|FIXME|XXX|HACK)\\\\b`}},a.getStartRule=function(e){return{token:`comment.doc`,regex:/\\/\\*\\*(?!\\/)/,next:e}},a.getEndRule=function(e){return{token:`comment.doc`,regex:`\\\\*\\\\/`,next:e}},t.JsDocCommentHighlightRules=a}),ace.define(`ace/mode/javascript_highlight_rules`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/mode/jsdoc_comment_highlight_rules`,`ace/mode/text_highlight_rules`],function(e,t,n){var r=e(\"../lib/oop\"),i=e(\"./jsdoc_comment_highlight_rules\").JsDocCommentHighlightRules,a=e(\"./text_highlight_rules\").TextHighlightRules,o=`[a-zA-Z\\\\$_\u00A1-\uFFFF][a-zA-Z\\\\d\\\\$_\u00A1-\uFFFF]*`,s=function(e){var t={\"variable.language\":`Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document`,keyword:`const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor`,\"storage.type\":`const|let|var|function`,\"constant.language\":`null|Infinity|NaN|undefined`,\"support.function\":`alert`,\"constant.language.boolean\":`true|false`},n=this.createKeywordMapper(t,`identifier`),r=`case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void`,a=`\\\\\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)`,s=`(function)(\\\\s*)(\\\\*?)`,u={token:[`identifier`,`text`,`paren.lparen`],regex:`(\\\\b(?!`+Object.values(t).join(`|`)+`\\\\b)`+o+`)(\\\\s*)(\\\\()`};this.$rules={no_regex:[i.getStartRule(`doc-start`),l(`no_regex`),u,{token:`string`,regex:`'(?=.)`,next:`qstring`},{token:`string`,regex:`\"(?=.)`,next:`qqstring`},{include:`numeric_constants`},{token:[`entity.name.function`,`text`,`keyword.operator`,`text`,`storage.type`,`text`,`storage.type`,`text`,`paren.lparen`],regex:`(`+o+`)(\\\\s*)(=)(\\\\s*)`+s+`(\\\\s*)(\\\\()`,next:`function_arguments`},{token:[`storage.type`,`text`,`storage.type`,`text`,`text`,`entity.name.function`,`text`,`paren.lparen`],regex:`(function)(?:(?:(\\\\s*)(\\\\*)(\\\\s*))|(\\\\s+))(`+o+`)(\\\\s*)(\\\\()`,next:`function_arguments`},{token:[`entity.name.function`,`text`,`punctuation.operator`,`text`,`storage.type`,`text`,`storage.type`,`text`,`paren.lparen`],regex:`(`+o+`)(\\\\s*)(:)(\\\\s*)`+s+`(\\\\s*)(\\\\()`,next:`function_arguments`},{token:[`text`,`text`,`storage.type`,`text`,`storage.type`,`text`,`paren.lparen`],regex:`(:)(\\\\s*)`+s+`(\\\\s*)(\\\\()`,next:`function_arguments`},{token:`keyword`,regex:`from(?=\\\\s*('|\"))`},{token:`keyword`,regex:`(?:`+r+`)\\\\b`,next:`start`},{token:`support.constant`,regex:/that\\b/},{token:[`storage.type`,`punctuation.operator`,`support.function.firebug`],regex:/(console)(\\.)(warn|info|log|error|debug|time|trace|timeEnd|assert)\\b/},{token:n,regex:o},{token:`punctuation.operator`,regex:/[.](?![.])/,next:`property`},{token:`storage.type`,regex:/=>/,next:`start`},{token:`keyword.operator`,regex:/--|\\+\\+|\\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\\|\\||\\?:|[!$%&*+\\-~\\/^]=?/,next:`start`},{token:`punctuation.operator`,regex:/[?:,;.]/,next:`start`},{token:`paren.lparen`,regex:/[\\[({]/,next:`start`},{token:`paren.rparen`,regex:/[\\])}]/},{token:`comment`,regex:/^#!.*$/}],property:[{token:`text`,regex:`\\\\s+`},{token:`keyword.operator`,regex:/=/},{token:[`storage.type`,`text`,`storage.type`,`text`,`paren.lparen`],regex:s+`(\\\\s*)(\\\\()`,next:`function_arguments`},{token:[`storage.type`,`text`,`storage.type`,`text`,`text`,`entity.name.function`,`text`,`paren.lparen`],regex:`(function)(?:(?:(\\\\s*)(\\\\*)(\\\\s*))|(\\\\s+))(\\\\w+)(\\\\s*)(\\\\()`,next:`function_arguments`},{token:`punctuation.operator`,regex:/[.](?![.])/},{token:`support.function`,regex:`prototype`},{token:`support.function`,regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\\b(?=\\()/},{token:`support.function.dom`,regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\\b(?=\\()/},{token:`support.constant`,regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\\b/},{token:`identifier`,regex:o},{regex:``,token:`empty`,next:`no_regex`}],start:[i.getStartRule(`doc-start`),l(`start`),{token:`string.regexp`,regex:`\\\\/`,next:`regex`},{token:`text`,regex:`\\\\s+|^$`,next:`start`},{token:`empty`,regex:``,next:`no_regex`}],regex:[{token:`regexp.keyword.operator`,regex:`\\\\\\\\(?:u[\\\\da-fA-F]{4}|x[\\\\da-fA-F]{2}|.)`},{token:`string.regexp`,regex:`/[sxngimy]*`,next:`no_regex`},{token:`invalid`,regex:/\\{\\d+\\b,?\\d*\\}[+*]|[+*$^?][+*]|[$^][?]|\\?{3,}/},{token:`constant.language.escape`,regex:/\\(\\?[:=!]|\\)|\\{\\d+\\b,?\\d*\\}|[+*]\\?|[()$^+*?.]/},{token:`constant.language.delimiter`,regex:/\\|/},{token:`constant.language.escape`,regex:/\\[\\^?/,next:`regex_character_class`},{token:`empty`,regex:`$`,next:`no_regex`},{defaultToken:`string.regexp`}],regex_character_class:[{token:`regexp.charclass.keyword.operator`,regex:`\\\\\\\\(?:u[\\\\da-fA-F]{4}|x[\\\\da-fA-F]{2}|.)`},{token:`constant.language.escape`,regex:`]`,next:`regex`},{token:`constant.language.escape`,regex:`-`},{token:`empty`,regex:`$`,next:`no_regex`},{defaultToken:`string.regexp.charachterclass`}],default_parameter:[{token:`string`,regex:`'(?=.)`,push:[{token:`string`,regex:`'|$`,next:`pop`},{include:`qstring`}]},{token:`string`,regex:`\"(?=.)`,push:[{token:`string`,regex:`\"|$`,next:`pop`},{include:`qqstring`}]},{token:`constant.language`,regex:`null|Infinity|NaN|undefined`},{include:`numeric_constants`},{token:`punctuation.operator`,regex:`,`,next:`function_arguments`},{token:`text`,regex:`\\\\s+`},{token:`punctuation.operator`,regex:`$`},{token:`empty`,regex:``,next:`no_regex`}],function_arguments:[l(`function_arguments`),{token:`variable.parameter`,regex:o},{token:`punctuation.operator`,regex:`,`},{token:`text`,regex:`\\\\s+`},{token:`punctuation.operator`,regex:`$`},{token:`empty`,regex:``,next:`no_regex`}],qqstring:[{token:`constant.language.escape`,regex:a},{token:`string`,regex:`\\\\\\\\$`,consumeLineEnd:!0},{token:`string`,regex:`\"|$`,next:`no_regex`},{defaultToken:`string`}],qstring:[{token:`constant.language.escape`,regex:a},{token:`string`,regex:`\\\\\\\\$`,consumeLineEnd:!0},{token:`string`,regex:`'|$`,next:`no_regex`},{defaultToken:`string`}],numeric_constants:[{token:`constant.numeric`,regex:/0(?:[xX][0-9a-fA-F_]+|[oO][0-7_]+|[bB][01_]+)\\b/},{token:`constant.numeric`,regex:/(?:\\d[\\d_]*(?:\\.[\\d_]*)?|\\.\\d[\\d_]*)(?:[eE][+-]?\\d+\\b)?/}]},(!e||!e.noES6)&&(this.$rules.no_regex.unshift({regex:`[{}]`,onMatch:function(e,t,n){if(this.next=e==`{`?this.nextState:``,e==`{`&&n.length)n.unshift(`start`,t);else if(e==`}`&&n.length&&(n.shift(),this.next=n.shift(),this.next.indexOf(`string`)!=-1||this.next.indexOf(`jsx`)!=-1))return`paren.quasi.end`;return e==`{`?`paren.lparen`:`paren.rparen`},nextState:`start`},{token:`string.quasi.start`,regex:/`/,push:[{token:`constant.language.escape`,regex:a},{token:`paren.quasi.start`,regex:/\\${/,push:`start`},{token:`string.quasi.end`,regex:/`/,next:`pop`},{defaultToken:`string.quasi`}]},{token:[`variable.parameter`,`text`],regex:`(`+o+`)(\\\\s*)(?=\\\\=>)`},{token:`paren.lparen`,regex:`(\\\\()(?=[^\\\\(]+\\\\s*=>)`,next:`function_arguments`},{token:`variable.language`,regex:`(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\\\b`}),this.$rules.function_arguments.unshift({token:`keyword.operator`,regex:`=`,next:`default_parameter`},{token:`keyword.operator`,regex:`\\\\.{3}`}),this.$rules.property.unshift({token:`support.function`,regex:`(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\\\b(?=\\\\()`},{token:`constant.language`,regex:`(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\\\b`}),(!e||e.jsx!=0)&&c.call(this)),this.embedRules(i,`doc-`,[i.getEndRule(`no_regex`)]),this.normalizeRules()};r.inherits(s,a);function c(){var e=o.replace(`\\\\d`,`\\\\d\\\\-`),t={onMatch:function(e,t,n){var r=e.charAt(1)==`/`?2:1;return r==1?(t==this.nextState?n.unshift(this.next):n.unshift(this.next,this.nextState,0),n[2]++):r==2&&t==this.nextState&&(n[1]--,(!n[1]||n[1]<0)&&(n.shift(),n.shift())),[{type:`meta.tag.punctuation.`+(r==1?``:`end-`)+`tag-open.xml`,value:e.slice(0,r)},{type:`meta.tag.tag-name.xml`,value:e.substr(r)}]},regex:`</?(?:`+e+`|(?=>))`,next:`jsxAttributes`,nextState:`jsx`};this.$rules.start.unshift(t);var n={regex:`{`,token:`paren.quasi.start`,push:`start`};this.$rules.jsx=[n,t,{include:`reference`},{defaultToken:`string.xml`}],this.$rules.jsxAttributes=[{token:`meta.tag.punctuation.tag-close.xml`,regex:`/?>`,onMatch:function(e,t,n){return t==n[0]&&n.shift(),e.length==2&&(n[0]==this.nextState&&n[1]--,(!n[1]||n[1]<0)&&n.splice(0,2)),this.next=n[0]||`start`,[{type:this.token,value:e}]},nextState:`jsx`},n,l(`jsxAttributes`),{token:`entity.other.attribute-name.xml`,regex:e},{token:`keyword.operator.attribute-equals.xml`,regex:`=`},{token:`text.tag-whitespace.xml`,regex:`\\\\s+`},{token:`string.attribute-value.xml`,regex:`'`,stateName:`jsx_attr_q`,push:[{token:`string.attribute-value.xml`,regex:`'`,next:`pop`},{include:`reference`},{defaultToken:`string.attribute-value.xml`}]},{token:`string.attribute-value.xml`,regex:`\"`,stateName:`jsx_attr_qq`,push:[{token:`string.attribute-value.xml`,regex:`\"`,next:`pop`},{include:`reference`},{defaultToken:`string.attribute-value.xml`}]},t],this.$rules.reference=[{token:`constant.language.escape.reference.xml`,regex:`(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\\\.-]+;)`}]}function l(e){return[{token:`comment`,regex:/\\/\\*/,next:[i.getTagRule(),{token:`comment`,regex:`\\\\*\\\\/`,next:e||`pop`},{defaultToken:`comment`,caseInsensitive:!0}]},{token:`comment`,regex:`\\\\/\\\\/`,next:[i.getTagRule(),{token:`comment`,regex:`$|^`,next:e||`pop`},{defaultToken:`comment`,caseInsensitive:!0}]}]}t.JavaScriptHighlightRules=s}),ace.define(`ace/mode/matching_brace_outdent`,[`require`,`exports`,`module`,`ace/range`],function(e,t,n){var r=e(\"../range\").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\\s+$/.test(e)?/^\\s*\\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\\s*\\})/);if(!n)return 0;var i=n[1].length,a=e.findMatchingBracket({row:t,column:i});if(!a||a.row==t)return 0;var o=this.$getIndent(e.getLine(a.row));e.replace(new r(t,0,t,i-1),o)},this.$getIndent=function(e){return e.match(/^\\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define(`ace/mode/behaviour/xml`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/mode/behaviour`,`ace/token_iterator`],function(e,t,n){var r=e(\"../../lib/oop\"),i=e(\"../behaviour\").Behaviour,a=e(\"../../token_iterator\").TokenIterator;function o(e,t){return e&&e.type.lastIndexOf(t+`.xml`)>-1}var s=function(){this.add(`string_dquotes`,`insertion`,function(e,t,n,r,i){if(i==`\"`||i==`'`){var s=i,c=r.doc.getTextRange(n.getSelectionRange());if(c!==``&&c!==`'`&&c!=`\"`&&n.getWrapBehavioursEnabled())return{text:s+c+s,selection:!1};var l=n.getCursorPosition(),u=r.doc.getLine(l.row).substring(l.column,l.column+1),d=new a(r,l.row,l.column),f=d.getCurrentToken();if(u==s&&(o(f,`attribute-value`)||o(f,`string`)))return{text:``,selection:[1,1]};if(f||=d.stepBackward(),!f)return;for(;o(f,`tag-whitespace`)||o(f,`whitespace`);)f=d.stepBackward();var p=!u||u.match(/\\s/);if(o(f,`attribute-equals`)&&(p||u==`>`)||o(f,`decl-attribute-equals`)&&(p||u==`?`))return{text:s+s,selection:[1,1]}}}),this.add(`string_dquotes`,`deletion`,function(e,t,n,r,i){var a=r.doc.getTextRange(i);if(!i.isMultiLine()&&(a==`\"`||a==`'`)&&r.doc.getLine(i.start.row).substring(i.start.column+1,i.start.column+2)==a)return i.end.column++,i}),this.add(`autoclosing`,`insertion`,function(e,t,n,r,i){if(i==`>`){var s=n.getSelectionRange().start,c=new a(r,s.row,s.column),l=c.getCurrentToken()||c.stepBackward();if(!l||!(o(l,`tag-name`)||o(l,`tag-whitespace`)||o(l,`attribute-name`)||o(l,`attribute-equals`)||o(l,`attribute-value`))||o(l,`reference.attribute-value`))return;if(o(l,`attribute-value`)){var u=c.getCurrentTokenColumn()+l.value.length;if(s.column<u)return;if(s.column==u){var d=c.stepForward();if(d&&o(d,`attribute-value`))return;c.stepBackward()}}if(/^\\s*>/.test(r.getLine(s.row).slice(s.column)))return;for(;!o(l,`tag-name`);)if(l=c.stepBackward(),l.value==`<`){l=c.stepForward();break}var f=c.getCurrentTokenRow(),p=c.getCurrentTokenColumn();if(o(c.stepBackward(),`end-tag-open`))return;var m=l.value;return f==s.row&&(m=m.substring(0,s.column-p)),this.voidElements&&this.voidElements.hasOwnProperty(m.toLowerCase())?void 0:{text:`></`+m+`>`,selection:[1,1]}}}),this.add(`autoindent`,`insertion`,function(e,t,n,r,i){if(i==`\n`){var s=n.getCursorPosition(),c=r.getLine(s.row),l=new a(r,s.row,s.column),u=l.getCurrentToken();if(o(u,``)&&u.type.indexOf(`tag-close`)!==-1){if(u.value==`/>`)return;for(;u&&u.type.indexOf(`tag-name`)===-1;)u=l.stepBackward();if(!u)return;var d=u.value,f=l.getCurrentTokenRow();if(u=l.stepBackward(),!u||u.type.indexOf(`end-tag`)!==-1)return;if(this.voidElements&&!this.voidElements[d]||!this.voidElements){var p=r.getTokenAt(s.row,s.column+1),c=r.getLine(f),m=this.$getIndent(c),h=m+r.getTabString();return p&&p.value===`</`?{text:`\n`+h+`\n`+m,selection:[1,h.length,1,h.length]}:{text:`\n`+h}}}}})};r.inherits(s,i),t.XmlBehaviour=s}),ace.define(`ace/mode/behaviour/javascript`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/token_iterator`,`ace/mode/behaviour/cstyle`,`ace/mode/behaviour/xml`],function(e,t,n){var r=e(\"../../lib/oop\"),i=e(\"../../token_iterator\").TokenIterator,a=e(\"../behaviour/cstyle\").CstyleBehaviour,o=e(\"../behaviour/xml\").XmlBehaviour,s=function(){var e=new o({closeCurlyBraces:!0}).getBehaviours();this.addBehaviours(e),this.inherit(a),this.add(`autoclosing-fragment`,`insertion`,function(e,t,n,r,a){if(a==`>`){var o=n.getSelectionRange().start,s=new i(r,o.row,o.column),c=s.getCurrentToken()||s.stepBackward();if(!c)return;if(c.value==`<`)return{text:`></>`,selection:[1,1]}}})};r.inherits(s,a),t.JavaScriptBehaviour=s}),ace.define(`ace/mode/folding/xml`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/range`,`ace/mode/folding/fold_mode`],function(e,t,n){var r=e(\"../../lib/oop\"),i=e(\"../../range\").Range,a=e(\"./fold_mode\").FoldMode,o=t.FoldMode=function(e,t){a.call(this),this.voidElements=e||{},this.optionalEndTags=r.mixin({},this.voidElements),t&&r.mixin(this.optionalEndTags,t)};r.inherits(o,a);var s=function(){this.tagName=``,this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};function c(e,t){return e&&e.type&&e.type.lastIndexOf(t+`.xml`)>-1}(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?t===`markbeginend`?`end`:``:!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())||this._findEndTagInLine(e,n,r.tagName,r.end.column)?``:`start`:this.getCommentFoldWidget(e,n)},this.getCommentFoldWidget=function(e,t){return/comment/.test(e.getState(t))&&/<!-/.test(e.getLine(t))?`start`:``},this._getFirstTagInLine=function(e,t){for(var n=e.getTokens(t),r=new s,i=0;i<n.length;i++){var a=n[i];if(c(a,`tag-open`)){if(r.end.column=r.start.column+a.value.length,r.closing=c(a,`end-tag-open`),a=n[++i],!a)return null;if(r.tagName=a.value,a.value===``){if(a=n[++i],!a)return null;r.tagName=a.value}for(r.end.column+=a.value.length,i++;i<n.length;i++)if(a=n[i],r.end.column+=a.value.length,c(a,`tag-close`)){r.selfClosing=a.value==`/>`;break}return r}else if(c(a,`tag-close`))return r.selfClosing=a.value==`/>`,r;r.start.column+=a.value.length}return null},this._findEndTagInLine=function(e,t,n,r){for(var i=e.getTokens(t),a=0,o=0;o<i.length;o++){var s=i[o];if(a+=s.value.length,!(a<r-1)&&c(s,`end-tag-open`)&&(s=i[o+1],c(s,`tag-name`)&&s.value===``&&(s=i[o+2]),s&&s.value==n))return!0}return!1},this.getFoldWidgetRange=function(e,t,n){if(!this._getFirstTagInLine(e,n))return this.getCommentFoldWidget(e,n)&&e.getCommentFoldRange(n,e.getLine(n).length);var r=e.getMatchingTags({row:n,column:0});if(r)return new i(r.openTag.end.row,r.openTag.end.column,r.closeTag.start.row,r.closeTag.start.column)}}).call(o.prototype)}),ace.define(`ace/mode/folding/cstyle`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/range`,`ace/mode/folding/fold_mode`],function(e,t,n){var r=e(\"../../lib/oop\"),i=e(\"../../range\").Range,a=e(\"./fold_mode\").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\\|[^|]*?$/,`|`+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\\|[^|]*?$/,`|`+e.end)))};r.inherits(o,a),(function(){this.foldingStartMarker=/([\\{\\[\\(])[^\\}\\]\\)]*$|^\\s*(\\/\\*)/,this.foldingStopMarker=/^[^\\[\\{\\(]*([\\}\\]\\)])|^[\\s\\*]*(\\*\\/)/,this.singleLineBlockCommentRe=/^\\s*(\\/\\*).*\\*\\/\\s*$/,this.tripleStarBlockCommentRe=/^\\s*(\\/\\*\\*\\*).*\\*\\/\\s*$/,this.startRegionRe=/^\\s*(\\/\\*|\\/\\/)#?region\\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return``;var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?`start`:i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var a=i.match(this.foldingStartMarker);if(a){var o=a.index;if(a[1])return this.openingBracketBlock(e,a[1],n,o);var s=e.getCommentFoldRange(n,o+a[0].length,1);return s&&!s.isMultiLine()&&(r?s=this.getSectionRange(e,n):t!=`all`&&(s=null)),s}if(t!==`markbegin`){var a=i.match(this.foldingStopMarker);if(a){var o=a.index+a[0].length;return a[1]?this.closingBracketBlock(e,a[1],n,o):e.getCommentFoldRange(n,o,-1)}}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\\S/),a=t,o=n.length;t+=1;for(var s=t,c=e.getLength();++t<c;){n=e.getLine(t);var l=n.search(/\\S/);if(l!==-1){if(r>l)break;var u=this.getFoldWidgetRange(e,`all`,t);if(u){if(u.start.row<=a)break;if(u.isMultiLine())t=u.end.row;else if(r==l)break}s=t}}return new i(a,o,s,e.getLine(s).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\\s*$/),a=e.getLength(),o=n,s=/^\\s*(?:\\/\\*|\\/\\/|--)#?(end)?region\\b/,c=1;++n<a;){t=e.getLine(n);var l=s.exec(t);if(l&&(l[1]?c--:c++,!c))break}var u=n;if(u>o)return new i(o,r,u,t.length)}}).call(o.prototype)}),ace.define(`ace/mode/folding/javascript`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/mode/folding/xml`,`ace/mode/folding/cstyle`],function(e,t,n){var r=e(\"../../lib/oop\"),i=e(\"./xml\").FoldMode,a=e(\"./cstyle\").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\\|[^|]*?$/,`|`+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\\|[^|]*?$/,`|`+e.end))),this.xmlFoldMode=new i};r.inherits(o,a),(function(){this.getFoldWidgetRangeBase=this.getFoldWidgetRange,this.getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){return this.getFoldWidgetBase(e,t,n)||this.xmlFoldMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n,r){return this.getFoldWidgetRangeBase(e,t,n,r)||this.xmlFoldMode.getFoldWidgetRange(e,t,n)}}).call(o.prototype)}),ace.define(`ace/mode/javascript`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/mode/text`,`ace/mode/javascript_highlight_rules`,`ace/mode/matching_brace_outdent`,`ace/worker/worker_client`,`ace/mode/behaviour/javascript`,`ace/mode/folding/javascript`],function(e,t,n){var r=e(\"../lib/oop\"),i=e(\"./text\").Mode,a=e(\"./javascript_highlight_rules\").JavaScriptHighlightRules,o=e(\"./matching_brace_outdent\").MatchingBraceOutdent,s=e(\"../worker/worker_client\").WorkerClient,c=e(\"./behaviour/javascript\").JavaScriptBehaviour,l=e(\"./folding/javascript\").FoldMode,u=function(){this.HighlightRules=a,this.$outdent=new o,this.$behaviour=new c,this.foldingRules=new l};r.inherits(u,i),(function(){this.lineCommentStart=`//`,this.blockComment={start:`/*`,end:`*/`},this.$quotes={'\"':`\"`,\"'\":`'`,\"`\":\"`\"},this.$pairQuotesAfter={\"`\":/\\w/},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),a=i.tokens,o=i.state;if(a.length&&a[a.length-1].type==`comment`)return r;if(e==`start`||e==`no_regex`)t.match(/^.*(?:\\bcase\\b.*:|[\\{\\(\\[])\\s*$/)&&(r+=n);else if(e==`doc-start`&&(o==`start`||o==`no_regex`))return``;return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new s([`ace`],`ace/mode/javascript_worker`,`JavaScriptWorker`);return t.attachToDocument(e.getDocument()),t.on(`annotate`,function(t){e.setAnnotations(t.data)}),t.on(`terminate`,function(){e.clearAnnotations()}),t},this.$id=`ace/mode/javascript`,this.snippetFileId=`ace/snippets/javascript`}).call(u.prototype),t.Mode=u}),(function(){ace.require([`ace/mode/javascript`],function(n){typeof t==`object`&&typeof e==`object`&&t&&(t.exports=n)})})()})),tn=o(((e,t)=>{ace.define(`ace/mode/sql_highlight_rules`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/mode/text_highlight_rules`],function(e,t,n){var r=e(\"../lib/oop\"),i=e(\"./text_highlight_rules\").TextHighlightRules,a=function(){var e=this.createKeywordMapper({\"support.function\":`avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|coalesce|ifnull|isnull|nvl`,keyword:`select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|when|then|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|foreign|not|references|default|null|inner|cross|natural|database|drop|grant|distinct|is|in|all|alter|any|array|at|authorization|between|both|cast|check|collate|column|commit|constraint|cube|current|current_date|current_time|current_timestamp|current_user|describe|escape|except|exists|external|extract|fetch|filter|for|full|function|global|grouping|intersect|interval|into|leading|like|local|no|of|only|out|overlaps|partition|position|range|revoke|rollback|rollup|row|rows|session_user|set|some|start|tablesample|time|to|trailing|truncate|unique|unknown|user|using|values|window|with`,\"constant.language\":`true|false`,\"storage.type\":`int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|money|real|number|integer|string`},`identifier`,!0);this.$rules={start:[{token:`comment`,regex:`--.*$`},{token:`comment`,start:`/\\\\*`,end:`\\\\*/`},{token:`string`,regex:`\".*?\"`},{token:`string`,regex:`'.*?'`},{token:`string`,regex:\"`.*?`\"},{token:`constant.numeric`,regex:`[+-]?\\\\d+(?:(?:\\\\.\\\\d*)?(?:[eE][+-]?\\\\d+)?)?\\\\b`},{token:e,regex:`[a-zA-Z_$][a-zA-Z0-9_$]*\\\\b`},{token:`keyword.operator`,regex:`\\\\+|\\\\-|\\\\/|\\\\/\\\\/|%|<@>|@>|<@|&|\\\\^|~|<|>|<=|=>|==|!=|<>|=`},{token:`paren.lparen`,regex:`[\\\\(]`},{token:`paren.rparen`,regex:`[\\\\)]`},{token:`text`,regex:`\\\\s+`}]},this.normalizeRules()};r.inherits(a,i),t.SqlHighlightRules=a}),ace.define(`ace/mode/folding/cstyle`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/range`,`ace/mode/folding/fold_mode`],function(e,t,n){var r=e(\"../../lib/oop\"),i=e(\"../../range\").Range,a=e(\"./fold_mode\").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\\|[^|]*?$/,`|`+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\\|[^|]*?$/,`|`+e.end)))};r.inherits(o,a),(function(){this.foldingStartMarker=/([\\{\\[\\(])[^\\}\\]\\)]*$|^\\s*(\\/\\*)/,this.foldingStopMarker=/^[^\\[\\{\\(]*([\\}\\]\\)])|^[\\s\\*]*(\\*\\/)/,this.singleLineBlockCommentRe=/^\\s*(\\/\\*).*\\*\\/\\s*$/,this.tripleStarBlockCommentRe=/^\\s*(\\/\\*\\*\\*).*\\*\\/\\s*$/,this.startRegionRe=/^\\s*(\\/\\*|\\/\\/)#?region\\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return``;var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?`start`:i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var a=i.match(this.foldingStartMarker);if(a){var o=a.index;if(a[1])return this.openingBracketBlock(e,a[1],n,o);var s=e.getCommentFoldRange(n,o+a[0].length,1);return s&&!s.isMultiLine()&&(r?s=this.getSectionRange(e,n):t!=`all`&&(s=null)),s}if(t!==`markbegin`){var a=i.match(this.foldingStopMarker);if(a){var o=a.index+a[0].length;return a[1]?this.closingBracketBlock(e,a[1],n,o):e.getCommentFoldRange(n,o,-1)}}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\\S/),a=t,o=n.length;t+=1;for(var s=t,c=e.getLength();++t<c;){n=e.getLine(t);var l=n.search(/\\S/);if(l!==-1){if(r>l)break;var u=this.getFoldWidgetRange(e,`all`,t);if(u){if(u.start.row<=a)break;if(u.isMultiLine())t=u.end.row;else if(r==l)break}s=t}}return new i(a,o,s,e.getLine(s).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\\s*$/),a=e.getLength(),o=n,s=/^\\s*(?:\\/\\*|\\/\\/|--)#?(end)?region\\b/,c=1;++n<a;){t=e.getLine(n);var l=s.exec(t);if(l&&(l[1]?c--:c++,!c))break}var u=n;if(u>o)return new i(o,r,u,t.length)}}).call(o.prototype)}),ace.define(`ace/mode/folding/sql`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/mode/folding/cstyle`],function(e,t,n){var r=e(\"../../lib/oop\"),i=e(\"./cstyle\").FoldMode,a=t.FoldMode=function(){};r.inherits(a,i),(function(){}).call(a.prototype)}),ace.define(`ace/mode/sql`,[`require`,`exports`,`module`,`ace/lib/oop`,`ace/mode/text`,`ace/mode/sql_highlight_rules`,`ace/mode/folding/sql`],function(e,t,n){var r=e(\"../lib/oop\"),i=e(\"./text\").Mode,a=e(\"./sql_highlight_rules\").SqlHighlightRules,o=e(\"./folding/sql\").FoldMode,s=function(){this.HighlightRules=a,this.foldingRules=new o,this.$behaviour=this.$defaultBehaviour};r.inherits(s,i),(function(){this.lineCommentStart=`--`,this.blockComment={start:`/*`,end:`*/`},this.$id=`ace/mode/sql`,this.snippetFileId=`ace/snippets/sql`}).call(s.prototype),t.Mode=s}),(function(){ace.require([`ace/mode/sql`],function(n){typeof t==`object`&&typeof e==`object`&&t&&(t.exports=n)})})()})),nn=o(((e,t)=>{ace.define(`ace/theme/github-css`,[`require`,`exports`,`module`],function(e,t,n){n.exports=`/* CSS style content from github's default pygments highlighter template.\n Cursor and selection styles from textmate.css. */\n.ace-github .ace_gutter {\n background: #e8e8e8;\n color: #AAA;\n}\n\n.ace-github {\n background: #fff;\n color: #000;\n}\n\n.ace-github .ace_keyword {\n font-weight: bold;\n}\n\n.ace-github .ace_string {\n color: #D14;\n}\n\n.ace-github .ace_variable.ace_class {\n color: teal;\n}\n\n.ace-github .ace_constant.ace_numeric {\n color: #099;\n}\n\n.ace-github .ace_constant.ace_buildin {\n color: #0086B3;\n}\n\n.ace-github .ace_support.ace_function {\n color: #0086B3;\n}\n\n.ace-github .ace_comment {\n color: #998;\n font-style: italic;\n}\n\n.ace-github .ace_variable.ace_language {\n color: #0086B3;\n}\n\n.ace-github .ace_paren {\n font-weight: bold;\n}\n\n.ace-github .ace_boolean {\n font-weight: bold;\n}\n\n.ace-github .ace_string.ace_regexp {\n color: #009926;\n font-weight: normal;\n}\n\n.ace-github .ace_variable.ace_instance {\n color: teal;\n}\n\n.ace-github .ace_constant.ace_language {\n font-weight: bold;\n}\n\n.ace-github .ace_cursor {\n color: black;\n}\n\n.ace-github.ace_focus .ace_marker-layer .ace_active-line {\n background: rgb(255, 255, 204);\n}\n.ace-github .ace_marker-layer .ace_active-line {\n background: rgb(245, 245, 245);\n}\n\n.ace-github .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n\n.ace-github.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px white;\n}\n/* bold keywords cause cursor issues for some fonts */\n/* this disables bold style for editor and keeps for static highlighter */\n.ace-github.ace_nobold .ace_line > span {\n font-weight: normal !important;\n}\n\n.ace-github .ace_marker-layer .ace_step {\n background: rgb(252, 255, 0);\n}\n\n.ace-github .ace_marker-layer .ace_stack {\n background: rgb(164, 229, 101);\n}\n\n.ace-github .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-github .ace_gutter-active-line {\n background-color : rgba(0, 0, 0, 0.07);\n}\n\n.ace-github .ace_marker-layer .ace_selected-word {\n background: rgb(250, 250, 255);\n border: 1px solid rgb(200, 200, 250);\n}\n\n.ace-github .ace_invisible {\n color: #BFBFBF\n}\n\n.ace-github .ace_print-margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-github .ace_indent-guide {\n background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\n}\n\n.ace-github .ace_indent-guide-active {\n background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC\") right repeat-y;\n}\n`}),ace.define(`ace/theme/github`,[`require`,`exports`,`module`,`ace/theme/github-css`,`ace/lib/dom`],function(e,t,n){t.isDark=!1,t.cssClass=`ace-github`,t.cssText=e(\"./github-css\"),e(\"../lib/dom\").importCssString(t.cssText,t.cssClass,!1)}),(function(){ace.require([`ace/theme/github`],function(n){typeof t==`object`&&typeof e==`object`&&t&&(t.exports=n)})})()})),rn=o(((e,t)=>{ace.define(`ace/theme/one_dark-css`,[`require`,`exports`,`module`],function(e,t,n){n.exports=`.ace-one-dark .ace_gutter {\n background: #282c34;\n color: #6a6f7a\n}\n\n.ace-one-dark .ace_print-margin {\n width: 1px;\n background: #e8e8e8\n}\n\n.ace-one-dark {\n background-color: #282c34;\n color: #abb2bf\n}\n\n.ace-one-dark .ace_cursor {\n color: #528bff\n}\n\n.ace-one-dark .ace_marker-layer .ace_selection {\n background: #3d4350\n}\n\n.ace-one-dark.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0 #282c34;\n border-radius: 2px\n}\n\n.ace-one-dark .ace_marker-layer .ace_step {\n background: #c6dbae\n}\n\n.ace-one-dark .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid #747369\n}\n\n.ace-one-dark .ace_marker-layer .ace_active-line {\n background: rgba(76, 87, 103, .19)\n}\n\n.ace-one-dark .ace_gutter-active-line {\n background-color: rgba(76, 87, 103, .19)\n}\n\n.ace-one-dark .ace_marker-layer .ace_selected-word {\n border: 1px solid #3d4350\n}\n\n.ace-one-dark .ace_fold {\n background-color: #61afef;\n border-color: #abb2bf\n}\n\n.ace-one-dark .ace_keyword {\n color: #c678dd\n}\n\n.ace-one-dark .ace_keyword.ace_operator {\n color: #c678dd\n}\n\n.ace-one-dark .ace_keyword.ace_other.ace_unit {\n color: #d19a66\n}\n\n.ace-one-dark .ace_constant.ace_language {\n color: #d19a66\n}\n\n.ace-one-dark .ace_constant.ace_numeric {\n color: #d19a66\n}\n\n.ace-one-dark .ace_constant.ace_character {\n color: #56b6c2\n}\n\n.ace-one-dark .ace_constant.ace_other {\n color: #56b6c2\n}\n\n.ace-one-dark .ace_support.ace_function {\n color: #61afef\n}\n\n.ace-one-dark .ace_support.ace_constant {\n color: #d19a66\n}\n\n.ace-one-dark .ace_support.ace_class {\n color: #e5c07b\n}\n\n.ace-one-dark .ace_support.ace_type {\n color: #e5c07b\n}\n\n.ace-one-dark .ace_storage {\n color: #c678dd\n}\n\n.ace-one-dark .ace_storage.ace_type {\n color: #c678dd\n}\n\n.ace-one-dark .ace_invalid {\n color: #fff;\n background-color: #f2777a\n}\n\n.ace-one-dark .ace_invalid.ace_deprecated {\n color: #272b33;\n background-color: #d27b53\n}\n\n.ace-one-dark .ace_string {\n color: #98c379\n}\n\n.ace-one-dark .ace_string.ace_regexp {\n color: #e06c75\n}\n\n.ace-one-dark .ace_comment {\n font-style: italic;\n color: #5c6370\n}\n\n.ace-one-dark .ace_variable {\n color: #e06c75\n}\n\n.ace-one-dark .ace_variable.ace_parameter {\n color: #d19a66\n}\n\n.ace-one-dark .ace_meta.ace_tag {\n color: #e06c75\n}\n\n.ace-one-dark .ace_entity.ace_other.ace_attribute-name {\n color: #e06c75\n}\n\n.ace-one-dark .ace_entity.ace_name.ace_function {\n color: #61afef\n}\n\n.ace-one-dark .ace_entity.ace_name.ace_tag {\n color: #e06c75\n}\n\n.ace-one-dark .ace_markup.ace_heading {\n color: #98c379\n}\n\n.ace-one-dark .ace_indent-guide {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ09NrYAgMjP4PAAtGAwchHMyAAAAAAElFTkSuQmCC) right repeat-y\n}\n\n.ace-one-dark .ace_indent-guide-active {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) right repeat-y;\n}\n`}),ace.define(`ace/theme/one_dark`,[`require`,`exports`,`module`,`ace/theme/one_dark-css`,`ace/lib/dom`],function(e,t,n){t.isDark=!0,t.cssClass=`ace-one-dark`,t.cssText=e(\"./one_dark-css\"),e(\"../lib/dom\").importCssString(t.cssText,t.cssClass,!1)}),(function(){ace.require([`ace/theme/one_dark`],function(n){typeof t==`object`&&typeof e==`object`&&t&&(t.exports=n)})})()})),an=c(Qt(),1);$t(),en(),tn(),nn(),rn();function on(e,t,n){let r=(()=>{let r=localStorage.getItem(e);return n.includes(r)?r:t})(),i=new Set;return{get:()=>r,set:t=>{r=t,localStorage.setItem(e,t),i.forEach(e=>e())},subscribe:e=>(i.add(e),()=>i.delete(e))}}var sn=on(`tinbase_theme`,`dark`,[`dark`,`light`,`system`]),cn=window.matchMedia(`(prefers-color-scheme: dark)`);function ln(e){return e===`system`?cn.matches?`dark`:`light`:e}function un(){document.documentElement.classList.toggle(`dark`,ln(sn.get())===`dark`)}un(),sn.subscribe(un),cn.addEventListener(`change`,()=>{un(),sn.set(sn.get())});function dn(){return[(0,_.useSyncExternalStore)(sn.subscribe,sn.get),sn.set]}function fn(){return ln((0,_.useSyncExternalStore)(sn.subscribe,sn.get))}var pn=on(`tinbase_sidebar`,`hover`,[`expanded`,`collapsed`,`hover`]);function mn(){return[(0,_.useSyncExternalStore)(pn.subscribe,pn.get),pn.set]}var hn=c(m(),1);function gn(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var _n=e=>{switch(e){case`success`:return bn;case`info`:return Sn;case`warning`:return xn;case`error`:return Cn;default:return null}},vn=Array(12).fill(0),yn=({visible:e,className:t})=>_.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),\"data-visible\":e},_.createElement(`div`,{className:`sonner-spinner`},vn.map((e,t)=>_.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),bn=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),xn=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},_.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Sn=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Cn=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),wn=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},_.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),_.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Tn=()=>{let[e,t]=_.useState(document.hidden);return _.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},En=1,Dn=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:En++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],_.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(kn(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||En++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},On=(e,t)=>{let n=t?.id||En++;return Dn.addToast({title:e,...t,id:n}),n},kn=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,An=Object.assign(On,{success:Dn.success,info:Dn.info,warning:Dn.warning,error:Dn.error,custom:Dn.custom,message:Dn.message,promise:Dn.promise,dismiss:Dn.dismiss,loading:Dn.loading},{getHistory:()=>Dn.toasts,getToasts:()=>Dn.getActiveToasts()});gn(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function jn(e){return e.label!==void 0}var Mn=3,Nn=`24px`,Pn=`16px`,Fn=4e3,In=356,Ln=14,Rn=45,zn=200;function Bn(...e){return e.filter(Boolean).join(` `)}function Vn(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Hn=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:v=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,O]=_.useState(null),[k,A]=_.useState(null),[j,M]=_.useState(!1),[N,P]=_.useState(!1),[ee,F]=_.useState(!1),[I,te]=_.useState(!1),[ne,re]=_.useState(!1),[ie,ae]=_.useState(0),[L,oe]=_.useState(0),se=_.useRef(n.duration||b||Fn),ce=_.useRef(null),le=_.useRef(null),ue=c===0,de=c+1<=o,fe=n.type,pe=n.dismissible!==!1,me=n.className||``,he=n.descriptionClassName||``,ge=_.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),_e=_.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ve=_.useMemo(()=>n.duration||b||Fn,[n.duration,b]),ye=_.useRef(0),be=_.useRef(0),xe=_.useRef(0),Se=_.useRef(null),[Ce,we]=x.split(`-`),Te=_.useMemo(()=>s.reduce((e,t,n)=>n>=ge?e:e+t.height,0),[s,ge]),Ee=Tn(),De=n.invert||t,Oe=fe===`loading`;be.current=_.useMemo(()=>ge*S+Te,[ge,Te]),_.useEffect(()=>{se.current=ve},[ve]),_.useEffect(()=>{M(!0)},[]),_.useEffect(()=>{let e=le.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),_.useLayoutEffect(()=>{if(!j)return;let e=le.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[j,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let ke=_.useCallback(()=>{P(!0),ae(be.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},zn)},[n,d,a,be]);_.useEffect(()=>{if(n.promise&&fe===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Ee?(()=>{if(xe.current<ye.current){let e=new Date().getTime()-ye.current;se.current-=e}xe.current=new Date().getTime()})():se.current!==1/0&&(ye.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),ke()},se.current)),()=>clearTimeout(e)},[u,i,n,fe,Ee,ke]),_.useEffect(()=>{n.delete&&(ke(),n.onDismiss==null||n.onDismiss.call(n,n))},[ke,n.delete]);function Ae(){return T?.loading?_.createElement(`div`,{className:Bn(w?.loader,n?.classNames?.loader,`sonner-loader`),\"data-visible\":fe===`loading`},T.loading):_.createElement(yn,{className:Bn(w?.loader,n?.classNames?.loader),visible:fe===`loading`})}let je=n.icon||T?.[fe]||_n(fe);return _.createElement(`li`,{tabIndex:0,ref:le,className:Bn(v,me,w?.toast,n?.classNames?.toast,w?.default,w?.[fe],n?.classNames?.[fe]),\"data-sonner-toast\":``,\"data-rich-colors\":n.richColors??f,\"data-styled\":!(n.jsx||n.unstyled||r),\"data-mounted\":j,\"data-promise\":!!n.promise,\"data-swiped\":ne,\"data-removed\":N,\"data-visible\":de,\"data-y-position\":Ce,\"data-x-position\":we,\"data-index\":c,\"data-front\":ue,\"data-swiping\":ee,\"data-dismissible\":pe,\"data-type\":fe,\"data-invert\":De,\"data-swipe-out\":I,\"data-swipe-direction\":k,\"data-expanded\":!!(u||C&&j),\"data-testid\":n.testId,style:{\"--index\":c,\"--toasts-before\":c,\"--z-index\":l.length-c,\"--offset\":`${N?ie:be.current}px`,\"--initial-height\":C?`auto`:`${L}px`,...m,...n.style},onDragEnd:()=>{F(!1),O(null),Se.current=null},onPointerDown:e=>{e.button!==2&&(Oe||!pe||(ce.current=new Date,ae(be.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(F(!0),Se.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(I||!pe)return;Se.current=null;let e=Number(le.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(le.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ce.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=Rn||a>.11){ae(be.current),n.onDismiss==null||n.onDismiss.call(n,n),A(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),ke(),te(!0);return}else{var o,s;(o=le.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=le.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}re(!1),F(!1),O(null)},onPointerMove:t=>{var n,r;if(!Se.current||!pe||window.getSelection()?.toString().length>0)return;let i=t.clientY-Se.current.y,a=t.clientX-Se.current.x,o=e.swipeDirections??Vn(x);!D&&(Math.abs(a)>1||Math.abs(i)>1)&&O(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(D===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&re(!0),(n=le.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=le.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},_e&&!n.jsx&&fe!==`loading`?_.createElement(`button`,{\"aria-label\":E,\"data-disabled\":Oe,\"data-close-button\":!0,onClick:Oe||!pe?()=>{}:()=>{ke(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Bn(w?.closeButton,n?.classNames?.closeButton)},T?.close??wn):null,(fe||n.icon||n.promise)&&n.icon!==null&&(T?.[fe]!==null||n.icon)?_.createElement(`div`,{\"data-icon\":``,className:Bn(w?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Ae():null,n.type===`loading`?null:je):null,_.createElement(`div`,{\"data-content\":``,className:Bn(w?.content,n?.classNames?.content)},_.createElement(`div`,{\"data-title\":``,className:Bn(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?_.createElement(`div`,{\"data-description\":``,className:Bn(y,he,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),_.isValidElement(n.cancel)?n.cancel:n.cancel&&jn(n.cancel)?_.createElement(`button`,{\"data-button\":!0,\"data-cancel\":!0,style:n.cancelButtonStyle||h,onClick:e=>{jn(n.cancel)&&pe&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),ke())},className:Bn(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,_.isValidElement(n.action)?n.action:n.action&&jn(n.action)?_.createElement(`button`,{\"data-button\":!0,\"data-action\":!0,style:n.actionButtonStyle||g,onClick:e=>{jn(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&ke())},className:Bn(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Un(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Wn(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Pn:Nn;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Gn=_.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Mn,toastOptions:g,dir:v=Un(),gap:y=Ln,icons:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=_.useState([]),w=_.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=_.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=_.useState([]),[O,k]=_.useState(!1),[A,j]=_.useState(!1),[M,N]=_.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),P=_.useRef(null),ee=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),F=_.useRef(null),I=_.useRef(!1),te=_.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||Dn.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return _.useEffect(()=>Dn.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{hn.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[S]),_.useEffect(()=>{if(d!==`system`){N(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?N(`dark`):N(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{N(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{N(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),_.useEffect(()=>{S.length<=1&&k(!1)},[S]),_.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=P.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),_.useEffect(()=>{if(P.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,I.current=!1)}},[P.current]),_.createElement(`section`,{ref:t,\"aria-label\":`${x} ${ee}`,tabIndex:-1,\"aria-live\":`polite`,\"aria-relevant\":`additions text`,\"aria-atomic\":`false`,suppressHydrationWarning:!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?_.createElement(`ol`,{key:t,dir:v===`auto`?Un():v,tabIndex:-1,ref:P,className:c,\"data-sonner-toaster\":!0,\"data-sonner-theme\":M,\"data-y-position\":i,\"data-x-position\":a,style:{\"--front-toast-height\":`${E[0]?.height||0}px`,\"--width\":`${In}px`,\"--gap\":`${y}px`,...m,...Wn(l,u)},onBlur:e=>{I.current&&!e.currentTarget.contains(e.relatedTarget)&&(I.current=!1,F.current&&=(F.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||I.current||(I.current=!0,F.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||j(!0)},onPointerUp:()=>j(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>_.createElement(Hn,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:te,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:y,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),Kn={info:We,success:_e,error:ge},qn={info:`text-info`,success:`text-brand`,error:`text-destructive`};function Jn({id:e,kind:t,msg:n}){let r=Kn[t];return(0,B.jsxs)(`div`,{className:`group pointer-events-auto relative flex w-[360px] items-start gap-2.5 rounded-md border border-input bg-popover py-2.5 pl-3 pr-8 shadow-xl`,children:[(0,B.jsx)(r,{size:15,className:`mt-px shrink-0 ${qn[t]}`}),(0,B.jsx)(`p`,{className:`min-w-0 flex-1 break-words text-[13px] leading-snug text-foreground`,children:n}),(0,B.jsx)(`button`,{onClick:()=>An.dismiss(e),\"aria-label\":`Dismiss`,className:`absolute right-1.5 top-1.5 flex size-6 items-center justify-center rounded text-muted-foreground/80 opacity-0 transition-colors hover:bg-accent hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none`,children:(0,B.jsx)(Ft,{size:14})})]})}function U(e,t=`info`){return An.custom(n=>(0,B.jsx)(Jn,{id:n,kind:t,msg:e}),{duration:t===`error`?6e3:3500})}U.error=e=>U(e,`error`),U.success=e=>U(e,`success`);function Yn(){return(0,B.jsx)(Gn,{position:`bottom-right`,gap:8,offset:16})}function Xn(e,t=`Value`){return navigator.clipboard.writeText(e).then(()=>(U.success(`${t} copied`),!0),()=>(U.error(`Clipboard write failed`),!1))}function Zn(e,t){let[n,r]=(0,_.useState)(!1),i=(0,_.useRef)(void 0);return(0,_.useEffect)(()=>()=>clearTimeout(i.current),[]),{copied:n,copy:()=>{Xn(typeof e==`function`?e():e,t).then(e=>{e&&(r(!0),clearTimeout(i.current),i.current=setTimeout(()=>r(!1),1800))})}}}function Qn({value:e,label:t=`Value`,variant:n=`ghost`,size:r=`iconXs`,iconSize:i=12,className:a,disabled:o,children:s}){let{copied:c,copy:l}=Zn(e,t);return(0,B.jsxs)(H,{variant:n,size:r,className:a,disabled:o,title:c?`Copied!`:`Copy ${t}`,onClick:l,children:[c?(0,B.jsx)(fe,{size:i,className:`text-brand`}):(0,B.jsx)(xe,{size:i}),s]})}var $n={js:`ace/mode/javascript`,sql:`ace/mode/sql`};function er({value:e,lang:t,onChange:n,readOnly:r,gutter:i=!1,minLines:a,maxLines:o,placeholder:s,onCmdEnter:c,className:l}){let u=(0,_.useRef)(null),d=(0,_.useRef)(null),f=fn(),p=(0,_.useRef)({onChange:n,onCmdEnter:c});return p.current={onChange:n,onCmdEnter:c},(0,_.useEffect)(()=>{let n=an.default.edit(u.current,{mode:$n[t],theme:f===`dark`?`ace/theme/one_dark`:`ace/theme/github`,readOnly:!!r,showGutter:i,minLines:a,maxLines:o,fontSize:13,fontFamily:`ui-monospace, 'SF Mono', Menlo, monospace`,useWorker:!1,showPrintMargin:!1,highlightActiveLine:!r,highlightGutterLine:!r,tabSize:2,useSoftTabs:!0,placeholder:s,enableBasicAutocompletion:!r,enableLiveAutocompletion:!r});return n.setValue(e??``,-1),n.on(`change`,()=>p.current.onChange?.(n.getValue())),n.commands.addCommand({name:`cmd-enter`,bindKey:{win:`Ctrl-Enter`,mac:`Command-Enter`},exec:()=>p.current.onCmdEnter?.()}),n.renderer.setPadding(12),n.renderer.setScrollMargin(8,8,0,0),r&&(n.renderer.$cursorLayer.element.style.display=`none`),d.current=n,()=>{n.destroy(),d.current=null}},[t,r,i,a,o,f]),(0,_.useEffect)(()=>{let t=d.current;t&&t.getValue()!==e&&t.setValue(e??``,-1)},[e]),(0,B.jsx)(`div`,{ref:u,className:Yt(`w-full`,l)})}function tr({code:e,lang:t=`js`,gutter:n}){return(0,B.jsxs)(`div`,{className:`relative overflow-hidden rounded-md border border-border bg-code`,children:[(0,B.jsx)(er,{value:e,lang:t,readOnly:!0,gutter:n,minLines:2,maxLines:80}),(0,B.jsx)(Qn,{value:e,label:`Snippet`,className:`absolute right-2 top-2 z-10`})]})}function nr({value:e,onChange:t,lang:n,className:r,placeholder:i,onCmdEnter:a}){return(0,B.jsx)(`div`,{className:Yt(`overflow-hidden rounded-md border border-input bg-field focus-within:border-brand`,r),children:(0,B.jsx)(er,{value:e,onChange:t,lang:n,gutter:!0,placeholder:i,onCmdEnter:a,className:`h-full`})})}typeof window<`u`&&window.document&&window.document.createElement;function W(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function rr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ir(...e){return t=>{let n=!1,r=e.map(e=>{let r=rr(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():rr(e[t],null)}}}}function ar(...e){return _.useCallback(ir(...e),e)}function or(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,B.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=_.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\\`${n}\\` must be used within \\`${t}\\``)}return[o,s]}let i=()=>{let t=n.map(e=>_.createContext(e));return function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,sr(i,...t)]}function sr(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var cr=globalThis?.document?_.useLayoutEffect:()=>{},lr=_.useId||(()=>void 0),ur=0;function dr(e){let[t,n]=_.useState(lr());return cr(()=>{e||n(e=>e??String(ur++))},[e]),e||(t?`radix-${t}`:``)}var fr=_.useEffectEvent,pr=_.useInsertionEffect;function mr(e){if(typeof fr==`function`)return fr(e);let t=_.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof pr==`function`?pr(()=>{t.current=e}):cr(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}var hr=_.useInsertionEffect||cr;function gr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=_r({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=_.useRef(e!==void 0);_.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,_.useCallback(t=>{if(s){let n=vr(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function _r({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return hr(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function vr(e){return typeof e==`function`}function yr(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Dr(r)&&typeof jr==`function`&&(r=jr(r._payload)),_.Children.forEach(r,e=>{if(Tr(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Dr(n)&&typeof jr==`function`&&(n=jr(n._payload)),a=Sr(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?wr(a):void 0,l=ar(n,c);if(!a){if(r||r===0)throw Error(o?Ar(e):kr(e));return r}let u=Cr(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var br=Symbol.for(`radix.slottable`);function xr(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=br,t}var Sr=(e,t)=>{if(`child`in e.props){let t=e.props.child;return _.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null}return _.isValidElement(t)?t:null};function Cr(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function wr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Tr(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===br}var Er=Symbol.for(`react.lazy`);function Dr(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Er&&`_payload`in e&&Or(e._payload)}function Or(e){return typeof e==`object`&&!!e&&`then`in e}var kr=e=>`${e} failed to slot onto its children. Expected a single React element child or \\`Slottable\\`.`,Ar=e=>`${e} failed to slot onto its \\`Slottable\\`. Expected \\`Slottable\\` to receive a single React element child.`,jr=_.use,G=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=yr(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Mr(e,t){e&&hn.flushSync(()=>e.dispatchEvent(t))}function Nr(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}var Pr=`DismissableLayer`,Fr=`dismissableLayer.update`,Ir=`dismissableLayer.pointerDownOutside`,Lr=`dismissableLayer.focusOutside`,Rr,zr=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Br=_.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=_.useContext(zr),[d,f]=_.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=_.useState({}),h=ar(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(v),b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=_.useRef(!1),w=Wr(e=>{let t=e.target;if(!(t instanceof Node))return;let n=[...u.branches].some(e=>e.contains(t));!S||n||(a?.(e),s?.(e),e.defaultPrevented||c?.())},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces}),T=Gr(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=mr(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return _.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E]),_.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Rr=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Kr(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Rr))}},[d,p,n,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Kr())},[d,u]),_.useEffect(()=>{let e=()=>m({});return document.addEventListener(Fr,e),()=>document.removeEventListener(Fr,e)},[]),(0,B.jsx)(G.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:W(e.onFocusCapture,T.onFocusCapture),onBlurCapture:W(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:W(e.onPointerDownCapture,w.onPointerDownCapture)})});Br.displayName=Pr;var Vr=`DismissableLayerBranch`,Hr=_.forwardRef((e,t)=>{let n=_.useContext(zr),r=_.useRef(null),i=ar(t,r);return _.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,B.jsx)(G.div,{...e,ref:i})});Hr.displayName=Vr;function Ur(){let e=_.useContext(zr),[t,n]=_.useState(null);return _.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function Wr(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a}=t,o=Nr(e),s=_.useRef(!1),c=_.useRef(!1),l=_.useRef(new Map),u=_.useRef(()=>{});return _.useEffect(()=>{function e(){c.current=!1,i.current=!1,l.current.clear()}function t(){return Array.from(l.current.values()).some(Boolean)}function d(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||l.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{c.current&&u.current()},0)}function f(e){c.current&&l.current.set(e.type,!1)}let p=a=>{if(a.target&&!s.current){let s=function(){n.removeEventListener(`click`,u.current);let r=t();e(),r||qr(Ir,o,d,{discrete:!0})},d={originalEvent:a};c.current=!0,i.current=r&&a.button===0,l.current.clear(),!r||a.button!==0?s():(n.removeEventListener(`click`,u.current),u.current=s,n.addEventListener(`click`,u.current,{once:!0}))}else n.removeEventListener(`click`,u.current),e();s.current=!1},m=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of m)n.addEventListener(e,d,!0),n.addEventListener(e,f);let h=window.setTimeout(()=>{n.addEventListener(`pointerdown`,p)},0);return()=>{window.clearTimeout(h),n.removeEventListener(`pointerdown`,p),n.removeEventListener(`click`,u.current);for(let e of m)n.removeEventListener(e,d,!0),n.removeEventListener(e,f)}},[n,o,r,i,a]),{onPointerDownCapture:()=>s.current=!0}}function Gr(e,t=globalThis?.document){let n=Nr(e),r=_.useRef(!1);return _.useEffect(()=>{let e=e=>{e.target&&!r.current&&qr(Lr,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Kr(){let e=new CustomEvent(Fr);document.dispatchEvent(e)}function qr(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Mr(i,a):i.dispatchEvent(a)}var Jr=`focusScope.autoFocusOnMount`,Yr=`focusScope.autoFocusOnUnmount`,Xr={bubbles:!1,cancelable:!0},Zr=`FocusScope`,Qr=_.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=_.useState(null),l=Nr(i),u=Nr(a),d=_.useRef(null),f=ar(t,c),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:ai(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ai(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ai(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),_.useEffect(()=>{if(s){oi.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Jr,Xr);s.addEventListener(Jr,l),s.dispatchEvent(t),t.defaultPrevented||($r(li(ti(s)),{select:!0}),document.activeElement===e&&ai(s))}return()=>{s.removeEventListener(Jr,l),setTimeout(()=>{let t=new CustomEvent(Yr,Xr);s.addEventListener(Yr,u),s.dispatchEvent(t),t.defaultPrevented||ai(e??document.body,{select:!0}),s.removeEventListener(Yr,u),oi.remove(p)},0)}}},[s,l,u,p]);let m=_.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ei(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ai(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ai(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,B.jsx)(G.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Qr.displayName=Zr;function $r(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ai(r,{select:t}),document.activeElement!==n)return}function ei(e){let t=ti(e);return[ni(t,e),ni(t.reverse(),e)]}function ti(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ni(e,t){for(let n of e)if(!ri(n,{upTo:t}))return n}function ri(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function ii(e){return e instanceof HTMLInputElement&&`select`in e}function ai(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ii(e)&&t&&e.select()}}var oi=si();function si(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ci(e,t),e.unshift(t)},remove(t){e=ci(e,t),e[0]?.resume()}}}function ci(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function li(e){return e.filter(e=>e.tagName!==`A`)}var ui=`Portal`,di=_.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=_.useState(!1);cr(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?hn.createPortal((0,B.jsx)(G.div,{...r,ref:t}),o):null});di.displayName=ui;function fi(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}var pi=e=>{let{present:t,children:n}=e,r=mi(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=gi(r.ref,vi(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null};pi.displayName=`Presence`;function mi(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),[o,s]=fi(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{let e=_i(r.current);a.current=o===`mounted`?e:`none`},[o]),cr(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=_i(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),cr(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=_i(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=_i(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:_.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function hi(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function gi(...e){let t=_.useRef(e);return t.current=e,_.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=hi(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():hi(n[e],null)}}},[])}function _i(e){return e?.animationName||`none`}function vi(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yi=0,bi=null;function xi(){_.useEffect(()=>{bi||={start:Si(),end:Si()};let{start:e,end:t}=bi;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),yi++,()=>{yi===1&&(bi?.start.remove(),bi?.end.remove(),bi=null),yi=Math.max(0,yi-1)}},[])}function Si(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Ci=function(){return Ci=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},Ci.apply(this,arguments)};function wi(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 Ti(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))}var Ei=`right-scroll-bar-position`,Di=`width-before-scroll-bar`,Oi=`with-scroll-bars-hidden`,ki=`--removed-body-scroll-bar-size`;function Ai(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ji(e,t){var n=(0,_.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Mi=typeof window<`u`?_.useLayoutEffect:_.useEffect,Ni=new WeakMap;function Pi(e,t){var n=ji(t||null,function(t){return e.forEach(function(e){return Ai(e,t)})});return Mi(function(){var t=Ni.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ai(e,null)}),i.forEach(function(e){r.has(e)||Ai(e,a)})}Ni.set(n,e)},[e]),n}function Fi(e){return e}function Ii(e,t){t===void 0&&(t=Fi);var n=[],r=!1;return{read:function(){if(r)throw Error(\"Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.\");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Li(e){e===void 0&&(e={});var t=Ii(null);return t.options=Ci({async:!0,ssr:!1},e),t}var Ri=function(e){var t=e.sideCar,n=wi(e,[`sideCar`]);if(!t)throw Error(\"Sidecar: please provide `sideCar` property to import the right car\");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return _.createElement(r,Ci({},n))};Ri.isSideCarExport=!0;function zi(e,t){return e.useMedium(t),Ri}var Bi=Li(),Vi=function(){},Hi=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:Vi,onWheelCapture:Vi,onTouchMoveCapture:Vi}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=wi(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=Pi([n,t]),w=Ci(Ci({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:Bi,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),Ci(Ci({},w),{ref:C})):_.createElement(y,Ci({},w,{className:c,ref:C}),s))});Hi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Hi.classNames={fullWidth:Di,zeroRight:Ei};var Ui,Wi=function(){if(Ui)return Ui;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Gi(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Wi();return t&&e.setAttribute(`nonce`,t),e}function Ki(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qi(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Ji=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Gi())&&(Ki(t,n),qi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Yi=function(){var e=Ji();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Xi=function(){var e=Yi();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Zi={left:0,top:0,right:0,gap:0},Qi=function(e){return parseInt(e||``,10)||0},$i=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Qi(n),Qi(r),Qi(i)]},ea=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Zi;var t=$i(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ta=Xi(),na=`data-scroll-locked`,ra=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`\n .${Oi} {\n overflow: hidden ${r};\n padding-right: ${s}px ${r};\n }\n body[${na}] {\n overflow: hidden ${r};\n overscroll-behavior: contain;\n ${[t&&`position: relative ${r};`,n===`margin`&&`\n padding-left: ${i}px;\n padding-top: ${a}px;\n padding-right: ${o}px;\n margin-left:0;\n margin-top:0;\n margin-right: ${s}px ${r};\n `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}\n }\n \n .${Ei} {\n right: ${s}px ${r};\n }\n \n .${Di} {\n margin-right: ${s}px ${r};\n }\n \n .${Ei} .${Ei} {\n right: 0 ${r};\n }\n \n .${Di} .${Di} {\n margin-right: 0 ${r};\n }\n \n body[${na}] {\n ${ki}: ${s}px;\n }\n`},ia=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},aa=function(){_.useEffect(function(){return document.body.setAttribute(na,(ia()+1).toString()),function(){var e=ia()-1;e<=0?document.body.removeAttribute(na):document.body.setAttribute(na,e.toString())}},[])},oa=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;aa();var a=_.useMemo(function(){return ea(i)},[i]);return _.createElement(ta,{styles:ra(a,!t,i,n?``:`!important`)})},sa=!1;if(typeof window<`u`)try{var ca=Object.defineProperty({},\"passive\",{get:function(){return sa=!0,!0}});window.addEventListener(`test`,ca,ca),window.removeEventListener(`test`,ca,ca)}catch{sa=!1}var la=sa?{passive:!1}:!1,ua=function(e){return e.tagName===`TEXTAREA`},da=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!ua(e)&&n[t]===`visible`)},fa=function(e){return da(e,`overflowY`)},pa=function(e){return da(e,`overflowX`)},ma=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),_a(e,r)){var i=va(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ha=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ga=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},_a=function(e,t){return e===`v`?fa(t):pa(t)},va=function(e,t){return e===`v`?ha(t):ga(t)},ya=function(e,t){return e===`h`&&t===`rtl`?-1:1},ba=function(e,t,n,r,i){var a=ya(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=va(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&_a(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},xa=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Sa=function(e){return[e.deltaX,e.deltaY]},Ca=function(e){return e&&`current`in e?e.current:e},wa=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ta=function(e){return`\n .block-interactivity-${e} {pointer-events: none;}\n .allow-interactivity-${e} {pointer-events: all;}\n`},Ea=0,Da=[];function Oa(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Ea++)[0],a=_.useState(Xi)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Ti([e.lockRef.current],(e.shards||[]).map(Ca),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=xa(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=ma(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=ma(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return ba(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(!(!Da.length||Da[Da.length-1]!==a)){var r=`deltaY`in n?Sa(n):xa(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&wa(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Ca).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ka(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=xa(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,Sa(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,xa(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return Da.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,la),document.addEventListener(`touchmove`,c,la),document.addEventListener(`touchstart`,u,la),function(){Da=Da.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,la),document.removeEventListener(`touchmove`,c,la),document.removeEventListener(`touchstart`,u,la)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:Ta(i)}):null,p?_.createElement(oa,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ka(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Aa=zi(Bi,Oa),ja=_.forwardRef(function(e,t){return _.createElement(Hi,Ci({},e,{ref:t,sideCar:Aa}))});ja.classNames=Hi.classNames;var Ma=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Na=new WeakMap,Pa=new WeakMap,Fa={},Ia=0,La=function(e){return e&&(e.host||La(e.parentNode))},Ra=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=La(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},za=function(e,t,n,r){var i=Ra(t,Array.isArray(e)?e:[e]);Fa[n]||(Fa[n]=new WeakMap);var a=Fa[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Na.get(e)||0)+1,l=(a.get(e)||0)+1;Na.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Pa.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Ia++,function(){o.forEach(function(e){var t=Na.get(e)-1,i=a.get(e)-1;Na.set(e,t),a.set(e,i),t||(Pa.has(e)||e.removeAttribute(r),Pa.delete(e)),i||e.removeAttribute(n)}),Ia--,Ia||(Na=new WeakMap,Na=new WeakMap,Pa=new WeakMap,Fa={})}},Ba=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ma(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),za(r,i,n,`aria-hidden`)):function(){return null}},Va=`Dialog`,[Ha,Ua]=or(Va),[Wa,Ga]=Ha(Va),Ka=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),[l,u]=gr({prop:r,defaultProp:i??!1,onChange:a,caller:Va});return(0,B.jsx)(Wa,{scope:t,triggerRef:s,contentRef:c,contentId:dr(),titleId:dr(),descriptionId:dr(),open:l,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};Ka.displayName=Va;var qa=`DialogTrigger`,Ja=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ga(qa,n),a=ar(t,i.triggerRef);return(0,B.jsx)(G.button,{type:`button`,\"aria-haspopup\":`dialog`,\"aria-expanded\":i.open,\"aria-controls\":i.open?i.contentId:void 0,\"data-state\":mo(i.open),...r,ref:a,onClick:W(e.onClick,i.onOpenToggle)})});Ja.displayName=qa;var Ya=`DialogPortal`,[Xa,Za]=Ha(Ya,{forceMount:void 0}),Qa=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ga(Ya,t);return(0,B.jsx)(Xa,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,B.jsx)(pi,{present:n||a.open,children:(0,B.jsx)(di,{asChild:!0,container:i,children:e})}))})};Qa.displayName=Ya;var $a=`DialogOverlay`,eo=_.forwardRef((e,t)=>{let n=Za($a,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ga($a,e.__scopeDialog);return a.modal?(0,B.jsx)(pi,{present:r||a.open,children:(0,B.jsx)(no,{...i,ref:t})}):null});eo.displayName=$a;var to=yr(`DialogOverlay.RemoveScroll`),no=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ga($a,n),a=ar(t,Ur());return(0,B.jsx)(ja,{as:to,allowPinchZoom:!0,shards:[i.contentRef],children:(0,B.jsx)(G.div,{\"data-state\":mo(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})}),ro=`DialogContent`,io=_.forwardRef((e,t)=>{let n=Za(ro,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ga(ro,e.__scopeDialog);return(0,B.jsx)(pi,{present:r||a.open,children:a.modal?(0,B.jsx)(ao,{...i,ref:t}):(0,B.jsx)(oo,{...i,ref:t})})});io.displayName=ro;var ao=_.forwardRef((e,t)=>{let n=Ga(ro,e.__scopeDialog),r=_.useRef(null),i=ar(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return Ba(e)},[]),(0,B.jsx)(K,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:W(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:W(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:W(e.onFocusOutside,e=>e.preventDefault())})}),oo=_.forwardRef((e,t)=>{let n=Ga(ro,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,B.jsx)(K,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),K=_.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Ga(ro,n);return xi(),(0,B.jsx)(B.Fragment,{children:(0,B.jsx)(Qr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,B.jsx)(Br,{role:`dialog`,id:s.contentId,\"aria-describedby\":s.descriptionId,\"aria-labelledby\":s.titleId,\"data-state\":mo(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),so=`DialogTitle`,co=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ga(so,n);return(0,B.jsx)(G.h2,{id:i.titleId,...r,ref:t})});co.displayName=so;var lo=`DialogDescription`,uo=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ga(lo,n);return(0,B.jsx)(G.p,{id:i.descriptionId,...r,ref:t})});uo.displayName=lo;var fo=`DialogClose`,po=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Ga(fo,n);return(0,B.jsx)(G.button,{type:`button`,...r,ref:t,onClick:W(e.onClick,()=>i.onOpenChange(!1))})});po.displayName=fo;function mo(e){return e?`open`:`closed`}function ho({open:e,onClose:t,title:n,children:r,wide:i,width:a}){return(0,B.jsx)(Ka,{open:e,onOpenChange:e=>!e&&t(),children:(0,B.jsxs)(Qa,{children:[(0,B.jsx)(eo,{className:`fixed inset-0 z-50 bg-black/60 backdrop-blur-sm animate-[fade-in_.15s_ease-out]`}),(0,B.jsxs)(io,{className:Yt(`fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2 rounded-lg border border-input bg-popover shadow-2xl`,`max-h-[85vh] max-w-[92vw] overflow-auto focus:outline-none`,a??(i?`w-160`:`w-110`)),children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-4 py-3`,children:[(0,B.jsx)(co,{className:`text-sm font-semibold`,children:n}),(0,B.jsx)(po,{className:`text-muted-foreground/80 hover:text-foreground`,children:(0,B.jsx)(Ft,{size:16})})]}),(0,B.jsx)(`div`,{className:`p-4`,children:r})]})]})})}function go({open:e,title:t,description:n,confirmLabel:r=`Confirm`,cancelLabel:i=`Cancel`,danger:a,onConfirm:o,onClose:s}){return(0,B.jsxs)(ho,{open:e,onClose:s,title:t,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[a&&(0,B.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-destructive/15`,children:(0,B.jsx)(kt,{size:15,className:`text-destructive`})}),(0,B.jsx)(`p`,{className:`min-w-0 text-[13px] leading-relaxed text-muted-foreground`,children:n??`Are you sure?`})]}),(0,B.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,B.jsx)(H,{variant:`outline`,onClick:s,children:i}),(0,B.jsx)(H,{variant:a?`dangerSolid`:`default`,autoFocus:!0,onClick:()=>{o(),s()},children:r})]})]})}function _o(e){let t=e+`CollectionProvider`,[n,r]=or(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=_.useRef(null),a=_.useRef(new Map).current;return(0,B.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=yr(s),l=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=ar(t,a(s,n).collectionRef);return(0,B.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=yr(u),p=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),s=ar(t,o),c=a(u,n);return _.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,B.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return _.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var vo=_.createContext(void 0);function yo(e){let t=_.useContext(vo);return e||t||`ltr`}var bo=[`top`,`right`,`bottom`,`left`],xo=Math.min,So=Math.max,Co=Math.round,wo=Math.floor,To=e=>({x:e,y:e}),Eo={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Do(e,t,n){return So(e,xo(t,n))}function Oo(e,t){return typeof e==`function`?e(t):e}function ko(e){return e.split(`-`)[0]}function Ao(e){return e.split(`-`)[1]}function jo(e){return e===`x`?`y`:`x`}function Mo(e){return e===`y`?`height`:`width`}function No(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Po(e){return jo(No(e))}function Fo(e,t,n){n===void 0&&(n=!1);let r=Ao(e),i=Po(e),a=Mo(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Wo(o)),[o,Wo(o)]}function Io(e){let t=Wo(e);return[Lo(e),t,Lo(t)]}function Lo(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ro=[`left`,`right`],zo=[`right`,`left`],Bo=[`top`,`bottom`],Vo=[`bottom`,`top`];function Ho(e,t,n){switch(e){case`top`:case`bottom`:return n?t?zo:Ro:t?Ro:zo;case`left`:case`right`:return t?Bo:Vo;default:return[]}}function Uo(e,t,n,r){let i=Ao(e),a=Ho(ko(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Lo)))),a}function Wo(e){let t=ko(e);return Eo[t]+e.slice(t.length)}function Go(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ko(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Go(e)}function qo(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Jo(e,t,n){let{reference:r,floating:i}=e,a=No(t),o=Po(t),s=Mo(o),c=ko(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Ao(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Yo(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Oo(t,e),p=Ko(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=qo(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=qo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Xo=50,Zo=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Yo},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Jo(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Xo&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Jo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Qo=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Oo(e,t)||{};if(l==null)return{};let d=Ko(u),f={x:n,y:r},p=Po(i),m=Mo(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=xo(d[_],T),D=xo(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Do(O,A,k),M=!c.arrow&&Ao(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),$o=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Oo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ko(r),_=No(o),v=ko(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Wo(o)]:Io(o)),x=p!==`none`;!d&&x&&b.push(...Uo(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Fo(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==No(t))||T.every(e=>No(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=No(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function es(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ts(e){return bo.some(t=>e[t]>=0)}var ns=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Oo(e,t);switch(i){case`referenceHidden`:{let e=es(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ts(e)}}}case`escaped`:{let e=es(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ts(e)}}}default:return{}}}}},rs=new Set([`left`,`top`]);async function is(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ko(n),s=Ao(n),c=No(n)===`y`,l=rs.has(o)?-1:1,u=a&&c?-1:1,d=Oo(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var as=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await is(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},os=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Oo(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=No(ko(i)),p=jo(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Do(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Do(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},ss=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Oo(e,t),u={x:n,y:r},d=No(i),f=jo(d),p=u[f],m=u[d],h=Oo(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=rs.has(ko(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},cs=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Oo(e,t),u=await o.detectOverflow(t,l),d=ko(i),f=Ao(i),p=No(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=xo(h-u[g],v),x=xo(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=So(u.left,0),t=So(u.right,0),n=So(u.top,0),r=So(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:So(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:So(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function ls(){return typeof window<`u`}function us(e){return ps(e)?(e.nodeName||``).toLowerCase():`#document`}function ds(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fs(e){return((ps(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ps(e){return ls()?e instanceof Node||e instanceof ds(e).Node:!1}function ms(e){return ls()?e instanceof Element||e instanceof ds(e).Element:!1}function hs(e){return ls()?e instanceof HTMLElement||e instanceof ds(e).HTMLElement:!1}function gs(e){return!ls()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ds(e).ShadowRoot}function _s(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Os(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function vs(e){return/^(table|td|th)$/.test(us(e))}function ys(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var bs=/transform|translate|scale|rotate|perspective|filter/,xs=/paint|layout|strict|content/,Ss=e=>!!e&&e!==`none`,Cs;function ws(e){let t=ms(e)?Os(e):e;return Ss(t.transform)||Ss(t.translate)||Ss(t.scale)||Ss(t.rotate)||Ss(t.perspective)||!Es()&&(Ss(t.backdropFilter)||Ss(t.filter))||bs.test(t.willChange||``)||xs.test(t.contain||``)}function Ts(e){let t=As(e);for(;hs(t)&&!Ds(t);){if(ws(t))return t;if(ys(t))return null;t=As(t)}return null}function Es(){return Cs??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Cs}function Ds(e){return/^(html|body|#document)$/.test(us(e))}function Os(e){return ds(e).getComputedStyle(e)}function ks(e){return ms(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function As(e){if(us(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||gs(e)&&e.host||fs(e);return gs(t)?t.host:t}function js(e){let t=As(e);return Ds(t)?e.ownerDocument?e.ownerDocument.body:e.body:hs(t)&&_s(t)?t:js(t)}function Ms(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=js(e),i=r===e.ownerDocument?.body,a=ds(r);if(i){let e=Ns(a);return t.concat(a,a.visualViewport||[],_s(r)?r:[],e&&n?Ms(e):[])}else return t.concat(r,Ms(r,[],n))}function Ns(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ps(e){let t=Os(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=hs(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Co(n)!==a||Co(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Fs(e){return ms(e)?e:e.contextElement}function Is(e){let t=Fs(e);if(!hs(t))return To(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ps(t),o=(a?Co(n.width):n.width)/r,s=(a?Co(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ls=To(0);function Rs(e){let t=ds(e);return!Es()||!t.visualViewport?Ls:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zs(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ds(e)?!1:t}function Bs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Fs(e),o=To(1);t&&(r?ms(r)&&(o=Is(r)):o=Is(e));let s=zs(a,n,r)?Rs(a):To(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=ds(a),t=r&&ms(r)?ds(r):r,n=e,i=Ns(n);for(;i&&r&&t!==n;){let e=Is(i),t=i.getBoundingClientRect(),r=Os(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ds(i),i=Ns(n)}}return qo({width:u,height:d,x:c,y:l})}function Vs(e,t){let n=ks(e).scrollLeft;return t?t.left+n:Bs(fs(e)).left+n}function Hs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Vs(e,n),y:n.top+t.scrollTop}}function Us(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=fs(r),s=t?ys(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=To(1),u=To(0),d=hs(r);if((d||!d&&!a)&&((us(r)!==`body`||_s(o))&&(c=ks(r)),d)){let e=Bs(r);l=Is(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Hs(o,c):To(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ws(e){return Array.from(e.getClientRects())}function Gs(e){let t=fs(e),n=ks(e),r=e.ownerDocument.body,i=So(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=So(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Vs(e),s=-n.scrollTop;return Os(r).direction===`rtl`&&(o+=So(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Ks=25;function qs(e,t){let n=ds(e),r=fs(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Es();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Vs(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Ks&&(a-=o)}else l<=Ks&&(a+=l);return{width:a,height:o,x:s,y:c}}function Js(e,t){let n=Bs(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=hs(e)?Is(e):To(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ys(e,t,n){let r;if(t===`viewport`)r=qs(e,n);else if(t===`document`)r=Gs(fs(e));else if(ms(t))r=Js(t,n);else{let n=Rs(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return qo(r)}function Xs(e,t){let n=As(e);return n===t||!ms(n)||Ds(n)?!1:Os(n).position===`fixed`||Xs(n,t)}function Zs(e,t){let n=t.get(e);if(n)return n;let r=Ms(e,[],!1).filter(e=>ms(e)&&us(e)!==`body`),i=null,a=Os(e).position===`fixed`,o=a?As(e):e;for(;ms(o)&&!Ds(o);){let t=Os(o),n=ws(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||_s(o)&&!n&&Xs(e,o))?r=r.filter(e=>e!==o):i=t,o=As(o)}return t.set(e,r),r}function Qs(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ys(t)?[]:Zs(t,this._c):[].concat(n),r],o=Ys(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ys(t,a[e],i);s=So(n.top,s),c=xo(n.right,c),l=xo(n.bottom,l),u=So(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function $s(e){let{width:t,height:n}=Ps(e);return{width:t,height:n}}function ec(e,t,n){let r=hs(t),i=fs(t),a=n===`fixed`,o=Bs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=To(0);function l(){c.x=Vs(i)}if(r||!r&&!a)if((us(t)!==`body`||_s(i))&&(s=ks(t)),r){let e=Bs(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Hs(i,s):To(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function tc(e){return Os(e).position===`static`}function nc(e,t){if(!hs(e)||Os(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return fs(e)===n&&(n=n.ownerDocument.body),n}function rc(e,t){let n=ds(e);if(ys(e))return n;if(!hs(e)){let t=As(e);for(;t&&!Ds(t);){if(ms(t)&&!tc(t))return t;t=As(t)}return n}let r=nc(e,t);for(;r&&vs(r)&&tc(r);)r=nc(r,t);return r&&Ds(r)&&tc(r)&&!ws(r)?n:r||Ts(e)||n}var ic=async function(e){let t=this.getOffsetParent||rc,n=this.getDimensions,r=await n(e.floating);return{reference:ec(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ac(e){return Os(e).direction===`rtl`}var oc={convertOffsetParentRelativeRectToViewportRelativeRect:Us,getDocumentElement:fs,getClippingRect:Qs,getOffsetParent:rc,getElementRects:ic,getClientRects:Ws,getDimensions:$s,getScale:Is,isElement:ms,isRTL:ac};function sc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function cc(e,t){let n=null,r,i=fs(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=wo(d),h=wo(i.clientWidth-(u+f)),g=wo(i.clientHeight-(d+p)),_=wo(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:So(0,xo(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!sc(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function lc(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Fs(e),u=i||a?[...l?Ms(l):[],...t?Ms(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?cc(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Bs(e):null;c&&g();function g(){let t=Bs(e);h&&!sc(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var uc=as,dc=os,fc=$o,pc=cs,mc=ns,hc=Qo,gc=ss,_c=(e,t,n)=>{let r=new Map,i={platform:oc,...n},a={...i.platform,_c:r};return Zo(e,t,{...i,platform:a})},vc=typeof document<`u`?_.useLayoutEffect:function(){};function yc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!yc(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!yc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function bc(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xc(e,t){let n=bc(e);return Math.round(t*n)/n}function Sc(e){let t=_.useRef(e);return vc(()=>{t.current=e}),t}function Cc(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);yc(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=Sc(c),O=Sc(i),k=Sc(l),A=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),_c(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!yc(T.current,t)&&(T.current=t,hn.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);vc(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=_.useRef(!1);vc(()=>(j.current=!0,()=>{j.current=!1}),[]),vc(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=_.useMemo(()=>({reference:x,floating:S}),[x,S]),P=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=xc(N.floating,u.x),r=xc(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...bc(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var wc=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:hc({element:r.current,padding:i}).fn(n):r?hc({element:r,padding:i}).fn(n):{}}}},Tc=(e,t)=>{let n=uc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ec=(e,t)=>{let n=dc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dc=(e,t)=>({fn:gc(e).fn,options:[e,t]}),Oc=(e,t)=>{let n=fc(e);return{name:n.name,fn:n.fn,options:[e,t]}},kc=(e,t)=>{let n=pc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ac=(e,t)=>{let n=mc(e);return{name:n.name,fn:n.fn,options:[e,t]}},jc=(e,t)=>{let n=wc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mc=`Arrow`,Nc=_.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,B.jsx)(G.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,B.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Nc.displayName=Mc;var Pc=Nc;function Fc(e){let[t,n]=_.useState(void 0);return cr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Ic=`Popper`,[Lc,Rc]=or(Ic),[zc,Bc]=Lc(Ic),Vc=e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return(0,B.jsx)(zc,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};Vc.displayName=Ic;var Hc=`PopperAnchor`,Uc=_.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Bc(Hc,n),o=_.useRef(null),s=a.onAnchorChange,c=ar(t,_.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=_.useRef(null);_.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&$c(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,B.jsx)(G.div,{\"data-radix-popper-side\":d,\"data-radix-popper-align\":f,...i,ref:c})});Uc.displayName=Hc;var Wc=`PopperContent`,[Gc,Kc]=Lc(Wc),qc=_.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Bc(Wc,n),[v,y]=_.useState(null),b=ar(t,y),[x,S]=_.useState(null),C=Fc(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Zc),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:ee}=Cc({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>lc(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[Tc({mainAxis:i+T,alignmentAxis:o}),c&&Ec({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Dc():void 0,...A}),c&&Oc({...A}),kc({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&jc({element:x,padding:s}),Qc({arrowWidth:w,arrowHeight:T}),f&&Ac({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),F=g.setPlacementState;cr(()=>(F(N),()=>{F(void 0)}),[N,F]);let[I,te]=$c(N),ne=Nr(m);cr(()=>{P&&ne?.()},[P,ne]);let re=ee.arrow?.x,ie=ee.arrow?.y,ae=ee.arrow?.centerOffset!==0,[L,oe]=_.useState();return cr(()=>{v&&oe(window.getComputedStyle(v).zIndex)},[v]),(0,B.jsx)(`div`,{ref:j.setFloating,\"data-radix-popper-content-wrapper\":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:L,\"--radix-popper-transform-origin\":[ee.transformOrigin?.x,ee.transformOrigin?.y].join(` `),...ee.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,B.jsx)(Gc,{scope:n,placedSide:I,placedAlign:te,onArrowChange:S,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,B.jsx)(G.div,{\"data-side\":I,\"data-align\":te,...h,ref:b,style:{...h.style,animation:P?void 0:`none`}})})})});qc.displayName=Wc;var Jc=`PopperArrow`,Yc={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Xc=_.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Kc(Jc,n),a=Yc[i.placedSide];return(0,B.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,B.jsx)(Pc,{...r,ref:t,style:{...r.style,display:`block`}})})});Xc.displayName=Jc;function Zc(e){return e!==null}var Qc=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=$c(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function $c(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var el=Vc,tl=Uc,nl=qc,rl=Xc,il=`rovingFocusGroup.onEntryFocus`,al={bubbles:!1,cancelable:!0},ol=`RovingFocusGroup`,[sl,cl,ll]=_o(ol),[ul,dl]=or(ol,[ll]),[fl,pl]=ul(ol),ml=_.forwardRef((e,t)=>(0,B.jsx)(sl.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,B.jsx)(sl.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,B.jsx)(hl,{...e,ref:t})})}));ml.displayName=ol;var hl=_.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=_.useRef(null),p=ar(t,f),m=yo(a),[h,g]=gr({prop:o,defaultProp:s??null,onChange:c,caller:ol}),[v,y]=_.useState(!1),b=Nr(l),x=cl(n),S=_.useRef(!1),[C,w]=_.useState(0);return _.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(il,b),()=>e.removeEventListener(il,b)},[b]),(0,B.jsx)(fl,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:_.useCallback(e=>g(e),[g]),onItemShiftTab:_.useCallback(()=>y(!0),[]),onFocusableItemAdd:_.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:_.useCallback(()=>w(e=>e-1),[]),children:(0,B.jsx)(G.div,{tabIndex:v||C===0?-1:0,\"data-orientation\":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:W(e.onMouseDown,()=>{S.current=!0}),onFocus:W(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(il,al);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);xl([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:W(e.onBlur,()=>y(!1))})})}),gl=`RovingFocusGroupItem`,_l=_.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=dr(),l=a||c,u=pl(gl,n),d=u.currentTabStopId===l,f=cl(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return _.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,B.jsx)(sl.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,B.jsx)(G.span,{tabIndex:d?0:-1,\"data-orientation\":u.orientation,...s,ref:t,onMouseDown:W(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:W(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:W(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=bl(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Sl(n,r+1):n.slice(r+1)}setTimeout(()=>xl(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});_l.displayName=gl;var vl={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function yl(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function bl(e,t,n){let r=yl(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return vl[r]}function xl(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Sl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Cl=ml,wl=_l,Tl=[`Enter`,` `],El=[`ArrowDown`,`PageUp`,`Home`],Dl=[`ArrowUp`,`PageDown`,`End`],Ol=[...El,...Dl],kl={ltr:[...Tl,`ArrowRight`],rtl:[...Tl,`ArrowLeft`]},Al={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},jl=`Menu`,[Ml,Nl,Pl]=_o(jl),[Fl,Il]=or(jl,[Pl,Rc,dl]),Ll=Rc(),Rl=dl(),[zl,q]=Fl(jl),[Bl,Vl]=Fl(jl),Hl=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Ll(t),[c,l]=_.useState(null),u=_.useRef(!1),d=Nr(a),f=yo(i);return _.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),_.useEffect(()=>{if(!n)return;let e=()=>d(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,B.jsx)(el,{...s,children:(0,B.jsx)(zl,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,B.jsx)(Bl,{scope:t,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Hl.displayName=jl;var Ul=`MenuAnchor`,Wl=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Ll(n);return(0,B.jsx)(tl,{...i,...r,ref:t})});Wl.displayName=Ul;var Gl=`MenuPortal`,[Kl,ql]=Fl(Gl,{forceMount:void 0}),Jl=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=q(Gl,t);return(0,B.jsx)(Kl,{scope:t,forceMount:n,children:(0,B.jsx)(pi,{present:n||a.open,children:(0,B.jsx)(di,{asChild:!0,container:i,children:r})})})};Jl.displayName=Gl;var Yl=`MenuContent`,[Xl,Zl]=Fl(Yl),Ql=_.forwardRef((e,t)=>{let n=ql(Yl,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=q(Yl,e.__scopeMenu),o=Vl(Yl,e.__scopeMenu);return(0,B.jsx)(Ml.Provider,{scope:e.__scopeMenu,children:(0,B.jsx)(pi,{present:r||a.open,children:(0,B.jsx)(Ml.Slot,{scope:e.__scopeMenu,children:o.modal?(0,B.jsx)($l,{...i,ref:t}):(0,B.jsx)(eu,{...i,ref:t})})})})}),$l=_.forwardRef((e,t)=>{let n=q(Yl,e.__scopeMenu),r=_.useRef(null),i=ar(t,r);return _.useEffect(()=>{let e=r.current;if(e)return Ba(e)},[]),(0,B.jsx)(nu,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:W(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),eu=_.forwardRef((e,t)=>{let n=q(Yl,e.__scopeMenu);return(0,B.jsx)(nu,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),tu=yr(`MenuContent.ScrollLock`),nu=_.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=q(Yl,n),v=Vl(Yl,n),y=Ll(n),b=Rl(n),x=Nl(n),[S,C]=_.useState(null),w=_.useRef(null),T=ar(t,w,g.onContentChange),E=_.useRef(0),D=_.useRef(``),O=_.useRef(0),k=_.useRef(null),A=_.useRef(`right`),j=_.useRef(0),M=m?ja:_.Fragment,N=m?{as:tu,allowPinchZoom:!0}:void 0,P=e=>{let t=D.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Bu(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){D.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};_.useEffect(()=>()=>window.clearTimeout(E.current),[]),xi();let ee=_.useCallback(e=>A.current===k.current?.side&&Hu(e,k.current?.area),[]);return(0,B.jsx)(Xl,{scope:n,searchRef:D,onItemEnter:_.useCallback(e=>{ee(e)&&e.preventDefault()},[ee]),onItemLeave:_.useCallback(e=>{ee(e)||(w.current?.focus(),C(null))},[ee]),onTriggerLeave:_.useCallback(e=>{ee(e)&&e.preventDefault()},[ee]),pointerGraceTimerRef:O,onPointerGraceIntentChange:_.useCallback(e=>{k.current=e},[]),children:(0,B.jsx)(M,{...N,children:(0,B.jsx)(Qr,{asChild:!0,trapped:i,onMountAutoFocus:W(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,B.jsx)(Br,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,B.jsx)(Cl,{asChild:!0,...b,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:W(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,B.jsx)(nl,{role:`menu`,\"aria-orientation\":`vertical`,\"data-state\":Fu(g.open),\"data-radix-menu-content\":``,dir:v.dir,...y,...h,ref:T,style:{outline:`none`,...h.style},onKeyDown:W(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&P(e.key));let i=w.current;if(e.target!==i||!Ol.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);Dl.includes(e.key)&&a.reverse(),Ru(a)}),onBlur:W(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:W(e.onPointerMove,Uu(e=>{let t=e.target,n=j.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>j.current?`right`:`left`;A.current=t,j.current=e.clientX}}))})})})})})})});Ql.displayName=Yl;var ru=`MenuGroup`,iu=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,B.jsx)(G.div,{role:`group`,...r,ref:t})});iu.displayName=ru;var au=`MenuLabel`,ou=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,B.jsx)(G.div,{...r,ref:t})});ou.displayName=au;var su=`MenuItem`,cu=`menu.itemSelect`,lu=_.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=_.useRef(null),o=Vl(su,e.__scopeMenu),s=Zl(su,e.__scopeMenu),c=ar(t,a),l=_.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(cu,{bubbles:!0,cancelable:!0});e.addEventListener(cu,e=>r?.(e),{once:!0}),Mr(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,B.jsx)(uu,{...i,ref:c,disabled:n,onClick:W(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:W(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:W(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||Tl.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});lu.displayName=su;var uu=_.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Zl(su,n),s=Rl(n),c=_.useRef(null),l=ar(t,c),[u,d]=_.useState(!1),[f,p]=_.useState(``);return _.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,B.jsx)(Ml.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,B.jsx)(wl,{asChild:!0,...s,focusable:!r,children:(0,B.jsx)(G.div,{role:`menuitem`,\"data-highlighted\":u?``:void 0,\"aria-disabled\":r||void 0,\"data-disabled\":r?``:void 0,...a,ref:l,onPointerMove:W(e.onPointerMove,Uu(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:W(e.onPointerLeave,Uu(e=>o.onItemLeave(e))),onFocus:W(e.onFocus,()=>d(!0)),onBlur:W(e.onBlur,()=>d(!1))})})})}),du=`MenuCheckboxItem`,fu=_.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,B.jsx)(bu,{scope:e.__scopeMenu,checked:n,children:(0,B.jsx)(lu,{role:`menuitemcheckbox`,\"aria-checked\":Iu(n)?`mixed`:n,...i,ref:t,\"data-state\":Lu(n),onSelect:W(i.onSelect,()=>r?.(Iu(n)?!0:!n),{checkForDefaultPrevented:!1})})})});fu.displayName=du;var pu=`MenuRadioGroup`,[mu,hu]=Fl(pu,{value:void 0,onValueChange:()=>{}}),gu=_.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=Nr(r);return(0,B.jsx)(mu,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,B.jsx)(iu,{...i,ref:t})})});gu.displayName=pu;var _u=`MenuRadioItem`,vu=_.forwardRef((e,t)=>{let{value:n,...r}=e,i=hu(_u,e.__scopeMenu),a=n===i.value;return(0,B.jsx)(bu,{scope:e.__scopeMenu,checked:a,children:(0,B.jsx)(lu,{role:`menuitemradio`,\"aria-checked\":a,...r,ref:t,\"data-state\":Lu(a),onSelect:W(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});vu.displayName=_u;var yu=`MenuItemIndicator`,[bu,xu]=Fl(yu,{checked:!1}),Su=_.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=xu(yu,n);return(0,B.jsx)(pi,{present:r||Iu(a.checked)||a.checked===!0,children:(0,B.jsx)(G.span,{...i,ref:t,\"data-state\":Lu(a.checked)})})});Su.displayName=yu;var Cu=`MenuSeparator`,wu=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,B.jsx)(G.div,{role:`separator`,\"aria-orientation\":`horizontal`,...r,ref:t})});wu.displayName=Cu;var Tu=`MenuArrow`,Eu=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Ll(n);return(0,B.jsx)(rl,{...i,...r,ref:t})});Eu.displayName=Tu;var Du=`MenuSub`,[Ou,ku]=Fl(Du),Au=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=q(Du,t),o=Ll(t),[s,c]=_.useState(null),[l,u]=_.useState(null),d=Nr(i);return _.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,B.jsx)(el,{...o,children:(0,B.jsx)(zl,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,B.jsx)(Ou,{scope:t,contentId:dr(),triggerId:dr(),trigger:s,onTriggerChange:c,children:n})})})};Au.displayName=Du;var ju=`MenuSubTrigger`,Mu=_.forwardRef((e,t)=>{let n=q(ju,e.__scopeMenu),r=Vl(ju,e.__scopeMenu),i=ku(ju,e.__scopeMenu),a=Zl(ju,e.__scopeMenu),o=_.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=_.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);_.useEffect(()=>u,[u]),_.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=ar(t,i.onTriggerChange);return(0,B.jsx)(Wl,{asChild:!0,...l,children:(0,B.jsx)(uu,{id:i.triggerId,\"aria-haspopup\":`menu`,\"aria-expanded\":n.open,\"aria-controls\":n.open?i.contentId:void 0,\"data-state\":Fu(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:W(e.onPointerMove,Uu(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:W(e.onPointerLeave,Uu(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:W(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||kl[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Mu.displayName=ju;var Nu=`MenuSubContent`,Pu=_.forwardRef((e,t)=>{let n=ql(Yl,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=q(Yl,e.__scopeMenu),s=Vl(Yl,e.__scopeMenu),c=ku(Nu,e.__scopeMenu),l=_.useRef(null),u=ar(t,l);return(0,B.jsx)(Ml.Provider,{scope:e.__scopeMenu,children:(0,B.jsx)(pi,{present:r||o.open,children:(0,B.jsx)(Ml.Slot,{scope:e.__scopeMenu,children:(0,B.jsx)(nu,{id:c.contentId,\"aria-labelledby\":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:W(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:W(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:W(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Al[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});Pu.displayName=Nu;function Fu(e){return e?`open`:`closed`}function Iu(e){return e===`indeterminate`}function Lu(e){return Iu(e)?`indeterminate`:e?`checked`:`unchecked`}function Ru(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function zu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Bu(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=zu(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Vu(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Hu(e,t){return t?Vu({x:e.clientX,y:e.clientY},t):!1}function Uu(e){return t=>t.pointerType===`mouse`?e(t):void 0}var Wu=Hl,Gu=Wl,Ku=Jl,qu=Ql,Ju=iu,Yu=ou,Xu=lu,Zu=fu,Qu=gu,$u=vu,ed=Su,td=wu,nd=Eu,rd=Au,id=Mu,ad=Pu,od=`DropdownMenu`,[sd,cd]=or(od,[Il]),ld=Il(),[ud,dd]=sd(od),fd=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=ld(t),l=_.useRef(null),[u,d]=gr({prop:i,defaultProp:a??!1,onChange:o,caller:od});return(0,B.jsx)(ud,{scope:t,triggerId:dr(),triggerRef:l,contentId:dr(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,B.jsx)(Wu,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};fd.displayName=od;var pd=`DropdownMenuTrigger`,md=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=dd(pd,n),o=ld(n),s=ar(t,a.triggerRef);return(0,B.jsx)(Gu,{asChild:!0,...o,children:(0,B.jsx)(G.button,{type:`button`,id:a.triggerId,\"aria-haspopup\":`menu`,\"aria-expanded\":a.open,\"aria-controls\":a.open?a.contentId:void 0,\"data-state\":a.open?`open`:`closed`,\"data-disabled\":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:W(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:W(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});md.displayName=pd;var hd=`DropdownMenuPortal`,gd=e=>{let{__scopeDropdownMenu:t,...n}=e,r=ld(t);return(0,B.jsx)(Ku,{...r,...n})};gd.displayName=hd;var _d=`DropdownMenuContent`,vd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=dd(_d,n),a=ld(n),o=_.useRef(!1);return(0,B.jsx)(qu,{id:i.contentId,\"aria-labelledby\":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:W(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:W(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,\"--radix-dropdown-menu-content-transform-origin\":`var(--radix-popper-transform-origin)`,\"--radix-dropdown-menu-content-available-width\":`var(--radix-popper-available-width)`,\"--radix-dropdown-menu-content-available-height\":`var(--radix-popper-available-height)`,\"--radix-dropdown-menu-trigger-width\":`var(--radix-popper-anchor-width)`,\"--radix-dropdown-menu-trigger-height\":`var(--radix-popper-anchor-height)`}})});vd.displayName=_d;var yd=`DropdownMenuGroup`,bd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)(Ju,{...i,...r,ref:t})});bd.displayName=yd;var xd=`DropdownMenuLabel`,Sd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)(Yu,{...i,...r,ref:t})});Sd.displayName=xd;var Cd=`DropdownMenuItem`,J=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)(Xu,{...i,...r,ref:t})});J.displayName=Cd;var wd=`DropdownMenuCheckboxItem`,Td=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)(Zu,{...i,...r,ref:t})});Td.displayName=wd;var Ed=`DropdownMenuRadioGroup`,Dd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)(Qu,{...i,...r,ref:t})});Dd.displayName=Ed;var Od=`DropdownMenuRadioItem`,kd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)($u,{...i,...r,ref:t})});kd.displayName=Od;var Ad=`DropdownMenuItemIndicator`,jd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)(ed,{...i,...r,ref:t})});jd.displayName=Ad;var Md=`DropdownMenuSeparator`,Nd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)(td,{...i,...r,ref:t})});Nd.displayName=Md;var Pd=`DropdownMenuArrow`,Fd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)(nd,{...i,...r,ref:t})});Fd.displayName=Pd;var Id=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=ld(t),[s,c]=gr({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,B.jsx)(rd,{...o,open:s,onOpenChange:c,children:n})},Ld=`DropdownMenuSubTrigger`,Rd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)(id,{...i,...r,ref:t})});Rd.displayName=Ld;var zd=`DropdownMenuSubContent`,Bd=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=ld(n);return(0,B.jsx)(ad,{...i,...r,ref:t,style:{...e.style,\"--radix-dropdown-menu-content-transform-origin\":`var(--radix-popper-transform-origin)`,\"--radix-dropdown-menu-content-available-width\":`var(--radix-popper-available-width)`,\"--radix-dropdown-menu-content-available-height\":`var(--radix-popper-available-height)`,\"--radix-dropdown-menu-trigger-width\":`var(--radix-popper-anchor-width)`,\"--radix-dropdown-menu-trigger-height\":`var(--radix-popper-anchor-height)`}})});Bd.displayName=zd;var Vd=fd,Hd=md,Ud=gd,Wd=vd,Gd=Sd,Kd=J,qd=Nd,Jd=Id,Yd=Rd,Xd=Bd,Zd=Vd,Qd=Hd,$d=Jd,ef=`z-50 min-w-[180px] rounded-md border border-input bg-popover p-1 shadow-xl animate-[fade-in_.1s_ease-out]`;function tf({children:e,align:t=`start`,className:n}){return(0,B.jsx)(Ud,{children:(0,B.jsx)(Wd,{align:t,sideOffset:4,className:Yt(`z-50 min-w-[180px] rounded-md border border-input bg-popover p-1 shadow-xl animate-[fade-in_.1s_ease-out]`,n),children:e})})}function nf({children:e,onSelect:t,danger:n,disabled:r,shortcut:i}){return(0,B.jsxs)(Kd,{disabled:r,onSelect:t,className:Yt(`flex cursor-pointer select-none items-center gap-2 rounded px-2 py-1.5 text-[13px] outline-none`,n?`text-destructive data-[highlighted]:bg-destructive/10`:`text-foreground data-[highlighted]:bg-accent`,r&&`pointer-events-none opacity-40`),children:[e,i!==void 0&&(0,B.jsx)(`span`,{className:`ml-auto pl-4 text-[11px] text-muted-foreground/80`,children:i})]})}function rf({children:e}){return(0,B.jsxs)(Yd,{className:`flex cursor-pointer select-none items-center gap-2 rounded px-2 py-1.5 text-[13px] text-foreground outline-none data-[highlighted]:bg-accent data-[state=open]:bg-accent`,children:[e,(0,B.jsx)(he,{size:12,className:`ml-auto text-muted-foreground/80`})]})}function af({children:e}){return(0,B.jsx)(Ud,{children:(0,B.jsx)(Xd,{sideOffset:6,className:ef,children:e})})}function of(){return(0,B.jsx)(qd,{className:`my-1 h-px bg-accent`})}function sf({children:e}){return(0,B.jsx)(Gd,{className:`px-2 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80`,children:e})}function cf({children:e}){return(0,B.jsx)(`div`,{className:`py-16 text-center text-[13px] text-muted-foreground/80`,children:e})}function Y({className:e,mono:t,...n}){return(0,B.jsx)(`input`,{className:Yt(`h-8 w-full rounded-md border border-input bg-field px-2.5 text-[13px] text-foreground`,`placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none disabled:opacity-50`,t&&`font-mono`,e),...n})}function lf({children:e}){return(0,B.jsx)(`kbd`,{className:`inline-flex h-[18px] min-w-[18px] items-center justify-center rounded border border-input bg-accent px-1 font-mono text-[10px] text-muted-foreground`,children:e})}function X({children:e}){return(0,B.jsx)(`label`,{className:`mb-1 block text-xs font-medium text-muted-foreground`,children:e})}function uf({label:e,hint:t,value:n,danger:r,bare:i}){let[a,o]=(0,_.useState)(!r);return(0,B.jsxs)(`div`,{children:[!i&&(0,B.jsxs)(X,{children:[e,` `,(0,B.jsx)(`span`,{className:`ml-1 font-normal `+(r?`text-destructive/80`:`text-muted-foreground/80`),children:t})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,B.jsx)(Y,{mono:!0,readOnly:!0,type:a?`text`:`password`,value:n||`unavailable`,className:`pr-9`}),(0,B.jsx)(`button`,{type:`button`,title:a?`Hide key`:`Reveal key`,className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/80 transition-colors hover:text-foreground`,onClick:()=>o(e=>!e),children:a?(0,B.jsx)(Oe,{size:14}):(0,B.jsx)(ke,{size:14})})]}),(0,B.jsx)(Qn,{value:n,label:e,variant:`outline`,size:`icon`,iconSize:13,disabled:!n})]})]})}function df({message:e}){return(0,B.jsxs)(`div`,{className:`m-4 flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px] text-destructive`,children:[(0,B.jsx)(ge,{size:14,className:`mt-0.5 shrink-0`}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`span`,{className:`font-medium`,children:`Couldn't load this view.`}),` `,e]})]})}function ff({open:e,onOpenChange:t,trigger:n,children:r,align:i=`start`,className:a}){return(0,B.jsxs)(`div`,{className:`relative`,children:[n,e&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`fixed inset-0 z-40`,onClick:()=>t(!1)}),(0,B.jsx)(`div`,{className:Yt(`absolute top-full z-50 mt-1 rounded-md border border-input bg-popover shadow-xl animate-[fade-in_.1s_ease-out]`,i===`start`?`left-0`:`right-0`,a),children:r})]})]})}var pf=(e,t,n)=>Math.min(n,Math.max(t,e));function mf({id:e,axis:t=`x`,side:n=`left`,defaultSize:r,min:i=180,max:a=560,className:o,children:s}){let c=`tinbase_panel_${e}`,[l,u]=(0,_.useState)(()=>{let e=parseInt(localStorage.getItem(c)??``,10);return pf(Number.isFinite(e)?e:r,i,a)}),d=(0,_.useRef)(l);d.current=l;let f=(0,_.useRef)(null);return(0,B.jsxs)(`div`,{className:Yt(`relative shrink-0`,o),style:t===`x`?{width:l}:{height:l},children:[s,(0,B.jsx)(`div`,{role:`separator`,\"aria-orientation\":t===`x`?`vertical`:`horizontal`,title:`Drag to resize \u2014 double-click to reset`,className:Yt(`absolute z-20 transition-colors hover:bg-brand/40 active:bg-brand/60`,t===`x`?Yt(`inset-y-0 w-1 cursor-col-resize`,n===`left`?`-right-0.5`:`-left-0.5`):Yt(`inset-x-0 h-1 cursor-row-resize`,n===`left`?`-bottom-0.5`:`-top-0.5`)),onPointerDown:e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),f.current={start:t===`x`?e.clientX:e.clientY,startSize:d.current}},onPointerMove:e=>{let r=f.current;if(!r)return;let o=t===`x`?e.clientX:e.clientY,s=n===`left`?o-r.start:r.start-o;u(pf(r.startSize+s,i,a))},onPointerUp:()=>{f.current=null,localStorage.setItem(c,String(d.current))},onDoubleClick:()=>{u(pf(r,i,a)),localStorage.setItem(c,String(r))}})]})}function hf(e,[t,n]){return Math.min(n,Math.max(t,e))}function gf(e){let t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var _f=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),vf=`VisuallyHidden`,yf=_.forwardRef((e,t)=>(0,B.jsx)(G.span,{...e,ref:t,style:{..._f,...e.style}}));yf.displayName=vf;var bf=yf,xf=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Sf=[` `,`Enter`],Cf=`Select`,[wf,Tf,Ef]=_o(Cf),[Df,Of]=or(Cf,[Ef,Rc]),kf=Rc(),[Af,jf]=Df(Cf),[Mf,Nf]=Df(Cf),Pf=`SelectProvider`;function Ff(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=kf(t),[v,y]=_.useState(null),[b,x]=_.useState(null),[S,C]=_.useState(!1),w=yo(l),[T,E]=gr({prop:r,defaultProp:i??!1,onChange:a,caller:Cf}),[D,O]=gr({prop:o,defaultProp:s,onChange:c,caller:Cf}),k=_.useRef(null),A=v?!!m||!!v.closest(`form`):!0,[j,M]=_.useState(new Set),N=dr(),P=Array.from(j).map(e=>e.props.value).join(`;`),ee=_.useCallback(e=>{M(t=>new Set(t).add(e))},[]),F=_.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),I={required:p,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:N,value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:j,nativeSelectKey:P,isFormControl:A};return(0,B.jsx)(el,{...g,children:(0,B.jsx)(Af,{scope:t,...I,children:(0,B.jsx)(wf.Provider,{scope:t,children:(0,B.jsx)(Mf,{scope:t,onNativeOptionAdd:ee,onNativeOptionRemove:F,children:Fp(h)?h(I):n})})})})}Ff.displayName=Pf;var If=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,B.jsx)(Ff,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,B.jsxs)(B.Fragment,{children:[n,e?(0,B.jsx)(Pp,{__scopeSelect:t}):null]})})};If.displayName=Cf;var Lf=`SelectTrigger`,Rf=_.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=kf(n),o=jf(Lf,n),s=o.disabled||r,c=ar(t,o.onTriggerChange),l=Tf(n),u=_.useRef(`touch`),[d,f,p]=Lp(e=>{let t=l().filter(e=>!e.disabled),n=Rp(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,B.jsx)(tl,{asChild:!0,...a,children:(0,B.jsx)(G.button,{type:`button`,role:`combobox`,\"aria-controls\":o.open?o.contentId:void 0,\"aria-expanded\":o.open,\"aria-required\":o.required,\"aria-autocomplete\":`none`,dir:o.dir,\"data-state\":o.open?`open`:`closed`,disabled:s,\"data-disabled\":s?``:void 0,\"data-placeholder\":Ip(o.value)?``:void 0,...i,ref:c,onClick:W(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:W(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:W(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&xf.includes(e.key)&&(m(),e.preventDefault())})})})});Rf.displayName=Lf;var zf=`SelectValue`,Bf=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=jf(zf,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=ar(t,c.onValueNodeChange);cr(()=>{l(u)},[l,u]);let f=Ip(c.value);return(0,B.jsx)(G.span,{...s,asChild:f?!1:s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,B.jsx)(_.Fragment,{children:f?o:a},f?`placeholder`:`value`)})});Bf.displayName=zf;var Vf=`SelectIcon`,Hf=_.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,B.jsx)(G.span,{\"aria-hidden\":!0,...i,ref:t,children:r||`\u25BC`})});Hf.displayName=Vf;var Uf=`SelectPortal`,[Wf,Gf]=Df(Uf,{forceMount:void 0}),Kf=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,B.jsx)(Wf,{scope:e.__scopeSelect,forceMount:n,children:(0,B.jsx)(di,{asChild:!0,...r})})};Kf.displayName=Uf;var qf=`SelectContent`,Jf=_.forwardRef((e,t)=>{let n=Gf(qf,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=jf(qf,e.__scopeSelect),[o,s]=_.useState();return cr(()=>{s(new DocumentFragment)},[]),(0,B.jsx)(pi,{present:r||a.open,children:({present:e})=>e?(0,B.jsx)(tp,{...i,ref:t}):(0,B.jsx)(Yf,{...i,fragment:o})})});Jf.displayName=qf;var Yf=_.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?hn.createPortal((0,B.jsx)(Zf,{scope:n,children:(0,B.jsx)(wf.Slot,{scope:n,children:(0,B.jsx)(`div`,{ref:t,children:r})})}),i):null});Yf.displayName=`SelectContentFragment`;var Xf=10,[Zf,Qf]=Df(qf),$f=`SelectContentImpl`,ep=yr(`SelectContent.RemoveScroll`),tp=_.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,...v}=e,y=jf(qf,n),[b,x]=_.useState(null),[S,C]=_.useState(null),w=ar(t,x),[T,E]=_.useState(null),[D,O]=_.useState(null),k=Tf(n),[A,j]=_.useState(!1),M=_.useRef(!1);_.useEffect(()=>{if(b)return Ba(b)},[b]),xi();let N=_.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),P=_.useCallback(()=>N([T,b]),[N,T,b]);_.useEffect(()=>{A&&P()},[A,P]);let{onOpenChange:ee,triggerPointerDownPosRef:F}=y;_.useEffect(()=>{if(b){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||ee(!1),document.removeEventListener(`pointermove`,t),F.current=null};return F.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,ee,F]),_.useEffect(()=>{let e=()=>ee(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[ee]);let[I,te]=Lp(e=>{let t=k().filter(e=>!e.disabled),n=Rp(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ne=_.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&(E(e),r&&(M.current=!0))},[y.value]),re=_.useCallback(()=>b?.focus(),[b]),ie=_.useCallback((e,t,n)=>{let r=!M.current&&!n;(y.value!==void 0&&y.value===t||r)&&O(e)},[y.value]),ae=r===`popper`?ap:rp,L=ae===ap?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,B.jsx)(Zf,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ne,selectedItem:T,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:P,selectedItemText:D,position:r,isPositioned:A,searchRef:I,children:(0,B.jsx)(ja,{as:ep,allowPinchZoom:!0,children:(0,B.jsx)(Qr,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:W(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,B.jsx)(Br,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,B.jsx)(ae,{role:`listbox`,id:y.contentId,\"data-state\":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),...v,...L,onPlaced:()=>j(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,...v.style},onKeyDown:W(v.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>N(t)),e.preventDefault()}})})})})})})});tp.displayName=$f;var np=`SelectItemAlignedPosition`,rp=_.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=jf(qf,n),o=Qf(qf,n),[s,c]=_.useState(null),[l,u]=_.useState(null),d=ar(t,u),f=Tf(n),p=_.useRef(!1),m=_.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:v,focusSelectedItem:y}=o,b=_.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&v){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Xf,d=hf(a,[Xf,Math.max(Xf,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Xf,d=hf(a,[Xf,Math.max(Xf,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-Xf*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),_=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+_+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Xf,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+_+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${Xf}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,v,a.dir,r]);cr(()=>b(),[b]);let[x,S]=_.useState();return cr(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,B.jsx)(op,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:_.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]),children:(0,B.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,B.jsx)(G.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});rp.displayName=np;var ip=`SelectPopperPosition`,ap=_.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Xf,...a}=e,o=kf(n);return(0,B.jsx)(nl,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,\"--radix-select-content-transform-origin\":`var(--radix-popper-transform-origin)`,\"--radix-select-content-available-width\":`var(--radix-popper-available-width)`,\"--radix-select-content-available-height\":`var(--radix-popper-available-height)`,\"--radix-select-trigger-width\":`var(--radix-popper-anchor-width)`,\"--radix-select-trigger-height\":`var(--radix-popper-anchor-height)`}})});ap.displayName=ip;var[op,sp]=Df(qf,{}),cp=`SelectViewport`,lp=_.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Qf(cp,n),o=sp(cp,n),s=ar(t,a.onViewportChange),c=_.useRef(0);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,B.jsx)(wf.Slot,{scope:n,children:(0,B.jsx)(G.div,{\"data-radix-select-viewport\":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:W(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Xf*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});lp.displayName=cp;var up=`SelectGroup`,[dp,fp]=Df(up),pp=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=dr();return(0,B.jsx)(dp,{scope:n,id:i,children:(0,B.jsx)(G.div,{role:`group`,\"aria-labelledby\":i,...r,ref:t})})});pp.displayName=up;var mp=`SelectLabel`,hp=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=fp(mp,n);return(0,B.jsx)(G.div,{id:i.id,...r,ref:t})});hp.displayName=mp;var gp=`SelectItem`,[_p,vp]=Df(gp),yp=_.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=jf(gp,n),c=Qf(gp,n),l=s.value===r,[u,d]=_.useState(a??``),[f,p]=_.useState(!1),m=ar(t,Nr(e=>c.itemRefCallback?.(e,r,i))),h=dr(),g=_.useRef(`touch`),v=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};return(0,B.jsx)(_p,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:_.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,B.jsx)(wf.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,B.jsx)(G.div,{role:`option`,\"aria-labelledby\":h,\"data-highlighted\":f?``:void 0,\"aria-selected\":l&&f,\"data-state\":l?`checked`:`unchecked`,\"aria-disabled\":i||void 0,\"data-disabled\":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:W(o.onFocus,()=>p(!0)),onBlur:W(o.onBlur,()=>p(!1)),onClick:W(o.onClick,()=>{g.current!==`mouse`&&v()}),onPointerUp:W(o.onPointerUp,()=>{g.current===`mouse`&&v()}),onPointerDown:W(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:W(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:W(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:W(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(Sf.includes(e.key)&&v(),e.key===` `&&e.preventDefault())})})})})});yp.displayName=gp;var bp=`SelectItemText`,xp=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=jf(bp,n),s=Qf(bp,n),c=vp(bp,n),l=Nf(bp,n),[u,d]=_.useState(null),f=Nr(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=ar(t,d,c.onItemTextChange,f),m=u?.textContent,h=_.useMemo(()=>(0,B.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:v}=l;return cr(()=>(g(h),()=>v(h)),[g,v,h]),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(G.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Ip(o.value)?hn.createPortal(a.children,o.valueNode):null]})});xp.displayName=bp;var Sp=`SelectItemIndicator`,Cp=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return vp(Sp,n).isSelected?(0,B.jsx)(G.span,{\"aria-hidden\":!0,...r,ref:t}):null});Cp.displayName=Sp;var wp=`SelectScrollUpButton`,Tp=_.forwardRef((e,t)=>{let n=Qf(wp,e.__scopeSelect),r=sp(wp,e.__scopeSelect),[i,a]=_.useState(!1),o=ar(t,r.onScrollButtonChange);return cr(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,B.jsx)(Op,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Tp.displayName=wp;var Ep=`SelectScrollDownButton`,Dp=_.forwardRef((e,t)=>{let n=Qf(Ep,e.__scopeSelect),r=sp(Ep,e.__scopeSelect),[i,a]=_.useState(!1),o=ar(t,r.onScrollButtonChange);return cr(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,B.jsx)(Op,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Dp.displayName=Ep;var Op=_.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Qf(`SelectScrollButton`,n),o=_.useRef(null),s=Tf(n),c=_.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return _.useEffect(()=>()=>c(),[c]),cr(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,B.jsx)(G.div,{\"aria-hidden\":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:W(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:W(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:W(i.onPointerLeave,()=>{c()})})}),kp=`SelectSeparator`,Ap=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,B.jsx)(G.div,{\"aria-hidden\":!0,...r,ref:t})});Ap.displayName=kp;var jp=`SelectArrow`,Mp=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=kf(n);return Qf(jp,n).position===`popper`?(0,B.jsx)(rl,{...i,...r,ref:t}):null});Mp.displayName=jp;var Np=`SelectBubbleInput`,Pp=_.forwardRef(({__scopeSelect:e,...t},n)=>{let r=jf(Np,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=_.useRef(null),m=ar(n,p),h=i??``,g=gf(h),v=Array.from(d).some(e=>(e.props.value??``)===``);return _.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,B.jsxs)(G.select,{\"aria-hidden\":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{..._f,...t.style},ref:m,defaultValue:h,children:[Ip(i)&&!v?(0,B.jsx)(`option`,{value:``}):null,Array.from(d)]},f)});Pp.displayName=Np;function Fp(e){return typeof e==`function`}function Ip(e){return e===``||e===void 0}function Lp(e){let t=Nr(e),n=_.useRef(``),r=_.useRef(0),i=_.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=_.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Rp(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=zp(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function zp(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Bp=`__select-empty__`,Vp=e=>e===``?Bp:e,Hp=e=>e===Bp?``:e;function Up({value:e,onValueChange:t,options:n,placeholder:r=`Select\u2026`,disabled:i,autoFocus:a,mono:o,size:s=`sm`,className:c=`w-full`}){return(0,B.jsxs)(If,{value:Vp(e),onValueChange:e=>t(Hp(e)),disabled:i,children:[(0,B.jsxs)(Rf,{autoFocus:a,className:Yt(`flex cursor-pointer items-center gap-1.5 rounded-md border border-input bg-field text-left text-foreground`,s===`xs`?`h-6 px-2 text-xs`:`h-8 px-2.5 text-[13px]`,`transition-colors hover:border-muted-foreground focus:border-brand focus:outline-none disabled:pointer-events-none disabled:opacity-50`,`data-placeholder:text-muted-foreground/60`,o&&`font-mono`,c),children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,B.jsx)(Bf,{placeholder:r})}),(0,B.jsx)(Hf,{children:(0,B.jsx)(pe,{size:13,className:`shrink-0 text-muted-foreground/80`})})]}),(0,B.jsx)(Kf,{children:(0,B.jsx)(Jf,{position:`popper`,sideOffset:4,className:`z-90 max-h-64 min-w-(--radix-select-trigger-width) overflow-hidden rounded-md border border-input bg-popover shadow-xl animate-[fade-in_.1s_ease-out]`,children:(0,B.jsx)(lp,{className:`p-1`,children:n.map(e=>(0,B.jsxs)(yp,{value:Vp(e.value),disabled:e.disabled,className:Yt(`flex cursor-pointer select-none items-center gap-2 rounded px-2 py-1.5 text-[13px] text-foreground outline-none`,`data-highlighted:bg-accent data-disabled:pointer-events-none data-disabled:opacity-40`,o&&`font-mono`),children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:(0,B.jsx)(xp,{children:e.label??e.value})}),(0,B.jsx)(Cp,{children:(0,B.jsx)(fe,{size:12,className:`shrink-0 text-brand`})})]},e.value))})})})]})}var Wp=200,Gp=po;function Kp({open:e,onClose:t,title:n,children:r,footer:i,actions:a,flush:o,hideHeader:s,width:c=`w-[500px]`}){let[l,u]=(0,_.useState)(e),d=(0,_.useRef)(void 0);(0,_.useEffect)(()=>(e&&u(!0),()=>clearTimeout(d.current)),[e]);let f=()=>{l&&(u(!1),d.current=setTimeout(t,Wp))};return(0,B.jsx)(Ka,{open:e&&l,onOpenChange:e=>!e&&f(),children:(0,B.jsxs)(Qa,{children:[(0,B.jsx)(eo,{className:`fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-[fade-in_.15s_ease-out] data-[state=closed]:animate-[fade-out_.2s_ease-in]`}),(0,B.jsxs)(io,{className:Yt(`fixed inset-y-0 right-0 z-50 flex max-w-[92vw] flex-col border-l border-border bg-background shadow-2xl`,`transition-[width] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]`,`data-[state=open]:animate-[sheet-in_.25s_cubic-bezier(0.16,1,0.3,1)] data-[state=closed]:animate-[sheet-out_.2s_ease-in]`,`focus:outline-none`,c),children:[s?(0,B.jsx)(co,{className:`sr-only`,children:n}):(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-border px-5 py-3.5`,children:[(0,B.jsx)(co,{className:`text-sm font-medium text-foreground`,children:n}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,children:[a,(0,B.jsx)(po,{className:`rounded p-0.5 text-muted-foreground/80 hover:bg-accent hover:text-foreground`,children:(0,B.jsx)(Ft,{size:16})})]})]}),(0,B.jsx)(`div`,{className:Yt(`min-h-0 flex-1`,o?`overflow-hidden`:`overflow-y-auto px-5 py-4`),children:r}),i&&(0,B.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 border-t border-border bg-card px-5 py-3`,children:i})]})]})})}function qp(){return(0,B.jsx)(`div`,{className:`flex items-center justify-center py-16 text-muted-foreground/80`,children:(0,B.jsx)(`div`,{className:`size-5 animate-spin rounded-full border-2 border-input border-t-brand`})})}function Jp({checked:e,onChange:t,disabled:n}){return(0,B.jsx)(`button`,{type:`button`,role:`switch`,\"aria-checked\":e,disabled:n,onClick:()=>t?.(!e),className:Yt(`relative h-4.5 w-8 shrink-0 rounded-full transition-colors`,e?`bg-brand`:`bg-muted`,n&&`pointer-events-none opacity-40`),children:(0,B.jsx)(`span`,{className:Yt(`absolute left-0 top-0.5 size-3.5 rounded-full bg-white transition-transform`,e?`translate-x-4`:`translate-x-0.5`)})})}function Yp({children:e,className:t}){return(0,B.jsx)(`table`,{className:Yt(`w-full border-collapse text-[13px]`,t),children:e})}function Xp({children:e}){return(0,B.jsx)(`thead`,{className:`sticky top-0 z-10 bg-card`,children:e})}function Z({className:e,...t}){return(0,B.jsx)(`th`,{className:Yt(`whitespace-nowrap border-b border-border px-3 py-2 text-left font-medium text-muted-foreground`,e),...t})}function Zp({className:e,...t}){return(0,B.jsx)(`tr`,{className:Yt(`group border-b border-border/60 transition-colors hover:bg-accent/30`,e),...t})}function Q({className:e,...t}){return(0,B.jsx)(`td`,{className:Yt(`px-3 py-1.5 align-middle`,e),...t})}function Qp({tabs:e,active:t,onSelect:n}){return(0,B.jsx)(`div`,{className:`flex gap-5 border-b border-border`,children:e.map(e=>(0,B.jsx)(`button`,{onClick:()=>n(e.id),className:`-mb-px border-b-2 pb-2 text-[13px] transition-colors `+(t===e.id?`border-foreground font-medium text-foreground`:`border-transparent text-muted-foreground hover:text-foreground`),children:e.label},e.id))})}function $p({className:e,...t}){return(0,B.jsx)(`textarea`,{className:Yt(`w-full rounded-md border border-input bg-field p-2.5 font-mono text-[13px] text-foreground`,`placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none disabled:opacity-50`,e),...t})}var[em,tm]=or(`Tooltip`,[Rc]),nm=Rc(),rm=`TooltipProvider`,im=700,am=`tooltip.open`,[om,sm]=em(rm),cm=e=>{let{__scopeTooltip:t,delayDuration:n=im,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,B.jsx)(om,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};cm.displayName=rm;var lm=`Tooltip`,[um,dm]=em(lm),fm=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=sm(lm,e.__scopeTooltip),l=nm(t),[u,d]=_.useState(null),f=dr(),p=_.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=_.useRef(!1),[v,y]=gr({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(am))):c.onClose(),a?.(e)},caller:lm}),b=_.useMemo(()=>v?g.current?`delayed-open`:`instant-open`:`closed`,[v]),x=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,y(!0)},[y]),S=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),C=_.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,y(!0),p.current=0},h)},[h,y]);return _.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,B.jsx)(el,{...l,children:(0,B.jsx)(um,{scope:t,contentId:f,open:v,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:_.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:x,onClose:S,disableHoverableContent:m,children:n})})};fm.displayName=lm;var pm=`TooltipTrigger`,mm=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=dm(pm,n),a=sm(pm,n),o=nm(n),s=ar(t,_.useRef(null),i.onTriggerChange),c=_.useRef(!1),l=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,B.jsx)(tl,{asChild:!0,...o,children:(0,B.jsx)(G.button,{\"aria-describedby\":i.open?i.contentId:void 0,\"data-state\":i.stateAttribute,...r,ref:s,onPointerMove:W(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:W(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:W(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:W(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:W(e.onBlur,i.onClose),onClick:W(e.onClick,i.onClose)})})});mm.displayName=pm;var hm=`TooltipPortal`,[gm,_m]=em(hm,{forceMount:void 0}),vm=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=dm(hm,t);return(0,B.jsx)(gm,{scope:t,forceMount:n,children:(0,B.jsx)(pi,{present:n||a.open,children:(0,B.jsx)(di,{asChild:!0,container:i,children:r})})})};vm.displayName=hm;var ym=`TooltipContent`,bm=_.forwardRef((e,t)=>{let n=_m(ym,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=dm(ym,e.__scopeTooltip);return(0,B.jsx)(pi,{present:r||o.open,children:o.disableHoverableContent?(0,B.jsx)(Tm,{side:i,...a,ref:t}):(0,B.jsx)(xm,{side:i,...a,ref:t})})}),xm=_.forwardRef((e,t)=>{let n=dm(ym,e.__scopeTooltip),r=sm(ym,e.__scopeTooltip),i=_.useRef(null),a=ar(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=km(r,Om(r,n.getBoundingClientRect())),a=Am(t.getBoundingClientRect()),o=Mm([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!jm(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,B.jsx)(Tm,{...e,ref:a})}),[Sm,Cm]=em(lm,{isInside:!1}),wm=xr(`TooltipContent`),Tm=_.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,\"aria-label\":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=dm(ym,n),l=nm(n),{onClose:u}=c;return _.useEffect(()=>(document.addEventListener(am,u),()=>document.removeEventListener(am,u)),[u]),_.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,B.jsx)(Br,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,B.jsxs)(nl,{\"data-state\":c.stateAttribute,...l,...s,ref:t,style:{...s.style,\"--radix-tooltip-content-transform-origin\":`var(--radix-popper-transform-origin)`,\"--radix-tooltip-content-available-width\":`var(--radix-popper-available-width)`,\"--radix-tooltip-content-available-height\":`var(--radix-popper-available-height)`,\"--radix-tooltip-trigger-width\":`var(--radix-popper-anchor-width)`,\"--radix-tooltip-trigger-height\":`var(--radix-popper-anchor-height)`},children:[(0,B.jsx)(wm,{children:r}),(0,B.jsx)(Sm,{scope:n,isInside:!0,children:(0,B.jsx)(bf,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});bm.displayName=ym;var Em=`TooltipArrow`,Dm=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=nm(n);return Cm(Em,n).isInside?null:(0,B.jsx)(rl,{...i,...r,ref:t})});Dm.displayName=Em;function Om(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function km(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Am(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function jm(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Mm(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Nm(t)}function Nm(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Pm=cm,Fm=fm,Im=mm,Lm=vm,Rm=bm;function zm({content:e,children:t,side:n=`top`}){return(0,B.jsx)(Pm,{delayDuration:250,children:(0,B.jsxs)(Fm,{children:[(0,B.jsx)(Im,{asChild:!0,children:t}),(0,B.jsx)(Lm,{children:(0,B.jsx)(Rm,{side:n,sideOffset:5,className:`z-[60] max-w-[300px] rounded-md border border-input bg-field px-2 py-1 text-xs text-foreground shadow-xl animate-[fade-in_.1s_ease-out]`,children:e})})]})})}var Bm=e=>String(e).padStart(2,`0`),Vm=e=>e.toLocaleDateString(void 0,{day:`2-digit`,month:`short`,year:`2-digit`}),Hm=e=>`${Bm(e.getHours())}:${Bm(e.getMinutes())}:${Bm(e.getSeconds())}`,Um=e=>{let t=e.toISOString();return`${t.slice(8,10)} ${e.toLocaleDateString(`en`,{month:`short`,timeZone:`UTC`})} ${t.slice(2,4)} ${t.slice(11,19)}`};function Wm(e){let t=e.getTime()-Date.now(),n=Math.abs(t);if(n<1e4)return`a few seconds ago`;for(let[e,r]of[[31536e6,`year`],[2592e6,`month`],[864e5,`day`],[36e5,`hour`],[6e4,`minute`],[1e3,`second`]])if(n>=e){let i=Math.round(n/e);return t<0?`${i} ${r}${i>1?`s`:``} ago`:`in ${i} ${r}${i>1?`s`:``}`}return`just now`}function Gm({label:e,value:t}){return(0,B.jsxs)(`div`,{className:`flex items-baseline gap-2 font-mono text-[11px]`,children:[(0,B.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e}),(0,B.jsx)(`span`,{className:`min-w-4 flex-1 border-b border-dotted border-muted-foreground/30`}),(0,B.jsx)(`span`,{className:`shrink-0 tabular-nums text-foreground/90`,children:t})]})}function Km({value:e,format:t=`datetime`,className:n=``}){if(e==null||e===``)return(0,B.jsx)(`span`,{className:n,children:`\u2014`});let r=e instanceof Date?e:new Date(e);if(Number.isNaN(r.getTime()))return(0,B.jsx)(`span`,{className:n,children:String(e)});let i=t===`time`?Hm(r):t===`date`?Vm(r):t===`relative`?Wm(r):`${Vm(r)} ${Hm(r)}`,a=Intl.DateTimeFormat().resolvedOptions().timeZone;return(0,B.jsx)(zm,{side:`top`,content:(0,B.jsxs)(`div`,{className:`w-72 space-y-1 p-1`,children:[(0,B.jsx)(Gm,{label:`UTC`,value:Um(r)}),(0,B.jsx)(Gm,{label:a,value:`${Vm(r)} ${Hm(r)}`}),(0,B.jsx)(Gm,{label:`Relative`,value:Wm(r)}),(0,B.jsx)(Gm,{label:`Timestamp`,value:r.getTime()})]}),children:(0,B.jsx)(`span`,{className:`cursor-default whitespace-nowrap tabular-nums underline decoration-dotted decoration-muted-foreground/40 underline-offset-2 `+n,children:i})})}function qm({value:e}){return e==null?(0,B.jsx)(`span`,{className:`select-none text-muted-foreground/60`,children:`NULL`}):e===``?(0,B.jsx)(`span`,{className:`select-none italic text-muted-foreground/60`,children:`empty`}):typeof e==`boolean`?(0,B.jsx)(`span`,{className:`text-info`,children:String(e)}):typeof e==`object`?(0,B.jsx)(`span`,{className:`text-warning/90`,children:JSON.stringify(e)}):(0,B.jsx)(B.Fragment,{children:String(e)})}function Jm(e){if(e==null)return;let t=typeof e==`object`?JSON.stringify(e):String(e);return t.length>40?t:void 0}var $=({children:e})=>(0,B.jsx)(`code`,{className:`rounded bg-accent px-1 py-px font-mono text-[12px] text-foreground/90`,children:e}),Ym=/auth\\.(uid|jwt|role|email)\\(\\)/i,Xm=/\\(\\s*select\\s+(auth\\.|current_setting)/i;async function Zm(){let[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m]=await Promise.allSettled([N.sql(`select c.relname as name, c.relrowsecurity as rls,\n exists(select 1 from pg_index i where i.indrelid = c.oid and i.indisprimary) as has_pk,\n (select count(*)::int from pg_policies p where p.schemaname = 'public' and p.tablename = c.relname) as policies\n from pg_class c join pg_namespace n on n.oid = c.relnamespace\n where n.nspname = 'public' and c.relkind = 'r' order by c.relname`),N.sql(`select c.relname as name from pg_class c join pg_namespace n on n.oid = c.relnamespace\n where n.nspname = 'public' and c.relkind = 'v'\n and not coalesce('security_invoker=true' = any(c.reloptions) or 'security_invoker=on' = any(c.reloptions), false)\n order by c.relname`),N.sql(`select con.conname as name, cl.relname as tbl, a.attname as col\n from pg_constraint con\n join pg_class cl on cl.oid = con.conrelid\n join pg_namespace n on n.oid = cl.relnamespace\n join pg_attribute a on a.attrelid = con.conrelid and a.attnum = con.conkey[1]\n where con.contype = 'f' and n.nspname = 'public'\n and not exists (select 1 from pg_index i where i.indrelid = con.conrelid and i.indkey[0] = con.conkey[1])\n order by cl.relname, con.conname`),N.sql(`select c.relname as name from pg_class c join pg_namespace n on n.oid = c.relnamespace\n where n.nspname = 'public' and c.relkind in ('v','m') and pg_get_viewdef(c.oid) ilike '%auth.users%'\n order by c.relname`),N.sql(`select tablename as tbl, policyname as name, cmd, permissive, roles::text[] as roles,\n coalesce(qual, '') as qual, coalesce(with_check, '') as check\n from pg_policies where schemaname = 'public' order by tablename, policyname`),N.sql(`select cl.relname as tbl, array_agg(ic.relname order by ic.relname) as idxs\n from pg_index i\n join pg_class cl on cl.oid = i.indrelid\n join pg_class ic on ic.oid = i.indexrelid\n join pg_namespace n on n.oid = cl.relnamespace\n where n.nspname = 'public'\n group by cl.relname, i.indkey, i.indclass,\n coalesce(pg_get_expr(i.indexprs, i.indrelid), ''), coalesce(pg_get_expr(i.indpred, i.indrelid), '')\n having count(*) > 1`),N.sql(`select p.proname as name, p.prosecdef as secdef,\n (p.proconfig is null or not exists (select 1 from unnest(p.proconfig) cfg where cfg like 'search_path=%')) as mutable_path,\n has_function_privilege('anon', p.oid, 'execute') as anon_exec,\n has_function_privilege('authenticated', p.oid, 'execute') as auth_exec\n from pg_proc p join pg_namespace n on n.oid = p.pronamespace\n where n.nspname = 'public' and p.prokind = 'f' order by p.proname`),N.sql(`select e.extname as name from pg_extension e join pg_namespace n on n.oid = e.extnamespace\n where n.nspname = 'public' order by e.extname`),N.sql(`select c.relname as name, c.relkind as kind from pg_class c join pg_namespace n on n.oid = c.relnamespace\n where n.nspname = 'public' and c.relkind in ('m','f') order by c.relname`),N.sql(`select table_name as tbl, column_name as col, udt_name as typ from information_schema.columns\n where table_schema = 'public' and udt_name in\n ('regclass','regcollation','regconfig','regdictionary','regnamespace','regoper','regoperator','regproc','regprocedure','regrole')\n order by table_name, column_name`),N.sql(`select table_name as tbl, column_name as col from information_schema.columns\n where table_schema = 'public'\n and column_name ~* '(password|passwd|secret|api_key|apikey|access_token|refresh_token|private_key|ssn|credit_card)'\n order by table_name, column_name`),N.sql(`select c.relname as name from pg_class c join pg_namespace n on n.oid = c.relnamespace\n where n.nspname = 'pgmq' and c.relkind = 'r' and c.relname like 'q\\\\_%'\n and (has_table_privilege('anon', c.oid, 'select') or has_table_privilege('authenticated', c.oid, 'select'))\n order by c.relname`),N.sql(`select id from storage.buckets where public order by id`),N.sql(`select policyname as name, cmd, roles::text[] as roles, coalesce(qual, '') as qual\n from pg_policies where schemaname = 'storage' and tablename = 'objects'`),N.authConfig()]);if(e.status===`rejected`||!e.value.ok){let t=e.status===`rejected`?String(e.reason?.message??e.reason):e.value.error??`catalog unreachable`;throw Error(t)}let h=[],g=e=>e.status===`fulfilled`&&e.value.ok?e.value.rows??[]:[];for(let t of g(e))t.rls?t.policies===0&&h.push({id:`0008:${t.name}`,code:`0008`,category:`security`,level:`warning`,title:`RLS Enabled No Policy`,entity:`public.${t.name}`,entityKind:`table`,issue:(0,B.jsxs)(B.Fragment,{children:[`Table `,(0,B.jsxs)($,{children:[`public.`,t.name]}),` has RLS enabled but no policies \u2014 anon and authenticated queries return zero rows, which usually surfaces as an app bug.`]}),description:`Detects tables with Row Level Security enabled but no policy granting any access.`,action:{label:`Create policy`,go:()=>z(`table`,t.name)}}):(h.push({id:`0013:${t.name}`,code:`0013`,category:`security`,level:`critical`,title:`RLS Disabled in Public`,entity:`public.${t.name}`,entityKind:`table`,issue:(0,B.jsxs)(B.Fragment,{children:[`Table `,(0,B.jsxs)($,{children:[`public.`,t.name]}),` is exposed through the Data API with Row Level Security disabled \u2014 anon and authenticated can read and write every row.`]}),description:`Detects tables in the public schema without RLS. Public-schema tables are reachable over /rest/v1, so RLS is the row-level access control.`,action:{label:`Enable RLS`,go:()=>z(`table`,t.name)}}),t.policies>0&&h.push({id:`0007:${t.name}`,code:`0007`,category:`security`,level:`critical`,title:`Policy Exists RLS Disabled`,entity:`public.${t.name}`,entityKind:`table`,issue:(0,B.jsxs)(B.Fragment,{children:[`Table `,(0,B.jsxs)($,{children:[`public.`,t.name]}),` has `,t.policies,` RLS `,t.policies===1?`policy`:`policies`,` but RLS itself is disabled \u2014 the policies are written but not enforced.`]}),description:`Detects tables where policies exist while row level security is disabled, so none of them apply.`,action:{label:`Enable RLS`,go:()=>z(`table`,t.name)}})),t.has_pk||h.push({id:`0004:${t.name}`,code:`0004`,category:`performance`,level:`warning`,title:`No Primary Key`,entity:`public.${t.name}`,entityKind:`table`,issue:(0,B.jsxs)(B.Fragment,{children:[`Table `,(0,B.jsxs)($,{children:[`public.`,t.name]}),` has no primary key \u2014 rows can't be uniquely addressed, so updates and deletes through the API and the table editor are disabled.`]}),description:`Detects tables without a primary key. Replication, upserts, and row addressing all require one.`,action:{label:`Open table`,go:()=>z(`table`,t.name)}});for(let e of g(t))h.push({id:`0010:${e.name}`,code:`0010`,category:`security`,level:`critical`,title:`Security Definer View`,entity:`public.${e.name}`,entityKind:`view`,issue:(0,B.jsxs)(B.Fragment,{children:[`View `,(0,B.jsxs)($,{children:[`public.`,e.name]}),` is defined with the SECURITY DEFINER property.`]}),description:`Detects views defined with the SECURITY DEFINER property. These views enforce Postgres permissions and row level security policies (RLS) of the view creator, rather than that of the querying user.`,action:{label:`Review view`,go:()=>z(`table`,e.name)}});for(let e of g(r))h.push({id:`0002:${e.name}`,code:`0002`,category:`security`,level:`critical`,title:`Auth Users Exposed`,entity:`public.${e.name}`,entityKind:`view`,issue:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)($,{children:[`public.`,e.name]}),` selects from `,(0,B.jsx)($,{children:`auth.users`}),` and is exposed through the Data API \u2014 user records (emails, metadata) may leak to anon/authenticated.`]}),description:`Detects views or materialized views in an API-exposed schema that read auth.users.`,action:{label:`Review view`,go:()=>z(`table`,e.name)}});for(let e of g(n))h.push({id:`0001:${e.name}`,code:`0001`,category:`performance`,level:`info`,title:`Unindexed foreign keys`,entity:`public.${e.tbl}`,entityKind:`table`,issue:(0,B.jsxs)(B.Fragment,{children:[`Table `,(0,B.jsxs)($,{children:[`public.`,e.tbl]}),` has a foreign key `,(0,B.jsx)($,{children:e.name}),` on `,(0,B.jsx)($,{children:e.col}),` without a covering index. This can lead to suboptimal query performance.`]}),description:`Identifies foreign key constraints without a covering index, which can impact database performance.`,action:{label:`Create an index`,go:()=>z(`database`,`indexes`)}});let _=g(i),v=new Map;for(let e of _){let t=`${e.qual} ${e.check}`;if((Ym.test(t)||/current_setting\\(/i.test(t))&&!Xm.test(t)&&h.push({id:`0003:${e.tbl}:${e.name}`,code:`0003`,category:`performance`,level:`warning`,title:`Auth RLS Initialization Plan`,entity:`public.${e.tbl}`,entityKind:`table`,issue:(0,B.jsxs)(B.Fragment,{children:[`Policy `,(0,B.jsx)($,{children:e.name}),` on `,(0,B.jsxs)($,{children:[`public.`,e.tbl]}),` re-evaluates `,(0,B.jsx)($,{children:`auth.<function>()`}),` or`,` `,(0,B.jsx)($,{children:`current_setting()`}),` for each row. Replace `,(0,B.jsx)($,{children:`auth.uid()`}),` with `,(0,B.jsx)($,{children:`(select auth.uid())`}),` so it runs once per query.`]}),description:`Detects if calls to current_setting() and auth.<function>() in RLS policies are being unnecessarily re-evaluated for each row.`,action:{label:`View policies`,go:()=>z(`table`,e.tbl)}}),/user_metadata|raw_user_meta_data/i.test(t)&&h.push({id:`0015:${e.tbl}:${e.name}`,code:`0015`,category:`security`,level:`critical`,title:`RLS References User Metadata`,entity:`public.${e.tbl}`,entityKind:`table`,issue:(0,B.jsxs)(B.Fragment,{children:[`Policy `,(0,B.jsx)($,{children:e.name}),` on `,(0,B.jsxs)($,{children:[`public.`,e.tbl]}),` references user metadata, which end users can edit about themselves \u2014 it must never gate access.`]}),description:`Detects RLS policies that reference user_metadata; use app_metadata or your own tables for authorization data.`,action:{label:`View policies`,go:()=>z(`table`,e.tbl)}}),String(e.permissive).toUpperCase()===`PERMISSIVE`&&[`INSERT`,`UPDATE`,`DELETE`,`ALL`].includes(e.cmd?.toUpperCase())&&(e.qual.trim()===`true`||e.check.trim()===`true`)&&h.push({id:`0024:${e.tbl}:${e.name}`,code:`0024`,category:`security`,level:`warning`,title:`Permissive RLS Policy`,entity:`public.${e.tbl}`,entityKind:`table`,issue:(0,B.jsxs)(B.Fragment,{children:[`Policy `,(0,B.jsx)($,{children:e.name}),` on `,(0,B.jsxs)($,{children:[`public.`,e.tbl]}),` allows `,e.cmd,` with a bare `,(0,B.jsx)($,{children:`true`}),` expression \u2014 every matching role can write unconditionally.`]}),description:`Detects write policies whose expression is a constant true, granting unrestricted access.`,action:{label:`View policies`,go:()=>z(`table`,e.tbl)}}),String(e.permissive).toUpperCase()===`PERMISSIVE`)for(let t of Lt(e.roles)){let n=`${e.tbl}|${e.cmd}|${t}`;v.set(n,(v.get(n)??0)+1)}}for(let[e,t]of v)if(t>1){let[n,r,i]=e.split(`|`);h.push({id:`0006:${e}`,code:`0006`,category:`performance`,level:`warning`,title:`Multiple Permissive Policies`,entity:`public.${n}`,entityKind:`table`,issue:(0,B.jsxs)(B.Fragment,{children:[`Table `,(0,B.jsxs)($,{children:[`public.`,n]}),` has `,t,` permissive policies for role `,(0,B.jsx)($,{children:i}),` on `,r,` \u2014 every policy runs for every relevant query.`]}),description:`Detects multiple permissive policies for the same role and command, which multiplies policy evaluation cost.`,action:{label:`View policies`,go:()=>z(`table`,n)}})}for(let e of g(a)){let t=Lt(e.idxs);h.push({id:`0009:${e.tbl}:${t.join(`,`)}`,code:`0009`,category:`performance`,level:`warning`,title:`Duplicate Index`,entity:`public.${e.tbl}`,entityKind:`table`,issue:(0,B.jsxs)(B.Fragment,{children:[`Table `,(0,B.jsxs)($,{children:[`public.`,e.tbl]}),` has identical indexes: `,(0,B.jsx)($,{children:t.join(`, `)}),` \u2014 every extra copy slows writes for no read benefit.`]}),description:`Detects indexes with identical columns, operator classes, expressions and predicates.`,action:{label:`View indexes`,go:()=>z(`database`,`indexes`)}})}for(let e of g(o))e.mutable_path&&h.push({id:`0011:${e.name}`,code:`0011`,category:`security`,level:`warning`,title:`Function Search Path Mutable`,entity:`public.${e.name}()`,entityKind:`function`,issue:(0,B.jsxs)(B.Fragment,{children:[`Function `,(0,B.jsxs)($,{children:[`public.`,e.name,`()`]}),` does not pin `,(0,B.jsx)($,{children:`search_path`}),` \u2014 a caller-controlled search_path can make it resolve unexpected objects. Add `,(0,B.jsx)($,{children:`set search_path = ''`}),` (or the schemas it needs).`]}),description:`Detects functions without a fixed search_path configuration parameter.`,action:{label:`View functions`,go:()=>z(`database`,`functions`)}}),e.secdef&&e.anon_exec&&h.push({id:`0028:${e.name}`,code:`0028`,category:`security`,level:`warning`,title:`Anon Can Execute SECURITY DEFINER Function`,entity:`public.${e.name}()`,entityKind:`function`,issue:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)($,{children:[`public.`,e.name,`()`]}),` runs with its owner's privileges and is executable by `,(0,B.jsx)($,{children:`anon`}),` \u2014 any unauthenticated caller inherits those rights for the duration of the call.`]}),description:`Detects SECURITY DEFINER functions executable by the anon role.`,action:{label:`View functions`,go:()=>z(`database`,`functions`)}}),e.secdef&&e.auth_exec&&h.push({id:`0029:${e.name}`,code:`0029`,category:`security`,level:`info`,title:`Signed-In Users Can Execute SECURITY DEFINER Function`,entity:`public.${e.name}()`,entityKind:`function`,issue:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)($,{children:[`public.`,e.name,`()`]}),` runs with its owner's privileges and is executable by `,(0,B.jsx)($,{children:`authenticated`}),`. Often intentional (policy helpers) \u2014 keep the body minimal and pin `,(0,B.jsx)($,{children:`search_path`}),`.`]}),description:`Detects SECURITY DEFINER functions executable by signed-in users.`,action:{label:`View functions`,go:()=>z(`database`,`functions`)}});for(let e of g(s))h.push({id:`0014:${e.name}`,code:`0014`,category:`security`,level:`warning`,title:`Extension in Public`,entity:`public.${e.name}`,entityKind:`extension`,issue:(0,B.jsxs)(B.Fragment,{children:[`Extension `,(0,B.jsx)($,{children:e.name}),` is installed in the public schema. Move it to another schema (e.g.`,` `,(0,B.jsx)($,{children:`extensions`}),`).`]}),description:`Detects extensions installed in the public schema.`,action:{label:`Open SQL editor`,go:()=>z(`sql`)}});for(let e of g(c)){let t=e.kind===`m`;h.push({id:`${t?`0016`:`0017`}:${e.name}`,code:t?`0016`:`0017`,category:`security`,level:`critical`,title:t?`Materialized View in API`:`Foreign Table in API`,entity:`public.${e.name}`,entityKind:`view`,issue:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)($,{children:[`public.`,e.name]}),` is a `,t?`materialized view`:`foreign table`,` in an API-exposed schema \u2014`,` `,t?`materialized views`:`foreign tables`,` do not enforce RLS, so every role can read all of it.`]}),description:t?`Detects materialized views in API-exposed schemas; they cannot have RLS policies.`:`Detects foreign tables in API-exposed schemas; they do not respect RLS.`,action:{label:`Open SQL editor`,go:()=>z(`sql`)}})}for(let e of g(l))h.push({id:`0018:${e.tbl}.${e.col}`,code:`0018`,category:`performance`,level:`info`,title:`Unsupported reg types`,entity:`public.${e.tbl}`,entityKind:`table`,issue:(0,B.jsxs)(B.Fragment,{children:[`Column `,(0,B.jsx)($,{children:e.col}),` on `,(0,B.jsxs)($,{children:[`public.`,e.tbl]}),` uses `,(0,B.jsx)($,{children:e.typ}),` \u2014 reg* types store OIDs that break across dump/restore and upgrades.`]}),description:`Detects columns using reg* types (except regtype/regrole handled by tooling), which are not supported by backups and upgrades.`,action:{label:`Open table`,go:()=>z(`table`,e.tbl)}});for(let e of g(u))h.push({id:`0023:${e.tbl}.${e.col}`,code:`0023`,category:`security`,level:`info`,title:`Sensitive Columns Exposed`,entity:`public.${e.tbl}`,entityKind:`table`,issue:(0,B.jsxs)(B.Fragment,{children:[`Column `,(0,B.jsx)($,{children:e.col}),` on `,(0,B.jsxs)($,{children:[`public.`,e.tbl]}),` looks like it holds a secret. Public-schema columns are selectable through the Data API \u2014 keep secrets out of exposed tables or lock them down with policies/column grants.`]}),description:`Heuristically detects likely-sensitive column names (password, token, api_key, \u2026) in API-exposed tables.`,action:{label:`Open table`,go:()=>z(`table`,e.tbl)}});for(let e of g(d))h.push({id:`0019:${e.name}`,code:`0019`,category:`security`,level:`critical`,title:`Insecure Queue Exposed`,entity:`pgmq.${e.name}`,entityKind:`queue`,issue:(0,B.jsxs)(B.Fragment,{children:[`Queue table `,(0,B.jsxs)($,{children:[`pgmq.`,e.name]}),` is readable by anon/authenticated \u2014 queue payloads often carry internal data. Revoke those grants.`]}),description:`Detects pgmq queue tables granted to API roles.`,action:{label:`Open queues`,go:()=>z(`automations`,`queues`)}});{let e=g(f);if(g(p).some(e=>[`SELECT`,`ALL`].includes(e.cmd?.toUpperCase())&&e.roles.some(e=>e===`anon`||e===`public`)&&!/bucket_id/.test(e.qual)))for(let t of e)h.push({id:`0025:${t.id}`,code:`0025`,category:`security`,level:`info`,title:`Public Bucket Allows Listing`,entity:`storage.${t.id}`,entityKind:`storage`,issue:(0,B.jsxs)(B.Fragment,{children:[`Bucket `,(0,B.jsx)($,{children:t.id}),` is public and an anon SELECT policy on `,(0,B.jsx)($,{children:`storage.objects`}),` has no`,` `,(0,B.jsx)($,{children:`bucket_id`}),` filter \u2014 anyone can enumerate its file names.`]}),description:`Detects public buckets whose object-listing policy is not scoped, allowing enumeration of contents.`,action:{label:`Open bucket policies`,go:()=>z(`storage`,t.id)}})}m.status===`fulfilled`&&m.value.settings?.anonymousUsers&&h.push({id:`0012`,code:`0012`,category:`security`,level:`info`,title:`Auth Allow Anonymous Sign-ins`,entity:`Auth`,entityKind:`auth`,issue:(0,B.jsxs)(B.Fragment,{children:[`Anonymous sign-ins are enabled \u2014 anyone can mint an `,(0,B.jsx)($,{children:`authenticated`}),` session without credentials. Make sure RLS policies distinguish anonymous users where it matters.`]}),description:`Detects when anonymous sign-ins are enabled, since anonymous users hold the authenticated role.`,action:{label:`Open auth settings`,go:()=>z(`auth`,`providers`)}});let y={critical:0,warning:1,info:2};return h.sort((e,t)=>y[e.level]-y[t.level]||e.code.localeCompare(t.code)||e.entity.localeCompare(t.entity))}var Qm=null;function $m(){Qm?.()}var eh={critical:`red`,warning:`amber`,info:`neutral`},th={table:Et,view:ke,function:wt,auth:Ge,storage:ze,queue:Ue,extension:nt};function nh({f:e}){let t=e.level===`critical`?`text-destructive`:e.level===`warning`?`text-warning`:`text-muted-foreground/70`;return e.category===`security`?(0,B.jsx)(bt,{size:15,className:t}):(0,B.jsx)(R,{size:15,className:t})}function rh(){let[e,t]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let e=!0,n=()=>Zm().then(n=>{e&&t(n.some(e=>e.level===`critical`)?`critical`:n.some(e=>e.level===`warning`)?`warning`:n.length?`info`:null)},()=>{});n();let r=setInterval(n,3e5);return()=>{e=!1,clearInterval(r)}},[]),(0,B.jsxs)(`button`,{title:`Advisor`,onClick:$m,className:`relative flex size-7 items-center justify-center rounded-md border border-input text-muted-foreground transition-colors hover:border-muted-foreground hover:bg-accent hover:text-foreground`,children:[(0,B.jsx)(qe,{size:14}),e&&e!==`info`&&(0,B.jsx)(`span`,{className:`absolute -right-0.5 -top-0.5 size-2 rounded-full ring-2 ring-card `+(e===`critical`?`bg-destructive`:`bg-warning`)})]})}function ih(){let[e,t]=(0,_.useState)(!1);return(0,_.useEffect)(()=>(Qm=()=>t(!0),()=>{Qm=null}),[]),e?(0,B.jsx)(ah,{onClose:()=>t(!1)}):null}function ah({onClose:e}){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(`all`),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(null),d=(0,_.useCallback)(()=>{Zm().then(e=>{i(null),n(e)},e=>{i(e?.message??`Advisor could not read the catalog`),n([])})},[]);(0,_.useEffect)(()=>{d()},[d]);let f=(t??[]).filter(e=>(a===`all`||e.category===a)&&(!s||e.level===s));return(0,B.jsx)(Kp,{open:!0,onClose:e,flush:!0,hideHeader:!0,width:`w-135`,title:`Advisor`,children:(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-2.5 border-b border-border px-4`,children:[l?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{className:`rounded p-1 text-muted-foreground/80 hover:bg-accent hover:text-foreground`,onClick:()=>u(null),children:(0,B.jsx)(me,{size:16})}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`p`,{className:`truncate text-[14px] font-medium text-foreground`,children:l.title}),(0,B.jsx)(`p`,{className:`truncate font-mono text-[11px] text-muted-foreground/70`,children:l.entity})]}),(0,B.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground/50`,children:l.code}),(0,B.jsx)(V,{variant:eh[l.level],children:l.level.toUpperCase()})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(qe,{size:15,className:`text-muted-foreground`}),(0,B.jsx)(`p`,{className:`flex-1 text-[14px] font-medium text-foreground`,children:`Advisor`})]}),(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(`button`,{className:`rounded p-1 text-muted-foreground/80 hover:bg-accent hover:text-foreground`,children:`\u2715`})})]}),l?(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-5`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`mb-1.5 text-[13px] font-semibold text-foreground`,children:`Entity`}),(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-md border border-border bg-card px-2.5 py-1.5 font-mono text-[12px] text-foreground/90`,children:[(()=>{let e=th[l.entityKind];return(0,B.jsx)(e,{size:12,className:`text-muted-foreground`})})(),l.entity]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`mb-1.5 text-[13px] font-semibold text-foreground`,children:`Issue`}),(0,B.jsx)(`p`,{className:`text-[13px] leading-relaxed text-muted-foreground`,children:l.issue})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`mb-1.5 text-[13px] font-semibold text-foreground`,children:`Description`}),(0,B.jsx)(`p`,{className:`text-[13px] leading-relaxed text-muted-foreground`,children:l.description})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`mb-1.5 text-[13px] font-semibold text-foreground`,children:`Resolve`}),(0,B.jsx)(H,{variant:`outline`,onClick:()=>{l.action.go(),e()},children:l.action.label})]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-border px-4 pt-1.5`,children:[(0,B.jsx)(Qp,{tabs:[{id:`all`,label:`All`},{id:`security`,label:`Security`},{id:`performance`,label:`Performance`}],active:a,onSelect:e=>o(e)}),(0,B.jsx)(`div`,{className:`ml-auto pb-1.5`,children:(0,B.jsx)(Up,{size:`xs`,className:`w-28 shrink-0`,value:s,onValueChange:e=>c(e),options:[{value:``,label:`Severity`},{value:`critical`,label:`Critical`},{value:`warning`,label:`Warning`},{value:`info`,label:`Info`}]})})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:r?(0,B.jsx)(df,{message:r}):t===null?(0,B.jsx)(`div`,{className:`p-5`,children:(0,B.jsx)(qp,{})}):f.length===0?(0,B.jsx)(`p`,{className:`px-5 py-10 text-center text-[13px] text-muted-foreground/70`,children:t.length===0?`No advisor findings \u2014 everything looks healthy.`:`Nothing matches the filters.`}):f.map(e=>(0,B.jsxs)(`button`,{className:`flex w-full items-center gap-3 border-b border-border/60 px-4 py-3 text-left transition-colors hover:bg-accent/40`,onClick:()=>u(e),children:[(0,B.jsx)(nh,{f:e}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate text-[13px] font-medium text-foreground`,children:e.title}),(0,B.jsx)(`span`,{className:`block truncate font-mono text-[11px] text-muted-foreground/70`,children:e.entity})]}),e.level===`critical`&&(0,B.jsx)(V,{variant:`red`,children:`CRITICAL`}),(0,B.jsx)(he,{size:14,className:`shrink-0 text-muted-foreground/50`})]},e.id))})]})]})})}var oh=[{tab:`database`,section:`visualizer`,label:`Database \u00B7 Schema Visualizer`},{tab:`database`,section:`tables`,label:`Database \u00B7 Tables`},{tab:`database`,section:`functions`,label:`Database \u00B7 Functions`},{tab:`database`,section:`triggers`,label:`Database \u00B7 Triggers`},{tab:`database`,section:`policies`,label:`Database \u00B7 Policies`},{tab:`database`,section:`enums`,label:`Database \u00B7 Enumerated Types`},{tab:`database`,section:`indexes`,label:`Database \u00B7 Indexes`},{tab:`database`,section:`roles`,label:`Database \u00B7 Roles`},{tab:`database`,section:`migrations`,label:`Database \u00B7 Migrations`},{tab:`auth`,section:`users`,label:`Authentication \u00B7 Users`},{tab:`auth`,section:`providers`,label:`Authentication \u00B7 Providers`},{tab:`functions`,section:`secrets`,label:`Edge Functions \u00B7 Secrets`},{tab:`functions`,section:`settings`,label:`Edge Functions \u00B7 Settings`},{tab:`realtime`,section:`inspector`,label:`Realtime \u00B7 Inspector`},{tab:`realtime`,section:`policies`,label:`Realtime \u00B7 Policies`},{tab:`realtime`,section:`settings`,label:`Realtime \u00B7 Settings`},{tab:`automations`,section:`cron`,label:`Automations \u00B7 Cron`},{tab:`automations`,section:`queues`,label:`Automations \u00B7 Queues`},{tab:`automations`,section:`webhooks`,label:`Automations \u00B7 Webhooks`},{tab:`settings`,section:`general`,label:`Settings \u00B7 General`},{tab:`settings`,section:`api-keys`,label:`Settings \u00B7 API Keys`}];function sh(){let[e,t]=(0,_.useState)(!1),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(0),[o,s]=(0,_.useState)(null),c=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),t(e=>!e)),e.key===`Escape`&&t(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,_.useEffect)(()=>{if(!e){r(``),a(0);return}c.current?.focus(),o===null&&N.tables().then(e=>s(e.map(e=>e.name)),()=>s([]))},[e,o]);let l=(0,_.useMemo)(()=>{let e=Rt.flatMap(e=>e.items.map(e=>({key:`page:${e.id}`,label:e.label,group:`Pages`,tab:e.id,icon:e.icon}))),t=oh.map(e=>({key:`sec:${e.tab}/${e.section}`,label:e.label,group:`Sections`,tab:e.tab,section:e.section})),n=(o??[]).map(e=>({key:`tbl:${e}`,label:e,group:`Tables`,tab:`table`,section:e,icon:Et}));return[...e,...t,...n]},[o]),u=n.toLowerCase().trim(),d=u?l.filter(e=>e.label.toLowerCase().includes(u)):l.slice(0,12);function f(e){z(e.tab,e.section??null),t(!1)}if(!e)return null;let p=``;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`fixed inset-0 z-80 bg-black/50 backdrop-blur-[2px] animate-[fade-in_.1s_ease-out]`,onClick:()=>t(!1)}),(0,B.jsxs)(`div`,{className:`fixed left-1/2 top-24 z-80 w-140 max-w-[92vw] -translate-x-1/2 overflow-hidden rounded-lg border border-input bg-popover shadow-2xl animate-[fade-in_.1s_ease-out]`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2.5 border-b border-border px-4`,children:[(0,B.jsx)(_t,{size:15,className:`shrink-0 text-muted-foreground/60`}),(0,B.jsx)(`input`,{ref:c,value:n,onChange:e=>{r(e.target.value),a(0)},onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),a(e=>Math.min(e+1,d.length-1))):e.key===`ArrowUp`?(e.preventDefault(),a(e=>Math.max(e-1,0))):e.key===`Enter`&&d[i]&&f(d[i])},placeholder:`Jump to a page, section, or table\u2026`,className:`h-11 w-full bg-transparent text-sm text-foreground placeholder:text-muted-foreground/60 focus:outline-none`}),(0,B.jsx)(lf,{children:`esc`})]}),(0,B.jsxs)(`div`,{className:`max-h-80 overflow-y-auto p-1.5`,children:[d.length===0&&(0,B.jsx)(`p`,{className:`px-3 py-6 text-center text-xs text-muted-foreground/60`,children:`No matches.`}),d.map((e,t)=>{let n=e.group!==p;p=e.group;let r=e.icon;return(0,B.jsxs)(`div`,{children:[n&&(0,B.jsx)(`p`,{className:`px-2.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60`,children:e.group}),(0,B.jsxs)(`button`,{onMouseEnter:()=>a(t),onClick:()=>f(e),className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left text-[13px] `+(i===t?`bg-accent text-foreground`:`text-foreground/80`),children:[r&&(0,B.jsx)(r,{size:14,className:`shrink-0 text-muted-foreground/70`}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate `+(e.group===`Tables`?`font-mono`:``),children:e.label}),i===t&&(0,B.jsx)(Se,{size:12,className:`shrink-0 text-muted-foreground/60`})]})]},e.key)})]})]})]})}function ch(){return window.location.origin}function lh(){return`import { createClient } from '@supabase/supabase-js'\nimport { createBackend, createPgmemEngine } from 'tinbase'\n\n// a whole backend \u2014 in memory, inside the page\nconst backend = await createBackend({\n engine: await createPgmemEngine(), // pure JS \u2014 omit for PGlite (real Postgres in WASM)\n})\n\n// hand it to supabase-js as a custom fetch \u2014 no server, no network\nconst supabase = createClient('http://localhost', backend.anonKey, {\n global: { fetch: (input, init) => backend.fetch(new Request(input, init)) },\n})\n\n// query it like any Supabase project \u2014 swap in your table and columns\nawait supabase.from('YOUR_TABLE').insert({ some_column: 'value' })\nconst { data } = await supabase.from('YOUR_TABLE').select()`}function uh({size:e=24}){let t=(0,_.useId)(),n=`${t}-body`,r=`${t}-lid`;return(0,B.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 120 120`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,B.jsxs)(`defs`,{children:[(0,B.jsxs)(`linearGradient`,{id:n,x1:`30`,y1:`30`,x2:`92`,y2:`102`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{stopColor:`#10b981`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#047857`})]}),(0,B.jsxs)(`linearGradient`,{id:r,x1:`26`,y1:`19`,x2:`94`,y2:`49`,gradientUnits:`userSpaceOnUse`,children:[(0,B.jsx)(`stop`,{stopColor:`#6ee7b7`}),(0,B.jsx)(`stop`,{offset:`1`,stopColor:`#34d399`})]})]}),(0,B.jsx)(`path`,{d:`M26 34v52c0 8.4 15.2 15.2 34 15.2s34-6.8 34-15.2V34Z`,fill:`url(#${n})`}),(0,B.jsx)(`path`,{d:`M26 60c0 8.4 15.2 15.2 34 15.2S94 68.4 94 60`,stroke:`#6ee7b7`,strokeWidth:`3`,fill:`none`}),(0,B.jsx)(`ellipse`,{cx:`60`,cy:`34`,rx:`34`,ry:`15`,fill:`url(#${r})`}),(0,B.jsx)(`ellipse`,{cx:`60`,cy:`34`,rx:`25`,ry:`10`,fill:`none`,stroke:`#059669`,strokeOpacity:`0.5`,strokeWidth:`2.5`})]})}function dh({onLogout:e}){let[t,n]=(0,_.useState)(!1),r=ch(),i=Zn(r,`API URL`);return(0,B.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-2 border-b border-border bg-card px-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 pl-1`,children:[(0,B.jsx)(uh,{size:22}),(0,B.jsx)(`span`,{className:`text-[13px] font-semibold text-foreground`,children:`tinbase`}),(0,B.jsx)(V,{variant:`outline`,children:`studio`})]}),(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`/`}),(0,B.jsxs)(`button`,{onClick:i.copy,title:i.copied?`Copied!`:`Copy API URL`,className:`group flex items-center gap-1.5 rounded-md px-2 py-1 font-mono text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:[r.replace(/^https?:\\/\\//,``),i.copied?(0,B.jsx)(fe,{size:11,className:`text-brand`}):(0,B.jsx)(xe,{size:11,className:`opacity-0 transition-opacity group-hover:opacity-100`})]}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,B.jsxs)(`button`,{onClick:()=>window.dispatchEvent(new KeyboardEvent(`keydown`,{key:`k`,ctrlKey:!0})),className:`flex h-7 items-center gap-2 rounded-md border border-input bg-field px-2.5 text-xs text-muted-foreground/80 transition-colors hover:border-muted-foreground hover:text-foreground`,title:`Search (Ctrl+K)`,children:[(0,B.jsx)(_t,{size:12}),`Search\u2026`,(0,B.jsx)(lf,{children:`\u2318K`})]}),(0,B.jsxs)(H,{size:`xs`,className:`h-7`,onClick:()=>n(!0),children:[(0,B.jsx)(ft,{size:12}),` Connect`]}),(0,B.jsx)(rh,{}),(0,B.jsx)(H,{variant:`outline`,size:`icon`,className:`size-7`,title:`Log out`,onClick:e,children:(0,B.jsx)(Qe,{size:13})})]}),(0,B.jsx)(fh,{open:t,onClose:()=>n(!1)})]})}function fh({open:e,onClose:t}){let n=ch(),r=x(),[i,a]=(0,_.useState)(``);return(0,_.useEffect)(()=>{e&&N.keys().then(e=>a(e.anonKey??``),()=>a(``))},[e]),(0,B.jsx)(ho,{open:e,onClose:t,title:`Connect to tinbase`,wide:!0,children:(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground/80`,children:[`tinbase is a`,` `,(0,B.jsx)(`span`,{className:`text-foreground/80`,children:`Supabase-compatible`}),` backend in one process \u2014 REST, Auth, Storage, and Realtime speak the same wire protocols, so the official`,` `,(0,B.jsx)(`span`,{className:`text-foreground/80`,children:`supabase-js`}),` SDK connects unchanged.`]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`API URL`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(Y,{mono:!0,readOnly:!0,value:n}),(0,B.jsx)(Qn,{value:n,label:`API URL`,variant:`outline`,size:`icon`,iconSize:13})]})]}),(0,B.jsx)(uf,{label:`anon key`,hint:`safe for browsers \u2014 RLS applies`,value:i}),(0,B.jsx)(uf,{label:`service_role key`,hint:`server-side only \u2014 bypasses RLS`,value:r,danger:!0}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Get Started`}),(0,B.jsx)(tr,{code:lh(),lang:`js`})]})]})})}function ph({onOk:e}){let[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(!1);async function s(){o(!0),i(``),S(t.trim());try{await N.ping(),e()}catch(e){C(),i(`Invalid service_role key: `+e.message)}finally{o(!1)}}return(0,B.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,B.jsxs)(`div`,{className:`w-[400px] text-center`,children:[(0,B.jsx)(`div`,{className:`mb-4 flex justify-center`,children:(0,B.jsx)(uh,{size:48})}),(0,B.jsx)(`h1`,{className:`text-lg font-semibold`,children:`tinbase studio`}),(0,B.jsxs)(`p`,{className:`mt-1 text-[13px] text-muted-foreground/80`,children:[`Sign in with the `,(0,B.jsx)(`span`,{className:`text-foreground/80`,children:`service_role`}),` key printed when tinbase started.`]}),(0,B.jsxs)(`div`,{className:`mt-5 space-y-3 text-left`,children:[(0,B.jsx)(Y,{type:`password`,placeholder:`service_role key (eyJ\u2026)`,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>e.key===`Enter`&&s()}),(0,B.jsx)(H,{className:`w-full`,onClick:s,disabled:a||!t.trim(),children:a?`Checking\u2026`:`Continue`}),r&&(0,B.jsx)(`p`,{className:`text-xs text-destructive`,children:r})]})]})})}var mh=52,hh=224,gh=[{id:`expanded`,label:`Expanded`},{id:`collapsed`,label:`Collapsed`},{id:`hover`,label:`Expand on hover`}];function _h({tab:e,onTab:t}){let[n,r]=mn(),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1),c=(0,_.useRef)(void 0),l=i||o,u=n===`expanded`||n===`hover`&&l,d=n===`hover`&&l,f=e=>{r(e),a(!1)};return(0,B.jsx)(`aside`,{className:`relative shrink-0 transition-[width] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)]`,style:{width:n===`expanded`?hh:mh},children:(0,B.jsxs)(`div`,{onMouseEnter:()=>{n===`hover`&&(clearTimeout(c.current),c.current=setTimeout(()=>a(!0),60))},onMouseLeave:()=>{clearTimeout(c.current),c.current=setTimeout(()=>a(!1),120)},className:`absolute inset-y-0 left-0 z-40 flex flex-col overflow-hidden border-r border-border bg-sidebar transition-[width,box-shadow] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] `+(d?`shadow-[12px_0_32px_rgba(0,0,0,0.45)]`:``),style:{width:u?hh:mh},children:[(0,B.jsx)(`nav`,{className:`flex-1 overflow-y-auto overflow-x-hidden py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:Rt.map((n,r)=>(0,B.jsxs)(`div`,{children:[n.title&&(0,B.jsx)(vh,{title:n.title,expanded:u}),n.items.map(n=>(0,B.jsx)(yh,{icon:n.icon,label:n.label,active:e===n.id,expanded:u,onClick:()=>t(n.id)},n.id))]},r))}),(0,B.jsx)(`div`,{className:`shrink-0 border-t border-border py-2`,children:(0,B.jsxs)(Zd,{open:o,onOpenChange:s,children:[(0,B.jsx)(Qd,{asChild:!0,children:(0,B.jsxs)(`button`,{title:u?void 0:`Sidebar control`,className:`mx-1.5 my-px flex h-8 items-center rounded-md text-[13px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground data-[state=open]:bg-accent data-[state=open]:text-foreground`,style:{width:`calc(100% - 12px)`},children:[(0,B.jsx)(`span`,{className:`flex w-10 shrink-0 items-center justify-center`,children:u?(0,B.jsx)(rt,{size:16}):(0,B.jsx)(it,{size:16})}),(0,B.jsx)(`span`,{className:`whitespace-nowrap transition-[opacity,transform] duration-200 `+(u?`translate-x-0 opacity-100`:`pointer-events-none -translate-x-2 opacity-0`),children:`Sidebar control`})]})}),(0,B.jsxs)(tf,{align:`start`,className:`w-48`,children:[(0,B.jsx)(sf,{children:`Sidebar control`}),gh.map(e=>(0,B.jsxs)(nf,{onSelect:()=>f(e.id),children:[(0,B.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full `+(n===e.id?`bg-foreground`:`bg-transparent`)}),e.label]},e.id))]})]})})]})})}function vh({title:e,expanded:t}){return(0,B.jsxs)(`div`,{className:`relative mx-3 mb-1 mt-3 flex h-4 items-center`,children:[(0,B.jsx)(`div`,{className:`h-px w-full bg-accent transition-opacity duration-200 `+(t?`opacity-0`:`opacity-100`)}),(0,B.jsx)(`span`,{className:`absolute left-0.5 whitespace-nowrap text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80 transition-opacity duration-200 `+(t?`opacity-100`:`opacity-0`),children:e})]})}function yh({icon:e,label:t,active:n,expanded:r,onClick:i}){return(0,B.jsxs)(`button`,{onClick:i,title:r?void 0:t,className:`mx-1.5 my-px flex h-8 items-center rounded-md text-[13px] transition-colors `+(n?`bg-accent text-foreground`:`text-muted-foreground hover:bg-accent/60 hover:text-foreground`),style:{width:`calc(100% - 12px)`},children:[(0,B.jsx)(`span`,{className:`flex w-10 shrink-0 items-center justify-center`,children:(0,B.jsx)(e,{size:16,className:n?`text-brand`:``})}),(0,B.jsx)(`span`,{className:`whitespace-nowrap transition-[opacity,transform] duration-200 `+(r?`translate-x-0 opacity-100`:`pointer-events-none -translate-x-2 opacity-0`),children:t})]})}function bh({title:e,children:t}){return(0,B.jsxs)(`div`,{className:`mx-auto max-w-4xl px-10 py-8`,children:[(0,B.jsx)(`h1`,{className:`border-b border-border pb-4 text-xl font-semibold text-foreground`,children:e}),t]})}function xh({title:e,description:t,children:n}){return(0,B.jsxs)(`div`,{className:`border-b border-border pb-2 last:border-0`,children:[(0,B.jsxs)(`div`,{className:`pb-1 pt-6 first:pt-0`,children:[(0,B.jsx)(`h2`,{className:`text-[15px] font-semibold text-foreground`,children:e}),t&&(0,B.jsx)(`p`,{className:`mt-0.5 text-[13px] text-muted-foreground/80`,children:t})]}),(0,B.jsx)(`div`,{className:`divide-y divide-border/70`,children:n})]})}function Sh({label:e,description:t,children:n,wide:r}){return(0,B.jsxs)(`div`,{className:`flex flex-col gap-4 py-6 sm:flex-row sm:items-start sm:gap-10`,children:[(0,B.jsxs)(`div`,{className:`w-64 shrink-0`,children:[(0,B.jsx)(`p`,{className:`text-[13px] font-medium text-foreground`,children:e}),t&&(0,B.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground/80`,children:t})]}),(0,B.jsx)(`div`,{className:`min-w-0 flex-1 `+(r?``:`max-w-md`),children:n})]})}function Ch({label:e,value:t}){return(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-6 py-1.5 text-[13px]`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,B.jsx)(`span`,{className:`text-right font-mono text-foreground/90`,children:t})]})}function wh({title:e,groups:t,active:n,onSelect:r,footer:i}){return(0,B.jsxs)(mf,{id:`sub-nav`,side:`left`,defaultSize:224,min:176,max:340,className:`flex flex-col border-r border-border bg-card`,children:[(0,B.jsx)(`div`,{className:`px-4 pb-1 pt-4 text-sm font-semibold text-foreground`,children:e}),(0,B.jsx)(`nav`,{className:`min-h-0 flex-1 overflow-y-auto px-2 pb-3`,children:t.map((e,t)=>(0,B.jsxs)(`div`,{className:`pt-3 first:pt-2`,children:[e.title&&(0,B.jsx)(`p`,{className:`px-2.5 pb-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60`,children:e.title}),e.items.map(e=>(0,B.jsxs)(`button`,{onClick:()=>r(e.id),className:`mb-px flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-[13px] transition-colors `+(n===e.id?`bg-accent text-foreground`:`text-muted-foreground hover:bg-accent/50 hover:text-foreground`),children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.badge]},e.id))]},t))}),i&&(0,B.jsx)(`div`,{className:`shrink-0 border-t border-border p-3`,children:i})]})}function Th(){let[e,t]=(0,_.useState)(null);if((0,_.useEffect)(()=>{N.authConfig().then(t,()=>t({providers:[],inbox:!1,settings:null}))},[]),e===null)return(0,B.jsx)(qp,{});let n=e.settings;async function r(e){if(!n)return;let r={...n,disabledProviders:[...n.disabledProviders]};t(t=>t&&t.settings?{...t,settings:{...t.settings,...e}}:t);try{let n=await N.updateAuthSettings(e);t(e=>e&&{...e,settings:n})}catch(e){t(e=>e&&{...e,settings:r}),U.error(e.message)}}return(0,B.jsx)(`div`,{className:`h-full overflow-y-auto`,children:(0,B.jsxs)(`div`,{className:`mx-auto max-w-3xl px-8 py-8`,children:[(0,B.jsx)(`h1`,{className:`text-lg font-semibold text-foreground`,children:`Sign In / Providers`}),(0,B.jsx)(`p`,{className:`mt-0.5 text-[13px] text-muted-foreground/80`,children:`Changes apply instantly to the running instance and persist across restarts.`}),(0,B.jsx)(`h2`,{className:`mb-2 mt-7 text-sm font-medium text-foreground`,children:`User signups`}),(0,B.jsxs)(`div`,{className:`divide-y divide-border rounded-md border border-border bg-card`,children:[(0,B.jsx)(Eh,{title:`Allow new users to sign up`,description:`If disabled, new email/password and OTP signups are rejected; existing users can still sign in.`,children:(0,B.jsx)(Jp,{checked:n?!n.disableSignup:!0,onChange:e=>void r({disableSignup:!e}),disabled:!n})}),(0,B.jsx)(Eh,{title:`Allow anonymous sign-ins`,description:`Enable signInAnonymously() \u2014 temporary users without credentials.`,children:(0,B.jsx)(Jp,{checked:n?.anonymousUsers??!0,onChange:e=>void r({anonymousUsers:e}),disabled:!n})}),(0,B.jsx)(Eh,{title:`Confirm email`,description:`Require users to verify their email address (via the emailed link or code) before they can sign in.`,children:(0,B.jsx)(Jp,{checked:n?!n.autoconfirm:!1,onChange:e=>void r({autoconfirm:!e}),disabled:!n})}),(0,B.jsx)(Eh,{title:`Minimum password length`,description:`Passwords shorter than this are rejected on signup and password change (4\u201372).`,children:(0,B.jsx)(Oh,{value:n?.minPasswordLength??6,disabled:!n,onSave:e=>void r({minPasswordLength:e})})})]}),(0,B.jsx)(`h2`,{className:`mb-2 mt-8 text-sm font-medium text-foreground`,children:`Auth methods`}),(0,B.jsxs)(`div`,{className:`divide-y divide-border rounded-md border border-border bg-card`,children:[(0,B.jsx)(Dh,{icon:$e,name:`Email`,description:`Email/password, OTP codes, magic links, and password recovery.`,children:(0,B.jsx)(V,{variant:`brand`,children:`Enabled`})}),(0,B.jsx)(Dh,{icon:Ge,name:`PKCE flows`,description:`OAuth and magic links support the PKCE flow out of the box.`,children:(0,B.jsx)(V,{variant:`brand`,children:`Enabled`})}),(0,B.jsx)(Dh,{icon:jt,name:`Anonymous`,description:`Temporary users without credentials \u2014 controlled by the toggle above.`,children:n?.anonymousUsers===!1?(0,B.jsx)(V,{variant:`neutral`,children:`Disabled`}):(0,B.jsx)(V,{variant:`brand`,children:`Enabled`})})]}),(0,B.jsx)(`h2`,{className:`mb-2 mt-8 text-sm font-medium text-foreground`,children:`OAuth providers`}),e.providers.length>0?(0,B.jsx)(`div`,{className:`divide-y divide-border rounded-md border border-border bg-card`,children:e.providers.map(e=>(0,B.jsx)(Dh,{icon:Re,name:e,description:`signInWithOAuth() with identity linking.`,oauth:!0,children:(0,B.jsx)(Jp,{checked:!n?.disabledProviders.includes(e),disabled:!n,onChange:t=>{n&&r({disabledProviders:t?n.disabledProviders.filter(t=>t!==e):[...n.disabledProviders,e]})}})},e))}):(0,B.jsxs)(`div`,{className:`rounded-md border border-dashed border-border p-4 text-xs text-muted-foreground/80`,children:[`No OAuth providers configured. Add Google/GitHub (or a generic provider) to`,` `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`supabase/config.toml`}),` and restart \u2014 they appear here with a toggle.`]}),(0,B.jsx)(`h2`,{className:`mb-2 mt-8 text-sm font-medium text-foreground`,children:`Email delivery`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md border border-border bg-card p-4`,children:[(0,B.jsx)(Ue,{size:16,className:`shrink-0 text-muted-foreground`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`p`,{className:`text-[13px] text-foreground`,children:[e.inbox?`Local dev inbox`:`Custom mailer`,` `,e.inbox&&(0,B.jsx)(V,{variant:`brand`,children:`active`})]}),(0,B.jsx)(`p`,{className:`text-[11px] text-muted-foreground/80`,children:e.inbox?`No mailer configured \u2014 OTP codes, magic links and confirmations are captured locally instead of being sent.`:`A mailer was provided to createBackend; emails are delivered through it.`})]}),e.inbox&&(0,B.jsxs)(`a`,{href:`${ch()}/inbox`,target:`_blank`,rel:`noreferrer`,className:`flex shrink-0 items-center gap-1.5 rounded-md border border-input px-2.5 py-1.5 text-xs text-foreground/80 transition-colors hover:border-muted-foreground hover:text-foreground`,children:[`Open inbox `,(0,B.jsx)(De,{size:11})]})]}),n===null&&(0,B.jsx)(`p`,{className:`mt-6 rounded-md border border-warning/30 bg-warning/10 px-3 py-2 text-xs text-warning`,children:`This server predates runtime auth settings \u2014 restart tinbase after updating to enable the toggles.`})]})})}function Eh({title:e,description:t,children:n}){return(0,B.jsxs)(`div`,{className:`flex items-center gap-4 p-4`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`p`,{className:`text-[13px] text-foreground`,children:e}),(0,B.jsx)(`p`,{className:`mt-0.5 text-[11px] leading-relaxed text-muted-foreground/80`,children:t})]}),(0,B.jsx)(`div`,{className:`shrink-0`,children:n})]})}function Dh({icon:e,name:t,description:n,oauth:r,children:i}){return(0,B.jsxs)(`div`,{className:`flex items-center gap-3 p-4`,children:[(0,B.jsx)(e,{size:16,className:`shrink-0 text-muted-foreground`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`p`,{className:`flex items-center gap-2 text-[13px] capitalize text-foreground`,children:[t,r&&(0,B.jsx)(V,{variant:`blue`,children:`oauth`})]}),(0,B.jsx)(`p`,{className:`text-[11px] text-muted-foreground/80`,children:n})]}),(0,B.jsx)(`div`,{className:`shrink-0`,children:i})]})}function Oh({value:e,disabled:t,onSave:n}){let[r,i]=(0,_.useState)(String(e));(0,_.useEffect)(()=>i(String(e)),[e]);function a(){let t=parseInt(r,10);if(!Number.isFinite(t)||t<4||t>72){i(String(e));return}t!==e&&n(t)}return(0,B.jsx)(Y,{mono:!0,className:`w-16 text-center`,value:r,disabled:t,onChange:e=>i(e.target.value.replace(/[^0-9]/g,``)),onBlur:a,onKeyDown:e=>e.key===`Enter`&&e.target.blur()})}function kh({user:e,onClose:t,onChanged:n}){let[r,i]=(0,_.useState)(`overview`),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(!1);async function l(){try{await N.deleteUser(e.id),U.success(`User deleted`),n()}catch(e){U.error(e.message)}}async function u(){if(e.email)try{await N.sendMagicLink(e.email),U.success(`Magic link sent \u2014 check /inbox in dev`)}catch(e){U.error(e.message)}}return(0,B.jsxs)(Kp,{open:!0,onClose:t,width:`w-[480px]`,title:(0,B.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`truncate`,children:e.email||(e.is_anonymous?`Anonymous user`:e.id.slice(0,12))}),e.is_anonymous&&(0,B.jsx)(V,{variant:`neutral`,children:`anon`})]}),footer:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(H,{variant:`danger`,onClick:()=>c(!0),children:[(0,B.jsx)(Ot,{size:13}),` Delete user`]}),(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,className:`ml-auto`,children:`Done`})})]}),children:[(0,B.jsx)(Qp,{tabs:[{id:`overview`,label:`Overview`},{id:`json`,label:`Raw JSON`}],active:r,onSelect:i}),r===`overview`&&(0,B.jsxs)(`div`,{className:`mt-4 space-y-5`,children:[(0,B.jsx)(`div`,{children:[[`User UID`,e.id,!0],[`Email`,e.email??`\u2014`,!1],[`Created at`,(0,B.jsx)(Km,{value:e.created_at}),!1],[`Updated at`,(0,B.jsx)(Km,{value:e.updated_at}),!1],[`Confirmation sent at`,(0,B.jsx)(Km,{value:e.confirmation_sent_at}),!1],[`Confirmed at`,(0,B.jsx)(Km,{value:e.email_confirmed_at}),!1],[`Last signed in`,(0,B.jsx)(Km,{value:e.last_sign_in_at}),!1]].map(([e,t,n])=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-b border-border/60 py-2 text-[13px] last:border-0`,children:[(0,B.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e}),(0,B.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 font-mono text-foreground/90`,children:[(0,B.jsx)(`span`,{className:`truncate`,children:t}),n&&(0,B.jsx)(Qn,{value:String(t),label:e,iconSize:11})]})]},e))}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60`,children:`Provider information`}),(0,B.jsxs)(`div`,{className:`rounded-md border border-border bg-card p-3.5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`text-[13px] font-medium capitalize text-foreground`,children:e.app_metadata?.provider??(e.is_anonymous?`anonymous`:`email`)}),(0,B.jsx)(V,{variant:`brand`,children:`enabled`})]}),(0,B.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground/80`,children:e.is_anonymous?`Signed in anonymously \u2014 no credentials attached.`:`How this user authenticates with your project.`})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60`,children:`Actions`}),(0,B.jsx)(`div`,{className:`space-y-2`,children:!e.is_anonymous&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Ah,{icon:Ge,title:`Reset password`,description:`Set a new password for the user directly.`,action:(0,B.jsx)(H,{variant:`outline`,size:`xs`,onClick:()=>o(!0),children:`Reset password`})}),(0,B.jsx)(Ah,{icon:$e,title:`Send magic link`,description:`Send a passwordless sign-in link to the user.`,action:(0,B.jsx)(H,{variant:`outline`,size:`xs`,onClick:()=>void u(),disabled:!e.email,children:`Send magic link`})})]})})]})]}),r===`json`&&(0,B.jsx)(`div`,{className:`mt-4`,children:(0,B.jsx)(er,{value:JSON.stringify(e,null,2),lang:`js`,readOnly:!0,minLines:10,maxLines:400})}),a&&(0,B.jsx)(jh,{user:e,onClose:()=>o(!1),onDone:()=>{o(!1),U.success(`Password updated`)}}),s&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Delete user ${e.email||e.id.slice(0,8)}?`,description:`The user and their sessions will be permanently removed.`,confirmLabel:`Delete user`,onConfirm:()=>void l(),onClose:()=>c(!1)})]})}function Ah({icon:e,title:t,description:n,action:r}){return(0,B.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md border border-border bg-card p-3.5`,children:[(0,B.jsx)(e,{size:15,className:`shrink-0 text-muted-foreground`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`p`,{className:`text-[13px] text-foreground`,children:t}),(0,B.jsx)(`p`,{className:`text-[11px] text-muted-foreground/80`,children:n})]}),r]})}function jh({user:e,onClose:t,onDone:n}){let[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(!1);async function l(){c(!0),o(``);try{await N.updateUser(e.id,{password:r}),n()}catch(e){o(e.message),c(!1)}}return(0,B.jsx)(ho,{open:!0,onClose:t,title:`Reset password \u00B7 ${e.email||e.id.slice(0,8)}`,children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`New password (min 6 characters)`}),(0,B.jsx)(Y,{type:`password`,value:r,autoFocus:!0,onChange:e=>i(e.target.value),onKeyDown:e=>e.key===`Enter`&&r.length>=6&&void l()})]}),a&&(0,B.jsx)(`p`,{className:`text-xs text-destructive`,children:a}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(H,{variant:`outline`,onClick:t,children:`Cancel`}),(0,B.jsx)(H,{onClick:()=>void l(),disabled:s||r.length<6,children:s?`Saving\u2026`:`Update password`})]})]})})}var Mh=50;function Nh(e){return e.app_metadata?.provider||(e.is_anonymous?`anonymous`:`email`)}function Ph({provider:e}){return e===`email`?(0,B.jsx)($e,{size:12,className:`text-muted-foreground`}):e===`anonymous`?(0,B.jsx)(jt,{size:12,className:`text-muted-foreground`}):(0,B.jsx)(Re,{size:12,className:`text-muted-foreground`})}function Fh(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(`all`),[o,s]=(0,_.useState)(0),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(!1),m=(0,_.useCallback)(()=>{N.users().then(e=>t(e),()=>t([]))},[]);(0,_.useEffect)(()=>{m()},[m]);let h=(0,_.useMemo)(()=>{if(!e)return[];let t=n.toLowerCase().trim();return e.filter(e=>i===`anonymous`&&!e.is_anonymous||i===`verified`&&!e.email_confirmed_at?!1:t?(e.email??``).toLowerCase().includes(t)||e.id.toLowerCase().includes(t):!0)},[e,n,i]);if((0,_.useEffect)(()=>s(0),[n,i]),e===null)return(0,B.jsx)(qp,{});let g=Math.max(1,Math.ceil(h.length/Mh)),v=h.slice(o*Mh,(o+1)*Mh);return(0,B.jsxs)(`div`,{className:`flex h-full`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border px-4 py-2.5`,children:[(0,B.jsx)(`h1`,{className:`text-sm font-semibold text-foreground`,children:`Users`}),(0,B.jsx)(V,{variant:`neutral`,children:e.length}),(0,B.jsxs)(`div`,{className:`relative ml-2 w-64`,children:[(0,B.jsx)(_t,{size:13,className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60`}),(0,B.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:`Search by email or UID\u2026`,className:`h-8 w-full rounded-md border border-input bg-field pl-8 pr-2 text-[13px] text-foreground placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none`})]}),(0,B.jsx)(Up,{className:`w-36 shrink-0`,value:i,onValueChange:e=>a(e),options:[{value:`all`,label:`All users`},{value:`verified`,label:`Verified`},{value:`anonymous`,label:`Anonymous`}]}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,title:`Refresh`,onClick:m,children:(0,B.jsx)(ht,{size:13})}),(0,B.jsxs)(Zd,{children:[(0,B.jsx)(Qd,{asChild:!0,children:(0,B.jsxs)(H,{size:`xs`,children:[(0,B.jsx)(pt,{size:12}),` Add user `,(0,B.jsx)(pe,{size:11})]})}),(0,B.jsxs)(tf,{align:`end`,children:[(0,B.jsxs)(nf,{onSelect:()=>d(!0),children:[(0,B.jsx)(Ge,{size:13}),` Create with password`]}),(0,B.jsxs)(nf,{onSelect:()=>p(!0),children:[(0,B.jsx)($e,{size:13}),` Invite via magic link`]})]})]})]})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Z,{children:`Email`}),(0,B.jsx)(Z,{children:`UID`}),(0,B.jsx)(Z,{children:`Provider`}),(0,B.jsx)(Z,{children:`Created`}),(0,B.jsx)(Z,{children:`Last sign in`})]})}),(0,B.jsx)(`tbody`,{children:v.map(e=>{let t=Nh(e);return(0,B.jsxs)(Zp,{className:`cursor-pointer`,onClick:()=>l(e),children:[(0,B.jsx)(Q,{className:`text-foreground/90`,children:(0,B.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.email||(0,B.jsx)(`span`,{className:`italic text-muted-foreground/60`,children:e.is_anonymous?`anonymous`:`\u2014`}),e.is_anonymous&&(0,B.jsx)(V,{variant:`neutral`,children:`anon`}),e.email&&!e.email_confirmed_at&&(0,B.jsx)(V,{variant:`amber`,children:`unverified`})]})}),(0,B.jsxs)(Q,{className:`font-mono text-[11px] text-muted-foreground/80`,children:[e.id.slice(0,8),`\u2026`]}),(0,B.jsx)(Q,{children:(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,B.jsx)(Ph,{provider:t}),t]})}),(0,B.jsx)(Q,{className:`text-muted-foreground`,children:(0,B.jsx)(Km,{value:e.created_at,format:`date`})}),(0,B.jsx)(Q,{className:`text-muted-foreground`,children:(0,B.jsx)(Km,{value:e.last_sign_in_at})})]},e.id)})})]}),v.length===0&&(0,B.jsx)(cf,{children:e.length===0?`No users yet \u2014 add one or invite via magic link.`:`No match.`})]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-t border-border bg-card px-4 py-1.5 text-xs text-muted-foreground/80`,children:[(0,B.jsxs)(`span`,{children:[h.length.toLocaleString(),` user`,h.length===1?``:`s`]}),g>1&&(0,B.jsxs)(`span`,{className:`ml-auto flex items-center gap-2`,children:[(0,B.jsx)(H,{variant:`ghost`,size:`xs`,disabled:o===0,onClick:()=>s(e=>e-1),children:`Prev`}),`Page `,o+1,` of `,g,(0,B.jsx)(H,{variant:`ghost`,size:`xs`,disabled:o+1>=g,onClick:()=>s(e=>e+1),children:`Next`})]})]})]}),c&&(0,B.jsx)(kh,{user:c,onClose:()=>l(null),onChanged:()=>{m(),l(null)}}),u&&(0,B.jsx)(Ih,{onClose:()=>d(!1),onDone:()=>{d(!1),m()}}),f&&(0,B.jsx)(Lh,{onClose:()=>p(!1),onDone:()=>{p(!1),m()}})]})}function Ih({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(!1);async function u(){l(!0),s(``);try{await N.createUser({email:n,password:i||void 0,email_confirm:!0}),U.success(`Created ${n}`),t()}catch(e){s(e.message),l(!1)}}return(0,B.jsx)(ho,{open:!0,onClose:e,title:`Create user`,children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Email`}),(0,B.jsx)(Y,{value:n,autoFocus:!0,placeholder:`user@example.com`,onChange:e=>r(e.target.value)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Password (optional \u2014 leave empty for passwordless)`}),(0,B.jsx)(Y,{type:`password`,value:i,onChange:e=>a(e.target.value)})]}),o&&(0,B.jsx)(`p`,{className:`text-xs text-destructive`,children:o}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(H,{variant:`outline`,onClick:e,children:`Cancel`}),(0,B.jsx)(H,{onClick:()=>void u(),disabled:c||!n.includes(`@`),children:c?`Creating\u2026`:`Create user`})]})]})})}function Lh({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(!1);async function c(){s(!0),a(``);try{await N.sendMagicLink(n),U.success(`Magic link sent to ${n} \u2014 check /inbox in dev`),t()}catch(e){a(e.message),s(!1)}}return(0,B.jsx)(ho,{open:!0,onClose:e,title:`Invite via magic link`,children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground/80`,children:[`Sends a sign-in link (creating the user if needed). Without a configured mailer, the email lands in the local dev inbox at `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`/inbox`}),`.`]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Email`}),(0,B.jsx)(Y,{value:n,autoFocus:!0,placeholder:`user@example.com`,onChange:e=>r(e.target.value),onKeyDown:e=>e.key===`Enter`&&n.includes(`@`)&&void c()})]}),i&&(0,B.jsx)(`p`,{className:`text-xs text-destructive`,children:i}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(H,{variant:`outline`,onClick:e,children:`Cancel`}),(0,B.jsx)(H,{onClick:()=>void c(),disabled:o||!n.includes(`@`),children:o?`Sending\u2026`:`Send invite`})]})]})})}var Rh=[{id:`users`,label:`Users`,group:`Manage`,component:Fh},{id:`providers`,label:`Sign In / Providers`,group:`Configuration`,component:Th}];function zh(){let{section:e}=qt(),t=Rh.some(t=>t.id===e)?e:`users`,n=Rh.find(e=>e.id===t).component;return(0,B.jsxs)(`div`,{className:`flex h-full`,children:[(0,B.jsx)(wh,{title:`Authentication`,active:t,onSelect:e=>z(`auth`,e),groups:[{title:`Manage`,items:[{id:`users`,label:`Users`}]},{title:`Configuration`,items:[{id:`providers`,label:`Sign In / Providers`}]}]}),(0,B.jsx)(`div`,{className:`min-w-0 flex-1 overflow-hidden`,children:(0,B.jsx)(n,{})})]})}var Bh=`tinbase_db_schema`,Vh=localStorage.getItem(Bh)||`public`,Hh=new Set;function Uh(){return[(0,_.useSyncExternalStore)(e=>(Hh.add(e),()=>Hh.delete(e)),()=>Vh),Wh]}function Wh(e){Vh=e,localStorage.setItem(Bh,e),Hh.forEach(e=>e())}function Gh(e,t){let n=e=>`\"`+e.replace(/\"/g,`\"\"`)+`\"`;return e===`public`?n(t):`${n(e)}.${n(t)}`}var Kh=new Set([`auth`,`storage`,`realtime`,`vault`,`cron`,`pgmq`,`net`,`extensions`,`graphql`,`supabase_migrations`,`supabase_functions`,`information_schema`]);function qh(e){return Kh.has(e)||e.startsWith(`pg_`)}function Jh({className:e=`w-44 shrink-0`,size:t}){let[n,r]=Uh(),[i,a]=(0,_.useState)([n]);return(0,_.useEffect)(()=>{N.schemas().then(e=>{a(e),e.includes(n)||Wh(e.includes(`public`)?`public`:e[0]??`public`)},()=>{})},[]),(0,B.jsx)(Up,{className:e,size:t,mono:!0,value:n,onValueChange:r,options:i.map(e=>({value:e,label:(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,B.jsx)(`span`,{className:`font-sans text-muted-foreground/70`,children:`schema `}),e,qh(e)&&(0,B.jsx)(Xe,{size:10,className:`text-muted-foreground/60`})]})}))})}function Yh({title:e,description:t,search:n,onSearch:r,onRefresh:i,actions:a,schemaPicker:o,filters:s}){return(0,B.jsxs)(`div`,{className:`border-b border-border px-6 pb-4 pt-5`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`text-lg font-semibold text-foreground`,children:e}),(0,B.jsx)(`p`,{className:`mt-0.5 text-[13px] text-muted-foreground/80`,children:t})]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 pt-1`,children:[i&&(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,title:`Refresh`,onClick:i,children:(0,B.jsx)(ht,{size:13})}),a]})]}),(r||o||s)&&(0,B.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[o&&(0,B.jsx)(Jh,{}),r&&(0,B.jsxs)(`div`,{className:`relative w-full max-w-xs`,children:[(0,B.jsx)(_t,{size:13,className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60`}),(0,B.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:`Search\u2026`,className:`h-8 w-full rounded-md border border-input bg-field pl-8 pr-2 text-[13px] text-foreground placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none`})]}),s]})]})}var Xh=e=>`\"`+e.replace(/\"/g,`\"\"`)+`\"`,Zh=e=>`'`+e.replace(/'/g,`''`)+`'`;function Qh(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(null),u=(0,_.useCallback)(async()=>{let[e,n]=await Promise.all([N.sql(`select jobid, jobname, schedule, command, active from cron.job order by jobid`),N.sql(`select jobid, status, return_message, start_time, end_time from cron.job_run_details order by start_time desc limit 50`)]);if(!e.ok||!n.ok){a(e.error??n.error??`Query failed`),t(e=>e??[]),e.ok&&t(e.rows??[]),n.ok&&r(n.rows??[]);return}a(null),t(e.rows??[]),r(n.rows??[])},[]);(0,_.useEffect)(()=>{u()},[u]);async function d(e){let t=await N.sql(`select cron.unschedule(${Zh(e.jobname??String(e.jobid))})`);if(!t.ok){U.error(t.error??`Unschedule failed`);return}U.success(`Unscheduled ${e.jobname??e.jobid}`),await u()}return e===null?(0,B.jsx)(qp,{}):(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsx)(Yh,{title:`Cron`,description:`Scheduled SQL, pg_cron-compatible \u2014 jobs run in UTC with service-role privileges while tinbase is up.`,onRefresh:()=>void u(),actions:(0,B.jsxs)(H,{size:`xs`,onClick:()=>s(!0),children:[(0,B.jsx)(pt,{size:12}),` Schedule job`]})}),i&&(0,B.jsx)(df,{message:i}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Z,{children:`Name`}),(0,B.jsx)(Z,{children:`Schedule`}),(0,B.jsx)(Z,{children:`Command`}),(0,B.jsx)(Z,{children:`Status`}),(0,B.jsx)(Z,{className:`w-12`})]})}),(0,B.jsx)(`tbody`,{children:e.map(e=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:`font-mono text-foreground/90`,children:e.jobname??`#${e.jobid}`}),(0,B.jsx)(Q,{className:`font-mono text-brand`,children:e.schedule}),(0,B.jsx)(Q,{className:`max-w-90 truncate font-mono text-[11px] text-muted-foreground/80`,title:e.command,children:e.command}),(0,B.jsx)(Q,{children:e.active?(0,B.jsx)(V,{variant:`brand`,children:`active`}):(0,B.jsx)(V,{variant:`neutral`,children:`inactive`})}),(0,B.jsx)(Q,{children:(0,B.jsx)(`button`,{className:`p-1 text-muted-foreground/80 opacity-0 hover:text-destructive group-hover:opacity-100`,title:`Unschedule`,onClick:()=>l(e),children:(0,B.jsx)(Ot,{size:13})})})]},e.jobid))})]}),e.length===0&&(0,B.jsxs)(cf,{children:[`No jobs scheduled. `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`select cron.schedule('name', '*/5 * * * *', 'select 1')`}),` `,`also works from SQL.`]}),n.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h2`,{className:`border-b border-border px-6 pb-2 pt-6 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/80`,children:`Recent runs`}),(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Z,{children:`Job`}),(0,B.jsx)(Z,{children:`Status`}),(0,B.jsx)(Z,{children:`Started`}),(0,B.jsx)(Z,{children:`Message`})]})}),(0,B.jsx)(`tbody`,{children:n.map((t,n)=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:`font-mono text-muted-foreground`,children:e.find(e=>e.jobid===t.jobid)?.jobname??`#${t.jobid}`}),(0,B.jsx)(Q,{children:t.status===`succeeded`?(0,B.jsx)(V,{variant:`brand`,children:`succeeded`}):(0,B.jsx)(V,{variant:`red`,children:t.status})}),(0,B.jsx)(Q,{className:`text-muted-foreground`,children:(0,B.jsx)(Km,{value:t.start_time})}),(0,B.jsx)(Q,{className:`max-w-90 truncate font-mono text-[11px] text-muted-foreground/80`,title:t.return_message??``,children:t.return_message??`\u2014`})]},n))})]})]})]}),o&&(0,B.jsx)($h,{onClose:()=>s(!1),onDone:async()=>{s(!1),await u()}}),c&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Unschedule \"${c.jobname??c.jobid}\"?`,description:`The job stops running immediately. Run history is kept.`,confirmLabel:`Unschedule`,onConfirm:()=>void d(c),onClose:()=>l(null)})]})}function $h({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(`*/5 * * * *`),[o,s]=(0,_.useState)(`select net.http_post('https://example.com/hook', '{}'::jsonb)`),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(!1);async function f(){if(!n.trim()||!i.trim()||!o.trim())return l(`All fields are required.`);d(!0),l(``);let e=await N.sql(`select cron.schedule(${Zh(n.trim())}, ${Zh(i.trim())}, ${Zh(o)})`);if(!e.ok){l(e.error??`Schedule failed`),d(!1);return}U.success(`Scheduled ${n.trim()}`),await t()}return(0,B.jsx)(Kp,{open:!0,onClose:e,width:`w-140`,title:`Schedule a new job`,footer:(0,B.jsxs)(B.Fragment,{children:[c&&(0,B.jsx)(`p`,{className:`min-w-0 truncate text-xs text-destructive`,children:c}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,children:`Cancel`})}),(0,B.jsx)(H,{onClick:()=>void f(),disabled:u,children:u?`Scheduling\u2026`:`Schedule job`})]})]}),children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Name`}),(0,B.jsx)(Y,{mono:!0,value:n,autoFocus:!0,placeholder:`cleanup`,onChange:e=>r(e.target.value)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Schedule \u2014 cron (UTC) or \"N seconds\"`}),(0,B.jsx)(Y,{mono:!0,value:i,placeholder:`*/5 * * * *`,onChange:e=>a(e.target.value)})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`SQL command`}),(0,B.jsx)(nr,{lang:`sql`,className:`h-40`,value:o,onChange:s,onCmdEnter:()=>void f()})]})]})})}var eg=/^[a-z_][a-z0-9_-]{0,46}$/i;function tg(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(null),f=(0,_.useCallback)(async()=>{let e=await N.sql(`select replace(t.table_name, 'q_', '') as name,\n (xpath('/row/cnt/text()', query_to_xml('select count(*) as cnt from pgmq.' || quote_ident(t.table_name), false, true, '')))[1]::text::int as depth\n from information_schema.tables t\n where t.table_schema = 'pgmq' and t.table_name like 'q\\\\_%' order by 1`);if(e.ok){r(null),t((e.rows??[]).map(e=>({...e,archived:0})));return}let n=await N.sql(`select replace(table_name, 'q_', '') as name from information_schema.tables\n where table_schema = 'pgmq' and table_name like 'q\\\\_%' order by 1`);if(!n.ok){r(n.error??`Query failed`),t(e=>e??[]);return}r(null);let i=[];for(let e of n.rows??[]){if(!eg.test(e.name))continue;let t=await N.sql(`select count(*)::int as depth from pgmq.${Xh(`q_`+e.name)}`);i.push({name:e.name,depth:t.ok?t.rows?.[0]?.depth??0:0,archived:0})}t(i)},[]);(0,_.useEffect)(()=>{f()},[f]);async function p(e){if(!eg.test(e.name)){U.error(`Invalid queue name`);return}let t=await N.sql(`delete from pgmq.${Xh(`q_`+e.name)}`);if(!t.ok){U.error(t.error??`Purge failed`);return}U.success(`Purged queue ${e.name}`),await f()}return e===null?(0,B.jsx)(qp,{}):(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsx)(Yh,{title:`Queues`,description:`pgmq-compatible message queues \u2014 send/read/pop from SQL or supabase.schema('pgmq').rpc(\u2026).`,onRefresh:()=>void f(),actions:(0,B.jsxs)(H,{size:`xs`,onClick:()=>a(!0),children:[(0,B.jsx)(pt,{size:12}),` New queue`]})}),n&&(0,B.jsx)(df,{message:n}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Z,{children:`Queue`}),(0,B.jsx)(Z,{children:`Depth`}),(0,B.jsx)(Z,{className:`w-28`})]})}),(0,B.jsx)(`tbody`,{children:e.map(e=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:`font-mono text-foreground/90`,children:e.name}),(0,B.jsx)(Q,{className:`tabular-nums text-muted-foreground`,children:e.depth}),(0,B.jsx)(Q,{children:(0,B.jsxs)(`div`,{className:`flex justify-end gap-0.5 opacity-0 group-hover:opacity-100`,children:[(0,B.jsx)(`button`,{className:`p-1 text-muted-foreground/80 hover:text-foreground`,title:`Peek messages`,onClick:()=>l(e),children:(0,B.jsx)(ke,{size:13})}),(0,B.jsx)(`button`,{className:`p-1 text-muted-foreground/80 hover:text-foreground`,title:`Send test message`,onClick:()=>s(e),children:(0,B.jsx)(vt,{size:13})}),(0,B.jsx)(`button`,{className:`p-1 text-muted-foreground/80 hover:text-destructive`,title:`Purge queue`,onClick:()=>d(e),children:(0,B.jsx)(Ot,{size:13})})]})})]},e.name))})]}),e.length===0&&(0,B.jsxs)(cf,{children:[`No queues yet. Create one here or via`,` `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`select pgmq.create('jobs')`}),`.`]})]}),i&&(0,B.jsx)(ng,{onClose:()=>a(!1),onDone:async()=>{a(!1),await f()}}),o&&(0,B.jsx)(rg,{queue:o,onClose:()=>s(null),onDone:async()=>{s(null),await f()}}),c&&(0,B.jsx)(ig,{queue:c,onClose:()=>l(null)}),u&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Purge queue \"${u.name}\"?`,description:`All ${u.depth} pending messages are permanently deleted.`,confirmLabel:`Purge`,onConfirm:()=>void p(u),onClose:()=>d(null)})]})}function ng({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(!1);async function c(){if(!eg.test(n))return a(`Letters, digits, underscores and hyphens only.`);s(!0),a(``);let e=await N.sql(`select pgmq.create(${Zh(n)})`);if(!e.ok){a(e.error??`Create failed`),s(!1);return}U.success(`Created queue ${n}`),await t()}return(0,B.jsx)(Kp,{open:!0,onClose:e,width:`w-120`,title:`Create a new queue`,footer:(0,B.jsxs)(B.Fragment,{children:[i&&(0,B.jsx)(`p`,{className:`min-w-0 truncate text-xs text-destructive`,children:i}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,children:`Cancel`})}),(0,B.jsx)(H,{onClick:()=>void c(),disabled:o||!n,children:o?`Creating\u2026`:`Create queue`})]})]}),children:(0,B.jsx)(`div`,{className:`space-y-3`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Name`}),(0,B.jsx)(Y,{mono:!0,value:n,autoFocus:!0,placeholder:`jobs`,onChange:e=>r(e.target.value),onKeyDown:e=>e.key===`Enter`&&void c()}),(0,B.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground/60`,children:`Lowercase letters, digits and underscores.`})]})})})}function rg({queue:e,onClose:t,onDone:n}){let[r,i]=(0,_.useState)(`{ \"task\": \"hello\" }`),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(!1);async function l(){try{JSON.parse(r)}catch{return o(`Payload must be valid JSON.`)}c(!0),o(``);let t=await N.sql(`select pgmq.send(${Zh(e.name)}, ${Zh(r)}::jsonb)`);if(!t.ok){o(t.error??`Send failed`),c(!1);return}U.success(`Sent to ${e.name}`),await n()}return(0,B.jsx)(Kp,{open:!0,onClose:t,width:`w-120`,title:(0,B.jsxs)(`span`,{children:[`Send message to`,` `,(0,B.jsx)(`code`,{className:`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e.name})]}),footer:(0,B.jsxs)(B.Fragment,{children:[a&&(0,B.jsx)(`p`,{className:`min-w-0 truncate text-xs text-destructive`,children:a}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,children:`Cancel`})}),(0,B.jsx)(H,{onClick:()=>void l(),disabled:s,children:s?`Sending\u2026`:`Send message`})]})]}),children:(0,B.jsx)(`div`,{className:`space-y-3`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Message (JSON)`}),(0,B.jsx)($p,{rows:6,value:r,onChange:e=>i(e.target.value)})]})})})}function ig({queue:e,onClose:t}){let[n,r]=(0,_.useState)(null);return(0,_.useEffect)(()=>{N.sql(`select msg_id, read_ct, enqueued_at, vt, message from pgmq.${`q_`+e.name} order by msg_id desc limit 50`).then(e=>r(e.ok?e.rows??[]:[]))},[e.name]),(0,B.jsx)(Kp,{open:!0,onClose:t,flush:!0,width:`w-[620px]`,title:(0,B.jsxs)(`span`,{children:[`Messages in`,` `,(0,B.jsx)(`code`,{className:`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e.name})]}),footer:(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,className:`ml-auto`,children:`Done`})}),children:n===null?(0,B.jsx)(`div`,{className:`p-5`,children:(0,B.jsx)(qp,{})}):n.length===0?(0,B.jsx)(cf,{children:`Queue is empty.`}):(0,B.jsx)(`div`,{className:`h-full overflow-auto`,children:(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Z,{children:`id`}),(0,B.jsx)(Z,{children:`reads`}),(0,B.jsx)(Z,{children:`enqueued`}),(0,B.jsx)(Z,{children:`message`})]})}),(0,B.jsx)(`tbody`,{children:n.map((e,t)=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:`font-mono text-muted-foreground`,children:String(e.msg_id)}),(0,B.jsx)(Q,{className:`tabular-nums text-muted-foreground`,children:String(e.read_ct)}),(0,B.jsx)(Q,{className:`text-muted-foreground`,children:(0,B.jsx)(Km,{value:e.enqueued_at})}),(0,B.jsx)(Q,{className:`max-w-70 truncate font-mono text-[11px]`,children:(0,B.jsx)(qm,{value:e.message})})]},t))})]})})})}function ag(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(null),o=(0,_.useCallback)(async()=>{let[e,n]=await Promise.allSettled([N.webhooksConfig(),N.sql(`select id, status_code, timed_out, error_msg, created from net._http_response order by id desc limit 50`)]);t(e.status===`fulfilled`?e.value:[]),n.status===`fulfilled`&&n.value.ok?(a(null),r(n.value.rows??[])):a((n.status===`fulfilled`?n.value.error:n.reason?.message)??`Query failed`)},[]);return(0,_.useEffect)(()=>{o()},[o]),e===null?(0,B.jsx)(qp,{}):(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsx)(Yh,{title:`Webhooks`,description:`Fire HTTP requests on table changes (CDC \u2192 HTTP) \u2014 configured via supabase/webhooks.json or createBackend({ webhooks }).`,onRefresh:()=>void o()}),i&&(0,B.jsx)(df,{message:i}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Z,{children:`Table`}),(0,B.jsx)(Z,{children:`Events`}),(0,B.jsx)(Z,{children:`URL`})]})}),(0,B.jsx)(`tbody`,{children:e.map((e,t)=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:`font-mono text-foreground/90`,children:e.table}),(0,B.jsx)(Q,{children:(0,B.jsx)(`span`,{className:`flex gap-1`,children:(e.events?.length?e.events:[`INSERT`,`UPDATE`,`DELETE`]).map(e=>(0,B.jsx)(V,{variant:`blue`,children:e},e))})}),(0,B.jsx)(Q,{className:`max-w-90 truncate font-mono text-[12px] text-muted-foreground`,title:e.url,children:e.url})]},t))})]}),e.length===0&&(0,B.jsxs)(cf,{children:[`No webhooks configured. Add `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`supabase/webhooks.json`}),` \u2014`,` `,(0,B.jsxs)(`code`,{className:`text-muted-foreground`,children:[`[`,`{ \"table\": \"orders\", \"url\": \"https://\u2026\" }`,`]`]}),` \u2014 and restart.`]}),(0,B.jsx)(`h2`,{className:`border-b border-border px-6 pb-2 pt-6 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/80`,children:`Recent outbound requests (pg_net + webhooks)`}),(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Z,{children:`id`}),(0,B.jsx)(Z,{children:`Status`}),(0,B.jsx)(Z,{children:`Error`}),(0,B.jsx)(Z,{children:`At`})]})}),(0,B.jsx)(`tbody`,{children:n.map(e=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:`font-mono text-muted-foreground`,children:e.id}),(0,B.jsx)(Q,{children:e.timed_out?(0,B.jsx)(V,{variant:`red`,children:`timeout`}):e.status_code&&e.status_code<400?(0,B.jsx)(V,{variant:`brand`,children:e.status_code}):(0,B.jsx)(V,{variant:`red`,children:e.status_code??`error`})}),(0,B.jsx)(Q,{className:`max-w-90 truncate font-mono text-[11px] text-muted-foreground/80`,children:e.error_msg??`\u2014`}),(0,B.jsx)(Q,{className:`text-muted-foreground`,children:(0,B.jsx)(Km,{value:e.created})})]},e.id))})]}),n.length===0&&(0,B.jsx)(cf,{children:`No outbound requests recorded yet.`})]})]})}var og=[{id:`cron`,label:`Cron`,component:Qh},{id:`queues`,label:`Queues`,component:tg},{id:`webhooks`,label:`Webhooks`,component:ag}];function sg(){let{section:e}=qt(),t=og.some(t=>t.id===e)?e:`cron`,n=og.find(e=>e.id===t).component;return(0,B.jsxs)(`div`,{className:`flex h-full`,children:[(0,B.jsx)(wh,{title:`Automations`,active:t,onSelect:e=>z(`automations`,e),groups:[{items:og.map(e=>({id:e.id,label:e.label}))}]}),(0,B.jsx)(`div`,{className:`min-w-0 flex-1 overflow-hidden`,children:(0,B.jsx)(n,{})})]})}function cg(){let[e]=Uh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(null),p=(0,_.useCallback)(async()=>{let t=await N.sql(`select t.typname as name, array_agg(e.enumlabel order by e.enumsortorder) as values,\n obj_description(t.oid, 'pg_type') as comment\n from pg_type t join pg_enum e on e.enumtypid = t.oid\n join pg_namespace n on n.oid = t.typnamespace\n where n.nspname = ${Zh(e)}\n group by t.typname, t.oid order by t.typname`);if(!t.ok){i(t.error??`Query failed`),n(e=>e??[]);return}i(null),n((t.rows??[]).map(e=>({...e,values:Lt(e.values)})))},[e]);(0,_.useEffect)(()=>{p();let e=setInterval(()=>void p(),5e3);return()=>clearInterval(e)},[p]);async function m(t){let n=await N.sql(`drop type ${Gh(e,t.name)}`);if(!n.ok){U.error(n.error??`Drop failed \u2014 is the type still used by a column?`);return}U.success(`Dropped type ${t.name}`),await p()}if(t===null)return(0,B.jsx)(qp,{});let h=t.filter(e=>e.name.toLowerCase().includes(a.toLowerCase()));return(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsx)(Yh,{title:`Enumerated Types`,description:`Custom enum types \u2014 columns using them render as dropdowns in the table editor.`,search:a,onSearch:o,onRefresh:()=>void p(),schemaPicker:!0,actions:(0,B.jsxs)(H,{size:`xs`,onClick:()=>c(!0),children:[(0,B.jsx)(pt,{size:12}),` New type`]})}),r&&(0,B.jsx)(df,{message:r}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto p-6`,children:[h.map(e=>(0,B.jsxs)(`div`,{className:`rounded-md border border-border bg-card p-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`font-mono text-[13px] text-foreground`,children:e.name}),(0,B.jsxs)(`span`,{className:`text-[11px] text-muted-foreground/60`,children:[e.values.length,` values`]}),e.comment&&(0,B.jsxs)(`span`,{className:`truncate text-[11px] text-muted-foreground/60`,title:e.comment,children:[`\u2014 `,e.comment]}),(0,B.jsxs)(`div`,{className:`ml-auto flex gap-0.5`,children:[(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,title:`Edit type`,onClick:()=>u(e),children:(0,B.jsx)(ct,{size:12})}),(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,title:`Drop type`,onClick:()=>f(e),children:(0,B.jsx)(Ot,{size:12,className:`text-muted-foreground hover:text-destructive`})})]})]}),(0,B.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:e.values.map(e=>(0,B.jsx)(V,{variant:`outline`,className:`font-mono`,children:e},e))})]},e.name)),h.length===0&&(0,B.jsx)(cf,{children:t.length===0?`No enum types yet.`:`No match.`})]}),s&&(0,B.jsx)(lg,{schema:e,onClose:()=>c(!1),onDone:async()=>{c(!1),await p()}}),l&&(0,B.jsx)(lg,{schema:e,existing:l,onClose:()=>u(null),onDone:async()=>{u(null),await p()}}),d&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Drop type \"${d.name}\"?`,description:`Fails if any column still uses the type. This cannot be undone.`,confirmLabel:`Drop type`,onConfirm:()=>void m(d),onClose:()=>f(null)})]})}function lg({schema:e,existing:t,onClose:n,onDone:r}){let[i,a]=(0,_.useState)(t?.name??``),[o,s]=(0,_.useState)(t?.comment??``),[c,l]=(0,_.useState)(t?[...t.values]:[``]),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(``),m=t?.values.length??0;async function h(e){let t=await N.sql(e);return t.ok?!0:(p(t.error??`Statement failed`),d(!1),!1)}async function g(){let n=c.map(e=>e.trim()),a=i.trim();if(!a)return p(`Name is required.`);if(n.some((e,t)=>!e&&t<m))return p(`Existing values cannot be blank.`);let s=n.filter(Boolean);if(s.length===0)return p(`At least one value is required.`);if(new Set(s).size!==s.length)return p(`Values must be unique.`);if(d(!0),p(``),!t){if(!await h(`create type ${Gh(e,a)} as enum (${s.map(Zh).join(`, `)})`)||o.trim()&&!await h(`comment on type ${Gh(e,a)} is ${Zh(o.trim())}`))return;U.success(`Created type ${a}`),await r();return}let l=t.name;for(let r=0;r<m;r++)if(n[r]!==t.values[r]&&!await h(`alter type ${Gh(e,l)} rename value ${Zh(t.values[r])} to ${Zh(n[r])}`))return;if(a!==t.name){if(!await h(`alter type ${Gh(e,l)} rename to ${Xh(a)}`))return;l=a}for(let t of n.slice(m).filter(Boolean))if(!await h(`alter type ${Gh(e,l)} add value if not exists ${Zh(t)}`))return;if((o.trim()||null)!==(t.comment??null)){let t=o.trim()?Zh(o.trim()):`null`;if(!await h(`comment on type ${Gh(e,l)} is ${t}`))return}U.success(`Updated type ${l}`),await r()}return(0,B.jsx)(Kp,{open:!0,onClose:n,width:`w-135`,title:t?`Edit type \"${t.name}\"`:`Create a new enumerated type`,footer:(0,B.jsxs)(B.Fragment,{children:[f&&(0,B.jsx)(`p`,{className:`min-w-0 truncate text-xs text-destructive`,children:f}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,children:`Cancel`})}),(0,B.jsx)(H,{onClick:()=>void g(),disabled:u,children:u?`Saving\u2026`:t?`Save changes`:`Create type`})]})]}),children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Name`}),(0,B.jsx)(Y,{mono:!0,value:i,autoFocus:!t,placeholder:`order_status`,onChange:e=>a(e.target.value)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(X,{children:[`Description `,(0,B.jsx)(`span`,{className:`font-normal text-muted-foreground/60`,children:`\u2014 optional`})]}),(0,B.jsx)(Y,{value:o,onChange:e=>s(e.target.value)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Values`}),(0,B.jsxs)(`div`,{className:`mb-2 flex items-start gap-2.5 rounded-md border border-border bg-card px-3 py-2.5 text-[11px] leading-relaxed text-muted-foreground`,children:[(0,B.jsx)(ge,{size:13,className:`mt-px shrink-0`}),(0,B.jsx)(`span`,{children:t?`Existing values can be renamed but never deleted or re-ordered \u2014 that requires dropping and recreating the type.`:`After creation, values cannot be deleted or sorted \u2014 only renamed or appended.`})]}),(0,B.jsx)(`div`,{className:`space-y-1.5`,children:c.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(Y,{mono:!0,value:e,placeholder:t<m?void 0:`new value`,onChange:e=>l(n=>n.map((n,r)=>r===t?e.target.value:n))}),t>=m&&(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,title:`Remove`,onClick:()=>l(e=>e.filter((e,n)=>n!==t)),children:(0,B.jsx)(Ot,{size:12,className:`text-muted-foreground`})})]},t))}),(0,B.jsxs)(H,{variant:`outline`,size:`xs`,className:`mt-2`,onClick:()=>l(e=>[...e,``]),children:[(0,B.jsx)(pt,{size:12}),` Add value`]})]})]})})}function ug(){let[e]=Uh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(null),h=(0,_.useCallback)(()=>{N.functions(e).then(e=>n(e),()=>n([]))},[e]);(0,_.useEffect)(()=>{h();let e=setInterval(()=>void h(),5e3);return()=>clearInterval(e)},[h]);let g=(0,_.useMemo)(()=>[...new Set((t??[]).map(e=>e.returns))].sort(),[t]);async function v(t){let n=await N.sql(`drop function ${Xh(e)}.${Xh(t.name)}(${t.args??``})`);if(!n.ok){U.error(n.error??`Drop failed`);return}U.success(`Dropped function ${t.name}`),h()}if(t===null)return(0,B.jsx)(qp,{});let y=t.filter(e=>e.name.toLowerCase().includes(r.toLowerCase())&&(!a||e.returns===a)&&(!s||s===`definer`==!!e.security_definer));return(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsx)(Yh,{title:`Functions`,description:`User-defined functions in the selected schema \u2014 usable from SQL, triggers, and RPC.`,search:r,onSearch:i,onRefresh:h,schemaPicker:!0,filters:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Up,{className:`w-36 shrink-0`,value:a,onValueChange:o,placeholder:`Return type`,options:[{value:``,label:`All return types`},...g.map(e=>({value:e}))]}),(0,B.jsx)(Up,{className:`w-32 shrink-0`,value:s,onValueChange:c,placeholder:`Security`,options:[{value:``,label:`All security`},{value:`definer`,label:`Definer`},{value:`invoker`,label:`Invoker`}]})]}),actions:(0,B.jsxs)(H,{size:`xs`,onClick:()=>f(!0),children:[(0,B.jsx)(pt,{size:12}),` New function`]})}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Z,{children:`Name`}),(0,B.jsx)(Z,{children:`Arguments`}),(0,B.jsx)(Z,{children:`Returns`}),(0,B.jsx)(Z,{children:`Language`}),(0,B.jsx)(Z,{children:`Security`}),(0,B.jsx)(Z,{className:`w-20`})]})}),(0,B.jsx)(`tbody`,{children:y.map(e=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:`font-mono text-foreground/90`,children:e.name}),(0,B.jsx)(Q,{className:`max-w-70 truncate font-mono text-[11px] text-muted-foreground/80`,children:e.args||`\u2014`}),(0,B.jsx)(Q,{className:`font-mono text-muted-foreground`,children:e.returns}),(0,B.jsx)(Q,{className:`text-muted-foreground`,children:e.language}),(0,B.jsx)(Q,{children:e.security_definer?(0,B.jsx)(V,{variant:`amber`,children:`definer`}):(0,B.jsx)(V,{variant:`neutral`,children:`invoker`})}),(0,B.jsx)(Q,{children:(0,B.jsxs)(`div`,{className:`flex justify-end gap-0.5 opacity-0 group-hover:opacity-100`,children:[(0,B.jsx)(`button`,{className:`p-1 text-muted-foreground/80 hover:text-foreground`,title:`View source`,onClick:()=>u(e),children:(0,B.jsx)(ke,{size:13})}),(0,B.jsx)(`button`,{className:`p-1 text-muted-foreground/80 hover:text-destructive`,title:`Drop`,onClick:()=>m(e),children:(0,B.jsx)(Ot,{size:13})})]})})]},e.name+e.args))})]}),y.length===0&&(0,B.jsx)(cf,{children:t.length===0?`No user functions yet.`:`No match.`})]}),l&&(0,B.jsx)(Kp,{open:!0,onClose:()=>u(null),width:`w-[640px]`,title:(0,B.jsxs)(`span`,{children:[`Source of `,(0,B.jsx)(`code`,{className:`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground`,children:l.name})]}),footer:(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,className:`ml-auto`,children:`Done`})}),children:(0,B.jsx)(er,{value:l.body?.trim()??`-- source unavailable`,lang:`sql`,readOnly:!0,gutter:!0,minLines:6,maxLines:400})}),d&&(0,B.jsx)(mg,{schema:e,onDone:()=>{f(!1),h()},onClose:()=>f(!1)}),p&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Drop function \"${p.name}\"?`,description:`Triggers and RPC calls that use it will fail. This cannot be undone.`,confirmLabel:`Drop function`,onConfirm:()=>void v(p),onClose:()=>m(null)})]})}var dg=[`void`,`trigger`,`text`,`int4`,`int8`,`numeric`,`bool`,`uuid`,`jsonb`,`timestamptz`,`record`],fg=[`text`,`int4`,`int8`,`numeric`,`bool`,`uuid`,`jsonb`,`timestamptz`,`date`],pg={plpgsql:`begin\n\nend;`,sql:`select 1;`};function mg({schema:e,onDone:t,onClose:n}){let[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(`void`),[l,u]=(0,_.useState)(`plpgsql`),[d,f]=(0,_.useState)(pg.plpgsql),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(!1),[v,y]=(0,_.useState)(``),[b,x]=(0,_.useState)(!1),S=e=>`\"`+e.replace(/\"/g,`\"\"`)+`\"`,C=a.filter(e=>e.name.trim()).map(e=>`${S(e.name.trim())} ${e.type}`).join(`, `),w=`create or replace function ${S(e)}.${S(r.trim()||`my_function`)}(${C})\nreturns ${s}\nlanguage ${l}${p?`\nsecurity definer`:``}\nas $$\n${d}\n$$;`;async function T(){if(!r.trim())return y(`Function name is required.`);x(!0),y(``);let e=await N.sql(w);if(!e.ok){y(e.error??`Create failed`),x(!1);return}U.success(`Created function ${r.trim()}`),t()}return(0,B.jsx)(Kp,{open:!0,onClose:n,width:`w-160`,title:`Add a new function`,footer:(0,B.jsxs)(B.Fragment,{children:[v&&(0,B.jsx)(`p`,{className:`min-w-0 truncate text-xs text-destructive`,children:v}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,children:`Cancel`})}),(0,B.jsx)(H,{onClick:()=>void T(),disabled:b||!r.trim(),children:b?`Creating\u2026`:`Create function`})]})]}),children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Schema`}),(0,B.jsx)(`div`,{className:`flex h-8 items-center rounded-md border border-border bg-card px-2.5 font-mono text-[13px] text-muted-foreground`,children:e})]}),(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Name of function`}),(0,B.jsx)(Y,{mono:!0,value:r,autoFocus:!0,placeholder:`my_function`,onChange:e=>i(e.target.value.replace(/\\s/g,`_`))})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Return type`}),(0,B.jsx)(Up,{mono:!0,value:s,onValueChange:c,options:dg.map(e=>({value:e}))})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(X,{children:[`Arguments `,(0,B.jsx)(`span`,{className:`font-normal text-muted-foreground/60`,children:`\u2014 referenced in the body by name`})]}),(0,B.jsx)(`div`,{className:`space-y-1.5`,children:a.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(Y,{mono:!0,value:e.name,placeholder:`arg_name`,onChange:e=>o(n=>n.map((n,r)=>r===t?{...n,name:e.target.value}:n))}),(0,B.jsx)(Up,{mono:!0,className:`w-36 shrink-0`,value:e.type,onValueChange:e=>o(n=>n.map((n,r)=>r===t?{...n,type:e}:n)),options:fg.map(e=>({value:e}))}),(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,title:`Remove`,onClick:()=>o(e=>e.filter((e,n)=>n!==t)),children:(0,B.jsx)(Ot,{size:12,className:`text-muted-foreground`})})]},t))}),(0,B.jsxs)(H,{variant:`outline`,size:`xs`,className:`mt-1.5`,onClick:()=>o(e=>[...e,{name:``,type:`text`}]),children:[(0,B.jsx)(pt,{size:12}),` Add a new argument`]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(X,{children:[`Definition `,(0,B.jsxs)(`span`,{className:`font-normal text-muted-foreground/60`,children:[`\u2014 written in `,l]})]}),(0,B.jsx)(nr,{lang:`sql`,className:`h-44`,value:d,onChange:f,onCmdEnter:()=>void T()})]}),(0,B.jsxs)(`button`,{className:`flex w-full items-center justify-between rounded-md border border-border bg-card px-3 py-2.5 text-left text-[13px] text-foreground/85 transition-colors hover:border-muted-foreground/60`,onClick:()=>g(e=>!e),children:[`Show advanced settings`,(0,B.jsx)(Jp,{checked:h,onChange:()=>g(e=>!e)})]}),h&&(0,B.jsxs)(`div`,{className:`space-y-3 rounded-md border border-border bg-card p-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Language`}),(0,B.jsx)(Up,{mono:!0,value:l,onValueChange:e=>{u(e),f(t=>Object.values(pg).includes(t)?pg[e]:t)},options:[{value:`plpgsql`},{value:`sql`}]})]}),(0,B.jsxs)(`label`,{className:`flex items-center gap-3 text-[13px] text-foreground/85`,children:[(0,B.jsx)(Jp,{checked:p,onChange:m}),(0,B.jsxs)(`span`,{children:[`SECURITY DEFINER `,(0,B.jsx)(`span`,{className:`text-[11px] text-muted-foreground/60`,children:`\u2014 runs with the owner's privileges (bypasses caller RLS)`})]})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Preview of SQL statement`}),(0,B.jsx)(er,{value:w,lang:`sql`,readOnly:!0,minLines:4,maxLines:10})]})]})})}function hg(){let[e]=Uh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(null),d=(0,_.useCallback)(async()=>{let t=await N.sql(`select i.indexname as name, i.tablename as \"table\", i.indexdef as def,\n exists (select 1 from pg_constraint c where c.conname = i.indexname) as constraint\n from pg_indexes i where i.schemaname = ${Zh(e)} order by i.tablename, i.indexname`);if(!t.ok){i(t.error??`Query failed`),n(e=>e??[]);return}i(null),n(t.rows??[])},[e]);(0,_.useEffect)(()=>{d();let e=setInterval(()=>void d(),5e3);return()=>clearInterval(e)},[d]);async function f(t){let n=await N.sql(`drop index ${Xh(e)}.${Xh(t.name)}`);if(!n.ok){U.error(n.error??`Drop failed`);return}U.success(`Dropped index ${t.name}`),await d()}if(t===null)return(0,B.jsx)(qp,{});let p=t.filter(e=>(e.name+e.table).toLowerCase().includes(a.toLowerCase()));return(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsx)(Yh,{title:`Indexes`,description:`Every index in the selected schema, including constraint-backed ones (locked).`,search:a,onSearch:o,onRefresh:()=>void d(),schemaPicker:!0,actions:(0,B.jsxs)(H,{size:`xs`,onClick:()=>c(!0),children:[(0,B.jsx)(pt,{size:12}),` New index`]})}),r&&(0,B.jsx)(df,{message:r}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Z,{children:`Name`}),(0,B.jsx)(Z,{children:`Table`}),(0,B.jsx)(Z,{children:`Definition`}),(0,B.jsx)(Z,{className:`w-12`})]})}),(0,B.jsx)(`tbody`,{children:p.map(e=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:`font-mono text-foreground/90`,children:e.name}),(0,B.jsx)(Q,{className:`font-mono text-muted-foreground`,children:e.table}),(0,B.jsx)(Q,{className:`max-w-120 truncate font-mono text-[11px]`,title:e.def,children:(0,B.jsx)(`span`,{className:`text-muted-foreground/80`,children:e.def})}),(0,B.jsx)(Q,{children:!e.constraint&&(0,B.jsx)(`button`,{className:`p-1 text-muted-foreground/80 opacity-0 hover:text-destructive group-hover:opacity-100`,title:`Drop index`,onClick:()=>u(e),children:(0,B.jsx)(Ot,{size:13})})})]},e.name))})]}),p.length===0&&(0,B.jsx)(cf,{children:t.length===0?`No indexes.`:`No match.`})]}),s&&(0,B.jsx)(_g,{schema:e,onClose:()=>c(!1),onDone:async()=>{c(!1),await d()}}),l&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Drop index \"${l.name}\"?`,description:`Queries relying on it may slow down. This cannot be undone.`,confirmLabel:`Drop index`,onConfirm:()=>void f(l),onClose:()=>u(null)})]})}var gg=[`btree`,`hash`,`gin`,`gist`,`brin`];function _g({schema:e,onClose:t,onDone:n}){let[r,i]=(0,_.useState)([]),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)([]),[l,u]=(0,_.useState)(`btree`),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(``);(0,_.useEffect)(()=>{N.tables(e).then(e=>{let t=e.filter(e=>!e.isView).map(e=>({name:e.name,columns:e.columns.map(e=>e.name)}));i(t),o(e=>e||(t[0]?.name??``))},()=>{})},[e]);let h=r.find(e=>e.name===a)?.columns??[],g=e=>`\"`+e.replace(/\"/g,`\"\"`)+`\"`,v=a&&s.length>0?`create index on ${g(e)}.${g(a)} using ${l} (${s.map(g).join(`, `)});`:`-- pick a table and at least one column`;function y(e){c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}async function b(){f(!0),m(``);let e=await N.sql(v);if(!e.ok){m(e.error??`Create failed`),f(!1);return}U.success(`Index created on ${a}`),await n()}return(0,B.jsx)(Kp,{open:!0,onClose:t,width:`w-140`,title:`Create new index`,footer:(0,B.jsxs)(B.Fragment,{children:[p&&(0,B.jsx)(`p`,{className:`min-w-0 truncate text-xs text-destructive`,children:p}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,children:`Cancel`})}),(0,B.jsx)(H,{onClick:()=>void b(),disabled:d||!a||s.length===0,children:d?`Creating\u2026`:`Create index`})]})]}),children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Schema`}),(0,B.jsx)(`div`,{className:`flex h-8 items-center rounded-md border border-border bg-card px-2.5 font-mono text-[13px] text-muted-foreground`,children:e})]}),(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Table`}),(0,B.jsx)(Up,{mono:!0,value:a,onValueChange:e=>{o(e),c([])},placeholder:`Pick a table\u2026`,options:r.map(e=>({value:e.name}))})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Index type`}),(0,B.jsx)(Up,{mono:!0,value:l,onValueChange:u,options:gg.map(e=>({value:e}))})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Columns \u2014 click to add; order matters for btree`}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 rounded-md border border-input bg-field p-2`,children:[h.map(e=>{let t=s.indexOf(e);return(0,B.jsxs)(`button`,{onClick:()=>y(e),className:`flex items-center gap-1 rounded border px-2 py-1 font-mono text-xs transition-colors `+(t>=0?`border-brand/50 bg-brand/15 text-brand`:`border-input text-muted-foreground hover:border-muted-foreground hover:text-foreground`),children:[t>=0&&(0,B.jsxs)(`span`,{className:`tabular-nums`,children:[t+1,`.`]}),e]},e)}),h.length===0&&(0,B.jsx)(`span`,{className:`px-1 py-0.5 text-xs text-muted-foreground/60`,children:`No table selected.`})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Preview of SQL statement`}),(0,B.jsx)(er,{value:v,lang:`sql`,readOnly:!0,minLines:2,maxLines:6})]})]})})}function vg(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),i=(0,_.useCallback)(async()=>{let e=await N.sql(`select * from supabase_migrations.schema_migrations order by version`);e.ok?t(e.rows??[]):N.migrations().then(e=>t(e),()=>t([]))},[]);if((0,_.useEffect)(()=>{i()},[i]),e===null)return(0,B.jsx)(qp,{});let a=e=>Array.isArray(e.statements)?e.statements.join(`\n\n`):typeof e.statements==`string`&&e.statements.trim()?e.statements:null;return(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsx)(Yh,{title:`Migrations`,description:`Applied migrations from supabase/migrations/*.sql \u2014 the same ledger the Supabase CLI uses.`,onRefresh:()=>void i()}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Z,{children:`Version`}),(0,B.jsx)(Z,{children:`Name`}),(0,B.jsx)(Z,{children:`Applied`}),(0,B.jsx)(Z,{className:`w-12`})]})}),(0,B.jsx)(`tbody`,{children:e.map(e=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:`font-mono text-muted-foreground`,children:e.version}),(0,B.jsx)(Q,{className:`font-mono text-foreground/90`,children:e.name||`\u2014`}),(0,B.jsx)(Q,{className:`text-muted-foreground`,children:(0,B.jsx)(Km,{value:e.applied_at})}),(0,B.jsx)(Q,{children:a(e)&&(0,B.jsx)(`button`,{className:`p-1 text-muted-foreground/80 opacity-0 hover:text-foreground group-hover:opacity-100`,title:`View SQL`,onClick:()=>r(e),children:(0,B.jsx)(ke,{size:13})})})]},e.version))})]}),e.length===0&&(0,B.jsxs)(cf,{children:[`No migrations applied. Add SQL files under `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`supabase/migrations/`}),` and restart.`]})]}),n&&(0,B.jsx)(Kp,{open:!0,onClose:()=>r(null),width:`w-[640px]`,title:(0,B.jsxs)(`span`,{children:[`Migration `,(0,B.jsx)(`code`,{className:`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground`,children:n.name??n.version})]}),footer:(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,className:`ml-auto`,children:`Done`})}),children:(0,B.jsx)(er,{value:a(n)??`-- SQL not recorded for this migration`,lang:`sql`,readOnly:!0,gutter:!0,minLines:6,maxLines:500})})]})}var yg=[`SELECT`,`INSERT`,`UPDATE`,`DELETE`,`ALL`],bg=e=>e!==`INSERT`,xg=e=>e===`INSERT`||e===`UPDATE`||e===`ALL`,Sg={SELECT:`brand`,INSERT:`amber`,UPDATE:`blue`,DELETE:`red`,ALL:`neutral`},Cg=[{title:`Enable read access for all users`,description:`This policy gives read access to your table for all users via the SELECT operation.`,command:`SELECT`,roles:[],using:`true`},{title:`Enable insert for authenticated users only`,description:`This policy gives insert access to your table for all authenticated users only.`,command:`INSERT`,roles:[`authenticated`],check:`true`},{title:`Enable delete for users based on user_id`,description:`This policy assumes that your table has a column \"user_id\", and allows users to delete rows which the \"user_id\" column matches their ID.`,command:`DELETE`,roles:[],using:`(select auth.uid()) = user_id`},{title:`Enable insert for users based on user_id`,description:`This policy assumes that your table has a column \"user_id\", and allows users to insert rows which the \"user_id\" column matches their ID.`,command:`INSERT`,roles:[],check:`(select auth.uid()) = user_id`},{title:`Enable users to view their own data only`,description:`Restrict users to reading only their own data, matching \"user_id\" against their ID.`,command:`SELECT`,roles:[`authenticated`],using:`(select auth.uid()) = user_id`},{title:`Policy with table joins`,description:(0,B.jsxs)(B.Fragment,{children:[`Query across tables to build more advanced RLS rules. Assuming 2 tables called`,` `,(0,B.jsx)(`code`,{className:`rounded bg-accent px-1 text-[11px]`,children:`teams`}),` and`,` `,(0,B.jsx)(`code`,{className:`rounded bg-accent px-1 text-[11px]`,children:`members`}),`, you can query both tables in the policy to control access to the members table.`]}),command:`UPDATE`,roles:[],using:`team_id in (select team_id from members where user_id = (select auth.uid()))`,check:`team_id in (select team_id from members where user_id = (select auth.uid()))`},{title:`Policy with security definer functions`,description:(0,B.jsxs)(B.Fragment,{children:[`Useful in a many-to-many relationship where you want to restrict access to the linking table. Use a`,` `,(0,B.jsx)(`code`,{className:`rounded bg-accent px-1 text-[11px]`,children:`security definer`}),` function in combination with a policy to avoid recursive RLS lookups.`]}),command:`ALL`,roles:[],using:`team_id in (select private.get_teams_for_user((select auth.uid())))`,check:`team_id in (select private.get_teams_for_user((select auth.uid())))`},{title:`Policy to implement Time To Live (TTL)`,description:`Implement a TTL-like feature as seen in Instagram stories or Snapchat. Rows are only visible if they were created within the last 24 hours.`,command:`SELECT`,roles:[`authenticated`],using:`created_at > (current_timestamp - interval '1 day')`}];function wg({table:e,tables:t,schema:n=`public`,existing:r,onClose:i,onCreated:a}){let[o,s]=(0,_.useState)(e??``),[c,l]=(0,_.useState)(r?.name??``),[u,d]=(0,_.useState)(r?.behavior??`PERMISSIVE`),[f,p]=(0,_.useState)(r?.command??`SELECT`),[m,h]=(0,_.useState)(r?.roles.filter(e=>e!==`public`)??[]),[g,v]=(0,_.useState)(r?.using??``),[y,b]=(0,_.useState)(r?.check??``),[x,S]=(0,_.useState)(``),[C,w]=(0,_.useState)(!1),[T,E]=(0,_.useState)(``),[D,O]=(0,_.useState)(!r),[k,A]=(0,_.useState)(!1),[j,M]=(0,_.useState)([`anon`,`authenticated`]);(0,_.useEffect)(()=>{N.sql(`select rolname from pg_roles where rolname not like 'pg\\\\_%' order by rolname`).then(e=>{let t=(e.rows??[]).map(e=>e.rolname);e.ok&&t.length>0&&M(t)}).catch(()=>{})},[]);let P=m.length>0?m.join(`, `):`public`;function ee(e){l(e.title),p(e.command),h(e.roles),v(e.using??``),b(e.check??``),E(``)}async function F(){if(!o)return E(`Pick a table for the policy.`);if(!c.trim())return E(`Policy name is required.`);w(!0),E(``);let e={schema:n,table:o,name:c.trim(),command:f,behavior:u,roles:P,using:bg(f)&&g.trim()||void 0,check:xg(f)&&y.trim()||void 0};try{if(r){await N.dropPolicy(o,r.name,n);try{await N.createPolicy(e)}catch(e){throw await N.createPolicy({schema:n,table:o,name:r.name,command:r.command,behavior:r.behavior,roles:r.roles.join(`, `)||`public`,using:r.using??void 0,check:r.check??void 0}).catch(()=>{}),e}U.success(`Updated policy \"${c.trim()}\"`)}else await N.createPolicy(e),U.success(`Created policy \"${c.trim()}\"`);await a(),i()}catch(e){E(e.message),w(!1)}}let I=Cg.filter(e=>e.title.toLowerCase().includes(x.toLowerCase()));return(0,B.jsx)(Kp,{open:!0,onClose:i,flush:!0,hideHeader:!0,width:D?`w-[980px]`:`w-[640px]`,title:r?`Edit policy \"${r.name}\"`:`Create a new Row Level Security policy`,footer:(0,B.jsxs)(B.Fragment,{children:[T&&(0,B.jsx)(`p`,{className:`min-w-0 truncate text-xs text-destructive`,children:T}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,children:`Cancel`})}),(0,B.jsx)(H,{onClick:()=>void F(),disabled:C||!c.trim(),children:C?`Saving\u2026`:`Save policy`})]})]}),children:(0,B.jsxs)(`div`,{className:`flex h-full`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-3 border-b border-border pl-3 pr-2`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(`button`,{className:`rounded p-1 text-muted-foreground/80 transition-colors hover:bg-accent hover:text-foreground`,children:(0,B.jsx)(Ft,{size:16})})}),(0,B.jsx)(`h2`,{className:`truncate text-[15px] font-medium text-foreground`,children:r?(0,B.jsxs)(B.Fragment,{children:[`Edit policy `,(0,B.jsx)(`code`,{className:`rounded bg-accent px-1.5 py-0.5 font-mono text-[13px]`,children:r.name})]}):`Create a new Row Level Security policy`}),(0,B.jsx)(`button`,{onClick:()=>O(e=>!e),title:D?`Hide templates`:`Show templates`,className:`ml-auto rounded p-1 text-muted-foreground/80 transition-colors hover:bg-accent hover:text-foreground`,children:D?(0,B.jsx)(at,{size:15}):(0,B.jsx)(ot,{size:15})})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 py-4`,children:[(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Policy name`}),(0,B.jsx)(Y,{value:c,autoFocus:!0,placeholder:`Provide a name for your policy`,onChange:e=>l(e.target.value)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(X,{children:[`Table `,(0,B.jsx)(Tg,{children:`on`})]}),e||r?(0,B.jsxs)(`div`,{className:`flex h-8 items-center rounded-md border border-border bg-card px-2.5 font-mono text-[13px] text-muted-foreground`,children:[n,`.`,o]}):(0,B.jsx)(Up,{mono:!0,value:o,onValueChange:s,placeholder:`Pick a table\u2026`,options:(t??[]).map(e=>({value:e,label:`${n}.${e}`}))})]})]}),(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(X,{children:[`Policy behavior `,(0,B.jsx)(Tg,{children:`as`})]}),(0,B.jsx)(Up,{value:u,onValueChange:e=>d(e),options:[{value:`PERMISSIVE`,label:`Permissive`},{value:`RESTRICTIVE`,label:`Restrictive`}]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(X,{children:[`Target roles `,(0,B.jsx)(Tg,{children:`to`})]}),(0,B.jsxs)(ff,{open:k,onOpenChange:A,className:`max-h-56 w-full overflow-auto p-1.5`,trigger:(0,B.jsxs)(`button`,{onClick:()=>A(e=>!e),className:`flex h-8 w-full items-center gap-1.5 rounded-md border border-input bg-field px-2.5 text-left text-[13px] transition-colors hover:border-muted-foreground focus:border-brand focus:outline-none`,children:[m.length>0?(0,B.jsx)(`span`,{className:`truncate font-mono text-foreground`,children:m.join(`, `)}):(0,B.jsx)(`span`,{className:`truncate text-muted-foreground/60`,children:`Defaults to all (public) roles`}),(0,B.jsx)(pe,{size:13,className:`ml-auto shrink-0 text-muted-foreground/80`})]}),children:[j.map(e=>(0,B.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[13px] text-foreground hover:bg-accent`,children:[(0,B.jsx)(Zt,{checked:m.includes(e),onChange:t=>h(n=>t?[...n,e]:n.filter(t=>t!==e))}),(0,B.jsx)(`span`,{className:`font-mono`,children:e})]},e)),m.length>0&&(0,B.jsx)(`button`,{className:`mt-1 w-full rounded px-2 py-1.5 text-left text-xs text-brand hover:bg-accent`,onClick:()=>h([]),children:`Clear \u2014 default to public`})]})]})]}),(0,B.jsx)(`p`,{className:`mt-1.5! text-[11px] text-muted-foreground/60`,children:u===`PERMISSIVE`?`Permissive policies are combined with OR \u2014 a row is visible if any permissive policy allows it.`:`Restrictive policies are combined with AND \u2014 they narrow down what permissive policies allow.`}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(X,{children:[`Policy command `,(0,B.jsx)(Tg,{children:`for`})]}),(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:yg.map(e=>{let t=f===e;return(0,B.jsxs)(`button`,{onClick:()=>p(e),className:`flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition-colors `+(t?`border-foreground bg-accent text-foreground`:`border-input text-muted-foreground hover:border-muted-foreground hover:text-foreground`),children:[t?(0,B.jsx)(ve,{size:12,className:`text-brand`}):(0,B.jsx)(ye,{size:12,className:`text-muted-foreground/60`}),e]},e)})})]}),(0,B.jsx)(Eg,{name:c,schema:n,table:o,behavior:u,command:f,roleStr:P,usingExpr:bg(f)?g:null,checkExpr:xg(f)?y:null,onUsing:v,onCheck:b})]})]}),(0,B.jsx)(`div`,{className:`shrink-0 overflow-hidden transition-[width] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]`,style:{width:D?340:0},children:(0,B.jsxs)(`div`,{className:`flex h-full w-85 flex-col border-l border-border bg-card`,children:[(0,B.jsx)(`div`,{className:`flex h-12 shrink-0 items-end border-b border-border px-4`,children:(0,B.jsx)(`span`,{className:`border-b-2 border-foreground pb-3 text-[13px] font-medium text-foreground`,children:`Templates`})}),(0,B.jsx)(`div`,{className:`shrink-0 border-b border-border p-3`,children:(0,B.jsxs)(`div`,{className:`relative`,children:[(0,B.jsx)(_t,{size:13,className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60`}),(0,B.jsx)(`input`,{value:x,onChange:e=>S(e.target.value),placeholder:`Search templates\u2026`,className:`h-8 w-full rounded-md border border-input bg-field pl-8 pr-2 text-xs text-foreground placeholder:text-muted-foreground/60 focus:border-muted-foreground focus:outline-none`})]})}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto p-3`,children:[I.map(e=>(0,B.jsxs)(`button`,{onClick:()=>ee(e),className:`w-full rounded-md border border-border bg-popover p-3 text-left transition-colors hover:border-muted-foreground`,children:[(0,B.jsx)(V,{variant:Sg[e.command],children:e.command}),(0,B.jsx)(`p`,{className:`mt-2 text-[13px] font-medium text-foreground`,children:e.title}),(0,B.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground/80`,children:e.description})]},e.title)),I.length===0&&(0,B.jsx)(`p`,{className:`py-6 text-center text-xs text-muted-foreground/60`,children:`No matching template.`})]})]})})]})})}function Tg({children:e}){return(0,B.jsx)(`span`,{className:`mx-0.5 rounded border border-input bg-accent px-1 py-px font-mono text-[10px] normal-case text-muted-foreground`,children:e})}function Eg({name:e,schema:t,table:n,behavior:r,command:i,roleStr:a,usingExpr:o,checkExpr:s,onUsing:c,onCheck:l}){let u=e=>(0,B.jsx)(`span`,{className:`text-info`,children:e}),d=o!==null&&s===null,f=[{key:`create`,kind:`static`,content:(0,B.jsxs)(B.Fragment,{children:[u(`create policy`),` `,(0,B.jsxs)(`span`,{className:`text-warning`,children:[`\"`,e||`policy_name`,`\"`]})]})},{key:`on`,kind:`static`,content:(0,B.jsxs)(B.Fragment,{children:[u(`on`),` \"`,t,`\".\"`,n,`\"`]})},{key:`as`,kind:`static`,content:(0,B.jsxs)(B.Fragment,{children:[u(`as`),` `,r]})},{key:`for`,kind:`static`,content:(0,B.jsxs)(B.Fragment,{children:[u(`for`),` `,i]})},{key:`to`,kind:`static`,content:(0,B.jsxs)(B.Fragment,{children:[u(`to`),` `,a,o===null&&s===null?`;`:``]})}];return o!==null&&f.push({key:`using-open`,kind:`static`,content:(0,B.jsxs)(B.Fragment,{children:[u(`using`),` (`]})},{key:`using-expr`,kind:`expr`,value:o,clause:`using`,onChange:c},{key:`using-close`,kind:`static`,content:(0,B.jsx)(B.Fragment,{children:d?`);`:`)`})}),s!==null&&f.push({key:`check-open`,kind:`static`,content:(0,B.jsxs)(B.Fragment,{children:[u(`with check`),` (`]})},{key:`check-expr`,kind:`expr`,value:s,clause:`with check`,onChange:l},{key:`check-close`,kind:`static`,content:(0,B.jsx)(B.Fragment,{children:`);`})}),(0,B.jsxs)(`div`,{className:`overflow-hidden rounded-md border border-border bg-code font-mono text-[13px]`,children:[(0,B.jsxs)(`p`,{className:`flex items-center gap-2 border-b border-border px-3 py-1.5 text-[10px] uppercase tracking-wider text-muted-foreground/80`,children:[(0,B.jsx)(Xe,{size:10}),` Use options above to edit`]}),(0,B.jsx)(`div`,{className:`px-1 py-2`,children:f.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex leading-6`,children:[(0,B.jsx)(`span`,{className:`w-8 shrink-0 select-none pr-3 text-right text-muted-foreground/60`,children:t+1}),e.kind===`static`?(0,B.jsx)(`span`,{className:`whitespace-pre`,children:e.content}):(0,B.jsx)(`input`,{value:e.value,onChange:t=>e.onChange(t.target.value),placeholder:`-- Provide a SQL expression for the ${e.clause} statement`,spellCheck:!1,className:`min-w-0 flex-1 border-b border-dashed border-input bg-transparent pr-2 font-mono text-brand placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none`})]},e.key))})]})}function Dg(e){return{name:e.name,command:e.cmd?.toUpperCase()??`ALL`,behavior:String(e.permissive).toUpperCase()===`RESTRICTIVE`?`RESTRICTIVE`:`PERMISSIVE`,roles:Array.isArray(e.roles)?e.roles:String(e.roles).replace(/[{}]/g,``).split(`,`).map(e=>e.trim()).filter(Boolean),using:e.using_expr,check:e.with_check}}var Og=e=>e.replace(/'/g,`''`),kg=(e,t)=>`\"${e.replace(/\"/g,`\"\"`)}\".\"${t.replace(/\"/g,`\"\"`)}\"`;async function Ag(e,t){let n=await N.sql(`select c.relrowsecurity as enabled\n from pg_class c join pg_namespace n on n.oid = c.relnamespace\n where n.nspname = '${Og(t)}' and c.relname = '${Og(e)}' and c.relkind = 'r'`);return{enabled:n.ok?!!n.rows?.[0]?.enabled:!1,policies:(await N.policies(t)).filter(t=>t.table===e)}}function jg({table:e,schema:t=`public`,refreshKey:n,onChanged:r}){let[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),c=(0,_.useCallback)(()=>{Ag(e,t).then(a,()=>a(null))},[e,t]);(0,_.useEffect)(()=>{c()},[c,n]);let l=i?.policies.length??0,u=i?.enabled&&l===0;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(H,{variant:`outline`,size:`xs`,onClick:()=>s(!0),title:i?i.enabled?u?`RLS is enabled for this table, but no policies are set. Select queries may return 0 results.`:`${l} ${l===1?`policy`:`policies`} active`:`RLS is disabled \u2014 the API exposes all rows to every role`:void 0,children:[(0,B.jsx)(Ct,{size:12}),`Add RLS policy`,i&&(0,B.jsx)(`span`,{className:`size-1.5 rounded-full `+(i.enabled?u?`bg-warning`:`bg-brand`:`bg-destructive`)})]}),o&&(0,B.jsx)(Ng,{table:e,schema:t,onClose:()=>s(!1),onChanged:()=>{c(),r?.()}})]})}function Mg({view:e,schema:t=`public`,refreshKey:n,onChanged:r}){let[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(!1),f=(0,_.useCallback)(()=>{N.sql(`select coalesce('security_invoker=true' = any(c.reloptions) or 'security_invoker=on' = any(c.reloptions), false) as invoker,\n pg_get_viewdef(c.oid, true) as def\n from pg_class c join pg_namespace n on n.oid = c.relnamespace\n where n.nspname = '${Og(t)}' and c.relname = '${Og(e)}' and c.relkind = 'v'`).then(e=>a(e.ok&&e.rows?.[0]?{invoker:!!e.rows[0].invoker,def:String(e.rows[0].def??``)}:null),()=>a(null))},[e,t]);(0,_.useEffect)(()=>{f()},[f,n]);async function p(n){let i=await N.sql(`alter view ${kg(t,e)} set (security_invoker = ${n?`on`:`off`})`);if(!i.ok){U.error(i.error??`Failed to change view security`);return}U.success(n?`${e} now runs with the caller's permissions`:`${e} now runs with the owner's permissions`),l(!1),s(!1),f(),r?.()}let m=i?.invoker??null,h=n=>`create view ${t}.${e}${n?`\nwith (security_invoker = on)`:``} as\\n${(i?.def??`\u2026`).trim()}`,g=Math.max(h(!0).split(`\n`).length,6)+1;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(ff,{open:o,onOpenChange:s,align:`end`,className:`w-120 p-4`,trigger:(0,B.jsxs)(H,{variant:`outline`,size:`xs`,className:m===!1?`border-warning/50 bg-warning/10 text-warning hover:border-warning hover:bg-warning/15`:void 0,onClick:()=>s(e=>!e),children:[m===!1?(0,B.jsx)(Xe,{size:12}):(0,B.jsx)(Ze,{size:12}),m===!1?`Security Definer view`:`Security Invoker view`,m===!0&&(0,B.jsx)(`span`,{className:`size-1.5 rounded-full bg-brand`})]}),children:[(0,B.jsxs)(`p`,{className:`flex items-center gap-2 text-[13px] font-medium text-foreground`,children:[m===!1?(0,B.jsx)(Xe,{size:13,className:`text-warning`}):(0,B.jsx)(xt,{size:13,className:`text-brand`}),m===!1?`Secure your view`:`This view is secured`]}),m===!1?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`p`,{className:`mt-2.5 text-[13px] leading-relaxed text-muted-foreground`,children:`This view is defined with the Security Definer property, giving it the permissions of the view's creator (postgres), rather than the permissions of the querying user.`}),(0,B.jsxs)(`p`,{className:`mt-2.5 text-[13px] leading-relaxed text-muted-foreground`,children:[`Since this view is in the `,(0,B.jsx)(`code`,{className:`text-foreground/80`,children:t}),` schema, it is accessible via your project's APIs \u2014 Row Level Security on the tables it reads is bypassed through it.`]}),(0,B.jsx)(`div`,{className:`mt-4`,children:(0,B.jsx)(H,{onClick:()=>l(!0),children:`Autofix`})})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{className:`mt-2.5 text-[13px] leading-relaxed text-muted-foreground`,children:[`This view runs with `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`security_invoker=on`}),` \u2014 it executes with the querying user's permissions, so Row Level Security on the underlying tables applies through it.`]}),(0,B.jsx)(`button`,{className:`mt-3 text-[11px] text-muted-foreground/70 underline-offset-2 hover:text-destructive hover:underline`,onClick:()=>d(!0),children:`Switch back to security definer\u2026`})]})]}),c&&(0,B.jsxs)(ho,{open:!0,onClose:()=>l(!1),title:`Confirm autofixing view security`,width:`w-235`,children:[(0,B.jsxs)(`div`,{className:`px-1 pt-1`,children:[(0,B.jsxs)(`p`,{className:`text-[13px] leading-relaxed text-muted-foreground`,children:[`Setting `,(0,B.jsx)(`code`,{className:`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground`,children:`security_invoker=on`}),` `,`ensures the view runs with the permissions of the querying user, reducing the risk of unintended data exposure.`]}),(0,B.jsx)(`div`,{className:`mt-4 grid grid-cols-2 gap-4`,children:[[`Existing query`,h(!1)],[`Updated query`,h(!0)]].map(([e,t])=>(0,B.jsxs)(`div`,{className:`overflow-hidden rounded-md border border-border bg-code`,children:[(0,B.jsx)(`div`,{className:`border-b border-border bg-card px-4 py-2.5 font-mono text-[12px] font-medium text-foreground`,children:e}),(0,B.jsx)(`div`,{className:`px-2 py-3`,children:(0,B.jsx)(er,{value:t,lang:`sql`,readOnly:!0,minLines:g,maxLines:g})})]},e))})]}),(0,B.jsxs)(`div`,{className:`-mx-4 -mb-4 mt-5 flex gap-3 border-t border-border px-4 py-3.5`,children:[(0,B.jsx)(H,{variant:`outline`,className:`h-9 flex-1`,onClick:()=>l(!1),children:`Cancel`}),(0,B.jsx)(H,{className:`h-9 flex-1`,autoFocus:!0,onClick:()=>void p(!0),children:`Confirm`})]})]}),u&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Run \"${e}\" as its owner?`,description:`RLS on the underlying tables will be bypassed through this view \u2014 every role can read all rows the owner can.`,confirmLabel:`Switch to definer`,onConfirm:()=>{d(!1),p(!1)},onClose:()=>d(!1)})]})}function Ng({table:e,schema:t=`public`,onClose:n,onChanged:r}){let[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(null),m=(0,_.useCallback)(async()=>{try{a(await Ag(e,t))}catch(e){U.error(e.message)}},[e,t]);(0,_.useEffect)(()=>{m()},[m]);async function h(n){let i=await N.sql(`alter table ${kg(t,e)} ${n?`enable`:`disable`} row level security`);if(!i.ok){U.error(i.error??`Failed to change RLS`);return}U.success(`RLS ${n?`enabled`:`disabled`} on ${e}`),await m(),r?.()}async function g(n){try{await N.dropPolicy(e,n.name,t),U.success(`Dropped policy ${n.name}`),await m(),r?.()}catch(e){U.error(e.message)}}return(0,B.jsxs)(Kp,{open:!0,onClose:n,width:`w-[560px]`,title:(0,B.jsxs)(`span`,{children:[`Row Level Security \u2014 `,(0,B.jsx)(`code`,{className:`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e})]}),footer:(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,className:`ml-auto`,children:`Done`})}),children:[i?(0,B.jsxs)(`div`,{className:`space-y-5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md border border-border bg-card p-3.5`,children:[i.enabled?(0,B.jsx)(xt,{size:16,className:`text-brand`}):(0,B.jsx)(St,{size:16,className:`text-destructive`}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`p`,{className:`text-[13px] font-medium text-foreground`,children:`Enable Row Level Security`}),(0,B.jsx)(`p`,{className:`text-[11px] text-muted-foreground/80`,children:i.enabled?`Rows are only visible to roles a policy grants access to. The service_role always bypasses RLS.`:`RLS is disabled \u2014 the API exposes all rows to every role, including anon.`})]}),(0,B.jsx)(Jp,{checked:i.enabled,onChange:e=>e?void h(!0):d(!0)})]}),i.enabled&&i.policies.length===0&&(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-md border border-warning/30 bg-warning/10 px-3 py-2.5 text-xs text-warning`,children:[(0,B.jsx)(kt,{size:13,className:`mt-px shrink-0`}),`RLS is enabled for this table, but no policies are set. Select queries by anon/authenticated will return 0 results.`]}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,B.jsxs)(`p`,{className:`text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80`,children:[`Policies `,(0,B.jsx)(`span`,{className:`text-muted-foreground/60`,children:i.policies.length})]}),(0,B.jsxs)(H,{size:`xs`,onClick:()=>s(!0),children:[(0,B.jsx)(pt,{size:12}),` Create policy`]})]}),(0,B.jsxs)(`div`,{className:`space-y-2`,children:[i.policies.map(e=>(0,B.jsxs)(`div`,{className:`cursor-pointer rounded-md border border-border bg-card p-3 transition-colors hover:border-muted-foreground/60`,title:`Edit policy`,onClick:()=>l(e),children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`truncate font-mono text-[13px] text-foreground`,children:e.name}),(0,B.jsx)(V,{variant:`blue`,children:e.cmd}),String(e.permissive).toUpperCase()!==`PERMISSIVE`&&(0,B.jsx)(V,{variant:`red`,children:`restrictive`}),(0,B.jsx)(V,{variant:`neutral`,children:Array.isArray(e.roles)?e.roles.join(`, `):String(e.roles)}),(0,B.jsx)(`button`,{className:`ml-auto p-1 text-muted-foreground/80 hover:text-destructive`,title:`Drop policy`,onClick:t=>{t.stopPropagation(),p(e)},children:(0,B.jsx)(Ot,{size:13})})]}),e.using_expr&&(0,B.jsxs)(`p`,{className:`mt-1.5 truncate font-mono text-[11px] text-muted-foreground/80`,title:e.using_expr,children:[`using (`,e.using_expr,`)`]}),e.with_check&&(0,B.jsxs)(`p`,{className:`mt-0.5 truncate font-mono text-[11px] text-muted-foreground/80`,title:e.with_check,children:[`with check (`,e.with_check,`)`]})]},e.name)),i.policies.length===0&&(0,B.jsxs)(`p`,{className:`rounded-md border border-dashed border-border px-3 py-4 text-center text-xs text-muted-foreground/60`,children:[`No policies on this table yet. Start from a template \u2192`,` `,(0,B.jsx)(`button`,{className:`text-brand hover:underline`,onClick:()=>s(!0),children:`Create policy`})]})]})]})]}):(0,B.jsx)(qp,{}),o&&(0,B.jsx)(wg,{table:e,schema:t,onClose:()=>s(!1),onCreated:async()=>{await m(),r?.()}}),c&&(0,B.jsx)(wg,{table:e,schema:t,existing:Dg(c),onClose:()=>l(null),onCreated:async()=>{await m(),r?.()}}),u&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Disable RLS on \"${e}\"?`,description:`Every role \u2014 including anon \u2014 will be able to read and write all rows through the API.`,confirmLabel:`Disable RLS`,onConfirm:()=>void h(!1),onClose:()=>d(!1)}),f&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Drop policy \"${f.name}\"?`,description:`Access rules for this table change immediately.`,confirmLabel:`Drop policy`,onConfirm:()=>void g(f),onClose:()=>p(null)})]})}function Pg(){let[e]=Uh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(null),h=(0,_.useCallback)(()=>{Promise.all([N.policies(e),N.tables(e)]).then(([e,t])=>{i(null),n(e),o(t.filter(e=>!e.isView).map(e=>e.name))},e=>{i(e?.message??`Query failed`),n(e=>e??[])})},[e]);(0,_.useEffect)(()=>{h();let e=setInterval(()=>void h(),5e3);return()=>clearInterval(e)},[h]);async function g(e){try{await N.dropPolicy(e.table,e.name),U.success(`Dropped policy ${e.name}`),h()}catch(e){U.error(e.message)}}if(t===null)return(0,B.jsx)(qp,{});let v=t.filter(e=>(e.table+e.name).toLowerCase().includes(s.toLowerCase())),y=new Map;for(let e of v)y.has(e.table)||y.set(e.table,[]),y.get(e.table).push(e);return(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsx)(Yh,{title:`Policies`,description:`Row Level Security policies across every table \u2014 who can see and write which rows.`,search:s,onSearch:c,onRefresh:h,schemaPicker:!0,actions:(0,B.jsxs)(H,{size:`xs`,onClick:()=>u(!0),children:[(0,B.jsx)(pt,{size:12}),` New policy`]})}),r&&(0,B.jsx)(df,{message:r}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-6`,children:[[...y].map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-2`,children:[(0,B.jsx)(xt,{size:13,className:`text-brand`}),(0,B.jsx)(`span`,{className:`font-mono text-[13px] text-foreground/90`,children:e}),(0,B.jsxs)(`span`,{className:`text-[11px] text-muted-foreground/60`,children:[t.length,` `,t.length===1?`policy`:`policies`]})]}),(0,B.jsx)(`div`,{className:`space-y-2`,children:t.map(e=>(0,B.jsxs)(`div`,{className:`cursor-pointer rounded-md border border-border bg-card p-3 transition-colors hover:border-muted-foreground/60`,title:`Edit policy`,onClick:()=>f(e),children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`truncate font-mono text-[13px] text-foreground`,children:e.name}),(0,B.jsx)(V,{variant:`blue`,children:e.cmd}),String(e.permissive).toUpperCase()!==`PERMISSIVE`&&(0,B.jsx)(V,{variant:`red`,children:`restrictive`}),(0,B.jsx)(V,{variant:`neutral`,children:Array.isArray(e.roles)?e.roles.join(`, `):String(e.roles)}),(0,B.jsx)(`button`,{className:`ml-auto p-1 text-muted-foreground/80 hover:text-destructive`,title:`Drop policy`,onClick:t=>{t.stopPropagation(),m(e)},children:(0,B.jsx)(Ot,{size:13})})]}),e.using_expr&&(0,B.jsxs)(`p`,{className:`mt-1.5 truncate font-mono text-[11px] text-muted-foreground/80`,title:e.using_expr,children:[`using (`,e.using_expr,`)`]}),e.with_check&&(0,B.jsxs)(`p`,{className:`mt-0.5 truncate font-mono text-[11px] text-muted-foreground/80`,title:e.with_check,children:[`with check (`,e.with_check,`)`]})]},e.name))})]},e)),v.length===0&&(0,B.jsx)(cf,{children:t.length===0?`No policies yet. Create one to start restricting access.`:`No match.`})]}),l&&(0,B.jsx)(wg,{tables:a,schema:e,onClose:()=>u(!1),onCreated:async()=>h()}),d&&(0,B.jsx)(wg,{table:d.table,schema:e,existing:Dg(d),onClose:()=>f(null),onCreated:async()=>h()}),p&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Drop policy \"${p.name}\"?`,description:`Access rules for \"${p.table}\" change immediately.`,confirmLabel:`Drop policy`,onConfirm:()=>void g(p),onClose:()=>m(null)})]})}var Fg=new Set([`postgres`,`anon`,`authenticated`,`authenticator`,`service_role`]),Ig=[{key:`login`,label:`User can login`,sql:e=>e?`login`:`nologin`},{key:`createrole`,label:`User can create roles`,sql:e=>e?`createrole`:`nocreaterole`},{key:`createdb`,label:`User can create databases`,sql:e=>e?`createdb`:`nocreatedb`},{key:`bypassrls`,label:`User bypasses every row level security policy`,sql:e=>e?`bypassrls`:`nobypassrls`},{key:`replication`,label:`User can initiate streaming replication and put the system in and out of backup mode`,sql:e=>e?`replication`:`noreplication`}];function Lg(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null),f=(0,_.useCallback)(async()=>{let e=await N.sql(`select r.rolname as name, r.oid::int as oid, r.rolsuper as \"super\", r.rolcanlogin as login,\n r.rolcreatedb as createdb, r.rolcreaterole as createrole,\n r.rolreplication as replication, r.rolbypassrls as bypassrls,\n r.rolconnlimit as connlimit,\n coalesce((select count(*)::int from pg_stat_activity a where a.usename = r.rolname), 0) as connections\n from pg_roles r where r.rolname not like 'pg\\\\_%' order by r.rolname`);if(!e.ok){r(e.error??`Query failed`),t(e=>e??[]);return}r(null),t(e.rows??[])},[]);(0,_.useEffect)(()=>{f();let e=setInterval(()=>void f(),5e3);return()=>clearInterval(e)},[f]);async function p(e,t,n){let r=await N.sql(`alter role ${Xh(e.name)} ${t.sql(n)}`);if(!r.ok){U.error(r.error??`Failed to change privilege`);return}U.success(`${e.name}: ${t.sql(n)}`),await f()}async function m(e){let t=await N.sql(`drop role ${Xh(e.name)}`);if(!t.ok){U.error(t.error??`Drop failed \u2014 the role may still own objects or have grants`);return}U.success(`Dropped role ${e.name}`),await f()}if(e===null)return(0,B.jsx)(qp,{});let h=e.filter(e=>e.name.toLowerCase().includes(i.toLowerCase())),g=h.filter(e=>Fg.has(e.name)),v=h.filter(e=>!Fg.has(e.name)),y=e.reduce((e,t)=>e+t.connections,0),b=(e,t)=>{let n=o===e.name;return(0,B.jsxs)(`div`,{className:`border-b border-border/60 last:border-b-0`,children:[(0,B.jsxs)(`button`,{className:`flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-accent/40`,onClick:()=>s(n?null:e.name),children:[n?(0,B.jsx)(pe,{size:13,className:`shrink-0 text-muted-foreground/60`}):(0,B.jsx)(he,{size:13,className:`shrink-0 text-muted-foreground/60`}),(0,B.jsx)(`span`,{className:`font-mono text-[13px] text-foreground`,children:e.name}),(0,B.jsxs)(`span`,{className:`text-[11px] text-muted-foreground/60`,children:[`(ID: `,e.oid,`)`]}),e.super&&(0,B.jsx)(V,{variant:`amber`,children:`superuser`}),[`anon`,`authenticated`,`service_role`].includes(e.name)&&(0,B.jsx)(V,{variant:`brand`,children:`api`}),(0,B.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5 text-[12px] text-muted-foreground`,children:[e.connections>0&&(0,B.jsx)(`span`,{className:`size-1.5 rounded-full bg-brand`}),e.connections,` connection`,e.connections===1?``:`s`]}),!t&&(0,B.jsx)(`span`,{role:`button`,title:`Drop role`,className:`rounded p-1 text-muted-foreground/70 hover:bg-muted hover:text-destructive`,onClick:t=>{t.stopPropagation(),d(e)},children:(0,B.jsx)(Ot,{size:13})})]}),n&&(0,B.jsxs)(`div`,{className:`space-y-3 px-11 pb-4 pt-1`,children:[Ig.map(n=>(0,B.jsxs)(`label`,{className:`flex items-center gap-3 text-[13px] text-foreground/85 `+(t?`opacity-70`:``),children:[(0,B.jsx)(Jp,{checked:!!e[n.key],disabled:t,onChange:t=>void p(e,n,t)}),n.label]},n.key)),(0,B.jsxs)(`label`,{className:`flex items-center gap-3 text-[13px] text-foreground/85 opacity-70`,children:[(0,B.jsx)(Jp,{checked:e.super,disabled:!0}),`User is a Superuser `,(0,B.jsx)(`span`,{className:`text-[11px] text-muted-foreground/60`,children:`\u2014 cannot be granted via the dashboard`})]})]})]},e.name)};return(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsx)(Yh,{title:`Roles`,description:`Manage access control to your database through users, groups, and permissions.`,search:i,onSearch:a,onRefresh:()=>void f(),filters:(0,B.jsxs)(`span`,{className:`ml-auto shrink-0 text-[11px] text-muted-foreground/70`,children:[`Active connections `,(0,B.jsx)(`span`,{className:`tabular-nums text-foreground/80`,children:y})]}),actions:(0,B.jsxs)(H,{size:`xs`,onClick:()=>l(!0),children:[(0,B.jsx)(pt,{size:12}),` Add role`]})}),n&&(0,B.jsx)(df,{message:n}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-6`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-2`,children:[(0,B.jsx)(`p`,{className:`text-[13px] text-foreground/90`,children:`Roles managed by tinbase`}),(0,B.jsx)(V,{variant:`brand`,children:`PROTECTED`})]}),(0,B.jsxs)(`div`,{className:`rounded-md border border-border bg-card`,children:[g.map(e=>b(e,!0)),g.length===0&&(0,B.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground/60`,children:`No match.`})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`mb-1.5 text-[13px] text-foreground/90`,children:`Custom roles`}),(0,B.jsxs)(`div`,{className:`rounded-md border border-border bg-card`,children:[v.map(e=>b(e,!1)),v.length===0&&(0,B.jsxs)(cf,{children:[`No custom roles yet \u2014`,` `,(0,B.jsx)(`button`,{className:`text-brand hover:underline`,onClick:()=>l(!0),children:`add one`}),`.`]})]})]})]}),c&&(0,B.jsx)(Rg,{onClose:()=>l(!1),onDone:async()=>{l(!1),await f()}}),u&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Drop role \"${u.name}\"?`,description:`Grants and policies referencing this role will stop matching. Fails if the role still owns objects.`,confirmLabel:`Drop role`,onConfirm:()=>void m(u),onClose:()=>d(null)})]})}function Rg({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)({}),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(``);async function u(){if(!n.trim())return l(`Role name is required.`);s(!0),l(``);let e=Ig.map(e=>e.sql(!!i[e.key])).join(` `),r=await N.sql(`create role ${Xh(n.trim())} ${e}`);if(!r.ok){l(r.error??`Create failed`),s(!1);return}U.success(`Created role ${n.trim()}`),await t()}return(0,B.jsx)(Kp,{open:!0,onClose:e,width:`w-135`,title:`Create a new role`,footer:(0,B.jsxs)(B.Fragment,{children:[c&&(0,B.jsx)(`p`,{className:`min-w-0 truncate text-xs text-destructive`,children:c}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,children:`Cancel`})}),(0,B.jsx)(H,{onClick:()=>void u(),disabled:o||!n.trim(),children:o?`Creating\u2026`:`Create role`})]})]}),children:(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Name`}),(0,B.jsx)(Y,{mono:!0,value:n,autoFocus:!0,onChange:e=>r(e.target.value)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Role privileges`}),(0,B.jsx)(`div`,{className:`space-y-2.5`,children:Ig.map(e=>(0,B.jsxs)(`label`,{className:`flex items-center gap-3 text-[13px] text-foreground/85`,children:[(0,B.jsx)(Jp,{checked:!!i[e.key],onChange:t=>a(n=>({...n,[e.key]:t}))}),e.label]},e.key))}),(0,B.jsxs)(`div`,{className:`mt-3 border-t border-border pt-3`,children:[(0,B.jsx)(`p`,{className:`mb-2 text-[12px] font-medium text-foreground/80`,children:`These privileges cannot be granted via the dashboard:`}),(0,B.jsxs)(`label`,{className:`flex items-center gap-3 text-[13px] text-foreground/85 opacity-60`,children:[(0,B.jsx)(Jp,{checked:!1,disabled:!0}),`User is a Superuser`]})]})]})]})})}function zg(){let[e]=Uh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(``),s=(0,_.useCallback)(async()=>{try{let[t,r]=await Promise.all([N.tables(e),N.sql(`select c.relname as name, c.relrowsecurity as rls,\n coalesce('security_invoker=true' = any(c.reloptions) or 'security_invoker=on' = any(c.reloptions), false) as invoker,\n case when c.relkind = 'r' then pg_size_pretty(pg_total_relation_size(c.oid)) end as size,\n (select count(*)::int from pg_policies p where p.schemaname = ${Zh(e)} and p.tablename = c.relname) as policies\n from pg_class c join pg_namespace n on n.oid = c.relnamespace\n where n.nspname = ${Zh(e)} and c.relkind in ('r','v') order by c.relname`)]);i(r.ok?null:r.error??`Query failed`);let a=new Map(((r.ok?r.rows:[])??[]).map(e=>[e.name,e]));n(t.map(e=>{let t=a.get(e.name);return{name:e.name,rows:e.rowCount,size:t?.size??`\u2014`,rls:!!t?.rls,policies:t?.policies??0,pk:e.primaryKey.length>0,view:!!e.isView,invoker:!!t?.invoker}}))}catch(e){i(e?.message??`Query failed`),n(e=>e??[])}},[e]);if((0,_.useEffect)(()=>{s();let e=setInterval(()=>void s(),5e3);return()=>clearInterval(e)},[s]),t===null)return(0,B.jsx)(qp,{});let c=t.filter(e=>e.name.toLowerCase().includes(a.toLowerCase())),l=qh(e);return(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsx)(Yh,{title:`Tables`,description:`Every table in the selected schema \u2014 size, rows, and Row Level Security posture.`,search:a,onSearch:o,onRefresh:()=>void s(),schemaPicker:!0}),r&&(0,B.jsx)(df,{message:r}),l&&(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border bg-accent/40 px-6 py-2 text-xs text-muted-foreground`,children:[(0,B.jsx)(Xe,{size:13,className:`shrink-0`}),(0,B.jsxs)(`span`,{children:[`The `,(0,B.jsx)(`span`,{className:`font-mono text-foreground/80`,children:e}),` schema is managed by tinbase. It isn't exposed to anon/authenticated through the Data API \u2014 access is controlled by grants, so tables here don't need RLS policies.`]})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Z,{children:`Name`}),(0,B.jsx)(Z,{children:`Rows`}),(0,B.jsx)(Z,{children:`Size`}),(0,B.jsx)(Z,{children:`RLS`}),(0,B.jsx)(Z,{children:`Policies`}),(0,B.jsx)(Z,{className:`w-10`})]})}),(0,B.jsx)(`tbody`,{children:c.map(e=>(0,B.jsxs)(Zp,{className:`cursor-pointer`,onClick:()=>z(`table`,e.name),children:[(0,B.jsx)(Q,{className:`font-mono text-foreground/90`,children:(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[e.view?(0,B.jsx)(ke,{size:12,className:`shrink-0 text-muted-foreground/60`}):(0,B.jsx)(Et,{size:12,className:`shrink-0 text-muted-foreground/50`}),e.name,e.view&&(0,B.jsx)(V,{variant:`neutral`,children:`view`}),!e.pk&&!e.view&&(0,B.jsx)(`span`,{title:`No primary key`,children:(0,B.jsx)(Ge,{size:11,className:`text-warning`})})]})}),(0,B.jsx)(Q,{className:`tabular-nums text-muted-foreground`,children:e.rows.toLocaleString()}),(0,B.jsx)(Q,{className:`font-mono text-muted-foreground`,children:e.view?`\u2014`:e.size}),(0,B.jsx)(Q,{children:e.view?e.invoker?(0,B.jsx)(`span`,{title:`security_invoker \u2014 the caller's RLS applies through this view`,children:(0,B.jsx)(V,{variant:`neutral`,children:`invoker`})}):(0,B.jsx)(`span`,{title:l?`Owner-rights view in a grant-protected schema`:`Runs with the owner's permissions \u2014 RLS on the underlying tables is bypassed`,children:(0,B.jsx)(V,{variant:l?`neutral`:`red`,children:l?`definer`:`unrestricted`})}):e.rls?(0,B.jsx)(V,{variant:`brand`,children:`enabled`}):(0,B.jsx)(`span`,{title:l?`Protected by grants \u2014 not exposed through the Data API`:`RLS is disabled \u2014 all rows are exposed to every role`,children:(0,B.jsx)(V,{variant:l?`neutral`:`red`,children:`disabled`})})}),(0,B.jsx)(Q,{className:`tabular-nums text-muted-foreground`,children:e.view?`\u2014`:e.policies}),(0,B.jsx)(Q,{children:(0,B.jsx)(ue,{size:13,className:`text-muted-foreground/60 opacity-0 group-hover:opacity-100`})})]},e.name))})]}),c.length===0&&(0,B.jsx)(cf,{children:t.length===0?`No tables yet.`:`No match.`})]})]})}function Bg(){let[e]=Uh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(null),d=(0,_.useCallback)(async()=>{let t=await N.sql(`select tg.tgname as name, c.relname as \"table\", tg.tgenabled <> 'D' as enabled,\n case when (tg.tgtype & 2) <> 0 then 'BEFORE' else 'AFTER' end as timing,\n array_remove(array[\n case when (tg.tgtype & 4) <> 0 then 'INSERT' end,\n case when (tg.tgtype & 8) <> 0 then 'DELETE' end,\n case when (tg.tgtype & 16) <> 0 then 'UPDATE' end], null) as events,\n p.proname as function\n from pg_trigger tg\n join pg_class c on c.oid = tg.tgrelid\n join pg_namespace n on n.oid = c.relnamespace\n join pg_proc p on p.oid = tg.tgfoid\n where n.nspname = ${Zh(e)} and not tg.tgisinternal\n order by c.relname, tg.tgname`);if(!t.ok){i(t.error??`Query failed`),n(e=>e??[]);return}i(null),n(t.rows??[])},[e]);(0,_.useEffect)(()=>{d();let e=setInterval(()=>void d(),5e3);return()=>clearInterval(e)},[d]);async function f(t){let n=await N.sql(`alter table ${Xh(e)}.${Xh(t.table)} ${t.enabled?`disable`:`enable`} trigger ${Xh(t.name)}`);if(!n.ok){U.error(n.error??`Failed`);return}U.success(`${t.enabled?`Disabled`:`Enabled`} ${t.name}`),await d()}async function p(t){let n=await N.sql(`drop trigger ${Xh(t.name)} on ${Xh(e)}.${Xh(t.table)}`);if(!n.ok){U.error(n.error??`Drop failed`);return}U.success(`Dropped trigger ${t.name}`),await d()}if(t===null)return(0,B.jsx)(qp,{});let m=t.filter(e=>(e.name+e.table).toLowerCase().includes(a.toLowerCase()));return(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsx)(Yh,{title:`Triggers`,description:`Functions that fire automatically on table events.`,search:a,onSearch:o,onRefresh:()=>void d(),schemaPicker:!0,actions:(0,B.jsxs)(H,{size:`xs`,onClick:()=>c(!0),children:[(0,B.jsx)(pt,{size:12}),` New trigger`]})}),r&&(0,B.jsx)(df,{message:r}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Z,{children:`Name`}),(0,B.jsx)(Z,{children:`Table`}),(0,B.jsx)(Z,{children:`Fires`}),(0,B.jsx)(Z,{children:`Function`}),(0,B.jsx)(Z,{children:`Status`}),(0,B.jsx)(Z,{className:`w-20`})]})}),(0,B.jsx)(`tbody`,{children:m.map(e=>(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:`font-mono text-foreground/90`,children:e.name}),(0,B.jsx)(Q,{className:`font-mono text-muted-foreground`,children:e.table}),(0,B.jsxs)(Q,{className:`text-muted-foreground`,children:[e.timing,` `,Lt(e.events).join(` | `)]}),(0,B.jsxs)(Q,{className:`font-mono text-[11px] text-muted-foreground/80`,children:[e.function,`()`]}),(0,B.jsx)(Q,{children:e.enabled?(0,B.jsx)(V,{variant:`brand`,children:`enabled`}):(0,B.jsx)(V,{variant:`neutral`,children:`disabled`})}),(0,B.jsx)(Q,{children:(0,B.jsxs)(`div`,{className:`flex justify-end gap-0.5 opacity-0 group-hover:opacity-100`,children:[(0,B.jsx)(`button`,{className:`p-1 text-muted-foreground/80 hover:text-foreground`,title:e.enabled?`Disable`:`Enable`,onClick:()=>void f(e),children:e.enabled?(0,B.jsx)(st,{size:13}):(0,B.jsx)(dt,{size:13})}),(0,B.jsx)(`button`,{className:`p-1 text-muted-foreground/80 hover:text-destructive`,title:`Drop`,onClick:()=>u(e),children:(0,B.jsx)(Ot,{size:13})})]})})]},e.table+e.name))})]}),m.length===0&&(0,B.jsx)(cf,{children:t.length===0?`No triggers.`:`No match.`})]}),s&&(0,B.jsx)(Vg,{schema:e,onClose:()=>c(!1),onDone:async()=>{c(!1),await d()}}),l&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Drop trigger \"${l.name}\"?`,description:`The trigger on \"${l.table}\" will stop firing immediately.`,confirmLabel:`Drop trigger`,onConfirm:()=>void p(l),onClose:()=>u(null)})]})}function Vg({schema:e,onClose:t,onDone:n}){let[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)([]),[l,u]=(0,_.useState)(new Set([`INSERT`])),[d,f]=(0,_.useState)(`AFTER`),[p,m]=(0,_.useState)(`ROW`),[h,g]=(0,_.useState)(``),[v,y]=(0,_.useState)([]),[b,x]=(0,_.useState)(!1),[S,C]=(0,_.useState)(``);(0,_.useEffect)(()=>{N.tables(e).then(e=>{let t=e.filter(e=>!e.isView).map(e=>e.name);c(t),o(e=>e||(t[0]??``))},()=>{}),N.functions(e).then(e=>y(e.filter(e=>e.returns===`trigger`).map(e=>e.name)),()=>{})},[e]);function w(e){u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}let T=[`INSERT`,`UPDATE`,`DELETE`].filter(e=>l.has(e));async function E(){if(!r.trim()||!a||T.length===0||!h)return C(`Name, table, at least one event, and a function are required.`);x(!0),C(``);let t=`create trigger ${Xh(r.trim())}\n ${d.toLowerCase()} ${T.join(` or `)} on ${Gh(e,a)}\n for each ${p.toLowerCase()}\n execute function ${Gh(e,h)}()`,i=await N.sql(t);if(!i.ok){C(i.error??`Create failed`),x(!1);return}U.success(`Created trigger ${r.trim()}`),await n()}return(0,B.jsx)(Kp,{open:!0,onClose:t,width:`w-140`,title:`Create a new database trigger`,footer:(0,B.jsxs)(B.Fragment,{children:[S&&(0,B.jsx)(`p`,{className:`min-w-0 truncate text-xs text-destructive`,children:S}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,children:`Cancel`})}),(0,B.jsx)(H,{onClick:()=>void E(),disabled:b||!r.trim()||!a||T.length===0||!h,children:b?`Creating\u2026`:`Create trigger`})]})]}),children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Name of trigger`}),(0,B.jsx)(Y,{mono:!0,value:r,autoFocus:!0,placeholder:`set_updated_at`,onChange:e=>i(e.target.value.replace(/\\s/g,`_`))}),(0,B.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground/60`,children:`Do not use spaces/whitespace.`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Table`}),(0,B.jsx)(Up,{mono:!0,value:a,onValueChange:o,placeholder:`Pick a table\u2026`,options:s.map(t=>({value:t,label:`${e}.${t}`}))}),(0,B.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground/60`,children:`The trigger watches for changes on this table.`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Events`}),(0,B.jsx)(`div`,{className:`space-y-1.5`,children:[`INSERT`,`UPDATE`,`DELETE`].map(e=>(0,B.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-[13px] text-foreground/85`,children:[(0,B.jsx)(Zt,{checked:l.has(e),onChange:()=>w(e)}),(0,B.jsx)(`span`,{className:`font-mono`,children:e})]},e))})]}),(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Trigger type`}),(0,B.jsx)(Up,{value:d,onValueChange:e=>f(e),options:[{value:`BEFORE`,label:`Before the event`},{value:`AFTER`,label:`After the event`}]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Orientation`}),(0,B.jsx)(Up,{value:p,onValueChange:e=>m(e),options:[{value:`ROW`,label:`Row`},{value:`STATEMENT`,label:`Statement`}]})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Function to trigger`}),v.length>0?(0,B.jsx)(Up,{mono:!0,value:h,onValueChange:g,placeholder:`Choose a function\u2026`,options:v.map(e=>({value:e,label:`${e}()`}))}):(0,B.jsxs)(`p`,{className:`rounded-md border border-dashed border-border px-3 py-2.5 text-xs text-muted-foreground/80`,children:[`No trigger functions in `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:e}),` yet \u2014 create one under Functions with return type `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`trigger`}),` first.`]})]})]})})}var Hg=240,Ug=32,Wg=22,Gg=36,Kg=60,qg=e=>Ug+e.columns.length*Wg+6;function Jg(e){let t=new Map(e.map(e=>[e.name,e])),n=new Map;function r(e,i){if(n.has(e))return n.get(e);if(i.has(e))return 0;let a=t.get(e);if(!a)return 0;i.add(e);let o=0;for(let n of a.foreignKeys){let a=n.target.split(`.`).pop();a===e||!t.has(a)||(o=Math.max(o,r(a,i)+1))}return i.delete(e),n.set(e,o),o}let i=new Map;for(let t of e){let e=r(t.name,new Set);i.has(e)||i.set(e,[]),i.get(e).push(t)}let a={};for(let[e,t]of[...i.entries()].sort((e,t)=>e[0]-t[0])){t.sort((e,t)=>t.columns.length-e.columns.length);let n=Kg;for(let r of t)a[r.name]={x:Kg+e*350,y:n},n+=qg(r)+Gg}return a}function Yg(){let[e]=Uh(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)({}),[a,o]=(0,_.useState)({x:0,y:0}),[s,c]=(0,_.useState)(1),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(null),p=(0,_.useRef)(null),m=(0,_.useCallback)(()=>{n(null),N.tables(e).then(e=>{n(e),i(Jg(e)),o({x:0,y:0}),c(e.length>8?.8:1)},()=>n([]))},[e]);(0,_.useEffect)(()=>{m()},[m]);let h=(0,_.useRef)(null);(0,_.useEffect)(()=>{h.current=t},[t]),(0,_.useEffect)(()=>{let t=setInterval(()=>{N.tables(e).then(e=>{let t=h.current;t&&JSON.stringify(e.map(e=>[e.name,e.columns.length]))!==JSON.stringify(t.map(e=>[e.name,e.columns.length]))&&(n(e),i(t=>{let n={...Jg(e),...t};for(let t of Object.keys(n))e.some(e=>e.name===t)||delete n[t];return n}))},()=>{})},5e3);return()=>clearInterval(t)},[e]);let g=(0,_.useMemo)(()=>{if(!t)return[];let e=new Map(t.map(e=>[e.name,e])),n=[];for(let i of t){let t=r[i.name];if(t)for(let[a,o]of i.foreignKeys.entries()){let s=o.target.split(`.`).pop(),c=e.get(s),l=c&&r[s];if(!c||!l)continue;let u=Math.max(0,i.columns.findIndex(e=>e.name===o.columns[0])),d=t.y+Ug+u*Wg+Wg/2,f=l.x+Hg/2<t.x+Hg/2,p={x:f?t.x:t.x+Hg,y:d},m={x:f?l.x+Hg:l.x,y:l.y+Ug/2};n.push({from:p,to:m,key:`${i.name}-${a}`})}}return n},[t,r]);function v(e){let t=p.current;if(t)if(t.kind===`pan`)o({x:t.panX+(e.clientX-t.startX),y:t.panY+(e.clientY-t.startY)});else{let n=t.name;i(r=>({...r,[n]:{x:t.nodeX+(e.clientX-t.startX)/s,y:t.nodeY+(e.clientY-t.startY)/s}}))}}let y=()=>p.current=null;function b(e){c(t=>Math.min(1.6,Math.max(.3,Math.round(t*e*100)/100)))}function x(e){let t=r[e];t&&(f(e),o({x:-(t.x+Hg/2)*s+480,y:-(t.y+60)*s+240}),setTimeout(()=>f(t=>t===e?null:t),1600))}let S=l&&t?t.filter(e=>e.name.toLowerCase().includes(l.toLowerCase())).slice(0,8):[];return t===null?(0,B.jsx)(qp,{}):(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border px-4 py-2.5`,children:[(0,B.jsx)(`h1`,{className:`mr-2 text-sm font-semibold text-foreground`,children:`Schema Visualizer`}),(0,B.jsx)(Jh,{}),(0,B.jsxs)(`div`,{className:`relative w-56`,children:[(0,B.jsx)(_t,{size:13,className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60`}),(0,B.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),placeholder:`Find table\u2026`,className:`h-8 w-full rounded-md border border-input bg-field pl-8 pr-2 text-[13px] text-foreground placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none`}),S.length>0&&(0,B.jsx)(`div`,{className:`absolute left-0 top-full z-30 mt-1 w-full overflow-hidden rounded-md border border-input bg-popover py-1 shadow-xl`,children:S.map(e=>(0,B.jsx)(`button`,{className:`block w-full px-3 py-1.5 text-left font-mono text-xs text-foreground hover:bg-accent`,onClick:()=>{x(e.name),u(``)},children:e.name},e.name))})]}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,title:`Zoom out`,onClick:()=>b(1/1.2),children:(0,B.jsx)(tt,{size:13})}),(0,B.jsxs)(`span`,{className:`w-10 text-center text-[11px] tabular-nums text-muted-foreground`,children:[Math.round(s*100),`%`]}),(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,title:`Zoom in`,onClick:()=>b(1.2),children:(0,B.jsx)(pt,{size:13})}),(0,B.jsxs)(H,{variant:`outline`,size:`xs`,onClick:()=>{i(Jg(t)),o({x:0,y:0})},children:[(0,B.jsx)(Ke,{size:12}),` Auto layout`]})]})]}),t.length===0?(0,B.jsx)(cf,{children:`No tables in this schema yet \u2014 create one in the table editor or SQL editor.`}):(0,B.jsxs)(`div`,{className:`relative min-h-0 flex-1 cursor-grab overflow-hidden bg-background active:cursor-grabbing`,style:{backgroundImage:`radial-gradient(circle, var(--color-border) 1px, transparent 1px)`,backgroundSize:`${24*s}px ${24*s}px`,backgroundPosition:`${a.x}px ${a.y}px`},onPointerDown:e=>{e.target===e.currentTarget&&(e.target.setPointerCapture(e.pointerId),p.current={kind:`pan`,startX:e.clientX,startY:e.clientY,panX:a.x,panY:a.y})},onPointerMove:v,onPointerUp:y,onPointerLeave:y,onWheel:e=>b(e.deltaY<0?1.08:1/1.08),children:[(0,B.jsxs)(`div`,{className:`pointer-events-none absolute left-0 top-0`,style:{transform:`translate(${a.x}px, ${a.y}px) scale(${s})`,transformOrigin:`0 0`},children:[(0,B.jsx)(`svg`,{className:`absolute left-0 top-0 overflow-visible`,width:1,height:1,children:g.map(e=>{let t=Math.max(40,Math.abs(e.to.x-e.from.x)/2),n=e.from.x<e.to.x?e.from.x+t:e.from.x-t,r=e.from.x<e.to.x?e.to.x-t:e.to.x+t;return(0,B.jsxs)(`g`,{children:[(0,B.jsx)(`path`,{d:`M ${e.from.x} ${e.from.y} C ${n} ${e.from.y}, ${r} ${e.to.y}, ${e.to.x} ${e.to.y}`,fill:`none`,stroke:`var(--color-muted-foreground)`,strokeOpacity:.45,strokeWidth:1.25}),(0,B.jsx)(`circle`,{cx:e.from.x,cy:e.from.y,r:2.5,fill:`var(--color-muted-foreground)`,fillOpacity:.7}),(0,B.jsx)(`circle`,{cx:e.to.x,cy:e.to.y,r:2.5,fill:`var(--color-muted-foreground)`,fillOpacity:.7})]},e.key)})}),t.map(e=>{let t=r[e.name];return t?(0,B.jsxs)(`div`,{className:`pointer-events-auto absolute select-none overflow-hidden rounded-md border bg-card shadow-sm transition-shadow `+(d===e.name?`border-brand ring-2 ring-brand/40`:`border-border hover:border-muted-foreground/60`),style:{left:t.x,top:t.y,width:Hg},children:[(0,B.jsxs)(`div`,{className:`flex h-8 cursor-move items-center gap-1.5 border-b border-border bg-accent/40 px-2.5`,onPointerDown:n=>{n.stopPropagation(),n.currentTarget.setPointerCapture(n.pointerId),p.current={kind:`node`,name:e.name,startX:n.clientX,startY:n.clientY,nodeX:t.x,nodeY:t.y}},onPointerMove:v,onPointerUp:y,children:[(0,B.jsx)(Et,{size:12,className:`shrink-0 text-muted-foreground`}),(0,B.jsx)(`button`,{className:`min-w-0 flex-1 truncate text-left font-mono text-xs font-medium text-foreground hover:text-brand`,title:`Open in table editor`,onClick:()=>z(`table`,e.name),children:e.name}),(0,B.jsx)(`span`,{className:`text-[10px] tabular-nums text-muted-foreground/60`,children:e.rowCount.toLocaleString()})]}),(0,B.jsx)(`div`,{className:`py-0.5`,children:e.columns.map(e=>(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5`,style:{height:Wg},children:[e.isPrimaryKey?(0,B.jsx)(Ge,{size:9,className:`shrink-0 text-warning`}):(0,B.jsx)(we,{size:8,className:`shrink-0 `+(e.nullable?`text-muted-foreground/50`:`fill-muted-foreground/60 text-muted-foreground/60`)}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[11px] text-foreground/85`,children:e.name}),(0,B.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-muted-foreground/50`,children:e.type})]},e.name))})]},e.name):null})]}),(0,B.jsxs)(`div`,{className:`pointer-events-none absolute bottom-0 left-0 right-0 flex items-center justify-center gap-5 border-t border-border bg-background/80 py-1.5 font-mono text-[11px] text-muted-foreground backdrop-blur`,children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(Ge,{size:10,className:`text-warning`}),` Primary key`]}),(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(we,{size:9,className:`text-muted-foreground/50`}),` Nullable`]}),(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(we,{size:9,className:`fill-muted-foreground/60 text-muted-foreground/60`}),` Non-nullable`]})]})]})]})}var Xg=[{id:`visualizer`,label:`Schema Visualizer`,component:Yg},{id:`tables`,label:`Tables`,component:zg},{id:`functions`,label:`Functions`,component:ug},{id:`triggers`,label:`Triggers`,component:Bg},{id:`enums`,label:`Enumerated Types`,component:cg},{id:`indexes`,label:`Indexes`,component:hg},{id:`migrations`,label:`Migrations`,component:vg},{id:`policies`,label:`Policies`,component:Pg},{id:`roles`,label:`Roles`,component:Lg}];function Zg(){let{section:e}=qt(),t=Xg.some(t=>t.id===e)?e:`visualizer`,n=Xg.find(e=>e.id===t).component;return(0,B.jsxs)(`div`,{className:`flex h-full`,children:[(0,B.jsx)(wh,{title:`Database`,active:t,onSelect:e=>z(`database`,e),groups:[{title:`Database Management`,items:Xg.slice(0,7).map(e=>({id:e.id,label:e.label}))},{title:`Access Control`,items:Xg.slice(7).map(e=>({id:e.id,label:e.label}))}]}),(0,B.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:(0,B.jsx)(n,{})})]})}function Qg({name:e,onClose:t}){let[n,r]=(0,_.useState)(`POST`),[i,a]=(0,_.useState)(`service_role`),[o,s]=(0,_.useState)(`{\n \"name\": \"world\"\n}`),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(!1);async function f(){d(!0),l(null);try{let t=i===`anon`?(await N.keys()).anonKey??x():x(),r=performance.now(),a=await fetch(`${ch()}/functions/v1/${e}`,{method:n,headers:{apikey:t,authorization:`Bearer ${t}`,\"content-type\":`application/json`},body:n===`GET`||n===`HEAD`?void 0:o}),s=await a.text(),c=s;try{c=JSON.stringify(JSON.parse(s),null,2)}catch{}l({status:a.status,ms:Math.round(performance.now()-r),headers:[...a.headers.entries()],body:c})}catch(e){l({status:0,ms:0,headers:[],body:`Request failed: ${e.message}`})}finally{d(!1)}}return(0,B.jsx)(Kp,{open:!0,onClose:t,width:`w-[560px]`,title:(0,B.jsxs)(`span`,{children:[`Invoke `,(0,B.jsx)(`code`,{className:`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e})]}),footer:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,children:`Close`})}),(0,B.jsxs)(H,{className:`ml-auto`,onClick:()=>void f(),disabled:u,children:[(0,B.jsx)(dt,{size:12}),` `,u?`Invoking\u2026`:`Invoke`]})]}),children:(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Method`}),(0,B.jsx)(Up,{value:n,onValueChange:r,options:[`POST`,`GET`,`PUT`,`PATCH`,`DELETE`].map(e=>({value:e}))})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Authorization`}),(0,B.jsx)(Up,{value:i,onValueChange:e=>a(e),options:[{value:`service_role`,label:`service_role key`},{value:`anon`,label:`anon key`}]})]})]}),n!==`GET`&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Request body (JSON)`}),(0,B.jsx)(nr,{lang:`js`,className:`h-32`,value:o,onChange:s,onCmdEnter:()=>void f()})]}),u&&(0,B.jsx)(qp,{}),c&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`mb-2 flex items-center gap-3 text-[13px]`,children:[(0,B.jsx)(`span`,{className:`rounded px-2 py-0.5 font-mono text-xs font-semibold `+(c.status>=200&&c.status<300?`bg-brand/15 text-brand`:c.status===0?`bg-destructive/15 text-destructive`:`bg-warning/15 text-warning`),children:c.status||`ERR`}),(0,B.jsxs)(`span`,{className:`text-muted-foreground/80`,children:[c.ms,` ms`]})]}),(0,B.jsx)(er,{value:c.body||`(empty body)`,lang:`js`,readOnly:!0,minLines:4,maxLines:200}),c.headers.length>0&&(0,B.jsxs)(`details`,{className:`mt-2`,children:[(0,B.jsxs)(`summary`,{className:`cursor-pointer text-xs text-muted-foreground hover:text-foreground`,children:[`Response headers (`,c.headers.length,`)`]}),(0,B.jsx)(`div`,{className:`mt-1.5 space-y-0.5 font-mono text-[11px] text-muted-foreground`,children:c.headers.map(([e,t])=>(0,B.jsxs)(`div`,{className:`truncate`,children:[(0,B.jsx)(`span`,{className:`text-foreground/70`,children:e}),`: `,t]},e))})]})]})]})})}var $g=[`functions`,`secrets`,`settings`];function e_(){let{section:e}=qt(),t=$g.includes(e)?e:`functions`;return(0,B.jsxs)(`div`,{className:`flex h-full`,children:[(0,B.jsx)(wh,{title:`Edge Functions`,active:t,onSelect:e=>z(`functions`,e),groups:[{title:`Manage`,items:[{id:`functions`,label:`Functions`}]},{title:`Configuration`,items:[{id:`secrets`,label:`Secrets`},{id:`settings`,label:`Settings`}]}]}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:[t===`functions`&&(0,B.jsx)(t_,{}),t===`secrets`&&(0,B.jsx)(r_,{}),t===`settings`&&(0,B.jsx)(o_,{})]})]})}function t_(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),i=(0,_.useCallback)(()=>{N.edgeFunctions().then(e=>t(e.functions),()=>t([]))},[]);return(0,_.useEffect)(()=>{i()},[i]),e===null?(0,B.jsx)(qp,{}):(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsx)(`div`,{className:`border-b border-border px-6 pb-4 pt-5`,children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`text-lg font-semibold text-foreground`,children:`Functions`}),(0,B.jsxs)(`p`,{className:`mt-0.5 text-[13px] text-muted-foreground/80`,children:[(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`Deno.serve`}),` / export-default handlers loaded from`,` `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`supabase/functions/<name>/index.ts`}),` \u2014 running in-process.`]})]}),(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,title:`Refresh`,onClick:i,children:(0,B.jsx)(ht,{size:13})})]})}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[e.length===0?(0,B.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,B.jsxs)(`div`,{className:`max-w-md rounded-lg border border-dashed border-border px-10 py-8 text-center`,children:[(0,B.jsx)(It,{size:20,className:`mx-auto text-muted-foreground/60`}),(0,B.jsx)(`p`,{className:`mt-3 text-sm font-medium text-foreground`,children:`No functions loaded`}),(0,B.jsxs)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground/80`,children:[`Create `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`supabase/functions/hello/index.ts`}),` with a`,` `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`Deno.serve(handler)`}),` and restart tinbase \u2014 it appears here and is served at `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`/functions/v1/hello`}),`.`]})]})}):(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Z,{children:`Name`}),(0,B.jsx)(Z,{children:`URL`}),(0,B.jsx)(Z,{className:`w-24`})]})}),(0,B.jsx)(`tbody`,{children:e.map(e=>{let t=`${ch()}/functions/v1/${e}`;return(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{className:`font-mono text-foreground/90`,children:e}),(0,B.jsx)(Q,{children:(0,B.jsxs)(`span`,{className:`flex items-center gap-1 font-mono text-[12px] text-muted-foreground`,children:[(0,B.jsx)(`span`,{className:`truncate`,children:t}),(0,B.jsx)(Qn,{value:t,label:`${e} URL`,iconSize:11})]})}),(0,B.jsx)(Q,{children:(0,B.jsxs)(H,{variant:`outline`,size:`xs`,onClick:()=>r(e),children:[(0,B.jsx)(dt,{size:11}),` Invoke`]})})]},e)})})]}),e.length>0&&(0,B.jsx)(cf,{children:`Invoke runs the function through the real HTTP path with the key/role you pick.`})]}),n&&(0,B.jsx)(Qg,{name:n,onClose:()=>r(null)})]})}var n_={SUPABASE_URL:`The in-process API gateway for this tinbase instance.`,SUPABASE_ANON_KEY:`Anon JWT \u2014 safe in a browser when RLS is enabled.`,SUPABASE_SERVICE_ROLE_KEY:`Service-role JWT \u2014 bypasses RLS, keep server-side only.`};function r_(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(``),i=(0,_.useCallback)(()=>{N.edgeFunctions().then(e=>{let n=new Set(e.builtins),r=Object.keys(e.env).filter(e=>!n.has(e)).sort((e,t)=>e.localeCompare(t)).map(t=>({name:t,digest:e.digests[t]??``}));t({builtins:e.builtins,custom:r})},()=>t({builtins:[],custom:[]}))},[]);if((0,_.useEffect)(()=>{i()},[i]),e===null)return(0,B.jsx)(qp,{});let a=n.trim()?e.custom.filter(e=>e.name.toLowerCase().includes(n.trim().toLowerCase())):e.custom;return(0,B.jsxs)(bh,{title:`Edge Function Secrets`,children:[(0,B.jsx)(a_,{existing:new Set([...e.builtins,...e.custom.map(e=>e.name)]),onSaved:i}),(0,B.jsxs)(xh,{title:`Custom secrets`,description:`Runtime secrets you've set for this instance. Applied live to Deno.env \u2014 no restart. Not written back to supabase/functions/.env, so a restart reloads from that file.`,children:[(0,B.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground/70`,children:[e.custom.length,` secret`,e.custom.length===1?``:`s`]}),e.custom.length>0&&(0,B.jsx)(Y,{value:n,onChange:e=>r(e.target.value),placeholder:`Search for a secret`,className:`h-8 w-56 text-xs`})]}),e.custom.length===0?(0,B.jsx)(`p`,{className:`py-6 text-xs text-muted-foreground/60`,children:`No custom secrets yet. Add one above.`}):(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Z,{children:`Name`}),(0,B.jsxs)(Z,{children:[`Digest `,(0,B.jsx)(V,{variant:`neutral`,children:`SHA256`})]}),(0,B.jsx)(Z,{className:`w-10`})]})}),(0,B.jsxs)(`tbody`,{children:[a.map(e=>(0,B.jsx)(i_,{secret:e,onChanged:i},e.name)),a.length===0&&(0,B.jsx)(`tr`,{children:(0,B.jsxs)(Q,{colSpan:3,className:`py-6 text-center text-xs text-muted-foreground/60`,children:[`No secret matches \u201C`,n,`\u201D.`]})})]})]})]}),(0,B.jsx)(xh,{title:`Built-in secrets`,description:`Injected into every function by tinbase \u2014 read-only. These are the vars a local Supabase edge function can rely on here.`,children:e.builtins.map(e=>(0,B.jsx)(Sh,{label:e,description:n_[e]??`Provided by tinbase.`,children:(0,B.jsx)(V,{variant:`neutral`,children:`built-in`})},e))})]})}function i_({secret:e,onChanged:t}){let[n,r]=(0,_.useState)(!1),i=async()=>{try{await N.deleteSecret(e.name),U.success(`Deleted ${e.name}`),t()}catch(t){U.error(t instanceof Error?t.message:`Failed to delete ${e.name}`)}finally{r(!1)}};return(0,B.jsxs)(Zp,{children:[(0,B.jsx)(Q,{children:(0,B.jsx)(V,{variant:`neutral`,children:e.name})}),(0,B.jsx)(Q,{children:(0,B.jsxs)(`span`,{className:`flex items-center gap-1 font-mono text-[12px] text-muted-foreground`,children:[(0,B.jsxs)(`span`,{className:`truncate`,title:e.digest,children:[e.digest.slice(0,48),`\u2026`]}),(0,B.jsx)(Qn,{value:e.digest,label:`${e.name} digest`,iconSize:11})]})}),(0,B.jsx)(Q,{children:(0,B.jsxs)(Zd,{children:[(0,B.jsx)(Qd,{asChild:!0,children:(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,title:`Actions`,children:(0,B.jsx)(Ee,{size:13})})}),(0,B.jsx)(tf,{children:(0,B.jsxs)(nf,{danger:!0,onSelect:()=>r(!0),children:[(0,B.jsx)(Ot,{size:13}),` Delete secret`]})})]})}),n&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Delete ${e.name}?`,description:`Functions will stop seeing this value on the next invocation.`,confirmLabel:`Delete`,onConfirm:()=>void i(),onClose:()=>r(!1)})]})}function a_({existing:e,onSaved:t}){let[n,r]=(0,_.useState)([{name:``,value:``}]),[i,a]=(0,_.useState)(!1),o=(e,t)=>r(n=>n.map((n,r)=>r===e?{...n,...t}:n)),s=async()=>{let i={};for(let t of n){let n=t.name.trim();if(n){if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(n))return U.error(`Invalid name \"${n}\" \u2014 letters, digits, underscores.`);if(e.has(n)&&[`SUPABASE_URL`,`SUPABASE_ANON_KEY`,`SUPABASE_SERVICE_ROLE_KEY`].includes(n))return U.error(`\"${n}\" is built-in and can't be changed.`);i[n]=t.value}}if(Object.keys(i).length===0)return U.error(`Enter at least one named secret.`);a(!0);try{await N.putSecrets(i),U.success(`Saved ${Object.keys(i).length} secret${Object.keys(i).length===1?``:`s`}`),r([{name:``,value:``}]),t()}catch(e){U.error(e instanceof Error?e.message:`Failed to save secrets`)}finally{a(!1)}};return(0,B.jsx)(xh,{title:`Add or replace secrets`,description:`Set a secret every function reads via Deno.env.get(). Saving an existing name replaces its value.`,children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[n.map((e,t)=>(0,B.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_minmax(0,1.6fr)_auto] items-start gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Name`}),(0,B.jsx)(Y,{value:e.name,onChange:e=>o(t,{name:e.target.value}),placeholder:`e.g. CLIENT_KEY`,className:`mt-1 h-9 font-mono text-xs`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Value`}),(0,B.jsx)($p,{value:e.value,onChange:e=>o(t,{value:e.target.value}),placeholder:`Supports multi-line values such as PEM keys, JSON, or tokens.`,rows:2,className:`mt-1 font-mono text-xs`})]}),n.length>1&&(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,title:`Remove row`,className:`mt-6`,onClick:()=>r(e=>e.filter((e,n)=>n!==t)),children:(0,B.jsx)(Ot,{size:13})})]},t)),(0,B.jsxs)(`div`,{className:`flex items-center justify-between border-t border-border pt-3`,children:[(0,B.jsxs)(H,{variant:`outline`,size:`xs`,onClick:()=>r(e=>[...e,{name:``,value:``}]),children:[(0,B.jsx)(pt,{size:12}),` Add another`]}),(0,B.jsx)(H,{size:`sm`,onClick:()=>void s(),disabled:i,children:i?`Saving\u2026`:`Save`})]})]})})}function o_(){let e=({children:e})=>(0,B.jsx)(`code`,{className:`rounded bg-code px-1 py-px font-mono text-foreground/90`,children:e});return(0,B.jsxs)(bh,{title:`Edge Function Settings`,children:[(0,B.jsxs)(xh,{title:`Runtime`,description:`How functions execute on this instance.`,children:[(0,B.jsx)(Sh,{label:`Engine`,description:`In-process Deno shim \u2014 no containers, no cold starts.`,children:(0,B.jsxs)(`span`,{className:`text-[13px] text-muted-foreground`,children:[(0,B.jsx)(e,{children:`Deno.serve`}),`, `,(0,B.jsx)(e,{children:`Deno.env`}),`, fetch, WebCrypto`]})}),(0,B.jsx)(Sh,{label:`Loading`,description:`Functions are discovered at boot; restart tinbase to pick up new or changed code.`,children:(0,B.jsx)(`span`,{className:`text-[13px] text-muted-foreground`,children:(0,B.jsx)(e,{children:`supabase/functions/<name>/index.ts`})})}),(0,B.jsx)(Sh,{label:`Invocation`,description:`Every HTTP method, CORS pre-handled.`,children:(0,B.jsx)(`span`,{className:`text-[13px] text-muted-foreground`,children:(0,B.jsx)(e,{children:`/functions/v1/<name>`})})})]}),(0,B.jsxs)(xh,{title:`Security`,description:`What a function sees on each request.`,children:[(0,B.jsx)(Sh,{label:`JWT verification`,description:(0,B.jsxs)(B.Fragment,{children:[`The `,(0,B.jsx)(e,{children:`Authorization`}),` header is passed through as-is \u2014 verify the JWT inside the function (or trust the gateway key), matching `,(0,B.jsx)(e,{children:`verify_jwt`}),`-off Supabase functions.`]}),children:(0,B.jsx)(V,{variant:`neutral`,children:`pass-through`})}),(0,B.jsx)(Sh,{label:`Secrets`,description:`Injected from supabase/functions/.env plus the built-in SUPABASE_* vars.`,children:(0,B.jsx)(H,{variant:`outline`,size:`xs`,onClick:()=>z(`functions`,`secrets`),children:`View secrets`})}),(0,B.jsx)(Sh,{label:`Database access`,description:(0,B.jsxs)(B.Fragment,{children:[`Use supabase-js with `,(0,B.jsx)(e,{children:`SUPABASE_URL`}),` and a key from env \u2014 requests loop back through the same backend in-process.`]}),children:(0,B.jsx)(V,{variant:`brand`,children:`in-process`})})]})]})}function s_(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(!0),f=ch(),p=Zn(f,`API URL`);if((0,_.useEffect)(()=>{Promise.allSettled([N.stats(),N.tables(),N.migrations(),N.logs(),Zm()]).then(([e,n,i,o,c])=>{e.status===`fulfilled`&&t(e.value),r(n.status===`fulfilled`?n.value:[]),i.status===`fulfilled`&&a(i.value),o.status===`fulfilled`&&s(o.value),c.status===`fulfilled`&&l(c.value),d(!1)})},[]),u)return(0,B.jsx)(qp,{});let m=n.reduce((e,t)=>e+t.rowCount,0),h=i[i.length-1],g=o.slice(-8).reverse(),v=o.filter(e=>e.level===`error`).length;return(0,B.jsx)(`div`,{className:`h-full overflow-y-auto`,children:(0,B.jsxs)(`div`,{className:`mx-auto w-full max-w-7xl space-y-12 px-10 py-12`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(`h1`,{className:`text-3xl font-semibold text-foreground`,children:`tinbase`}),(0,B.jsxs)(V,{variant:`brand`,children:[(0,B.jsx)(`span`,{className:`inline-block size-1.5 rounded-full bg-brand`}),` `,`Healthy`]})]}),(0,B.jsxs)(`button`,{onClick:p.copy,title:p.copied?`Copied!`:`Copy API URL`,className:`group mt-1.5 flex items-center gap-2 font-mono text-[13px] text-muted-foreground/80 transition-colors hover:text-foreground`,children:[f,p.copied?(0,B.jsx)(fe,{size:11,className:`text-brand`}):(0,B.jsx)(xe,{size:11,className:`opacity-0 transition-opacity group-hover:opacity-100`})]}),(0,B.jsxs)(`div`,{className:`mt-8 grid grid-cols-1 gap-x-10 gap-y-6 sm:grid-cols-2 lg:grid-cols-3`,children:[(0,B.jsx)(c_,{icon:oe,label:`Status`,value:`Healthy`,accent:!0}),(0,B.jsx)(c_,{icon:Ce,label:`Database size`,value:e?.dbSize??`\u2014`}),(0,B.jsx)(c_,{icon:It,label:`Version`,value:e?.version??`\u2014`}),(0,B.jsx)(c_,{icon:Ae,label:`Last migration`,value:h?h.name??h.version:`No migrations`,sub:h?(0,B.jsx)(Km,{value:h.applied_at}):void 0}),(0,B.jsx)(c_,{icon:Et,label:`Tables`,value:`${e?.tables??0}`,sub:`${m.toLocaleString()} total rows`}),(0,B.jsx)(c_,{icon:Ge,label:`Auth users`,value:`${e?.users??0}`})]})]}),(0,B.jsx)(l_,{title:`At a glance`,children:(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 lg:grid-cols-4`,children:[(0,B.jsx)(d_,{icon:Et,label:`Table Editor`,value:e?.tables??0,sub:`${m.toLocaleString()} rows`,onClick:()=>z(`table`)}),(0,B.jsx)(d_,{icon:Ge,label:`Authentication`,value:e?.users??0,sub:`users`,onClick:()=>z(`auth`)}),(0,B.jsx)(d_,{icon:ze,label:`Storage`,value:e?.buckets??0,sub:`${e?.objects??0} objects`,onClick:()=>z(`storage`)}),(0,B.jsx)(d_,{icon:gt,label:`Logs`,value:o.length,sub:v>0?`${v} errors`:`no errors`,danger:v>0,onClick:()=>z(`logs`)})]})}),(0,B.jsx)(l_,{title:`Advisor`,action:c.length>0?(0,B.jsxs)(`button`,{className:`text-xs text-brand hover:underline`,onClick:$m,children:[`View all `,c.length]}):void 0,children:c.length===0?(0,B.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border border-border bg-card p-5 text-[13px] text-muted-foreground`,children:[(0,B.jsx)(fe,{size:15,className:`text-brand`}),` No advisor findings \u2014 security and performance checks all pass.`]}):(0,B.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-border bg-card`,children:c.slice(0,6).map(e=>(0,B.jsxs)(`button`,{onClick:$m,className:`flex w-full items-center gap-3 border-b border-border/60 px-4 py-2.5 text-left transition-colors last:border-0 hover:bg-accent/40`,children:[(0,B.jsx)(bt,{size:14,className:e.level===`critical`?`text-destructive`:e.level===`warning`?`text-warning`:`text-muted-foreground/70`}),(0,B.jsx)(`span`,{className:`shrink-0 text-[13px] text-foreground/90`,children:e.title}),(0,B.jsx)(`span`,{className:`truncate font-mono text-xs text-muted-foreground`,children:e.entity}),(0,B.jsx)(le,{size:12,className:`ml-auto shrink-0 text-muted-foreground/60`})]},e.id))})}),(0,B.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-2`,children:[(0,B.jsx)(u_,{title:`Recent migrations`,onMore:()=>z(`database`,`migrations`),children:i.length===0?(0,B.jsxs)(`p`,{className:`px-4 py-6 text-center text-xs text-muted-foreground/60`,children:[`No migrations applied. Add SQL files under`,` `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`supabase/migrations/`}),`.`]}):i.slice(-6).reverse().map(e=>(0,B.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border/60 px-4 py-2 last:border-0`,children:[(0,B.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground/80`,children:e.version}),(0,B.jsx)(`span`,{className:`truncate text-[13px] text-foreground/80`,children:e.name??`\u2014`}),(0,B.jsx)(`span`,{className:`ml-auto shrink-0 text-[11px] text-muted-foreground/60`,children:(0,B.jsx)(Km,{value:e.applied_at})})]},e.version))}),(0,B.jsx)(u_,{title:`Recent logs`,onMore:()=>z(`logs`),children:g.length===0?(0,B.jsx)(`p`,{className:`px-4 py-6 text-center text-xs text-muted-foreground/60`,children:`No log entries yet.`}):g.map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-center gap-2.5 border-b border-border/60 px-4 py-2 last:border-0`,children:[(0,B.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full `+(e.level===`error`?`bg-destructive`:e.level===`warn`?`bg-warning`:`bg-muted-foreground/60`)}),(0,B.jsx)(`span`,{className:`truncate font-mono text-xs text-muted-foreground`,children:e.msg}),(0,B.jsx)(`span`,{className:`ml-auto shrink-0 text-[11px] text-muted-foreground/60`,children:(0,B.jsx)(Km,{value:e.ts,format:`time`})})]},t))})]}),(0,B.jsx)(l_,{title:`Get connected`,children:(0,B.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-6`,children:[(0,B.jsxs)(`p`,{className:`text-[13px] text-muted-foreground/80`,children:[`Every tinbase service is a`,` `,(0,B.jsx)(`span`,{className:`text-foreground/80`,children:`(Request) \u21D2 Response`}),` `,`fetch handler \u2014 run the whole backend in-process, or point`,` `,(0,B.jsx)(`span`,{className:`text-foreground/80`,children:`supabase-js`}),` at this server (URL + keys under`,` `,(0,B.jsx)(`span`,{className:`text-foreground/80`,children:`Connect`}),`).`]}),(0,B.jsx)(`div`,{className:`mt-3`,children:(0,B.jsx)(tr,{code:lh(),lang:`js`})})]})})]})})}function c_({icon:e,label:t,value:n,sub:r,accent:i}){return(0,B.jsxs)(`div`,{className:`flex items-start gap-3.5`,children:[(0,B.jsx)(`div`,{className:`flex size-11 shrink-0 items-center justify-center rounded-md border border-border bg-card`,children:(0,B.jsx)(e,{size:17,className:i?`text-brand`:`text-muted-foreground/80`})}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/80`,children:t}),(0,B.jsx)(`p`,{className:`mt-0.5 truncate text-sm `+(i?`text-brand`:`text-foreground`),children:n}),r&&(0,B.jsx)(`p`,{className:`truncate text-xs text-muted-foreground/60`,children:r})]})]})}function l_({title:e,action:t,children:n}){return(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-4`,children:[(0,B.jsx)(`h2`,{className:`text-base font-medium text-foreground`,children:e}),t]}),n]})}function u_({title:e,onMore:t,children:n}){return(0,B.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border bg-card`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-4 py-2.5`,children:[(0,B.jsx)(`h3`,{className:`text-[13px] font-medium text-foreground`,children:e}),t&&(0,B.jsxs)(`button`,{onClick:t,className:`flex items-center gap-1 text-[11px] text-muted-foreground/80 transition-colors hover:text-brand`,children:[`View all `,(0,B.jsx)(le,{size:11})]})]}),(0,B.jsx)(`div`,{children:n})]})}function d_({icon:e,label:t,value:n,sub:r,danger:i,onClick:a}){return(0,B.jsxs)(`button`,{onClick:a,className:`group rounded-lg border border-border bg-card p-5 text-left transition-colors hover:border-muted-foreground`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground/80`,children:[(0,B.jsx)(e,{size:13}),(0,B.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-wide`,children:t}),(0,B.jsx)(le,{size:12,className:`ml-auto opacity-0 transition-opacity group-hover:opacity-100`})]}),(0,B.jsx)(`p`,{className:`mt-3 text-3xl font-semibold text-foreground`,children:n.toLocaleString()}),(0,B.jsx)(`p`,{className:`mt-1 text-[13px] `+(i?`text-destructive`:`text-muted-foreground/80`),children:r})]})}function f_(e,t){let n=e=>{if(e==null)return``;let t=typeof e==`object`?JSON.stringify(e):String(e);return/[\",\\n]/.test(t)?`\"`+t.replace(/\"/g,`\"\"`)+`\"`:t};return[e.join(`,`),...t.map(t=>e.map(e=>n(t[e])).join(`,`))].join(`\n`)}function p_(e,t,n){let r=document.createElement(`a`);r.href=URL.createObjectURL(new Blob([n],{type:t})),r.download=e,r.click(),URL.revokeObjectURL(r.href)}var m_=/^([A-Z]+)\\s+(\\S+)\\s+\u2192\\s+(\\d{3})\\b/;function h_(e,t){if(e)return e.startsWith(`/rest/`)?`REST`:e.startsWith(`/auth/`)?`Auth`:e.startsWith(`/storage/`)?`Storage`:e.startsWith(`/realtime/`)?`Realtime`:e.startsWith(`/functions/`)?`Functions`:e.startsWith(`/admin/`)?`Admin`:e.startsWith(`/inbox`)?`Inbox`:e===`/_`||e.startsWith(`/_/`)?`Studio`:`Server`;let n=t.toLowerCase();return n.includes(`cron`)?`Cron`:n.includes(`webhook`)||n.includes(`http`)?`Webhooks`:n.includes(`mail`)||n.includes(`otp`)||n.includes(`magic`)?`Auth`:n.includes(`migration`)?`Migrations`:`Server`}function g_(e){let t=m_.exec(e.msg),n=t?.[1]??null,r=t?.[2]??null,i=t?parseInt(t[3],10):null;return{...e,method:n,path:r,status:i,service:h_(r,e.msg)}}var __=e=>e===null?null:`${Math.floor(e/100)}xx`,v_=[{key:`all`,label:`All time`,ms:null},{key:`1m`,label:`Last minute`,ms:6e4},{key:`5m`,label:`Last 5 min`,ms:3e5},{key:`15m`,label:`Last 15 min`,ms:9e5},{key:`1h`,label:`Last hour`,ms:36e5}];function y_(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(!0),[i,a]=(0,_.useState)(`all`),[o,s]=(0,_.useState)(new Set),[c,l]=(0,_.useState)(new Set),[u,d]=(0,_.useState)(new Set),[f,p]=(0,_.useState)(new Set),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(null),[y,b]=(0,_.useState)(!1),x=(0,_.useCallback)(async()=>{try{t(await N.logs())}catch{}},[]);(0,_.useEffect)(()=>{if(x(),!n)return;let e=setInterval(x,2e3);return()=>clearInterval(e)},[n,x]);let S=(0,_.useMemo)(()=>(e??[]).map(g_),[e]),C=(0,_.useMemo)(()=>{let e=v_.find(e=>e.key===i).ms,t=e===null?0:Date.now()-e,n=m.toLowerCase();return S.filter(e=>(t===0||Date.parse(e.ts)>=t)&&(!n||e.msg.toLowerCase().includes(n)))},[S,i,m]),w=(0,_.useMemo)(()=>{let e=new Map,t={info:0,warn:0,error:0},n=new Map,r=new Map;for(let i of C){e.set(i.service,(e.get(i.service)??0)+1),t[i.level]++,i.method&&n.set(i.method,(n.get(i.method)??0)+1);let a=__(i.status);a&&r.set(a,(r.get(a)??0)+1)}return{svc:e,lvl:t,mth:n,sts:r}},[C]),T=(0,_.useMemo)(()=>C.filter(e=>(o.size===0||o.has(e.service))&&(c.size===0||c.has(e.level))&&(u.size===0||e.method!==null&&u.has(e.method))&&(f.size===0||__(e.status)!==null&&f.has(__(e.status)))).reverse(),[C,o,c,u,f]),E=o.size+c.size+u.size+f.size+ +!!m+(i===`all`?0:1);return e===null?(0,B.jsx)(qp,{}):(0,B.jsxs)(`div`,{className:`flex h-full`,children:[(0,B.jsxs)(mf,{id:`logs-facets`,side:`left`,defaultSize:224,min:180,max:360,className:`flex flex-col overflow-y-auto border-r border-border bg-card`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between px-4 pb-1 pt-4`,children:[(0,B.jsx)(`span`,{className:`text-sm font-semibold text-foreground`,children:`Logs`}),E>0&&(0,B.jsxs)(`button`,{className:`flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-accent hover:text-foreground`,onClick:()=>{s(new Set),l(new Set),d(new Set),p(new Set),h(``),a(`all`)},children:[(0,B.jsx)(Ft,{size:10}),` Clear (`,E,`)`]})]}),(0,B.jsx)(x_,{title:`Time range`,children:v_.map(e=>(0,B.jsx)(`button`,{onClick:()=>a(e.key),className:`flex w-full items-center rounded px-2 py-1 text-left text-xs transition-colors `+(i===e.key?`bg-accent text-foreground`:`text-muted-foreground hover:bg-accent/50 hover:text-foreground`),children:e.label},e.key))}),(0,B.jsxs)(x_,{title:`Service`,children:[[...w.svc.entries()].sort((e,t)=>t[1]-e[1]).map(([e,t])=>(0,B.jsx)(S_,{label:e,count:t,checked:o.has(e),onToggle:()=>s(b_(o,e))},e)),w.svc.size===0&&(0,B.jsx)(`p`,{className:`px-2 py-1 text-[11px] text-muted-foreground/50`,children:`No entries`})]}),(0,B.jsx)(x_,{title:`Level`,children:[`info`,`warn`,`error`].map(e=>(0,B.jsx)(S_,{label:e,count:w.lvl[e],dot:e===`error`?`bg-destructive`:e===`warn`?`bg-warning`:`bg-muted-foreground/60`,checked:c.has(e),onToggle:()=>l(b_(c,e))},e))}),(0,B.jsxs)(x_,{title:`Method`,children:[[`GET`,`POST`,`PATCH`,`PUT`,`DELETE`,`OPTIONS`].filter(e=>w.mth.has(e)).map(e=>(0,B.jsx)(S_,{label:e,mono:!0,count:w.mth.get(e),checked:u.has(e),onToggle:()=>d(b_(u,e))},e)),w.mth.size===0&&(0,B.jsx)(`p`,{className:`px-2 py-1 text-[11px] text-muted-foreground/50`,children:`No requests`})]}),(0,B.jsxs)(x_,{title:`Status`,children:[[`2xx`,`3xx`,`4xx`,`5xx`].filter(e=>w.sts.has(e)).map(e=>(0,B.jsx)(S_,{label:e,mono:!0,count:w.sts.get(e),dot:e===`2xx`?`bg-brand`:e===`4xx`?`bg-warning`:e===`5xx`?`bg-destructive`:`bg-muted-foreground/60`,checked:f.has(e),onToggle:()=>p(b_(f,e))},e)),w.sts.size===0&&(0,B.jsx)(`p`,{className:`px-2 py-1 text-[11px] text-muted-foreground/50`,children:`No responses`})]})]}),(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border px-3 py-2`,children:[(0,B.jsxs)(`div`,{className:`relative min-w-0 flex-1 max-w-md`,children:[(0,B.jsx)(_t,{size:13,className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/60`}),(0,B.jsx)(`input`,{value:m,onChange:e=>h(e.target.value),placeholder:`Search events\u2026`,className:`h-7 w-full rounded-md border border-input bg-field pl-8 pr-2 text-xs text-foreground placeholder:text-muted-foreground/60 focus:border-brand focus:outline-none`})]}),(0,B.jsxs)(`span`,{className:`text-[11px] tabular-nums text-muted-foreground/70`,children:[T.length.toLocaleString(),` event`,T.length===1?``:`s`]}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,B.jsx)(H,{variant:n?`outline`:`ghost`,size:`xs`,onClick:()=>r(e=>!e),children:n?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(st,{size:12}),` Live `,(0,B.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-brand`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(dt,{size:12}),` Paused`]})}),(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,title:`Refresh`,onClick:()=>void x(),children:(0,B.jsx)(ht,{size:13})}),(0,B.jsxs)(Zd,{children:[(0,B.jsx)(Qd,{asChild:!0,children:(0,B.jsxs)(H,{variant:`ghost`,size:`xs`,title:`Download logs`,children:[(0,B.jsx)(Te,{size:13}),` `,(0,B.jsx)(pe,{size:10})]})}),(0,B.jsxs)(tf,{align:`end`,children:[(0,B.jsx)(nf,{onSelect:()=>p_(`tinbase-logs.txt`,`text/plain`,T.map(e=>`${e.ts} ${e.level.toUpperCase()} ${e.msg}`).join(`\n`)),children:`Download .txt`}),(0,B.jsx)(nf,{onSelect:()=>p_(`tinbase-logs.json`,`application/json`,JSON.stringify(T,null,2)),children:`Download .json`})]})]}),(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,title:`Clear logs`,onClick:()=>b(!0),children:(0,B.jsx)(Ot,{size:13})})]})]}),(0,B.jsx)(C_,{entries:C}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:T.length===0?(0,B.jsx)(cf,{children:S.length===0?`No logs yet. Make a request or trigger an email/webhook.`:`No entries match the filters.`}):(0,B.jsxs)(`table`,{className:`w-full border-collapse font-mono text-[12px]`,children:[(0,B.jsx)(`thead`,{className:`sticky top-0 z-10 bg-background`,children:(0,B.jsxs)(`tr`,{className:`border-b border-border text-left text-[10px] uppercase tracking-wider text-muted-foreground/60`,children:[(0,B.jsx)(`th`,{className:`w-24 px-3 py-1.5 font-medium`,children:`Time`}),(0,B.jsx)(`th`,{className:`w-16 px-2 py-1.5 font-medium`,children:`Level`}),(0,B.jsx)(`th`,{className:`w-20 px-2 py-1.5 font-medium`,children:`Service`}),(0,B.jsx)(`th`,{className:`w-16 px-2 py-1.5 font-medium`,children:`Method`}),(0,B.jsx)(`th`,{className:`w-12 px-2 py-1.5 font-medium`,children:`Status`}),(0,B.jsx)(`th`,{className:`px-2 py-1.5 font-medium`,children:`Event`})]})}),(0,B.jsx)(`tbody`,{children:T.map((e,t)=>(0,B.jsxs)(`tr`,{onClick:()=>v(e),className:`cursor-pointer border-b border-border/40 transition-colors hover:bg-accent/40 `+(g===e?`bg-selected `:``)+(e.level===`error`?`bg-destructive/5`:``),children:[(0,B.jsx)(`td`,{className:`whitespace-nowrap px-3 py-1 text-muted-foreground/70`,children:(0,B.jsx)(Km,{value:e.ts,format:`time`})}),(0,B.jsx)(`td`,{className:`px-2 py-1`,children:(0,B.jsx)(`span`,{className:`inline-block size-2 rounded-full `+(e.level===`error`?`bg-destructive`:e.level===`warn`?`bg-warning`:`bg-muted-foreground/40`),title:e.level})}),(0,B.jsx)(`td`,{className:`px-2 py-1 text-muted-foreground/80`,children:e.service}),(0,B.jsx)(`td`,{className:`px-2 py-1 text-foreground/70`,children:e.method??``}),(0,B.jsx)(`td`,{className:`px-2 py-1`,children:e.status!==null&&(0,B.jsx)(`span`,{className:e.status>=500?`text-destructive`:e.status>=400?`text-warning`:`text-brand`,children:e.status})}),(0,B.jsx)(`td`,{className:`max-w-0 truncate px-2 py-1 text-foreground/85`,title:e.msg,children:e.path??e.msg})]},`${e.ts}-${t}`))})]})})]}),g&&(0,B.jsx)(O_,{entry:g,onClose:()=>v(null)}),y&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Clear all logs?`,description:`The in-memory log buffer is emptied \u2014 this cannot be undone.`,confirmLabel:`Clear logs`,onConfirm:()=>{N.clearLogs().then(x),v(null)},onClose:()=>b(!1)})]})}function b_(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function x_({title:e,children:t}){return(0,B.jsxs)(`div`,{className:`px-2 pt-3`,children:[(0,B.jsx)(`p`,{className:`px-2 pb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60`,children:e}),t]})}function S_({label:e,count:t,checked:n,onToggle:r,dot:i,mono:a}){return(0,B.jsxs)(`button`,{onClick:r,className:`group flex w-full items-center gap-2 rounded px-2 py-1 text-left text-xs text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground`,children:[(0,B.jsx)(Zt,{checked:n,onChange:r}),i&&(0,B.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full ${i}`}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate `+(a?`font-mono`:``),children:e}),(0,B.jsx)(`span`,{className:`tabular-nums text-muted-foreground/50`,children:t.toLocaleString()})]})}function C_({entries:e}){let t=(0,_.useMemo)(()=>{if(e.length===0)return null;let t=1/0,n=-1/0,r=e.map(e=>Date.parse(e.ts));for(let e of r)e<t&&(t=e),e>n&&(n=e);n===t&&(n=t+1);let i=n-t,a=Array.from({length:60},()=>({ok:0,err:0}));return e.forEach((e,n)=>{let o=Math.min(59,Math.floor((r[n]-t)/i*60));e.level===`error`||e.status!==null&&e.status>=500?a[o].err++:a[o].ok++}),{buckets:a,peak:Math.max(...a.map(e=>e.ok+e.err)),min:t,max:n}},[e]);return t?(0,B.jsx)(`div`,{className:`flex h-12 shrink-0 items-end gap-px border-b border-border px-3 pb-1 pt-2`,title:`Event volume`,children:t.buckets.map((e,n)=>{let r=e.ok+e.err,i=r===0?0:Math.max(8,r/t.peak*100);return(0,B.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col justify-end self-stretch`,title:`${r} events`,children:r>0&&(0,B.jsxs)(`div`,{className:`flex w-full flex-col overflow-hidden rounded-sm`,style:{height:`${i}%`},children:[e.err>0&&(0,B.jsx)(`div`,{className:`w-full bg-destructive/70`,style:{flexGrow:e.err}}),(0,B.jsx)(`div`,{className:`w-full bg-brand/40`,style:{flexGrow:e.ok}})]})},n)})}):null}var w_={200:`OK`,201:`Created`,204:`No Content`,206:`Partial Content`,301:`Moved Permanently`,303:`See Other`,304:`Not Modified`,400:`Bad Request`,401:`Unauthorized`,403:`Forbidden`,404:`Not Found`,405:`Method Not Allowed`,406:`Not Acceptable`,409:`Conflict`,422:`Unprocessable Entity`,429:`Too Many Requests`,500:`Internal Server Error`,503:`Service Unavailable`};function T_(e){let t=Date.now()-Date.parse(e);if(!Number.isFinite(t))return``;for(let[e,n]of[[864e5,`day`],[36e5,`hour`],[6e4,`minute`],[1e3,`second`]])if(Math.abs(t)>=e){let r=Math.round(Math.abs(t)/e);return`${r} ${n}${r===1?``:`s`} ago`}return`just now`}function E_({label:e,copy:t,children:n}){return(0,B.jsxs)(`div`,{className:`group flex items-start gap-3 rounded px-1 py-1 -mx-1 hover:bg-accent/40`,children:[(0,B.jsx)(`span`,{className:`w-24 shrink-0 pt-px font-mono text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60`,children:e}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 text-right text-[12.5px] text-foreground/90`,children:n}),t!==void 0&&(0,B.jsx)(`span`,{className:`shrink-0 opacity-0 transition-opacity group-hover:opacity-100`,children:(0,B.jsx)(Qn,{value:t,label:e})})]})}function D_({title:e,children:t}){return(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`mb-1.5 border-b border-border pb-1.5 font-mono text-[10px] font-semibold uppercase tracking-wider text-muted-foreground`,children:e}),(0,B.jsx)(`div`,{className:`space-y-0.5`,children:t})]})}function O_({entry:e,onClose:t}){let n=new Date(e.ts),[r,i]=(e.path??``).split(`?`),a=Intl.DateTimeFormat().resolvedOptions().timeZone;return(0,B.jsxs)(mf,{id:`logs-detail`,side:`right`,defaultSize:400,min:300,max:640,className:`flex flex-col border-l border-border bg-card`,children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-border px-4 py-2.5`,children:[(0,B.jsx)(`span`,{className:`text-[13px] font-medium text-foreground`,children:`Event details`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(Qn,{value:JSON.stringify(e,null,2),label:`Event JSON`}),(0,B.jsx)(`button`,{className:`rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground`,onClick:t,children:(0,B.jsx)(Ft,{size:14})})]})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-4`,children:[(0,B.jsxs)(D_,{title:`Event`,children:[(0,B.jsx)(E_,{label:`Timestamp`,copy:e.ts,children:(0,B.jsx)(`span`,{className:`font-mono text-[12px]`,children:e.ts})}),(0,B.jsx)(E_,{label:`Local`,children:(0,B.jsx)(`span`,{className:`font-mono text-[12px]`,title:a,children:n.toLocaleString()})}),(0,B.jsx)(E_,{label:`Relative`,children:T_(e.ts)}),(0,B.jsx)(E_,{label:`Level`,children:(0,B.jsx)(V,{variant:e.level===`error`?`red`:e.level===`warn`?`amber`:`neutral`,children:e.level})}),(0,B.jsx)(E_,{label:`Service`,copy:e.service,children:e.service})]}),e.method&&(0,B.jsxs)(D_,{title:`Request`,children:[(0,B.jsx)(E_,{label:`Method`,copy:e.method,children:(0,B.jsx)(`span`,{className:`font-mono text-[12px]`,children:e.method})}),(0,B.jsx)(E_,{label:`Path`,copy:r,children:(0,B.jsx)(`span`,{className:`break-all font-mono text-[12px]`,children:r})}),i&&(0,B.jsx)(E_,{label:`Query`,copy:i,children:(0,B.jsx)(`span`,{className:`break-all font-mono text-[11px] text-muted-foreground`,children:i})}),e.status!==null&&(0,B.jsx)(E_,{label:`Status`,copy:String(e.status),children:(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,B.jsx)(V,{variant:e.status>=500?`red`:e.status>=400?`amber`:`brand`,children:e.status}),w_[e.status]&&(0,B.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:w_[e.status]})]})})]}),(0,B.jsx)(D_,{title:`Message`,children:(0,B.jsx)(`pre`,{className:`whitespace-pre-wrap wrap-break-word rounded-md border border-border bg-code p-3 font-mono text-[12px] leading-relaxed text-foreground/90`,children:e.msg})}),(0,B.jsx)(D_,{title:`Raw JSON`,children:(0,B.jsx)(`div`,{className:`overflow-hidden rounded-md border border-border bg-code px-1 py-2`,children:(0,B.jsx)(er,{value:JSON.stringify(e,null,2),lang:`js`,readOnly:!0,minLines:6,maxLines:16})})})]})]})}var k_=25e3;function A_(e){let t=`${e.baseUrl.replace(/^http/,`ws`)}/realtime/v1/websocket?apikey=${encodeURIComponent(e.token)}&vsn=1.0.0`,n=`realtime:${e.channel}`,r=0,i=()=>String(++r),a=null,o=null,s=!1;e.onStatus(`connecting`);let c=new WebSocket(t),l=t=>{c.readyState===WebSocket.OPEN&&(c.send(JSON.stringify(t)),e.onMessage({dir:`out`,ts:Date.now(),event:t.event,topic:t.topic,payload:t.payload}))};return c.onopen=()=>{e.onStatus(`open`);let t=e.listenChanges?[{event:`*`,schema:e.schema,...e.table?{table:e.table}:{}}]:[];a=i(),l({topic:n,event:`phx_join`,ref:a,payload:{config:{broadcast:{self:!0},presence:{key:`studio-${Math.floor(performance.now()).toString(36)}`},postgres_changes:t},access_token:e.token}}),o=setInterval(()=>{l({topic:`phoenix`,event:`heartbeat`,payload:{},ref:i()})},k_)},c.onmessage=t=>{try{let n=JSON.parse(String(t.data));if(n.topic===`phoenix`)return;if(n.event===`phx_reply`&&n.ref===a){let t=n.payload?.status===`ok`;e.onStatus(t?`joined`:`error`)}e.onMessage({dir:`in`,ts:Date.now(),event:n.event,topic:n.topic,payload:n.payload})}catch{e.onMessage({dir:`in`,ts:Date.now(),event:`raw`,payload:String(t.data)})}},c.onerror=()=>{s||e.onStatus(`error`)},c.onclose=()=>{o&&clearInterval(o),e.onStatus(`closed`)},{sendBroadcast:(e,t)=>{l({topic:n,event:`broadcast`,ref:i(),payload:{type:`broadcast`,event:e,payload:t}})},close:()=>{s=!0,o&&clearInterval(o);try{l({topic:n,event:`phx_leave`,payload:{},ref:i()})}finally{c.close()}}}}var j_=[`inspector`,`policies`,`settings`];function M_(){let{section:e}=qt(),t=j_.includes(e)?e:`inspector`;return(0,B.jsxs)(`div`,{className:`flex h-full`,children:[(0,B.jsx)(wh,{title:`Realtime`,active:t,onSelect:e=>z(`realtime`,e),groups:[{title:`Tools`,items:[{id:`inspector`,label:`Inspector`}]},{title:`Configuration`,items:[{id:`policies`,label:`Policies`},{id:`settings`,label:`Settings`}]}]}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:[t===`inspector`&&(0,B.jsx)(I_,{}),t===`policies`&&(0,B.jsx)(L_,{}),t===`settings`&&(0,B.jsx)(R_,{})]})]})}function N_(e){return e.event===`broadcast`?`broadcast`:e.event===`postgres_changes`?`postgres`:e.event.startsWith(`presence`)?`presence`:`system`}var P_={broadcast:`brand`,postgres:`blue`,presence:`amber`,system:`neutral`},F_={connecting:{label:`connecting\u2026`,variant:`amber`},open:{label:`connected`,variant:`amber`},joined:{label:`joined`,variant:`brand`},closed:{label:`disconnected`,variant:`neutral`},error:{label:`error`,variant:`red`}};function I_(){let[e,t]=(0,_.useState)(`room-1`),[n,r]=(0,_.useState)(`service_role`),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(`closed`),[u,d]=(0,_.useState)([]),[f,p]=(0,_.useState)(new Set),[m,h]=(0,_.useState)(`test`),[g,v]=(0,_.useState)(`{ \"hello\": \"world\" }`),y=(0,_.useRef)(null),b=c===`joined`||c===`open`||c===`connecting`;(0,_.useEffect)(()=>()=>y.current?.close(),[]);async function S(){let t=n===`anon`?(await N.keys()).anonKey??x():x();d([]),y.current?.close(),y.current=A_({baseUrl:ch(),token:t,channel:e.trim()||`room-1`,listenChanges:i,schema:`public`,table:o.trim()||void 0,onMessage:e=>d(t=>[e,...t].slice(0,500)),onStatus:l})}function C(){y.current?.close(),y.current=null}function w(){if(!y.current||c!==`joined`)return U.error(`Join a channel first`);let e;try{e=g.trim()?JSON.parse(g):{}}catch{return U.error(`Payload is not valid JSON`)}y.current.sendBroadcast(m.trim()||`test`,e)}let T=u.filter(e=>f.size===0||f.has(N_(e))),E=F_[c];return(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-end gap-3 border-b border-border px-4 py-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Channel`}),(0,B.jsx)(Y,{mono:!0,className:`w-44`,value:e,disabled:b,onChange:e=>t(e.target.value)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Join as`}),(0,B.jsx)(Up,{className:`w-36`,value:n,disabled:b,onValueChange:e=>r(e),options:[{value:`service_role`,label:`service_role`},{value:`anon`,label:`anon`}]})]}),(0,B.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 pb-2 text-[13px] text-foreground/80`,children:[(0,B.jsx)(Zt,{checked:i,disabled:b,onChange:a}),`postgres_changes`]}),i&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Table (empty = all public)`}),(0,B.jsx)(Y,{mono:!0,className:`w-40`,value:o,disabled:b,placeholder:`*`,onChange:e=>s(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-2 pb-0.5`,children:[(0,B.jsxs)(V,{variant:E.variant,children:[(0,B.jsx)(mt,{size:10}),` `,E.label]}),b?(0,B.jsxs)(H,{variant:`outline`,size:`xs`,onClick:C,children:[(0,B.jsx)(Tt,{size:11}),` Leave`]}):(0,B.jsxs)(H,{size:`xs`,onClick:()=>void S(),children:[(0,B.jsx)(dt,{size:11}),` Join channel`]})]})]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-end gap-3 border-b border-border bg-card px-4 py-2.5`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Broadcast event`}),(0,B.jsx)(Y,{mono:!0,className:`w-36`,value:m,onChange:e=>h(e.target.value)})]}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(X,{children:`Payload (JSON)`}),(0,B.jsx)(Y,{mono:!0,value:g,onChange:e=>v(e.target.value),onKeyDown:e=>e.key===`Enter`&&w()})]}),(0,B.jsxs)(H,{size:`xs`,className:`mb-0.5`,onClick:w,disabled:c!==`joined`,children:[(0,B.jsx)(vt,{size:11}),` Send`]})]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 border-b border-border px-4 py-2`,children:[[`broadcast`,`postgres`,`presence`,`system`].map(e=>(0,B.jsx)(`button`,{onClick:()=>p(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),className:`rounded-md border px-2 py-1 text-[11px] font-medium transition-colors `+(f.size===0||f.has(e)?`border-input text-foreground/80`:`border-transparent text-muted-foreground/50 hover:text-muted-foreground`),children:e},e)),(0,B.jsxs)(`span`,{className:`ml-auto text-xs text-muted-foreground/60`,children:[u.length,` messages`]}),(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,title:`Clear feed`,onClick:()=>d([]),children:(0,B.jsx)(Ot,{size:13})})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-2`,children:T.length===0?(0,B.jsx)(cf,{children:c===`joined`?`Listening\u2026 insert a row in the table editor or send a broadcast to see messages.`:`Join a channel to start inspecting realtime traffic.`}):T.map((e,t)=>{let n=N_(e);return(0,B.jsxs)(`details`,{className:`group rounded px-2 py-1 hover:bg-accent/40`,children:[(0,B.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2.5 text-[12.5px]`,children:[e.dir===`out`?(0,B.jsx)(de,{size:11,className:`shrink-0 text-brand`}):(0,B.jsx)(ce,{size:11,className:`shrink-0 text-info`}),(0,B.jsx)(`span`,{className:`shrink-0 font-mono text-muted-foreground/60`,children:(0,B.jsx)(Km,{value:e.ts,format:`time`})}),(0,B.jsx)(V,{variant:P_[n],children:n}),(0,B.jsx)(`span`,{className:`truncate font-mono text-foreground/80`,children:e.event})]}),(0,B.jsx)(`pre`,{className:`mt-1 overflow-auto rounded-md border border-border bg-code p-2 font-mono text-[11px] text-foreground/80`,children:JSON.stringify(e.payload,null,2)})]},t)})})]})}function L_(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),c=(0,_.useCallback)(()=>{N.policies(`realtime`).then(e=>t(e.filter(e=>e.table===`messages`)),()=>t([]))},[]);return(0,_.useEffect)(()=>{c();let e=setInterval(()=>void c(),5e3);return()=>clearInterval(e)},[c]),e===null?(0,B.jsx)(qp,{}):(0,B.jsxs)(`div`,{className:`mx-auto max-w-3xl px-8 py-8`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h1`,{className:`text-lg font-semibold text-foreground`,children:`Policies`}),(0,B.jsxs)(`p`,{className:`mt-0.5 text-[13px] text-muted-foreground/80`,children:[`RLS on `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`realtime.messages`}),` authorizes channels: SELECT gates receiving broadcast/presence, INSERT gates sending. Use `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`realtime.topic()`}),` in expressions to scope a policy to specific channels.`]})]}),(0,B.jsxs)(H,{size:`xs`,className:`shrink-0`,onClick:()=>r(!0),children:[(0,B.jsx)(pt,{size:12}),` New policy`]})]}),(0,B.jsxs)(`div`,{className:`mt-6 space-y-2`,children:[e.map(e=>(0,B.jsxs)(`div`,{className:`cursor-pointer rounded-md border border-border bg-card p-3 transition-colors hover:border-muted-foreground/60`,title:`Edit policy`,onClick:()=>a(e),children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`truncate font-mono text-[13px] text-foreground`,children:e.name}),(0,B.jsx)(V,{variant:`blue`,children:e.cmd}),(0,B.jsx)(V,{variant:`neutral`,children:Array.isArray(e.roles)?e.roles.join(`, `):String(e.roles)}),(0,B.jsx)(`button`,{className:`ml-auto p-1 text-muted-foreground/80 hover:text-destructive`,title:`Drop policy`,onClick:t=>{t.stopPropagation(),s(e)},children:(0,B.jsx)(Ot,{size:13})})]}),e.using_expr&&(0,B.jsxs)(`p`,{className:`mt-1.5 truncate font-mono text-[11px] text-muted-foreground/80`,title:e.using_expr,children:[`using (`,e.using_expr,`)`]}),e.with_check&&(0,B.jsxs)(`p`,{className:`mt-0.5 truncate font-mono text-[11px] text-muted-foreground/80`,title:e.with_check,children:[`with check (`,e.with_check,`)`]})]},e.name)),e.length===0&&(0,B.jsx)(`p`,{className:`rounded-md border border-dashed border-border px-4 py-6 text-center text-xs text-muted-foreground/60`,children:`No channel policies yet \u2014 every channel is public. Create one to start requiring authorization.`})]}),n&&(0,B.jsx)(wg,{table:`messages`,schema:`realtime`,onClose:()=>r(!1),onCreated:async()=>c()}),i&&(0,B.jsx)(wg,{table:`messages`,schema:`realtime`,existing:Dg(i),onClose:()=>a(null),onCreated:async()=>c()}),o&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Drop policy \"${o.name}\"?`,description:`Channel authorization changes immediately.`,confirmLabel:`Drop policy`,onConfirm:()=>{N.dropPolicy(`messages`,o.name,`realtime`).then(c,e=>U.error(e.message))},onClose:()=>s(null)})]})}function R_(){let e=`${ch().replace(/^http/,`ws`)}/realtime/v1/websocket?apikey=<anon key>&vsn=1.0.0`,t=({children:e})=>(0,B.jsx)(`code`,{className:`rounded bg-code px-1 py-px font-mono text-foreground/90`,children:e});return(0,B.jsxs)(bh,{title:`Realtime Settings`,children:[(0,B.jsxs)(xh,{title:`Connection`,description:`How clients reach the Realtime engine.`,children:[(0,B.jsx)(Sh,{label:`WebSocket endpoint`,description:`supabase-js connects here automatically from the project URL.`,wide:!0,children:(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`code`,{className:`min-w-0 flex-1 truncate rounded-md border border-border bg-code px-2.5 py-1.5 font-mono text-[12px] text-foreground/90`,title:e,children:e}),(0,B.jsx)(Qn,{value:e,label:`WebSocket URL`})]})}),(0,B.jsxs)(Sh,{label:`Protocol`,description:`The exact wire format supabase-js's RealtimeClient speaks.`,children:[(0,B.jsx)(Ch,{label:`Format`,value:`Phoenix v1 JSON`}),(0,B.jsx)(Ch,{label:`Heartbeat`,value:`every 25s`})]})]}),(0,B.jsxs)(xh,{title:`Features`,description:`What channels can carry on this instance.`,children:[(0,B.jsx)(Sh,{label:`postgres_changes`,description:`Change-data-capture on every table \u2014 INSERT / UPDATE / DELETE, filterable by schema and table.`,children:(0,B.jsx)(V,{variant:`brand`,children:`Enabled`})}),(0,B.jsx)(Sh,{label:`Broadcast`,description:(0,B.jsxs)(B.Fragment,{children:[`Client-to-client messages; `,(0,B.jsx)(t,{children:`self: true`}),` echoes back to the sender.`]}),children:(0,B.jsx)(V,{variant:`brand`,children:`Enabled`})}),(0,B.jsx)(Sh,{label:`Presence`,description:`Join/leave state tracking per channel.`,children:(0,B.jsx)(V,{variant:`brand`,children:`Enabled`})})]}),(0,B.jsx)(xh,{title:`Authorization`,description:`Who may join, read, and send on private channels.`,children:(0,B.jsx)(Sh,{label:`Channel policies`,description:(0,B.jsxs)(B.Fragment,{children:[`RLS on `,(0,B.jsx)(t,{children:`realtime.messages`}),`: SELECT gates receiving broadcast/presence, INSERT gates sending. Scope with `,(0,B.jsx)(t,{children:`realtime.topic()`}),`.`]}),children:(0,B.jsx)(H,{variant:`outline`,size:`xs`,onClick:()=>z(`realtime`,`policies`),children:`Manage policies`})})})]})}function z_(){let[e,t]=(0,_.useState)(``),n=ch();return(0,_.useEffect)(()=>{N.keys().then(e=>t(e.anonKey??``),()=>t(``))},[]),(0,B.jsxs)(xh,{title:`API keys`,description:`Long-lived JWTs signed with the project's JWT secret. Rotating the secret invalidates both.`,children:[(0,B.jsx)(Sh,{label:`Project URL`,description:`Point supabase-js (or any HTTP client) here.`,children:(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(Y,{mono:!0,readOnly:!0,value:n}),(0,B.jsx)(Qn,{value:n,label:`API URL`,variant:`outline`,size:`icon`,iconSize:13})]})}),(0,B.jsx)(Sh,{label:`anon key`,description:`Safe for browsers \u2014 Row Level Security applies to every request.`,children:(0,B.jsx)(uf,{bare:!0,label:`anon key`,hint:``,value:e})}),(0,B.jsx)(Sh,{label:`service_role key`,description:(0,B.jsx)(`span`,{className:`text-destructive/80`,children:`Server-side only \u2014 bypasses Row Level Security.`}),children:(0,B.jsx)(uf,{bare:!0,label:`service_role key`,hint:``,value:x(),danger:!0})}),(0,B.jsx)(Sh,{label:`CLI`,description:`Keys are also printed on startup.`,children:(0,B.jsx)(`code`,{className:`rounded bg-code px-2 py-1 font-mono text-xs text-foreground/90`,children:`tinbase keys`})})]})}function B_(){let[e,t]=dn(),[n,r]=mn();return(0,B.jsxs)(xh,{title:`Appearance`,description:`Preferences are stored in this browser and apply instantly.`,children:[(0,B.jsx)(Sh,{label:`Theme`,description:`Choose your interface color theme. System follows your OS preference.`,wide:!0,children:(0,B.jsx)(J_,{value:e,onChange:t})}),(0,B.jsx)(Sh,{label:`Sidebar`,description:`How the navigation sidebar behaves.`,wide:!0,children:(0,B.jsx)(W_,{value:n,onChange:r})})]})}var V_=[{value:`expanded`,label:`Expanded`},{value:`collapsed`,label:`Collapsed`},{value:`hover`,label:`Expand on hover`}];function H_({label:e}){return(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`div`,{className:`size-1.5 shrink-0 rounded-full bg-muted-foreground/60`}),e&&(0,B.jsx)(`div`,{className:`h-1 flex-1 rounded-full bg-muted-foreground/25`})]})}function U_({variant:e}){return(0,B.jsxs)(`div`,{className:`absolute inset-0 flex`,children:[(0,B.jsx)(`div`,{className:`flex shrink-0 flex-col gap-2 border-r border-border bg-accent/50 p-2.5 `+(e===`expanded`?`w-[42%]`:`w-[22%]`),children:[0,1,2,3].map(t=>(0,B.jsx)(H_,{label:e===`expanded`},t))}),e===`hover`&&(0,B.jsx)(`div`,{className:`absolute inset-y-0 left-[22%] flex w-[42%] flex-col gap-2 border-r border-border bg-popover/95 p-2.5 shadow-xl backdrop-blur-sm`,children:[0,1,2,3].map(e=>(0,B.jsx)(H_,{label:!0},e))}),(0,B.jsx)(`div`,{className:`flex-1 bg-card`})]})}function W_({value:e,onChange:t}){return(0,B.jsx)(`div`,{className:`grid max-w-2xl grid-cols-1 gap-4 sm:grid-cols-3`,children:V_.map(n=>{let r=e===n.value;return(0,B.jsxs)(`button`,{onClick:()=>t(n.value),\"aria-pressed\":r,className:`group relative flex h-32 flex-col overflow-hidden rounded-lg border-2 text-left transition-colors `+(r?`border-brand`:`border-border hover:border-muted-foreground`),children:[(0,B.jsx)(`div`,{className:`relative flex-1 overflow-hidden`,children:(0,B.jsx)(U_,{variant:n.value})}),(0,B.jsx)(`div`,{className:`flex h-8 shrink-0 items-center border-t px-3 text-xs font-medium transition-colors `+(r?`border-brand/40 bg-brand/10 text-foreground`:`border-border bg-card text-muted-foreground group-hover:text-foreground`),children:n.label})]},n.value)})})}var G_={light:{bg:`#ffffff`,panel:`#f4f4f5`,line:`#d9d9de`,block:`#e8e8ea`,card:`#fafafa`,border:`#e4e4e7`},dark:{bg:`#1c1c1c`,panel:`#141414`,line:`#3a3a3a`,block:`#2a2a2a`,card:`#212121`,border:`#333333`}};function K_({variant:e}){let t=G_[e];return(0,B.jsxs)(`div`,{className:`absolute inset-0 flex gap-2 p-3`,style:{background:t.bg},children:[(0,B.jsxs)(`div`,{className:`flex w-1/4 shrink-0 flex-col gap-1.5 rounded-sm p-1.5`,style:{background:t.panel},children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(`div`,{className:`h-1.5 w-2/3 rounded-full`,style:{background:t.line}}),(0,B.jsx)(`div`,{className:`ml-auto size-2 rounded-full`,style:{background:t.line}})]}),[80,60,70,50].map((e,n)=>(0,B.jsx)(`div`,{className:`h-1.5 rounded-full`,style:{width:`${e}%`,background:t.block}},n))]}),(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5 rounded-sm border p-2`,style:{background:t.card,borderColor:t.border},children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,B.jsx)(`div`,{className:`size-2.5 rounded-full`,style:{background:t.block}}),(0,B.jsx)(`div`,{className:`h-1.5 w-1/3 rounded-full`,style:{background:t.line}}),(0,B.jsx)(`div`,{className:`h-1.5 w-1/4 rounded-full`,style:{background:t.block}})]}),(0,B.jsx)(`div`,{className:`h-1.5 w-3/4 rounded-full`,style:{background:t.block}}),(0,B.jsx)(`div`,{className:`mt-auto h-1/2 w-full rounded-sm`,style:{background:t.block}})]})]})}var q_=[{value:`light`,label:`Light`},{value:`dark`,label:`Dark`},{value:`system`,label:`System`}];function J_({value:e,onChange:t}){return(0,B.jsx)(`div`,{className:`grid max-w-2xl grid-cols-1 gap-4 sm:grid-cols-3`,children:q_.map(n=>{let r=e===n.value;return(0,B.jsxs)(`button`,{onClick:()=>t(n.value),\"aria-pressed\":r,className:`group relative flex h-32 flex-col overflow-hidden rounded-lg border-2 text-left transition-colors `+(r?`border-brand`:`border-border hover:border-muted-foreground`),children:[(0,B.jsx)(`div`,{className:`relative flex-1 overflow-hidden`,children:n.value===`system`?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(K_,{variant:`light`}),(0,B.jsx)(`div`,{className:`absolute inset-0`,style:{clipPath:`polygon(100% 0, 100% 100%, 0 100%)`},children:(0,B.jsx)(K_,{variant:`dark`})})]}):(0,B.jsx)(K_,{variant:n.value})}),(0,B.jsx)(`div`,{className:`flex h-8 shrink-0 items-center border-t px-3 text-xs font-medium transition-colors `+(r?`border-brand/40 bg-brand/10 text-foreground`:`border-border bg-card text-muted-foreground group-hover:text-foreground`),children:n.label})]},n.value)})})}var Y_=({children:e})=>(0,B.jsx)(`code`,{className:`rounded bg-code px-1 py-px font-mono text-foreground/90`,children:e});function X_(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null);return(0,_.useEffect)(()=>{N.stats().then(e=>{t(e),r(!0)},()=>r(!1))},[]),e===null&&n===null?(0,B.jsx)(qp,{}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(xh,{title:`Instance`,description:`One process \u2014 embedded Postgres, no Docker.`,children:[(0,B.jsx)(Sh,{label:`Status`,description:`Whether the admin API responds.`,children:n?(0,B.jsx)(V,{variant:`brand`,children:`Healthy`}):(0,B.jsx)(V,{variant:`red`,children:`Unreachable`})}),(0,B.jsxs)(Sh,{label:`Database`,description:`Engine version and current on-disk size.`,children:[(0,B.jsx)(Ch,{label:`Postgres`,value:e?.version??`\u2014`}),(0,B.jsx)(Ch,{label:`Size`,value:e?.dbSize??`\u2014`}),(0,B.jsx)(Ch,{label:`Tables (public)`,value:e?.tables??`\u2014`}),(0,B.jsx)(Ch,{label:`Applied migrations`,value:e?.migrations??`\u2014`})]}),(0,B.jsxs)(Sh,{label:`Services`,description:`Counts across auth and storage.`,children:[(0,B.jsx)(Ch,{label:`Auth users`,value:e?.users??`\u2014`}),(0,B.jsx)(Ch,{label:`Buckets`,value:e?.buckets??`\u2014`}),(0,B.jsx)(Ch,{label:`Objects`,value:e?.objects??`\u2014`})]})]}),(0,B.jsx)(xh,{title:`Data locations`,description:`Configured by CLI flags when starting tinbase.`,children:(0,B.jsx)(Sh,{label:`On disk`,description:`Where this project's data lives, relative to the project directory.`,children:(0,B.jsxs)(`div`,{className:`space-y-1.5 text-xs leading-relaxed text-muted-foreground`,children:[(0,B.jsxs)(`p`,{children:[`Database: `,(0,B.jsx)(Y_,{children:`.tinbase/db`}),` (PGlite) or `,(0,B.jsx)(Y_,{children:`.tinbase/pgdata`}),` (native)`]}),(0,B.jsxs)(`p`,{children:[`Storage objects: `,(0,B.jsx)(Y_,{children:`.tinbase/storage`})]}),(0,B.jsxs)(`p`,{children:[`Override with `,(0,B.jsx)(Y_,{children:`--data-dir`}),` / `,(0,B.jsx)(Y_,{children:`--storage-dir`}),` \u00B7 wipe + reseed with `,(0,B.jsx)(Y_,{children:`tinbase db reset`})]})]})})})]})}var Z_=({children:e})=>(0,B.jsx)(`code`,{className:`rounded bg-code px-1 py-px font-mono text-foreground/90`,children:e});function Q_(){return(0,B.jsxs)(xh,{title:`JWT keys`,description:`All tokens \u2014 anon key, service_role key, and user sessions \u2014 are HS256 JWTs signed with one secret.`,children:[(0,B.jsx)(Sh,{label:`Secret`,description:`Never exposed over the API. Configured where tinbase starts.`,children:(0,B.jsxs)(`div`,{className:`space-y-1.5 text-xs leading-relaxed text-muted-foreground`,children:[(0,B.jsxs)(`p`,{children:[(0,B.jsx)(Z_,{children:`TINBASE_JWT_SECRET`}),` environment variable, or the `,(0,B.jsx)(Z_,{children:`--jwt-secret`}),` CLI flag.`]}),(0,B.jsx)(`p`,{children:`Without either, a well-known development default is used \u2014 fine locally, but set a real secret before exposing the server to anything.`})]})}),(0,B.jsx)(Sh,{label:`Rotation`,description:`Rotating the secret invalidates every existing token.`,children:(0,B.jsxs)(`ol`,{className:`list-inside list-decimal space-y-1.5 text-xs leading-relaxed text-muted-foreground`,children:[(0,B.jsxs)(`li`,{children:[`Restart with the new secret: `,(0,B.jsx)(Z_,{children:`TINBASE_JWT_SECRET=\u2026 tinbase start`})]}),(0,B.jsxs)(`li`,{children:[`Grab the re-derived keys from the startup banner or `,(0,B.jsx)(Z_,{children:`tinbase keys`})]}),(0,B.jsx)(`li`,{children:`Update every client using the old keys \u2014 and sign back in to this studio`})]})})]})}var $_=[{id:`general`,label:`General`,component:B_},{id:`infrastructure`,label:`Infrastructure`,component:X_},{id:`api-keys`,label:`API Keys`,component:z_},{id:`jwt`,label:`JWT Keys`,component:Q_}];function ev(){let{section:e}=qt(),t=$_.some(t=>t.id===e)?e:`general`,n=$_.find(e=>e.id===t).component;return(0,B.jsxs)(`div`,{className:`flex h-full`,children:[(0,B.jsx)(wh,{title:`Project Settings`,active:t,onSelect:e=>z(`settings`,e),groups:[{items:$_.map(e=>({id:e.id,label:e.label}))}]}),(0,B.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:(0,B.jsxs)(`div`,{className:`mx-auto max-w-4xl px-10 py-8`,children:[(0,B.jsx)(`h1`,{className:`border-b border-border pb-4 text-xl font-semibold text-foreground`,children:$_.find(e=>e.id===t).label}),(0,B.jsx)(n,{})]})})]})}var tv=[{kind:`postgres`,icon:Ce,title:`Postgres`,sub:`Superuser`,blurb:`Full admin access \u2014 the service_role, which bypasses all Row Level Security (RLS) policies.`},{kind:`anon`,icon:jt,title:`Anonymous`,sub:`Not logged in`,blurb:`The anon key \u2014 what an unauthenticated visitor sees. RLS policies apply.`},{kind:`authenticated`,icon:Mt,title:`Authenticated`,sub:`Specific logged in user`,blurb:`Impersonate a real user \u2014 auth.uid() resolves to them. RLS policies apply.`}];function nv({value:e,onChange:t,align:n=`end`}){let[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)([]);(0,_.useEffect)(()=>{r&&a.length===0&&N.users().then(o,()=>{})},[r,a.length]);async function s(e,n){try{if(e===`postgres`)t({kind:`postgres`},null);else if(e===`anon`){let{anonKey:e}=await N.keys();t({kind:`anon`},e??(await N.impersonate(`anon`)).token)}else{if(!n)return;let{token:e}=await N.impersonate(`authenticated`,{sub:n.id,email:n.email});t({kind:`authenticated`,sub:n.id,email:n.email},e)}(e!==`authenticated`||n)&&i(!1)}catch(e){U.error(e.message)}}let c=e.kind===`authenticated`?e.email??e.sub.slice(0,8):e.kind,l=tv.find(t=>t.kind===e.kind);return(0,B.jsxs)(ff,{open:r,onOpenChange:i,align:n,className:`w-105 p-3`,trigger:(0,B.jsxs)(H,{variant:`outline`,size:`xs`,onClick:()=>i(e=>!e),children:[`Role `,(0,B.jsx)(`span`,{className:`font-mono `+(e.kind===`postgres`?`text-foreground`:`text-brand`),children:c}),(0,B.jsx)(pe,{size:11})]}),children:[(0,B.jsx)(`p`,{className:`mb-2 px-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80`,children:`View data as a role`}),(0,B.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:tv.map(t=>{let n=t.icon,r=e.kind===t.kind;return(0,B.jsxs)(`button`,{onClick:()=>t.kind===`authenticated`?void 0:void s(t.kind),className:`relative rounded-md border p-3 text-left transition-colors `+(r?`border-foreground bg-accent/60`:`border-input hover:border-muted-foreground`),children:[r&&(0,B.jsx)(`span`,{className:`absolute right-2 top-2 flex size-4 items-center justify-center rounded-full bg-foreground text-background`,children:(0,B.jsx)(fe,{size:10,strokeWidth:3})}),(0,B.jsx)(n,{size:15,className:`text-muted-foreground`}),(0,B.jsx)(`p`,{className:`mt-2 text-[13px] font-medium text-foreground`,children:t.title}),(0,B.jsx)(`p`,{className:`text-[11px] text-muted-foreground/80`,children:t.sub})]},t.kind)})}),(0,B.jsx)(`div`,{className:`mt-2`,children:(0,B.jsx)(Up,{value:e.kind===`authenticated`?e.sub:``,onValueChange:e=>{let t=a.find(t=>t.id===e);t&&s(`authenticated`,t)},placeholder:a.length===0?`No auth users \u2014 sign someone up first`:`Impersonate a user\u2026`,disabled:a.length===0,options:a.map(e=>({value:e.id,label:e.email??e.id}))})}),(0,B.jsxs)(`p`,{className:`mt-3 border-t border-border pt-2.5 text-[11px] leading-relaxed text-muted-foreground/80`,children:[(0,B.jsx)(`span`,{className:`font-medium text-foreground/80`,children:l.title}),e.kind===`postgres`&&(0,B.jsx)(`span`,{className:`ml-1.5 rounded border border-input px-1 py-px text-[9px] uppercase text-muted-foreground/80`,children:`default`}),(0,B.jsx)(`br`,{}),l.blurb]})]})}function rv({result:e}){if(!e)return(0,B.jsx)(cf,{children:`Run a query to see results. \u2318\u23CE / Ctrl+\u23CE`});if(!e.ok)return(0,B.jsxs)(`div`,{className:`m-4 rounded-md border border-destructive/30 bg-destructive/10 p-3 text-[13px] text-destructive`,children:[(0,B.jsx)(`div`,{className:`font-mono`,children:e.error}),e.code&&(0,B.jsxs)(`div`,{className:`mt-1 text-xs text-destructive/70`,children:[`SQLSTATE `,e.code]}),e.detail&&(0,B.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:e.detail}),e.hint&&(0,B.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Hint: `,e.hint]})]});let t=e.rows??[],n=t[0]?Object.keys(t[0]):[];return n.length===0?(0,B.jsxs)(cf,{children:[`Statement executed`,e.affectedRows==null?``:` \u00B7 ${e.affectedRows} rows affected`,`.`]}):(0,B.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-border px-3 py-1.5 text-xs text-muted-foreground/80`,children:[(0,B.jsxs)(`span`,{children:[e.rowCount,` row`,e.rowCount===1?``:`s`,` \u00B7 `,e.ms,` ms`]}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,B.jsxs)(H,{variant:`ghost`,size:`xs`,onClick:()=>p_(`results.csv`,`text/csv`,f_(n,t)),children:[(0,B.jsx)(Te,{size:12}),` CSV`]}),(0,B.jsxs)(H,{variant:`ghost`,size:`xs`,onClick:()=>p_(`results.json`,`application/json`,JSON.stringify(t,null,2)),children:[(0,B.jsx)(Te,{size:12}),` JSON`]}),(0,B.jsx)(Qn,{variant:`ghost`,size:`xs`,label:`results as JSON`,value:()=>JSON.stringify(t,null,2),children:`Copy`})]})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsx)(`tr`,{children:n.map(e=>(0,B.jsx)(Z,{className:`font-mono text-foreground/80`,children:e},e))})}),(0,B.jsx)(`tbody`,{children:t.map((e,t)=>(0,B.jsx)(Zp,{children:n.map(t=>(0,B.jsx)(Q,{className:`max-w-90 cursor-cell truncate font-mono text-foreground/80`,title:Jm(e[t])??`Double-click to copy`,onDoubleClick:()=>{let n=e[t];Xn(n==null?``:typeof n==`object`?JSON.stringify(n):String(n),t)},children:(0,B.jsx)(qm,{value:e[t]})},t))},t))})]})})]})}var iv=`tinbase_sql_queries`,av=`tinbase_sql_tabs`,ov=`tinbase_sql_history`,sv=50;function cv(e,t){try{let n=localStorage.getItem(e);return n?JSON.parse(n):t}catch{return t}}function lv(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}var uv=()=>cv(iv,[]),dv=e=>lv(iv,e),fv=()=>cv(av,{tabs:[],active:null}),pv=(e,t)=>lv(av,{tabs:e,active:t}),mv=()=>cv(ov,[]);function hv(e){let t=[e,...mv()].slice(0,sv);return lv(ov,t),t}function gv(){return lv(ov,[]),[]}var _v=()=>crypto.randomUUID();function vv(e,t){if(t)return t.name;let n=e.replace(/--[^\\n]*/g,` `).replace(/\\/\\*[\\s\\S]*?\\*\\//g,` `).replace(/\\s+/g,` `).trim();return n?n.length>32?n.slice(0,32)+`\u2026`:n:`Untitled query`}function yv(e,t){if(!t)return e;let n=e.trim().replace(/;+\\s*$/,``);return!/^\\s*(select|with)\\b/i.test(n)||/\\blimit\\s+\\d+/i.test(n)?e:`${n} limit ${t}`}var bv=/\\b(select|from|where|group by|order by|having|limit|offset|left join|right join|inner join|join|union|insert into|values|update|set|delete from|returning)\\b/gi;function xv(e){return e.replace(bv,e=>`\\n${e.toUpperCase()}`).replace(/^\\n/,``).replace(/\\n{2,}/g,`\n`).trim()}var Sv=!1;function Cv(e){Sv||(Sv=!0,an.default.require(`ace/ext/language_tools`).addCompleter({getCompletions:(t,n,r,i,a)=>{a(null,e().map(e=>({...e,score:500})))}}))}function wv(){let[e,t]=(0,_.useState)(uv),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),c=fv(),[l,u]=(0,_.useState)(c.tabs.length?c.tabs:[{id:_v(),queryId:null,sql:``}]),[d,f]=(0,_.useState)(c.active??(c.tabs[0]?.id||``)),p=l.find(e=>e.id===d)??l[0],[m,h]=(0,_.useState)({kind:`postgres`}),[g,v]=(0,_.useState)(100),[y,b]=(0,_.useState)(null),[x,S]=(0,_.useState)(!1),[C,w]=(0,_.useState)(mv),[T,E]=(0,_.useState)(!1),[D,O]=(0,_.useState)(!1),k=(0,_.useRef)([]);(0,_.useEffect)(()=>{Cv(()=>k.current),N.tables().then(e=>{let t=[];for(let n of e){t.push({caption:n.name,value:n.name,meta:`table`});for(let e of n.columns)t.push({caption:`${n.name}.${e.name}`,value:e.name,meta:e.type})}k.current=t},()=>{})},[]),(0,_.useEffect)(()=>pv(l,p?.id??null),[l,p]);let A=(0,_.useCallback)(e=>{t(e),dv(e)},[]);if(!p)return(0,B.jsx)(cf,{children:`Something went wrong \u2014 reload.`});let j=t=>e.find(e=>e.id===t.queryId)??null,M=e=>{let t=j(e);return t?t.sql!==e.sql:e.sql.trim()!==``};function P(e){u(t=>t.map(t=>t.id===d?{...t,sql:e}:t))}function ee(e=``,t=null){let n={id:_v(),queryId:t,sql:e};u(e=>[...e,n]),f(n.id),b(null)}function F(e){u(t=>{let n=t.filter(t=>t.id!==e);if(n.length===0){let e={id:_v(),queryId:null,sql:``};return f(e.id),[e]}return e===d&&f(n[Math.max(0,t.findIndex(t=>t.id===e)-1)].id),n})}function I(e){let t=l.find(t=>t.queryId===e.id);t?f(t.id):ee(e.sql,e.id)}function te(t){let n=j(p);if(n)A(e.map(e=>e.id===n.id?{...e,sql:p.sql,updatedAt:Date.now()}:e)),U.success(`Saved \"${n.name}\"`);else if(t){let n={id:_v(),name:t,sql:p.sql,favorite:!1,updatedAt:Date.now()};A([n,...e]),u(e=>e.map(e=>e.id===d?{...e,queryId:n.id}:e)),U.success(`Saved \"${t}\"`)}else O(!0)}async function ne(){let e=p.sql.trim();if(!e||x)return;S(!0);let t=m.kind===`postgres`?void 0:m.kind===`anon`?{role:`anon`,claims:{role:`anon`}}:{role:`authenticated`,claims:{role:`authenticated`,sub:m.sub,email:m.email}};try{let n=await N.sql(yv(e,g),t);b(n),w(hv({sql:e,ts:Date.now(),ms:n.ms,ok:n.ok,rows:n.rowCount}))}catch(e){b({ok:!1,error:e instanceof Error?e.message:String(e)})}finally{S(!1)}}let re=n.toLowerCase(),ie=e.filter(e=>e.name.toLowerCase().includes(re)||e.sql.toLowerCase().includes(re)),ae=ie.filter(e=>e.favorite),L=ie.filter(e=>!e.favorite);return(0,B.jsxs)(`div`,{className:`flex h-full`,children:[(0,B.jsxs)(mf,{id:`sql-saved`,side:`left`,defaultSize:240,min:200,max:400,className:`flex flex-col border-r border-border bg-card`,children:[(0,B.jsx)(`div`,{className:`px-4 pb-1 pt-4 text-sm font-semibold text-foreground`,children:`SQL Editor`}),(0,B.jsxs)(`div`,{className:`space-y-1.5 px-2 pb-2 pt-1`,children:[(0,B.jsxs)(H,{variant:`outline`,size:`xs`,className:`w-full`,onClick:()=>ee(),children:[(0,B.jsx)(pt,{size:12}),` New query`]}),(0,B.jsxs)(`div`,{className:`relative`,children:[(0,B.jsx)(_t,{size:13,className:`pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground/60`}),(0,B.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:`Search queries\u2026`,className:`h-7 w-full rounded-md border border-border bg-field pl-7 pr-2 text-xs text-foreground placeholder:text-muted-foreground/60 focus:border-muted-foreground focus:outline-none`})]})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-2`,children:[ae.length>0&&(0,B.jsx)(Tv,{title:`Favorites`,items:ae,onOpen:I,onRename:a,onDelete:s,onFav:t=>A(e.map(e=>e.id===t.id?{...e,favorite:!e.favorite}:e))}),(0,B.jsx)(Tv,{title:`Saved (${L.length})`,items:L,onOpen:I,onRename:a,onDelete:s,onFav:t=>A(e.map(e=>e.id===t.id?{...e,favorite:!e.favorite}:e))}),ie.length===0&&(0,B.jsx)(`p`,{className:`px-4 py-6 text-center text-xs text-muted-foreground/60`,children:e.length===0?`No saved queries yet \u2014 write one and hit Save.`:`No match.`})]})]}),(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-px overflow-x-auto border-b border-border bg-card px-1 pt-1`,children:[l.map(e=>(0,B.jsxs)(`div`,{className:`group flex shrink-0 cursor-pointer items-center gap-1.5 rounded-t-md border-x border-t px-3 py-1.5 text-xs `+(e.id===d?`border-border bg-background text-foreground`:`border-transparent text-muted-foreground hover:text-foreground`),onClick:()=>f(e.id),children:[(0,B.jsx)(`span`,{className:`max-w-40 truncate`,children:vv(e.sql,j(e))}),M(e)&&(0,B.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-brand`,title:`Unsaved changes`}),(0,B.jsx)(`button`,{className:`rounded p-px text-muted-foreground/60 opacity-0 hover:bg-accent hover:text-foreground group-hover:opacity-100`,onClick:t=>{t.stopPropagation(),F(e.id)},children:(0,B.jsx)(Ft,{size:11})})]},e.id)),(0,B.jsx)(`button`,{className:`ml-1 rounded p-1 text-muted-foreground/80 hover:bg-accent hover:text-foreground`,title:`New tab`,onClick:()=>ee(),children:(0,B.jsx)(pt,{size:13})})]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 border-b border-border px-3 py-1.5`,children:[(0,B.jsx)(nv,{align:`start`,value:m,onChange:e=>h(e)}),(0,B.jsx)(Up,{size:`xs`,className:`w-26 shrink-0`,value:g===null?`none`:String(g),onValueChange:e=>v(e===`none`?null:parseInt(e,10)),options:[{value:`100`,label:`Limit 100`},{value:`500`,label:`Limit 500`},{value:`1000`,label:`Limit 1000`},{value:`none`,label:`No limit`}]}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,B.jsxs)(ff,{open:T,onOpenChange:E,align:`end`,className:`max-h-96 w-105 overflow-y-auto p-1.5`,trigger:(0,B.jsxs)(H,{variant:`ghost`,size:`xs`,onClick:()=>E(e=>!e),children:[(0,B.jsx)(Ve,{size:12}),` History`]}),children:[C.length===0&&(0,B.jsx)(`p`,{className:`px-3 py-4 text-center text-xs text-muted-foreground/60`,children:`No runs yet.`}),C.map((e,t)=>(0,B.jsxs)(`button`,{className:`block w-full rounded px-2.5 py-1.5 text-left hover:bg-accent`,onClick:()=>{ee(e.sql),E(!1)},children:[(0,B.jsx)(`span`,{className:`block truncate font-mono text-xs text-foreground/80`,children:e.sql}),(0,B.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/60`,children:[(0,B.jsx)(Km,{value:e.ts,format:`time`}),` \u00B7 `,e.ok?`${e.rows??0} rows \u00B7 ${e.ms} ms`:`error`]})]},t)),C.length>0&&(0,B.jsx)(`button`,{className:`mt-1 w-full rounded px-2.5 py-1.5 text-left text-xs text-muted-foreground hover:bg-accent`,onClick:()=>w(gv()),children:`Clear history`})]}),(0,B.jsxs)(H,{variant:`ghost`,size:`xs`,title:`Format query`,onClick:()=>P(xv(p.sql)),children:[(0,B.jsx)(Nt,{size:12}),` Format`]}),(0,B.jsx)(H,{variant:`outline`,size:`xs`,onClick:()=>te(),disabled:!p.sql.trim(),children:j(p)?`Save`:`Save as\u2026`}),(0,B.jsxs)(H,{size:`xs`,onClick:()=>void ne(),disabled:x||!p.sql.trim(),children:[(0,B.jsx)(dt,{size:12}),` `,x?`Running\u2026`:`Run`,` `,(0,B.jsx)(lf,{children:`\u2318\u23CE`})]})]})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 p-3 pb-0`,children:(0,B.jsx)(nr,{lang:`sql`,className:`h-full`,value:p.sql,onChange:P,onCmdEnter:()=>void ne(),placeholder:`select * from \u2026 (\u2318\u23CE to run)`})}),(0,B.jsx)(mf,{id:`sql-results`,axis:`y`,side:`right`,defaultSize:300,min:140,max:640,className:`overflow-hidden border-t border-border`,children:(0,B.jsx)(rv,{result:y})})]}),i&&(0,B.jsx)(Ev,{query:i,onClose:()=>a(null),onSave:t=>{A(e.map(e=>e.id===i.id?{...e,name:t}:e)),a(null)}}),D&&(0,B.jsx)(Dv,{suggested:vv(p.sql,null),onClose:()=>O(!1),onSave:e=>{te(e),O(!1)}}),o&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Delete query \"${o.name}\"?`,description:`The saved query will be removed from this browser.`,confirmLabel:`Delete query`,onConfirm:()=>{A(e.filter(e=>e.id!==o.id)),u(e=>e.map(e=>e.queryId===o.id?{...e,queryId:null}:e))},onClose:()=>s(null)})]})}function Tv({title:e,items:t,onOpen:n,onRename:r,onDelete:i,onFav:a}){return(0,B.jsxs)(`div`,{className:`pt-2`,children:[(0,B.jsx)(`p`,{className:`px-4 pb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60`,children:e}),t.map(e=>(0,B.jsxs)(`div`,{className:`group flex items-center gap-1 pl-4 pr-1.5 text-[13px] text-muted-foreground hover:bg-accent/50`,children:[(0,B.jsxs)(`button`,{className:`flex min-w-0 flex-1 items-center gap-1.5 py-1.5 text-left`,onClick:()=>n(e),title:e.sql,children:[e.favorite&&(0,B.jsx)(Be,{size:10,className:`shrink-0 fill-brand text-brand`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,B.jsxs)(Zd,{children:[(0,B.jsx)(Qd,{asChild:!0,children:(0,B.jsx)(`button`,{className:`hidden shrink-0 rounded p-1 text-muted-foreground/80 hover:bg-muted hover:text-foreground group-hover:block data-[state=open]:block`,children:(0,B.jsx)(Ee,{size:12})})}),(0,B.jsxs)(tf,{align:`start`,children:[(0,B.jsxs)(nf,{onSelect:()=>a(e),children:[(0,B.jsx)(Be,{size:13}),` `,e.favorite?`Unfavorite`:`Favorite`]}),(0,B.jsxs)(nf,{onSelect:()=>r(e),children:[(0,B.jsx)(ct,{size:13}),` Rename`]}),(0,B.jsx)(of,{}),(0,B.jsxs)(nf,{danger:!0,onSelect:()=>i(e),children:[(0,B.jsx)(Ot,{size:13}),` Delete`]})]})]})]},e.id))]})}function Ev({query:e,onClose:t,onSave:n}){let[r,i]=(0,_.useState)(e.name);return(0,B.jsx)(ho,{open:!0,onClose:t,title:`Rename query`,children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Name`}),(0,B.jsx)(Y,{value:r,autoFocus:!0,onChange:e=>i(e.target.value),onKeyDown:e=>e.key===`Enter`&&r.trim()&&n(r.trim())})]}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(H,{variant:`outline`,onClick:t,children:`Cancel`}),(0,B.jsx)(H,{onClick:()=>n(r.trim()),disabled:!r.trim(),children:`Rename`})]})]})})}function Dv({suggested:e,onClose:t,onSave:n}){let[r,i]=(0,_.useState)(e===`Untitled query`?``:e);return(0,B.jsx)(ho,{open:!0,onClose:t,title:`Save query`,children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Name`}),(0,B.jsx)(Y,{value:r,autoFocus:!0,placeholder:`My query`,onChange:e=>i(e.target.value),onKeyDown:e=>e.key===`Enter`&&r.trim()&&n(r.trim())})]}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(H,{variant:`outline`,onClick:t,children:`Cancel`}),(0,B.jsx)(H,{onClick:()=>n(r.trim()),disabled:!r.trim(),children:`Save`})]})]})})}function Ov({bucket:e}){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(null),l=(0,_.useCallback)(()=>{N.policies(`storage`).then(e=>n(e.filter(e=>e.table===`objects`)),()=>n([]))},[]);(0,_.useEffect)(()=>{l();let e=setInterval(()=>void l(),5e3);return()=>clearInterval(e)},[l]);async function u(e){try{await N.dropPolicy(`objects`,e.name,`storage`),U.success(`Dropped policy ${e.name}`),l()}catch(e){U.error(e.message)}}if(t===null)return(0,B.jsx)(qp,{});let d=t=>`${t.using_expr??``} ${t.with_check??``}`.includes(`'${e}'`),f=e?t.filter(d):[],p=e?t.filter(e=>!d(e)):t,m=e=>(0,B.jsxs)(`div`,{className:`cursor-pointer rounded-md border border-border bg-card p-3 transition-colors hover:border-muted-foreground/60`,title:`Edit policy`,onClick:()=>o(e),children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`truncate font-mono text-[13px] text-foreground`,children:e.name}),(0,B.jsx)(V,{variant:`blue`,children:e.cmd}),String(e.permissive).toUpperCase()!==`PERMISSIVE`&&(0,B.jsx)(V,{variant:`red`,children:`restrictive`}),(0,B.jsx)(V,{variant:`neutral`,children:Array.isArray(e.roles)?e.roles.join(`, `):String(e.roles)}),(0,B.jsx)(`button`,{className:`ml-auto p-1 text-muted-foreground/80 hover:text-destructive`,title:`Drop policy`,onClick:t=>{t.stopPropagation(),c(e)},children:(0,B.jsx)(Ot,{size:13})})]}),e.using_expr&&(0,B.jsxs)(`p`,{className:`mt-1.5 truncate font-mono text-[11px] text-muted-foreground/80`,title:e.using_expr,children:[`using (`,e.using_expr,`)`]}),e.with_check&&(0,B.jsxs)(`p`,{className:`mt-0.5 truncate font-mono text-[11px] text-muted-foreground/80`,title:e.with_check,children:[`with check (`,e.with_check,`)`]})]},e.name);return(0,B.jsxs)(`div`,{className:`h-full overflow-y-auto px-6 py-5`,children:[(0,B.jsxs)(`div`,{className:`flex max-w-2xl items-start justify-between gap-4`,children:[(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground/80`,children:[`Object access is controlled by RLS policies on `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`storage.objects`}),`. The service_role (this studio) bypasses them; your app's anon/authenticated requests do not. Scope a policy to a bucket with`,` `,(0,B.jsxs)(`code`,{className:`text-muted-foreground`,children:[`bucket_id = '`,e??`name`,`'`]}),`.`]}),(0,B.jsxs)(H,{size:`xs`,className:`shrink-0`,onClick:()=>i(!0),children:[(0,B.jsx)(pt,{size:12}),` New policy`]})]}),(0,B.jsxs)(`div`,{className:`mt-4 max-w-2xl space-y-5`,children:[e&&(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`p`,{className:`mb-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60`,children:[`Policies for `,e,` `,(0,B.jsx)(`span`,{className:`text-muted-foreground/40`,children:f.length})]}),(0,B.jsxs)(`div`,{className:`space-y-2`,children:[f.map(m),f.length===0&&(0,B.jsx)(`p`,{className:`rounded-md border border-dashed border-border px-3 py-3 text-center text-xs text-muted-foreground/60`,children:`No policies mention this bucket yet.`})]})]}),(0,B.jsxs)(`div`,{children:[e&&(0,B.jsxs)(`p`,{className:`mb-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60`,children:[`Other policies on storage.objects `,(0,B.jsx)(`span`,{className:`text-muted-foreground/40`,children:p.length})]}),(0,B.jsxs)(`div`,{className:`space-y-2`,children:[p.map(m),t.length===0&&(0,B.jsx)(cf,{children:`No policies on storage.objects \u2014 only the service_role can access objects in private buckets. Create one to open access up.`})]})]})]}),r&&(0,B.jsx)(wg,{table:`objects`,schema:`storage`,onClose:()=>i(!1),onCreated:async()=>l()}),a&&(0,B.jsx)(wg,{table:`objects`,schema:`storage`,existing:Dg(a),onClose:()=>o(null),onCreated:async()=>l()}),s&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Drop policy \"${s.name}\"?`,description:`Object access rules change immediately.`,confirmLabel:`Drop policy`,onConfirm:()=>void u(s),onClose:()=>c(null)})]})}var kv=e=>e==null?`Unlimited`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(0)} MB`;function Av({bucket:e,onDelete:t}){return(0,B.jsxs)(`div`,{className:`h-full overflow-y-auto px-6 py-5`,children:[(0,B.jsxs)(`div`,{className:`max-w-2xl divide-y divide-border/70`,children:[(0,B.jsx)(jv,{label:`Visibility`,description:`Public buckets serve objects without authentication.`,children:e.public?(0,B.jsx)(V,{variant:`brand`,children:`public`}):(0,B.jsx)(V,{variant:`neutral`,children:`private`})}),(0,B.jsx)(jv,{label:`File size limit`,description:`Uploads above the limit are rejected.`,children:(0,B.jsx)(`span`,{className:`font-mono text-[13px] text-foreground/90`,children:kv(e.file_size_limit)})}),(0,B.jsx)(jv,{label:`Allowed MIME types`,description:`Empty means every type is accepted.`,children:e.allowed_mime_types?.length?(0,B.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.allowed_mime_types.map(e=>(0,B.jsx)(V,{variant:`outline`,className:`font-mono`,children:e},e))}):(0,B.jsx)(`span`,{className:`text-[13px] text-muted-foreground`,children:`Any`})}),(0,B.jsx)(jv,{label:`Created`,description:``,children:(0,B.jsx)(`span`,{className:`font-mono text-[13px] text-foreground/90`,children:(0,B.jsx)(Km,{value:e.created_at})})}),(0,B.jsx)(jv,{label:`Delete bucket`,description:`The bucket must be empty. This cannot be undone.`,children:(0,B.jsxs)(H,{variant:`danger`,size:`xs`,onClick:t,children:[(0,B.jsx)(Ot,{size:12}),` Delete bucket`]})})]}),(0,B.jsxs)(`p`,{className:`mt-4 max-w-2xl text-[11px] text-muted-foreground/60`,children:[`Limits and visibility are set when the bucket is created (or via `,(0,B.jsx)(`code`,{children:`supabase-js`}),`'s`,` `,(0,B.jsx)(`code`,{className:`text-muted-foreground`,children:`updateBucket`}),`).`]})]})}function jv({label:e,description:t,children:n}){return(0,B.jsxs)(`div`,{className:`flex flex-col gap-3 py-5 sm:flex-row sm:items-start sm:gap-10`,children:[(0,B.jsxs)(`div`,{className:`w-56 shrink-0`,children:[(0,B.jsx)(`p`,{className:`text-[13px] font-medium text-foreground`,children:e}),t&&(0,B.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground/80`,children:t})]}),(0,B.jsx)(`div`,{className:`min-w-0 flex-1 pt-0.5`,children:n})]})}var Mv=e=>e.id===null&&!e.metadata;function Nv(e){return e==null?`\u2014`:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Pv({bucket:e}){let[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(new Set),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(!1),p=(0,_.useRef)(null),m=(0,_.useCallback)(async()=>{try{i(await N.listObjects(e.id,t))}catch(e){U.error(e.message),i([])}},[e.id,t]);(0,_.useEffect)(()=>{o(new Set),c(null),m()},[m]);let h=e=>t?`${t}/${e.name}`:e.name;async function g(n){for(let r of Array.from(n))try{await N.uploadObject(e.id,t?`${t}/${r.name}`:r.name,r)}catch(e){U.error(`${r.name}: ${e.message}`)}U.success(`Uploaded ${n.length} file${n.length===1?``:`s`}`),await m()}async function v(){try{await N.removeObjects(e.id,[...a]),U.success(`Deleted ${a.size} object${a.size===1?``:`s`}`),o(new Set),await m()}catch(e){U.error(e.message)}}async function y(t){let n=h(t);if(e.public)await Xn(`${ch()}/storage/v1/object/public/${e.id}/${n}`,`Public URL`);else try{await Xn(await N.signUrl(e.id,n,3600),`Signed URL (1h)`)}catch(e){U.error(e.message)}}if(r===null)return(0,B.jsx)(qp,{});let b=t?t.split(`/`):[],x=r.filter(e=>!Mv(e)).map(h),S=x.length>0&&x.every(e=>a.has(e));return(0,B.jsxs)(`div`,{className:`relative flex h-full min-h-0`,onDragOver:e=>{e.preventDefault(),f(!0)},onDragLeave:()=>f(!1),onDrop:e=>{e.preventDefault(),f(!1),e.dataTransfer.files.length&&g(e.dataTransfer.files)},children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 border-b border-border px-4 py-2 text-[13px]`,children:[(0,B.jsxs)(`button`,{className:`flex items-center gap-1 text-muted-foreground hover:text-foreground`,onClick:()=>n(``),children:[(0,B.jsx)(He,{size:12}),` `,e.id]}),b.map((e,t)=>(0,B.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(he,{size:11,className:`text-muted-foreground/60`}),(0,B.jsx)(`button`,{className:`font-mono text-muted-foreground hover:text-foreground`,onClick:()=>n(b.slice(0,t+1).join(`/`)),children:e})]},t)),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[a.size>0&&(0,B.jsxs)(H,{variant:`dangerSolid`,size:`xs`,onClick:()=>u(!0),children:[(0,B.jsx)(Ot,{size:12}),` Delete `,a.size]}),(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,title:`Refresh`,onClick:()=>void m(),children:(0,B.jsx)(ht,{size:13})}),(0,B.jsx)(`input`,{ref:p,type:`file`,multiple:!0,className:`hidden`,onChange:e=>e.target.files&&void g(e.target.files)}),(0,B.jsxs)(H,{size:`xs`,onClick:()=>p.current?.click(),children:[(0,B.jsx)(At,{size:12}),` Upload`]})]})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[(0,B.jsxs)(Yp,{children:[(0,B.jsx)(Xp,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(Z,{className:`w-10`,children:(0,B.jsx)(Zt,{checked:S,indeterminate:!S&&x.some(e=>a.has(e)),disabled:x.length===0,onChange:e=>o(e?new Set(x):new Set)})}),(0,B.jsx)(Z,{children:`Name`}),(0,B.jsx)(Z,{children:`Size`}),(0,B.jsx)(Z,{children:`Type`}),(0,B.jsx)(Z,{children:`Modified`}),(0,B.jsx)(Z,{className:`w-16`})]})}),(0,B.jsx)(`tbody`,{children:r.map(t=>{let r=Mv(t),i=h(t);return(0,B.jsxs)(Zp,{className:`cursor-pointer`,onClick:()=>r?n(i):c(t),children:[(0,B.jsx)(Q,{onClick:e=>e.stopPropagation(),children:!r&&(0,B.jsx)(Zt,{checked:a.has(i),onChange:e=>o(t=>{let n=new Set(t);return e?n.add(i):n.delete(i),n})})}),(0,B.jsx)(Q,{className:`font-mono text-foreground/90`,children:(0,B.jsxs)(`span`,{className:`flex items-center gap-2`,children:[r?(0,B.jsx)(Fe,{size:13,className:`text-info`}):(0,B.jsx)(Me,{size:13,className:`text-muted-foreground/70`}),t.name]})}),(0,B.jsx)(Q,{className:`text-muted-foreground`,children:r?`\u2014`:Nv(t.metadata?.size)}),(0,B.jsx)(Q,{className:`text-muted-foreground`,children:r?`folder`:t.metadata?.mimetype??`\u2014`}),(0,B.jsx)(Q,{className:`text-muted-foreground`,children:(0,B.jsx)(Km,{value:t.updated_at})}),(0,B.jsx)(Q,{onClick:e=>e.stopPropagation(),children:!r&&(0,B.jsxs)(`div`,{className:`flex justify-end gap-0.5 opacity-0 group-hover:opacity-100`,children:[(0,B.jsx)(`button`,{className:`p-1 text-muted-foreground/80 hover:text-foreground`,title:e.public?`Copy public URL`:`Copy signed URL (1h)`,onClick:()=>void y(t),children:(0,B.jsx)(Je,{size:13})}),(0,B.jsx)(`button`,{className:`p-1 text-muted-foreground/80 hover:text-destructive`,title:`Delete`,onClick:()=>{o(new Set([i])),u(!0)},children:(0,B.jsx)(Ot,{size:13})})]})})]},t.name)})})]}),r.length===0&&(0,B.jsxs)(cf,{children:[`Empty`,t?` folder`:` bucket`,` \u2014 drop files here or hit Upload.`]})]})]}),s&&(0,B.jsx)(Fv,{bucket:e,path:h(s),entry:s,onClose:()=>c(null),onCopyUrl:()=>void y(s)}),d&&(0,B.jsx)(`div`,{className:`pointer-events-none absolute inset-0 z-10 flex items-center justify-center border-2 border-dashed border-brand bg-brand/5`,children:(0,B.jsxs)(`p`,{className:`rounded-md bg-popover px-4 py-2 text-sm text-foreground shadow-lg`,children:[`Drop to upload`,t?` into ${t}/`:``]})}),l&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Delete ${a.size} object${a.size===1?``:`s`}?`,description:`Objects are permanently removed from the bucket.`,confirmLabel:`Delete`,onConfirm:()=>void v(),onClose:()=>u(!1)})]})}function Fv({bucket:e,path:t,entry:n,onClose:r,onCopyUrl:i}){let[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),l=n.metadata?.mimetype??``,u=l.startsWith(`image/`),d=l.startsWith(`text/`)||l===`application/json`,[f,p]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let n=null;if(o(null),p(null),c(!1),!(!u&&!d))return N.downloadObject(e.id,t).then(async e=>{u?(n=URL.createObjectURL(e),o(n)):p((await e.text()).slice(0,4e3))},()=>c(!0)),()=>{n&&URL.revokeObjectURL(n)}},[e.id,t,u,d]),(0,B.jsxs)(mf,{id:`storage-preview`,side:`right`,defaultSize:320,min:260,max:560,className:`flex flex-col border-l border-border bg-card`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-4 py-2.5`,children:[(0,B.jsx)(`span`,{className:`truncate font-mono text-[13px] text-foreground`,children:n.name}),(0,B.jsx)(`button`,{className:`text-muted-foreground/80 hover:text-foreground`,onClick:r,children:`\u2715`})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4`,children:[u&&(a?(0,B.jsx)(`img`,{src:a,alt:n.name,className:`max-h-64 w-full rounded-md border border-border object-contain`}):s?(0,B.jsx)(`p`,{className:`text-xs text-destructive`,children:`Preview failed.`}):(0,B.jsx)(`div`,{className:`h-40 animate-pulse rounded-md bg-accent`})),d&&f!==null&&(0,B.jsx)(`pre`,{className:`max-h-64 overflow-auto rounded-md border border-border bg-code p-2 font-mono text-[11px] text-foreground/80`,children:f}),!u&&!d&&(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground/80`,children:[`No inline preview for `,l||`this type`,`.`]}),(0,B.jsxs)(`div`,{className:`mt-4 space-y-1.5 text-[13px]`,children:[(0,B.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`Size`}),(0,B.jsx)(`span`,{className:`font-mono text-foreground/90`,children:Nv(n.metadata?.size)})]}),(0,B.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`Type`}),(0,B.jsx)(`span`,{className:`truncate font-mono text-foreground/90`,children:l||`\u2014`})]}),(0,B.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:`Path`}),(0,B.jsx)(`span`,{className:`truncate font-mono text-foreground/90`,title:t,children:t})]})]}),(0,B.jsxs)(H,{variant:`outline`,size:`xs`,className:`mt-4 w-full`,onClick:i,children:[(0,B.jsx)(Je,{size:12}),` `,e.public?`Copy public URL`:`Copy signed URL (1h)`]})]})]})}function Iv(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(`files`),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(null),{section:c}=qt(),l=(0,_.useCallback)(async()=>{try{let e=await N.buckets();return t(e),e}catch{return t([]),[]}},[]);if((0,_.useEffect)(()=>{l()},[l]),e===null)return(0,B.jsx)(qp,{});let u=e.find(e=>e.id===c)??null;!u&&e.length>0&&c===null&&z(`storage`,e[0].id,{replace:!0});async function d(e){try{await N.deleteBucket(e.id),U.success(`Deleted bucket ${e.id}`),z(`storage`,(await l())[0]?.id??null,{replace:!0})}catch(e){U.error(e.message)}}return(0,B.jsxs)(`div`,{className:`flex h-full`,children:[(0,B.jsxs)(mf,{id:`storage-rail`,side:`left`,defaultSize:224,min:180,max:360,className:`flex flex-col border-r border-border bg-card`,children:[(0,B.jsx)(`div`,{className:`px-4 pb-1 pt-4 text-sm font-semibold text-foreground`,children:`Storage`}),(0,B.jsx)(`div`,{className:`px-2 pb-2 pt-1`,children:(0,B.jsxs)(H,{variant:`outline`,size:`xs`,className:`w-full`,onClick:()=>a(!0),children:[(0,B.jsx)(pt,{size:12}),` New bucket`]})}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2 pb-3`,children:[e.map(e=>(0,B.jsxs)(`button`,{onClick:()=>z(`storage`,e.id),className:`mb-px flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-[13px] transition-colors `+(u?.id===e.id?`bg-accent text-foreground`:`text-muted-foreground hover:bg-accent/50 hover:text-foreground`),children:[(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:e.id}),e.public&&(0,B.jsx)(V,{variant:`brand`,children:`public`})]},e.id)),e.length===0&&(0,B.jsx)(`p`,{className:`px-3 py-4 text-center text-xs text-muted-foreground/60`,children:`No buckets yet.`})]})]}),(0,B.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:u?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`shrink-0 px-6 pt-5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`h1`,{className:`font-mono text-lg font-semibold text-foreground`,children:u.id}),u.public&&(0,B.jsx)(V,{variant:`brand`,children:`public`})]}),(0,B.jsx)(`div`,{className:`mt-3`,children:(0,B.jsx)(Qp,{tabs:[{id:`files`,label:`Files`},{id:`settings`,label:`Settings`},{id:`policies`,label:`Policies`}],active:n,onSelect:r})})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1`,children:[n===`files`&&(0,B.jsx)(Pv,{bucket:u}),n===`settings`&&(0,B.jsx)(Av,{bucket:u,onDelete:()=>s(u)}),n===`policies`&&(0,B.jsx)(Ov,{bucket:u.id})]})]}):(0,B.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,B.jsxs)(`div`,{className:`rounded-lg border border-dashed border-border px-16 py-12 text-center`,children:[(0,B.jsx)(Pe,{size:22,className:`mx-auto text-muted-foreground/60`}),(0,B.jsx)(`p`,{className:`mt-3 text-sm font-medium text-foreground`,children:`Create a file bucket`}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground/80`,children:`Store images, videos, documents, and any other file type.`}),(0,B.jsxs)(H,{size:`xs`,className:`mt-4`,onClick:()=>a(!0),children:[(0,B.jsx)(pt,{size:12}),` New bucket`]})]})})}),i&&(0,B.jsx)(Lv,{onClose:()=>a(!1),onDone:async e=>{a(!1),await l(),z(`storage`,e,{replace:!0})}}),o&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Delete bucket \"${o.id}\"?`,description:`The bucket must be empty before it can be deleted.`,confirmLabel:`Delete bucket`,onConfirm:()=>void d(o),onClose:()=>s(null)})]})}function Lv({onClose:e,onDone:t}){let[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(!1);async function u(){l(!0),s(``);try{await N.createBucket({id:n,name:n,public:i}),U.success(`Created bucket ${n}`),await t(n)}catch(e){s(e.message),l(!1)}}return(0,B.jsx)(ho,{open:!0,onClose:e,title:`New bucket`,children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Name \u2014 lowercase, no spaces`}),(0,B.jsx)(Y,{mono:!0,value:n,autoFocus:!0,placeholder:`avatars`,onChange:e=>r(e.target.value.toLowerCase()),onKeyDown:e=>e.key===`Enter`&&n&&void u()})]}),(0,B.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-[13px] text-foreground/80`,children:[(0,B.jsx)(Zt,{checked:i,onChange:a}),`Public bucket \u2014 objects readable without auth`]}),o&&(0,B.jsx)(`p`,{className:`text-xs text-destructive`,children:o}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(H,{variant:`outline`,onClick:e,children:`Cancel`}),(0,B.jsx)(H,{onClick:()=>void u(),disabled:c||!n,children:c?`Creating\u2026`:`Create bucket`})]})]})})}var Rv=[{op:`eq`,label:`Equals`,sym:`=`,group:`Comparison`},{op:`neq`,label:`Not equal`,sym:`<>`,group:`Comparison`},{op:`gt`,label:`Greater than`,sym:`>`,group:`Comparison`},{op:`lt`,label:`Less than`,sym:`<`,group:`Comparison`},{op:`gte`,label:`Greater or equal`,sym:`>=`,group:`Comparison`},{op:`lte`,label:`Less or equal`,sym:`<=`,group:`Comparison`},{op:`like`,label:`Like`,sym:`~~`,group:`Pattern matching`},{op:`ilike`,label:`iLike`,sym:`~~*`,group:`Pattern matching`},{op:`in`,label:`In list`,sym:`in`,group:`Lists`},{op:`is`,label:`Is NULL`,sym:`null`,group:`Null`,noValue:!0},{op:`not.is`,label:`Is not NULL`,sym:`!null`,group:`Null`,noValue:!0}],zv=[`Comparison`,`Pattern matching`,`Lists`,`Null`],Bv=new Set([`text`,`varchar`,`bpchar`,`char`,`name`,`citext`]);function Vv(e,t){let n=e.filter(e=>Bv.has(e.type)).map(e=>e.name);if(n.length===0)return null;let r=t.replace(/[(),]/g,` `).trim();return[`or`,`(${n.map(e=>`${e}.ilike.*${r}*`).join(`,`)})`]}function Hv(e,t){let n=[];for(let r of t)if(r.column===`*`){let t=Vv(e,r.value);t&&n.push(t)}else r.op===`is`||r.op===`not.is`?n.push([r.column,`${r.op}.null`]):r.op===`in`?n.push([r.column,`in.(${r.value})`]):n.push([r.column,`${r.op}.${r.value}`]);return n}function Uv(e){let t=e.type;return t===`uuid`?300:t===`bool`?100:/^(int|float|numeric)/.test(t)?110:/timestamp|date|time/.test(t)?220:t===`json`||t===`jsonb`||t.startsWith(`_`)?240:190}function Wv(e){let t=new Date().toISOString();return e.startsWith(`timestamp`)?t.replace(`T`,` `).replace(`Z`,`+00`):e===`date`?t.slice(0,10):e===`timetz`?t.slice(11,23)+`+00`:e.startsWith(`time`)?t.slice(11,19):t}function Gv(e){let t=e.trim();if(!t)return null;let n=t.includes(`T`)?t:t.replace(` `,`T`);/[+-]\\d\\d$/.test(n)&&(n+=`:00`);let r=new Date(n);return Number.isNaN(r.getTime())?null:r}function Kv(e,t){if(t===`bool`)return e===`true`||e===`t`||e===`1`;if([`int2`,`int4`,`int8`,`float4`,`float8`,`numeric`].includes(t)){let t=Number(e);return Number.isNaN(t)?e:t}if(t===`json`||t===`jsonb`||t.startsWith(`_`))try{return JSON.parse(e)}catch{return e}return e}function qv(e){if(e==null)return;let t=typeof e==`object`?JSON.stringify(e):String(e);return t.length>40?t:void 0}function Jv({value:e}){return e==null?(0,B.jsx)(`span`,{className:`select-none text-muted-foreground/60`,children:`NULL`}):e===``?(0,B.jsx)(`span`,{className:`select-none italic text-muted-foreground/60`,children:`empty`}):typeof e==`boolean`?(0,B.jsx)(`span`,{className:`text-info`,children:String(e)}):typeof e==`object`?(0,B.jsx)(`span`,{className:`text-warning/90`,children:JSON.stringify(e)}):(0,B.jsx)(B.Fragment,{children:String(e)})}function Yv(e){let t=e.getTime()-Date.now(),n=Math.abs(t);for(let[e,r]of[[31536e6,`year`],[2592e6,`month`],[864e5,`day`],[36e5,`hour`],[6e4,`minute`],[1e3,`second`]])if(n>=e){let i=Math.round(n/e);return t<0?`${i} ${r}${i>1?`s`:``} ago`:`in ${i} ${r}${i>1?`s`:``}`}return`just now`}function Xv({col:e,value:t,anchor:n,enumValues:r,onCommit:i,onCancel:a}){let o=t==null?``:typeof t==`object`?JSON.stringify(t,null,2):String(t),[s,c]=(0,_.useState)(o),l=(0,_.useRef)(!1),u=e=>{l.current||(l.current=!0,e())},d=(e=0)=>u(()=>i(s,e)),f=()=>u(a),p=e.type===`bool`,m=!p&&(r?.length??0)>0,h=/^(timestamp|date|time)/.test(e.type),g=!p&&!m&&!h&&!/^(int|float|numeric|uuid)/.test(e.type),v=/^(timestamp|date)/.test(e.type),y=v&&s?Gv(s):null,b=y!==null,x=Intl.DateTimeFormat().resolvedOptions().timeZone,S=Math.max(n.width+2,h?320:280),C=Math.max(8,Math.min(n.top,window.innerHeight-(g?320:h?300:m?320:160)))-1,w=Math.max(8,Math.min(n.left,window.innerWidth-S-12))-1,T=p?[`true`,`false`,...e.nullable?[`__null`]:[]]:m?[...r,...e.nullable?[`__null`]:[]]:null;return(0,hn.createPortal)((0,B.jsxs)(`div`,{style:{position:`fixed`,top:C,left:w,width:S},className:`z-80 overflow-hidden rounded-md border border-muted-foreground bg-card shadow-[0_16px_48px_rgba(0,0,0,0.6)] animate-[fade-in_.1s_ease-out]`,onKeyDown:e=>{e.key===`Escape`?(e.stopPropagation(),f()):e.key===`Enter`&&!(g&&e.shiftKey)?(e.preventDefault(),d()):e.key===`Tab`&&(e.preventDefault(),d(e.shiftKey?-1:1))},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||d()},children:[T?(0,B.jsx)(`div`,{className:`max-h-64 overflow-y-auto p-1`,children:T.map(e=>(0,B.jsxs)(`button`,{autoFocus:e===(o||T[0]),onFocus:()=>c(e),onMouseDown:e=>e.preventDefault(),onClick:()=>u(()=>i(e,0)),className:`flex w-full items-center gap-2 rounded px-2.5 py-1.5 text-left font-mono text-[13px] transition-colors hover:bg-accent focus:bg-accent focus:outline-none `+(e===o?`text-brand`:e===`__null`?`text-muted-foreground/80`:`text-foreground`),children:[e===`__null`?`NULL`:e,e===o&&(0,B.jsx)(fe,{size:12,className:`ml-auto shrink-0`})]},e))}):g?(0,B.jsx)(`textarea`,{autoFocus:!0,value:s,onChange:e=>c(e.target.value),onFocus:e=>e.target.select(),placeholder:e.nullable?`NULL`:``,className:`block h-52 w-full resize-none bg-transparent px-2.5 py-2 font-mono text-[13px] leading-relaxed text-foreground selection:bg-brand/40 placeholder:text-muted-foreground/60 focus:outline-none`}):(0,B.jsx)(`input`,{autoFocus:!0,value:s,onChange:e=>c(e.target.value),onFocus:e=>e.target.select(),placeholder:e.nullable?`NULL`:``,className:`block w-full bg-transparent px-2.5 py-2 font-mono text-[13px] text-foreground selection:bg-brand/40 placeholder:text-muted-foreground/60 focus:outline-none`}),v&&(0,B.jsxs)(`div`,{className:`border-t border-border px-2.5 py-2 font-mono text-[11px]`,children:[(0,B.jsx)(`p`,{className:`mb-1 font-sans text-muted-foreground/80`,children:`Formatted value:`}),s===``?(0,B.jsx)(`p`,{className:`text-muted-foreground/60`,children:e.nullable?`NULL`:`empty`}):b?(0,B.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,B.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground/80`,children:`UTC`}),(0,B.jsx)(`span`,{className:`text-foreground/80`,children:y.toISOString().replace(`T`,` `).slice(0,19)})]}),(0,B.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,B.jsx)(`span`,{className:`truncate text-muted-foreground/80`,children:x}),(0,B.jsx)(`span`,{className:`shrink-0 text-foreground/80`,children:y.toLocaleString()})]}),(0,B.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,B.jsx)(`span`,{className:`text-muted-foreground/80`,children:`Relative`}),(0,B.jsx)(`span`,{className:`text-foreground/80`,children:Yv(y)})]})]}):(0,B.jsx)(`p`,{className:`text-destructive`,children:`Invalid date`})]}),(0,B.jsxs)(`div`,{className:`border-t border-border p-1.5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,B.jsxs)(`button`,{className:`flex flex-1 items-center gap-2 rounded px-2 py-1.5 text-left text-xs text-foreground/80 hover:bg-accent`,onMouseDown:e=>e.preventDefault(),onClick:()=>d(),children:[(0,B.jsx)(lf,{children:`\u21B5`}),` Save changes`]}),h&&(0,B.jsxs)(`button`,{className:`flex shrink-0 items-center gap-1.5 rounded border border-input px-2 py-1 text-xs text-foreground/80 hover:bg-accent`,onMouseDown:e=>e.preventDefault(),onClick:()=>c(Wv(e.type)),children:[(0,B.jsx)(be,{size:11}),` Set to NOW`]})]}),(0,B.jsxs)(`button`,{className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs text-muted-foreground hover:bg-accent`,onMouseDown:e=>e.preventDefault(),onClick:f,children:[(0,B.jsx)(lf,{children:`Esc`}),` Cancel changes`]})]})]}),document.body)}var Zv=e=>e.replace(/'/g,`''`);async function Qv(e,t){let n=Zv(e),r=Zv(t),i=`'\"${n}\".\"${r}\"'::regclass`,a=await N.sql(`select\n (select json_agg(json_build_object(\n 'name', column_name, 'type', data_type,\n 'nullable', is_nullable = 'YES',\n 'default', column_default,\n 'identityGen', identity_generation\n ) order by ordinal_position)\n from information_schema.columns\n where table_schema = '${n}' and table_name = '${r}') as cols,\n (select json_agg(json_build_object('name', conname, 'def', pg_get_constraintdef(oid), 'type', contype))\n from pg_constraint where conrelid = ${i}) as cons,\n (select json_agg(indexdef)\n from pg_indexes i\n where i.schemaname = '${n}' and i.tablename = '${r}'\n and i.indexname not in (select conname from pg_constraint where conrelid = ${i})) as idxs`);if(!a.ok)throw Error(a.error??`Failed to read table definition`);let o=a.rows?.[0]??{},s=e=>typeof e==`string`?JSON.parse(e):e??[],c=s(o.cols),l=s(o.cons),u=s(o.idxs),d=c.map(e=>{let t=`${e.name} ${e.type}`;return e.nullable||(t+=` not null`),e.identityGen?t+=` generated ${e.identityGen.toLowerCase()} as identity`:e.default&&(t+=` default ${e.default}`),t}),f={p:0,u:1,f:2,c:3},p=l.sort((e,t)=>(f[e.type]??9)-(f[t.type]??9)||e.name.localeCompare(t.name)).map(e=>`constraint ${e.name} ${e.def}`),m=`create table ${e}.${t} (\\n ${[...d,...p].join(`,\n `)}\\n);`;return u.length>0&&(m+=`\n\n`+u.map(e=>e+`;`).join(`\n`)),m}function $v({schema:e=`public`,table:t,refreshKey:n}){let[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(``);return(0,_.useEffect)(()=>{i(null),o(``),Qv(e,t).then(i,e=>o(e.message))},[e,t,n]),a?(0,B.jsxs)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-center text-[13px] text-muted-foreground/80`,children:[`Could not generate the definition: `,(0,B.jsx)(`span`,{className:`ml-1 text-destructive`,children:a})]}):r===null?(0,B.jsx)(`div`,{className:`flex-1`,children:(0,B.jsx)(qp,{})}):(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between px-5 pb-1 pt-4`,children:[(0,B.jsxs)(`h2`,{className:`text-sm text-foreground/80`,children:[`SQL definition of `,(0,B.jsx)(`code`,{className:`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground`,children:t}),` `,(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground/60`,children:`(read only)`})]}),(0,B.jsx)(Qn,{value:r,label:`Definition`,variant:`outline`,size:`xs`,children:`Copy`})]}),(0,B.jsx)(`div`,{className:`px-3 pb-4`,children:(0,B.jsx)(er,{value:r,lang:`sql`,readOnly:!0,gutter:!0,minLines:4,maxLines:500})})]})}var ey=e=>e.target.split(`.`).pop(),ty=e=>e.target===`auth.users`;function ny(e,t){return e?e.columns.filter(e=>!t.targetColumns.includes(e.name)&&Bv.has(e.type)).slice(0,2).map(e=>e.name):[]}async function ry(e,t,n){if(ty(e)){let e=await N.users();if(n.exact!==void 0&&(e=e.filter(e=>String(e.id)===String(n.exact))),n.search){let t=n.search.toLowerCase();e=e.filter(e=>String(e.email??``).toLowerCase().includes(t)||String(e.id).includes(t))}return{rows:e,total:e.length}}let r=[];if(n.exact!==void 0&&r.push([e.targetColumns[0],`eq.${n.exact}`]),n.search?.trim()&&t){let e=Vv(t.columns,n.search);e&&r.push(e)}let i=n.perPage??100;return N.rows(ey(e),{limit:n.exact===void 0?i:1,offset:(n.page??0)*i,order:t?.primaryKey[0]?`${t.primaryKey[0]}.asc`:void 0,filters:r})}function iy({fk:e,value:t,anchor:n,tables:r,onClose:i,onOpenTable:a}){let o=r.find(t=>t.name===ey(e)),[s,c]=(0,_.useState)(void 0);(0,_.useEffect)(()=>{ry(e,o,{exact:t}).then(({rows:e})=>c(e[0]??null),()=>c(null))},[e,o,t]);let l=ty(e)?`id`:e.targetColumns[0],u=ty(e)?[`email`]:ny(o,e),d=t=>ty(e)?t===`id`?`uuid`:`text`:o?.columns.find(e=>e.name===t)?.type??``,f=Math.min(n.top+n.height+4,window.innerHeight-190),p=Math.max(8,Math.min(n.left,window.innerWidth-400-12));return(0,hn.createPortal)((0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`fixed inset-0 z-[70]`,onClick:i}),(0,B.jsxs)(`div`,{style:{position:`fixed`,top:f,left:p,width:400},className:`z-[80] overflow-hidden rounded-md border border-muted-foreground bg-card shadow-[0_16px_48px_rgba(0,0,0,0.6)] animate-[fade-in_.1s_ease-out]`,children:[(0,B.jsxs)(`p`,{className:`border-b border-border px-3 py-2 text-xs text-muted-foreground`,children:[`Referencing record from `,(0,B.jsx)(`code`,{className:`font-mono text-foreground`,children:e.target}),`:`]}),s===void 0?(0,B.jsx)(qp,{}):s===null?(0,B.jsx)(`p`,{className:`px-3 py-4 text-center text-xs text-muted-foreground/60`,children:`No matching record found.`}):(0,B.jsxs)(`table`,{className:`w-full border-collapse text-[13px]`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsx)(`tr`,{children:[l,...u].map((e,t)=>(0,B.jsx)(`th`,{className:`border-b border-r border-border px-3 py-1.5 text-left font-normal last:border-r-0`,children:(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[t===0&&(0,B.jsx)(Ge,{size:10,className:`text-brand`}),(0,B.jsx)(`span`,{className:`font-mono font-medium text-foreground`,children:e}),(0,B.jsx)(`span`,{className:`text-[11px] text-muted-foreground/60`,children:d(e)})]})},e))})}),(0,B.jsx)(`tbody`,{children:(0,B.jsx)(`tr`,{children:[l,...u].map(e=>(0,B.jsx)(`td`,{className:`max-w-[220px] truncate border-r border-border/60 px-3 py-2 font-mono text-foreground/80 last:border-r-0`,children:(0,B.jsx)(Jv,{value:s[e]})},e))})})]}),!ty(e)&&(0,B.jsx)(`div`,{className:`flex justify-end border-t border-border px-2 py-1.5`,children:(0,B.jsx)(H,{variant:`outline`,size:`xs`,onClick:()=>a(ey(e)),children:`Open table`})})]})]}),document.body)}function ay({fk:e,tables:t,currentKey:n,onPick:r,onClose:i}){let a=t.find(t=>t.name===ey(e)),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(0),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(0),[m,h]=(0,_.useState)(``),g=ty(e),v=g?[`id`,`email`,`created_at`]:a?[...e.targetColumns,...a.columns.map(e=>e.name).filter(t=>!e.targetColumns.includes(t))].slice(0,6):e.targetColumns,y=(0,_.useCallback)(()=>{h(``),ry(e,a,{search:o,page:c,perPage:100}).then(({rows:e,total:t})=>{d(e),p(t)},e=>h(e.message))},[e,a,o,c]);(0,_.useEffect)(()=>{y()},[y]);let b=Math.max(1,Math.ceil(f/100));return(0,B.jsx)(Kp,{open:!0,onClose:i,flush:!0,width:`w-[640px]`,title:(0,B.jsxs)(`span`,{children:[`Select a record to reference from`,` `,(0,B.jsx)(`code`,{className:`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e.target})]}),footer:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`span`,{className:`text-xs text-muted-foreground/80`,children:[f.toLocaleString(),` record`,f===1?``:`s`,b>1&&` \u00B7 page ${c+1} of ${b}`]}),b>1&&(0,B.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(H,{variant:`outline`,size:`xs`,disabled:c===0,onClick:()=>l(e=>e-1),children:`Prev`}),(0,B.jsx)(H,{variant:`outline`,size:`xs`,disabled:c+1>=b,onClick:()=>l(e=>e+1),children:`Next`})]}),(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,className:`ml-auto`,children:`Cancel`})})]}),children:(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsxs)(`div`,{className:`relative border-b border-border`,children:[(0,B.jsx)(_t,{size:13,className:`pointer-events-none absolute left-4 top-1/2 -translate-y-1/2 text-muted-foreground/60`}),(0,B.jsx)(`input`,{autoFocus:!0,value:o,onChange:e=>{s(e.target.value),l(0)},placeholder:`Search ${ey(e)}\u2026`,className:`h-10 w-full bg-transparent pl-10 pr-10 text-[13px] text-foreground placeholder:text-muted-foreground/60 focus:outline-none`}),(0,B.jsx)(`button`,{className:`absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground/80 hover:text-foreground`,title:`Refresh`,onClick:y,children:(0,B.jsx)(ht,{size:13})})]}),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[m&&(0,B.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive`,children:m}),!m&&u===null&&(0,B.jsx)(qp,{}),!m&&u!==null&&u.length===0&&(0,B.jsxs)(`p`,{className:`py-10 text-center text-xs text-muted-foreground/60`,children:[`No records`,o?` match your search`:``,`.`]}),!m&&u!==null&&u.length>0&&(0,B.jsxs)(`table`,{className:`w-full border-collapse text-[13px]`,children:[(0,B.jsx)(`thead`,{className:`sticky top-0 z-10 bg-card`,children:(0,B.jsx)(`tr`,{children:v.map((t,n)=>(0,B.jsx)(`th`,{className:`whitespace-nowrap border-b border-r border-border px-3 py-1.5 text-left font-normal last:border-r-0`,children:(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[n<e.targetColumns.length&&(0,B.jsx)(Ge,{size:10,className:`text-brand`}),(0,B.jsx)(`span`,{className:`font-mono font-medium text-foreground`,children:t})]})},t))})}),(0,B.jsx)(`tbody`,{children:u.map((t,a)=>(0,B.jsx)(`tr`,{onClick:()=>{let n={};e.columns.forEach((r,i)=>n[r]=t[g?`id`:e.targetColumns[i]]),r(n),i()},className:`cursor-pointer `+(n!=null&&String(t[g?`id`:e.targetColumns[0]])===String(n)?`bg-brand/10`:`hover:bg-accent/50`),children:v.map(e=>(0,B.jsx)(`td`,{className:`max-w-[200px] truncate border-b border-r border-border/60 px-3 py-1.5 font-mono text-foreground/80 last:border-r-0`,children:(0,B.jsx)(Jv,{value:t[e]})},e))},a))})]})]})]})})}function oy({fk:e,value:t,disabled:n,placeholder:r,onOpen:i}){return(0,B.jsxs)(`button`,{type:`button`,disabled:n,onClick:i,className:`flex h-8 w-full items-center gap-2 rounded-md border border-input bg-field px-2.5 text-left font-mono text-[13px] text-foreground transition-colors hover:border-muted-foreground focus:border-brand focus:outline-none disabled:pointer-events-none disabled:opacity-50`,title:`Select a record from ${e.target}`,children:[t?(0,B.jsx)(`span`,{className:`truncate`,children:t}):(0,B.jsx)(`span`,{className:`text-muted-foreground/60`,children:n?`NULL`:r}),(0,B.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1 font-sans text-[11px] text-muted-foreground/80`,children:[e.target,` `,(0,B.jsx)(ue,{size:11})]})]})}var sy=1;function cy({columns:e,filters:t,onChange:n}){let[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(0),d=(0,_.useRef)(null),f=e.filter(e=>e.name.toLowerCase().includes(a.toLowerCase())),p=a.trim().length>0&&!s,m=+!!p+f.length;function h(e){n([...t,{...e,id:sy++}]),c(null),o(``),i(!1)}function g(e){c({column:e}),o(``),u(0),d.current?.focus()}function v(e){if(e.noValue)return h({column:s.column,op:e.op,value:``});c({column:s.column,op:e}),o(``),i(!1),d.current?.focus()}function y(e){if(e.key===`Escape`){c(null),o(``),i(!1);return}if(s?.op){e.key===`Enter`&&a.trim()&&h({column:s.column,op:s.op.op,value:a.trim()}),e.key===`Backspace`&&a===``&&(c({column:s.column}),i(!0));return}if(s?.column){e.key===`Backspace`&&a===``&&(c(null),i(!0));return}if(e.key===`ArrowDown`)e.preventDefault(),u(e=>Math.min(e+1,m-1));else if(e.key===`ArrowUp`)e.preventDefault(),u(e=>Math.max(e-1,0));else if(e.key===`Enter`)if(p&&l===0)h({column:`*`,op:`search`,value:a.trim()});else{let e=f[l-+!!p];e&&g(e.name)}else e.key===`Backspace`&&a===``&&t.length>0&&n(t.slice(0,-1))}let b=s?.op?s.op.op===`in`?`comma,separated,values \u2014 Enter to apply`:s.op.op===`like`||s.op.op===`ilike`?`%pattern% \u2014 Enter to apply`:`value \u2014 Enter to apply`:s?.column?`pick an operator\u2026`:`Filter by ${e.slice(0,3).map(e=>e.name).join(`, `)}\u2026 or type to search`;return(0,B.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,B.jsxs)(`div`,{className:`flex min-h-[30px] cursor-text flex-wrap items-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 hover:border-border focus-within:border-input`,onClick:()=>{d.current?.focus(),s?.op||i(!0)},children:[(0,B.jsx)(_t,{size:13,className:`shrink-0 text-muted-foreground/60`}),t.map(e=>{let r=Rv.find(t=>t.op===e.op);return(0,B.jsxs)(`span`,{className:`flex max-w-[260px] shrink-0 items-center gap-1 rounded border border-input bg-accent/80 py-0.5 pl-1.5 pr-0.5 text-xs`,children:[e.column===`*`?(0,B.jsxs)(`span`,{className:`truncate text-foreground/80`,children:[`search `,(0,B.jsxs)(`span`,{className:`text-brand`,children:[`\u201C`,e.value,`\u201D`]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:`font-mono text-foreground`,children:e.column}),(0,B.jsx)(`span`,{className:`text-muted-foreground/80`,children:r?.sym??e.op}),!r?.noValue&&(0,B.jsx)(`span`,{className:`truncate text-brand`,children:e.value})]}),(0,B.jsx)(`button`,{className:`rounded p-0.5 text-muted-foreground/80 hover:bg-muted hover:text-foreground`,onClick:r=>{r.stopPropagation(),n(t.filter(t=>t.id!==e.id))},children:(0,B.jsx)(Ft,{size:11})})]},e.id)}),s?.column&&(0,B.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 rounded border border-brand/40 bg-brand/10 px-1.5 py-0.5 text-xs`,children:[(0,B.jsx)(`span`,{className:`font-mono text-foreground`,children:s.column}),s.op&&(0,B.jsx)(`span`,{className:`text-brand`,children:s.op.sym})]}),(0,B.jsx)(`input`,{ref:d,value:a,onChange:e=>{o(e.target.value),u(0),s?.op||i(!0)},onFocus:()=>!s?.op&&i(!0),onKeyDown:y,placeholder:t.length===0||s?b:`Add more filters\u2026`,className:`h-6 min-w-[140px] flex-1 bg-transparent text-[13px] text-foreground placeholder:text-muted-foreground/60 focus:outline-none`})]}),r&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`fixed inset-0 z-40`,onClick:()=>i(!1)}),(0,B.jsx)(`div`,{className:`absolute left-0 top-full z-50 mt-1 max-h-[340px] w-[300px] overflow-auto rounded-md border border-input bg-popover py-1 shadow-xl animate-[fade-in_.1s_ease-out]`,children:s?.column?zv.map(e=>{let t=Rv.filter(t=>t.group===e&&t.label.toLowerCase().includes(a.toLowerCase()));return t.length===0?null:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`px-3 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80`,children:e}),t.map(e=>(0,B.jsxs)(`button`,{className:`flex w-full items-center px-3 py-1.5 text-left text-[13px] text-foreground hover:bg-accent`,onClick:()=>v(e),children:[e.label,(0,B.jsx)(`span`,{className:`ml-auto rounded border border-input bg-accent px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:e.sym})]},e.op))]},e)}):(0,B.jsxs)(B.Fragment,{children:[p&&(0,B.jsxs)(`button`,{className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-[13px] text-foreground `+(l===0?`bg-accent`:`hover:bg-accent`),onClick:()=>h({column:`*`,op:`search`,value:a.trim()}),children:[(0,B.jsx)(_t,{size:13,className:`text-muted-foreground/80`}),`Search all text columns for `,(0,B.jsxs)(`span`,{className:`text-brand`,children:[`\u201C`,a.trim(),`\u201D`]})]}),f.map((e,t)=>{let n=t+ +!!p;return(0,B.jsxs)(`button`,{className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-[13px] `+(l===n?`bg-accent`:`hover:bg-accent`),onClick:()=>g(e.name),children:[(0,B.jsx)(`span`,{className:`font-mono text-foreground`,children:e.name}),(0,B.jsx)(`span`,{className:`ml-auto text-[11px] text-muted-foreground/60`,children:e.type})]},e.name)}),f.length===0&&!p&&(0,B.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground/80`,children:`No matching column.`})]})})]})]})}function ly({table:e,schema:t=`public`,column:n,onClose:r,onDone:i}){let[a,o]=(0,_.useState)(n),[s,c]=(0,_.useState)(!1);async function l(){let o=a.trim();if(!o||o===n)return r();c(!0);let s=await N.sql(`alter table ${Gh(t,e)} rename column \"${n}\" to \"${o.replace(/\"/g,`\"\"`)}\"`);if(c(!1),!s.ok){U.error(s.error??`Rename failed`);return}U.success(`Renamed ${n} \u2192 ${o}`),await i()}return(0,B.jsx)(ho,{open:!0,onClose:r,title:`Rename column \"${n}\"`,children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`New name`}),(0,B.jsx)(Y,{mono:!0,value:a,autoFocus:!0,onChange:e=>o(e.target.value),onKeyDown:e=>e.key===`Enter`&&void l()})]}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(H,{variant:`outline`,onClick:r,children:`Cancel`}),(0,B.jsx)(H,{onClick:()=>void l(),disabled:s||!a.trim(),children:s?`Renaming\u2026`:`Rename`})]})]})})}var uy=e=>`\"`+e.replace(/\"/g,`\"\"`)+`\"`;async function dy(e){let t=await N.sql(e);return t.ok?null:t.error??`Statement failed`}var fy=`create table new_table (\n id uuid primary key default gen_random_uuid(),\n name text not null,\n created_at timestamptz not null default now()\n);`;function py({schema:e=`public`,onClose:t,onDone:n}){let[r,i]=(0,_.useState)(e===`public`?fy:fy.replace(`create table `,`create table ${uy(e)}.`)),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(!1);async function l(){c(!0),o(``);let e=await dy(r);if(e){o(e),c(!1);return}let i=/create\\s+table\\s+(?:if\\s+not\\s+exists\\s+)?(?:\"([^\"]+)\"|([\\w.]+))/i.exec(r),a=(i?.[1]??i?.[2])?.split(`.`).pop();U.success(`Created table${a?` ${a}`:``}`),await n(a??void 0),t()}return(0,B.jsx)(ho,{open:!0,onClose:t,title:`New table`,wide:!0,children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground/80`,children:`Define the table in SQL \u2014 full Postgres DDL is supported (constraints, references, checks\u2026).`}),(0,B.jsx)(nr,{lang:`sql`,className:`h-56`,value:r,onChange:i,onCmdEnter:()=>void l()}),a&&(0,B.jsx)(`p`,{className:`rounded border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:a}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(H,{variant:`outline`,onClick:t,children:`Cancel`}),(0,B.jsx)(H,{onClick:()=>void l(),disabled:s||!r.trim(),children:s?`Creating\u2026`:`Create table`})]})]})})}var my=[`text`,`int8`,`int4`,`numeric`,`float8`,`bool`,`uuid`,`timestamptz`,`date`,`jsonb`];function hy({table:e,schema:t=`public`,onClose:n,onDone:r}){let[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(`text`),[c,l]=(0,_.useState)(!0),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(!1),[m,h]=(0,_.useState)(``);async function g(){if(!i.trim())return;p(!0),h(``);let a=`alter table ${Gh(t,e)} add column ${uy(i.trim())} ${o}`;c||(a+=` not null`),u.trim()&&(a+=` default ${u.trim()}`);let s=await dy(a);if(s){h(s),p(!1);return}U.success(`Added column ${i.trim()}`),await r(),n()}return(0,B.jsx)(ho,{open:!0,onClose:n,title:`Add column to \"${e}\"`,children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Name`}),(0,B.jsx)(Y,{mono:!0,value:i,autoFocus:!0,placeholder:`status`,onChange:e=>a(e.target.value)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`Type`}),(0,B.jsx)(Up,{mono:!0,value:o,onValueChange:s,options:my.map(e=>({value:e}))})]})]}),(0,B.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-[13px] text-foreground/80`,children:[(0,B.jsx)(Zt,{checked:c,onChange:l}),`Nullable`]}),(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(X,{children:[`Default `,(0,B.jsx)(`span`,{className:`font-normal text-muted-foreground/60`,children:`\u2014 raw SQL expression, e.g. now() or 'draft'`})]}),(0,B.jsx)(Y,{mono:!0,value:u,placeholder:`(none)`,onChange:e=>d(e.target.value),onKeyDown:e=>e.key===`Enter`&&void g()})]}),m&&(0,B.jsx)(`p`,{className:`rounded border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:m}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(H,{variant:`outline`,onClick:n,children:`Cancel`}),(0,B.jsx)(H,{onClick:()=>void g(),disabled:f||!i.trim(),children:f?`Adding\u2026`:`Add column`})]})]})})}function gy({table:e,schema:t=`public`,onClose:n,onDone:r}){let[i,a]=(0,_.useState)(e),[o,s]=(0,_.useState)(!1);async function c(){let a=i.trim();if(!a||a===e)return n();s(!0);let o=await dy(`alter table ${Gh(t,e)} rename to ${uy(a)}`);if(s(!1),o){U.error(o);return}U.success(`Renamed ${e} \u2192 ${a}`),await r(a),n()}return(0,B.jsx)(ho,{open:!0,onClose:n,title:`Rename table \"${e}\"`,children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`New name`}),(0,B.jsx)(Y,{mono:!0,value:i,autoFocus:!0,onChange:e=>a(e.target.value),onKeyDown:e=>e.key===`Enter`&&void c()})]}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(H,{variant:`outline`,onClick:n,children:`Cancel`}),(0,B.jsx)(H,{onClick:()=>void c(),disabled:o||!i.trim(),children:o?`Renaming\u2026`:`Rename`})]})]})})}function _y({table:e,schema:t=`public`,onClose:n,onDone:r}){let[i,a]=(0,_.useState)(`${e}_copy`),[o,s]=(0,_.useState)(!0),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``);async function f(){let a=i.trim();if(!a)return;l(!0),d(``);let s=await dy(`create table ${Gh(t,a)} (like ${Gh(t,e)} including all)`);if(s){d(s),l(!1);return}if(o){let n=await dy(`insert into ${Gh(t,a)} select * from ${Gh(t,e)}`);if(n){d(`Table created, but copying rows failed: ${n}`),l(!1),await r(a);return}}U.success(`Duplicated ${e} \u2192 ${a}`),await r(a),n()}return(0,B.jsx)(ho,{open:!0,onClose:n,title:`Duplicate table \"${e}\"`,children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(X,{children:`New table name`}),(0,B.jsx)(Y,{mono:!0,value:i,autoFocus:!0,onChange:e=>a(e.target.value),onKeyDown:e=>e.key===`Enter`&&void f()})]}),(0,B.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-[13px] text-foreground/80`,children:[(0,B.jsx)(Zt,{checked:o,onChange:s}),`Copy the rows too`]}),(0,B.jsx)(`p`,{className:`text-[11px] text-muted-foreground/60`,children:`Copies columns, defaults, not-null constraints and indexes. Foreign keys are not copied.`}),u&&(0,B.jsx)(`p`,{className:`rounded border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:u}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(H,{variant:`outline`,onClick:n,children:`Cancel`}),(0,B.jsx)(H,{onClick:()=>void f(),disabled:c||!i.trim(),children:c?`Duplicating\u2026`:`Duplicate`})]})]})})}function vy({table:e,schema:t=`public`,onClose:n,onDone:r}){let[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(``);async function u(){s(!0),l(``);let a=await dy(`drop table ${Gh(t,e)}${i?` cascade`:``}`);if(a){l(a),s(!1);return}U.success(`Dropped table ${e}`),await r(),n()}return(0,B.jsx)(ho,{open:!0,onClose:n,title:`Delete table \"${e}\"?`,children:(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,B.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-destructive/15`,children:(0,B.jsx)(kt,{size:15,className:`text-destructive`})}),(0,B.jsx)(`p`,{className:`text-[13px] leading-relaxed text-muted-foreground`,children:`The table and all of its rows will be permanently deleted. This cannot be undone.`})]}),(0,B.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-[13px] text-foreground/80`,children:[(0,B.jsx)(Zt,{checked:i,onChange:a}),`Also drop dependent objects (CASCADE)`]}),c&&(0,B.jsx)(`p`,{className:`rounded border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:c}),(0,B.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,B.jsx)(H,{variant:`outline`,onClick:n,children:`Cancel`}),(0,B.jsx)(H,{variant:`dangerSolid`,onClick:()=>void u(),disabled:o,children:o?`Deleting\u2026`:`Delete table`})]})]})})}function yy({table:e,tables:t,initial:n,isNew:r,readOnly:i,onClose:a,onSave:o,onDelete:s}){let c=e.columns.filter(e=>!(r&&e.isPrimaryKey&&e.hasDefault)),[l,u]=(0,_.useState)(()=>{let e={};for(let t of c){let r=n[t.name];e[t.name]=r==null?``:typeof r==`object`?JSON.stringify(r,null,2):String(r)}return e}),[d,f]=(0,_.useState)(()=>{let e=new Set;if(!r)for(let t of c)n[t.name]===null&&e.add(t.name);return e}),[p,m]=(0,_.useState)(new Set),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(``),[S,C]=(0,_.useState)(!1),[w,T]=(0,_.useState)({});(0,_.useEffect)(()=>{N.sql(`select t.typname as name, e.enumlabel as label\n from pg_enum e join pg_type t on t.oid = e.enumtypid\n order by t.typname, e.enumsortorder`).then(e=>{if(!e.ok||!e.rows)return;let t={};for(let n of e.rows)(t[n.name]??=[]).push(n.label);T(t)}).catch(()=>{})},[]);function E(e,t){u(n=>({...n,[e]:t})),m(t=>new Set(t).add(e)),f(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})}function D(e){m(t=>new Set(t).add(e)),f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function O(){if(i)return;x(``);for(let e of c){let t=l[e.name]??``;if(!(d.has(e.name)||t===``||t===`__null`)){if(e.type===`json`||e.type===`jsonb`||e.type.startsWith(`_`))try{JSON.parse(t)}catch{return x(`\"${e.name}\": not valid JSON \u2014 fix it or set the field to NULL.`)}if(/^(int|float|numeric)/.test(e.type)&&Number.isNaN(Number(t)))return x(`\"${e.name}\": \"${t}\" is not a number.`)}}if(r){for(let e of c)if(!e.nullable&&!e.hasDefault&&(l[e.name]??``)===``&&!d.has(e.name))return x(`\"${e.name}\" is required.`)}C(!0);let e={};for(let t of c){if(!r&&t.isPrimaryKey||!r&&!p.has(t.name))continue;if(d.has(t.name)){e[t.name]=null;continue}let n=l[t.name]??``;if(n===`__null`){e[t.name]=null;continue}if(n===``){!r&&t.nullable&&(e[t.name]=null);continue}e[t.name]=Kv(n,t.type)}try{await o(e)}catch(e){x(e.message),C(!1)}}return(0,B.jsxs)(Kp,{open:!0,onClose:a,title:(0,B.jsxs)(`span`,{children:[i?`View row from `:r?`Insert row into `:`Update row from `,(0,B.jsx)(`code`,{className:`rounded bg-accent px-1.5 py-0.5 font-mono text-xs text-foreground`,children:e.name})]}),footer:i?(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,className:`ml-auto`,children:`Close`})}):(0,B.jsxs)(B.Fragment,{children:[!r&&s&&(0,B.jsxs)(H,{variant:`danger`,onClick:()=>y(!0),children:[(0,B.jsx)(Ot,{size:13}),` Delete row`]}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,B.jsxs)(`span`,{className:`mr-1 hidden items-center gap-1 text-[11px] text-muted-foreground/60 sm:flex`,children:[(0,B.jsx)(lf,{children:`Ctrl`}),`+`,(0,B.jsx)(lf,{children:`\u21B5`}),` to save`]}),(0,B.jsx)(Gp,{asChild:!0,children:(0,B.jsx)(H,{variant:`outline`,children:`Cancel`})}),(0,B.jsx)(H,{onClick:()=>void O(),disabled:S,children:S?`Saving\u2026`:r?`Insert row`:`Save changes`})]})]}),children:[(0,B.jsxs)(`div`,{className:`space-y-4`,onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&O()},children:[r&&e.columns.some(e=>e.isPrimaryKey&&e.hasDefault)&&(0,B.jsxs)(`p`,{className:`rounded-md border border-border bg-card px-3 py-2 text-[11px] text-muted-foreground/80`,children:[`Primary key`,` `,(0,B.jsx)(`span`,{className:`font-mono text-muted-foreground`,children:e.columns.filter(e=>e.isPrimaryKey&&e.hasDefault).map(e=>e.name).join(`, `)}),` `,`is generated automatically.`]}),c.map(t=>{let n=e.foreignKeys.find(e=>e.columns.includes(t.name)),a=d.has(t.name),o=!t.nullable&&!t.hasDefault,s=/^(timestamp|date|time)/.test(t.type),c=i||!r&&t.isPrimaryKey;return(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5`,children:[(0,B.jsx)(X,{children:(0,B.jsx)(`span`,{className:`font-mono text-foreground/80`,children:t.name})}),(0,B.jsx)(`span`,{className:`mb-1 text-[11px] text-muted-foreground/60`,children:t.type}),t.isPrimaryKey&&(0,B.jsxs)(V,{variant:`amber`,className:`mb-1`,children:[c&&(0,B.jsx)(Xe,{size:9}),` PK`]}),o&&!c&&(0,B.jsx)(V,{variant:`red`,className:`mb-1`,children:`required`}),!c&&(0,B.jsxs)(`span`,{className:`mb-1 ml-auto flex items-center gap-1`,children:[s&&!a&&(0,B.jsx)(by,{label:`now`,onClick:()=>E(t.name,Wv(t.type))}),t.type===`uuid`&&!n&&!a&&(0,B.jsx)(by,{label:`generate`,onClick:()=>E(t.name,crypto.randomUUID())}),t.nullable&&t.type!==`bool`&&(0,B.jsx)(by,{label:`NULL`,active:a,onClick:()=>D(t.name)})]})]}),c?(0,B.jsxs)(`div`,{className:`flex h-8 items-center gap-2 rounded-md border border-border bg-card px-2.5 font-mono text-[13px] text-muted-foreground/80`,children:[(0,B.jsx)(Xe,{size:11,className:`shrink-0 text-muted-foreground/60`}),(0,B.jsx)(`span`,{className:`truncate`,children:l[t.name]||`NULL`})]}):n?(0,B.jsx)(oy,{fk:n,value:a?``:l[t.name]??``,disabled:a,placeholder:t.hasDefault?`default \u2014 or select a record`:`Select a record\u2026`,onOpen:()=>g({col:t.name,fk:n})}):(0,B.jsx)(xy,{col:t,enums:w,value:a?``:l[t.name]??``,disabled:a,onChange:e=>E(t.name,e)})]},t.name)}),b&&(0,B.jsx)(`p`,{className:`wrap-break-word rounded border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:b})]}),v&&s&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Delete this row?`,description:`The row will be permanently deleted. This cannot be undone.`,confirmLabel:`Delete row`,onConfirm:()=>void s().catch(e=>x(e.message)),onClose:()=>y(!1)}),h&&(0,B.jsx)(ay,{fk:h.fk,tables:t,currentKey:l[h.col]||null,onClose:()=>g(null),onPick:e=>{for(let[t,n]of Object.entries(e))E(t,n==null?``:String(n))}})]})}function by({label:e,active:t,onClick:n}){return(0,B.jsx)(`button`,{type:`button`,className:`rounded border px-1.5 py-px text-[10px] transition-colors `+(t?`border-brand/50 bg-brand/15 text-brand`:`border-input text-muted-foreground/80 hover:border-muted-foreground hover:text-foreground/80`),onClick:n,children:e})}function xy({col:e,enums:t,value:n,disabled:r,onChange:i}){let a=r?`NULL`:e.hasDefault?`default`:e.nullable?`NULL`:``,o=e.hasDefault?`default`:e.nullable?`NULL`:`\u2014`;return e.type===`bool`?(0,B.jsx)(Up,{mono:!0,value:n,disabled:r,onValueChange:i,options:[{value:``,label:o},{value:`true`},{value:`false`},...e.nullable?[{value:`__null`,label:`NULL`}]:[]]}):t[e.type]?(0,B.jsx)(Up,{mono:!0,value:n,disabled:r,onValueChange:i,options:[{value:``,label:o},...t[e.type].map(e=>({value:e}))]}):e.type===`json`||e.type===`jsonb`||e.type.startsWith(`_`)?(0,B.jsx)($p,{rows:4,value:n,disabled:r,placeholder:a||`{ }`,onChange:e=>i(e.target.value)}):e.type===`text`?(0,B.jsx)($p,{rows:n.length>80||n.includes(`\n`)?4:2,value:n,disabled:r,placeholder:a,onChange:e=>i(e.target.value)}):(0,B.jsx)(Y,{mono:!0,value:n,disabled:r,placeholder:a,inputMode:/^(int|float|numeric)/.test(e.type)?`decimal`:void 0,onChange:e=>i(e.target.value)})}function Sy({tables:e,schema:t,managed:n,active:r,onSelect:i,onTablesChanged:a,onOpenPolicies:o,refreshKey:s}){let[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)({});(0,_.useEffect)(()=>{let e=!1;return N.sql(`select c.relname as name, c.relkind = 'v' as is_view, c.relrowsecurity as rls,\n coalesce('security_invoker=true' = any(c.reloptions) or 'security_invoker=on' = any(c.reloptions), false) as invoker\n from pg_class c join pg_namespace n on n.oid = c.relnamespace\n where n.nspname = '${t.replace(/'/g,`''`)}' and c.relkind in ('r','v')`).then(t=>{if(e||!t.ok||!t.rows)return;let n={};for(let e of t.rows)n[e.name]=e.is_view?!e.invoker:!e.rls;p(n)}).catch(()=>{}),()=>{e=!0}},[e,t,s]);async function m(e){try{await Xn(await Qv(t,e),`${e} schema`)}catch(e){U.error(e.message)}}async function h(e,n){try{let{rows:r,total:i}=await N.rows(e,{limit:1e4,offset:0,schema:t});if(n===`json`)p_(`${e}.json`,`application/json`,JSON.stringify(r,null,2));else{let t=r[0]?Object.keys(r[0]):[];p_(`${e}.csv`,`text/csv`,f_(t,r))}i>r.length?U(`Exported the first ${r.length.toLocaleString()} of ${i.toLocaleString()} rows`):U.success(`Exported ${r.length.toLocaleString()} rows`)}catch(e){U.error(e.message)}}let g=e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase()));return(0,B.jsxs)(mf,{id:`table-editor-rail`,side:`left`,defaultSize:240,min:200,max:420,className:`flex flex-col border-r border-border bg-card`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground/80`,children:[`Tables `,(0,B.jsx)(`span`,{className:`text-muted-foreground/60`,children:e.length})]}),(0,B.jsxs)(`div`,{className:`space-y-1.5 px-2 pb-2`,children:[(0,B.jsx)(Jh,{className:`w-full`}),!n&&(0,B.jsxs)(H,{variant:`outline`,size:`xs`,className:`w-full`,onClick:()=>d({kind:`new`}),children:[(0,B.jsx)(pt,{size:12}),` New table`]}),(0,B.jsxs)(`div`,{className:`relative`,children:[(0,B.jsx)(_t,{size:13,className:`pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground/60`}),(0,B.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:`Search tables\u2026`,className:`h-7 w-full rounded-md border border-border bg-field pl-7 pr-2 text-xs text-foreground placeholder:text-muted-foreground/60 focus:border-muted-foreground focus:outline-none`})]})]}),(0,B.jsxs)(`div`,{className:`flex-1 overflow-auto pb-2`,children:[g.map(e=>{let t=!n&&f[e.name]===!0;return(0,B.jsxs)(`div`,{className:`group flex w-full items-center gap-1.5 pl-3 pr-1.5 text-left text-[13px] `+(r===e.name?`bg-accent text-foreground`:`text-muted-foreground hover:bg-accent/50`),children:[(0,B.jsxs)(`button`,{className:`flex min-w-0 flex-1 items-center gap-2 py-1.5 text-left`,onClick:()=>i(e.name),children:[e.isView?(0,B.jsx)(`span`,{title:`View (read-only)`,children:(0,B.jsx)(ke,{size:12,className:`shrink-0 text-muted-foreground/60`})}):(0,B.jsx)(Et,{size:12,className:`shrink-0 text-muted-foreground/50`}),(0,B.jsx)(`span`,{className:`truncate font-mono`,children:e.name}),t&&(0,B.jsx)(`span`,{className:`shrink-0 rounded border border-destructive/30 bg-destructive/10 px-1 py-px text-[8px] font-semibold tracking-wider text-destructive`,title:e.isView?`View runs with the owner\u2019s permissions (no security_invoker) \u2014 RLS on the underlying tables is bypassed`:`RLS is disabled \u2014 all rows are exposed to every role`,children:`UNRESTRICTED`})]}),(0,B.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground/60 group-hover:hidden`,children:e.rowCount}),(0,B.jsxs)(Zd,{children:[(0,B.jsx)(Qd,{asChild:!0,children:(0,B.jsx)(`button`,{className:`hidden shrink-0 rounded p-1 text-muted-foreground/80 hover:bg-muted hover:text-foreground group-hover:block data-[state=open]:block data-[state=open]:bg-muted data-[state=open]:text-foreground`,title:`Table actions`,children:(0,B.jsx)(Ee,{size:13})})}),(0,B.jsxs)(tf,{align:`start`,children:[(0,B.jsxs)(nf,{onSelect:()=>void Xn(e.name,`\"${e.name}\"`),children:[(0,B.jsx)(xe,{size:13}),` Copy name`]}),!e.isView&&(0,B.jsxs)(nf,{onSelect:()=>void m(e.name),children:[(0,B.jsx)(je,{size:13}),` Copy table schema`]}),(0,B.jsx)(of,{}),!e.isView&&!n&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(nf,{onSelect:()=>d({kind:`rename`,table:e.name}),children:[(0,B.jsx)(ct,{size:13}),` Rename table`]}),(0,B.jsxs)(nf,{onSelect:()=>d({kind:`duplicate`,table:e.name}),children:[(0,B.jsx)(Ne,{size:13}),` Duplicate table`]}),(0,B.jsxs)(nf,{onSelect:()=>o(e.name),children:[(0,B.jsx)(xt,{size:13}),` View policies`]})]}),(0,B.jsxs)($d,{children:[(0,B.jsxs)(rf,{children:[(0,B.jsx)(Te,{size:13}),` Export data`]}),(0,B.jsxs)(af,{children:[(0,B.jsx)(nf,{onSelect:()=>void h(e.name,`csv`),children:`Export as CSV`}),(0,B.jsx)(nf,{onSelect:()=>void h(e.name,`json`),children:`Export as JSON`})]})]}),!e.isView&&!n&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(of,{}),(0,B.jsxs)(nf,{danger:!0,onSelect:()=>d({kind:`delete`,table:e.name}),children:[(0,B.jsx)(Ot,{size:13}),` Delete table`]})]})]})]})]},e.name)}),g.length===0&&(0,B.jsx)(cf,{children:e.length===0?`No tables yet \u2014 create one.`:`No match.`})]}),u?.kind===`new`&&(0,B.jsx)(py,{schema:t,onClose:()=>d(null),onDone:async e=>{await a(),e&&i(e)}}),u?.kind===`rename`&&(0,B.jsx)(gy,{table:u.table,schema:t,onClose:()=>d(null),onDone:async e=>{await a(),i(e)}}),u?.kind===`duplicate`&&(0,B.jsx)(_y,{table:u.table,schema:t,onClose:()=>d(null),onDone:async e=>{await a(),i(e)}}),u?.kind===`delete`&&(0,B.jsx)(vy,{table:u.table,schema:t,onClose:()=>d(null),onDone:a})]})}function Cy(){let[e]=Uh(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(!0),[s,c]=(0,_.useState)([]),[l,u]=(0,_.useState)(0),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(0),[h,g]=(0,_.useState)(100),[v,y]=(0,_.useState)([]),[b,x]=(0,_.useState)([]),[S,C]=(0,_.useState)(new Set),[w,E]=(0,_.useState)(new Set),[D,O]=(0,_.useState)({}),[k,A]=(0,_.useState)(new Set),j=(0,_.useRef)(null),[M,P]=(0,_.useState)(null),[ee,F]=(0,_.useState)(!1),[I,te]=(0,_.useState)(null),[ne,re]=(0,_.useState)(!1),[ie,ae]=(0,_.useState)(null),[L,oe]=(0,_.useState)(!1),[ue,fe]=(0,_.useState)(null),[ge,_e]=(0,_.useState)(null),[ve,ye]=(0,_.useState)(null),[be,Se]=(0,_.useState)(!1),[Ce,we]=(0,_.useState)(`data`),[De,Ae]=(0,_.useState)({kind:`postgres`}),[je,Me]=(0,_.useState)(null),[Ne,Pe]=(0,_.useState)(0),Fe=(0,_.useCallback)(()=>Pe(e=>e+1),[]),R=t.find(e=>e.name===r)||null,Le=qh(e),Re=!!R&&R.primaryKey.length>0&&!R.isView&&!Le,[ze,Be]=(0,_.useState)({});(0,_.useEffect)(()=>{N.sql(`select t.typname as name, e.enumlabel as label\n from pg_enum e join pg_type t on t.oid = e.enumtypid\n order by t.typname, e.enumsortorder`).then(e=>{if(!e.ok||!e.rows)return;let t={};for(let n of e.rows)(t[n.name]??=[]).push(n.label);Be(t)}).catch(()=>{})},[e]);let Ve=(0,_.useMemo)(()=>R?R.columns.filter(e=>!S.has(e.name)):[],[R,S]),He=(0,_.useMemo)(()=>Ve.filter(e=>w.has(e.name)),[Ve,w]),Ue=(0,_.useCallback)(e=>D[e.name]??Uv(e),[D]),We=(0,_.useCallback)(e=>R?.foreignKeys.find(t=>t.columns.includes(e)),[R]),Ke=(0,_.useCallback)(e=>{if(!w.has(e))return null;let t=56;for(let n of He){if(n.name===e)return t;t+=Ue(n)}return t},[w,He,Ue]),qe=qt(),Ze=qe.tab===`table`?qe.section:null,Qe=(0,_.useRef)(Ze);Qe.current=Ze;let $e=(0,_.useCallback)(async()=>{try{let t=await N.tables(e);n(t),i(e=>{if(e&&t.some(t=>t.name===e))return e;let n=Qe.current;return n&&t.some(e=>e.name===n)?n:t[0]?.name??null})}catch(e){U.error(e.message)}},[e]);(0,_.useEffect)(()=>{i(null),n([]),o(!0),$e().finally(()=>o(!1))},[$e]),(0,_.useEffect)(()=>{Ze&&Ze!==r&&t.some(e=>e.name===Ze)&&i(Ze)},[Ze,t]),(0,_.useEffect)(()=>{!r||qe.tab!==`table`||qe.section===r||Ze&&t.some(e=>e.name===Ze)||z(`table`,r,{replace:!0})},[r,t]);let tt=(0,_.useRef)(0),nt=(0,_.useCallback)(async()=>{if(!r||!R)return;let t=++tt.current;f(!0);try{let n=v.length>0?v.map(e=>`${e.column}.${e.dir}`).join(`,`):R.primaryKey[0]?`${R.primaryKey[0]}.asc`:void 0,{rows:i,total:a}=await N.rows(r,{limit:h,offset:p*h,order:n,schema:e,filters:Hv(R.columns,b)});if(t!==tt.current)return;c(i),u(a)}catch(e){t===tt.current&&U.error(e.message)}finally{t===tt.current&&f(!1)}},[r,R,p,h,v,b,De,Ne,e]);(0,_.useEffect)(()=>()=>T(null),[]),(0,_.useEffect)(()=>{nt()},[nt]),(0,_.useEffect)(()=>{c([]),u(0),m(0),y([]),x([]),A(new Set),C(new Set),E(new Set),O({}),fe(null),_e(null),ye(null),P(null),j.current=null},[r,e]),(0,_.useEffect)(()=>{m(0),A(new Set)},[b,h]),(0,_.useEffect)(()=>{if(!R)return;let e=new Set(R.columns.map(e=>e.name));y(t=>t.some(t=>!e.has(t.column))?t.filter(t=>e.has(t.column)):t),x(t=>t.some(t=>t.column!==`*`&&!e.has(t.column))?t.filter(t=>t.column===`*`||e.has(t.column)):t),C(t=>[...t].some(t=>!e.has(t))?new Set([...t].filter(t=>e.has(t))):t),E(t=>[...t].some(t=>!e.has(t))?new Set([...t].filter(t=>e.has(t))):t)},[R]);let rt=(0,_.useCallback)(e=>JSON.stringify(R.primaryKey.map(t=>e[t])),[R]),it=(0,_.useCallback)(e=>{let t={};for(let n of R.primaryKey)t[n]=e[n];return t},[R]);function at(e,t,n){A(r=>{let i=new Set(r),a=e=>{let n=rt(s[e]);t?i.add(n):i.delete(n)};if(n&&j.current!==null){let[t,n]=[Math.min(j.current,e),Math.max(j.current,e)];for(let e=t;e<=n;e++)a(e)}else a(e);return i}),j.current=e}let ot=(0,_.useMemo)(()=>Re?s.map(e=>rt(e)):[],[s,rt,Re]),st=ot.length>0&&ot.every(e=>k.has(e)),dt=ot.some(e=>k.has(e)),ft=(0,_.useMemo)(()=>Re?s.filter(e=>k.has(rt(e))):[],[s,k,rt,Re]),mt=(0,_.useCallback)(async()=>{if(!(!R||k.size===0))try{let t=[...k].map(e=>JSON.parse(e));if(R.primaryKey.length===1)await N.deleteRows(R.name,R.primaryKey[0],t.map(e=>e[0]),e);else for(let n of t){let t={};R.primaryKey.forEach((e,r)=>t[e]=n[r]),await N.deleteRow(R.name,t,e)}U.success(`Deleted ${k.size} row(s)`),A(new Set),await nt(),await $e()}catch(e){U.error(e.message)}},[R,k,nt,$e]);function gt(e){let t=Ve.map(e=>e.name);e===`json`?p_(`${r}-page${p+1}.json`,`application/json`,JSON.stringify(s,null,2)):p_(`${r}-page${p+1}.csv`,`text/csv`,f_(t,s))}function _t(e,t){y(n=>{let r=n.find(t=>t.column===e),i=r?r.dir===`asc`?{column:e,dir:`desc`}:null:{column:e,dir:`asc`};if(!t)return i?[i]:[];let a=n.filter(t=>t.column!==e);return i?[...a,i]:a})}function vt(e,t,n){if(!Re)return;if(t.isPrimaryKey)return U(`Primary key columns are locked \u2014 use the SQL editor to change keys`);let r=We(t.name);if(r)return ye({row:e,fk:r,col:t.name});let i=n.getBoundingClientRect();fe({key:rt(e),col:t.name,rect:{top:i.top,left:i.left,width:i.width,height:i.height}})}async function yt(t,n){try{let i=await N.updateRow(r,it(t),n,e),a=Array.isArray(i)?i[0]:null;c(e=>e.map(e=>e===t?a??{...e,...n}:e)),U.success(`Row updated`)}catch(e){U.error(e.message)}}async function bt(t,n,i,a){let o=t[n.name],s=o==null?``:typeof o==`object`?JSON.stringify(o):String(o),l=t;if(i!==s){let a=i===`__null`||i===``&&n.nullable?null:Kv(i,n.type);try{let i=await N.updateRow(r,it(t),{[n.name]:a},e);l=(Array.isArray(i)?i[0]:null)??{...t,[n.name]:a},c(e=>e.map(e=>e===t?l:e)),U.success(`Row updated`)}catch(e){U.error(e.message),fe(null);return}}if(a!==0&&ue){let e=Ve.findIndex(e=>e.name===n.name),t=a,r=Ve[e+t],i=ue.rect.left,o=n;for(;r&&(r.isPrimaryKey||We(r.name));)i+=a===1?Ue(o):-Ue(r),o=r,t+=a,r=Ve[e+t];if(r)return i+=a===1?Ue(o):-Ue(r),fe({key:rt(l),col:r.name,rect:{...ue.rect,left:i,width:Ue(r)}})}fe(null)}async function xt(t){if(!r)return;let n=await N.sql(`alter table ${Gh(e,r)} drop column \"${t}\"`);if(!n.ok)return U.error(n.error??`Failed to drop column`);U.success(`Dropped column ${t}`),await $e()}let[St,Ct]=(0,_.useState)(null);(0,_.useEffect)(()=>Ct(null),[r,p,s.length,Ve.length]),(0,_.useEffect)(()=>{let e=e=>{let t=e.target;if(!(M||ee||I||ue||t.closest(`input, textarea, select, [role=\"dialog\"]`))){if(St&&Re){let t=(t,n)=>{e.preventDefault();let r=Math.max(0,Math.min(s.length-1,St.r+t)),i=Math.max(0,Math.min(Ve.length-1,St.c+n));Ct({r,c:i}),document.querySelector(`[data-cell=\"${r}:${Ve[i]?.name}\"]`)?.scrollIntoView({block:`nearest`,inline:`nearest`})};if(e.key===`ArrowUp`)return t(-1,0);if(e.key===`ArrowDown`)return t(1,0);if(e.key===`ArrowLeft`)return t(0,-1);if(e.key===`ArrowRight`)return t(0,1);let n=s[St.r],r=Ve[St.c];if(n&&r&&e.key===`Enter`){e.preventDefault();let t=document.querySelector(`[data-cell=\"${St.r}:${r.name}\"]`);t&&vt(n,r,t);return}if(n&&r&&(e.key===`Delete`||e.key===`Backspace`)&&!r.isPrimaryKey&&!We(r.name)&&r.nullable&&n[r.name]!==null){e.preventDefault(),bt(n,r,``,0);return}if(e.key===`Escape`){Ct(null);return}}e.key===`Escape`&&A(new Set),e.key===`Delete`&&k.size>0&&re(!0)}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[k,M,ee,I,ue,St,s,Ve,Re]);let wt=(0,_.useRef)(null);if((0,_.useEffect)(()=>{let e=e=>{let t=wt.current;t&&O(n=>({...n,[t.col]:Math.max(72,t.startW+(e.clientX-t.startX))}))},t=()=>wt.current=null;return window.addEventListener(`mousemove`,e),window.addEventListener(`mouseup`,t),()=>{window.removeEventListener(`mousemove`,e),window.removeEventListener(`mouseup`,t)}},[]),a)return(0,B.jsx)(qp,{});let Tt=Math.max(1,Math.ceil(l/h)),Et=56+Ve.reduce((e,t)=>e+Ue(t),0)+40;return(0,B.jsxs)(`div`,{className:`flex h-full`,children:[(0,B.jsx)(Sy,{tables:t,schema:e,managed:Le,active:r,onSelect:i,onTablesChanged:$e,onOpenPolicies:Me,refreshKey:Ne}),(0,B.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:R?(0,B.jsxs)(B.Fragment,{children:[Ce===`definition`?(0,B.jsx)($v,{table:R.name,schema:e,refreshKey:R}):(0,B.jsxs)(B.Fragment,{children:[k.size>0?(0,B.jsxs)(`div`,{className:`flex h-11.5 shrink-0 items-center gap-3 border-b border-border bg-brand/10 px-3`,children:[(0,B.jsx)(Zt,{checked:st,indeterminate:!st&&dt,onChange:e=>A(e?new Set(ot):new Set)}),(0,B.jsxs)(`span`,{className:`text-[13px] text-foreground`,children:[(0,B.jsx)(`span`,{className:`font-semibold text-brand`,children:k.size}),` row`,k.size===1?``:`s`,` selected`]}),(0,B.jsx)(`div`,{className:`mx-1 h-4 w-px bg-muted`}),(0,B.jsx)(Qn,{variant:`outline`,size:`xs`,label:`rows as JSON`,value:()=>JSON.stringify(ft,null,2),children:`Copy JSON`}),(0,B.jsx)(Qn,{variant:`outline`,size:`xs`,label:`rows as CSV`,value:()=>f_(Ve.map(e=>e.name),ft),children:`Copy CSV`}),(0,B.jsxs)(H,{variant:`dangerSolid`,size:`xs`,onClick:()=>re(!0),children:[(0,B.jsx)(Ot,{size:12}),` Delete `,k.size]}),(0,B.jsxs)(`span`,{className:`ml-1 hidden items-center gap-1 text-[11px] text-muted-foreground/80 lg:flex`,children:[(0,B.jsx)(lf,{children:`Del`}),` delete \u00B7 `,(0,B.jsx)(lf,{children:`Esc`}),` clear`]}),(0,B.jsx)(`button`,{className:`ml-auto p-1 text-muted-foreground/80 hover:text-foreground`,onClick:()=>A(new Set),children:(0,B.jsx)(Ft,{size:15})})]}):(0,B.jsxs)(`div`,{className:`flex h-11.5 shrink-0 items-center gap-2 border-b border-border px-3`,children:[(0,B.jsx)(cy,{columns:R.columns,filters:b,onChange:x}),(0,B.jsxs)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:[!Le&&(R.isView?(0,B.jsx)(Mg,{view:R.name,schema:e,refreshKey:Ne,onChanged:Fe},R.name):(0,B.jsx)(jg,{table:R.name,schema:e,refreshKey:Ne,onChanged:Fe},R.name)),(0,B.jsx)(nv,{value:De,onChange:(e,t)=>{T(t),Ae(e),A(new Set)}}),(0,B.jsxs)(ff,{open:be,onOpenChange:Se,align:`end`,className:`w-60 p-1.5`,trigger:(0,B.jsx)(H,{variant:`outline`,size:`iconXs`,title:`View options`,onClick:()=>Se(e=>!e),children:(0,B.jsx)(Ee,{size:13})}),children:[(0,B.jsxs)(`p`,{className:`px-2 pb-1 pt-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80`,children:[`Columns`,S.size>0?` \u2014 ${S.size} hidden`:``]}),(0,B.jsx)(`div`,{className:`max-h-56 overflow-auto`,children:R.columns.map(e=>(0,B.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-[13px] text-foreground hover:bg-accent`,children:[(0,B.jsx)(Zt,{checked:!S.has(e.name),onChange:t=>C(n=>{let r=new Set(n);return t?r.delete(e.name):r.add(e.name),r})}),(0,B.jsx)(`span`,{className:`truncate font-mono`,children:e.name}),(0,B.jsx)(`span`,{className:`ml-auto text-[11px] text-muted-foreground/60`,children:e.type})]},e.name))}),S.size>0&&(0,B.jsx)(`button`,{className:`w-full rounded px-2 py-1.5 text-left text-xs text-brand hover:bg-accent`,onClick:()=>C(new Set),children:`Show all columns`}),(0,B.jsx)(`div`,{className:`my-1 h-px bg-accent`}),(0,B.jsx)(`p`,{className:`px-2 pb-1 pt-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80`,children:`Export page`}),[`csv`,`json`].map(e=>(0,B.jsxs)(`button`,{className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[13px] text-foreground hover:bg-accent`,onClick:()=>{gt(e),Se(!1)},children:[(0,B.jsx)(Te,{size:13,className:`text-muted-foreground/80`}),` Export as `,e.toUpperCase()]},e))]}),(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,title:`Refresh`,onClick:()=>void nt(),children:(0,B.jsx)(ht,{size:13,className:d?`animate-spin`:``})}),!R.isView&&!Le&&(0,B.jsxs)(H,{size:`xs`,onClick:()=>F(!0),children:[(0,B.jsx)(pt,{size:13}),` Insert`]})]})]}),!Re&&(Le?(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border bg-accent/40 px-3 py-1.5 text-xs text-muted-foreground`,children:[(0,B.jsx)(Xe,{size:13,className:`shrink-0`}),(0,B.jsxs)(`span`,{children:[`The `,(0,B.jsx)(`span`,{className:`font-mono text-foreground/80`,children:e}),` schema is managed by tinbase \u2014 read-only here; change it through SQL. It isn't exposed to anon/authenticated through the Data API, so access is controlled by grants rather than RLS.`]})]}):R?.isView?(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border bg-accent/40 px-3 py-1.5 text-xs text-muted-foreground`,children:[(0,B.jsx)(ke,{size:13,className:`shrink-0`}),(0,B.jsx)(`span`,{children:`This is a view \u2014 computed from other tables, so it's read-only. Edit the underlying tables instead.`})]}):(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-warning/30 bg-warning/10 px-3 py-1.5 text-xs text-warning`,children:[(0,B.jsx)(kt,{size:13,className:`shrink-0`}),(0,B.jsx)(`span`,{children:`This table has no primary key, so rows can't be uniquely addressed \u2014 selection and editing are off. Inserting still works; add a primary key (SQL editor) to unlock everything.`})]})),(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto transition-opacity `+(d?`opacity-60`:``),children:[(0,B.jsxs)(`table`,{className:`border-collapse text-[13px]`,style:{width:Math.max(Et,0),tableLayout:`fixed`},children:[(0,B.jsxs)(`colgroup`,{children:[(0,B.jsx)(`col`,{style:{width:56}}),Ve.map(e=>(0,B.jsx)(`col`,{style:{width:Ue(e)}},e.name)),(0,B.jsx)(`col`,{style:{width:40}})]}),(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{className:`sticky left-0 top-0 z-30 border-b border-r border-border bg-card px-0`,children:(0,B.jsx)(`div`,{className:`flex h-8.5 items-center gap-1.5 pl-3`,children:(0,B.jsx)(Zt,{checked:st,indeterminate:!st&&dt,disabled:!Re,title:Re?void 0:`Table has no primary key`,onChange:e=>A(e?new Set(ot):new Set)})})}),Ve.map(e=>{let t=v.findIndex(t=>t.column===e.name),n=t>=0?v[t]:null,r=Ke(e.name),i=We(e.name);return(0,B.jsxs)(`th`,{className:`group/th relative border-b border-r border-border bg-card p-0 text-left font-normal`,style:r===null?{position:`sticky`,top:0,zIndex:20}:{position:`sticky`,left:r,top:0,zIndex:25},children:[(0,B.jsxs)(`div`,{className:`flex h-8.5 items-center gap-1.5 pl-3 pr-1`,children:[e.isPrimaryKey&&(0,B.jsx)(Ge,{size:11,className:`shrink-0 text-warning`}),i&&(0,B.jsx)(`span`,{title:`foreign key \u2192 ${i.target}.${i.targetColumns.join(`,`)}`,children:(0,B.jsx)(Je,{size:11,className:`shrink-0 text-info`})}),(0,B.jsx)(`button`,{className:`min-w-0 truncate font-mono font-medium text-foreground hover:text-primary-foreground`,title:`${e.name} \u2014 click to sort${i?` \u00B7 fk \u2192 ${i.target}`:``}`,onClick:t=>_t(e.name,t.shiftKey),children:e.name}),(0,B.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground/60`,children:e.type}),n&&(0,B.jsxs)(`span`,{className:`flex shrink-0 items-center text-brand`,children:[n.dir===`asc`?(0,B.jsx)(de,{size:11}):(0,B.jsx)(ce,{size:11}),v.length>1&&(0,B.jsx)(`span`,{className:`text-[10px]`,children:t+1})]}),(0,B.jsxs)(Zd,{children:[(0,B.jsx)(Qd,{asChild:!0,children:(0,B.jsx)(`button`,{className:`ml-auto shrink-0 rounded p-0.5 text-muted-foreground/60 opacity-0 hover:bg-muted hover:text-foreground focus:opacity-100 group-hover/th:opacity-100 data-[state=open]:opacity-100`,children:(0,B.jsx)(pe,{size:13})})}),(0,B.jsxs)(tf,{children:[(0,B.jsxs)(nf,{onSelect:()=>y([{column:e.name,dir:`asc`}]),children:[(0,B.jsx)(de,{size:13}),` Sort ascending`]}),(0,B.jsxs)(nf,{onSelect:()=>y([{column:e.name,dir:`desc`}]),children:[(0,B.jsx)(ce,{size:13}),` Sort descending`]}),(0,B.jsxs)(nf,{onSelect:()=>y(t=>t.filter(t=>t.column!==e.name)),disabled:!n,children:[(0,B.jsx)(se,{size:13}),` Clear sort`]}),(0,B.jsx)(of,{}),(0,B.jsxs)(nf,{onSelect:()=>void Xn(e.name,`\"${e.name}\"`),children:[(0,B.jsx)(xe,{size:13}),` Copy name`]}),(0,B.jsxs)(nf,{onSelect:()=>E(t=>{let n=new Set(t);return n.has(e.name)?n.delete(e.name):n.add(e.name),n}),children:[w.has(e.name)?(0,B.jsx)(ut,{size:13}):(0,B.jsx)(lt,{size:13}),w.has(e.name)?`Unfreeze column`:`Freeze column`]}),(0,B.jsxs)(nf,{onSelect:()=>C(t=>new Set(t).add(e.name)),children:[(0,B.jsx)(Oe,{size:13}),` Hide column`]}),(0,B.jsx)(of,{}),(0,B.jsxs)(nf,{onSelect:()=>te(e.name),children:[(0,B.jsx)(ct,{size:13}),` Rename column`]}),(0,B.jsxs)(nf,{danger:!0,onSelect:()=>ae(e.name),children:[(0,B.jsx)(Ot,{size:13}),` Delete column`]})]})]})]}),(0,B.jsx)(`div`,{className:`absolute -right-0.5 top-0 z-10 h-full w-1.25 cursor-col-resize hover:bg-brand/50`,onMouseDown:t=>{t.preventDefault(),wt.current={col:e.name,startX:t.clientX,startW:Ue(e)}}})]},e.name)}),(0,B.jsx)(`th`,{className:`sticky top-0 z-20 border-b border-border bg-card p-0`,children:(0,B.jsx)(`button`,{title:`Add column`,onClick:()=>oe(!0),className:`flex h-8.5 w-10 items-center justify-center text-muted-foreground/60 transition-colors hover:text-foreground`,children:(0,B.jsx)(pt,{size:13})})})]})}),(0,B.jsx)(`tbody`,{children:s.map((e,t)=>{let n=Re?rt(e):String(t),i=Re&&k.has(n),a=i?`bg-selected`:`bg-background group-hover:bg-popover`;return(0,B.jsxs)(`tr`,{className:`group`,children:[(0,B.jsx)(`td`,{className:`sticky left-0 z-10 border-b border-r border-border/70 px-0 `+a,children:(0,B.jsxs)(`div`,{className:`flex h-8.5 items-center gap-1.5 pl-3`,children:[(0,B.jsx)(Zt,{checked:i,disabled:!Re,onChange:(e,n)=>at(t,e,n.shiftKey)}),(0,B.jsx)(`button`,{title:Re?`Edit row`:`View row`,className:`rounded p-0.5 text-muted-foreground/60 opacity-0 hover:bg-muted hover:text-foreground group-hover:opacity-100`,onClick:()=>P(e),children:(0,B.jsx)(et,{size:11})})]})}),Ve.map((r,i)=>{let o=Ke(r.name),s=Re&&ue?.key===n&&ue.col===r.name,c=St?.r===t&&St.c===i,l=We(r.name),u=e[r.name]!==null&&e[r.name]!==void 0;return(0,B.jsxs)(`td`,{\"data-cell\":`${t}:${r.name}`,className:`relative h-8.5 truncate border-b border-r border-border/70 px-3 font-mono text-foreground/80 `+(r.isPrimaryKey?`cursor-default `:`cursor-cell `)+(c?`ring-1 ring-inset ring-brand `:``)+a,style:o===null?void 0:{position:`sticky`,left:o,zIndex:5},title:s?void 0:qv(e[r.name]),onClick:()=>Re&&Ct({r:t,c:i}),onDoubleClick:t=>!s&&vt(e,r,t.currentTarget),children:[(0,B.jsx)(Jv,{value:e[r.name]}),l&&u&&(0,B.jsx)(`button`,{title:`View referencing record`,className:`absolute right-1 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center rounded border border-input bg-accent text-muted-foreground opacity-0 transition-opacity hover:border-foreground hover:text-foreground group-hover:opacity-100`,onClick:t=>{t.stopPropagation();let n=t.currentTarget.closest(`td`).getBoundingClientRect();_e({fk:l,value:e[r.name],rect:{top:n.top,left:n.left,width:n.width,height:n.height}})},onDoubleClick:e=>e.stopPropagation(),children:(0,B.jsx)(le,{size:11})}),s&&(0,B.jsx)(Xv,{col:r,value:e[r.name],anchor:ue.rect,enumValues:ze[r.type],onCancel:()=>fe(null),onCommit:(t,n)=>void bt(e,r,t,n)})]},r.name)}),(0,B.jsx)(`td`,{className:`border-b border-border/70 `+a})]},`${r}:${t}`)})})]}),s.length===0&&!d&&(0,B.jsx)(`div`,{className:`flex flex-col items-center gap-3 py-20 text-[13px] text-muted-foreground/80`,children:b.length>0?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Ie,{size:20,className:`text-muted-foreground/40`}),`No rows match the current filters.`,(0,B.jsx)(H,{variant:`outline`,size:`xs`,onClick:()=>x([]),children:`Clear filters`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Ye,{size:20,className:`text-muted-foreground/40`}),R.isView?`This view returns no rows.`:`This table is empty.`,!R.isView&&!Le&&(0,B.jsxs)(H,{size:`xs`,onClick:()=>F(!0),children:[(0,B.jsx)(pt,{size:13}),` Insert your first row`]})]})})]})]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-t border-border bg-card px-3 py-1.5 text-xs text-muted-foreground/80`,children:[Ce===`data`&&(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,disabled:p===0,onClick:()=>m(e=>e-1),children:(0,B.jsx)(me,{size:13})}),(0,B.jsx)(`span`,{children:`Page`}),(0,B.jsx)(`input`,{type:`number`,min:1,max:Tt,defaultValue:p+1,onKeyDown:e=>{if(e.key!==`Enter`)return;let t=parseInt(e.target.value,10);Number.isNaN(t)||m(Math.min(Math.max(t-1,0),Tt-1))},onBlur:e=>{let t=parseInt(e.target.value,10);Number.isNaN(t)||m(Math.min(Math.max(t-1,0),Tt-1))},className:`h-6 w-12 rounded border border-input bg-field px-1.5 text-center text-xs text-foreground focus:border-brand focus:outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none`},p),(0,B.jsxs)(`span`,{children:[`of `,Tt]}),(0,B.jsx)(H,{variant:`ghost`,size:`iconXs`,disabled:p+1>=Tt,onClick:()=>m(e=>e+1),children:(0,B.jsx)(he,{size:13})})]}),Ce===`data`&&(0,B.jsx)(`div`,{className:`w-27.5 shrink-0`,children:(0,B.jsx)(Up,{value:String(h),onValueChange:e=>g(parseInt(e,10)),options:[25,50,100,500].map(e=>({value:String(e),label:`${e} rows`}))})}),(0,B.jsx)(`span`,{className:`ml-auto`,children:Ce===`data`&&(0,B.jsxs)(B.Fragment,{children:[l.toLocaleString(),` record`,l===1?``:`s`,k.size>0&&(0,B.jsxs)(B.Fragment,{children:[` \u00B7 `,(0,B.jsxs)(`span`,{className:`text-brand`,children:[k.size,` selected`]})]})]})}),(0,B.jsx)(`div`,{className:`flex overflow-hidden rounded-md border border-input`,children:[`data`,`definition`].map(e=>(0,B.jsx)(`button`,{onClick:()=>we(e),className:`px-2.5 py-1 text-[11px] font-medium capitalize transition-colors `+(Ce===e?`bg-muted text-foreground`:`text-muted-foreground/80 hover:text-foreground`),children:e},e))})]})]}):(0,B.jsx)(cf,{children:`Select a table.`})}),M&&R&&(0,B.jsx)(yy,{table:R,tables:t,initial:M,readOnly:!Re,onClose:()=>P(null),onSave:async t=>{await N.updateRow(r,it(M),t,e),U.success(`Row updated`),P(null),await nt()},onDelete:async()=>{await N.deleteRow(r,it(M),e),U.success(`Row deleted`),P(null),await nt(),await $e()}}),ee&&R&&(0,B.jsx)(yy,{table:R,tables:t,initial:{},isNew:!0,onClose:()=>F(!1),onSave:async t=>{await N.insertRow(r,t,e),U.success(`Row inserted`),F(!1),await nt(),await $e()}}),je&&(0,B.jsx)(Ng,{table:je,schema:e,onClose:()=>Me(null),onChanged:Fe}),ge&&(0,B.jsx)(iy,{fk:ge.fk,value:ge.value,anchor:ge.rect,tables:t,onClose:()=>_e(null),onOpenTable:e=>{_e(null),i(e)}}),ve&&(0,B.jsx)(ay,{fk:ve.fk,tables:t,currentKey:ve.row[ve.col],onClose:()=>ye(null),onPick:e=>{yt(ve.row,e),ye(null)}}),I&&r&&(0,B.jsx)(ly,{table:r,schema:e,column:I,onClose:()=>te(null),onDone:async()=>{te(null),await $e()}}),L&&r&&(0,B.jsx)(hy,{table:r,schema:e,onClose:()=>oe(!1),onDone:async()=>{await $e()}}),ne&&R&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Delete ${k.size} selected row${k.size===1?``:`s`}?`,description:`Rows will be permanently deleted from \"${R.name}\". This cannot be undone.`,confirmLabel:`Delete ${k.size} row${k.size===1?``:`s`}`,onConfirm:()=>void mt(),onClose:()=>re(!1)}),ie&&r&&(0,B.jsx)(go,{open:!0,danger:!0,title:`Drop column \"${ie}\"?`,description:`The column and all data in it will be permanently removed from \"${r}\".`,confirmLabel:`Drop column`,onConfirm:()=>void xt(ie),onClose:()=>ae(null)})]})}function wy(){let[e,t]=(0,_.useState)(!!x()),{tab:n}=qt();return(0,_.useEffect)(()=>{x()&&N.ping().catch(e=>{e instanceof A&&(e.status===401||e.status===403)&&(C(),t(!1))})},[]),e?(0,B.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,B.jsx)(Yn,{}),(0,B.jsx)(sh,{}),(0,B.jsx)(ih,{}),(0,B.jsx)(dh,{onLogout:()=>{C(),t(!1)}}),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,B.jsx)(_h,{tab:n,onTab:e=>z(e)}),(0,B.jsxs)(`main`,{className:`min-w-0 flex-1 overflow-hidden`,children:[n===`home`&&(0,B.jsx)(s_,{}),n===`table`&&(0,B.jsx)(Cy,{}),n===`sql`&&(0,B.jsx)(wv,{}),n===`database`&&(0,B.jsx)(Zg,{}),n===`auth`&&(0,B.jsx)(zh,{}),n===`storage`&&(0,B.jsx)(Iv,{}),n===`functions`&&(0,B.jsx)(e_,{}),n===`realtime`&&(0,B.jsx)(M_,{}),n===`automations`&&(0,B.jsx)(sg,{}),n===`logs`&&(0,B.jsx)(y_,{}),n===`settings`&&(0,B.jsx)(ev,{})]})]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ph,{onOk:()=>t(!0)}),(0,B.jsx)(Yn,{})]})}(0,v.createRoot)(document.getElementById(`root`)).render((0,B.jsx)(_.StrictMode,{children:(0,B.jsx)(wy,{})}));</script>\n <style rel=\"stylesheet\" crossorigin>/*! tailwindcss v4.3.2 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-md:28rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-wide:.025em;--tracking-wider:.05em;--leading-snug:1.375;--leading-relaxed:1.625;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:ui-sans-serif, system-ui, -apple-system, sans-serif;--default-mono-font-family:ui-monospace, \"SF Mono\", Menlo, monospace;--color-muted-foreground:var(--muted-foreground);--color-border:var(--border)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}html,body,#root{height:100%}body{background:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;margin:0;font-size:13px}button:not(:disabled),[role=button]:not(:disabled){cursor:pointer}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{inset-inline:0}.inset-y-0{inset-block:0}.-top-0\\.5{top:calc(var(--spacing) * -.5)}.top-0{top:0}.top-0\\.5{top:calc(var(--spacing) * .5)}.top-1\\.5{top:calc(var(--spacing) * 1.5)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-24{top:calc(var(--spacing) * 24)}.top-full{top:100%}.-right-0\\.5{right:calc(var(--spacing) * -.5)}.right-0{right:0}.right-1{right:var(--spacing)}.right-1\\.5{right:calc(var(--spacing) * 1.5)}.right-2{right:calc(var(--spacing) * 2)}.right-2\\.5{right:calc(var(--spacing) * 2.5)}.right-3{right:calc(var(--spacing) * 3)}.-bottom-0\\.5{bottom:calc(var(--spacing) * -.5)}.bottom-0{bottom:0}.-left-0\\.5{left:calc(var(--spacing) * -.5)}.left-0{left:0}.left-0\\.5{left:calc(var(--spacing) * .5)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.left-2\\.5{left:calc(var(--spacing) * 2.5)}.left-4{left:calc(var(--spacing) * 4)}.left-\\[22\\%\\]{left:22%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-80{z-index:80}.z-90{z-index:90}.z-\\[60\\]{z-index:60}.z-\\[70\\]{z-index:70}.z-\\[80\\]{z-index:80}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-4{margin:calc(var(--spacing) * 4)}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.-mx-4{margin-inline:calc(var(--spacing) * -4)}.mx-0\\.5{margin-inline:calc(var(--spacing) * .5)}.mx-1{margin-inline:var(--spacing)}.mx-1\\.5{margin-inline:calc(var(--spacing) * 1.5)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.my-px{margin-block:1px}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-1\\.5\\!{margin-top:calc(var(--spacing) * 1.5)!important}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-7{margin-top:calc(var(--spacing) * 7)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.mr-1{margin-right:var(--spacing)}.mr-2{margin-right:calc(var(--spacing) * 2)}.-mb-4{margin-bottom:calc(var(--spacing) * -4)}.-mb-px{margin-bottom:-1px}.mb-0\\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:var(--spacing)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-px{margin-bottom:1px}.ml-1{margin-left:var(--spacing)}.ml-1\\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.\\!table{display:table!important}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-1\\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-11{width:calc(var(--spacing) * 11);height:calc(var(--spacing) * 11)}.h-1{height:var(--spacing)}.h-1\\.5{height:calc(var(--spacing) * 1.5)}.h-1\\/2{height:50%}.h-4{height:calc(var(--spacing) * 4)}.h-4\\.5{height:calc(var(--spacing) * 4.5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-8\\.5{height:calc(var(--spacing) * 8.5)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-11\\.5{height:calc(var(--spacing) * 11.5)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-32{height:calc(var(--spacing) * 32)}.h-40{height:calc(var(--spacing) * 40)}.h-44{height:calc(var(--spacing) * 44)}.h-52{height:calc(var(--spacing) * 52)}.h-56{height:calc(var(--spacing) * 56)}.h-\\[18px\\]{height:18px}.h-full{height:100%}.h-px{height:1px}.max-h-56{max-height:calc(var(--spacing) * 56)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\\[85vh\\]{max-height:85vh}.max-h-\\[340px\\]{max-height:340px}.min-h-0{min-height:0}.min-h-\\[30px\\]{min-height:30px}.w-1{width:var(--spacing)}.w-1\\.25{width:calc(var(--spacing) * 1.25)}.w-1\\/3{width:33.3333%}.w-1\\/4{width:25%}.w-2\\/3{width:66.6667%}.w-3\\/4{width:75%}.w-8{width:calc(var(--spacing) * 8)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-26{width:calc(var(--spacing) * 26)}.w-27\\.5{width:calc(var(--spacing) * 27.5)}.w-28{width:calc(var(--spacing) * 28)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-40{width:calc(var(--spacing) * 40)}.w-44{width:calc(var(--spacing) * 44)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-60{width:calc(var(--spacing) * 60)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-85{width:calc(var(--spacing) * 85)}.w-105{width:calc(var(--spacing) * 105)}.w-110{width:calc(var(--spacing) * 110)}.w-120{width:calc(var(--spacing) * 120)}.w-135{width:calc(var(--spacing) * 135)}.w-140{width:calc(var(--spacing) * 140)}.w-160{width:calc(var(--spacing) * 160)}.w-235{width:calc(var(--spacing) * 235)}.w-\\[22\\%\\]{width:22%}.w-\\[42\\%\\]{width:42%}.w-\\[300px\\]{width:300px}.w-\\[360px\\]{width:360px}.w-\\[400px\\]{width:400px}.w-\\[480px\\]{width:480px}.w-\\[500px\\]{width:500px}.w-\\[560px\\]{width:560px}.w-\\[620px\\]{width:620px}.w-\\[640px\\]{width:640px}.w-\\[980px\\]{width:980px}.w-full{width:100%}.w-px{width:1px}.max-w-0{max-width:0}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-70{max-width:calc(var(--spacing) * 70)}.max-w-90{max-width:calc(var(--spacing) * 90)}.max-w-120{max-width:calc(var(--spacing) * 120)}.max-w-\\[92vw\\]{max-width:92vw}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[220px\\]{max-width:220px}.max-w-\\[260px\\]{max-width:260px}.max-w-\\[300px\\]{max-width:300px}.max-w-md{max-width:var(--container-md)}.max-w-xs{max-width:var(--container-xs)}.min-w-\\(--radix-select-trigger-width\\){min-width:var(--radix-select-trigger-width)}.min-w-0{min-width:0}.min-w-4{min-width:calc(var(--spacing) * 4)}.min-w-\\[18px\\]{min-width:18px}.min-w-\\[140px\\]{min-width:140px}.min-w-\\[180px\\]{min-width:180px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-2{--tw-translate-x:calc(var(--spacing) * -2);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0\\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-4{--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[fade-in_\\.1s_ease-out\\]{animation:.1s ease-out fade-in}.animate-\\[fade-in_\\.15s_ease-out\\]{animation:.15s ease-out fade-in}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-cell{cursor:cell}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-move{cursor:move}.cursor-pointer{cursor:pointer}.cursor-row-resize{cursor:row-resize}.cursor-text{cursor:text}.resize{resize:both}.resize-none{resize:none}.\\[scrollbar-width\\:none\\]{scrollbar-width:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-none{list-style-type:none}.\\[appearance\\:textfield\\]{appearance:textfield}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\\[minmax\\(0\\,1fr\\)_minmax\\(0\\,1\\.6fr\\)_auto\\]{grid-template-columns:minmax(0,1fr) minmax(0,1.6fr) auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-12>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 12) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 12) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-10{column-gap:calc(var(--spacing) * 10)}.gap-y-6{row-gap:calc(var(--spacing) * 6)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-border>:not(:last-child)),:where(.divide-border\\/70>:not(:last-child)){border-color:var(--border)}@supports (color:color-mix(in lab, red, red)){:where(.divide-border\\/70>:not(:last-child)){border-color:color-mix(in oklab, var(--border) 70%, transparent)}}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[4px\\]{border-radius:4px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-t-md{border-top-left-radius:calc(var(--radius) - 2px);border-top-right-radius:calc(var(--radius) - 2px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-dotted{--tw-border-style:dotted;border-style:dotted}.border-border,.border-border\\/40{border-color:var(--border)}@supports (color:color-mix(in lab, red, red)){.border-border\\/40{border-color:color-mix(in oklab, var(--border) 40%, transparent)}}.border-border\\/60{border-color:var(--border)}@supports (color:color-mix(in lab, red, red)){.border-border\\/60{border-color:color-mix(in oklab, var(--border) 60%, transparent)}}.border-border\\/70{border-color:var(--border)}@supports (color:color-mix(in lab, red, red)){.border-border\\/70{border-color:color-mix(in oklab, var(--border) 70%, transparent)}}.border-brand,.border-brand\\/40{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.border-brand\\/40{border-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.border-brand\\/50{border-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.border-brand\\/50{border-color:color-mix(in oklab, var(--brand) 50%, transparent)}}.border-destructive\\/30{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.border-destructive\\/30{border-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.border-destructive\\/40{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.border-destructive\\/40{border-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.border-foreground{border-color:var(--foreground)}.border-input{border-color:var(--input)}.border-muted-foreground,.border-muted-foreground\\/30{border-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.border-muted-foreground\\/30{border-color:color-mix(in oklab, var(--muted-foreground) 30%, transparent)}}.border-transparent{border-color:#0000}.border-warning\\/30{border-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.border-warning\\/30{border-color:color-mix(in oklab, var(--warning) 30%, transparent)}}.border-warning\\/50{border-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.border-warning\\/50{border-color:color-mix(in oklab, var(--warning) 50%, transparent)}}.border-t-brand{border-top-color:var(--brand)}.bg-accent,.bg-accent\\/40{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/40{background-color:color-mix(in oklab, var(--accent) 40%, transparent)}}.bg-accent\\/50{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/50{background-color:color-mix(in oklab, var(--accent) 50%, transparent)}}.bg-accent\\/60{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/60{background-color:color-mix(in oklab, var(--accent) 60%, transparent)}}.bg-accent\\/80{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/80{background-color:color-mix(in oklab, var(--accent) 80%, transparent)}}.bg-background,.bg-background\\/80{background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){.bg-background\\/80{background-color:color-mix(in oklab, var(--background) 80%, transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-black\\/60{background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\\/60{background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-brand,.bg-brand\\/5{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\\/5{background-color:color-mix(in oklab, var(--brand) 5%, transparent)}}.bg-brand\\/10{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\\/10{background-color:color-mix(in oklab, var(--brand) 10%, transparent)}}.bg-brand\\/15{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\\/15{background-color:color-mix(in oklab, var(--brand) 15%, transparent)}}.bg-brand\\/40{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\\/40{background-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.bg-card{background-color:var(--card)}.bg-code{background-color:var(--code)}.bg-destructive,.bg-destructive\\/5{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/5{background-color:color-mix(in oklab, var(--destructive) 5%, transparent)}}.bg-destructive\\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/10{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.bg-destructive\\/15{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/15{background-color:color-mix(in oklab, var(--destructive) 15%, transparent)}}.bg-destructive\\/70{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\\/70{background-color:color-mix(in oklab, var(--destructive) 70%, transparent)}}.bg-field{background-color:var(--field)}.bg-foreground{background-color:var(--foreground)}.bg-info\\/15{background-color:var(--info)}@supports (color:color-mix(in lab, red, red)){.bg-info\\/15{background-color:color-mix(in oklab, var(--info) 15%, transparent)}}.bg-muted{background-color:var(--muted)}.bg-muted-foreground\\/25{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\\/25{background-color:color-mix(in oklab, var(--muted-foreground) 25%, transparent)}}.bg-muted-foreground\\/40{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\\/40{background-color:color-mix(in oklab, var(--muted-foreground) 40%, transparent)}}.bg-muted-foreground\\/60{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\\/60{background-color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.bg-popover,.bg-popover\\/95{background-color:var(--popover)}@supports (color:color-mix(in lab, red, red)){.bg-popover\\/95{background-color:color-mix(in oklab, var(--popover) 95%, transparent)}}.bg-primary{background-color:var(--primary)}.bg-selected{background-color:var(--selected)}.bg-sidebar{background-color:var(--sidebar)}.bg-transparent{background-color:#0000}.bg-warning,.bg-warning\\/10{background-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.bg-warning\\/10{background-color:color-mix(in oklab, var(--warning) 10%, transparent)}}.bg-warning\\/15{background-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.bg-warning\\/15{background-color:color-mix(in oklab, var(--warning) 15%, transparent)}}.bg-white{background-color:var(--color-white)}.fill-brand{fill:var(--brand)}.fill-muted-foreground\\/60{fill:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.fill-muted-foreground\\/60{fill:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.object-contain{object-fit:contain}.p-0{padding:0}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-px{padding:1px}.px-0{padding-inline:0}.px-0\\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-10{padding-inline:calc(var(--spacing) * 10)}.px-11{padding-inline:calc(var(--spacing) * 11)}.px-16{padding-inline:calc(var(--spacing) * 16)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-20{padding-block:calc(var(--spacing) * 20)}.py-px{padding-block:1px}.pt-0\\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-1\\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-px{padding-top:1px}.pr-0\\.5{padding-right:calc(var(--spacing) * .5)}.pr-1{padding-right:var(--spacing)}.pr-1\\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-9{padding-right:calc(var(--spacing) * 9)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-0{padding-bottom:0}.pb-0\\.5{padding-bottom:calc(var(--spacing) * .5)}.pb-1{padding-bottom:var(--spacing)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-1{padding-left:var(--spacing)}.pl-1\\.5{padding-left:calc(var(--spacing) * 1.5)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-7{padding-left:calc(var(--spacing) * 7)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-10{padding-left:calc(var(--spacing) * 10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SF Mono,Menlo,monospace}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,sans-serif}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[8px\\]{font-size:8px}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12\\.5px\\]{font-size:12.5px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.leading-6{--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words,.wrap-break-word{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-background{color:var(--background)}.text-brand{color:var(--brand)}.text-destructive,.text-destructive\\/70{color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.text-destructive\\/70{color:color-mix(in oklab, var(--destructive) 70%, transparent)}}.text-destructive\\/80{color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.text-destructive\\/80{color:color-mix(in oklab, var(--destructive) 80%, transparent)}}.text-foreground,.text-foreground\\/70{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/70{color:color-mix(in oklab, var(--foreground) 70%, transparent)}}.text-foreground\\/80{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/80{color:color-mix(in oklab, var(--foreground) 80%, transparent)}}.text-foreground\\/85{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/85{color:color-mix(in oklab, var(--foreground) 85%, transparent)}}.text-foreground\\/90{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/90{color:color-mix(in oklab, var(--foreground) 90%, transparent)}}.text-info{color:var(--info)}.text-muted-foreground,.text-muted-foreground\\/40{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/40{color:color-mix(in oklab, var(--muted-foreground) 40%, transparent)}}.text-muted-foreground\\/50{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/50{color:color-mix(in oklab, var(--muted-foreground) 50%, transparent)}}.text-muted-foreground\\/60{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/60{color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.text-muted-foreground\\/70{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/70{color:color-mix(in oklab, var(--muted-foreground) 70%, transparent)}}.text-muted-foreground\\/80{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/80{color:color-mix(in oklab, var(--muted-foreground) 80%, transparent)}}.text-primary-foreground{color:var(--primary-foreground)}.text-warning,.text-warning\\/90{color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.text-warning\\/90{color:color-mix(in oklab, var(--warning) 90%, transparent)}}.capitalize{text-transform:capitalize}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.decoration-muted-foreground\\/40{-webkit-text-decoration-color:var(--muted-foreground);-webkit-text-decoration-color:var(--muted-foreground);-webkit-text-decoration-color:var(--muted-foreground);text-decoration-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.decoration-muted-foreground\\/40{-webkit-text-decoration-color:color-mix(in oklab, var(--muted-foreground) 40%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--muted-foreground) 40%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--muted-foreground) 40%, transparent);text-decoration-color:color-mix(in oklab, var(--muted-foreground) 40%, transparent)}}.decoration-dotted{text-decoration-style:dotted}.underline-offset-2{text-underline-offset:2px}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-100{opacity:1}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_16px_48px_rgba\\(0\\,0\\,0\\,0\\.6\\)\\]{--tw-shadow:0 16px 48px var(--tw-shadow-color,#0009);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[12px_0_32px_rgba\\(0\\,0\\,0\\,0\\.45\\)\\]{--tw-shadow:12px 0 32px var(--tw-shadow-color,#00000073);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-brand,.ring-brand\\/40{--tw-ring-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.ring-brand\\/40{--tw-ring-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.ring-card{--tw-ring-color:var(--card)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\\[2px\\]{--tw-backdrop-blur:blur(2px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-\\[opacity\\,transform\\]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\,box-shadow\\]{transition-property:width,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-\\[cubic-bezier\\(0\\.16\\,1\\,0\\.3\\,1\\)\\]{--tw-ease:cubic-bezier(.16,1,.3,1);transition-timing-function:cubic-bezier(.16,1,.3,1)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.ring-inset{--tw-ring-inset:inset}@media (hover:hover){.group-hover\\:block:is(:where(.group):hover *){display:block}.group-hover\\:hidden:is(:where(.group):hover *){display:none}.group-hover\\:bg-popover:is(:where(.group):hover *){background-color:var(--popover)}.group-hover\\:text-foreground:is(:where(.group):hover *){color:var(--foreground)}.group-hover\\:opacity-100:is(:where(.group):hover *),.group-hover\\/th\\:opacity-100:is(:where(.group\\/th):hover *){opacity:1}}.selection\\:bg-brand\\/40 ::selection{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.selection\\:bg-brand\\/40 ::selection{background-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.selection\\:bg-brand\\/40::selection{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.selection\\:bg-brand\\/40::selection{background-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.placeholder\\:text-muted-foreground\\/60::placeholder{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.placeholder\\:text-muted-foreground\\/60::placeholder{color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.first\\:pt-0:first-child{padding-top:0}.first\\:pt-2:first-child{padding-top:calc(var(--spacing) * 2)}.last\\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}.last\\:border-r-0:last-child{border-right-style:var(--tw-border-style);border-right-width:0}.last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.focus-within\\:border-brand:focus-within{border-color:var(--brand)}.focus-within\\:border-input:focus-within{border-color:var(--input)}@media (hover:hover){.hover\\:border-border:hover{border-color:var(--border)}.hover\\:border-foreground:hover{border-color:var(--foreground)}.hover\\:border-muted-foreground:hover,.hover\\:border-muted-foreground\\/60:hover{border-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.hover\\:border-muted-foreground\\/60:hover{border-color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.hover\\:border-warning:hover{border-color:var(--warning)}.hover\\:bg-accent:hover,.hover\\:bg-accent\\/30:hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-accent\\/30:hover{background-color:color-mix(in oklab, var(--accent) 30%, transparent)}}.hover\\:bg-accent\\/40:hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-accent\\/40:hover{background-color:color-mix(in oklab, var(--accent) 40%, transparent)}}.hover\\:bg-accent\\/50:hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-accent\\/50:hover{background-color:color-mix(in oklab, var(--accent) 50%, transparent)}}.hover\\:bg-accent\\/60:hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-accent\\/60:hover{background-color:color-mix(in oklab, var(--accent) 60%, transparent)}}.hover\\:bg-brand\\/40:hover{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-brand\\/40:hover{background-color:color-mix(in oklab, var(--brand) 40%, transparent)}}.hover\\:bg-brand\\/50:hover{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-brand\\/50:hover{background-color:color-mix(in oklab, var(--brand) 50%, transparent)}}.hover\\:bg-destructive\\/10:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-destructive\\/10:hover{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.hover\\:bg-destructive\\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab, var(--destructive) 90%, transparent)}}.hover\\:bg-muted:hover{background-color:var(--muted)}.hover\\:bg-primary\\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.hover\\:bg-warning\\/15:hover{background-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-warning\\/15:hover{background-color:color-mix(in oklab, var(--warning) 15%, transparent)}}.hover\\:text-brand:hover{color:var(--brand)}.hover\\:text-destructive:hover{color:var(--destructive)}.hover\\:text-foreground:hover,.hover\\:text-foreground\\/80:hover{color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.hover\\:text-foreground\\/80:hover{color:color-mix(in oklab, var(--foreground) 80%, transparent)}}.hover\\:text-muted-foreground:hover{color:var(--muted-foreground)}.hover\\:text-primary-foreground:hover{color:var(--primary-foreground)}.hover\\:underline:hover{text-decoration-line:underline}}.focus\\:border-brand:focus{border-color:var(--brand)}.focus\\:border-muted-foreground:focus{border-color:var(--muted-foreground)}.focus\\:bg-accent:focus{background-color:var(--accent)}.focus\\:opacity-100:focus{opacity:1}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:opacity-100:focus-visible{opacity:1}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-brand\\/60:active{background-color:var(--brand)}@supports (color:color-mix(in lab, red, red)){.active\\:bg-brand\\/60:active{background-color:color-mix(in oklab, var(--brand) 60%, transparent)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:opacity-50:disabled{opacity:.5}.data-disabled\\:pointer-events-none[data-disabled]{pointer-events:none}.data-disabled\\:opacity-40[data-disabled]{opacity:.4}.data-highlighted\\:bg-accent[data-highlighted]{background-color:var(--accent)}.data-placeholder\\:text-muted-foreground\\/60[data-placeholder]{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.data-placeholder\\:text-muted-foreground\\/60[data-placeholder]{color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.data-\\[highlighted\\]\\:bg-accent[data-highlighted]{background-color:var(--accent)}.data-\\[highlighted\\]\\:bg-destructive\\/10[data-highlighted]{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.data-\\[highlighted\\]\\:bg-destructive\\/10[data-highlighted]{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.data-\\[state\\=closed\\]\\:animate-\\[fade-out_\\.2s_ease-in\\][data-state=closed]{animation:.2s ease-in fade-out}.data-\\[state\\=closed\\]\\:animate-\\[sheet-out_\\.2s_ease-in\\][data-state=closed]{animation:.2s ease-in sheet-out}.data-\\[state\\=open\\]\\:block[data-state=open]{display:block}.data-\\[state\\=open\\]\\:animate-\\[fade-in_\\.15s_ease-out\\][data-state=open]{animation:.15s ease-out fade-in}.data-\\[state\\=open\\]\\:animate-\\[sheet-in_\\.25s_cubic-bezier\\(0\\.16\\,1\\,0\\.3\\,1\\)\\][data-state=open]{animation:.25s cubic-bezier(.16,1,.3,1) sheet-in}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\\[state\\=open\\]\\:bg-muted[data-state=open]{background-color:var(--muted)}.data-\\[state\\=open\\]\\:text-foreground[data-state=open]{color:var(--foreground)}.data-\\[state\\=open\\]\\:opacity-100[data-state=open]{opacity:1}@media (width>=40rem){.sm\\:flex{display:flex}.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\\:flex-row{flex-direction:row}.sm\\:items-start{align-items:flex-start}.sm\\:gap-10{gap:calc(var(--spacing) * 10)}}@media (width>=64rem){.lg\\:flex{display:flex}.lg\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\\[\\&\\:\\:-webkit-inner-spin-button\\]\\:appearance-none::-webkit-inner-spin-button{appearance:none}.\\[\\&\\:\\:-webkit-scrollbar\\]\\:hidden::-webkit-scrollbar{display:none}}:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--background:#fafafa;--foreground:#171717;--card:#fff;--card-foreground:#171717;--popover:#fff;--popover-foreground:#171717;--sidebar:#f4f4f5;--sidebar-foreground:#52525b;--primary:#059669;--primary-foreground:#fff;--brand:#059669;--secondary:#f4f4f5;--muted:#e4e4e7;--muted-foreground:#52525b;--accent:#e8e8ea;--accent-foreground:#171717;--destructive:#dc2626;--destructive-foreground:#fff;--warning:#b45309;--info:#2563eb;--border:#e4e4e7;--input:#d4d4d8;--field:#fff;--code:#f4f4f5;--selected:#d7f0e4;--ring:#059669;--radius:.5rem}.dark{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--background:#1c1c1c;--foreground:#ededed;--card:#191919;--card-foreground:#ededed;--popover:#232323;--popover-foreground:#d4d4d4;--sidebar:#171717;--sidebar-foreground:#a3a3a3;--primary:#059669;--primary-foreground:#fff;--brand:#3ecf8e;--secondary:#171717;--muted:#404040;--muted-foreground:#a3a3a3;--accent:#262626;--accent-foreground:#ededed;--destructive:#ef4444;--destructive-foreground:#fff;--warning:#fbbf24;--info:#60a5fa;--border:#262626;--input:#404040;--field:#171717;--code:#141414;--selected:#12271c;--ring:#3ecf8e}@keyframes sheet-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes sheet-out{0%{transform:translate(0)}to{transform:translate(100%)}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-out{0%{opacity:1}to{opacity:0}}.ace_editor{background:0 0!important;line-height:1.6!important}.ace_editor .ace_gutter{color:var(--muted-foreground);background:0 0!important}@supports (color:color-mix(in lab, red, red)){.ace_editor .ace_gutter{color:color-mix(in oklab, var(--muted-foreground) 70%, transparent)}}.ace_editor .ace_gutter-active-line{background:var(--accent)!important}@supports (color:color-mix(in lab, red, red)){.ace_editor .ace_gutter-active-line{background:color-mix(in oklab, var(--accent) 60%, transparent)!important}}.ace_editor .ace_active-line{background:var(--accent)!important}@supports (color:color-mix(in lab, red, red)){.ace_editor .ace_active-line{background:color-mix(in oklab, var(--accent) 50%, transparent)!important}}.ace_editor .ace_selection{background:var(--brand)!important}@supports (color:color-mix(in lab, red, red)){.ace_editor .ace_selection{background:color-mix(in oklab, var(--brand) 22%, transparent)!important}}.ace_editor .ace_cursor{color:var(--foreground)}.ace_placeholder{color:var(--muted-foreground)!important}@supports (color:color-mix(in lab, red, red)){.ace_placeholder{color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)!important}}.ace_placeholder{padding:0!important;font-family:inherit!important}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--muted);border:2px solid var(--background);border-radius:6px}::-webkit-scrollbar-thumb:hover{background:var(--muted-foreground)}@property --tw-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\"*\";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:\"*\";inherits:false}@property --tw-rotate-y{syntax:\"*\";inherits:false}@property --tw-rotate-z{syntax:\"*\";inherits:false}@property --tw-skew-x{syntax:\"*\";inherits:false}@property --tw-skew-y{syntax:\"*\";inherits:false}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-tracking{syntax:\"*\";inherits:false}@property --tw-ordinal{syntax:\"*\";inherits:false}@property --tw-slashed-zero{syntax:\"*\";inherits:false}@property --tw-numeric-figure{syntax:\"*\";inherits:false}@property --tw-numeric-spacing{syntax:\"*\";inherits:false}@property --tw-numeric-fraction{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-blur{syntax:\"*\";inherits:false}@property --tw-brightness{syntax:\"*\";inherits:false}@property --tw-contrast{syntax:\"*\";inherits:false}@property --tw-grayscale{syntax:\"*\";inherits:false}@property --tw-hue-rotate{syntax:\"*\";inherits:false}@property --tw-invert{syntax:\"*\";inherits:false}@property --tw-opacity{syntax:\"*\";inherits:false}@property --tw-saturate{syntax:\"*\";inherits:false}@property --tw-sepia{syntax:\"*\";inherits:false}@property --tw-drop-shadow{syntax:\"*\";inherits:false}@property --tw-drop-shadow-color{syntax:\"*\";inherits:false}@property --tw-drop-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:\"*\";inherits:false}@property --tw-backdrop-blur{syntax:\"*\";inherits:false}@property --tw-backdrop-brightness{syntax:\"*\";inherits:false}@property --tw-backdrop-contrast{syntax:\"*\";inherits:false}@property --tw-backdrop-grayscale{syntax:\"*\";inherits:false}@property --tw-backdrop-hue-rotate{syntax:\"*\";inherits:false}@property --tw-backdrop-invert{syntax:\"*\";inherits:false}@property --tw-backdrop-opacity{syntax:\"*\";inherits:false}@property --tw-backdrop-saturate{syntax:\"*\";inherits:false}@property --tw-backdrop-sepia{syntax:\"*\";inherits:false}@property --tw-duration{syntax:\"*\";inherits:false}@property --tw-ease{syntax:\"*\";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}\n/*$vite$:1*/</style>\n </head>\n <body>\n <div id=\"root\"></div>\n </body>\n</html>\n";