@reventlessdev/reventless-host-shell 3.0.0-alpha.47 → 3.0.0-alpha.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,117 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GraphMode.res-D0J0rkKK.js","assets/MapMode.res-CrBcjDXG.js","assets/Geocoder.res-Vw1kD7XX.js","assets/index-BnuMdAWP.js"])))=>i.map(i=>d[i]);
2
- import"./virtualExposes-DN39MDG_.js";import{d as hD}from"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__reventless_host_shell__remoteEntry-_hash_-dsc9aHJC.js";import{_ as x0}from"./preload-helper-BlTxHScW.js";import{_ as t9}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-BzAfciYp.js";import{_ as M,a as b,b as qr}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-hre-5-8f.js";import{a as oe,b as Re,c as mr,d as Ar,e as Ut,f as Jr,g as Je,h as Lt,i as ax,j as r9,k as pD,l as Vi,m as n9,n as i9,o as o9,p as s9}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs-CuHP-S1B.js";import{c as H0,_ as St}from"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react__loadShare__.mjs_commonjs-proxy-CfkhEoF5.js";function a9(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}import{a as _p,b as l9}from"./_virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs-Df1FMNLk.js";import"./__virtual_mf___mfe_internal__reventless_host_shell__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-BUE6rcGI.js";function u9(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(n,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();function pr(e){return e===void 0?{BS_PRIVATE_NESTED_SOME_NONE:0}:e!==null&&e.BS_PRIVATE_NESTED_SOME_NONE!==void 0?{BS_PRIVATE_NESTED_SOME_NONE:e.BS_PRIVATE_NESTED_SOME_NONE+1|0}:e}function ms(e){if(e!=null)return pr(e)}function ir(e){if(e===null||e.BS_PRIVATE_NESTED_SOME_NONE===void 0)return e;let t=e.BS_PRIVATE_NESTED_SOME_NONE;if(t!==0)return{BS_PRIVATE_NESTED_SOME_NONE:t-1|0}}let Yg="JsExn";function c9(e){if(e.RE_EXN_ID===Yg)return pr(e._1)}function d9(e){return e==null?!1:typeof e.RE_EXN_ID=="string"}function Su(e){return d9(e)?e:{RE_EXN_ID:"JsExn",_1:e}}let f9=["map","graph"];async function h9(e,t){switch(e){case"graph":return(await x0(()=>import("./GraphMode.res-D0J0rkKK.js"),__vite__mapDeps([0])).then(s=>s.init))(t.graphLayout,void 0);case"map":let n=await x0(()=>import("./MapMode.res-CrBcjDXG.js"),__vite__mapDeps([1])).then(s=>s.init),i=t.geocoderEndpoint,o;return i!==void 0?o=(await x0(()=>import("./Geocoder.res-Vw1kD7XX.js"),__vite__mapDeps([2])).then(a=>a.fromEndpoint))(i):o=void 0,n(t.mapStyle,o,void 0);default:console.error('[host-shell] config.json viewModes: unknown mode "'+e+'" — known modes: '+f9.join(", "));return}}async function p9(e){await Promise.all(e.viewModes.map(async t=>{try{return await h9(t,e)}catch(r){let n=Su(r);if(n.RE_EXN_ID===Yg){console.error('[host-shell] view mode "'+t+'" failed to load: '+String(n._1));return}throw n}}))}function g9(e){if(typeof Event=="function")return new Event(e);let t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function T2(e){switch(e){case"":case"/":return 0;default:let t=e.slice(1),n=t[t.length-1|0]==="/"?t.slice(0,-1):t,i=n.split("?",2),s=(i.length!==2?n:i[0]).split("/").filter(u=>u.length!==0),a=s.length-1|0,l=0;for(;;){let u=l,d=a;if(d<0)return u;l={hd:s[d],tl:u},a=d-1|0}}}function m9(e,t){let r=globalThis.window;return e!==void 0?T2(e):r!==void 0?T2(ir(r).location.pathname):0}function v9(){let e=globalThis.window;if(e===void 0)return"";let t=ir(e).location.hash;switch(t){case"":case"#":return"";default:return t.slice(1)}}function $2(e){switch(e){case"":case"?":return"";default:let t=e.split("?",2);return t.length!==2?"":t[1]}}function _9(e,t){let r=globalThis.window;return e!==void 0?$2(e):r!==void 0?$2(ir(r).location.search):""}function Oc(e){let t=globalThis.history,r=globalThis.window;if(t!==void 0&&r!==void 0){ir(t).pushState(null,"",e),ir(r).dispatchEvent(g9("popstate"));return}}function b9(e,t){if(e.hash!==t.hash||e.search!==t.search)return!0;{let r=e.path,n=t.path;for(;;){let i=n,o=r;if(o===0)return i!==0;if(i===0||o.hd!==i.hd)return!0;n=i.tl,r=o.tl}}}function ay(e,t){return{path:m9(e),hash:v9(),search:_9(e)}}function y9(e){let t=globalThis.window;if(t===void 0)return()=>{};let r=()=>e(ay(void 0));return ir(t).addEventListener("popstate",r),r}function x9(e){let t=globalThis.window;if(t!==void 0){ir(t).removeEventListener("popstate",e);return}}function S9(e,t){let r=oe(()=>ay(void 0)),n=r[1],i=r[0];return Re(()=>{let o=y9(a=>n(l=>a)),s=ay(void 0);return b9(s,i)&&n(a=>s),()=>x9(o)},[]),i}let Xg=mr({prefix:"",path:""}),E9=Xg.Provider;function w9(e){return Ar(E9,{value:e.value,children:e.children})}let k9=w9;function ly(){let e=globalThis.window;return e!==void 0?ir(e).location.pathname:""}function C9(e){let t=globalThis.window;if(t===void 0)return()=>{};let r=()=>e(ly());return ir(t).addEventListener("popstate",r),r}function Zg(e,t){let r=oe(()=>ly()),n=r[1],i=r[0];return Re(()=>{let o=C9(a=>n(l=>a)),s=ly();return s!==i&&n(a=>s),()=>{let a=globalThis.window;if(a!==void 0){ir(a).removeEventListener("popstate",o);return}}},[]),i}function dl(){let t=Ut(Xg).prefix;return r=>t===""||r.startsWith(t)?Oc(r):Oc(t+r)}function R9(){let t=Ut(Xg).path,r=Zg();return t===""?r:t}function ie(e,t){if(e!==void 0)return t(ir(e))}function fe(e,t,r){return e!==void 0?r(ir(e)):t}function W(e,t){if(e!==void 0)return pr(t(ir(e)))}function T(e,t){if(e!==void 0)return t(ir(e))}function D(e,t){return e!==void 0?ir(e):t}function gD(e,t){return e!==void 0?e:t}function We(e){return e!==void 0}function no(e){return e===void 0}function qt(e,t){return e.catch(r=>t(Su(r)))}function lx(e,t){return e<t?-1:e===t?0:1}function Oo(e,t){if(t===0)throw{RE_EXN_ID:"Division_by_zero",Error:new Error};return e%t}function mD(e,t){if(e<=0)return[];let r=new Array(e);return r.fill(t),r}function Ja(e,t){if(e<=0)return[];let r=new Array(e);for(let n=0;n<e;++n)r[n]=t(n);return r}function lt(e,t,r){return e.reduce(r,t)}function A9(e,t){let r=e.findIndex(t);if(r!==-1)return r}function se(e,t){let r=e.length,n=new Array(r),i=0;for(let o=0;o<r;++o){let s=e[o],a=t(s);a!==void 0&&(n[i]=ir(a),i=i+1|0)}return n.length=i,n}function vD(e,t){let r=e.length,n=new Array(r),i=0;for(let o=0;o<r;++o){let s=e[o],a=t(s,o);a!==void 0&&(n[i]=ir(a),i=i+1|0)}return n.length=i,n}function T9(e,t){let r=0;for(;;){let n=r;if(n===e.length)return;let i=t(e[n]);if(i!==void 0)return i;r=n+1|0}}function _D(e,t){let r=parseInt(e);if(!(Number.isNaN(r)||r>2147483647||r<-2147483648))return r|0}function $9(e,t){for(;;){let r=t,n=e;if(n===0)return r;let i={hd:n.hd,tl:0};r.tl=i,t=i,e=n.tl}}function N9(e,t){if(e===0)return t;let r={hd:e.hd,tl:0};return $9(e.tl,r).tl=t,r}function D9(e){let t=e,r=0;for(;;){let n=r,i=t;if(i===0)return n;r=n+1|0,t=i.tl}}function F9(e,t,r){for(;;){let n=r,i=t;if(n===0)return;e[i]=n.hd,r=n.tl,t=i+1|0}}function ux(e){let t=e.length-1|0,r=0;for(;;){let n=r,i=t;if(i<0)return n;r={hd:e[i],tl:n},t=i-1|0}}function cx(e){let t=D9(e),r=new Array(t);return F9(r,0,e),r}function I9(e,t){for(;;){let r=t,n=e;if(n===0)return r;t={hd:n.hd,tl:r},e=n.tl}}function bD(e){return I9(e,0)}function P9(e,t){for(;;){let r=e;if(r===0)return;t(r.hd),e=r.tl}}function yD(e,t,r){for(;;){let n=t,i=e;if(i===0)return n;t=r(n,i.hd),e=i.tl}}function O9(e){let t=e.length,r=0;for(let i=0;i<t;++i)r=r+e[i].length|0;let n=new Array(r);r=0;for(let i=0;i<t;++i){let o=e[i];for(let s=0,a=o.length;s<a;++s)n[r]=o[s],r=r+1|0}return n}function M9(e,t,r){let n=t;for(let i=0,o=e.length;i<o;++i)n=r(n,e[i]);return n}let xD=M9;function cc(e){return e!==void 0?e.h:0}function Yo(e,t,r,n){let i=cc(e),o=cc(n);return{k:t,v:r,h:i>=o?i+1|0:o+1|0,l:e,r:n}}function L9(e,t){return{k:e,v:t,h:1,l:void 0,r:void 0}}function z9(e,t){return e.v===t?e:{k:e.k,v:t,h:e.h,l:e.l,r:e.r}}function N2(e,t,r,n){let i=e!==void 0?e.h:0,o=n!==void 0?n.h:0;if(i>(o+2|0)){let l=e.l,u=e.r;return cc(l)>=cc(u)?Yo(l,e.k,e.v,Yo(u,t,r,n)):Yo(Yo(l,e.k,e.v,u.l),u.k,u.v,Yo(u.r,t,r,n))}if(o<=(i+2|0))return{k:t,v:r,h:i>=o?i+1|0:o+1|0,l:e,r:n};let s=n.l,a=n.r;return cc(a)>=cc(s)?Yo(Yo(e,t,r,s),n.k,n.v,a):Yo(Yo(e,t,r,s.l),s.k,s.v,Yo(s.r,n.k,n.v,a))}function zf(e,t){return e===t?0:e<t?-1:1}function U9(e,t){for(;;){let r=e;if(r===void 0)return;let n=r.k;if(t===n)return pr(r.v);e=t<n?r.l:r.r}}function uy(e,t,r){if(e===void 0)return L9(t,r);let n=e.k;if(t===n)return z9(e,r);let i=e.v;return t<n?N2(uy(e.l,t,r),n,i,e.r):N2(e.l,n,i,uy(e.r,t,r))}let SD=U9;function ED(e){let t=n=>{switch(n){case"":case"/":return 0;default:let i=ux(n.split("/"));return i!==0&&i.hd===""?i.tl:i}},r=e.indexOf("?");return r===-1?t(e):r===0?0:t(e.slice(0,r))}let cy={parsers:0,children:void 0,capture:void 0,wildcard:!1};function B9(e,t){let r=e,n=t;for(;;){let i=n,o=r,s=o.parsers,a=0;if(s!==0)a=1;else{if(i===0)return 0;a=1}if(a===1){let l=o.capture,u=0;if(i===0)return s;if(i.hd===""){if(i.tl===0)return s;u=2}else u=2;if(u===2){if(o.wildcard)return s;let d=i.tl,f=SD(o.children,i.hd);if(f!==void 0){n=d,r=f;continue}if(l===void 0)return 0;n=d,r=l;continue}}}}function j9(e,t,r){let n=(i,o)=>{if(i===0)return{parsers:{hd:t,tl:o.parsers},children:o.children,capture:o.capture,wildcard:o.wildcard};let s=o.capture,a=o.children,l=i.tl,u=i.hd;if(typeof u!="object"){if(u!=="Capture")return{parsers:{hd:t,tl:o.parsers},children:o.children,capture:o.capture,wildcard:!0};let f=n(l,s!==void 0?s:cy);return{parsers:o.parsers,children:o.children,capture:f,wildcard:o.wildcard}}else{let d=u._0,f=SD(a,d),p=n(l,f!==void 0?f:cy);return{parsers:o.parsers,children:uy(a,d,p),capture:o.capture,wildcard:o.wildcard}}};return n(e,r)}function q9(e){return{prefix:0,matched:ED(e)}}function V9(e){return cx({hd:"",tl:e.matched}).join("/")}function K9(e){return cx({hd:"",tl:e.prefix}).join("/")}function H9(e,t){return{TAG:"Route",_0:e,_1:t,_2:r=>r}}function W0(e,t){return{TAG:"Match",_0:e,_1:t}}function dy(e){return typeof e!="object"?e==="End"?0:{hd:"Wildcard",tl:0}:e.TAG==="Match"?{hd:{TAG:"Match",_0:e._0},tl:dy(e._1)}:{hd:"Capture",tl:dy(e._1)}}function W9(e,t){let r=i=>e("/"+cx(i).join("/")),n=(i,o)=>{for(;;){let s=o,a=i;if(typeof s!="object")return s==="End"?a(0):d=>a(N9(d.matched,0));if(s.TAG==="Match"){let d=s._0;o=s._1,i=f=>a({hd:d,tl:f});continue}let l=s._1,u=s._0.to_;return d=>n(f=>a({hd:u(d),tl:f}),l)}};return n(r,t)}function G9(e){return W9(t=>t,e)}function J9(e,t,r){let n=e,i=t,o=0,s=r;for(;;){let a=s,l=o,u=i,d=n;if(typeof d!="object")return d==="End"?a!==0?a.hd===""&&a.tl===0?{TAG:"MatchWithTrailingSlash",_0:u}:"NoMatch":{TAG:"FullMatch",_0:u}:{TAG:"FullMatch",_0:u({prefix:bD(l),matched:a})};if(d.TAG==="Match"){if(a===0)return"NoMatch";let p=a.hd;if(d._0!==p)return"NoMatch";s=a.tl,o={hd:p,tl:l},n=d._1;continue}if(a===0)return"NoMatch";let f=a.hd,h=d._0.from_(f);if(h===void 0)return"NoMatch";s=a.tl,o={hd:f,tl:l},i=u(ir(h)),n=d._1}}function Q9(e){let t=bD(e);return yD(t,cy,(r,n)=>{let i=dy(n._0);return j9(i,n,r)})}function Y9(e,t){let r=ED(t),i=B9(e,r);for(;;){let o=i;if(o===0)return"NoMatch";let s=o.hd,a=s._2,l=J9(s._0,s._1,r);if(typeof l=="object")return l.TAG==="FullMatch"?{TAG:"FullMatch",_0:a(l._0)}:{TAG:"MatchWithTrailingSlash",_0:a(l._0)};i=o.tl}}function X9(e,t){let r=Y9(e,t);if(typeof r=="object")return pr(r._0)}function wD(e){return e("End")}let kD={prefix:K9,wildcard_match:V9,of_parts:q9},Z9="Wildcard",zs=G9,ec=H9;function tu(){return{}}let CD=mr({});function e7(e,t){return e+("."+t)}function t7(e,t,r,n){return e[e7(t,r)]=zs(n),e}function fy(e,t){return Object.assign(Object.assign({},e),t)}function em(){return Ut(CD)}let r7=CD.Provider;function n7(e){return Ar(r7,{value:e.registry,children:e.children})}let i7={make:n7},RD={contents:{}};function o7(e){RD.contents=e}function s7(e){let t=e.startsWith("/")?e.slice(1):e,r=t.indexOf("/");if(r!==-1)return t.slice(0,r)}function Mc(e){if(e.startsWith("http://")||e.startsWith("https://"))return e;let t=s7(e);if(t===void 0)return e;let r=RD.contents[t];if(r===void 0)return e;let n=e.startsWith("/")?e:"/"+e;return(r.endsWith("/")?r.slice(0,r.length-1|0):r)+n}function a7(e){if(typeof e=="boolean")return e}function l7(e){if(e===null)return null}function u7(e){if(typeof e=="string")return e}function c7(e){if(typeof e=="number")return e}function d7(e){if(typeof e=="object"&&e!==null&&!Array.isArray(e))return e}function f7(e){if(Array.isArray(e))return e}let ge={bool:a7,$$null:l7,string:u7,float:c7,object:d7,array:f7};function O(e,t){if(t in e)return pr(e[t])}function et(e){let t=Object.keys(e),r=t.length,n=new Array(r);for(let i=0;i<r;++i){let o=t[i];n[i]=[o,e[o]]}return n}function AD(e){let t=Object.keys(e),r=t.length,n=new Array(r);for(let i=0;i<r;++i)n[i]=e[t[i]];return n}function bt(e){let t={},r=e.length;for(let n=0;n<r;++n){let i=e[n];t[i[0]]=i[1]}return t}function nt(e){let t=typeof e;return t==="string"?{TAG:"JSONString",_0:e}:t==="number"?{TAG:"JSONNumber",_0:e}:t==="boolean"?e===!0?"JSONTrue":"JSONFalse":e===null?"JSONNull":Array.isArray(e)?{TAG:"JSONArray",_0:e}:{TAG:"JSONObject",_0:e}}function ce(e){if(typeof e=="string")return e}function vs(e){if(typeof e=="number")return e}function K(e){if(typeof e=="object"&&!Array.isArray(e)&&e!==null)return e}function Vt(e){if(Array.isArray(e))return e}function TD(e){if(typeof e=="boolean")return e}let D2=(function(e,t){for(var r in e)t(r)});function ot(e,t){if(e===t)return!0;let r=typeof e;if(r==="string"||r==="number"||r==="bigint"||r==="boolean"||r==="undefined"||e===null)return!1;let n=typeof t;if(r==="function"||n==="function")throw{RE_EXN_ID:"Invalid_argument",_1:"equal: functional value",Error:new Error};if(n==="number"||n==="bigint"||n==="undefined"||t===null)return!1;let i=e.TAG,o=t.TAG;if(i!==o)return!1;let s=e.length|0,a=t.length|0;if(s===a)if(Array.isArray(e)){let l=0;for(;;){let u=l;if(u===s)return!0;if(!ot(e[u],t[u]))return!1;l=u+1|0}}else{if(e instanceof Date&&t instanceof Date)return!(e>t||e<t);{let l={contents:!0},u=f=>{if(!Object.prototype.hasOwnProperty.call(t,f)){l.contents=!1;return}},d=f=>{if(!Object.prototype.hasOwnProperty.call(e,f)||!ot(t[f],e[f])){l.contents=!1;return}};return D2(e,u),l.contents&&D2(t,d),l.contents}}else return!1}function Uf(e,t){return(typeof e=="number"||typeof e=="bigint")&&(typeof t=="number"||typeof t=="bigint")?e!==t:!ot(e,t)}function h7(e,t){return t.startsWith(e)}function p7(e){return e==="inherit_"?"inherit":e==="unset"?"unset":"initial"}let _n={initial:"initial",inherit_:"inherit_",unset:"unset",toString:p7};function g7(e){return{NAME:"var",VAL:e}}function m7(e,t){return{NAME:"varDefault",VAL:[e,t]}}function F2(e){return h7("--",e)?e:"--"+e}function v7(e){if(e.NAME==="var")return"var("+F2(e.VAL)+")";let t=e.VAL;return"var("+F2(t[0])+","+t[1]+")"}function _7(e){return{NAME:"s",VAL:e}}function b7(e){return{NAME:"ms",VAL:e}}function y7(e){return e.NAME==="ms"?e.VAL.toString()+"ms":e.VAL.toString()+"s"}let x7={s:_7,ms:b7,toString:y7};function S7(e){return e.VAL.toString()+"%"}function E7(e){return{NAME:"px",VAL:e}}function I2(e){if(typeof e!="object")return"0";let t=e.NAME;return t==="inch"?e.VAL.toString()+"in":t==="vmax"?e.VAL.toString()+"vmax":t==="vmin"?e.VAL.toString()+"vmin":t==="percent"?e.VAL.toString()+"%":t==="ch"?e.VAL.toString()+"ch":t==="cm"?e.VAL.toString()+"cm":t==="em"?e.VAL.toString()+"em":t==="ex"?e.VAL.toString()+"ex":t==="mm"?e.VAL.toString()+"mm":t==="pc"?e.VAL.toString()+"pc":t==="pt"?e.VAL.toString()+"pt":t==="px"?e.VAL.toString()+"px":t==="vh"?e.VAL.toString()+"vh":t==="vw"?e.VAL.toString()+"vw":t==="rem"?e.VAL.toString()+"rem":e.VAL.toString()+"px"}let w7={px:E7};function k7(e,t){return{NAME:"min",VAL:[e,t]}}function C7(e,t){return{NAME:"max",VAL:[e,t]}}function So(e){if(typeof e!="object")return I2(e);let t=e.NAME;if(t==="subtract"){let n=e.VAL;return"calc("+So(n[0])+" - "+So(n[1])+")"}if(t==="percent")return S7(e);if(t==="add"){let n=e.VAL;return"calc("+So(n[0])+" + "+So(n[1])+")"}if(t==="div"){let n=e.VAL;return"calc("+So(n[0])+" / "+n[1].toString()+")"}if(t==="max"){let n=e.VAL;return"max("+So(n[0])+", "+So(n[1])+")"}if(t==="min"){let n=e.VAL;return"min("+So(n[0])+", "+So(n[1])+")"}if(t!=="mul")return I2(e);let r=e.VAL;return"calc("+So(r[0])+" * "+r[1].toString()+")"}let Qr={min:k7,max:C7,toString:So};function R7(e){return e==="fixed"?"fixed":e==="static"?"static":e==="sticky"?"sticky":e==="relative"?"relative":"absolute"}let A7={absolute:"absolute",relative:"relative",$$static:"static",fixed:"fixed",sticky:"sticky",toString:R7};function T7(e){return e==="clip"?"clip":e==="scroll"?"scroll":e==="hidden"?"hidden":e==="visible"?"visible":"auto"}let $D={hidden:"hidden",visible:"visible",scroll:"scroll",auto:"auto",clip:"clip",toString:T7};function $7(e){return"auto"}let N7={auto:"auto",toString:$7};function D7(e,t){return{NAME:"steps",VAL:[e,t]}}function F7(e,t,r,n){return{NAME:"cubicBezier",VAL:[e,t,r,n]}}function I7(e){if(typeof e!="object")return e==="easeInOut"?"ease-in-out":e==="linear"?"linear":e==="jumpBoth"?"jump-both":e==="stepStart"?"step-start":e==="jumpNone"?"jump-none":e==="stepEnd"?"step-end":e==="easeIn"?"ease-in":e==="jumpEnd"?"jump-end":e==="jumpStart"?"jump-start":e==="easeOut"?"ease-out":"ease";if(e.NAME==="steps"){let r=e.VAL,n=r[0];return r[1]==="start"?"steps("+n.toString()+", start)":"steps("+n.toString()+", end)"}let t=e.VAL;return"cubic-bezier("+t[0].toString()+", "+t[1].toString()+", "+t[2].toString()+", "+t[3].toString()+")"}function P7(e){return e==="none"?"none":e==="circle"?"circle":e==="lowerGreek"?"lower-greek":e==="square"?"square":e==="lowerAlpha"?"lower-alpha":e==="upperAlpha"?"upper-alpha":e==="decimal"?"decimal":e==="lowerRoman"?"lower-roman":e==="lowerLatin"?"lower-latin":e==="upperRoman"?"upper-roman":e==="upperLatin"?"upper-latin":"disc"}let O7={toString:P7};function M7(e){return typeof e=="object"?e.VAL.toString():"infinite"}let L7={toString:M7};function z7(e){return e==="cell"?"cell":e==="copy"?"copy":e==="swResize"?"sw-resize":e==="grab"?"grab":e==="help"?"help":e==="move"?"move":e==="none"?"none":e==="text"?"text":e==="rowResize"?"row-resize":e==="wait"?"wait":e==="pointer"?"pointer":e==="seResize"?"se-resize":e==="zoomOut"?"zoom-out":e==="sResize"?"s-resize":e==="zoomIn"?"zoom-in":e==="grabbing"?"grabbing":e==="nsResize"?"ns-resize":e==="nwseResize"?"nwse-resize":e==="progress"?"progress":e==="crosshair"?"crosshair":e==="wResize"?"w-resize":e==="noDrop"?"no-drop":e==="allScroll"?"all-scroll":e==="verticalText"?"vertical-text":e==="nResize"?"n-resize":e==="default"?"default":e==="neswResize"?"nesw-resize":e==="alias"?"alias":e==="ewResize"?"ew-resize":e==="eResize"?"e-resize":e==="nwResize"?"nw-resize":e==="contextMenu"?"context-menu":e==="colResize"?"col-resize":e==="notAllowed"?"not-allowed":e==="neResize"?"ne-resize":"auto"}let U7={auto:"auto",$$default:"default",none:"none",contextMenu:"contextMenu",help:"help",pointer:"pointer",progress:"progress",wait:"wait",cell:"cell",crosshair:"crosshair",text:"text",verticalText:"verticalText",alias:"alias",copy:"copy",move:"move",noDrop:"noDrop",notAllowed:"notAllowed",grab:"grab",grabbing:"grabbing",allScroll:"allScroll",colResize:"colResize",rowResize:"rowResize",nResize:"nResize",eResize:"eResize",sResize:"sResize",wResize:"wResize",neResize:"neResize",nwResize:"nwResize",seResize:"seResize",swResize:"swResize",ewResize:"ewResize",nsResize:"nsResize",neswResize:"neswResize",nwseResize:"nwseResize",zoomIn:"zoomIn",zoomOut:"zoomOut",toString:z7};function B7(e){return e==="inline"?"inline":e==="block"?"block":"run-in"}let j7={toString:B7};function q7(e){return e==="grid"?"grid":e==="table"?"table":"flex"}let V7={toString:q7};function K7(e){return"list-item"}let H7={toString:K7};function W7(e){return e==="tableRow"?"table-row":e==="tableRowGroup"?"table-row-group":e==="tableColumn"?"table-column":e==="tableHeaderGroup"?"table-header-group":e==="tableCell"?"table-cell":e==="tableColumnGroup"?"table-column-group":e==="tableCaption"?"table-caption":"table-footer-group"}let G7={toString:W7};function J7(e){return e==="contents"?"contents":"none"}let Q7={toString:J7};function Y7(e){return e==="inlineBlock"?"inline-block":e==="inlineFlex"?"inline-flex":e==="inlineGrid"?"inline-grid":"inline-table"}let X7={toString:Y7};function Z7(e){return e==="left"?"left":e==="right"?"right":e==="selfEnd"?"self-end":e==="start"?"start":e==="center"?"center":e==="flexStart"?"flex-start":e==="flexEnd"?"flex-end":e==="selfStart"?"self-start":"end"}let dx={toString:Z7};function eU(e){return e==="firstBaseline"?"first baseline":e==="baseline"?"baseline":"last baseline"}let ND={toString:eU};function tU(e){return"normal"}let rU={toString:tU};function nU(e){return e==="spaceAround"?"space-around":e==="stretch"?"stretch":e==="spaceBetween"?"space-between":"space-evenly"}let iU={toString:nU};function oU(e){return e==="right"?"right":e==="justify"?"justify":e==="start"?"start":e==="center"?"center":"left"}let sU={toString:oU};function aU(e){return e==="normal"?"normal":"stretch"}let lU={toString:aU};function uU(e){return e==="stretch"?"stretch":e==="normal"?"normal":"auto"}let cU={toString:uU};function dU(e){return e==="wrapReverse"?"wrap-reverse":e==="nowrap"?"nowrap":"wrap"}let fU={toString:dU};function hU(e){return e==="row"?"row":e==="columnReverse"?"column-reverse":e==="rowReverse"?"row-reverse":"column"}let pU={toString:hU};function gU(e){return e==="none"?"none":e==="text"?"text":e==="all"?"all":e==="contain"?"contain":"auto"}let mU={toString:gU};function vU(e){return e==="minContent"?"min-content":e==="fitContent"?"fit-content":e==="maxContent"?"max-content":"auto"}let fx={toString:vU};function _U(e){return"none"}let tm={toString:_U};function bU(e){return e==="minContent"?"min-content":e==="fitContent"?"fit-content":e==="maxContent"?"max-content":"auto"}let hx={toString:bU},bn={$$var:g7,varDefault:m7,toString:v7},yU={linear:"linear",ease:"ease",easeIn:"easeIn",easeOut:"easeOut",easeInOut:"easeInOut",stepStart:"stepStart",stepEnd:"stepEnd",steps:D7,cubicBezier:F7,jumpStart:"jumpStart",jumpEnd:"jumpEnd",jumpNone:"jumpNone",jumpBoth:"jumpBoth",toString:I7},xU=tm,SU=tm,EU=tm,wU=tm;function kU(e,t){switch(t.TAG){case"D":let r=t._1,n=t._0;n==="content"?e[n]=r===""?'""':r:e[n]=r;break;case"S":e[t._0]=Bl(t._1);break;case"PseudoClass":e[":"+t._0]=Bl(t._1);break;case"PseudoClassParam":e[":"+(t._0+("("+(t._1+")")))]=Bl(t._2);break}return e}function Bl(e){return xD(e,{},kU)}function CU(e){let t=p=>e.injectRaw(p),r=(p,g)=>e.renderRaw(p,g),n=(p,g)=>e.injectRules(p,Bl(g)),i=(p,g,m)=>e.renderRules(p,g,Bl(m)),o=p=>e.make(Bl(p)),s=p=>e.mergeStyles(p),a=(p,g)=>e.mergeStyles([p,g]),l=(p,g,m)=>e.mergeStyles([p,g,m]),u=(p,g,m,v)=>e.mergeStyles([p,g,m,v]),d=p=>xD(p,{},(g,m)=>(g[m[0].toString()+"%"]=Bl(m[1]),g));return{insertRule:t,renderRule:r,global:n,renderGlobal:i,style:o,merge:s,merge2:a,merge3:l,merge4:u,keyframes:p=>e.makeKeyframes(d(p)),renderKeyframes:(p,g)=>e.renderKeyframes(p,d(g))}}function rm(e){if(typeof e!="object")return e==="unset"||e==="inherit_"||e==="initial"?_n.toString(e):e==="zero"?Qr.toString(e):"auto";let t=e.NAME;return t==="var"||t==="varDefault"?bn.toString(e):Qr.toString(e)}function RU(e){return{TAG:"D",_0:"alignItems",_1:typeof e=="object"?bn.toString(e):e==="unset"||e==="inherit_"||e==="initial"?_n.toString(e):e==="baseline"||e==="firstBaseline"||e==="lastBaseline"?ND.toString(e):e==="normal"||e==="stretch"?lU.toString(e):dx.toString(e)}}function AU(e){return{TAG:"D",_0:"alignSelf",_1:typeof e=="object"?bn.toString(e):e==="selfStart"||e==="flexEnd"||e==="flexStart"||e==="center"||e==="start"||e==="selfEnd"||e==="right"||e==="left"||e==="end_"?dx.toString(e):e==="unset"||e==="inherit_"||e==="initial"?_n.toString(e):e==="baseline"||e==="firstBaseline"||e==="lastBaseline"?ND.toString(e):cU.toString(e)}}function TU(e){return{TAG:"D",_0:"animationDuration",_1:x7.toString(e)}}function $U(e){return{TAG:"D",_0:"animationIterationCount",_1:L7.toString(e)}}function NU(e){return{TAG:"D",_0:"animationTimingFunction",_1:yU.toString(e)}}function DU(e){return{TAG:"D",_0:"bottom",_1:rm(e)}}function FU(e){return{TAG:"D",_0:"cursor",_1:U7.toString(e)}}function IU(e){return{TAG:"D",_0:"display",_1:typeof e=="object"?bn.toString(e):e==="table"||e==="grid"||e==="flex"?V7.toString(e):e==="contents"||e==="none"?Q7.toString(e):e==="unset"||e==="inherit_"||e==="initial"?_n.toString(e):e==="inlineGrid"||e==="inlineFlex"||e==="inlineBlock"||e==="inlineTable"?X7.toString(e):e==="block"||e==="inline"||e==="runIn"?j7.toString(e):e==="listItem"?H7.toString(e):G7.toString(e)}}function PU(e){return{TAG:"D",_0:"flexDirection",_1:typeof e=="object"?bn.toString(e):e==="unset"||e==="inherit_"||e==="initial"?_n.toString(e):pU.toString(e)}}function OU(e){return{TAG:"D",_0:"flexGrow",_1:e.toString()}}function MU(e){return{TAG:"D",_0:"flexShrink",_1:e.toString()}}function LU(e){return{TAG:"D",_0:"flexWrap",_1:typeof e=="object"?bn.toString(e):e==="nowrap"||e==="wrapReverse"||e==="wrap"?fU.toString(e):_n.toString(e)}}function zU(e){let t;if(typeof e=="object"){let r=e.NAME;t=r==="var"||r==="varDefault"?bn.toString(e):Qr.toString(e)}else t=e==="unset"||e==="inherit_"||e==="initial"?_n.toString(e):e==="zero"?Qr.toString(e):hx.toString(e);return{TAG:"D",_0:"height",_1:t}}function UU(e){return{TAG:"D",_0:"justifyContent",_1:typeof e=="object"?bn.toString(e):e==="spaceBetween"||e==="stretch"||e==="spaceAround"||e==="spaceEvenly"?iU.toString(e):e==="unset"||e==="inherit_"||e==="initial"?_n.toString(e):e==="normal"?rU.toString(e):dx.toString(e)}}function BU(e){return{TAG:"D",_0:"left",_1:rm(e)}}function jU(e){return{TAG:"D",_0:"listStyleType",_1:typeof e=="object"?bn.toString(e):e==="unset"||e==="inherit_"||e==="initial"?_n.toString(e):O7.toString(e)}}function ru(e){if(typeof e!="object")return e==="unset"||e==="inherit_"||e==="initial"?_n.toString(e):e==="zero"?Qr.toString(e):N7.toString(e);let t=e.NAME;return t==="var"||t==="varDefault"?bn.toString(e):Qr.toString(e)}function qU(e){return{TAG:"D",_0:"margin",_1:ru(e)}}function VU(e,t){return{TAG:"D",_0:"margin",_1:ru(e)+(" "+ru(t))}}function KU(e){return{TAG:"D",_0:"marginLeft",_1:ru(e)}}function HU(e){return{TAG:"D",_0:"marginRight",_1:ru(e)}}function WU(e){return{TAG:"D",_0:"marginTop",_1:ru(e)}}function GU(e){return{TAG:"D",_0:"marginBottom",_1:ru(e)}}function JU(e){let t;if(typeof e=="object"){let r=e.NAME;t=r==="var"||r==="varDefault"?bn.toString(e):Qr.toString(e)}else t=e==="none"?EU.toString(e):e==="unset"||e==="inherit_"||e==="initial"?_n.toString(e):e==="zero"?Qr.toString(e):hx.toString(e);return{TAG:"D",_0:"maxHeight",_1:t}}function QU(e){let t;if(typeof e=="object"){let r=e.NAME;t=r==="var"||r==="varDefault"?bn.toString(e):Qr.toString(e)}else t=e==="none"?xU.toString(e):e==="unset"||e==="inherit_"||e==="initial"?_n.toString(e):e==="zero"?Qr.toString(e):fx.toString(e);return{TAG:"D",_0:"maxWidth",_1:t}}function YU(e){let t;if(typeof e=="object"){let r=e.NAME;t=r==="var"||r==="varDefault"?bn.toString(e):Qr.toString(e)}else t=e==="none"?wU.toString(e):e==="unset"||e==="inherit_"||e==="initial"?_n.toString(e):e==="zero"?Qr.toString(e):hx.toString(e);return{TAG:"D",_0:"minHeight",_1:t}}function XU(e){let t;if(typeof e=="object"){let r=e.NAME;t=r==="var"||r==="varDefault"?bn.toString(e):Qr.toString(e)}else t=e==="none"?SU.toString(e):e==="unset"||e==="inherit_"||e==="initial"?_n.toString(e):e==="zero"?Qr.toString(e):fx.toString(e);return{TAG:"D",_0:"minWidth",_1:t}}function ZU(e){return{TAG:"D",_0:"opacity",_1:e.toString()}}function eB(e){return{TAG:"D",_0:"overflow",_1:$D.toString(e)}}function tB(e){return{TAG:"D",_0:"overflowY",_1:$D.toString(e)}}function rB(e){return{TAG:"D",_0:"padding",_1:Qr.toString(e)}}function nB(e,t){return{TAG:"D",_0:"padding",_1:Qr.toString(e)+(" "+Qr.toString(t))}}function iB(e){return{TAG:"D",_0:"position",_1:typeof e=="object"?bn.toString(e):e==="unset"||e==="inherit_"||e==="initial"?_n.toString(e):A7.toString(e)}}function oB(e){return{TAG:"D",_0:"right",_1:rm(e)}}function sB(e){return{TAG:"D",_0:"textAlign",_1:typeof e=="object"?bn.toString(e):e==="unset"||e==="inherit_"||e==="initial"?_n.toString(e):sU.toString(e)}}function aB(e){return{TAG:"D",_0:"top",_1:rm(e)}}function lB(e,t){return{TAG:"D",_0:e,_1:t}}function uB(e){return{TAG:"D",_0:"userSelect",_1:typeof e=="object"?bn.toString(e):e==="unset"||e==="inherit_"||e==="initial"?_n.toString(e):mU.toString(e)}}function cB(e){let t;if(typeof e=="object"){let r=e.NAME;t=r==="var"||r==="varDefault"?bn.toString(e):Qr.toString(e)}else t=e==="unset"||e==="inherit_"||e==="initial"?_n.toString(e):e==="zero"?Qr.toString(e):fx.toString(e);return{TAG:"D",_0:"width",_1:t}}function dB(e){return{TAG:"D",_0:"zIndex",_1:e.toString()}}function fB(e,t){return{TAG:"S",_0:"@media "+e,_1:t}}function hB(e,t){return{TAG:"S",_0:e,_1:t}}function pB(e){return{TAG:"PseudoClass",_0:"disabled",_1:e}}function gB(e){return{TAG:"PseudoClass",_0:"focus",_1:e}}function mB(e){return{TAG:"PseudoClass",_0:"focus-within",_1:e}}function vB(e){return{TAG:"PseudoClass",_0:"hover",_1:e}}function _B(e){return{TAG:"PseudoClass",_0:"last-child",_1:e}}function bB(e){return{TAG:"S",_0:"::placeholder",_1:e}}let yB=w7.px;function xB(e){return{TAG:"D",_0:"animationName",_1:e}}function SB(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function EB(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var wB=(function(){function e(r){var n=this;this._insertTag=function(i){var o;n.tags.length===0?n.insertionPoint?o=n.insertionPoint.nextSibling:n.prepend?o=n.container.firstChild:o=n.before:o=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(i,o),n.tags.push(i)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(EB(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=SB(i);try{o.insertRule(n,o.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){var i;return(i=n.parentNode)==null?void 0:i.removeChild(n)}),this.tags=[],this.ctr=0},e})(),Dn="-ms-",G0="-moz-",Ft="-webkit-",DD="comm",px="rule",gx="decl",kB="@import",FD="@keyframes",CB="@layer",RB=Math.abs,nm=String.fromCharCode,AB=Object.assign;function TB(e,t){return Cn(e,0)^45?(((t<<2^Cn(e,0))<<2^Cn(e,1))<<2^Cn(e,2))<<2^Cn(e,3):0}function ID(e){return e.trim()}function $B(e,t){return(e=t.exec(e))?e[0]:e}function It(e,t,r){return e.replace(t,r)}function hy(e,t){return e.indexOf(t)}function Cn(e,t){return e.charCodeAt(t)|0}function Bf(e,t,r){return e.slice(t,r)}function ns(e){return e.length}function mx(e){return e.length}function bp(e,t){return t.push(e),e}function NB(e,t){return e.map(t).join("")}var im=1,Lc=1,PD=0,ci=0,jr=0,id="";function om(e,t,r,n,i,o,s){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:im,column:Lc,length:s,return:""}}function Ld(e,t){return AB(om("",null,null,"",null,null,0),e,{length:-e.length},t)}function DB(){return jr}function FB(){return jr=ci>0?Cn(id,--ci):0,Lc--,jr===10&&(Lc=1,im--),jr}function $i(){return jr=ci<PD?Cn(id,ci++):0,Lc++,jr===10&&(Lc=1,im++),jr}function ds(){return Cn(id,ci)}function S0(){return ci}function Th(e,t){return Bf(id,e,t)}function jf(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function OD(e){return im=Lc=1,PD=ns(id=e),ci=0,[]}function MD(e){return id="",e}function E0(e){return ID(Th(ci-1,py(e===91?e+2:e===40?e+1:e)))}function IB(e){for(;(jr=ds())&&jr<33;)$i();return jf(e)>2||jf(jr)>3?"":" "}function PB(e,t){for(;--t&&$i()&&!(jr<48||jr>102||jr>57&&jr<65||jr>70&&jr<97););return Th(e,S0()+(t<6&&ds()==32&&$i()==32))}function py(e){for(;$i();)switch(jr){case e:return ci;case 34:case 39:e!==34&&e!==39&&py(jr);break;case 40:e===41&&py(e);break;case 92:$i();break}return ci}function OB(e,t){for(;$i()&&e+jr!==57;)if(e+jr===84&&ds()===47)break;return"/*"+Th(t,ci-1)+"*"+nm(e===47?e:$i())}function MB(e){for(;!jf(ds());)$i();return Th(e,ci)}function LB(e){return MD(w0("",null,null,null,[""],e=OD(e),0,[0],e))}function w0(e,t,r,n,i,o,s,a,l){for(var u=0,d=0,f=s,h=0,p=0,g=0,m=1,v=1,_=1,x=0,w="",S=i,k=o,A=n,C=w;v;)switch(g=x,x=$i()){case 40:if(g!=108&&Cn(C,f-1)==58){hy(C+=It(E0(x),"&","&\f"),"&\f")!=-1&&(_=-1);break}case 34:case 39:case 91:C+=E0(x);break;case 9:case 10:case 13:case 32:C+=IB(g);break;case 92:C+=PB(S0()-1,7);continue;case 47:switch(ds()){case 42:case 47:bp(zB(OB($i(),S0()),t,r),l);break;default:C+="/"}break;case 123*m:a[u++]=ns(C)*_;case 125*m:case 59:case 0:switch(x){case 0:case 125:v=0;case 59+d:_==-1&&(C=It(C,/\f/g,"")),p>0&&ns(C)-f&&bp(p>32?O2(C+";",n,r,f-1):O2(It(C," ","")+";",n,r,f-2),l);break;case 59:C+=";";default:if(bp(A=P2(C,t,r,u,d,i,a,w,S=[],k=[],f),o),x===123)if(d===0)w0(C,t,A,A,S,o,f,a,k);else switch(h===99&&Cn(C,3)===110?100:h){case 100:case 108:case 109:case 115:w0(e,A,A,n&&bp(P2(e,A,A,0,0,i,a,w,i,S=[],f),k),i,k,f,a,n?S:k);break;default:w0(C,A,A,A,[""],k,0,a,k)}}u=d=p=0,m=_=1,w=C="",f=s;break;case 58:f=1+ns(C),p=g;default:if(m<1){if(x==123)--m;else if(x==125&&m++==0&&FB()==125)continue}switch(C+=nm(x),x*m){case 38:_=d>0?1:(C+="\f",-1);break;case 44:a[u++]=(ns(C)-1)*_,_=1;break;case 64:ds()===45&&(C+=E0($i())),h=ds(),d=f=ns(w=C+=MB(S0())),x++;break;case 45:g===45&&ns(C)==2&&(m=0)}}return o}function P2(e,t,r,n,i,o,s,a,l,u,d){for(var f=i-1,h=i===0?o:[""],p=mx(h),g=0,m=0,v=0;g<n;++g)for(var _=0,x=Bf(e,f+1,f=RB(m=s[g])),w=e;_<p;++_)(w=ID(m>0?h[_]+" "+x:It(x,/&\f/g,h[_])))&&(l[v++]=w);return om(e,t,r,i===0?px:a,l,u,d)}function zB(e,t,r){return om(e,t,r,DD,nm(DB()),Bf(e,2,-2),0)}function O2(e,t,r,n){return om(e,t,r,gx,Bf(e,0,n),Bf(e,n+1,-1),n)}function vc(e,t){for(var r="",n=mx(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function UB(e,t,r,n){switch(e.type){case CB:if(e.children.length)break;case kB:case gx:return e.return=e.return||e.value;case DD:return"";case FD:return e.return=e.value+"{"+vc(e.children,n)+"}";case px:e.value=e.props.join(",")}return ns(r=vc(e.children,n))?e.return=e.value+"{"+r+"}":""}function BB(e){var t=mx(e);return function(r,n,i,o){for(var s="",a=0;a<t;a++)s+=e[a](r,n,i,o)||"";return s}}function jB(e){return function(t){t.root||(t=t.return)&&e(t)}}function qB(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var VB=function(t,r,n){for(var i=0,o=0;i=o,o=ds(),i===38&&o===12&&(r[n]=1),!jf(o);)$i();return Th(t,ci)},KB=function(t,r){var n=-1,i=44;do switch(jf(i)){case 0:i===38&&ds()===12&&(r[n]=1),t[n]+=VB(ci-1,r,n);break;case 2:t[n]+=E0(i);break;case 4:if(i===44){t[++n]=ds()===58?"&\f":"",r[n]=t[n].length;break}default:t[n]+=nm(i)}while(i=$i());return t},HB=function(t,r){return MD(KB(OD(t),r))},M2=new WeakMap,WB=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var r=t.value,n=t.parent,i=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&r.charCodeAt(0)!==58&&!M2.get(n))&&!i){M2.set(t,!0);for(var o=[],s=HB(r,o),a=n.props,l=0,u=0;l<s.length;l++)for(var d=0;d<a.length;d++,u++)t.props[u]=o[l]?s[l].replace(/&\f/g,a[d]):a[d]+" "+s[l]}}},GB=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}};function LD(e,t){switch(TB(e,t)){case 5103:return Ft+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ft+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ft+e+G0+e+Dn+e+e;case 6828:case 4268:return Ft+e+Dn+e+e;case 6165:return Ft+e+Dn+"flex-"+e+e;case 5187:return Ft+e+It(e,/(\w+).+(:[^]+)/,Ft+"box-$1$2"+Dn+"flex-$1$2")+e;case 5443:return Ft+e+Dn+"flex-item-"+It(e,/flex-|-self/,"")+e;case 4675:return Ft+e+Dn+"flex-line-pack"+It(e,/align-content|flex-|-self/,"")+e;case 5548:return Ft+e+Dn+It(e,"shrink","negative")+e;case 5292:return Ft+e+Dn+It(e,"basis","preferred-size")+e;case 6060:return Ft+"box-"+It(e,"-grow","")+Ft+e+Dn+It(e,"grow","positive")+e;case 4554:return Ft+It(e,/([^-])(transform)/g,"$1"+Ft+"$2")+e;case 6187:return It(It(It(e,/(zoom-|grab)/,Ft+"$1"),/(image-set)/,Ft+"$1"),e,"")+e;case 5495:case 3959:return It(e,/(image-set\([^]*)/,Ft+"$1$`$1");case 4968:return It(It(e,/(.+:)(flex-)?(.*)/,Ft+"box-pack:$3"+Dn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ft+e+e;case 4095:case 3583:case 4068:case 2532:return It(e,/(.+)-inline(.+)/,Ft+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ns(e)-1-t>6)switch(Cn(e,t+1)){case 109:if(Cn(e,t+4)!==45)break;case 102:return It(e,/(.+:)(.+)-([^]+)/,"$1"+Ft+"$2-$3$1"+G0+(Cn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~hy(e,"stretch")?LD(It(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Cn(e,t+1)!==115)break;case 6444:switch(Cn(e,ns(e)-3-(~hy(e,"!important")&&10))){case 107:return It(e,":",":"+Ft)+e;case 101:return It(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ft+(Cn(e,14)===45?"inline-":"")+"box$3$1"+Ft+"$2$3$1"+Dn+"$2box$3")+e}break;case 5936:switch(Cn(e,t+11)){case 114:return Ft+e+Dn+It(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ft+e+Dn+It(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ft+e+Dn+It(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ft+e+Dn+e+e}return e}var JB=function(t,r,n,i){if(t.length>-1&&!t.return)switch(t.type){case gx:t.return=LD(t.value,t.length);break;case FD:return vc([Ld(t,{value:It(t.value,"@","@"+Ft)})],i);case px:if(t.length)return NB(t.props,function(o){switch($B(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return vc([Ld(t,{props:[It(o,/:(read-\w+)/,":"+G0+"$1")]})],i);case"::placeholder":return vc([Ld(t,{props:[It(o,/:(plac\w+)/,":"+Ft+"input-$1")]}),Ld(t,{props:[It(o,/:(plac\w+)/,":"+G0+"$1")]}),Ld(t,{props:[It(o,/:(plac\w+)/,Dn+"input-$1")]})],i)}return""})}},QB=[JB],YB=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(m){var v=m.getAttribute("data-emotion");v.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||QB,o={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(m){for(var v=m.getAttribute("data-emotion").split(" "),_=1;_<v.length;_++)o[v[_]]=!0;a.push(m)});var l,u=[WB,GB];{var d,f=[UB,jB(function(m){d.insert(m)})],h=BB(u.concat(i,f)),p=function(v){return vc(LB(v),h)};l=function(v,_,x,w){d=x,p(v?v+"{"+_.styles+"}":_.styles),w&&(g.inserted[_.name]=!0)}}var g={key:r,sheet:new wB({key:r,container:s,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:l};return g.sheet.hydrate(a),g};function XB(e){for(var t=0,r,n=0,i=e.length;i>=4;++n,i-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var ZB={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ej=/[A-Z]|^ms/g,tj=/_EMO_([^_]+?)_([^]*?)_EMO_/g,zD=function(t){return t.charCodeAt(1)===45},L2=function(t){return t!=null&&typeof t!="boolean"},Dv=qB(function(e){return zD(e)?e:e.replace(ej,"-$&").toLowerCase()}),z2=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(tj,function(n,i,o){return Fa={name:i,styles:o,next:Fa},i})}return ZB[t]!==1&&!zD(t)&&typeof r=="number"&&r!==0?r+"px":r};function J0(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var i=r;if(i.anim===1)return Fa={name:i.name,styles:i.styles,next:Fa},i.name;var o=r;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)Fa={name:s.name,styles:s.styles,next:Fa},s=s.next;var a=o.styles+";";return a}return rj(e,t,r)}}var l=r;if(t==null)return l;var u=t[l];return u!==void 0?u:l}function rj(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=J0(e,t,r[i])+";";else for(var o in r){var s=r[o];if(typeof s!="object"){var a=s;t!=null&&t[a]!==void 0?n+=o+"{"+t[a]+"}":L2(a)&&(n+=Dv(o)+":"+z2(o,a)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&(t==null||t[s[0]]===void 0))for(var l=0;l<s.length;l++)L2(s[l])&&(n+=Dv(o)+":"+z2(o,s[l])+";");else{var u=J0(e,t,s);switch(o){case"animation":case"animationName":{n+=Dv(o)+":"+u+";";break}default:n+=o+"{"+u+"}"}}}return n}var U2=/label:\s*([^\s;{]+)\s*(;|$)/g,Fa;function Fv(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,i="";Fa=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=J0(r,t,o);else{var s=o;i+=s[0]}for(var a=1;a<e.length;a++)if(i+=J0(r,t,e[a]),n){var l=o;i+=l[a]}U2.lastIndex=0;for(var u="",d;(d=U2.exec(i))!==null;)u+="-"+d[1];var f=XB(i)+u;return{name:f,styles:i,next:Fa}}function UD(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}var nj=function(t,r,n){var i=t.key+"-"+r.name;t.registered[i]===void 0&&(t.registered[i]=r.styles)},ij=function(t,r,n){nj(t,r);var i=t.key+"-"+r.name;if(t.inserted[r.name]===void 0){var o=r;do t.insert(r===o?"."+i:"",o,t.sheet,!0),o=o.next;while(o!==void 0)}};function B2(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function j2(e,t,r){var n=[],i=UD(e,n,r);return n.length<2?r:i+t(n)}var oj=function(t){var r=YB(t);r.sheet.speedy=function(a){this.isSpeedy=a},r.compat=!0;var n=function(){for(var l=arguments.length,u=new Array(l),d=0;d<l;d++)u[d]=arguments[d];var f=Fv(u,r.registered,void 0);return ij(r,f),r.key+"-"+f.name},i=function(){for(var l=arguments.length,u=new Array(l),d=0;d<l;d++)u[d]=arguments[d];var f=Fv(u,r.registered),h="animation-"+f.name;return B2(r,{name:f.name,styles:"@keyframes "+h+"{"+f.styles+"}"}),h},o=function(){for(var l=arguments.length,u=new Array(l),d=0;d<l;d++)u[d]=arguments[d];var f=Fv(u,r.registered);B2(r,f)},s=function(){for(var l=arguments.length,u=new Array(l),d=0;d<l;d++)u[d]=arguments[d];return j2(r.registered,n,sj(u))};return{css:n,cx:s,injectGlobal:o,keyframes:i,hydrate:function(l){l.forEach(function(u){r.inserted[u]=!0})},flush:function(){r.registered={},r.inserted={},r.sheet.flush()},sheet:r.sheet,cache:r,getRegisteredStyles:UD.bind(null,r.registered),merge:j2.bind(null,r.registered,n)}},sj=function e(t){for(var r="",n=0;n<t.length;n++){var i=t[n];if(i!=null){var o=void 0;switch(typeof i){case"boolean":break;case"object":{if(Array.isArray(i))o=e(i);else{o="";for(var s in i)i[s]&&s&&(o&&(o+=" "),o+=s)}break}default:o=i}o&&(r&&(r+=" "),r+=o)}}return r},sm=oj({key:"css"}),aj=sm.cx,am=sm.injectGlobal,BD=sm.keyframes,lj=sm.css;function uj(e,t){am(t)}function cj(e,t){am(bt([[e,t]]))}function dj(e,t,r){am(bt([[t,r]]))}function fj(e){return BD(e)}function hj(e,t){return BD(t)}let lm=CU({injectRaw:e=>{am(e)},renderRaw:uj,injectRules:cj,renderRules:dj,make:e=>lj(e),mergeStyles:e=>aj(e),makeKeyframes:fj,renderKeyframes:hj}),c=lB,ee=RU,pj=AU,vx=DU,we=FU,L=IU,he=PU,fo=OU,Li=MU,pi=LU,jD=zU,Qe=UU,od=BU,gj=jU,yn=qU,mj=VU,$h=KU,qD=HU,xs=WU,um=GU,vj=JU,_j=QU,bj=YU,VD=XU,Ws=ZU,fl=eB,yj=tB,xj=rB,Sj=nB,Ot=iB,hl=oB,sa=sB,aa=aB,KD=uB,Uo=cB,Ej=dB,xr=hB,HD=fB,WD=pB,la=gB,GD=mB,Ye=vB,JD=_B,wj=bB,ke=yB,kj=xB,Cj=TU,Rj=$U,Aj=NU,Tj=lm.global,E=lm.style,$n=lm.merge,$j=lm.keyframes,y={background:"--rv-color-background",surface:"--rv-color-surface",surfaceSubtle:"--rv-color-surface-subtle",surfaceElevated:"--rv-color-surface-elevated",brand:"--rv-color-brand",brandSubtle:"--rv-color-brand-subtle",success:"--rv-color-success",warning:"--rv-color-warning",error:"--rv-color-error",info:"--rv-color-info",textPrimary:"--rv-color-text-primary",textSecondary:"--rv-color-text-secondary",textDisabled:"--rv-color-text-disabled",textOnBrand:"--rv-color-text-on-brand",border:"--rv-color-border",borderSubtle:"--rv-color-border-subtle"},F={xs:"--rv-spacing-xs",sm:"--rv-spacing-sm",md:"--rv-spacing-md",lg:"--rv-spacing-lg",xl:"--rv-spacing-xl",xxl:"--rv-spacing-xxl"},$={fontFamily:"--rv-font-family",fontFamilyMono:"--rv-font-family-mono",sizeXs:"--rv-font-size-xs",sizeSm:"--rv-font-size-sm",sizeMd:"--rv-font-size-md",sizeLg:"--rv-font-size-lg",sizeXl:"--rv-font-size-xl",sizeXxl:"--rv-font-size-xxl",weightNormal:"--rv-font-weight-normal",weightMedium:"--rv-font-weight-medium",weightBold:"--rv-font-weight-bold",lineHeightTight:"--rv-line-height-tight",lineHeightNormal:"--rv-line-height-normal",lineHeightRelaxed:"--rv-line-height-relaxed"},X={sm:"--rv-radius-sm",md:"--rv-radius-md",lg:"--rv-radius-lg",full:"--rv-radius-full"},pn={sm:"--rv-shadow-sm",md:"--rv-shadow-md",lg:"--rv-shadow-lg"};function Qi(e){return"var("+e+")"}let Nj=E([L("flex"),he("column"),ee("center"),Qe("center"),c("gap",Qi(F.md)),fo(1),c("min-height","200px"),sa("center"),c("padding",Qi(F.xxl))]),Dj=E([c("font-size","40px"),c("color",Qi(y.textDisabled)),c("line-height","1")]),Fj=E([c("color",Qi(y.textPrimary)),c("font-size",Qi($.sizeLg)),c("font-weight",Qi($.weightMedium)),yn(ke(0))]),Ij=E([c("color",Qi(y.textSecondary)),c("font-size",Qi($.sizeMd)),c("max-width","360px"),yn(ke(0))]),Pj=E([c("background",Qi(y.brand)),c("color",Qi(y.textOnBrand)),c("border","none"),c("border-radius",Qi(X.md)),c("padding","var("+F.sm+") var("+F.lg+")"),c("font-size",Qi($.sizeMd)),c("cursor","pointer"),xs(ke(8))]);function Oj(e){let t=e.title,r=t!==void 0?t:"Nothing here yet";return M("div",{children:[b("div",{children:"( )",className:Dj}),b("h3",{children:r,className:Fj}),fe(e.description,null,n=>b("p",{children:n,className:Ij})),fe(e.action,null,n=>{let i=n[1];return b("button",{children:n[0],className:Pj,onClick:o=>i()})})],className:Nj})}let sd=Oj;function ai(e){return"var("+e+")"}let Mj=E([Uo({NAME:"percent",VAL:100}),c("border-collapse","collapse"),c("font-size",ai($.sizeMd))]),Lj=E([c("background",ai(y.surfaceSubtle)),c("border-bottom","2px solid var("+y.border+")")]),q2=E([c("padding","var("+F.xs+") var("+F.sm+")"),c("color",ai(y.textSecondary)),c("font-weight",ai($.weightMedium)),c("font-size",ai($.sizeSm)),c("text-align","left"),c("white-space","nowrap"),c("user-select","none")]),zj=E([c("padding","var("+F.sm+") var("+F.md+")"),c("font-size",ai($.sizeMd))]),Uj=E([we("pointer"),Ye([c("color",ai(y.textPrimary))])]),Bj=E([c("color",ai(y.textPrimary))]),jj=E([$h(ke(4)),c("font-size",ai($.sizeXs)),c("color",ai(y.brand))]),V2=E([c("border-bottom","1px solid var("+y.borderSubtle+")"),Ye([c("background",ai(y.surfaceSubtle))])]),qj=E([c("min-height","44px")]),Vj=E([we("pointer")]),Kj=E([c("background",ai(y.surfaceSubtle)),c("box-shadow","inset 3px 0 0 0 var("+y.brand+")")]),K2=E([c("padding","var("+F.xs+") var("+F.sm+")"),c("color",ai(y.textPrimary)),c("vertical-align","middle")]),Hj=E([c("padding","var("+F.sm+") var("+F.md+")")]),Wj=E([sa("center"),c("padding",ai(F.xxl))]);function Gj(e){let t=e.onSort,r=e.sortState,n=e.density==="Comfortable"?q2+" "+zj:q2;return b("thead",{children:b("tr",{children:e.columns.map(i=>{let o=fe(r,!1,l=>l.key===i.key),s=fe(r,"Asc",l=>l.direction),a=i.sortable?n+" "+Uj+(o?" "+Bj:""):n;return M("th",{children:[i.label,o?b("span",{children:s==="Asc"?"^":"v",className:jj}):null],className:a,style:fe(i.width,{},l=>({width:l})),onClick:l=>{if(i.sortable)return ie(t,u=>{let d=o&&s==="Asc"?"Desc":"Asc";u(i.key,d)})}},i.key)})}),className:Lj})}function Jj(e){let t=e.activeKey,r=e.density,n=e.onRowClick,i=e.keyFn,o=e.data,s=e.columns,a=r!==void 0?r:"Compact",l=a==="Comfortable"?K2+" "+Hj:K2,u=a==="Comfortable"?V2+" "+qj:V2;return M("table",{children:[b(Gj,{columns:s,sortState:e.sortState,onSort:e.onSort,density:a}),b("tbody",{children:o.length===0?b("tr",{children:b("td",{children:D(e.emptyView,b(sd,{title:"No data"})),className:l+" "+Wj,colSpan:s.length})}):o.map(d=>{let f=i(d),h=fe(n,u,g=>u+" "+Vj),p=ot(t,f)?h+" "+Kj:h;return b("tr",{children:s.map(g=>b("td",{children:g.render(d),className:l},g.key)),className:p,onClick:g=>ie(n,m=>m(d))},f)})})],className:Mj})}let Q0=Jj;function QD(e){switch(e){case"Small":return 20;case"Medium":return 28;case"Large":return 44}}let YD=["#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74","#5e7c9c"];function Qj(e){let t={contents:5381};return e.split("").forEach(r=>{let n=D(r.codePointAt(0),0);t.contents=(t.contents*33|0)+n&2147483647}),Oo(t.contents,YD.length)}function Yj(e){let t=se(e.split(/[\s_.@-]+/),o=>o).filter(o=>o!==""),r=o=>o.slice(0,1).toUpperCase(),n=t[0],i=t[1];return n!==void 0?i!==void 0?r(n)+r(i):r(n):"?"}function Iv(e){return"var("+e+")"}let Xj=E([L("inlineFlex"),ee("center"),Qe("center"),c("border-radius",Iv(X.full)),c("color","#ffffff"),c("font-family",Iv($.fontFamily)),c("font-weight",Iv($.weightMedium)),c("flex-shrink","0"),c("user-select","none"),c("vertical-align","middle"),c("overflow","hidden")]),Zj=E([c("width","100%"),c("height","100%"),c("object-fit","cover")]);function eq(e){let t=e.size,r=e.src,n=e.name,i=t!==void 0?t:"Medium",o=oe(()=>!1),s=o[1],a=QD(i),l=a.toString()+"px",u=r!==void 0?r!==""&&!o[0]:!1,d={background:u?"transparent":YD[Qj(n)],fontSize:((a/2|0)-1|0).toString()+"px",height:l,width:l};return b("span",{children:u?b("img",{className:Zj,alt:n,src:D(r,""),onError:f=>s(h=>!0)}):Yj(n),"aria-label":n,className:Xj,role:"img",style:d,title:n})}let ad=eq;function Aa(e){return"var("+e+")"}let tq=E([L("flex"),pi("wrap"),c("gap",Aa(F.xs)),ee("center")]),rq=E([L("inlineFlex"),ee("center"),c("padding","2px 8px"),c("border-radius",Aa(X.full)),c("background",Aa(y.surfaceElevated)),c("color",Aa(y.textSecondary)),c("font-size",Aa($.sizeXs)),c("font-weight",Aa($.weightMedium)),c("line-height","1.5"),c("white-space","nowrap")]),nq=E([c("color",Aa(y.textDisabled)),c("font-size",Aa($.sizeSm))]);function iq(e){let t=e.items;return t.length===0?b("span",{children:"—",className:nq}):b("div",{children:t.map((r,n)=>b("span",{children:r,className:rq},n.toString()+":"+r)),className:tq})}let XD=iq,oq=[["id","ID"],["ids","IDs"],["url","URL"],["uri","URI"],["api","API"],["arn","ARN"],["aws","AWS"],["iam","IAM"],["sqs","SQS"],["sns","SNS"],["uuid","UUID"],["ip","IP"],["dns","DNS"],["http","HTTP"],["https","HTTPS"],["json","JSON"],["xml","XML"],["sql","SQL"],["ui","UI"],["ux","UX"]],sq=bt(oq);function Pv(e){return e===e.toUpperCase()?e!==e.toLowerCase():!1}function Ov(e){return e===e.toLowerCase()?e!==e.toUpperCase():!1}function aq(e){switch(e){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return!0;default:return!1}}function lq(e){let t=e.length,r=[],n={contents:""},i=()=>{if(n.contents.length>0){r.push(n.contents),n.contents="";return}};for(let o=0;o<t;++o){let s=e.charAt(o);if(s==="_"||s==="-"||s===" ")i();else if(Pv(s)){let a=o>0&&Ov(e.charAt(o-1|0)),l=(o+1|0)<t&&Ov(e.charAt(o+1|0)),u=o>0&&Pv(e.charAt(o-1|0));(a||u&&l)&&i(),n.contents=n.contents+s}else if(aq(s)){let a=!1;if(o>0){let l=e.charAt(o-1|0);a=Pv(l)||Ov(l)}a&&i(),n.contents=n.contents+s}else n.contents=n.contents+s}return i(),r}function uq(e){let t=e.toLowerCase(),r=O(sq,t);return r!==void 0?r:e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function yt(e){let t=lq(e);return t.length!==0?t.map(uq).join(" "):e}function Ll(e){return"var("+e+")"}let H2=E([L("inlineFlex"),ee("center"),c("gap","4px"),c("background","transparent"),c("border","1px solid var("+y.borderSubtle+")"),c("border-radius",Ll(X.sm)),c("padding","1px 6px"),c("color",Ll(y.textSecondary)),c("font-size",Ll($.sizeXs)),c("line-height","1"),we("pointer"),Ye([c("background",Ll(y.surfaceElevated)),c("color",Ll(y.textPrimary))])]),cq=E([c("color",Ll(y.success)),c("border-color",Ll(y.success))]);function dq(e){let t=e.label,r=e.value,n=t!==void 0?t:"Copy",i=oe(()=>!1),o=i[1],s=i[0],a=u=>{u.stopPropagation(),u.preventDefault(),qt(navigator.clipboard.writeText(r).then(()=>(o(d=>!0),setTimeout(()=>o(d=>!1),1500),Promise.resolve())),d=>Promise.resolve())},l=s?H2+" "+cq:H2;return b("button",{children:s?"Copied":n,"aria-label":"Copy to clipboard",className:l,type:"button",onClick:a})}let fq=dq;function Y0(e){return"var("+e+")"}let hq=E([L("inlineFlex"),ee("center"),c("gap",Y0(F.xs)),c("min-width","0")]),pq=E([c("color",Y0(y.brand)),c("text-decoration","none"),c("max-width","260px"),c("overflow","hidden"),c("text-overflow","ellipsis"),c("white-space","nowrap"),Ye([c("text-decoration","underline")])]),gq=E([c("color",Y0(y.textPrimary)),c("font-family","var(--rv-font-mono, ui-monospace, monospace)"),c("font-size",Y0($.sizeSm)),c("max-width","200px"),c("overflow","hidden"),c("text-overflow","ellipsis"),c("white-space","nowrap")]);function mq(e,t){return e.length>t?e.slice(0,6)+"…"+e.slice(e.length-4|0,e.length):e}function vq(e){let t=e.copyable,r=e.rawValue,n=e.label,i=e.href,o=t!==void 0?t:!1,s=dl();return M("span",{children:[i!==void 0?b("a",{children:n,className:pq,title:n,href:i,onClick:l=>{if(!(l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||l.button!==0)&&i!==void 0)return l.preventDefault(),l.stopPropagation(),s(i)}}):b("span",{children:mq(n,18),className:gq,title:r}),o?b(fq,{value:r}):null],className:hq})}let _q=vq;function Us(e){return"var("+e+")"}let W2=E([L("inlineFlex"),ee("center"),c("gap","4px"),c("padding","2px 8px"),c("border-radius",Us(X.full)),c("background",Us(y.surfaceElevated)),c("color",Us(y.textSecondary)),c("font-size",Us($.sizeXs)),c("font-weight",Us($.weightMedium)),c("line-height","1.5"),c("white-space","nowrap"),c("border","none")]),bq=E([we("pointer"),Ye([c("background",Us(y.surface)),c("color",Us(y.textPrimary))])]),yq=E([c("font-weight",Us($.weightBold)),c("color",Us(y.textPrimary))]);function xq(e){let t=e.onClick,r=fe(t,W2,i=>W2+" "+bq),n=M(qr,{children:[b("span",{children:e.count.toString(),className:yq})," "+e.label,fe(t,null,i=>b("span",{children:" ▸","aria-hidden":!0}))]});return t!==void 0?b("button",{children:n,className:r,type:"button",onClick:i=>t()}):b("span",{children:n,className:r})}let bf=xq;function zd(e){let t=e.toString();return t.length<2?"0"+t:t}function _x(e){let t=new Date(e),r=t.getTime();if(Number.isNaN(r))return e;let n=t.getFullYear()|0,i=(t.getMonth()|0)+1|0,o=t.getDate()|0,s=t.getHours()|0,a=t.getMinutes()|0,l=t.getSeconds()|0;return n.toString()+"-"+zd(i)+"-"+zd(o)+" "+zd(s)+":"+zd(a)+":"+zd(l)}let Sq=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:?\d{2})?$/;function bx(e){if(Sq.test(e))return _x(e)}function Eq(e){let t=e.toLowerCase(),r=t.length;return r>2&&t.endsWith("id")&&t!=="id"?!0:r>3?t.endsWith("ids"):!1}function ZD(e,t){if(!fe(e,!1,Eq))return bx(t)}function wq(e,t){return e>t?e-t|0:0}function tc(e){return"var("+e+")"}let kq=E([L("inlineFlex"),ee("center"),c("vertical-align","middle")]),G2=E([L("inlineFlex"),c("border-radius",tc(X.full)),c("box-shadow","0 0 0 2px var("+y.surface+")")]),Cq=E([L("inlineFlex"),ee("center"),Qe("center"),c("border-radius",tc(X.full)),c("background",tc(y.surfaceElevated)),c("color",tc(y.textSecondary)),c("font-family",tc($.fontFamily)),c("font-weight",tc($.weightMedium)),c("flex-shrink","0"),c("user-select","none")]);function Rq(e){let t=e.max,r=e.size,n=e.members,i=r!==void 0?r:"Medium",o=t!==void 0?t:4,s=wq(n.length,o),a=s>0?n.slice(0,o):n,l=s>0?n.slice(o):[],u=QD(i),d=(-u|0)/3|0,f=h=>({marginLeft:h===0?"0":d.toString()+"px",zIndex:((a.length+1|0)-h|0).toString()});return M("span",{children:[a.map((h,p)=>b("span",{children:b(ad,{name:h.name,src:h.imageUrl,size:i}),className:G2,style:f(p)},p.toString())),s>0?b("span",{children:"+"+s.toString(),className:G2+" "+Cq,style:{fontSize:((u/2|0)-2|0).toString()+"px",height:u.toString()+"px",marginLeft:d.toString()+"px",width:u.toString()+"px",zIndex:(a.length+2|0).toString()},title:l.map(h=>h.name).join(", ")}):null],className:kq})}let eF=Rq;function Mv(e){return"var("+e+")"}function Aq(e){if(typeof e=="object")return[e.bg,e.fg];switch(e){case"Success":return[y.success,y.background];case"Warning":return[y.warning,y.background];case"Error":return[y.error,y.background];case"Info":return[y.info,y.background];case"Neutral":return[y.surfaceElevated,y.textSecondary]}}function Tq(e,t){return E([L("inlineFlex"),ee("center"),c("gap","4px"),c("padding","2px 8px"),c("border-radius",Mv(X.full)),c("font-size",Mv($.sizeXs)),c("font-weight",Mv($.weightMedium)),c("line-height","1.5"),c("white-space","nowrap"),c("background",e.startsWith("--rv-")?"var("+e+")":e),c("color",t.startsWith("--rv-")?"var("+t+")":t)])}function $q(e){let t=e.dot,r=e.variant,n=r!==void 0?r:"Neutral",i=t!==void 0?t:!1,o=Aq(n);return M("span",{children:[i?b("span",{style:{background:"currentColor",display:"inline-block",height:"6px",width:"6px",borderRadius:"50%",flexShrink:"0"}}):null,e.label],className:Tq(o[0],o[1])})}let Zs=$q,tF={isId:!1,isCompositeId:!1,isSubId:!1,isCompositeSubId:!1,index:void 0,hidden:!1,summary:!1,groupBy:!1,drillTarget:void 0,collapsed:!1,scan:!1,scanSort:!1,semantic:void 0,semanticFromType:!1,channel:void 0};function Xo(e,t){let r=W(O(e,t),nt);return r==="JSONTrue"&&typeof r!="object"}function Ud(e,t){return T(O(e,t),ce)}function Nq(e){let t=W(O(e,"x-reventless-index"),nt);if(t!==void 0)return typeof t!="object"?t==="JSONTrue"?"":void 0:t.TAG==="JSONString"?t._0:void 0}function nu(e){let t=K(e);return t!==void 0?{isId:Xo(t,"x-reventless-id"),isCompositeId:Xo(t,"x-reventless-compositeId"),isSubId:Xo(t,"x-reventless-subId"),isCompositeSubId:Xo(t,"x-reventless-compositeSubId"),index:Nq(t),hidden:Xo(t,"x-reventless-hidden"),summary:Xo(t,"x-reventless-summary"),groupBy:Xo(t,"x-reventless-group-by"),drillTarget:W(Ud(t,"x-reventless-drillTarget"),r=>({slice:r,keyPath:Ud(t,"x-reventless-drillTargetKey")})),collapsed:Xo(t,"x-reventless-collapsed"),scan:Xo(t,"x-reventless-scan"),scanSort:Xo(t,"x-reventless-scanSort"),semantic:Ud(t,"x-reventless-semantic"),semanticFromType:ot(Ud(t,"x-reventless-semantic-source"),"type"),channel:Ud(t,"x-reventless-channel")}:tF}function Nh(e,t){return D(W(T(T(K(e),r=>O(r,"properties")),K),r=>se(et(r),n=>{if(t(nu(n[1])))return n[0]})),[])}function Dq(e){return D(W(T(T(K(e),t=>O(t,"properties")),K),t=>se(et(t),r=>{let n=r[0];return T(T(T(K(r[1]),i=>O(i,"x-reventless-metric")),K),i=>{let o=T(O(i,"aggregate"),ce),s=T(O(i,"label"),ce);return W(o,a=>[n,a,s])})})),[])}function cm(e){return Nh(e,t=>t.summary)}function Fq(e){return Nh(e,t=>t.isId)[0]}function Iq(e){return Nh(e,t=>t.groupBy)[0]}function yx(e){return Nh(e,t=>t.isCompositeId)}function xx(e){return Nh(e,t=>t.isSubId?!0:t.isCompositeSubId)[0]}function Pq(e){return T(T(K(e),t=>O(t,"x-reventless-live")),t=>{let r=nt(t);if(typeof r!="object")switch(r){case"JSONFalse":return!1;case"JSONTrue":return!0;default:return}})}function rF(e){return T(T(K(e),t=>O(t,"x-reventless-viewmode")),ce)}function Oq(e){return T(T(K(e),t=>O(t,"x-reventless-layout")),ce)}function ld(e){return T(W(T(T(K(e),t=>O(t,"enum")),Vt),t=>se(t,ce)),t=>{if(t.length!==0)return t})}function Bo(e,t){return D(T(T(T(T(K(e),r=>O(r,"properties")),K),r=>O(r,t)),ld),[])}function Dh(e){switch(e){case"Email":return"email";case"Phone":return"phone";case"Url":return"url";case"DateTime":return"date-time";case"Currency":return"currency";case"Percent":return"percent";case"Bytes":return"bytes";case"Duration":return"duration";case"Color":return"color";case"Image":return"image";case"Status":return"status";case"GeoLat":return"geo-lat";case"GeoLng":return"geo-lng";case"GeoPoint":return"geo-point";case"Label":return"label";case"UserRef":return"user-ref";case"File":return"file";case"Markdown":return"markdown";case"ChannelText":return"channel-text";case"Rating":return"rating";case"Progress":return"progress";case"FileUrl":return"file-url";case"Country":return"country";case"Address":return"address";case"Qr":return"qr";case"Barcode":return"barcode";case"Signature":return"signature";case"ParentRef":return"parent-ref"}}let Mq=["Email","Phone","Url","DateTime","Currency","Percent","Bytes","Duration","Color","Image","Status","GeoLat","GeoLng","GeoPoint","Label","UserRef","File","Markdown","ChannelText","Rating","Progress","FileUrl","Country","Address","Qr","Barcode","Signature","ParentRef"];function Sx(e){switch(e){case"address":return"Address";case"barcode":return"Barcode";case"bytes":return"Bytes";case"channel-text":return"ChannelText";case"color":return"Color";case"country":return"Country";case"currency":return"Currency";case"date-time":return"DateTime";case"duration":return"Duration";case"email":return"Email";case"file":return"File";case"file-url":return"FileUrl";case"geo-lat":return"GeoLat";case"geo-lng":return"GeoLng";case"geo-point":return"GeoPoint";case"image":return"Image";case"label":return"Label";case"markdown":return"Markdown";case"parent-ref":return"ParentRef";case"percent":return"Percent";case"phone":return"Phone";case"progress":return"Progress";case"qr":return"Qr";case"rating":return"Rating";case"signature":return"Signature";case"status":return"Status";case"url":return"Url";case"user-ref":return"UserRef";default:return}}function Yr(e){return D(W(T(T(K(e),t=>O(t,"properties")),K),et),[])}function rn(e,t){return T(T(K(e),r=>O(r,t)),ce)}function Lq(e){return rn(e,"type")}function Qa(e){let t=rn(e,"type");if(t===void 0)return!1;switch(t){case"integer":case"number":return!0;default:return!1}}function dm(e){return ot(rn(e,"type"),"string")}function Ex(e){let t=rn(e,"format");if(t===void 0)return!1;switch(t){case"date":case"date-time":return!0;default:return!1}}let nF=["user","username","owner","assignee","assignedto","author","creator","createdby","updatedby","reporter","approver","reviewer","actor","member"];function iF(e){return nF.includes(e.toLowerCase())}function X0(e,t){return t.some(r=>e.endsWith(r))}function zq(e){return X0(e,["fileurl","documenturl","downloadurl","attachmenturl","pdfurl"])}function Uq(e){let t=rn(e,"format");if(t!==void 0)switch(t){case"date":case"date-time":return["DateTime","format:date-time"];case"email":return["Email","format:email"];case"uri":case"url":return["Url","format:uri"];default:return}}function J2(e){return fe(ld(e),0,t=>t.length)}function qf(e,t){return T(T(K(e),r=>O(r,t)),vs)}function Bq(e,t){if(!Qa(t))return;let r=qf(t,"maximum");return["rating","stars","starrating"].includes(e)?r!==void 0&&r>10?void 0:["Rating","name:rating"]:e==="score"&&r!==void 0&&r<=10?["Rating","name:score-scale"]:void 0}let jq=[["street","streetaddress","line1","addressline1","address1","housenumber"],["city","town","locality"],["postalcode","zip","zipcode","postcode"],["state","region","province","county"],["country","countrycode"]];function qq(e){let t=Yr(e);return jq.filter(r=>t.some(n=>r.includes(n[0].toLowerCase()))).length>=2}let Vq=["parent","parentid","manager","managerid","reportsto","reportstoid","supervisor","supervisorid"];function Kq(e){return Vq.includes(e)?!0:e.startsWith("parent")?e.endsWith("id"):!1}function Hq(e,t){let r=e.toLowerCase(),n=Bq(r,t);return n!==void 0?n:["status","state","stage"].includes(r)&&J2(t)>0?J2(t)<=8?["Status","name:status-enum"]:void 0:ot(rn(t,"type"),"string")&&["imageurl","image","photo","photourl","avatar","avatarurl","thumbnail"].includes(r)?["Image","name:image"]:Qa(t)&&X0(r,["price","amount","total"])?["Currency","name:currency"]:ot(rn(t,"type"),"string")&&["email"].includes(r)?["Email","name:email"]:ot(rn(t,"type"),"string")&&["phone","phonenumber"].includes(r)?["Phone","name:phone"]:ot(rn(t,"type"),"string")&&["website","url","homepage"].includes(r)?["Url","name:url"]:ot(rn(t,"type"),"string")&&(["file","attachment","upload"].includes(r)||X0(r,["storageref","fileref","attachmentref"]))?["File","name:file"]:Qa(t)&&["progress","percentcomplete","percentdone","completion"].includes(r)?["Progress","name:progress"]:ot(rn(t,"type"),"string")&&["country","countrycode","countryname"].includes(r)?["Country","name:country"]:ot(rn(t,"type"),"string")&&["address","streetaddress","billingaddress","shippingaddress"].includes(r)?["Address","name:address"]:ot(rn(t,"type"),"string")&&Kq(r)?["ParentRef","name:parent-ref"]:ot(rn(t,"type"),"string")&&["name","title","label","displayname"].includes(r)?["Label","name:label"]:ot(rn(t,"type"),"string")&&nF.includes(r)?["UserRef","name:user"]:void 0}function oF(e){return["lat","latitude"].includes(e)}function sF(e){return["lng","lon","long","longitude"].includes(e)}function Wq(e){let t=Yr(e),r=t.some(i=>oF(i[0].toLowerCase())?Qa(i[1]):!1),n=t.some(i=>sF(i[0].toLowerCase())?Qa(i[1]):!1);return r?n:!1}function Gq(e){return["createdat","updatedat","deletedat"].includes(e)}let Q2={contents:[]};function aF(e,t,r){let n=e+"."+t+"."+r;if(Q2.contents.some(o=>o===n))return;Q2.contents.push(n);let i=Mq.map(Dh).join(", ");console.error('[AutoUI] Unknown semantic "'+r+'" ('+e+') on field "'+t+'" — ignored. Valid ids: '+i+".")}function wx(e,t){let r=nu(t),n=r.semanticFromType?"Type":"Annotation",i=T(r.semantic,l=>{let u=Sx(l);if(u!==void 0)return{semantic:u,provenance:n};aF("x-reventless-semantic",e,l)});if(i!==void 0)return i;let o=e.toLowerCase(),s=ot(rn(t,"type"),"object")&&qq(t)?["Address","shape:address"]:ot(rn(t,"type"),"object")&&Wq(t)?["GeoPoint","shape:geo-point"]:oF(o)&&Qa(t)?["GeoLat","name:geo-pair"]:sF(o)&&Qa(t)?["GeoLng","name:geo-pair"]:void 0,a;if(s!==void 0)a=s;else if(ot(rn(t,"type"),"string")&&zq(o))a=["FileUrl","name:file-url"];else{let l=Uq(t);a=l!==void 0?l:Hq(e,t)}return W(a,l=>({semantic:l[0],provenance:{TAG:"Heuristic",_0:l[1]}}))}function Vr(e,t){let r=Yr(e),n={};r.forEach(h=>{let p=h[0],g=T(T(t,m=>O(m,p)),m=>{let v=Sx(m);if(v!==void 0)return{semantic:v,provenance:"Hint"};aF("uiHints.fields",p,m)});if(g!==void 0){n[p]=g;return}else return ie(wx(p,h[1]),m=>{n[p]=m})});let i=h=>r.map(p=>p[0]).find(p=>fe(O(n,p),!1,g=>g.semantic===h)),o=i("GeoLat"),s=i("GeoLng"),a=o!==void 0&&s!==void 0?{latField:o,lngField:s}:void 0,l=se(r,h=>{let p=h[0];if(fe(O(n,p),!1,g=>g.semantic==="DateTime")||Ex(h[1]))return p}),u=l.find(h=>h.toLowerCase().startsWith("start")),d=l.find(h=>h.toLowerCase().startsWith("end")),f=u!==void 0?d!==void 0?{startField:u,endField:d}:{startField:u}:W(l.find(h=>{let p=h.toLowerCase();return Gq(p)?!1:X0(p,["at","date"])?!0:p==="date"}),h=>({startField:h}));return{semantics:n,geo:a,dateSpan:f,statusField:i("Status"),labelField:i("Label"),imageField:i("Image"),parentField:i("ParentRef")}}let lF=mr([]),uF=mr(e=>{}),Jq=lF.Provider,Qq=uF.Provider;function Yq(e){let t=e.initial,r=t!==void 0?t:[],n=oe(()=>r),i=n[1],o=Jr(s=>i(a=>s),[]);return Ar(Qq,{value:o,children:Ar(Jq,{value:n[0],children:e.children})})}let Xq={make:Yq};function pl(){return Ut(lF)}function Zq(){return Ut(uF)}function eV(e){return e===""?e:e.slice(0,1).toUpperCase()+e.slice(1,e.length)}function tV(e){return e.endsWith("s")?e:e+"s"}function ua(e,t){let r=eV(t),n=tV(r),i=e.find(o=>o.name===n);return i!==void 0?i:e.find(o=>o.name===r)}function wa(e,t){return wD(r=>W0(e,W0(t,r)))}function rc(e,t){return W0(e,W0(t,Z9))}function ea(e,t,r,n){let i=[r].concat(n).map(o=>encodeURIComponent(o));return zs(rc(e,t))(kD.of_parts(i.join("/")))}function rV(e){let r=kD.wildcard_match(e).split("/").filter(o=>o!=="");if(r.length===0)return[void 0,[]];let n=W(r[0],o=>decodeURIComponent(o)),i=r.slice(1).map(o=>decodeURIComponent(o));return[n,i]}function Ya(e){let t=parseFloat(e);if(!Number.isNaN(t))return t}var zl=(e=>(e[e.Border=-1]="Border",e[e.Data=0]="Data",e[e.Function=1]="Function",e[e.Position=2]="Position",e[e.Timing=3]="Timing",e[e.Alignment=4]="Alignment",e))(zl||{});const nV=[0,1],cF=[1,0],dF=[2,3],fF=[3,2],iV={L:nV,M:cF,Q:dF,H:fF},oV=/^\d*$/,sV=/^[A-Z0-9 $%*+./:-]*$/,Lv="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",kx=1,Cx=40,Y2=3,aV=3,yp=40,lV=10,hF=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],pF=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];let uV=class{constructor(t,r,n,i){if(this.version=t,this.ecc=r,t<kx||t>Cx)throw new RangeError("Version value out of range");if(i<-1||i>7)throw new RangeError("Mask value out of range");this.size=t*4+17;const o=Array.from({length:this.size}).fill(!1);for(let a=0;a<this.size;a++)this.modules.push(o.slice()),this.types.push(o.map(()=>0));this.drawFunctionPatterns();const s=this.addEccAndInterleave(n);if(this.drawCodewords(s),i===-1){let a=1e9;for(let l=0;l<8;l++){this.applyMask(l),this.drawFormatBits(l);const u=this.getPenaltyScore();u<a&&(i=l,a=u),this.applyMask(l)}}this.mask=i,this.applyMask(i),this.drawFormatBits(i)}size;mask;modules=[];types=[];getModule(t,r){return t>=0&&t<this.size&&r>=0&&r<this.size&&this.modules[r][t]}drawFunctionPatterns(){for(let n=0;n<this.size;n++)this.setFunctionModule(6,n,n%2===0,zl.Timing),this.setFunctionModule(n,6,n%2===0,zl.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const t=this.getAlignmentPatternPositions(),r=t.length;for(let n=0;n<r;n++)for(let i=0;i<r;i++)n===0&&i===0||n===0&&i===r-1||n===r-1&&i===0||this.drawAlignmentPattern(t[n],t[i]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(t){const r=this.ecc[1]<<3|t;let n=r;for(let o=0;o<10;o++)n=n<<1^(n>>>9)*1335;const i=(r<<10|n)^21522;for(let o=0;o<=5;o++)this.setFunctionModule(8,o,As(i,o));this.setFunctionModule(8,7,As(i,6)),this.setFunctionModule(8,8,As(i,7)),this.setFunctionModule(7,8,As(i,8));for(let o=9;o<15;o++)this.setFunctionModule(14-o,8,As(i,o));for(let o=0;o<8;o++)this.setFunctionModule(this.size-1-o,8,As(i,o));for(let o=8;o<15;o++)this.setFunctionModule(8,this.size-15+o,As(i,o));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let t=this.version;for(let n=0;n<12;n++)t=t<<1^(t>>>11)*7973;const r=this.version<<12|t;for(let n=0;n<18;n++){const i=As(r,n),o=this.size-11+n%3,s=Math.floor(n/3);this.setFunctionModule(o,s,i),this.setFunctionModule(s,o,i)}}drawFinderPattern(t,r){for(let n=-4;n<=4;n++)for(let i=-4;i<=4;i++){const o=Math.max(Math.abs(i),Math.abs(n)),s=t+i,a=r+n;s>=0&&s<this.size&&a>=0&&a<this.size&&this.setFunctionModule(s,a,o!==2&&o!==4,zl.Position)}}drawAlignmentPattern(t,r){for(let n=-2;n<=2;n++)for(let i=-2;i<=2;i++)this.setFunctionModule(t+i,r+n,Math.max(Math.abs(i),Math.abs(n))!==1,zl.Alignment)}setFunctionModule(t,r,n,i=zl.Function){this.modules[r][t]=n,this.types[r][t]=i}addEccAndInterleave(t){const r=this.version,n=this.ecc;if(t.length!==k0(r,n))throw new RangeError("Invalid argument");const i=pF[n[0]][r],o=hF[n[0]][r],s=Math.floor(gy(r)/8),a=i-s%i,l=Math.floor(s/i),u=[],d=_V(o);for(let h=0,p=0;h<i;h++){const g=t.slice(p,p+l-o+(h<a?0:1));p+=g.length;const m=bV(g,d);h<a&&g.push(0),u.push(g.concat(m))}const f=[];for(let h=0;h<u[0].length;h++)u.forEach((p,g)=>{(h!==l-o||g>=a)&&f.push(p[h])});return f}drawCodewords(t){if(t.length!==Math.floor(gy(this.version)/8))throw new RangeError("Invalid argument");let r=0;for(let n=this.size-1;n>=1;n-=2){n===6&&(n=5);for(let i=0;i<this.size;i++)for(let o=0;o<2;o++){const s=n-o,l=(n+1&2)===0?this.size-1-i:i;!this.types[l][s]&&r<t.length*8&&(this.modules[l][s]=As(t[r>>>3],7-(r&7)),r++)}}}applyMask(t){if(t<0||t>7)throw new RangeError("Mask value out of range");for(let r=0;r<this.size;r++)for(let n=0;n<this.size;n++){let i;switch(t){case 0:i=(n+r)%2===0;break;case 1:i=r%2===0;break;case 2:i=n%3===0;break;case 3:i=(n+r)%3===0;break;case 4:i=(Math.floor(n/3)+Math.floor(r/2))%2===0;break;case 5:i=n*r%2+n*r%3===0;break;case 6:i=(n*r%2+n*r%3)%2===0;break;case 7:i=((n+r)%2+n*r%3)%2===0;break;default:throw new Error("Unreachable")}!this.types[r][n]&&i&&(this.modules[r][n]=!this.modules[r][n])}}getPenaltyScore(){let t=0;for(let o=0;o<this.size;o++){let s=!1,a=0;const l=[0,0,0,0,0,0,0];for(let u=0;u<this.size;u++)this.modules[o][u]===s?(a++,a===5?t+=Y2:a>5&&t++):(this.finderPenaltyAddHistory(a,l),s||(t+=this.finderPenaltyCountPatterns(l)*yp),s=this.modules[o][u],a=1);t+=this.finderPenaltyTerminateAndCount(s,a,l)*yp}for(let o=0;o<this.size;o++){let s=!1,a=0;const l=[0,0,0,0,0,0,0];for(let u=0;u<this.size;u++)this.modules[u][o]===s?(a++,a===5?t+=Y2:a>5&&t++):(this.finderPenaltyAddHistory(a,l),s||(t+=this.finderPenaltyCountPatterns(l)*yp),s=this.modules[u][o],a=1);t+=this.finderPenaltyTerminateAndCount(s,a,l)*yp}for(let o=0;o<this.size-1;o++)for(let s=0;s<this.size-1;s++){const a=this.modules[o][s];a===this.modules[o][s+1]&&a===this.modules[o+1][s]&&a===this.modules[o+1][s+1]&&(t+=aV)}let r=0;for(const o of this.modules)r=o.reduce((s,a)=>s+(a?1:0),r);const n=this.size*this.size,i=Math.ceil(Math.abs(r*20-n*10)/n)-1;return t+=i*lV,t}getAlignmentPatternPositions(){if(this.version===1)return[];{const t=Math.floor(this.version/7)+2,r=this.version===32?26:Math.ceil((this.version*4+4)/(t*2-2))*2,n=[6];for(let i=this.size-7;n.length<t;i-=r)n.splice(1,0,i);return n}}finderPenaltyCountPatterns(t){const r=t[1],n=r>0&&t[2]===r&&t[3]===r*3&&t[4]===r&&t[5]===r;return(n&&t[0]>=r*4&&t[6]>=r?1:0)+(n&&t[6]>=r*4&&t[0]>=r?1:0)}finderPenaltyTerminateAndCount(t,r,n){return t&&(this.finderPenaltyAddHistory(r,n),r=0),r+=this.size,this.finderPenaltyAddHistory(r,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(t,r){r[0]===0&&(t+=this.size),r.pop(),r.unshift(t)}};function Bs(e,t,r){if(t<0||t>31||e>>>t)throw new RangeError("Value out of range");for(let n=t-1;n>=0;n--)r.push(e>>>n&1)}function As(e,t){return(e>>>t&1)!==0}class Rx{constructor(t,r,n){if(this.mode=t,this.numChars=r,this.bitData=n,r<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}getData(){return this.bitData.slice()}}const cV=[1,10,12,14],dV=[2,9,11,13],fV=[4,8,16,16];function gF(e,t){return e[Math.floor((t+7)/17)+1]}function mF(e){const t=[];for(const r of e)Bs(r,8,t);return new Rx(fV,e.length,t)}function hV(e){if(!vF(e))throw new RangeError("String contains non-numeric characters");const t=[];for(let r=0;r<e.length;){const n=Math.min(e.length-r,3);Bs(Number.parseInt(e.substring(r,r+n),10),n*3+1,t),r+=n}return new Rx(cV,e.length,t)}function pV(e){if(!_F(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");const t=[];let r;for(r=0;r+2<=e.length;r+=2){let n=Lv.indexOf(e.charAt(r))*45;n+=Lv.indexOf(e.charAt(r+1)),Bs(n,11,t)}return r<e.length&&Bs(Lv.indexOf(e.charAt(r)),6,t),new Rx(dV,e.length,t)}function gV(e){return e===""?[]:vF(e)?[hV(e)]:_F(e)?[pV(e)]:[mF(vV(e))]}function vF(e){return oV.test(e)}function _F(e){return sV.test(e)}function mV(e,t){let r=0;for(const n of e){const i=gF(n.mode,t);if(n.numChars>=1<<i)return Number.POSITIVE_INFINITY;r+=4+i+n.bitData.length}return r}function vV(e){e=encodeURI(e);const t=[];for(let r=0;r<e.length;r++)e.charAt(r)!=="%"?t.push(e.charCodeAt(r)):(t.push(Number.parseInt(e.substring(r+1,r+3),16)),r+=2);return t}function gy(e){if(e<kx||e>Cx)throw new RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){const r=Math.floor(e/7)+2;t-=(25*r-10)*r-55,e>=7&&(t-=36)}return t}function k0(e,t){return Math.floor(gy(e)/8)-hF[t[0]][e]*pF[t[0]][e]}function _V(e){if(e<1||e>255)throw new RangeError("Degree out of range");const t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let r=1;for(let n=0;n<e;n++){for(let i=0;i<t.length;i++)t[i]=my(t[i],r),i+1<t.length&&(t[i]^=t[i+1]);r=my(r,2)}return t}function bV(e,t){const r=t.map(n=>0);for(const n of e){const i=n^r.shift();r.push(0),t.forEach((o,s)=>r[s]^=my(o,i))}return r}function my(e,t){if(e>>>8||t>>>8)throw new RangeError("Byte out of range");let r=0;for(let n=7;n>=0;n--)r=r<<1^(r>>>7)*285,r^=(t>>>n&1)*e;return r}function yV(e,t,r=1,n=40,i=-1,o=!0){if(!(kx<=r&&r<=n&&n<=Cx)||i<-1||i>7)throw new RangeError("Invalid value");let s,a;for(s=r;;s++){const f=k0(s,t)*8,h=mV(e,s);if(h<=f){a=h;break}if(s>=n)throw new RangeError("Data too long")}for(const f of[cF,dF,fF])o&&a<=k0(s,f)*8&&(t=f);const l=[];for(const f of e){Bs(f.mode[0],4,l),Bs(f.numChars,gF(f.mode,s),l);for(const h of f.getData())l.push(h)}const u=k0(s,t)*8;Bs(0,Math.min(4,u-l.length),l),Bs(0,(8-l.length%8)%8,l);for(let f=236;l.length<u;f^=253)Bs(f,8,l);const d=Array.from({length:Math.ceil(l.length/8)},()=>0);return l.forEach((f,h)=>d[h>>>3]|=f<<7-(h&7)),new uV(s,t,d,i)}function xV(e,t){const{ecc:r="L",boostEcc:n=!1,minVersion:i=1,maxVersion:o=40,maskPattern:s=-1,border:a=1}=t||{},l=typeof e=="string"?gV(e):Array.isArray(e)?[mF(e)]:void 0;if(!l)throw new Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);const u=yV(l,iV[r],i,o,s,n),d=SV({version:u.version,maskPattern:u.mask,size:u.size,data:u.modules,types:u.types},a);return t?.invert&&(d.data=d.data.map(f=>f.map(h=>!h))),t?.onEncoded?.(d),d}function SV(e,t=1){if(!t)return e;const{size:r}=e,n=r+t*2;e.size=n,e.data.forEach(o=>{for(let s=0;s<t;s++)o.unshift(!1),o.push(!1)});for(let o=0;o<t;o++)e.data.unshift(Array.from({length:n},s=>!1)),e.data.push(Array.from({length:n},s=>!1));const i=zl.Border;e.types.forEach(o=>{for(let s=0;s<t;s++)o.unshift(i),o.push(i)});for(let o=0;o<t;o++)e.types.unshift(Array.from({length:n},s=>i)),e.types.push(Array.from({length:n},s=>i));return e}function EV(e){return"var("+e+")"}let wV=E([L("inlineBlock"),c("background","#ffffff"),c("padding","6px"),c("border-radius",EV(X.md)),c("border","1px solid var("+y.borderSubtle+")"),c("line-height","0")]),kV=E([c("color","#000000"),c("display","block")]);function CV(e){return e.map((t,r)=>t.map((n,i)=>n?"M"+i.toString()+" "+r.toString()+"h1v1h-1z":"").join("")).join("")}function RV(e){if(e.trim()!=="")try{return xV(e,{ecc:"M",border:4})}catch{return}}function AV(e){let t=e.size,r=e.value,n=t!==void 0?t:128,i=RV(r);if(i===void 0)return null;let o=i.size.toString();return b("span",{children:b("svg",{children:b("path",{d:CV(i.data),fill:"currentColor"}),"aria-label":D(e.title,"QR code for "+r),className:kV,role:"img",height:n.toString(),width:n.toString(),shapeRendering:"crispEdges",viewBox:"0 0 "+o+" "+o,xmlns:"http://www.w3.org/2000/svg"}),className:wV})}let TV=AV,$V=["11011001100","11001101100","11001100110","10010011000","10010001100","10001001100","10011001000","10011000100","10001100100","11001001000","11001000100","11000100100","10110011100","10011011100","10011001110","10111001100","10011101100","10011100110","11001110010","11001011100","11001001110","11011100100","11001110100","11101101110","11101001100","11100101100","11100100110","11101100100","11100110100","11100110010","11011011000","11011000110","11000110110","10100011000","10001011000","10001000110","10110001000","10001101000","10001100010","11010001000","11000101000","11000100010","10110111000","10110001110","10001101110","10111011000","10111000110","10001110110","11101110110","11010001110","11000101110","11011101000","11011100010","11011101110","11101011000","11101000110","11100010110","11101101000","11101100010","11100011010","11101111010","11001000010","11110001010","10100110000","10100001100","10010110000","10010000110","10000101100","10000100110","10110010000","10110000100","10011010000","10011000010","10000110100","10000110010","11000010010","11001010000","11110111010","11000010100","10001111010","10100111100","10010111100","10010011110","10111100100","10011110100","10011110010","11110100100","11110010100","11110010010","11011011110","11011110110","11110110110","10101111000","10100011110","10001011110","10111101000","10111100010","11110101000","11110100010","10111011110","10111101110","11101011110","11110101110","11010000100","11010010000","11010011100","1100011101011"];function X2(e){return e>="0"?e<="9":!1}function NV(e){let t=[],r=0,n=e.length;for(;r<n;)if(X2(D(e[r],""))){let i=r;for(;r<n&&X2(D(e[r],""));)r=r+1|0;t.push([i,r-i|0])}else r=r+1|0;return t}function DV(e){let t={};return NV(e).forEach(r=>{let n=r[1],i=r[0],o=n%2,s=n-o|0;if(s<=0)return;let a=(i+n|0)===e.length;if((((o+(i===0&&o===0?0:1)|0)+(s/2|0)|0)+(a?0:1)|0)<n){t[(i+o|0).toString()]=s;return}}),t}function FV(e){let t=e.length;if(t===0||e.split("").some(l=>{let u=D(l.codePointAt(0),0);return u<32?!0:u>126}))return;let n=DV(e),i=[],o=We(n[0]);i.push(o?105:104);let s=o?"C":"B",a=0;for(;a<t;){let l=n[a.toString()];if(l!==void 0){s!=="C"&&(i.push(99),s="C");for(let u=0,d=l/2|0;u<d;++u){let f=e.substring(a+(u<<1)|0,(a+(u<<1)|0)+2|0);i.push(D(_D(f),0))}a=a+l|0}else s==="C"&&(i.push(100),s="B"),i.push(D(e.codePointAt(a),32)-32|0),a=a+1|0}return i}function IV(e){return W(FV(e),t=>{let r={contents:t[0]};return t.forEach((n,i)=>{if(i>0){r.contents=r.contents+(n*i|0)|0;return}}),t.concat([r.contents%103,106]).map(n=>$V[n]).join("")})}function PV(e,t,r){let n=r.toString(),i=[],o=0,s=e.length;for(;o<s;)if(ot(e[o],"1")){let a=o;for(;o<s&&ot(e[o],"1");)o=o+1|0;let l=(o-a|0).toString();i.push("M"+(a+t|0).toString()+" 0h"+l+"v"+n+"h-"+l+"z")}else o=o+1|0;return i.join("")}function OV(e){return"var("+e+")"}let MV=E([L("inlineBlock"),_j({NAME:"percent",VAL:100}),c("overflow-x","auto"),c("background","#ffffff"),c("padding","6px"),c("border-radius",OV(X.md)),c("border","1px solid var("+y.borderSubtle+")"),c("line-height","0")]),LV=E([c("color","#000000"),c("display","block")]);function zV(e){let t=e.moduleWidth,r=e.height,n=e.value,i=r!==void 0?r:64,o=t!==void 0?t:2,s=IV(n);if(s===void 0)return null;let a=s.length+20|0;return b("span",{children:b("svg",{children:b("path",{d:PV(s,10,40),fill:"currentColor"}),"aria-label":D(e.title,"Barcode for "+n),className:LV,role:"img",height:i.toString(),width:(a*o|0).toString(),preserveAspectRatio:"none",shapeRendering:"crispEdges",viewBox:"0 0 "+a.toString()+" 40",xmlns:"http://www.w3.org/2000/svg"}),className:MV})}let UV=zV;function Ii(e){return"var("+e+")"}let BV=E([Ot("fixed"),aa(ke(0)),od(ke(0)),hl(ke(0)),vx(ke(0)),c("background","rgba(0,0,0,0.82)"),L("flex"),he("column"),ee("center"),Qe("center"),c("gap",Ii(F.md)),c("padding",Ii(F.lg)),c("z-index","1100")]),jV=E([c("max-width","min(92vw, 1400px)"),c("max-height","78vh"),c("object-fit","contain"),c("border-radius",Ii(X.sm)),c("box-shadow",Ii(pn.lg))]),qV=E([L("flex"),ee("center"),c("gap",Ii(F.md)),c("max-width","100%")]),VV=E([L("flex"),ee("center"),c("gap",Ii(F.md)),c("max-width","92vw"),c("color","#f5f5f5"),c("font-size",Ii($.sizeSm))]),KV=E([c("font-size",Ii($.sizeMd)),c("font-weight",Ii($.weightMedium)),c("overflow","hidden"),c("text-overflow","ellipsis"),c("white-space","nowrap")]),HV=E([c("color","#c8c8c8")]),WV=E([c("font-family",Ii($.fontFamilyMono)),c("color","#c8c8c8")]),bF=E([L("inlineFlex"),ee("center"),Qe("center"),c("background","rgba(255,255,255,0.12)"),c("border","1px solid rgba(255,255,255,0.25)"),c("border-radius",Ii(X.md)),c("color","#f5f5f5"),c("padding","4px var("+F.sm+")"),c("font-size",Ii($.sizeSm)),we("pointer"),Ye([c("background","rgba(255,255,255,0.22)")])]),Z2=$n([bF,E([c("width","40px"),c("height","40px"),c("border-radius","50%"),c("font-size",Ii($.sizeLg)),Li(0)])]),GV=$n([bF,E([Ot("absolute"),aa(ke(16)),hl(ke(16)),c("width","32px")])]);function Vu(e,t,r){return t===0?0:Oo(Oo(e+r|0,t)+t|0,t)}function JV(e){let t=e.onClose,r=e.onIndexChange,n=e.index,i=e.slides,o=i.length,s=o>1;Re(()=>{let d=f=>{switch(f.key){case"ArrowLeft":return s?r(Vu(n,o,-1)):void 0;case"ArrowRight":return s?r(Vu(n,o,1)):void 0;case"Escape":return t();default:return}};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[n,o]);let a=i[Vu(n,o,0)];if(a===void 0)return null;let l=a.title,u=a.caption;return M("div",{children:[b("button",{children:"✕",className:GV,title:"Close",type:"button",onClick:d=>t()}),M("div",{children:[s?b("button",{children:"‹",className:Z2,title:"Previous",type:"button",onClick:d=>r(Vu(n,o,-1))}):null,b("img",{className:jV,alt:D(a.title,""),src:a.src}),s?b("button",{children:"›",className:Z2,title:"Next",type:"button",onClick:d=>r(Vu(n,o,1))}):null],className:qV,onClick:d=>{d.stopPropagation()}}),M("div",{children:[l!==void 0?b("span",{children:l,className:KV,title:l}):null,u!==void 0?b("span",{children:u,className:HV}):null,s?b("span",{children:(Vu(n,o,0)+1|0).toString()+" / "+o.toString(),className:WV}):null,D(e.action,null)],className:VV,onClick:d=>{d.stopPropagation()}})],"aria-modal":!0,className:BV,role:"dialog",onClick:d=>t()})}let yF=JV;function jl(e){return"var("+e+")"}function QV(e){return E([c("width","100%"),c("height",e),c("border","1px solid var("+y.borderSubtle+")"),c("border-radius",jl(X.md)),c("background",jl(y.surfaceSubtle)),fl("hidden")])}let YV=E([L("flex"),he("column"),ee("center"),Qe("center"),c("gap",jl(F.sm)),c("height","100%"),c("padding",jl(F.lg)),c("color",jl(y.textSecondary)),c("font-size",jl($.sizeSm)),c("text-align","center")]),XV=E([c("color",jl(y.brand)),c("text-decoration","none"),Ye([c("text-decoration","underline")])]);function ZV(e){return D(D(e.split("?")[0],e).split("#")[0],e).toLowerCase().endsWith(".pdf")}function eK(e){let t=e.height,r=e.title,n=e.src,i=r!==void 0?r:"Document",o=t!==void 0?t:"70vh";return b("object",{children:M("div",{children:["This browser can't display the document inline.",b("a",{children:"Open "+i,className:XV,href:n,rel:"noopener noreferrer",target:"_blank"})],className:YV}),"aria-label":i,className:QV(o),data:n,type:"application/pdf"})}let tK=eK;function xF(e){return e==="Small"?"13px":"18px"}let SF="★";function rK(e,t){let r=t<=0?1:t;return(e<0?0:e>r?r:e)/r}function iu(e){return"var("+e+")"}function nK(e){return E([L("inlineFlex"),Ot("relative"),c("font-size",xF(e)),c("line-height","1"),c("letter-spacing","1px"),c("white-space","nowrap"),c("vertical-align","-1px")])}let iK=E([c("color",iu(y.borderSubtle))]);function oK(e){return E([Ot("absolute"),c("top","0"),c("left","0"),c("width",(e*100).toString()+"%"),fl("hidden"),c("white-space","nowrap"),c("color",iu(y.warning)),c("pointer-events","none")])}let ek=E([L("inlineFlex"),c("gap","2px"),ee("center")]);function sK(e,t){return E([c("background","none"),c("border","none"),c("padding","0 1px"),c("font-size",xF(t)),c("line-height","1"),we("pointer"),c("color",iu(e?y.warning:y.borderSubtle)),c("transition","color 120ms, transform 120ms"),Ye([c("transform","scale(1.15)")]),xr("&:focus-visible",[c("outline","2px solid var("+y.brand+")"),c("outline-offset","1px"),c("border-radius","2px")])])}let tk=E([c("color",iu(y.textSecondary)),c("font-size",iu($.sizeSm))]),aK=E([L("inlineFlex"),ee("center"),c("gap","6px")]),lK=E([c("border","1px solid var("+y.error+")"),c("border-radius",iu(X.sm)),c("padding","2px 4px")]);function uK(e){return mD(e<=0?0:e,SF).join("")}function cK(e){let t=e.hasError,r=e.onBlur,n=e.onChange,i=e.showValue,o=e.size,s=e.max,a=e.value,l=s!==void 0?s:5,u=o!==void 0?o:"Small",d=i!==void 0?i:!1,f=t!==void 0?t:!1,h=l<=0?5:l,p=uK(h),g=D(e.label,(Math.round(a*10)/10).toString()+" of "+h.toString());return n!==void 0?M("span",{children:[Ja(h,m=>m+1|0).map(m=>{let v=m<=a;return b("button",{children:SF,"aria-label":m.toString()+" of "+h.toString(),"aria-pressed":v?"true":"false",className:sK(v,u),title:m.toString()+" of "+h.toString(),type:"button",onBlur:_=>ie(r,x=>x()),onClick:_=>{_.stopPropagation(),n(m===a?0:m)}},m.toString())}),d?b("span",{children:a<=0?"—":a.toString(),className:tk}):null],"aria-label":g,className:f?ek+" "+lK:ek,role:"group"}):M("span",{children:[M("span",{children:[b("span",{children:p,className:iK}),b("span",{children:p,className:oK(rK(a,h))})],"aria-label":g,className:nK(u),role:"img",title:g}),d?b("span",{children:(Math.round(a*10)/10).toString()+" / "+h.toString(),className:tk}):null],className:aK})}let zv=cK;function ou(e){return"var("+e+")"}let dK=E([L("flex"),he("column"),c("gap","4px")]),fK=E([L("flex"),Qe("spaceBetween"),c("font-size",ou($.sizeSm))]),hK=E([c("color",ou(y.textSecondary))]),pK=E([c("color",ou(y.textPrimary)),c("font-weight",ou($.weightMedium))]),gK=E([c("background",ou(y.surfaceSubtle)),c("border-radius",ou(X.full)),c("height","8px"),fl("hidden")]);function mK(e,t){return E([c("background",t!==void 0?t:"var("+y.brand+")"),c("border-radius",ou(X.full)),c("height","100%"),c("width",e.toString()+"%"),c("transition","width 0.3s ease")])}function vK(e){let t=e.showValue,r=e.label,n=e.value,i=t!==void 0?t:!0,o=n>100?100:n,s=o<0?0:o;return M("div",{children:[We(r)||i?M("div",{children:[fe(r,null,a=>b("span",{children:a,className:hK})),i?b("span",{children:Math.round(s).toString()+"%",className:pK}):null],className:fK}):null,b("div",{children:b("div",{className:mK(s,e.color)}),className:gK})],className:dK})}let EF=vK,fm={};function wF(e){fm[e.id]=e}function kF(e){return O(fm,e)}let CF={};function _K(e){return fe(O(fm,e),CF,t=>t.constraints)}let rk={contents:[]};function bK(e,t){if(rk.contents.some(n=>n===e))return;rk.contents.push(e);let r=AD(fm).map(n=>n.id).join(", ");console.error('[AutoUI] Unknown channel "'+e+'" ('+t+") — falling back to a plain-text preview. Registered channels: "+(r===""?"(none — has the channel adapter's init() run?)":r))}let RF="#111111";function Co(e){return"var("+e+")"}let nk=E([L("flex"),he("column"),c("gap",Co(F.xs))]);function yK(e){return E([c("background","#ffffff"),c("border",e?"1px solid var("+y.error+")":"1px dashed var("+y.border+")"),c("border-radius",Co(X.md)),c("touch-action","none"),c("max-width","100%"),c("width","100%"),c("height","auto"),we("crosshair"),c("display","block")])}let xK=E([c("fill","#9ca3af"),c("font-size","13px"),c("pointer-events","none"),c("user-select","none")]),SK=E([c("stroke","#e5e7eb"),c("stroke-width","1")]),ik=E([L("flex"),ee("center"),c("gap",Co(F.sm)),c("font-size",Co($.sizeXs)),c("color",Co(y.textSecondary))]),ok=E([c("background","none"),c("border","1px solid var("+y.border+")"),c("border-radius",Co(X.sm)),c("color",Co(y.textSecondary)),c("font-size",Co($.sizeXs)),c("padding","2px 8px"),we("pointer"),Ye([c("border-color",Co(y.brand)),c("color",Co(y.brand))])]),EK=E([c("background","#ffffff"),c("border","1px solid var("+y.borderSubtle+")"),c("border-radius",Co(X.md)),c("padding","4px"),c("display","inline-block"),c("line-height","0")]),wK=E([c("display","block"),c("max-width","100%"),c("height","auto")]);function ii(e){return(Math.round(e*10)/10).toString()}function AF(e){return e.map(t=>ii(t.x)+","+ii(t.y)).join(" ")}function kK(e,t,r){let n=e.filter(o=>o.length!==0);if(n.length===0)return"";let i=n.map(o=>{let s=o.length===1?o.concat(o):o;return'<polyline points="'+AF(s)+'"/>'}).join("");return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+ii(t)+" "+ii(r)+'" width="'+ii(t)+'" height="'+ii(r)+'"><g fill="none" stroke="'+RF+'" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">'+i+"</g></svg>"}function sk(e){return e.trim().startsWith("<svg")}function TF(e){return"data:image/svg+xml;utf8,"+encodeURIComponent(e)}function CK(e,t){let r=e.x-t.x,n=e.y-t.y;return r*r+n*n>=1.5*1.5}function RK(e){let t=e.hasError,r=e.height,n=e.width,i=e.onBlur,o=e.onChange,s=e.value,a=n!==void 0?n:480,l=r!==void 0?r:160,u=t!==void 0?t:!1,d=Je(null),f=oe(()=>[]),h=f[1],p=f[0],g=oe(()=>!1),m=g[1],v=Je(!1),_=R=>W(ms(d.current),N=>{let I=N.getBoundingClientRect(),P=I.width===0?1:a/I.width,z=I.height===0?1:l/I.height;return{x:(R.clientX-I.left)*P,y:(R.clientY-I.top)*z}}),x=R=>o(kK(R,a,l)),w=R=>{R.preventDefault();let N=_(R);if(N!==void 0)return v.current=!0,ie(ms(d.current),I=>{I.setPointerCapture(R.pointerId)}),h(I=>I.concat([[N]]))},S=R=>{if(!v.current)return;let N=_(R);if(N!==void 0)return h(I=>{let P=I[I.length-1|0];if(P===void 0)return I;let z=P[P.length-1|0];return z!==void 0&&!CK(N,z)?I:I.slice(0,I.length-1|0).concat([P.concat([N])])})},k=R=>{if(v.current)return v.current=!1,x(p),ie(i,N=>N())},A=()=>{h(R=>[]),m(R=>!0),o("")},C=p.length!==0;return s.trim().startsWith("<svg")&&!C&&!g[0]?M("div",{children:[b("span",{children:b("img",{className:wK,alt:"Signature",src:TF(s)}),className:EK}),b("div",{children:b("button",{children:"Sign again",className:ok,type:"button",onClick:R=>A()}),className:ik})],className:nk}):M("div",{children:[M("svg",{children:[b("line",{className:SK,x1:ii(a*.06),x2:ii(a*.94),y1:ii(l*.78),y2:ii(l*.78)}),C?null:b("text",{children:"Sign here",className:xK,textAnchor:"middle",x:ii(a/2),y:ii(l*.7)}),b("g",{children:p.map((R,N)=>b("polyline",{points:AF(R.length===1?R.concat(R):R)},N.toString())),fill:"none",stroke:RF,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})],ref:pr(d),"aria-label":"Signature pad",className:yK(u),role:"img",onPointerDown:w,onPointerMove:S,onPointerUp:k,onPointerCancel:k,viewBox:"0 0 "+ii(a)+" "+ii(l),xmlns:"http://www.w3.org/2000/svg"}),M("div",{children:[C?b("button",{children:"Clear",className:ok,type:"button",onClick:R=>A()}):null,b("span",{children:"Draw your signature above"})],className:ik})],className:nk})}let AK=RK;function TK(e,t,r){let n={};return n[t]=r,Object.assign({},e,n)}function Yi(e){return"var("+e+")"}let $K=E([L("flex"),he("column"),c("gap",Yi(F.sm))]),NK=E([L("flex"),c("gap","4px")]),ak=E([c("background","none"),c("border","1px solid var("+y.border+")"),c("border-radius",Yi(X.sm)),c("color",Yi(y.textSecondary)),c("font-size",Yi($.sizeXs)),c("padding","2px 8px"),we("pointer")]),DK=E([c("background",Yi(y.brandSubtle)),c("border-color",Yi(y.brand)),c("color",Yi(y.textPrimary))]),FK=E([Uo({NAME:"percent",VAL:100}),c("min-height","220px"),c("border","1px solid var("+y.borderSubtle+")"),c("border-radius",Yi(X.sm)),c("background","#ffffff")]),IK=E([c("margin","0"),c("font-family",Yi($.fontFamilyMono)),c("font-size",Yi($.sizeXs)),c("line-height",Yi($.lineHeightRelaxed)),c("color",Yi(y.textPrimary)),c("white-space","pre-wrap"),c("word-break","break-word")]);function PK(e){let t=e.textAlternative,r=oe(()=>!1),n=r[1],i=r[0],o=(l,u,d)=>b("button",{children:l,className:u?ak+" "+DK:ak,type:"button",onClick:d}),s,a=0;return i&&t!==void 0?s=b("pre",{children:t,className:IK}):a=1,a===1&&(s=b("iframe",{className:FK,title:"Email preview",sandbox:"",srcDoc:e.html})),M("div",{children:[t!==void 0?M("div",{children:[o("HTML",!i,l=>n(u=>!1)),o("Plain text",i,l=>n(u=>!0))],className:NK}):null,s],className:$K})}function OK(e,t){return b(PK,{html:e.body,textAlternative:e.textAlternative})}function MK(){wF({id:"email",label:"Email",constraints:{subjectMaxLength:78,note:"Subject lines are elided in inbox lists past ~78 characters"},preview:OK})}const lk={};function LK(e){let t=lk[e];if(t)return t;t=lk[e]=[];for(let r=0;r<128;r++){const n=String.fromCharCode(r);t.push(n)}for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);t[n]="%"+("0"+n.toString(16).toUpperCase()).slice(-2)}return t}function zc(e,t){typeof t!="string"&&(t=zc.defaultChars);const r=LK(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(n){let i="";for(let o=0,s=n.length;o<s;o+=3){const a=parseInt(n.slice(o+1,o+3),16);if(a<128){i+=r[a];continue}if((a&224)===192&&o+3<s){const l=parseInt(n.slice(o+4,o+6),16);if((l&192)===128){const u=a<<6&1984|l&63;u<128?i+="��":i+=String.fromCharCode(u),o+=3;continue}}if((a&240)===224&&o+6<s){const l=parseInt(n.slice(o+4,o+6),16),u=parseInt(n.slice(o+7,o+9),16);if((l&192)===128&&(u&192)===128){const d=a<<12&61440|l<<6&4032|u&63;d<2048||d>=55296&&d<=57343?i+="���":i+=String.fromCharCode(d),o+=6;continue}}if((a&248)===240&&o+9<s){const l=parseInt(n.slice(o+4,o+6),16),u=parseInt(n.slice(o+7,o+9),16),d=parseInt(n.slice(o+10,o+12),16);if((l&192)===128&&(u&192)===128&&(d&192)===128){let f=a<<18&1835008|l<<12&258048|u<<6&4032|d&63;f<65536||f>1114111?i+="����":(f-=65536,i+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),o+=9;continue}}i+="�"}return i})}zc.defaultChars=";/?:@&=+$,#";zc.componentChars="";const uk={};function zK(e){let t=uk[e];if(t)return t;t=uk[e]=[];for(let r=0;r<128;r++){const n=String.fromCharCode(r);/^[0-9a-z]$/i.test(n)?t.push(n):t.push("%"+("0"+r.toString(16).toUpperCase()).slice(-2))}for(let r=0;r<e.length;r++)t[e.charCodeAt(r)]=e[r];return t}function Fh(e,t,r){typeof t!="string"&&(r=t,t=Fh.defaultChars),typeof r>"u"&&(r=!0);const n=zK(t);let i="";for(let o=0,s=e.length;o<s;o++){const a=e.charCodeAt(o);if(r&&a===37&&o+2<s&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3))){i+=e.slice(o,o+3),o+=2;continue}if(a<128){i+=n[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&o+1<s){const l=e.charCodeAt(o+1);if(l>=56320&&l<=57343){i+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(e[o])}return i}Fh.defaultChars=";/?:@&=+$,-_.!~*'()#";Fh.componentChars="-_.!~*'()";function Ax(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Z0(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const UK=/^([a-z0-9.+-]+:)/i,BK=/:[0-9]*$/,jK=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,qK=["<",">",'"',"`"," ","\r",`
3
- `," "],VK=["{","}","|","\\","^","`"].concat(qK),KK=["'"].concat(VK),ck=["%","/","?",";","#"].concat(KK),dk=["/","?","#"],HK=255,fk=/^[+a-z0-9A-Z_-]{0,63}$/,WK=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,hk={javascript:!0,"javascript:":!0},pk={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Tx(e,t){if(e&&e instanceof Z0)return e;const r=new Z0;return r.parse(e,t),r}Z0.prototype.parse=function(e,t){let r,n,i,o=e;if(o=o.trim(),!t&&e.split("#").length===1){const u=jK.exec(o);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let s=UK.exec(o);if(s&&(s=s[0],r=s.toLowerCase(),this.protocol=s,o=o.substr(s.length)),(t||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=o.substr(0,2)==="//",i&&!(s&&hk[s])&&(o=o.substr(2),this.slashes=!0)),!hk[s]&&(i||s&&!pk[s])){let u=-1;for(let g=0;g<dk.length;g++)n=o.indexOf(dk[g]),n!==-1&&(u===-1||n<u)&&(u=n);let d,f;u===-1?f=o.lastIndexOf("@"):f=o.lastIndexOf("@",u),f!==-1&&(d=o.slice(0,f),o=o.slice(f+1),this.auth=d),u=-1;for(let g=0;g<ck.length;g++)n=o.indexOf(ck[g]),n!==-1&&(u===-1||n<u)&&(u=n);u===-1&&(u=o.length),o[u-1]===":"&&u--;const h=o.slice(0,u);o=o.slice(u),this.parseHost(h),this.hostname=this.hostname||"";const p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p){const g=this.hostname.split(/\./);for(let m=0,v=g.length;m<v;m++){const _=g[m];if(_&&!_.match(fk)){let x="";for(let w=0,S=_.length;w<S;w++)_.charCodeAt(w)>127?x+="x":x+=_[w];if(!x.match(fk)){const w=g.slice(0,m),S=g.slice(m+1),k=_.match(WK);k&&(w.push(k[1]),S.unshift(k[2])),S.length&&(o=S.join(".")+o),this.hostname=w.join(".");break}}}}this.hostname.length>HK&&(this.hostname=""),p&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=o.indexOf("#");a!==-1&&(this.hash=o.substr(a),o=o.slice(0,a));const l=o.indexOf("?");return l!==-1&&(this.search=o.substr(l),o=o.slice(0,l)),o&&(this.pathname=o),pk[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Z0.prototype.parseHost=function(e){let t=BK.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const GK=Object.freeze(Object.defineProperty({__proto__:null,decode:zc,encode:Fh,format:Ax,parse:Tx},Symbol.toStringTag,{value:"Module"})),$F=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,NF=/[\0-\x1F\x7F-\x9F]/,JK=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,$x=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,DF=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,FF=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,QK=Object.freeze(Object.defineProperty({__proto__:null,Any:$F,Cc:NF,Cf:JK,P:$x,S:DF,Z:FF},Symbol.toStringTag,{value:"Module"})),YK=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),XK=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var Uv;const ZK=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),eH=(Uv=String.fromCodePoint)!==null&&Uv!==void 0?Uv:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function tH(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=ZK.get(e))!==null&&t!==void 0?t:e}var ln;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(ln||(ln={}));const rH=32;var Ia;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Ia||(Ia={}));function vy(e){return e>=ln.ZERO&&e<=ln.NINE}function nH(e){return e>=ln.UPPER_A&&e<=ln.UPPER_F||e>=ln.LOWER_A&&e<=ln.LOWER_F}function iH(e){return e>=ln.UPPER_A&&e<=ln.UPPER_Z||e>=ln.LOWER_A&&e<=ln.LOWER_Z||vy(e)}function oH(e){return e===ln.EQUALS||iH(e)}var tn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(tn||(tn={}));var js;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(js||(js={}));class sH{constructor(t,r,n){this.decodeTree=t,this.emitCodePoint=r,this.errors=n,this.state=tn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=js.Strict}startEntity(t){this.decodeMode=t,this.state=tn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,r){switch(this.state){case tn.EntityStart:return t.charCodeAt(r)===ln.NUM?(this.state=tn.NumericStart,this.consumed+=1,this.stateNumericStart(t,r+1)):(this.state=tn.NamedEntity,this.stateNamedEntity(t,r));case tn.NumericStart:return this.stateNumericStart(t,r);case tn.NumericDecimal:return this.stateNumericDecimal(t,r);case tn.NumericHex:return this.stateNumericHex(t,r);case tn.NamedEntity:return this.stateNamedEntity(t,r)}}stateNumericStart(t,r){return r>=t.length?-1:(t.charCodeAt(r)|rH)===ln.LOWER_X?(this.state=tn.NumericHex,this.consumed+=1,this.stateNumericHex(t,r+1)):(this.state=tn.NumericDecimal,this.stateNumericDecimal(t,r))}addToNumericResult(t,r,n,i){if(r!==n){const o=n-r;this.result=this.result*Math.pow(i,o)+parseInt(t.substr(r,o),i),this.consumed+=o}}stateNumericHex(t,r){const n=r;for(;r<t.length;){const i=t.charCodeAt(r);if(vy(i)||nH(i))r+=1;else return this.addToNumericResult(t,n,r,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,n,r,16),-1}stateNumericDecimal(t,r){const n=r;for(;r<t.length;){const i=t.charCodeAt(r);if(vy(i))r+=1;else return this.addToNumericResult(t,n,r,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,n,r,10),-1}emitNumericEntity(t,r){var n;if(this.consumed<=r)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===ln.SEMI)this.consumed+=1;else if(this.decodeMode===js.Strict)return 0;return this.emitCodePoint(tH(this.result),this.consumed),this.errors&&(t!==ln.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,r){const{decodeTree:n}=this;let i=n[this.treeIndex],o=(i&Ia.VALUE_LENGTH)>>14;for(;r<t.length;r++,this.excess++){const s=t.charCodeAt(r);if(this.treeIndex=aH(n,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===js.Attribute&&(o===0||oH(s))?0:this.emitNotTerminatedNamedEntity();if(i=n[this.treeIndex],o=(i&Ia.VALUE_LENGTH)>>14,o!==0){if(s===ln.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==js.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:r,decodeTree:n}=this,i=(n[r]&Ia.VALUE_LENGTH)>>14;return this.emitNamedEntityData(r,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,r,n){const{decodeTree:i}=this;return this.emitCodePoint(r===1?i[t]&~Ia.VALUE_LENGTH:i[t+1],n),r===3&&this.emitCodePoint(i[t+2],n),n}end(){var t;switch(this.state){case tn.NamedEntity:return this.result!==0&&(this.decodeMode!==js.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case tn.NumericDecimal:return this.emitNumericEntity(0,2);case tn.NumericHex:return this.emitNumericEntity(0,3);case tn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case tn.EntityStart:return 0}}}function IF(e){let t="";const r=new sH(e,n=>t+=eH(n));return function(i,o){let s=0,a=0;for(;(a=i.indexOf("&",a))>=0;){t+=i.slice(s,a),r.startEntity(o);const u=r.write(i,a+1);if(u<0){s=a+r.end();break}s=a+u,a=u===0?s+1:s}const l=t+i.slice(s);return t="",l}}function aH(e,t,r,n){const i=(t&Ia.BRANCH_LENGTH)>>7,o=t&Ia.JUMP_TABLE;if(i===0)return o!==0&&n===o?r:-1;if(o){const l=n-o;return l<0||l>=i?-1:e[r+l]-1}let s=r,a=s+i-1;for(;s<=a;){const l=s+a>>>1,u=e[l];if(u<n)s=l+1;else if(u>n)a=l-1;else return e[l+i]}return-1}const PF=IF(YK);IF(XK);function lH(e,t=js.Legacy){return PF(e,t)}function uH(e){return PF(e,js.Strict)}function cH(e){return Object.prototype.toString.call(e)}function Nx(e){return cH(e)==="[object String]"}const dH=Object.prototype.hasOwnProperty;function fH(e,t){return dH.call(e,t)}function hm(e){return Array.prototype.slice.call(arguments,1).forEach(function(r){if(r){if(typeof r!="object")throw new TypeError(r+"must be object");Object.keys(r).forEach(function(n){e[n]=r[n]})}}),e}function OF(e,t,r){return[].concat(e.slice(0,t),r,e.slice(t+1))}function Dx(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Vf(e){if(e>65535){e-=65536;const t=55296+(e>>10),r=56320+(e&1023);return String.fromCharCode(t,r)}return String.fromCharCode(e)}const MF=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,hH=/&([a-z#][a-z0-9]{1,31});/gi,pH=new RegExp(MF.source+"|"+hH.source,"gi"),gH=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function mH(e,t){if(t.charCodeAt(0)===35&&gH.test(t)){const n=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Dx(n)?Vf(n):e}const r=lH(e);return r!==e?r:e}function vH(e){return e.indexOf("\\")<0?e:e.replace(MF,"$1")}function Uc(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(pH,function(t,r,n){return r||mH(t,n)})}const _H=/[&<>"]/,bH=/[&<>"]/g,yH={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function xH(e){return yH[e]}function Xa(e){return _H.test(e)?e.replace(bH,xH):e}const SH=/[.?*+^$[\]\\(){}|-]/g;function EH(e){return e.replace(SH,"\\$&")}function er(e){switch(e){case 9:case 32:return!0}return!1}function Kf(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function LF(e){return $x.test(e)||DF.test(e)}function Hf(e){return LF(Vf(e))}function Wf(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function pm(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function gk(e){return e===32||e===9||e===10||e===13}function gm(e){let t=0;for(;t<e.length&&gk(e.charCodeAt(t));t++);let r=e.length-1;for(;r>=t&&gk(e.charCodeAt(r));r--);return e.slice(t,r+1)}const wH={mdurl:GK,ucmicro:QK},kH=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:OF,asciiTrim:gm,assign:hm,escapeHtml:Xa,escapeRE:EH,fromCodePoint:Vf,has:fH,isMdAsciiPunct:Wf,isPunctChar:LF,isPunctCharCode:Hf,isSpace:er,isString:Nx,isValidEntityCode:Dx,isWhiteSpace:Kf,lib:wH,normalizeReference:pm,unescapeAll:Uc,unescapeMd:vH},Symbol.toStringTag,{value:"Module"}));function CH(e,t,r){let n,i,o,s;const a=e.posMax,l=e.pos;for(e.pos=t+1,n=1;e.pos<a;){if(o=e.src.charCodeAt(e.pos),o===93&&(n--,n===0)){i=!0;break}if(s=e.pos,e.md.inline.skipToken(e),o===91){if(s===e.pos-1)n++;else if(r)return e.pos=l,-1}}let u=-1;return i&&(u=e.pos),e.pos=l,u}function RH(e,t,r){let n,i=t;const o={ok:!1,pos:0,str:""};if(e.charCodeAt(i)===60){for(i++;i<r;){if(n=e.charCodeAt(i),n===10||n===60)return o;if(n===62)return o.pos=i+1,o.str=Uc(e.slice(t+1,i)),o.ok=!0,o;if(n===92&&i+1<r){i+=2;continue}i++}return o}let s=0;for(;i<r&&(n=e.charCodeAt(i),!(n===32||n<32||n===127));){if(n===92&&i+1<r){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(n===40&&(s++,s>32))return o;if(n===41){if(s===0)break;s--}i++}return t===i||s!==0||(o.str=Uc(e.slice(t,i)),o.pos=i,o.ok=!0),o}function AH(e,t,r,n){let i,o=t;const s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(n)s.str=n.str,s.marker=n.marker;else{if(o>=r)return s;let a=e.charCodeAt(o);if(a!==34&&a!==39&&a!==40)return s;t++,o++,a===40&&(a=41),s.marker=a}for(;o<r;){if(i=e.charCodeAt(o),i===s.marker)return s.pos=o+1,s.str+=Uc(e.slice(t,o)),s.ok=!0,s;if(i===40&&s.marker===41)return s;i===92&&o+1<r&&o++,o++}return s.can_continue=!0,s.str+=Uc(e.slice(t,o)),s}const TH=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:RH,parseLinkLabel:CH,parseLinkTitle:AH},Symbol.toStringTag,{value:"Module"})),Ss={};Ss.code_inline=function(e,t,r,n,i){const o=e[t];return"<code"+i.renderAttrs(o)+">"+Xa(o.content)+"</code>"};Ss.code_block=function(e,t,r,n,i){const o=e[t];return"<pre"+i.renderAttrs(o)+"><code>"+Xa(e[t].content)+`</code></pre>
4
- `};Ss.fence=function(e,t,r,n,i){const o=e[t],s=o.info?Uc(o.info).trim():"";let a="",l="";if(s){const d=s.split(/(\s+)/g);a=d[0],l=d.slice(2).join("")}let u;if(r.highlight?u=r.highlight(o.content,a,l)||Xa(o.content):u=Xa(o.content),u.indexOf("<pre")===0)return u+`
5
- `;if(s){const d=o.attrIndex("class"),f=o.attrs?o.attrs.slice():[];d<0?f.push(["class",r.langPrefix+a]):(f[d]=f[d].slice(),f[d][1]+=" "+r.langPrefix+a);const h={attrs:f};return`<pre><code${i.renderAttrs(h)}>${u}</code></pre>
6
- `}return`<pre><code${i.renderAttrs(o)}>${u}</code></pre>
7
- `};Ss.image=function(e,t,r,n,i){const o=e[t];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,r,n),i.renderToken(e,t,r)};Ss.hardbreak=function(e,t,r){return r.xhtmlOut?`<br />
8
- `:`<br>
9
- `};Ss.softbreak=function(e,t,r){return r.breaks?r.xhtmlOut?`<br />
10
- `:`<br>
11
- `:`
12
- `};Ss.text=function(e,t){return Xa(e[t].content)};Ss.html_block=function(e,t){return e[t].content};Ss.html_inline=function(e,t){return e[t].content};function ud(){this.rules=hm({},Ss)}ud.prototype.renderAttrs=function(t){let r,n,i;if(!t.attrs)return"";for(i="",r=0,n=t.attrs.length;r<n;r++)i+=" "+Xa(t.attrs[r][0])+'="'+Xa(t.attrs[r][1])+'"';return i};ud.prototype.renderToken=function(t,r,n){const i=t[r];let o="";if(i.hidden)return"";i.block&&i.nesting!==-1&&r&&t[r-1].hidden&&(o+=`
13
- `),o+=(i.nesting===-1?"</":"<")+i.tag,o+=this.renderAttrs(i),i.nesting===0&&n.xhtmlOut&&(o+=" /");let s=!1;if(i.block&&(s=!0,i.nesting===1&&r+1<t.length)){const a=t[r+1];(a.type==="inline"||a.hidden||a.nesting===-1&&a.tag===i.tag)&&(s=!1)}return o+=s?`>
14
- `:">",o};ud.prototype.renderInline=function(e,t,r){let n="";const i=this.rules;for(let o=0,s=e.length;o<s;o++){const a=e[o].type;typeof i[a]<"u"?n+=i[a](e,o,t,r,this):n+=this.renderToken(e,o,t)}return n};ud.prototype.renderInlineAsText=function(e,t,r){let n="";for(let i=0,o=e.length;i<o;i++)switch(e[i].type){case"text":n+=e[i].content;break;case"image":n+=this.renderInlineAsText(e[i].children,t,r);break;case"html_inline":case"html_block":n+=e[i].content;break;case"softbreak":case"hardbreak":n+=`
15
- `;break}return n};ud.prototype.render=function(e,t,r){let n="";const i=this.rules;for(let o=0,s=e.length;o<s;o++){const a=e[o].type;a==="inline"?n+=this.renderInline(e[o].children,t,r):typeof i[a]<"u"?n+=i[a](e,o,t,r,this):n+=this.renderToken(e,o,t,r)}return n};function di(){this.__rules__=[],this.__cache__=null}di.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1};di.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(r){r.enabled&&r.alt.forEach(function(n){t.indexOf(n)<0&&t.push(n)})}),e.__cache__={},t.forEach(function(r){e.__cache__[r]=[],e.__rules__.forEach(function(n){n.enabled&&(r&&n.alt.indexOf(r)<0||e.__cache__[r].push(n.fn))})})};di.prototype.at=function(e,t,r){const n=this.__find__(e),i=r||{};if(n===-1)throw new Error("Parser rule not found: "+e);this.__rules__[n].fn=t,this.__rules__[n].alt=i.alt||[],this.__cache__=null};di.prototype.before=function(e,t,r,n){const i=this.__find__(e),o=n||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:r,alt:o.alt||[]}),this.__cache__=null};di.prototype.after=function(e,t,r,n){const i=this.__find__(e),o=n||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:r,alt:o.alt||[]}),this.__cache__=null};di.prototype.push=function(e,t,r){const n=r||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null};di.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const r=[];return e.forEach(function(n){const i=this.__find__(n);if(i<0){if(t)return;throw new Error("Rules manager: invalid rule name "+n)}this.__rules__[i].enabled=!0,r.push(n)},this),this.__cache__=null,r};di.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(r){r.enabled=!1}),this.enable(e,t)};di.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const r=[];return e.forEach(function(n){const i=this.__find__(n);if(i<0){if(t)return;throw new Error("Rules manager: invalid rule name "+n)}this.__rules__[i].enabled=!1,r.push(n)},this),this.__cache__=null,r};di.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function jo(e,t,r){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=r,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}jo.prototype.attrIndex=function(t){if(!this.attrs)return-1;const r=this.attrs;for(let n=0,i=r.length;n<i;n++)if(r[n][0]===t)return n;return-1};jo.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};jo.prototype.attrSet=function(t,r){const n=this.attrIndex(t),i=[t,r];n<0?this.attrPush(i):this.attrs[n]=i};jo.prototype.attrGet=function(t){const r=this.attrIndex(t);let n=null;return r>=0&&(n=this.attrs[r][1]),n};jo.prototype.attrJoin=function(t,r){const n=this.attrIndex(t);n<0?this.attrPush([t,r]):this.attrs[n][1]=this.attrs[n][1]+" "+r};function zF(e,t,r){this.src=e,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=t}zF.prototype.Token=jo;const $H=/\r\n?|\n/g,NH=/\0/g;function DH(e){let t;t=e.src.replace($H,`
16
- `),t=t.replace(NH,"�"),e.src=t}function FH(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function IH(e){const t=e.tokens;for(let r=0,n=t.length;r<n;r++){const i=t[r];i.type==="inline"&&e.md.inline.parse(i.content,e.md,e.env,i.children)}}function PH(e){return/^<a[>\s]/i.test(e)}function OH(e){return/^<\/a\s*>/i.test(e)}function MH(e){const t=e.tokens;if(e.md.options.linkify)for(let r=0,n=t.length;r<n;r++){if(t[r].type!=="inline"||!e.md.linkify.pretest(t[r].content))continue;let i=t[r].children,o=0;for(let s=i.length-1;s>=0;s--){const a=i[s];if(a.type==="link_close"){for(s--;i[s].level!==a.level&&i[s].type!=="link_open";)s--;continue}if(a.type==="html_inline"&&(PH(a.content)&&o>0&&o--,OH(a.content)&&o++),!(o>0)&&a.type==="text"&&e.md.linkify.test(a.content)){const l=a.content;let u=e.md.linkify.match(l);const d=[];let f=a.level,h=0;u.length>0&&u[0].index===0&&s>0&&i[s-1].type==="text_special"&&(u=u.slice(1));for(let p=0;p<u.length;p++){const g=u[p].url,m=e.md.normalizeLink(g);if(!e.md.validateLink(m))continue;let v=u[p].text;u[p].schema?u[p].schema==="mailto:"&&!/^mailto:/i.test(v)?v=e.md.normalizeLinkText("mailto:"+v).replace(/^mailto:/,""):v=e.md.normalizeLinkText(v):v=e.md.normalizeLinkText("http://"+v).replace(/^http:\/\//,"");const _=u[p].index;if(_>h){const k=new e.Token("text","",0);k.content=l.slice(h,_),k.level=f,d.push(k)}const x=new e.Token("link_open","a",1);x.attrs=[["href",m]],x.level=f++,x.markup="linkify",x.info="auto",d.push(x);const w=new e.Token("text","",0);w.content=v,w.level=f,d.push(w);const S=new e.Token("link_close","a",-1);S.level=--f,S.markup="linkify",S.info="auto",d.push(S),h=u[p].lastIndex}if(h<l.length){const p=new e.Token("text","",0);p.content=l.slice(h),p.level=f,d.push(p)}t[r].children=i=OF(i,s,d)}}}}const UF=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,LH=/\((c|tm|r)\)/i,zH=/\((c|tm|r)\)/ig,UH={c:"©",r:"®",tm:"™"};function BH(e,t){return UH[t.toLowerCase()]}function jH(e){let t=0;for(let r=e.length-1;r>=0;r--){const n=e[r];n.type==="text"&&!t&&(n.content=n.content.replace(zH,BH)),n.type==="link_open"&&n.info==="auto"&&t--,n.type==="link_close"&&n.info==="auto"&&t++}}function qH(e){let t=0;for(let r=e.length-1;r>=0;r--){const n=e[r];n.type==="text"&&!t&&UF.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),n.type==="link_open"&&n.info==="auto"&&t--,n.type==="link_close"&&n.info==="auto"&&t++}}function VH(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(LH.test(e.tokens[t].content)&&jH(e.tokens[t].children),UF.test(e.tokens[t].content)&&qH(e.tokens[t].children))}const KH=/['"]/,mk=/['"]/g,vk="’";function xp(e,t,r,n){e[t]||(e[t]=[]),e[t].push({pos:r,ch:n})}function HH(e,t){let r="",n=0;t.sort((i,o)=>i.pos-o.pos);for(let i=0;i<t.length;i++){const o=t[i];r+=e.slice(n,o.pos)+o.ch,n=o.pos+1}return r+e.slice(n)}function WH(e,t){let r;const n=[],i={};for(let o=0;o<e.length;o++){const s=e[o],a=e[o].level;for(r=n.length-1;r>=0&&!(n[r].level<=a);r--);if(n.length=r+1,s.type!=="text")continue;const l=s.content;let u=0;const d=l.length;e:for(;u<d;){mk.lastIndex=u;const f=mk.exec(l);if(!f)break;let h=!0,p=!0;u=f.index+1;const g=f[0]==="'";let m=32;if(f.index-1>=0)m=l.charCodeAt(f.index-1);else for(r=o-1;r>=0&&!(e[r].type==="softbreak"||e[r].type==="hardbreak");r--)if(e[r].content){m=e[r].content.charCodeAt(e[r].content.length-1);break}let v=32;if(u<d)v=l.charCodeAt(u);else for(r=o+1;r<e.length&&!(e[r].type==="softbreak"||e[r].type==="hardbreak");r++)if(e[r].content){v=e[r].content.charCodeAt(0);break}const _=Wf(m)||Hf(m),x=Wf(v)||Hf(v),w=Kf(m),S=Kf(v);if(S?h=!1:x&&(w||_||(h=!1)),w?p=!1:_&&(S||x||(p=!1)),v===34&&f[0]==='"'&&m>=48&&m<=57&&(p=h=!1),h&&p&&(h=_,p=x),!h&&!p){g&&xp(i,o,f.index,vk);continue}if(p)for(r=n.length-1;r>=0;r--){let k=n[r];if(n[r].level<a)break;if(k.single===g&&n[r].level===a){k=n[r];let A,C;g?(A=t.md.options.quotes[2],C=t.md.options.quotes[3]):(A=t.md.options.quotes[0],C=t.md.options.quotes[1]),xp(i,o,f.index,C),xp(i,k.token,k.pos,A),n.length=r;continue e}}h?n.push({token:o,pos:f.index,single:g,level:a}):p&&g&&xp(i,o,f.index,vk)}}Object.keys(i).forEach(function(o){e[o].content=HH(e[o].content,i[o])})}function GH(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!KH.test(e.tokens[t].content)||WH(e.tokens[t].children,e)}function JH(e){let t,r;const n=e.tokens,i=n.length;for(let o=0;o<i;o++){if(n[o].type!=="inline")continue;const s=n[o].children,a=s.length;for(t=0;t<a;t++)s[t].type==="text_special"&&(s[t].type="text");for(t=r=0;t<a;t++)s[t].type==="text"&&t+1<a&&s[t+1].type==="text"?s[t+1].content=s[t].content+s[t+1].content:(t!==r&&(s[r]=s[t]),r++);t!==r&&(s.length=r)}}const Bv=[["normalize",DH],["block",FH],["inline",IH],["linkify",MH],["replacements",VH],["smartquotes",GH],["text_join",JH]];function Fx(){this.ruler=new di;for(let e=0;e<Bv.length;e++)this.ruler.push(Bv[e][0],Bv[e][1])}Fx.prototype.process=function(e){const t=this.ruler.getRules("");for(let r=0,n=t.length;r<n;r++)t[r](e)};Fx.prototype.State=zF;function Es(e,t,r,n){this.src=e,this.md=t,this.env=r,this.tokens=n,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const i=this.src;for(let o=0,s=0,a=0,l=0,u=i.length,d=!1;s<u;s++){const f=i.charCodeAt(s);if(!d)if(er(f)){a++,f===9?l+=4-l%4:l++;continue}else d=!0;(f===10||s===u-1)&&(f!==10&&s++,this.bMarks.push(o),this.eMarks.push(s),this.tShift.push(a),this.sCount.push(l),this.bsCount.push(0),d=!1,a=0,l=0,o=s+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Es.prototype.push=function(e,t,r){const n=new jo(e,t,r);return n.block=!0,r<0&&this.level--,n.level=this.level,r>0&&this.level++,this.tokens.push(n),n};Es.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};Es.prototype.skipEmptyLines=function(t){for(let r=this.lineMax;t<r&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};Es.prototype.skipSpaces=function(t){for(let r=this.src.length;t<r;t++){const n=this.src.charCodeAt(t);if(!er(n))break}return t};Es.prototype.skipSpacesBack=function(t,r){if(t<=r)return t;for(;t>r;)if(!er(this.src.charCodeAt(--t)))return t+1;return t};Es.prototype.skipChars=function(t,r){for(let n=this.src.length;t<n&&this.src.charCodeAt(t)===r;t++);return t};Es.prototype.skipCharsBack=function(t,r,n){if(t<=n)return t;for(;t>n;)if(r!==this.src.charCodeAt(--t))return t+1;return t};Es.prototype.getLines=function(t,r,n,i){if(t>=r)return"";const o=new Array(r-t);for(let s=0,a=t;a<r;a++,s++){let l=0;const u=this.bMarks[a];let d=u,f;for(a+1<r||i?f=this.eMarks[a]+1:f=this.eMarks[a];d<f&&l<n;){const h=this.src.charCodeAt(d);if(er(h))h===9?l+=4-(l+this.bsCount[a])%4:l++;else if(d-u<this.tShift[a])l++;else break;d++}l>n?o[s]=new Array(l-n+1).join(" ")+this.src.slice(d,f):o[s]=this.src.slice(d,f)}return o.join("")};Es.prototype.Token=jo;const QH=65536;function jv(e,t){const r=e.bMarks[t]+e.tShift[t],n=e.eMarks[t];return e.src.slice(r,n)}function _k(e){const t=[],r=e.length;let n=0,i=e.charCodeAt(n),o=!1,s=0,a="";for(;n<r;)i===124&&(o?(a+=e.substring(s,n-1),s=n):(t.push(a+e.substring(s,n)),a="",s=n+1)),o=i===92,n++,i=e.charCodeAt(n);return t.push(a+e.substring(s)),t}function YH(e,t,r,n){if(t+2>r)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let o=e.bMarks[i]+e.tShift[i];if(o>=e.eMarks[i])return!1;const s=e.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58||o>=e.eMarks[i])return!1;const a=e.src.charCodeAt(o++);if(a!==124&&a!==45&&a!==58&&!er(a)||s===45&&er(a))return!1;for(;o<e.eMarks[i];){const S=e.src.charCodeAt(o);if(S!==124&&S!==45&&S!==58&&!er(S))return!1;o++}let l=jv(e,t+1),u=l.split("|");const d=[];for(let S=0;S<u.length;S++){const k=u[S].trim();if(!k){if(S===0||S===u.length-1)continue;return!1}if(!/^:?-+:?$/.test(k))return!1;k.charCodeAt(k.length-1)===58?d.push(k.charCodeAt(0)===58?"center":"right"):k.charCodeAt(0)===58?d.push("left"):d.push("")}if(l=jv(e,t).trim(),l.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;u=_k(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const f=u.length;if(f===0||f!==d.length)return!1;if(n)return!0;const h=e.parentType;e.parentType="table";const p=e.md.block.ruler.getRules("blockquote"),g=e.push("table_open","table",1),m=[t,0];g.map=m;const v=e.push("thead_open","thead",1);v.map=[t,t+1];const _=e.push("tr_open","tr",1);_.map=[t,t+1];for(let S=0;S<u.length;S++){const k=e.push("th_open","th",1);d[S]&&(k.attrs=[["style","text-align:"+d[S]]]);const A=e.push("inline","",0);A.content=u[S].trim(),A.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let x,w=0;for(i=t+2;i<r&&!(e.sCount[i]<e.blkIndent);i++){let S=!1;for(let A=0,C=p.length;A<C;A++)if(p[A](e,i,r,!0)){S=!0;break}if(S||(l=jv(e,i).trim(),!l)||e.sCount[i]-e.blkIndent>=4||(u=_k(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),w+=f-u.length,w>QH))break;if(i===t+2){const A=e.push("tbody_open","tbody",1);A.map=x=[t+2,0]}const k=e.push("tr_open","tr",1);k.map=[i,i+1];for(let A=0;A<f;A++){const C=e.push("td_open","td",1);d[A]&&(C.attrs=[["style","text-align:"+d[A]]]);const R=e.push("inline","",0);R.content=u[A]?u[A].trim():"",R.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return x&&(e.push("tbody_close","tbody",-1),x[1]=i),e.push("table_close","table",-1),m[1]=i,e.parentType=h,e.line=i,!0}function XH(e,t,r){if(e.sCount[t]-e.blkIndent<4)return!1;let n=t+1,i=n;for(;n<r;){if(e.isEmpty(n)){n++;continue}if(e.sCount[n]-e.blkIndent>=4){n++,i=n;continue}break}e.line=i;const o=e.push("code_block","code",0);return o.content=e.getLines(t,i,4+e.blkIndent,!1)+`
17
- `,o.map=[t,e.line],!0}function ZH(e,t,r,n){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>o)return!1;const s=e.src.charCodeAt(i);if(s!==126&&s!==96)return!1;let a=i;i=e.skipChars(i,s);let l=i-a;if(l<3)return!1;const u=e.src.slice(a,i),d=e.src.slice(i,o);if(s===96&&d.indexOf(String.fromCharCode(s))>=0)return!1;if(n)return!0;let f=t,h=!1;for(;f++,!(f>=r||(i=a=e.bMarks[f]+e.tShift[f],o=e.eMarks[f],i<o&&e.sCount[f]<e.blkIndent));)if(e.src.charCodeAt(i)===s&&!(e.sCount[f]-e.blkIndent>=4)&&(i=e.skipChars(i,s),!(i-a<l)&&(i=e.skipSpaces(i),!(i<o)))){h=!0;break}l=e.sCount[t],e.line=f+(h?1:0);const p=e.push("fence","code",0);return p.info=d,p.content=e.getLines(t+1,f,l,!0),p.markup=u,p.map=[t,e.line],!0}function eW(e,t,r,n){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];const s=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(n)return!0;const a=[],l=[],u=[],d=[],f=e.md.block.ruler.getRules("blockquote"),h=e.parentType;e.parentType="blockquote";let p=!1,g;for(g=t;g<r;g++){const w=e.sCount[g]<e.blkIndent;if(i=e.bMarks[g]+e.tShift[g],o=e.eMarks[g],i>=o)break;if(e.src.charCodeAt(i++)===62&&!w){let k=e.sCount[g]+1,A,C;e.src.charCodeAt(i)===32?(i++,k++,C=!1,A=!0):e.src.charCodeAt(i)===9?(A=!0,(e.bsCount[g]+k)%4===3?(i++,k++,C=!1):C=!0):A=!1;let R=k;for(a.push(e.bMarks[g]),e.bMarks[g]=i;i<o;){const N=e.src.charCodeAt(i);if(er(N))N===9?R+=4-(R+e.bsCount[g]+(C?1:0))%4:R++;else break;i++}p=i>=o,l.push(e.bsCount[g]),e.bsCount[g]=e.sCount[g]+1+(A?1:0),u.push(e.sCount[g]),e.sCount[g]=R-k,d.push(e.tShift[g]),e.tShift[g]=i-e.bMarks[g];continue}if(p)break;let S=!1;for(let k=0,A=f.length;k<A;k++)if(f[k](e,g,r,!0)){S=!0;break}if(S){e.lineMax=g,e.blkIndent!==0&&(a.push(e.bMarks[g]),l.push(e.bsCount[g]),d.push(e.tShift[g]),u.push(e.sCount[g]),e.sCount[g]-=e.blkIndent);break}a.push(e.bMarks[g]),l.push(e.bsCount[g]),d.push(e.tShift[g]),u.push(e.sCount[g]),e.sCount[g]=-1}const m=e.blkIndent;e.blkIndent=0;const v=e.push("blockquote_open","blockquote",1);v.markup=">";const _=[t,0];v.map=_,e.md.block.tokenize(e,t,g);const x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=s,e.parentType=h,_[1]=e.line;for(let w=0;w<d.length;w++)e.bMarks[w+t]=a[w],e.tShift[w+t]=d[w],e.sCount[w+t]=u[w],e.bsCount[w+t]=l[w];return e.blkIndent=m,!0}function tW(e,t,r,n){const i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t];const s=e.src.charCodeAt(o++);if(s!==42&&s!==45&&s!==95)return!1;let a=1;for(;o<i;){const u=e.src.charCodeAt(o++);if(u!==s&&!er(u))return!1;u===s&&a++}if(a<3)return!1;if(n)return!0;e.line=t+1;const l=e.push("hr","hr",0);return l.map=[t,e.line],l.markup=Array(a+1).join(String.fromCharCode(s)),!0}function bk(e,t){const r=e.eMarks[t];let n=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(n++);if(i!==42&&i!==45&&i!==43)return-1;if(n<r){const o=e.src.charCodeAt(n);if(!er(o))return-1}return n}function yk(e,t){const r=e.bMarks[t]+e.tShift[t],n=e.eMarks[t];let i=r;if(i+1>=n)return-1;let o=e.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=n)return-1;if(o=e.src.charCodeAt(i++),o>=48&&o<=57){if(i-r>=10)return-1;continue}if(o===41||o===46)break;return-1}return i<n&&(o=e.src.charCodeAt(i),!er(o))?-1:i}function rW(e,t){const r=e.level+2;for(let n=t+2,i=e.tokens.length-2;n<i;n++)e.tokens[n].level===r&&e.tokens[n].type==="paragraph_open"&&(e.tokens[n+2].hidden=!0,e.tokens[n].hidden=!0,n+=2)}function nW(e,t,r,n){let i,o,s,a,l=t,u=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let d=!1;n&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(d=!0);let f,h,p;if((p=yk(e,l))>=0){if(f=!0,s=e.bMarks[l]+e.tShift[l],h=Number(e.src.slice(s,p-1)),d&&h!==1)return!1}else if((p=bk(e,l))>=0)f=!1;else return!1;if(d&&e.skipSpaces(p)>=e.eMarks[l])return!1;if(n)return!0;const g=e.src.charCodeAt(p-1),m=e.tokens.length;f?(a=e.push("ordered_list_open","ol",1),h!==1&&(a.attrs=[["start",h]])):a=e.push("bullet_list_open","ul",1);const v=[l,0];a.map=v,a.markup=String.fromCharCode(g);let _=!1;const x=e.md.block.ruler.getRules("list"),w=e.parentType;for(e.parentType="list";l<r;){o=p,i=e.eMarks[l];const S=e.sCount[l]+p-(e.bMarks[l]+e.tShift[l]);let k=S;for(;o<i;){const V=e.src.charCodeAt(o);if(V===9)k+=4-(k+e.bsCount[l])%4;else if(V===32)k++;else break;o++}const A=o;let C;A>=i?C=1:C=k-S,C>4&&(C=1);const R=S+C;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(g);const N=[l,0];a.map=N,f&&(a.info=e.src.slice(s,p-1));const I=e.tight,P=e.tShift[l],z=e.sCount[l],q=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=R,e.tight=!0,e.tShift[l]=A-e.bMarks[l],e.sCount[l]=k,A>=i&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,r):e.md.block.tokenize(e,l,r,!0),(!e.tight||_)&&(u=!1),_=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=q,e.tShift[l]=P,e.sCount[l]=z,e.tight=I,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(g),l=e.line,N[1]=l,l>=r||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let H=!1;for(let V=0,Y=x.length;V<Y;V++)if(x[V](e,l,r,!0)){H=!0;break}if(H)break;if(f){if(p=yk(e,l),p<0)break;s=e.bMarks[l]+e.tShift[l]}else if(p=bk(e,l),p<0)break;if(g!==e.src.charCodeAt(p-1))break}return f?a=e.push("ordered_list_close","ol",-1):a=e.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(g),v[1]=l,e.line=l,e.parentType=w,u&&rW(e,m),!0}function iW(e,t,r,n){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],s=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function a(x){const w=e.lineMax;if(x>=w||e.isEmpty(x))return null;let S=!1;if(e.sCount[x]-e.blkIndent>3&&(S=!0),e.sCount[x]<0&&(S=!0),!S){const C=e.md.block.ruler.getRules("reference"),R=e.parentType;e.parentType="reference";let N=!1;for(let I=0,P=C.length;I<P;I++)if(C[I](e,x,w,!0)){N=!0;break}if(e.parentType=R,N)return null}const k=e.bMarks[x]+e.tShift[x],A=e.eMarks[x];return e.src.slice(k,A+1)}let l=e.src.slice(i,o+1);o=l.length;let u=-1;for(i=1;i<o;i++){const x=l.charCodeAt(i);if(x===91)return!1;if(x===93){u=i;break}else if(x===10){const w=a(s);w!==null&&(l+=w,o=l.length,s++)}else if(x===92&&(i++,i<o&&l.charCodeAt(i)===10)){const w=a(s);w!==null&&(l+=w,o=l.length,s++)}}if(u<0||l.charCodeAt(u+1)!==58)return!1;for(i=u+2;i<o;i++){const x=l.charCodeAt(i);if(x===10){const w=a(s);w!==null&&(l+=w,o=l.length,s++)}else if(!er(x))break}const d=e.md.helpers.parseLinkDestination(l,i,o);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;i=d.pos;const h=i,p=s,g=i;for(;i<o;i++){const x=l.charCodeAt(i);if(x===10){const w=a(s);w!==null&&(l+=w,o=l.length,s++)}else if(!er(x))break}let m=e.md.helpers.parseLinkTitle(l,i,o);for(;m.can_continue;){const x=a(s);if(x===null)break;l+=x,i=o,o=l.length,s++,m=e.md.helpers.parseLinkTitle(l,i,o,m)}let v;for(i<o&&g!==i&&m.ok?(v=m.str,i=m.pos):(v="",i=h,s=p);i<o;){const x=l.charCodeAt(i);if(!er(x))break;i++}if(i<o&&l.charCodeAt(i)!==10&&v)for(v="",i=h,s=p;i<o;){const x=l.charCodeAt(i);if(!er(x))break;i++}if(i<o&&l.charCodeAt(i)!==10)return!1;const _=pm(l.slice(1,u));return _?(n||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[_]>"u"&&(e.env.references[_]={title:v,href:f}),e.line=s),!0):!1}const oW=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],sW="[a-zA-Z_:][a-zA-Z0-9:._-]*",aW="[^\"'=<>`\\x00-\\x20]+",lW="'[^']*'",uW='"[^"]*"',cW="(?:"+aW+"|"+lW+"|"+uW+")",dW="(?:\\s+"+sW+"(?:\\s*=\\s*"+cW+")?)",BF="<[A-Za-z][A-Za-z0-9\\-]*"+dW+"*\\s*\\/?>",jF="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",fW="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",hW="<[?][\\s\\S]*?[?]>",pW="<![A-Za-z][^>]*>",gW="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",mW=new RegExp("^(?:"+BF+"|"+jF+"|"+fW+"|"+hW+"|"+pW+"|"+gW+")"),vW=new RegExp("^(?:"+BF+"|"+jF+")"),Rl=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+oW.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(vW.source+"\\s*$"),/^$/,!1]];function _W(e,t,r,n){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let s=e.src.slice(i,o),a=0;for(;a<Rl.length&&!Rl[a][0].test(s);a++);if(a===Rl.length)return!1;if(n)return Rl[a][2];let l=t+1;const u=Rl[a][1].test("");if(!Rl[a][1].test(s)){for(;l<r&&!(e.sCount[l]<e.blkIndent&&(u||!e.isEmpty(l)));l++)if(i=e.bMarks[l]+e.tShift[l],o=e.eMarks[l],s=e.src.slice(i,o),Rl[a][1].test(s)){s.length!==0&&l++;break}}e.line=l;const d=e.push("html_block","",0);return d.map=[t,l],d.content=e.getLines(t,l,e.blkIndent,!0),!0}function bW(e,t,r,n){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.src.charCodeAt(i);if(s!==35||i>=o)return!1;let a=1;for(s=e.src.charCodeAt(++i);s===35&&i<o&&a<=6;)a++,s=e.src.charCodeAt(++i);if(a>6||i<o&&!er(s))return!1;if(n)return!0;o=e.skipSpacesBack(o,i);const l=e.skipCharsBack(o,35,i);l>i&&er(e.src.charCodeAt(l-1))&&(o=l),e.line=t+1;const u=e.push("heading_open","h"+String(a),1);u.markup="########".slice(0,a),u.map=[t,e.line];const d=e.push("inline","",0);d.content=gm(e.src.slice(i,o)),d.map=[t,e.line],d.children=[];const f=e.push("heading_close","h"+String(a),-1);return f.markup="########".slice(0,a),!0}function yW(e,t,r){const n=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const i=e.parentType;e.parentType="paragraph";let o=0,s,a=t+1;for(;a<r&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3)continue;if(e.sCount[a]>=e.blkIndent){let p=e.bMarks[a]+e.tShift[a];const g=e.eMarks[a];if(p<g&&(s=e.src.charCodeAt(p),(s===45||s===61)&&(p=e.skipChars(p,s),p=e.skipSpaces(p),p>=g))){o=s===61?1:2;break}}if(e.sCount[a]<0)continue;let h=!1;for(let p=0,g=n.length;p<g;p++)if(n[p](e,a,r,!0)){h=!0;break}if(h)break}if(!o)return e.parentType=i,!1;const l=gm(e.getLines(t,a,e.blkIndent,!1));e.line=a+1;const u=e.push("heading_open","h"+String(o),1);u.markup=String.fromCharCode(s),u.map=[t,e.line];const d=e.push("inline","",0);d.content=l,d.map=[t,e.line-1],d.children=[];const f=e.push("heading_close","h"+String(o),-1);return f.markup=String.fromCharCode(s),e.parentType=i,!0}function xW(e,t,r){const n=e.md.block.ruler.getRules("paragraph"),i=e.parentType;let o=t+1;for(e.parentType="paragraph";o<r&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3||e.sCount[o]<0)continue;let u=!1;for(let d=0,f=n.length;d<f;d++)if(n[d](e,o,r,!0)){u=!0;break}if(u)break}const s=gm(e.getLines(t,o,e.blkIndent,!1));e.line=o;const a=e.push("paragraph_open","p",1);a.map=[t,e.line];const l=e.push("inline","",0);return l.content=s,l.map=[t,e.line],l.children=[],e.push("paragraph_close","p",-1),e.parentType=i,!0}const Sp=[["table",YH,["paragraph","reference"]],["code",XH],["fence",ZH,["paragraph","reference","blockquote","list"]],["blockquote",eW,["paragraph","reference","blockquote","list"]],["hr",tW,["paragraph","reference","blockquote","list"]],["list",nW,["paragraph","reference","blockquote"]],["reference",iW],["html_block",_W,["paragraph","reference","blockquote"]],["heading",bW,["paragraph","reference","blockquote"]],["lheading",yW],["paragraph",xW]];function mm(){this.ruler=new di;for(let e=0;e<Sp.length;e++)this.ruler.push(Sp[e][0],Sp[e][1],{alt:(Sp[e][2]||[]).slice()})}mm.prototype.tokenize=function(e,t,r){const n=this.ruler.getRules(""),i=n.length,o=e.md.options.maxNesting;let s=t,a=!1;for(;s<r&&(e.line=s=e.skipEmptyLines(s),!(s>=r||e.sCount[s]<e.blkIndent));){if(e.level>=o){e.line=r;break}const l=e.line;let u=!1;for(let d=0;d<i;d++)if(u=n[d](e,s,r,!1),u){if(l>=e.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),s=e.line,s<r&&e.isEmpty(s)&&(a=!0,s++,e.line=s)}};mm.prototype.parse=function(e,t,r,n){if(!e)return;const i=new this.State(e,t,r,n);this.tokenize(i,i.line,i.lineMax)};mm.prototype.State=Es;function Ih(e,t,r,n){this.src=e,this.env=r,this.md=t,this.tokens=n,this.tokens_meta=Array(n.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Ih.prototype.pushPending=function(){const e=new jo("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e};Ih.prototype.push=function(e,t,r){this.pending&&this.pushPending();const n=new jo(e,t,r);let i=null;return r<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),n.level=this.level,r>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(i),n};Ih.prototype.scanDelims=function(e,t){const r=this.posMax,n=this.src.charCodeAt(e);let i;if(e===0)i=32;else if(e===1)i=this.src.charCodeAt(0),(i&63488)===55296&&(i=65533);else if(i=this.src.charCodeAt(e-1),(i&64512)===56320){const v=this.src.charCodeAt(e-2);i=(v&64512)===55296?65536+(v-55296<<10)+(i-56320):65533}else(i&64512)===55296&&(i=65533);let o=e;for(;o<r&&this.src.charCodeAt(o)===n;)o++;const s=o-e;let a=o<r?this.src.charCodeAt(o):32;if((a&64512)===55296){const v=this.src.charCodeAt(o+1);a=(v&64512)===56320?65536+(a-55296<<10)+(v-56320):65533}else(a&64512)===56320&&(a=65533);const l=Wf(i)||Hf(i),u=Wf(a)||Hf(a),d=Kf(i),f=Kf(a),h=!f&&(!u||d||l),p=!d&&(!l||f||u);return{can_open:h&&(t||!p||l),can_close:p&&(t||!h||u),length:s}};Ih.prototype.Token=jo;function SW(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function EW(e,t){let r=e.pos;for(;r<e.posMax&&!SW(e.src.charCodeAt(r));)r++;return r===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,r)),e.pos=r,!0)}const wW=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function kW(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const r=e.pos,n=e.posMax;if(r+3>n||e.src.charCodeAt(r)!==58||e.src.charCodeAt(r+1)!==47||e.src.charCodeAt(r+2)!==47)return!1;const i=e.pending.match(wW);if(!i)return!1;const o=i[1],s=e.md.linkify.matchAtStart(e.src.slice(r-o.length));if(!s)return!1;let a=s.url;if(a.length<=o.length)return!1;let l=a.length;for(;l>0&&a.charCodeAt(l-1)===42;)l--;l!==a.length&&(a=a.slice(0,l));const u=e.md.normalizeLink(a);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const d=e.push("link_open","a",1);d.attrs=[["href",u]],d.markup="linkify",d.info="auto";const f=e.push("text","",0);f.content=e.md.normalizeLinkText(a);const h=e.push("link_close","a",-1);h.markup="linkify",h.info="auto"}return e.pos+=a.length-o.length,!0}function CW(e,t){let r=e.pos;if(e.src.charCodeAt(r)!==10)return!1;const n=e.pending.length-1,i=e.posMax;if(!t)if(n>=0&&e.pending.charCodeAt(n)===32)if(n>=1&&e.pending.charCodeAt(n-1)===32){let o=n-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(r++;r<i&&er(e.src.charCodeAt(r));)r++;return e.pos=r,!0}const Ix=[];for(let e=0;e<256;e++)Ix.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Ix[e.charCodeAt(0)]=1});function RW(e,t){let r=e.pos;const n=e.posMax;if(e.src.charCodeAt(r)!==92||(r++,r>=n))return!1;let i=e.src.charCodeAt(r);if(i===10){for(t||e.push("hardbreak","br",0),r++;r<n&&(i=e.src.charCodeAt(r),!!er(i));)r++;return e.pos=r,!0}let o=e.src[r];if(i>=55296&&i<=56319&&r+1<n){const a=e.src.charCodeAt(r+1);a>=56320&&a<=57343&&(o+=e.src[r+1],r++)}const s="\\"+o;if(!t){const a=e.push("text_special","",0);i<256&&Ix[i]!==0?a.content=o:a.content=s,a.markup=s,a.info="escape"}return e.pos=r+1,!0}function AW(e,t){let r=e.pos;if(e.src.charCodeAt(r)!==96)return!1;const i=r;r++;const o=e.posMax;for(;r<o&&e.src.charCodeAt(r)===96;)r++;const s=e.src.slice(i,r),a=s.length;if(e.backticksScanned&&(e.backticks[a]||0)<=i)return t||(e.pending+=s),e.pos+=a,!0;let l=r,u;for(;(u=e.src.indexOf("`",l))!==-1;){for(l=u+1;l<o&&e.src.charCodeAt(l)===96;)l++;const d=l-u;if(d===a){if(!t){const f=e.push("code_inline","code",0);f.markup=s,f.content=e.src.slice(r,u).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=l,!0}e.backticks[d]=u}return e.backticksScanned=!0,t||(e.pending+=s),e.pos+=a,!0}function TW(e,t){const r=e.pos,n=e.src.charCodeAt(r);if(t||n!==126)return!1;const i=e.scanDelims(e.pos,!0);let o=i.length;const s=String.fromCharCode(n);if(o<2)return!1;let a;o%2&&(a=e.push("text","",0),a.content=s,o--);for(let l=0;l<o;l+=2)a=e.push("text","",0),a.content=s+s,e.delimiters.push({marker:n,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function xk(e,t){let r;const n=[],i=t.length;for(let o=0;o<i;o++){const s=t[o];if(s.marker!==126||s.end===-1)continue;const a=t[s.end];r=e.tokens[s.token],r.type="s_open",r.tag="s",r.nesting=1,r.markup="~~",r.content="",r=e.tokens[a.token],r.type="s_close",r.tag="s",r.nesting=-1,r.markup="~~",r.content="",e.tokens[a.token-1].type==="text"&&e.tokens[a.token-1].content==="~"&&n.push(a.token-1)}for(;n.length;){const o=n.pop();let s=o+1;for(;s<e.tokens.length&&e.tokens[s].type==="s_close";)s++;s--,o!==s&&(r=e.tokens[s],e.tokens[s]=e.tokens[o],e.tokens[o]=r)}}function $W(e){const t=e.tokens_meta,r=e.tokens_meta.length;xk(e,e.delimiters);for(let n=0;n<r;n++)t[n]&&t[n].delimiters&&xk(e,t[n].delimiters)}const qF={tokenize:TW,postProcess:$W};function NW(e,t){const r=e.pos,n=e.src.charCodeAt(r);if(t||n!==95&&n!==42)return!1;const i=e.scanDelims(e.pos,n===42);for(let o=0;o<i.length;o++){const s=e.push("text","",0);s.content=String.fromCharCode(n),e.delimiters.push({marker:n,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function Sk(e,t){const r=t.length;for(let n=r-1;n>=0;n--){const i=t[n];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const o=t[i.end],s=n>0&&t[n-1].end===i.end+1&&t[n-1].marker===i.marker&&t[n-1].token===i.token-1&&t[i.end+1].token===o.token+1,a=String.fromCharCode(i.marker),l=e.tokens[i.token];l.type=s?"strong_open":"em_open",l.tag=s?"strong":"em",l.nesting=1,l.markup=s?a+a:a,l.content="";const u=e.tokens[o.token];u.type=s?"strong_close":"em_close",u.tag=s?"strong":"em",u.nesting=-1,u.markup=s?a+a:a,u.content="",s&&(e.tokens[t[n-1].token].content="",e.tokens[t[i.end+1].token].content="",n--)}}function DW(e){const t=e.tokens_meta,r=e.tokens_meta.length;Sk(e,e.delimiters);for(let n=0;n<r;n++)t[n]&&t[n].delimiters&&Sk(e,t[n].delimiters)}const VF={tokenize:NW,postProcess:DW};function FW(e,t){let r,n,i,o,s="",a="",l=e.pos,u=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const d=e.pos,f=e.posMax,h=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let g=p+1;if(g<f&&e.src.charCodeAt(g)===40){for(u=!1,g++;g<f&&(r=e.src.charCodeAt(g),!(!er(r)&&r!==10));g++);if(g>=f)return!1;if(l=g,i=e.md.helpers.parseLinkDestination(e.src,g,e.posMax),i.ok){for(s=e.md.normalizeLink(i.str),e.md.validateLink(s)?g=i.pos:s="",l=g;g<f&&(r=e.src.charCodeAt(g),!(!er(r)&&r!==10));g++);if(i=e.md.helpers.parseLinkTitle(e.src,g,e.posMax),g<f&&l!==g&&i.ok)for(a=i.str,g=i.pos;g<f&&(r=e.src.charCodeAt(g),!(!er(r)&&r!==10));g++);}(g>=f||e.src.charCodeAt(g)!==41)&&(u=!0),g++}if(u){if(typeof e.env.references>"u")return!1;if(g<f&&e.src.charCodeAt(g)===91?(l=g+1,g=e.md.helpers.parseLinkLabel(e,g),g>=0?n=e.src.slice(l,g++):g=p+1):g=p+1,n||(n=e.src.slice(h,p)),o=e.env.references[pm(n)],!o)return e.pos=d,!1;s=o.href,a=o.title}if(!t){e.pos=h,e.posMax=p;const m=e.push("link_open","a",1),v=[["href",s]];m.attrs=v,a&&v.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=g,e.posMax=f,!0}function IW(e,t){let r,n,i,o,s,a,l,u,d="";const f=e.pos,h=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const p=e.pos+2,g=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(g<0)return!1;if(o=g+1,o<h&&e.src.charCodeAt(o)===40){for(o++;o<h&&(r=e.src.charCodeAt(o),!(!er(r)&&r!==10));o++);if(o>=h)return!1;for(u=o,a=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),a.ok&&(d=e.md.normalizeLink(a.str),e.md.validateLink(d)?o=a.pos:d=""),u=o;o<h&&(r=e.src.charCodeAt(o),!(!er(r)&&r!==10));o++);if(a=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<h&&u!==o&&a.ok)for(l=a.str,o=a.pos;o<h&&(r=e.src.charCodeAt(o),!(!er(r)&&r!==10));o++);else l="";if(o>=h||e.src.charCodeAt(o)!==41)return e.pos=f,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o<h&&e.src.charCodeAt(o)===91?(u=o+1,o=e.md.helpers.parseLinkLabel(e,o),o>=0?i=e.src.slice(u,o++):o=g+1):o=g+1,i||(i=e.src.slice(p,g)),s=e.env.references[pm(i)],!s)return e.pos=f,!1;d=s.href,l=s.title}if(!t){n=e.src.slice(p,g);const m=[];e.md.inline.parse(n,e.md,e.env,m);const v=e.push("image","img",0),_=[["src",d],["alt",""]];v.attrs=_,v.children=m,v.content=n,l&&_.push(["title",l])}return e.pos=o,e.posMax=h,!0}const PW=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,OW=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function MW(e,t){let r=e.pos;if(e.src.charCodeAt(r)!==60)return!1;const n=e.pos,i=e.posMax;for(;;){if(++r>=i)return!1;const s=e.src.charCodeAt(r);if(s===60)return!1;if(s===62)break}const o=e.src.slice(n+1,r);if(OW.test(o)){const s=e.md.normalizeLink(o);if(!e.md.validateLink(s))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(o);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=o.length+2,!0}if(PW.test(o)){const s=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(s))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(o);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=o.length+2,!0}return!1}function LW(e){return/^<a[>\s]/i.test(e)}function zW(e){return/^<\/a\s*>/i.test(e)}function UW(e){const t=e|32;return t>=97&&t<=122}function BW(e,t){if(!e.md.options.html)return!1;const r=e.posMax,n=e.pos;if(e.src.charCodeAt(n)!==60||n+2>=r)return!1;const i=e.src.charCodeAt(n+1);if(i!==33&&i!==63&&i!==47&&!UW(i))return!1;const o=e.src.slice(n).match(mW);if(!o)return!1;if(!t){const s=e.push("html_inline","",0);s.content=o[0],LW(s.content)&&e.linkLevel++,zW(s.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}const jW=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,qW=/^&([a-z][a-z0-9]{1,31});/i;function VW(e,t){const r=e.pos,n=e.posMax;if(e.src.charCodeAt(r)!==38||r+1>=n)return!1;if(e.src.charCodeAt(r+1)===35){const o=e.src.slice(r).match(jW);if(o){if(!t){const s=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),a=e.push("text_special","",0);a.content=Dx(s)?Vf(s):Vf(65533),a.markup=o[0],a.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(r).match(qW);if(o){const s=uH(o[0]);if(s!==o[0]){if(!t){const a=e.push("text_special","",0);a.content=s,a.markup=o[0],a.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function Ek(e){const t={},r=e.length;if(!r)return;let n=0,i=-2;const o=[];for(let s=0;s<r;s++){const a=e[s];if(o.push(0),(e[n].marker!==a.marker||i!==a.token-1)&&(n=s),i=a.token,a.length=a.length||0,!a.close)continue;t.hasOwnProperty(a.marker)||(t[a.marker]=[-1,-1,-1,-1,-1,-1]);const l=t[a.marker][(a.open?3:0)+a.length%3];let u=n-o[n]-1,d=u;for(;u>l;u-=o[u]+1){const f=e[u];if(f.marker===a.marker&&f.open&&f.end<0){let h=!1;if((f.close||a.open)&&(f.length+a.length)%3===0&&(f.length%3!==0||a.length%3!==0)&&(h=!0),!h){const p=u>0&&!e[u-1].open?o[u-1]+1:0;o[s]=s-u+p,o[u]=p,a.open=!1,f.end=s,f.close=!1,d=-1,i=-2;break}}}d!==-1&&(t[a.marker][(a.open?3:0)+(a.length||0)%3]=d)}}function KW(e){const t=e.tokens_meta,r=e.tokens_meta.length;Ek(e.delimiters);for(let n=0;n<r;n++)t[n]&&t[n].delimiters&&Ek(t[n].delimiters)}function HW(e){let t,r,n=0;const i=e.tokens,o=e.tokens.length;for(t=r=0;t<o;t++)i[t].nesting<0&&n--,i[t].level=n,i[t].nesting>0&&n++,i[t].type==="text"&&t+1<o&&i[t+1].type==="text"?i[t+1].content=i[t].content+i[t+1].content:(t!==r&&(i[r]=i[t]),r++);t!==r&&(i.length=r)}const qv=[["text",EW],["linkify",kW],["newline",CW],["escape",RW],["backticks",AW],["strikethrough",qF.tokenize],["emphasis",VF.tokenize],["link",FW],["image",IW],["autolink",MW],["html_inline",BW],["entity",VW]],Vv=[["balance_pairs",KW],["strikethrough",qF.postProcess],["emphasis",VF.postProcess],["fragments_join",HW]];function Ph(){this.ruler=new di;for(let e=0;e<qv.length;e++)this.ruler.push(qv[e][0],qv[e][1]);this.ruler2=new di;for(let e=0;e<Vv.length;e++)this.ruler2.push(Vv[e][0],Vv[e][1])}Ph.prototype.skipToken=function(e){const t=e.pos,r=this.ruler.getRules(""),n=r.length,i=e.md.options.maxNesting,o=e.cache;if(typeof o[t]<"u"){e.pos=o[t];return}let s=!1;if(e.level<i){for(let a=0;a<n;a++)if(e.level++,s=r[a](e,!0),e.level--,s){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;s||e.pos++,o[t]=e.pos};Ph.prototype.tokenize=function(e){const t=this.ruler.getRules(""),r=t.length,n=e.posMax,i=e.md.options.maxNesting;for(;e.pos<n;){const o=e.pos;let s=!1;if(e.level<i){for(let a=0;a<r;a++)if(s=t[a](e,!1),s){if(o>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(e.pos>=n)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};Ph.prototype.parse=function(e,t,r,n){const i=new this.State(e,t,r,n);this.tokenize(i);const o=this.ruler2.getRules(""),s=o.length;for(let a=0;a<s;a++)o[a](i)};Ph.prototype.State=Ih;function WW(e){const t={};e=e||{},t.src_Any=$F.source,t.src_Cc=NF.source,t.src_Z=FF.source,t.src_P=$x.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const r="[><|]";return t.src_pseudo_letter="(?:(?!"+r+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+r+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+r+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+r+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function _y(e){return Array.prototype.slice.call(arguments,1).forEach(function(r){r&&Object.keys(r).forEach(function(n){e[n]=r[n]})}),e}function vm(e){return Object.prototype.toString.call(e)}function GW(e){return vm(e)==="[object String]"}function JW(e){return vm(e)==="[object Object]"}function QW(e){return vm(e)==="[object RegExp]"}function wk(e){return vm(e)==="[object Function]"}function YW(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const KF={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function XW(e){return Object.keys(e||{}).reduce(function(t,r){return t||KF.hasOwnProperty(r)},!1)}const ZW={"http:":{validate:function(e,t,r){const n=e.slice(t);return r.re.http||(r.re.http=new RegExp("^\\/\\/"+r.re.src_auth+r.re.src_host_port_strict+r.re.src_path,"i")),r.re.http.test(n)?n.match(r.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,r){const n=e.slice(t);return r.re.no_http||(r.re.no_http=new RegExp("^"+r.re.src_auth+"(?:localhost|(?:(?:"+r.re.src_domain+")\\.)+"+r.re.src_domain_root+")"+r.re.src_port+r.re.src_host_terminator+r.re.src_path,"i")),r.re.no_http.test(n)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:n.match(r.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,r){const n=e.slice(t);return r.re.mailto||(r.re.mailto=new RegExp("^"+r.re.src_email_name+"@"+r.re.src_host_strict,"i")),r.re.mailto.test(n)?n.match(r.re.mailto)[0].length:0}}},eG="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",tG="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function rG(e){return function(t,r){const n=t.slice(r);return e.test(n)?n.match(e)[0].length:0}}function kk(){return function(e,t){t.normalize(e)}}function eg(e){const t=e.re=WW(e.__opts__),r=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||r.push(eG),r.push(t.src_xn),t.src_tlds=r.join("|");function n(a){return a.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(n(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(n(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(n(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(n(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(n(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(n(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(n(t.tpl_host_fuzzy_test),"i");const i=[];e.__compiled__={};function o(a,l){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+l)}Object.keys(e.__schemas__).forEach(function(a){const l=e.__schemas__[a];if(l===null)return;const u={validate:null,link:null};if(e.__compiled__[a]=u,JW(l)){QW(l.validate)?u.validate=rG(l.validate):wk(l.validate)?u.validate=l.validate:o(a,l),wk(l.normalize)?u.normalize=l.normalize:l.normalize?o(a,l):u.normalize=kk();return}if(GW(l)){i.push(a);return}o(a,l)}),i.forEach(function(a){e.__compiled__[e.__schemas__[a]]&&(e.__compiled__[a].validate=e.__compiled__[e.__schemas__[a]].validate,e.__compiled__[a].normalize=e.__compiled__[e.__schemas__[a]].normalize)}),e.__compiled__[""]={validate:null,normalize:kk()};const s=Object.keys(e.__compiled__).filter(function(a){return a.length>0&&e.__compiled__[a]}).map(YW).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function HF(e,t,r,n){const i=e.slice(r,n);this.schema=t.toLowerCase(),this.index=r,this.lastIndex=n,this.raw=i,this.text=i,this.url=i}function Pi(e,t){if(!(this instanceof Pi))return new Pi(e,t);t||XW(e)&&(t=e,e={}),this.__opts__=_y({},KF,t),this.__schemas__=_y({},ZW,e),this.__compiled__={},this.__tlds__=tG,this.__tlds_replaced__=!1,this.re={},eg(this)}Pi.prototype.add=function(t,r){return this.__schemas__[t]=r,eg(this),this};Pi.prototype.set=function(t){return this.__opts__=_y(this.__opts__,t),this};Pi.prototype.test=function(t){if(!t.length)return!1;let r,n;if(this.re.schema_test.test(t)){for(n=this.re.schema_search,n.lastIndex=0;(r=n.exec(t))!==null;)if(this.testSchemaAt(t,r[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};Pi.prototype.pretest=function(t){return this.re.pretest.test(t)};Pi.prototype.testSchemaAt=function(t,r,n){return this.__compiled__[r.toLowerCase()]?this.__compiled__[r.toLowerCase()].validate(t,n,this):0};Pi.prototype.match=function(t){const r=[],n=[],i=[],o=[];let s,a,l;function u(h,p){return h?p?h.index!==p.index?h.index<p.index?h:p:h.lastIndex>=p.lastIndex?h:p:h:p}if(!t.length)return null;if(this.re.schema_test.test(t))for(l=this.re.schema_search,l.lastIndex=0;(s=l.exec(t))!==null;)a=this.testSchemaAt(t,s[2],l.lastIndex),a&&n.push({schema:s[2],index:s.index+s[1].length,lastIndex:s.index+s[0].length+a});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(l=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,l.lastIndex=0;(s=l.exec(t))!==null;)i.push({schema:"",index:s.index+s[1].length,lastIndex:s.index+s[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(l=this.re.email_fuzzy_global,l.lastIndex=0;(s=l.exec(t))!==null;)o.push({schema:"mailto:",index:s.index+s[1].length,lastIndex:s.index+s[0].length});const d=[0,0,0];let f=0;for(;;){const h=[n[d[0]],o[d[1]],i[d[2]]],p=u(u(h[0],h[1]),h[2]);if(!p)break;if(p===h[0]?d[0]++:p===h[1]?d[1]++:d[2]++,p.index<f)continue;const g=new HF(t,p.schema,p.index,p.lastIndex);this.__compiled__[g.schema].normalize(g,this),r.push(g),f=p.lastIndex}return r.length?r:null};Pi.prototype.matchAtStart=function(t){if(!t.length)return null;const r=this.re.schema_at_start.exec(t);if(!r)return null;const n=this.testSchemaAt(t,r[2],r[0].length);if(!n)return null;const i=new HF(t,r[2],r.index+r[1].length,r.index+r[0].length+n);return this.__compiled__[i.schema].normalize(i,this),i};Pi.prototype.tlds=function(t,r){return t=Array.isArray(t)?t:[t],r?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(n,i,o){return n!==o[i-1]}).reverse(),eg(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,eg(this),this)};Pi.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Pi.prototype.onCompile=function(){};const _c=2147483647,ss=36,Px=1,Gf=26,nG=38,iG=700,WF=72,GF=128,JF="-",oG=/^xn--/,sG=/[^\0-\x7F]/,aG=/[\x2E\u3002\uFF0E\uFF61]/g,lG={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Kv=ss-Px,as=Math.floor,Hv=String.fromCharCode;function ka(e){throw new RangeError(lG[e])}function uG(e,t){const r=[];let n=e.length;for(;n--;)r[n]=t(e[n]);return r}function QF(e,t){const r=e.split("@");let n="";r.length>1&&(n=r[0]+"@",e=r[1]),e=e.replace(aG,".");const i=e.split("."),o=uG(i,t).join(".");return n+o}function YF(e){const t=[];let r=0;const n=e.length;for(;r<n;){const i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){const o=e.charCodeAt(r++);(o&64512)==56320?t.push(((i&1023)<<10)+(o&1023)+65536):(t.push(i),r--)}else t.push(i)}return t}const cG=e=>String.fromCodePoint(...e),dG=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:ss},Ck=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},XF=function(e,t,r){let n=0;for(e=r?as(e/iG):e>>1,e+=as(e/t);e>Kv*Gf>>1;n+=ss)e=as(e/Kv);return as(n+(Kv+1)*e/(e+nG))},ZF=function(e){const t=[],r=e.length;let n=0,i=GF,o=WF,s=e.lastIndexOf(JF);s<0&&(s=0);for(let a=0;a<s;++a)e.charCodeAt(a)>=128&&ka("not-basic"),t.push(e.charCodeAt(a));for(let a=s>0?s+1:0;a<r;){const l=n;for(let d=1,f=ss;;f+=ss){a>=r&&ka("invalid-input");const h=dG(e.charCodeAt(a++));h>=ss&&ka("invalid-input"),h>as((_c-n)/d)&&ka("overflow"),n+=h*d;const p=f<=o?Px:f>=o+Gf?Gf:f-o;if(h<p)break;const g=ss-p;d>as(_c/g)&&ka("overflow"),d*=g}const u=t.length+1;o=XF(n-l,u,l==0),as(n/u)>_c-i&&ka("overflow"),i+=as(n/u),n%=u,t.splice(n++,0,i)}return String.fromCodePoint(...t)},eI=function(e){const t=[];e=YF(e);const r=e.length;let n=GF,i=0,o=WF;for(const l of e)l<128&&t.push(Hv(l));const s=t.length;let a=s;for(s&&t.push(JF);a<r;){let l=_c;for(const d of e)d>=n&&d<l&&(l=d);const u=a+1;l-n>as((_c-i)/u)&&ka("overflow"),i+=(l-n)*u,n=l;for(const d of e)if(d<n&&++i>_c&&ka("overflow"),d===n){let f=i;for(let h=ss;;h+=ss){const p=h<=o?Px:h>=o+Gf?Gf:h-o;if(f<p)break;const g=f-p,m=ss-p;t.push(Hv(Ck(p+g%m,0))),f=as(g/m)}t.push(Hv(Ck(f,0))),o=XF(i,u,a===s),i=0,++a}++i,++n}return t.join("")},fG=function(e){return QF(e,function(t){return oG.test(t)?ZF(t.slice(4).toLowerCase()):t})},hG=function(e){return QF(e,function(t){return sG.test(t)?"xn--"+eI(t):t})},tI={version:"2.3.1",ucs2:{decode:YF,encode:cG},decode:ZF,encode:eI,toASCII:hG,toUnicode:fG},pG={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},gG={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},mG={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},vG={default:pG,zero:gG,commonmark:mG},_G=/^(vbscript|javascript|file|data):/,bG=/^data:image\/(gif|png|jpeg|webp);/;function yG(e){const t=e.trim().toLowerCase();return _G.test(t)?bG.test(t):!0}const rI=["http:","https:","mailto:"];function xG(e){const t=Tx(e,!0);if(t.hostname&&(!t.protocol||rI.indexOf(t.protocol)>=0))try{t.hostname=tI.toASCII(t.hostname)}catch{}return Fh(Ax(t))}function SG(e){const t=Tx(e,!0);if(t.hostname&&(!t.protocol||rI.indexOf(t.protocol)>=0))try{t.hostname=tI.toUnicode(t.hostname)}catch{}return zc(Ax(t),zc.defaultChars+"%")}function io(e,t){if(!(this instanceof io))return new io(e,t);t||Nx(e)||(t=e||{},e="default"),this.inline=new Ph,this.block=new mm,this.core=new Fx,this.renderer=new ud,this.linkify=new Pi,this.validateLink=yG,this.normalizeLink=xG,this.normalizeLinkText=SG,this.utils=kH,this.helpers=hm({},TH),this.options={},this.configure(e),t&&this.set(t)}io.prototype.set=function(e){return hm(this.options,e),this};io.prototype.configure=function(e){const t=this;if(Nx(e)){const r=e;if(e=vG[r],!e)throw new Error('Wrong `markdown-it` preset "'+r+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(r){e.components[r].rules&&t[r].ruler.enableOnly(e.components[r].rules),e.components[r].rules2&&t[r].ruler2.enableOnly(e.components[r].rules2)}),this};io.prototype.enable=function(e,t){let r=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){r=r.concat(this[i].ruler.enable(e,!0))},this),r=r.concat(this.inline.ruler2.enable(e,!0));const n=e.filter(function(i){return r.indexOf(i)<0});if(n.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this};io.prototype.disable=function(e,t){let r=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){r=r.concat(this[i].ruler.disable(e,!0))},this),r=r.concat(this.inline.ruler2.disable(e,!0));const n=e.filter(function(i){return r.indexOf(i)<0});if(n.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this};io.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};io.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const r=new this.core.State(e,this,t);return this.core.process(r),r.tokens};io.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};io.prototype.parseInline=function(e,t){const r=new this.core.State(e,this,t);return r.inlineMode=!0,this.core.process(r),r.tokens};io.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};function Ur(e){return"var("+e+")"}let EG=E([c("color",Ur(y.textPrimary)),c("font-size",Ur($.sizeSm)),c("line-height",Ur($.lineHeightRelaxed)),c("word-break","break-word"),xr("& > :first-child",[c("margin-top","0")]),xr("& > :last-child",[c("margin-bottom","0")]),xr("& h1, & h2, & h3, & h4, & h5, & h6",[c("margin","var("+F.md+") 0 var("+F.sm+")"),c("line-height",Ur($.lineHeightTight)),c("font-weight",Ur($.weightBold))]),xr("& h1",[c("font-size",Ur($.sizeXl))]),xr("& h2",[c("font-size",Ur($.sizeLg))]),xr("& h3, & h4, & h5, & h6",[c("font-size",Ur($.sizeMd))]),xr("& p",[c("margin","var("+F.sm+") 0")]),xr("& a",[c("color",Ur(y.brand)),c("text-decoration","none")]),xr("& a:hover",[c("text-decoration","underline")]),xr("& ul, & ol",[c("margin","var("+F.sm+") 0"),c("padding-left","1.5em")]),xr("& li",[c("margin","var("+F.xs+") 0")]),xr("& code",[c("font-family",Ur($.fontFamilyMono)),c("font-size","0.9em"),c("background",Ur(y.surfaceSubtle)),c("padding","1px 4px"),c("border-radius",Ur(X.sm))]),xr("& pre",[c("background",Ur(y.surfaceSubtle)),c("border","1px solid var("+y.borderSubtle+")"),c("border-radius",Ur(X.md)),c("padding",Ur(F.md)),c("overflow","auto"),c("margin","var("+F.sm+") 0")]),xr("& pre code",[c("background","none"),c("padding","0")]),xr("& blockquote",[c("margin","var("+F.sm+") 0"),c("padding-left",Ur(F.md)),c("border-left","3px solid var("+y.border+")"),c("color",Ur(y.textSecondary))]),xr("& table",[c("border-collapse","collapse"),c("margin","var("+F.sm+") 0")]),xr("& th, & td",[c("border","1px solid var("+y.borderSubtle+")"),c("padding","var("+F.xs+") var("+F.sm+")"),c("text-align","left")]),xr("& th",[c("background",Ur(y.surfaceSubtle)),c("font-weight",Ur($.weightMedium))]),xr("& img",[c("max-width","100%"),c("border-radius",Ur(X.sm))]),xr("& hr",[c("border","none"),c("border-top","1px solid var("+y.borderSubtle+")"),c("margin","var("+F.md+") 0")])]),wG=new io({html:!1,linkify:!0});function kG(e){let t=e.source,r=Lt(()=>wG.render(t),[t]),n=Je(null);return Re(()=>{ie(ms(n.current),i=>{Array.from(i.querySelectorAll("a")).forEach(o=>{o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer")})})},[r]),b("div",{ref:pr(n),className:EG,dangerouslySetInnerHTML:{__html:r}})}let nI=kG;function CG(e,t){return b(nI,{source:e.body})}function RG(){wF({id:"markdown",label:"Markdown",constraints:{},preview:CG})}function bc(e){return Array.from(e).length}function Ox(e,t){let r=Array.from(e),n=t<0?0:t;return r.length<=n?[e,""]:[r.slice(0,n).join(""),r.slice(n).join("")]}function iI(e,t){return T(t,r=>{let i=Ox(e,r)[1];if(i!=="")return i})}function ur(e){return"var("+e+")"}let AG=E([L("flex"),he("column"),c("gap","4px")]),Rk=E([c("background",ur(y.surface)),c("border","1px solid var("+y.border+")"),c("border-radius",ur(X.sm)),c("padding","var("+F.xs+") var("+F.sm+")"),c("font-family","inherit"),c("font-size",ur($.sizeMd)),c("line-height",ur($.lineHeightNormal)),c("color",ur(y.textPrimary)),c("outline","none"),c("resize","vertical"),Uo({NAME:"percent",VAL:100}),c("box-sizing","border-box"),c("transition","border-color 120ms"),la([c("border-color",ur(y.brand))])]),TG=E([c("border-color",ur(y.error)),la([c("border-color",ur(y.error))])]),$G=E([L("flex"),ee("center"),Qe("spaceBetween"),c("gap",ur(F.sm)),c("font-size",ur($.sizeXs)),c("color",ur(y.textSecondary))]),NG=E([L("inlineFlex"),ee("center"),c("gap","4px"),c("color",ur(y.textSecondary))]),Ak=E([c("font-variant-numeric","tabular-nums")]),DG=E([c("color",ur(y.error)),c("font-weight",ur($.weightMedium))]),FG=E([c("background",ur(y.surfaceSubtle)),c("border","1px solid var("+y.borderSubtle+")"),c("border-left","3px solid var("+y.error+")"),c("border-radius",ur(X.sm)),c("padding","var("+F.xs+") var("+F.sm+")"),c("font-size",ur($.sizeXs)),c("line-height",ur($.lineHeightNormal)),c("white-space","pre-wrap"),c("word-break","break-word"),c("max-height","8em"),c("overflow","auto")]),IG=E([c("color",ur(y.textSecondary)),c("font-size",ur($.sizeXs)),um(ke(2))]),PG=E([c("color",ur(y.textPrimary))]),OG=E([c("color",ur(y.error)),c("font-weight",ur($.weightMedium))]),MG=E([c("color",ur(y.textDisabled)),c("text-decoration","line-through")]);function oI(e){return e.toString()+" character"+(e===1?"":"s")}function sI(e,t){return t!==void 0?e>t?(e-t|0).toString()+" over the "+t.toString()+"-character limit":e.toString()+" / "+t.toString():e.toString()+" characters"}function LG(e){let t=e.note,r=e.hasError,n=e.rows,i=e.channelLabel,o=e.maxLength,s=e.onBlur,a=e.onChange,l=e.value,u=s!==void 0?s:()=>{},d=n!==void 0?n:6,f=r!==void 0?r:!1,h=Array.from(l).length,p=iI(l,o),g=We(p),m=f||g?Rk+" "+TG:Rk,v;if(p!==void 0&&o!==void 0){let _=Ox(l,o);v=M("div",{children:[b("div",{children:"Sent as:",className:IG}),M("div",{children:[b("span",{children:_[0],className:PG}),b("span",{children:"✂",className:OG}),b("span",{children:p,className:MG})],className:FG})]})}else v=null;return M("div",{children:[b("textarea",{className:m,name:e.name,placeholder:e.placeholder,rows:d,value:l,onBlur:_=>u(),onChange:_=>a(_.target.value)}),M("div",{children:[M("span",{children:[i!==void 0?i:null,t!==void 0?We(i)?" · "+t:t:null],className:NG}),b("span",{children:sI(h,o),className:g?Ak+" "+DG:Ak})],className:$G}),v],className:AG})}let zG=LG;MK();RG();function zt(e){return"var("+e+")"}let UG=E([L("flex"),he("column"),c("gap",zt(F.sm)),c("background",zt(y.surface)),c("border","1px solid var("+y.border+")"),c("border-radius",zt(X.md)),c("padding",zt(F.md))]),BG=E([L("flex"),ee("center"),Qe("spaceBetween"),c("gap",zt(F.sm))]),jG=E([c("font-size",zt($.sizeSm)),c("font-weight",zt($.weightMedium)),c("color",zt(y.textPrimary))]),qG=E([c("font-size",zt($.sizeXs)),c("color",zt(y.textSecondary))]),Ep=E([c("font-size",zt($.sizeXs)),c("color",zt(y.textSecondary)),c("font-variant-numeric","tabular-nums"),c("white-space","nowrap")]),Tk=E([c("color",zt(y.error)),c("font-weight",zt($.weightMedium))]),VG=E([L("flex"),ee("baseline"),Qe("spaceBetween"),c("gap",zt(F.sm)),c("border-bottom","1px solid var("+y.borderSubtle+")"),c("padding-bottom",zt(F.xs))]),KG=E([c("font-size",zt($.sizeMd)),c("font-weight",zt($.weightMedium)),c("color",zt(y.textPrimary)),c("word-break","break-word")]),HG=E([c("color",zt(y.textDisabled)),c("text-decoration","line-through")]),WG=E([c("color",zt(y.error)),c("font-weight",zt($.weightMedium))]),GG=E([c("margin","0"),c("font-family","inherit"),c("font-size",zt($.sizeSm)),c("line-height",zt($.lineHeightRelaxed)),c("color",zt(y.textPrimary)),c("white-space","pre-wrap"),c("word-break","break-word")]),JG=E([c("max-width","100%"),c("border-radius",zt(X.sm)),c("border","1px solid var("+y.borderSubtle+")"),c("object-fit","cover")]),QG=E([c("font-size",zt($.sizeXs)),c("color",zt(y.error)),c("background",zt(y.surfaceSubtle)),c("border-left","3px solid var("+y.error+")"),c("border-radius",zt(X.sm)),c("padding","var("+F.xs+") var("+F.sm+")")]);function $k(e,t){let r=Ox(e,t),n=r[1];return n===""?e:M(qr,{children:[r[0],b("span",{children:"✂",className:WG}),b("span",{children:n,className:HG})]})}function YG(e){let t=e.showHeader,r=e.message,n=e.channelId,i=t!==void 0?t:!0,o=kF(n);Re(()=>{no(o)&&bK(n,"ChannelPreview")},[n]);let s=fe(o,n,_=>_.label),a=fe(o,CF,_=>_.constraints),l=bc(r.body),u=iI(r.body,a.maxLength),d=r.subject,f;if(d!==void 0){let _=a.subjectMaxLength,x=bc(d),w=fe(_,!1,S=>x>S);f=M("div",{children:[b("span",{children:_!==void 0?$k(d,_):d,className:KG}),_!==void 0?b("span",{children:x.toString()+" / "+_.toString(),className:w?Ep+" "+Tk:Ep}):null],className:VG})}else f=null;let h=T(o,_=>_.preview),p;if(h!==void 0)p=h(r,a);else{let _=a.maxLength;p=b("pre",{children:_!==void 0?$k(r.body,_):r.body,className:GG})}let g=r.imageUrl,m;if(g!==void 0){let _=a.mediaAspect;m=b("img",{className:JG,style:_!==void 0?TK({},"aspectRatio",_):{},alt:"Message media",src:Mc(g)})}else m=null;let v=a.note;return M("div",{children:[i?M("div",{children:[b("span",{children:s,className:jG}),b("span",{children:sI(l,a.maxLength),className:We(u)?Ep+" "+Tk:Ep})],className:BG}):null,f,p,u!==void 0?b("div",{children:oI(bc(u))+" past the limit — "+s+" will cut the tail.",className:QG}):null,m,v!==void 0?b("span",{children:v,className:qG}):null],className:UG})}let XG=YG;function Z(e,...t){const r=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",e);for(const i of t)n.append("v",i);throw r.search=n.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function aI(e,...t){const r=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",e);for(const i of t)n.append("v",i);r.search=n.toString(),console.warn(`Minified Lexical warning #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const qo=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ZG=qo&&"documentMode"in document?document.documentMode:null,Eo=qo&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Za=qo&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Bc=!(!qo||!("InputEvent"in window)||ZG)&&"getTargetRanges"in new window.InputEvent("input"),el=qo&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,lI=qo&&/Android/.test(navigator.userAgent),Oh=qo&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!lI,uI=qo&&/^(?=.*Chrome).*/i.test(navigator.userAgent),tg=qo&&lI&&uI,Mh=qo&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Eo&&!uI,eJ=0,tJ=1,rJ=2,Nk=1,Dk=2,Fk=4,Ik=8,nJ=16,Wv=32,Gv=64,Mx=128,iJ=1,oJ=2,sJ=3,aJ=4,lJ=5,uJ=6,Jf=Oh||el||Mh?" ":"​",ql=`
18
-
19
- `,Lx=Za?" ":Jf,ta={bold:1,capitalize:1024,code:16,highlight:Mx,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},cJ={directionless:1,unmergeable:2},rg={center:2,end:6,justify:4,left:1,right:3,start:5},dJ={[oJ]:"center",[uJ]:"end",[aJ]:"justify",[iJ]:"left",[sJ]:"right",[lJ]:"start"},fJ={normal:0,segmented:2,token:1},hJ={[eJ]:"normal",[rJ]:"segmented",[tJ]:"token"},Pk="$config";function Ok(){return gr()._blockCursorElement}function pJ(e){return e!==null&&e.nodeType===1&&e.hasAttribute("data-lexical-slot")}let cI=class C0{element;before;after;constructor(t,r,n){this.element=t,this.before=r||null,this.after=n||null}withBefore(t){return new C0(this.element,t,this.after)}withAfter(t){return new C0(this.element,this.before,t)}withElement(t){return this.element===t?this:new C0(t,this.before,this.after)}insertChild(t){const r=this.getInsertionAnchor();return r!==null&&r.parentElement!==this.element&&Z(357),this.element.insertBefore(t,r),this}removeChild(t){return t.parentElement!==this.element&&Z(358),this.element.removeChild(t),this}replaceChild(t,r){return r.parentElement!==this.element&&Z(359),this.element.replaceChild(t,r),this}getFirstChild(){const t=this.getFirstChildAnchor(),r=t?t.nextSibling:this.element.firstChild;return r===this.getInsertionAnchor()?null:r}getFirstChildAnchor(){return this.after}resolveLeafPosition(t,r,n){if(this.element===t)return r===t&&n===0?"before":"after";const i=Mk(t,this.element);if(i===null)return"after";const o=Array.prototype.indexOf.call(t.childNodes,i);if(o<0)return"after";if(r===t)return n<=o?"before":"after";const s=Mk(t,r);if(s===null)return"after";const a=Array.prototype.indexOf.call(t.childNodes,s);return a>=0&&a<=o?"before":"after"}getInsertionAnchor(){return this.before}};function Mk(e,t){let r=t;for(;r!==null&&r.parentNode!==e;)r=r.parentNode;return r}class yc extends cI{withBefore(t){return new yc(this.element,t,this.after)}withAfter(t){return new yc(this.element,this.before,t)}withElement(t){return this.element===t?this:new yc(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()}getFirstChildAnchor(){let t=super.getFirstChildAnchor(),r=t?t.nextSibling:this.element.firstChild;for(;pJ(r);)t=r,r=r.nextSibling;const n=t?t.nextSibling:this.element.firstChild;return n!==null&&n===Ok()?n:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(this.element.__lexicalLastChildKind=t,t===null)this.removeManagedLineBreak();else{const r=t==="decorator"&&(Mh||el||Oh);this.insertManagedLineBreak(r)}}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const r=this.element,n=t.nodeName==="IMG"?t.nextSibling:null;n&&r.removeChild(n),r.removeChild(t),r.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const r=this.getManagedLineBreak();if(r){if(t===(r.nodeName==="IMG"))return;this.removeManagedLineBreak()}const n=this.element,i=this.before,o=Yt().createElement("br");if(o.setAttribute("data-lexical-managed-linebreak","true"),n.insertBefore(o,i),t){const s=Yt().createElement("img");s.setAttribute("data-lexical-managed-linebreak","true"),s.style.setProperty("display","inline","important"),s.style.setProperty("border","0px","important"),s.style.setProperty("margin","0px","important"),s.alt="",n.insertBefore(s,o),n.__lexicalLineBreak=s}else n.__lexicalLineBreak=o}getFirstChildOffset(){const t=this.getFirstChild(),r=this.getInsertionAnchor();let n=0;for(let i=this.element.firstChild;i!==null&&i!==t&&i!==r;i=i.nextSibling)n++;return n}resolveChildIndex(t,r,n,i){if(n===this.element){const l=this.getFirstChildOffset(),u=Ok(),d=this.element.childNodes,f=Math.min(i,d.length);let h=0;for(let p=l;p<f;p++)d[p]!==u&&h++;return[t,Math.min(h,t.getChildrenSize())]}const o=Lk(r,n);o.push(i);const s=Lk(r,this.element);let a=t.getIndexWithinParent();for(let l=0;l<s.length;l++){const u=o[l],d=s[l];if(u===void 0||u<d)break;if(u>d){a+=1;break}}return[t.getParentOrThrow(),a]}}function Lk(e,t){const r=[];let n=t;for(;n!==e&&n!==null;n=n.parentNode){let i=0;for(let o=n.previousSibling;o!==null;o=o.previousSibling)i++;r.push(i)}return n!==e&&Z(225),r.reverse()}let dI;try{dI="0.48.0+prod.esm"}catch{}const fI=dI??'"<unknown>+source"';let Bd=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(t){return delete this._cache,this._front.has(t)||this._back.add(t),this}addFront(t){return delete this._cache,this._back.has(t)||this._front.add(t),this}delete(t){return delete this._cache,this._front.delete(t)||this._back.delete(t)}toArray(){const t=Array.from(this._front).reverse();for(const r of this._back)t.push(r);return t}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}};const Al=null;function hI(e,t=1e3){return e instanceof by?e.clone():e.size<t?new Map(e):new by().init(new Map(e),void 0,e.size)}let by=class pI{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new pI().init(this._old,this._nursery,this._size)}init(t,r,n){return this._old=t,this._nursery=r,this._size=n,this}get size(){return this._size}has(t){return this.get(t)!==void 0}getWithTombstone(t){const r=this._nursery&&this._nursery.get(t);return r!==void 0?r:this._old&&this._old.get(t)}get(t){const r=this.getWithTombstone(t);return r===Al?void 0:r}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(t=!1){if(this._nursery&&this._nursery.size>0&&(t||this.shouldCompact())){const r=new Map(this._old);for(const[n,i]of this._nursery)i!==Al?r.set(n,i):r.delete(n);this._old=r,this._nursery=void 0}return this._mutable=!1,this}set(t,r){const n=this.getWithTombstone(t);if(n===r)return this;const i=this.getNursery();return n!==Al&&n!==void 0||(this._size++,n===Al&&i.delete(t)),i.set(t,r),this}delete(t){const r=this.has(t);return r&&(this.getNursery().set(t,Al),this._size--),r}getOrInsert(t,r){const n=this.get(t);return n!==void 0?n:(this.set(t,r),r)}getOrInsertComputed(t,r){const n=this.get(t);if(n!==void 0)return n;const i=r(t);return this.set(t,i),i}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(const t of this.entries())yield t[0]}*values(){for(const t of this.entries())yield t[1]}*entries(){const t=this._nursery,r=this._old;if(r)for(const n of r){const i=n[0],o=t?t.get(i):void 0;o!==Al&&(o!==void 0&&(n[1]=o),yield n)}if(t)for(const n of t)n[1]===Al||r&&r.has(n[0])||(yield n)}forEach(t,r){r!==void 0&&(t=t.bind(r));for(const[n,i]of this.entries())t(i,n,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}};function ng(e,t,r,n,i,o){if(U(e)){let s=e.getFirstChild();for(;s!==null;){const a=s.__key;s.__parent===t&&((U(s)||Gs(s)&&s.__slots!==null)&&ng(s,a,r,n,i,o),r.has(a)||o.delete(a),i.push(a)),s=s.getNextSibling()}}for(const s of Gs(e)&&e.__slots!==null?e.__slots.values():[]){const a=n.get(s);a!==void 0&&fu(a)&&a.__slotHost===t&&((U(a)||Gs(a)&&a.__slots!==null)&&ng(a,s,r,n,i,o),r.has(s)||o.delete(s),i.push(s))}}let yy=!1,zx=0;function gJ(e){zx=e.timeStamp}function Jv(e,t,r){const n=e.nodeName==="BR",i=t.__lexicalLineBreak;return i&&(e===i||n&&e.previousSibling===i)||n&&vd(e,r)!==void 0}function mJ(e,t,r){const n=Yn(mi(r)),i=n&&oo(n,r._rootElement);let o=null,s=null;i!==null&&i.anchorNode===e&&(o=i.anchorOffset,s=i.focusOffset);const a=e.nodeValue;a!==null&&tS(t,a,o,s,!1)}function vJ(e,t,r){if(te(e)){const n=e.anchor.getNode();if(n.is(r)&&e.format!==n.getFormat())return!1}return gi(t)&&r.isAttached()}function _J(e,t,r){for(let n=e;n&&!GP(n);n=ku(n)){const i=vd(n,t);if(i!==void 0){const o=Qt(i,r);if(o)return ct(o)||!tt(n)?void 0:[n,o]}}}function gI(e,t,r){yy=!0;const n=performance.now()-zx>100;try{Xi(e,()=>{const i=de()||(function(f){return f.read("latest",()=>{const h=de();return h!==null?h.clone():null})})(e),o=new Map,s=e._editorState,a=e._blockCursorElement;let l=!1,u="";for(let f=0;f<t.length;f++){const h=t[f],p=h.type,g=h.target,m=_J(g,e,s);if(!m)continue;const[v,_]=m;if(p==="characterData")n&&ne(_)&&gi(g)&&vJ(i,g,_)&&mJ(g,_,e);else if(p==="childList"){l=!0;const x=h.addedNodes;for(let k=0;k<x.length;k++){const A=x[k],C=IP(A),R=A.parentNode;if(!(R==null||A===a||C!==null||Jv(A,R,e)||e._slotsUsed&&tt(A)&&A.hasAttribute("data-lexical-slot")||GP(A))){if(Za){const N=(tt(A)?A.innerText:null)||A.nodeValue;N&&(u+=N)}R.removeChild(A)}}const w=h.removedNodes,S=w.length;if(S>0){let k=0;for(let A=0;A<S;A++){const C=w[A];(Jv(C,g,e)||a===C)&&(g.appendChild(C),k++)}S!==k&&o.set(v,_)}}}if(o.size>0)for(const[f,h]of o)h.reconcileObservedMutation(f,e);const d=r.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const h=d[f],p=h.addedNodes,g=h.target;for(let m=0;m<p.length;m++){const v=p[m],_=v.parentNode;_==null||v.nodeName!=="BR"||Jv(v,g,e)||_.removeChild(v)}}r.takeRecords()}i!==null&&(l&&gn(i),Za&&UP(e)&&i.insertRawText(u))})}finally{yy=!1}}function mI(e){const t=e._observer;t!==null&&gI(e,t.takeRecords(),t)}function vI(e){(function(t){zx===0&&mi(t).addEventListener("textInput",gJ,!0)})(e),e._observer=new MutationObserver((t,r)=>{gI(e,t,r)})}const zk="latest";let bJ=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(t,r){this.key=t,this.parse=r.parse.bind(r),this.unparse=(r.unparse||SJ).bind(r),this.isEqual=(r.isEqual||Object.is).bind(r),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=r.resetOnCopyNode||!1}};function Lh(e,t){return new bJ(e,t)}function zh(e,t,r=zk){const n=(r===zk?e.getLatest():e).__state;return n?n.getValue(t):t.defaultValue}function xc(e,t,r){let n;if(on(),typeof r=="function"){const o=e.getLatest(),s=zh(o,t);if(n=r(s),t.isEqual(s,n))return o}else n=r;const i=e.getWritable();return bI(i).updateFromKnown(t,n),i}function yJ(e){const t=new Map,r=new Set;for(const{ownNodeConfig:n}of sS(typeof e=="function"?e:e.replace))if(n&&n.stateConfigs)for(const i of n.stateConfigs){let o;"stateConfig"in i?(o=i.stateConfig,i.flat&&r.add(o.key)):o=i,t.set(o.key,o)}return{flatKeys:r,sharedConfigMap:t}}const Uk=new Set(["__proto__","constructor","prototype"]);let xJ=class _I{node;knownState;unknownState;sharedNodeState;size;constructor(t,r,n=void 0,i=new Map,o=void 0){this.node=t,this.sharedNodeState=r,this.unknownState=n,this.knownState=i;const{sharedConfigMap:s}=this.sharedNodeState,a=o!==void 0?o:(function(l,u,d){let f=d.size;if(u)for(const h in u){const p=l.get(h);p&&d.has(p)||f++}return f})(s,n,i);this.size=a}getValue(t){const r=this.knownState.get(t);if(r!==void 0)return r;this.sharedNodeState.sharedConfigMap.set(t.key,t);let n=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const i=this.unknownState[t.key];i!==void 0&&(n=t.parse(i)),this.updateFromKnown(t,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState},r={};for(const[n,i]of this.knownState)n.isEqual(i,n.defaultValue)?delete t[n.key]:t[n.key]=n.unparse(i);for(const n of this.sharedNodeState.flatKeys)n in t&&(r[n]=t[n],delete t[n]);return Bk(t)&&(r.$=t),r}getWritable(t){if(this.node===t)return this;const{sharedNodeState:r,unknownState:n}=this,i=new Map(this.knownState);return new _I(t,r,(function(o,s,a){let l;if(a)for(const[u,d]of Object.entries(a)){if(Uk.has(u))continue;const f=o.get(u);f?s.has(f)||s.set(f,f.parse(d)):(l=l||{},l[u]=d)}return l})(r.sharedConfigMap,i,n),i,this.size)}resetOnCopyNode(){for(const t of this.knownState.keys())t.resetOnCopyNode&&this.knownState.set(t,t.defaultValue);return this}updateFromKnown(t,r){const n=t.key;this.sharedNodeState.sharedConfigMap.set(n,t);const{knownState:i,unknownState:o}=this;i.has(t)||o&&n in o||(o&&(delete o[n],this.unknownState=Bk(o)),this.size++),i.set(t,r)}updateFromUnknown(t,r){if(Uk.has(t))return;const n=this.sharedNodeState.sharedConfigMap.get(t);n?this.updateFromKnown(n,n.parse(r)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=r)}updateFromJSON(t){const{knownState:r}=this;for(const n of r.keys())r.set(n,n.defaultValue);if(this.size=r.size,this.unknownState=void 0,t)for(const[n,i]of Object.entries(t))this.updateFromUnknown(n,i)}};function bI(e){const t=e.getWritable(),r=t.__state?t.__state.getWritable(t):new xJ(t,yI(t));return t.__state=r,r}function yI(e){return e.__state?e.__state.sharedNodeState:NP(gr(),e.getType()).sharedNodeState}function Bk(e){if(e)for(const t in e)return e}function SJ(e){return e}function jk(e,t,r){for(const[n,i]of t.knownState){if(e.has(n.key))continue;e.add(n.key);const o=r?r.getValue(n):n.defaultValue;if(o!==i&&!n.isEqual(o,i))return!0}return!1}function qk(e,t,r){const{unknownState:n}=t,i=r?r.unknownState:void 0;if(n){for(const[o,s]of Object.entries(n))if(!e.has(o)&&(e.add(o),s!==(i?i[o]:void 0)))return!0}return!1}function Vk(e,t){const r=e.__state;return r&&r.node===e?r.getWritable(t):r}function Kk(e,t){const r=e.__mode,n=e.__format,i=e.__style,o=t.__mode,s=t.__format,a=t.__style,l=e.__state,u=t.__state;return(r===null||r===o)&&(n===null||n===s)&&(i===null||i===a)&&(e.__state===null||l===u||(function(d,f){if(d===f)return!0;const h=new Set;return!(d&&jk(h,d,f)||f&&jk(h,f,d)||d&&qk(h,d,f)||f&&qk(h,f,d))})(l,u))}function Hk(e,t){const r=e.mergeWithSibling(t),n=Dt()._normalizedNodes;return n.add(e.__key),n.add(t.__key),r}function Wk(e){let t,r,n=e;if(n.__text!==""||!n.isSimpleText()||n.isUnmergeable()){for(;(t=n.getPreviousSibling())!==null&&ne(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Kk(t,n)){n=Hk(t,n);break}break}t.remove()}for(;(r=n.getNextSibling())!==null&&ne(r)&&r.isSimpleText()&&!r.isUnmergeable();){if(r.__text!==""){if(Kk(n,r)){n=Hk(n,r);break}break}r.remove()}}else n.remove()}function Pa(e){return Gk(e.anchor),Gk(e.focus),e}function Gk(e){for(;e.type==="element";){const t=e.getNode(),r=e.offset;let n,i;if(r===t.getChildrenSize()?(n=t.getChildAtIndex(r-1),i=!0):(n=t.getChildAtIndex(r),i=!1),ne(n)){e.set(n.__key,i?n.getTextContentSize():0,"text",!0);break}if(!U(n))break;e.set(n.__key,i?n.getChildrenSize():0,"element",!0)}}const Qf=Symbol.for("@lexical/CachedTextSize");function Jk(e,t){return Sy.read(()=>{let r=0,n=e;for(let i=0;i<t&&n!==null;i++){const o=Ro.get(n);if(o===void 0&&Z(345,n),U(o)){const s=lr.get(n);if(s!==void 0&&U(s)&&s.__parent!==o.__parent)r+=o.getTextContentSize();else{const a=su.get(n),l=a&&a.__lexicalTextContent;typeof l!="string"&&Z(346,o.getType()),r+=l.length}i<t-1&&!o.isInline()&&(r+=2)}else{const s=o[Qf];s===void 0&&Z(347,o.getType(),n),r+=s}n=o.__next}return r},{editor:kt})}function xI(e){U(e)||e[Qf]===void 0&&(e[Qf]=ne(e)?e.__text.length:e.getTextContentSize())}const EJ=4;let Yf,kt,Xf,ft="",Cr=null,Fn=null,wn=null;function ls(){return{firstTextKey:wn,format:Cr,style:Fn}}function Ki(e){e.firstTextKey!==null&&(Cr=e.format,Fn=e.style,wn=e.firstTextKey)}function xy(e){if(wn!==null)return;const t=e.__lexicalFirstTextKey;if(t===void 0&&Z(348),t===null)return;const r=lr.get(t);ne(r)&&(Cr=r.getFormat(),Fn=r.getStyle(),wn=t)}let _m,yf,xf,Ro,Sy,lr,su,Ey,Zf,au,qs=!1,ig=!1;function Va(e,t){const r=Ro.get(e),n=lr.has(e);if(t!==null){const i=Ay(e);i.parentNode===t&&t.removeChild(i)}if(!n){if(kt._keyToDOMMap.delete(e),U(r)){const i=xg(r,Ro);wy(i,0,i.length-1,null)}if(r!==void 0){for(const i of Ei(r).values()){const o=Cy(i);Va(i,null),o!==null&&o.remove()}rS(Zf,Xf,_m,r,"destroyed")}}}function wy(e,t,r,n){for(let i=t;i<=r;++i){const o=e[i];o!==void 0&&Va(o,n)}}function Tl(e,t){e.setProperty("text-align",t)}const wJ="40px";function SI(e,t){const r=Yf.theme.indent;if(typeof r=="string"){const n=e.classList.contains(r);t>0&&!n?e.classList.add(r):t<1&&n&&e.classList.remove(r)}e.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * var(--lexical-indent-base-value, ${wJ}))`)}function EI(e,t){const r=e.style;t===0?Tl(r,""):t===1?Tl(r,"left"):t===2?Tl(r,"center"):t===3?Tl(r,"right"):t===4?Tl(r,"justify"):t===5?Tl(r,"start"):t===6&&Tl(r,"end")}function ky(e,t){const r=(function(n){const i=n.__dir;if(i!==null)return i;if(Er(n))return null;const o=n.getParent();return o===null||Zt(o)&&o.__dir===null?"auto":null})(t);r!==null?e.dir=r:e.removeAttribute("dir")}function wI(e){const t=Yt().createElement("div");return t.setAttribute("data-lexical-slot",e),t.style.display="none",t}function kI(e,t,r){t||e.contentEditable==="false"?BQ(r,kt):r.removeAttribute("contenteditable")}function Qk(e,t,r){const n=ft,i=ls();ft="";let o="";const s=ct(e);for(const[a,l]of r){const u=wI(a);kI(t,s,u),t.appendChild(u),ft="";const d=ls();Ka(l,so(e,u,kt)),Ki(d),CI(e,a,t,u),o+=ft}return Ki(i),ft=n,o}function Ei(e){return Gs(e)&&e.__slots!==null?e.__slots:YP}function CI(e,t,r,n){const i=au.$getSlotTargetElement(e,t,r,kt);i!==null&&(n.parentElement!==i&&i.appendChild(n),n.style.display="")}function Cy(e){const t=su.get(e);return t!==void 0?t.parentElement:null}function Yk(e,t,r){const n=Ei(e),i=Ei(t);for(const[d,f]of n)if(!i.has(d)){const h=Cy(f);Va(f,null),h!==null&&h.remove()}const o=ft,s=ls();let a="",l=null;const u=ct(t);for(const[d,f]of i){const h=n.get(d);let p=h!==void 0?Cy(h):null;ft="";const g=ls();if(p===null){p=wI(d);let m=null;for(const v of r.children)if(!v.hasAttribute("data-lexical-slot")){m=v;break}r.insertBefore(p,m),Ka(f,so(t,p,kt))}else h===f?Ms(f,p):(h!==void 0&&Va(h,p),Ka(f,so(t,p,kt)));if(Ki(g),kI(r,u,p),CI(t,d,r,p),a+=ft,p.parentElement===r){const m=l===null?r.firstChild:l.nextSibling;m!==p&&r.insertBefore(p,m),l=p}}return Ki(s),ft=o,a}function Ka(e,t){const r=lr.get(e);if(r===void 0&&Z(60),t!==null){const i=Ro.get(e);if(i!==void 0){const o=su.get(e);if(o!==void 0){const s=fu(i)?i.__slotHost:null,a=fu(r)?r.__slotHost:null,l=i.__parent!==r.__parent||s!==a,u=a!==null&&o.parentElement!==t.element;if(l||u)return t.insertChild(o),Ms(e,t.element)}}}const n=au.$createDOM(r,kt);if((function(i,o,s){const a=s._keyToDOMMap;PP(o,s,i),a.set(i,o)})(e,n,kt),ne(r)?n.setAttribute("data-lexical-text","true"):ct(r)&&(n.setAttribute("data-lexical-decorator","true"),UQ(n,{captureSelection:!0})),U(r)){const i=r.__indent,o=r.__size;ky(n,r),i!==0&&SI(n,i);const s=Ei(r),a=s.size>0?Qk(r,n,s):"";if(o===0)n.__lexicalTextContent=a,n.__lexicalFirstTextKey=null,ft+=a,s.size>0&&(n.__lexicalSlotTextLength=a.length);else{const u=ft,d=o-1;if(Ry(xg(r,lr),r,0,d,so(r,n,kt)),a!==""){const f=n.__lexicalTextContent||"";n.__lexicalTextContent=a+f,ft=u+a+f}s.size>0&&(n.__lexicalSlotTextLength=a.length)}const l=r.__format;l!==0&&EI(n,l),r.isInline()||RI(null,r,n)}else{const i=r.getTextContent();if(ct(r)){const o=r.decorate(kt,Yf);o!==null&&AI(e,o),n.contentEditable="false";const s=Ei(r);s.size>0&&Qk(r,n,s)}ft+=i}return t!==null&&t.insertChild(n),au.$decorateDOM(r,null,n,kt),xI(r),rS(Zf,Xf,_m,r,"created"),n}function Ry(e,t,r,n,i){const o=ft,s=ls();ft="",Cr=null,Fn=null,wn=null;let a=r;for(;a<=n;++a){const u=ls();Ka(e[a],i);const d=lr.get(e[a]);d!==null&&ne(d)?Cr===null&&(Cr=d.getFormat(),Fn=d.getStyle(),wn=d.__key):U(d)&&a<n&&!d.isInline()&&(ft+=ql),Ki(u)}const l=kt._keyToDOMMap.get(t.__key);l===void 0&&Z(349,t.__key),l.__lexicalTextContent=ft,l.__lexicalFirstTextKey=wn,ft=o+ft,Ki(s)}function RI(e,t,r){const n=so(t,r,kt),i=n.element.__lexicalLastChildKind??null,o=(function(s,a){if(s){const l=s.__last;if(l){const u=a.get(l);if(u)return Qn(u)?"line-break":ct(u)&&u.isInline()?"decorator":null}return Ei(s).size>0?null:"empty"}return null})(t,lr);i!==o&&n.setManagedLineBreak(o)}function kJ(e,t,r){var n;Cr=null,Fn=null,wn=null,(function(i,o,s){const a=ft,l=i.__size,u=o.__size;ft="";const d=s.element,f=kt._keyToDOMMap.get(o.__key);f===void 0&&Z(351,o.__key);const h=u-l;if(!qs&&Math.abs(h)<=1&&l>=EJ&&i.__first===o.__first&&(h!==0||!kt._cloneNotNeeded.has(i.__key))){const p=f.__lexicalTextContent,g=Ey.get(i.__key);if(!qs&&typeof p=="string"&&g!==void 0){const m=(function(v,_){const x=_.size;if(x===0||x>=v.__size)return null;let w=v.__last,S=null,k=0;for(;w!==null&&k<x;){if(!_.has(w))return null;S=w;const A=lr.get(w);if(A===void 0)return null;w=A.__prev,k++}return k!==x||w!==null&&_.has(w)?null:S})(o,g);if(m!==null){const v=g.size;if(h===0){const _=Jk(m,v);let x=m,w=0;for(;x!==null&&w<v;){const R=lr.get(x);if(R===void 0)break;const N=ls();Ms(x,d),ne(R)&&Cr===null&&(Cr=R.getFormat(),Fn=R.getStyle(),wn=R.__key),Ki(N),x=R.__next,w++}let S="";for(x=m,w=0;x!==null&&w<v;){const R=lr.get(x);if(R===void 0)break;let N;if(U(R)){const I=kt._keyToDOMMap.get(x),P=I&&I.__lexicalTextContent;typeof P!="string"&&Z(352,R.getType()),N=P}else N=R.getTextContent();S+=N,w<v-1&&U(R)&&!R.isInline()&&(S+=ql),x=R.__next,w++}const k=f.__lexicalSlotTextLength||0,A=k>0?p.slice(k):p,C=A.slice(0,A.length-_)+S;return f.__lexicalTextContent=C,ft=a+C,void Xk(o,f,g)}if((function(_,x,w,S,k,A,C,R){if(R!==1&&R!==-1||C!==(R===1?2:1))return!1;const I=C-R;let P=_.__last;for(let be=0;be<I-1;be++){if(P===null)return!1;const Se=Ro.get(P);if(Se===void 0)return!1;P=Se.__prev}if(P===null)return!1;const z=lr.get(A),q=Ro.get(P);if(z===void 0||q===void 0||z.__prev!==q.__prev)return!1;const H=[];let V=A;for(let be=0;be<C;be++){if(V===null)return!1;H.push(V);const Se=lr.get(V);V=Se?Se.__next:null}const Y=[];V=P;for(let be=0;be<I;be++){if(V===null)return!1;Y.push(V);const Se=Ro.get(V);V=Se?Se.__next:null}const G=new Set(Y),J=new Set(H),Q=[];let ue=0,le=0;for(;ue<I&&le<C;)if(H[le]===Y[ue])Q.push({key:H[le],kind:"reconcile"}),ue++,le++;else if(J.has(Y[ue])){if(G.has(H[le]))return!1;Q.push({key:H[le],kind:"create",nextIndex:le}),le++}else Q.push({key:Y[ue],kind:"destroy"}),ue++;for(;ue<I;)Q.push({key:Y[ue++],kind:"destroy"});for(;le<C;)Q.push({key:H[le],kind:"create",nextIndex:le}),le++;const Ae=Jk(P,I);for(const be of Q){const Se=ls();if(be.kind==="reconcile")Ms(be.key,w.element);else if(be.kind==="destroy")Va(be.key,w.element);else{let st=null;for(let Xt=be.nextIndex+1;Xt<C;Xt++){const wt=kt._keyToDOMMap.get(H[Xt]);if(wt!==void 0){st=wt;break}}Ka(be.key,w.withBefore(st??w.before))}if(be.kind!=="destroy"){const st=lr.get(be.key);st&&ne(st)&&Cr===null&&(Cr=st.getFormat(),Fn=st.getStyle(),wn=st.__key)}Ki(Se)}let $e="";for(let be=0;be<C;be++){const Se=lr.get(H[be]);if(Se===void 0)return!1;let st;if(U(Se)){const Xt=kt._keyToDOMMap.get(H[be]),wt=Xt&&Xt.__lexicalTextContent;typeof wt!="string"&&Z(350,Se.getType()),st=wt}else st=Se.getTextContent();$e+=st,be<C-1&&U(Se)&&!Se.isInline()&&($e+=ql)}const ze=S.__lexicalSlotTextLength||0,mt=ze>0?k.slice(ze):k;return S.__lexicalTextContent=mt.slice(0,mt.length-Ae)+$e,!0})(i,0,s,f,p,m,v,h)){const _=f.__lexicalTextContent;return typeof _!="string"&&Z(353),ft=a+_,void Xk(o,f,g)}}}if(h===0){let m=i.__first,v=0;for(;m!==null;){const _=lr.get(m);if(_===void 0)break;const x=qs||xf.has(m)||yf.has(m),w=ls();if(x)Ms(m,d);else{let S,k;if(U(_)){k=su.get(m);const A=k&&k.__lexicalTextContent;typeof A!="string"&&Z(354,_.getType()),S=A}else S=_.getTextContent();ft+=S,k!==void 0&&xy(k)}ne(_)?Cr===null&&(Cr=_.getFormat(),Fn=_.getStyle(),wn=_.__key):U(_)&&v<u-1&&!_.isInline()&&(ft+=ql),Ki(w),m=_.__next,v++}return f.__lexicalTextContent=ft,f.__lexicalFirstTextKey=wn,void(ft=a+ft)}}if(l===1&&u===1){const p=i.__first,g=o.__first;if(p===g)Ms(p,d);else{const v=Ay(p),_=Ka(g,null);try{v.parentNode===d?d.replaceChild(_,v):s.insertChild(_)}catch(x){if(typeof x=="object"&&x!=null){const w=`${x.toString()} Parent: ${d.tagName}, new child: {tag: ${_.tagName} key: ${g}}, old child: {tag: ${v.tagName}, key: ${p}}.`;throw new Error(w)}throw x}Va(p,null)}const m=lr.get(g);ne(m)&&Cr===null&&(Cr=m.getFormat(),Fn=m.getStyle(),wn=m.__key)}else{const p=xg(i,Ro),g=xg(o,lr);if(p.length!==l&&Z(227),g.length!==u&&Z(228),l===0)u!==0&&Ry(g,o,0,u-1,s);else if(u===0){if(l!==0){const m=s.after==null&&s.before==null&&Ei(o).size===0&&s.element.__lexicalLineBreak==null;wy(p,0,l-1,m?null:d),m&&(d.textContent="")}}else(function(m,v,_,x,w,S){const k=x-1,A=w-1;let C,R,N=S.getFirstChild(),I=0,P=0;for(;I<=k&&P<=A;){const H=v[I],V=_[P],Y=ls();if(H===V)N=Qv(Ms(V,S.element)),I++,P++;else{if(R===void 0&&(R=Zk(_,P)),C===void 0)C=Zk(v,I);else if(!C.has(H)){I++,Ki(Y);continue}if(!R.has(H)){N=Qv(Ay(H)),Va(H,S.element),I++,C.delete(H),Ki(Y);continue}if(C.has(V)){const J=Kc(kt,V);J!==N&&S.withBefore(N??S.before).insertChild(J),N=Qv(Ms(V,S.element)),I++,P++}else Ka(V,S.withBefore(N??S.before)),P++}const G=lr.get(V);G!==null&&ne(G)?Cr===null&&(Cr=G.getFormat(),Fn=G.getStyle(),wn=G.__key):U(G)&&P<=A&&!G.isInline()&&(ft+=ql),Ki(Y)}const z=I>k,q=P>A;if(z&&!q){const H=_[A+1],V=H===void 0?null:kt.getElementByKey(H);Ry(_,m,P,A,S.withBefore(V??S.before))}else q&&!z&&wy(v,I,k,S.element)})(o,p,g,l,u,s)}f.__lexicalTextContent=ft,f.__lexicalFirstTextKey=wn,ft=a+ft})(e,t,so(t,r,kt)),Zt(t)||(n=t,Cr==null||Cr===n.__textFormat||ig||n.setTextFormat(Cr),(function(i){Fn==null||Fn===i.__textStyle||ig||i.setTextStyle(Fn)})(t))}function Xk(e,t,r){const n=t.__lexicalFirstTextKey;if(n!=null){const i=e.__key;let o=n;for(;o!==null;){const s=lr.get(o);if(s===void 0){o=null;break}if(s.__parent===i)break;o=s.__parent}if(o!==null&&!r.has(o)){const s=lr.get(n);if(ne(s))return Cr=s.getFormat(),void(Fn=s.getStyle())}}t.__lexicalFirstTextKey=wn}function Ms(e,t){const r=Ro.get(e);let n=lr.get(e);r!==void 0&&n!==void 0||Z(61);const i=qs||xf.has(e)||yf.has(e),o=Kc(kt,e);if(r===n&&!i){let s;if(U(r)){const a=o.__lexicalTextContent;typeof a!="string"&&Z(355,r.getType()),s=a,xy(o)}else s=r.getTextContent();return ft+=s,o}if(r!==n&&i&&rS(Zf,Xf,_m,n,"updated"),au.$updateDOM(n,r,o,kt)){const s=Ka(e,null);return t===null&&Z(62),t.replaceChild(s,o),Va(e,null),s}if(U(r)){U(n)||Z(334,e);const s=n.__indent;(qs||s!==r.__indent)&&SI(o,s);const a=n.__format;(qs||a!==r.__format)&&EI(o,a);const l=i&&(Ei(n).size>0||Ei(r).size>0)?Yk(r,n,o):"";if(i){const u=ft;if(kJ(r,n,o),Er(n)||n.isInline()||RI(0,n,o),l!==""){const d=o.__lexicalTextContent||"";o.__lexicalTextContent=l+d,ft=u+l+d,o.__lexicalSlotTextLength=l.length}else(Ei(n).size>0||Ei(r).size>0)&&(o.__lexicalSlotTextLength=0)}else{const u=o.__lexicalTextContent;typeof u!="string"&&Z(356,r.getType()),ft+=u,xy(o)}if((qs||n.__dir!==r.__dir||n.__parent!==r.__parent)&&(ky(o,n),Er(n)&&!qs))for(const u of n.getChildren())U(u)&&ky(Kc(kt,u.getKey()),u)}else{const s=n.getTextContent();if(ct(n)){const a=n.decorate(kt,Yf);a!==null&&AI(e,a),i&&(Ei(n).size>0||Ei(r).size>0)&&Yk(r,n,o)}ft+=s}if(!ig&&Er(n)){const s=n.getLatest();if(s.__cachedText!==ft){const a=s.getWritable();a.__cachedText=ft,n=a}}return au.$decorateDOM(n,r,o,kt),xI(n),o}function AI(e,t){let r=kt._pendingDecorators;const n=kt._decorators;if(r===null){if(n[e]===t)return;r=OP(kt)}r[e]=t}function Qv(e){let t=e.nextSibling;return t!==null&&t===kt._blockCursorElement&&(t=t.nextSibling),t}function Zk(e,t){const r=new Set;for(let n=t;n<e.length;n++)r.add(e[n]);return r}function CJ(e,t,r,n,i,o){ft="",Cr=null,Fn=null,wn=null,qs=n===2,kt=r,Yf=r._config,au=r._config.dom||mg,Xf=r._nodes,_m=kt._listeners.mutation,yf=i,xf=o,Ro=e._nodeMap,Sy=e,lr=t._nodeMap,ig=t._readOnly,su=hI(r._keyToDOMMap),Ey=(function(){const a=new Map,l=u=>{for(const d of u){const f=lr.get(d);if(f===void 0)continue;const h=f.__parent;if(h===null)continue;let p=a.get(h);p===void 0&&(p=new Set,a.set(h,p)),p.add(d)}};return l(yf.keys()),l(xf),a})();const s=new Map;return Zf=s,Ms("root",null),kt=void 0,Xf=void 0,yf=void 0,xf=void 0,Ro=void 0,Sy=void 0,lr=void 0,Yf=void 0,su=void 0,Ey=void 0,Zf=void 0,au=mg,s}function Ay(e){const t=su.get(e);return t===void 0&&Z(75,e),t}function je(e){return{type:e}}const TI=je("SELECTION_CHANGE_COMMAND"),RJ=je("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),$I=je("CLICK_COMMAND"),NI=je("BEFORE_INPUT_COMMAND"),DI=je("INPUT_COMMAND"),FI=je("COMPOSITION_START_COMMAND"),II=je("COMPOSITION_END_COMMAND"),Hl=je("DELETE_CHARACTER_COMMAND"),Sc=je("INSERT_LINE_BREAK_COMMAND"),eh=je("INSERT_PARAGRAPH_COMMAND"),Ec=je("CONTROLLED_TEXT_INSERTION_COMMAND"),Ux=je("PASTE_COMMAND"),R0=je("REMOVE_TEXT_COMMAND"),th=je("DELETE_WORD_COMMAND"),rh=je("DELETE_LINE_COMMAND"),Ao=je("FORMAT_TEXT_COMMAND"),AJ=je("SET_TEXT_FORMAT_COMMAND"),bm=je("UNDO_COMMAND"),ym=je("REDO_COMMAND"),PI=je("KEYDOWN_COMMAND"),OI=je("KEY_ARROW_RIGHT_COMMAND"),MI=je("MOVE_TO_END"),LI=je("KEY_ARROW_LEFT_COMMAND"),zI=je("MOVE_TO_START"),UI=je("KEY_ARROW_UP_COMMAND"),BI=je("KEY_ARROW_DOWN_COMMAND"),nh=je("KEY_ENTER_COMMAND"),jI=je("KEY_SPACE_COMMAND"),Bx=je("KEY_BACKSPACE_COMMAND"),qI=je("KEY_ESCAPE_COMMAND"),VI=je("KEY_DELETE_COMMAND"),KI=je("KEY_TAB_COMMAND"),TJ=je("INSERT_TAB_COMMAND"),$J=je("INDENT_CONTENT_COMMAND"),eC=je("OUTDENT_CONTENT_COMMAND"),HI=je("DROP_COMMAND"),NJ=je("FORMAT_ELEMENT_COMMAND"),WI=je("DRAGSTART_COMMAND"),GI=je("DRAGOVER_COMMAND"),DJ=je("DRAGEND_COMMAND"),xm=je("COPY_COMMAND"),jx=je("CUT_COMMAND"),JI=je("SELECT_ALL_COMMAND"),FJ=je("CLEAR_EDITOR_COMMAND"),IJ=je("CLEAR_HISTORY_COMMAND"),wp=je("CAN_REDO_COMMAND"),kp=je("CAN_UNDO_COMMAND"),PJ=je("FOCUS_COMMAND"),OJ=je("BLUR_COMMAND"),MJ=je("KEY_MODIFIER_COMMAND");function LJ(e){const t=new Map;return{dispose(){for(const r of t.values())r.dispose();t.clear()},register(r,n){let i=t.get(r);i===void 0&&(i={dispose:e(r,n),holders:new Set},t.set(r,i));const o=()=>{const s=t.get(r);s&&s.holders.delete(o)&&s.holders.size===0&&(t.delete(r),s.dispose())};return i.holders.add(o),o}}}function zJ(e,t,r,n){return e.addEventListener(t,r,n),e.removeEventListener.bind(e,t,r,n)}const Ts=Object.freeze({}),Ty=[["keydown",function(e,t){const r=t._inputState;r.lastKeyDownTimeStamp=e.timeStamp,r.lastKeyCode=e.key,e.key!=="Backspace"&&ih(r),!t.isComposing()&&xe(t,PI,e)}],["pointerdown",function(e,t){const r=KP(e),n=e.pointerType;_d(r)&&n!=="touch"&&n!=="pen"&&e.button===0&&Xi(t,()=>{yg(r,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(e,t){xe(t,FI,e)}],["compositionend",function(e,t){const r=t._inputState;Za?r.compositionPhase="ending-firefox":el||!Oh&&!Mh?xe(t,II,e):(r.compositionPhase="ending-safari",r.compositionEndData=e.data)}],["input",function(e,t){e.stopPropagation();const r=t._inputState;ih(r),Xi(t,()=>{ZI(e,t)||t.dispatchCommand(DI,e)},{event:e}),r.unprocessedBeforeInputData=null}],["click",function(e,t){Xi(t,()=>{const r=de(),n=Yn(mi(t)),i=fd();if(n){if(te(r)){const o=r.anchor,s=o.getNode();o.type==="element"&&o.offset===0&&r.isCollapsed()&&!Er(s)&&Kr().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&i!==null&&r.is(i)&&(n.removeAllRanges(),r.dirty=!0)}else if(e.pointerType==="touch"||e.pointerType==="pen"){const o=oo(n,t._rootElement).anchorNode;(tt(o)||gi(o))&&gn(Kx(i,n,t,e))}}xe(t,$I,e)})}],["cut",Ts],["copy",Ts],["dragstart",Ts],["dragover",Ts],["dragend",Ts],["paste",Ts],["focus",Ts],["blur",Ts],["drop",Ts]];Bc&&Ty.push(["beforeinput",(e,t)=>(function(r,n){const i=r.inputType;i==="deleteCompositionText"||Za&&UP(n)||i!=="insertCompositionText"&&Xi(n,()=>{ZI(r,n)||xe(n,NI,r)},{event:r})})(e,t)]);const $y=new WeakMap,og=new WeakMap,UJ=LJ(e=>(e.addEventListener("selectionchange",oC),()=>e.removeEventListener("selectionchange",oC)));function QI(e,t,r,n,i,o){const s=e.anchor,a=e.focus,l=s.getNode(),u=Dt();let d;if(o!==void 0)d=o;else{const m=Yn(mi(u));d=m!==null?oo(m,u._rootElement):null}const f=d!==null?d.anchorNode:null,h=s.key,p=u.getElementByKey(h),g=r.length;return h!==a.key||!ne(l)||(!i&&(!Bc||u._inputState.lastBeforeInputInsertTextTimeStamp<n+50)||l.isDirty()&&g<2||MP(r))&&s.offset!==a.offset&&!l.isComposing()||Ci(l)||l.isDirty()&&g>1||(i||!Bc)&&p!==null&&!l.isComposing()&&f!==Ha(l,p,u)||d!==null&&t!==null&&(!t.collapsed||t.startContainer!==d.anchorNode||t.startOffset!==d.anchorOffset)||!l.isComposing()&&(l.getFormat()!==e.format||l.getStyle()!==e.style)||(function(m,v){if(v.isSegmented())return!0;if(!m.isCollapsed())return!1;const _=m.anchor.offset,x=v.getParentOrThrow(),w=Wl(v);return _===0?!v.canInsertTextBefore()||!x.canInsertTextBefore()&&!v.isComposing()||w||(function(S){const k=S.getPreviousSibling();return(ne(k)||U(k)&&k.isInline())&&!k.canInsertTextAfter()})(v):_===v.getTextContentSize()&&(!v.canInsertTextAfter()||!x.canInsertTextAfter()&&!v.isComposing()||w)})(e,l)}function tC(e,t){return gi(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function rC(e,t,r){const{anchorNode:n,anchorOffset:i,focusNode:o,focusOffset:s}=oo(e,t._rootElement),a=t._inputState;a.isSelectionChangeFromDOMUpdate&&(a.isSelectionChangeFromDOMUpdate=!1,tC(n,i)&&tC(o,s)&&!a.postDeleteSelectionToRestore)||Xi(t,()=>{if(!r)return void gn(null);if(!Bh(t,n,o))return;let l=de();if(a.postDeleteSelectionToRestore&&te(l)&&l.isCollapsed()){const u=l.anchor,d=a.postDeleteSelectionToRestore.anchor;(u.key===d.key&&u.offset===d.offset+1||u.offset===1&&d.getNode().is(u.getNode().getPreviousSibling()))&&(l=a.postDeleteSelectionToRestore.clone(),gn(l))}if(a.postDeleteSelectionToRestore=null,te(l)){const u=l.anchor,d=u.getNode();if(l.isCollapsed()){e.type==="Range"&&n===o&&(l.dirty=!0);const f=mi(t).event,h=f?f.timeStamp:performance.now(),{format:p,style:g,offset:m,key:v,timeStamp:_}=a.collapsedSelectionFormat,x=Kr(),w=t.isComposing()===!1&&x.getTextContent()==="";if(h<_+200&&u.offset===m&&u.key===v)A0(l,p,g);else if(u.type==="text")ne(d)||Z(141),YI(l,d);else if(u.type==="element"&&!w){U(d)||Z(259);const S=u.getNode();S.isEmpty()?(function(k,A){const C=A.getTextFormat(),R=A.getTextStyle();A0(k,C,R)})(l,S):A0(l,l.format,"")}}else{const f=u.key,h=l.focus.key,p=l.getNodes(),g=p.length,m=l.isBackward(),v=m?s:i,_=m?i:s,x=m?h:f,w=m?f:h;let S=2047,k=!1;for(let A=0;A<g;A++){const C=p[A],R=C.getTextContentSize();if(ne(C)&&R!==0&&!(A===0&&C.__key===x&&v===R||A===g-1&&C.__key===w&&_===0)&&(k=!0,S&=C.getFormat(),S===0))break}l.format=k?S:0}}xe(t,TI,void 0)})}function A0(e,t,r){e.format===t&&e.style===r||(e.format=t,e.style=r,e.dirty=!0)}function YI(e,t){A0(e,t.getFormat(),t.getStyle())}function XI(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return t.length===0?null:t[0]}function nC(e){const{lastKeyCode:t}=Dt()._inputState;if(e==null||e.length<=1||t==null)return;const r=t.length===1?t:t==="Enter"?`
20
- `:t==="Tab"?" ":null;if(!r)return;const n=de();if(!te(n)||!n.isCollapsed())return;const i=n.anchor.getNode();if(!ne(i))return;const{offset:o}=n.anchor;if(i.getTextContentSize()===o){const s=i.getNextSibling();if(r===`
21
- `){if(Qn(s))s.selectEnd();else if(!s){const a=Kt(i,jc),l=a&&a.getNextSibling();U(l)&&l.selectStart()}}else r===" "?lu(s)&&s.selectEnd():ne(s)&&s.getTextContent()[0]===r&&s.select(1,1)}else i.getTextContent()[o]===r&&i.select(o+1,o+1)}function ih(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function iC(e){ih(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>ih(e),0)}function ZI(e,t){const r=KP(e);if(tt(r)&&yg(r,t))return!0;const n=t.getRootElement();if(n===null)return!1;const i=ah(n.ownerDocument);return i!==null&&n.contains(i)&&yg(i,t)}function BJ(e){const t=e.inputType,r=XI(e),n=Dt(),i=n._inputState,o=de();if(t==="insertText"&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(ih(i),e.preventDefault(),te(o)&&!o.isCollapsed()){const f=o.isBackward()?o.anchor:o.focus;o.anchor.set(f.key,f.offset,f.type),o.focus.set(f.key,f.offset,f.type)}return!0}if(t==="deleteContentBackward"){if(o===null){const f=fd();if(!te(f))return!0;gn(f.clone())}if(te(o)){const f=o.anchor.key===o.focus.key;if((function(h,p){return h.lastKeyCode==="MediaLast"&&p<h.lastKeyDownTimeStamp+30})(i,e.timeStamp)&&n.isComposing()&&f){if(sn(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{Xi(n,()=>{sn(null)})},30),te(o)){const h=o.anchor.getNode();h.markDirty(),ne(h)||Z(142),YI(o,h)}}else{if(sn(null),el&&r!==null&&!r.collapsed&&(o.applyDOMRange(r),!o.isCollapsed()))return e.preventDefault(),o.removeText(),!0;e.preventDefault();const h=o.anchor.getNode(),p=h.getTextContent(),g=h.canInsertTextAfter(),m=o.anchor.offset===0&&o.focus.offset===p.length;let v=tg&&f&&!m&&g;if(v&&o.isCollapsed()&&(v=!ct(kQ(o.anchor,!0))),!v){xe(n,Hl,!0);const _=de();tg&&te(_)&&_.isCollapsed()&&(i.postDeleteSelectionToRestore=_,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!te(o))return!0;const s=e.data;i.unprocessedBeforeInputData!==null&&eS(!1,n,i.unprocessedBeforeInputData),o.dirty&&i.unprocessedBeforeInputData===null||!o.isCollapsed()||Er(o.anchor.getNode())||r===null||o.applyDOMRange(r),i.unprocessedBeforeInputData=null;const a=o.anchor,l=o.focus,u=a.getNode(),d=l.getNode();if(t==="insertText"||t==="insertTranspose"){if(s===`
22
- `)e.preventDefault(),xe(n,Sc,!1);else if(s===ql)e.preventDefault(),xe(n,eh,void 0);else if(s==null&&e.dataTransfer){const f=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(f)}else s!=null&&QI(o,r,s,e.timeStamp,!0)?(e.preventDefault(),xe(n,Ec,s),nC(s)):i.unprocessedBeforeInputData=s;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":xe(n,Ec,e),nC((e.dataTransfer?e.dataTransfer.getData("text/plain"):null)??e.data);break;case"insertFromComposition":{const f=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;const h=n._compositionKey;sn(null),f||xe(n,Ec,e),T0(h);break}case"insertLineBreak":sn(null),xe(n,Sc,!1);break;case"insertParagraph":sn(null),i.isInsertLineBreak&&!el?(i.isInsertLineBreak=!1,xe(n,Sc,!1)):xe(n,eh,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":xe(n,Ux,e);break;case"deleteByComposition":(function(f,h){return f!==h||U(f)||U(h)||!Wl(f)||!Wl(h)})(u,d)&&xe(n,R0,e);break;case"deleteByDrag":du(Dy),xe(n,R0,e);break;case"deleteByCut":xe(n,R0,e);break;case"deleteContent":xe(n,Hl,!1);break;case"deleteWordBackward":xe(n,th,!0);break;case"deleteWordForward":xe(n,th,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":xe(n,rh,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":xe(n,rh,!1);break;case"formatStrikeThrough":xe(n,Ao,"strikethrough");break;case"formatBold":xe(n,Ao,"bold");break;case"formatItalic":xe(n,Ao,"italic");break;case"formatUnderline":xe(n,Ao,"underline");break;case"historyUndo":xe(n,bm,void 0);break;case"historyRedo":xe(n,ym,void 0)}return!0}function jJ(e){const t=Dt(),r=t._inputState,n=de(),i=e.data,o=XI(e);let s=!1;if(i!=null&&te(n)){const a=Yn(mi(t)),l=a!==null?oo(a,t._rootElement):null,u=e.inputType==="insertCompositionText"&&r.compositionPhase!=="ending-firefox"&&!t.isComposing();u&&(r.hadOrphanedCompositionEvents=!0);const d=n.anchor.getNode(),f=e.inputType==="insertCompositionText"&&r.compositionPhase!=="ending-firefox"&&t.isComposing()&&ne(d)&&Ci(d);if(!u&&!f&&QI(n,o,i,e.timeStamp,!1,l)){if(s=!0,r.compositionPhase==="ending-firefox"){const _=sg(t,i);if(r.compositionPhase="idle",_)return du(oh),$C(),!0}const h=n.anchor.getNode();if(a===null||l===null)return!0;const p=n.isBackward(),g=p?n.anchor.offset:n.focus.offset,m=p?n.focus.offset:n.anchor.offset;Bc&&!n.isCollapsed()&&ne(h)&&l.anchorNode!==null&&h.getTextContent().slice(0,g)+i+h.getTextContent().slice(g+m)===zP(l.anchorNode)||xe(t,Ec,i);const v=i.length;Za&&v>1&&e.inputType==="insertCompositionText"&&!t.isComposing()&&(n.anchor.offset-=v,n._cachedNodes=null,n._cachedIsBackward=null),tg&&t.isComposing()&&(r.lastKeyDownTimeStamp=0,sn(null))}}return s||(eS(!1,t,i!==null?i:void 0),r.compositionPhase==="ending-firefox"&&(sg(t,i||void 0),du(oh),r.compositionPhase="idle")),$C(),!0}function qJ(e){const t=Dt(),r=t._inputState,n=de();if(te(n)&&!t.isComposing()){r.compositionPhase="composing",r.hadOrphanedCompositionEvents=!1;const i=n.anchor,o=n.anchor.getNode();if(sn(i.key),du(aP),e.timeStamp<r.lastKeyDownTimeStamp+30||i.type==="element"||!n.isCollapsed()||!tg&&(o.getFormat()!==n.format||ne(o)&&o.getStyle()!==n.style)||ne(o)&&(Ci(o)||i.offset===0&&!o.canInsertTextBefore()||i.offset===o.getTextContentSize()&&!o.canInsertTextAfter())){xe(t,Ec,Lx);const s=de();te(s)&&sn(s.anchor.key)}}return!0}function VJ(e){const t=Dt();return t._inputState.compositionPhase="idle",sg(t,e.data),du(oh),!0}function T0(e){if(e===null)return;const t=Qt(e);if(!ne(t)||t.getType()==="text"||Ci(t)||!t.isAttached())return;const r=de(),n=te(r)&&r.anchor.key===e?r.anchor.offset:null,i=Sr(t.getTextContent());if(i.setFormat(t.getFormat()),i.setStyle(t.getStyle()),t.replace(i),n!==null){const o=Math.min(n,i.getTextContentSize());i.select(o,o)}}function sg(e,t){const r=e._compositionKey;if(sn(null),r!==null&&t!=null){if(t===""){const i=Qt(r),o=e.getElementByKey(r),s=o!==null&&ne(i)?Ha(i,o,e):null;if(s!==null&&s.nodeValue!==null&&ne(i)){const a=Yn(mi(e)),l=a&&oo(a,e._rootElement);let u=null,d=null;l!==null&&l.anchorNode===s&&(u=l.anchorOffset,d=l.focusOffset),tS(i,s.nodeValue,u,d,!0)}return T0(r),!1}if(t[t.length-1]===`
23
- `){const i=de();if(te(i)||Wt(i)){if(te(i)){const o=i.focus;i.anchor.set(o.key,o.offset,o.type)}return xe(e,nh,null),T0(r),!1}}const n=Qt(r);if(n!==null&&ne(n)&&Ci(n)){n.markDirty();const i=de(),o=n.getTextContentSize(),s=te(i)&&i.anchor.key===r?i.anchor.offset:o;return n.select(s,s).insertText(t),!0}}return eS(!0,e,t),T0(r),!1}function KJ(e){const t=Dt(),r=t._inputState;if(e.key==null)return!0;if(r.compositionPhase==="ending-safari"){const n=DC(e);if(n&&Xi(t,()=>{sg(t,r.compositionEndData)}),r.compositionPhase="idle",r.compositionEndData="",n)return!0}if((function(n){return jt(n,"ArrowRight",{shiftKey:"any"})})(e))xe(t,OI,e);else if((function(n){return jt(n,"ArrowRight",{...Ns,shiftKey:"any"})})(e))xe(t,MI,e);else if((function(n){return jt(n,"ArrowLeft",{shiftKey:"any"})})(e))xe(t,LI,e);else if((function(n){return jt(n,"ArrowLeft",{...Ns,shiftKey:"any"})})(e))xe(t,zI,e);else if((function(n){return jt(n,"ArrowUp",{altKey:"any",shiftKey:"any"})})(e))xe(t,UI,e);else if((function(n){return jt(n,"ArrowDown",{altKey:"any",shiftKey:"any"})})(e))xe(t,BI,e);else if((function(n){return jt(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(e))r.isInsertLineBreak=!0,xe(t,nh,e);else if((function(n){return n.key===" "})(e))xe(t,jI,e);else if((function(n){return Eo&&jt(n,"o",{ctrlKey:!0})})(e))e.preventDefault(),r.isInsertLineBreak=!0,xe(t,Sc,!0);else if((function(n){return jt(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(e))r.isInsertLineBreak=!1,xe(t,nh,e);else if((function(n){return jt(n,"Backspace",{shiftKey:"any"})||Eo&&jt(n,"h",{ctrlKey:!0})})(e))DC(e)?xe(t,Bx,e)&&iC(r):(e.preventDefault(),xe(t,Hl,!0));else if((function(n){return n.key==="Escape"})(e))xe(t,qI,e);else if((function(n){return jt(n,"Delete",{})||Eo&&jt(n,"d",{ctrlKey:!0})})(e))(function(n){return n.key==="Delete"})(e)?xe(t,VI,e):(e.preventDefault(),xe(t,Hl,!1));else if((function(n){return jt(n,"Backspace",NC)})(e))e.preventDefault(),xe(t,th,!0);else if((function(n){return jt(n,"Delete",NC)})(e))e.preventDefault(),xe(t,th,!1);else if((function(n){return Eo&&jt(n,"Backspace",{metaKey:!0})})(e))e.preventDefault(),xe(t,rh,!0);else if((function(n){return Eo&&(jt(n,"Delete",{metaKey:!0})||jt(n,"k",{ctrlKey:!0}))})(e))e.preventDefault(),xe(t,rh,!1);else if((function(n){return jt(n,"b",Ns)})(e))e.preventDefault(),xe(t,Ao,"bold");else if((function(n){return jt(n,"u",Ns)})(e))e.preventDefault(),xe(t,Ao,"underline");else if((function(n){return jt(n,"i",Ns)})(e))e.preventDefault(),xe(t,Ao,"italic");else if((function(n){return jt(n,"Tab",{shiftKey:"any"})})(e))xe(t,KI,e);else if((function(n){return jt(n,"z",Ns)})(e))e.preventDefault(),xe(t,bm,void 0);else if((function(n){return Eo?jt(n,"z",{metaKey:!0,shiftKey:!0}):jt(n,"y",{ctrlKey:!0})||jt(n,"z",{ctrlKey:!0,shiftKey:!0})})(e))e.preventDefault(),xe(t,ym,void 0);else{const n=t._editorState._selection;(function(i){return jt(i,"a",Ns)})(e)?(e.preventDefault(),xe(t,JI,e)&&iC(r)):n===null||te(n)||((function(i){return jt(i,"c",Ns)})(e)?(e.preventDefault(),xe(t,xm,e)):(function(i){return jt(i,"x",Ns)})(e)&&(e.preventDefault(),xe(t,jx,e)))}return(function(n){return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey})(e)&&t.dispatchCommand(MJ,e),!0}function eP(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}const wc=new Map;function oC(e){const t=TQ(e.target);if(t===null)return;const r=nS(e.target);let n=null,i=null;const o=r!==null?og.get(r):void 0;if(r!==null){if(o!==void 0){const f=o.editors;let h=o.hasShadowEditor;if(h===void 0){h=!1;for(const p of f)if(p._rootElement!==null&&ra(p._rootElement.getRootNode())){h=!0;break}o.hasShadowEditor=h}if(h){let p=null,g=null;for(const m of f){const v=m._rootElement;if(v===null)continue;const _=oo(t,v).anchorNode;if(_!==null&&Cc(_)===m){if(ra(v.getRootNode())){n=m,i=_;break}p===null&&(p=m,g=_)}}n===null&&p!==null&&(n=p,i=g)}else{const p=t.anchorNode;p===null||tt(p)&&p.shadowRoot!==null||(n=Cc(p),n!==null&&(i=p))}}if(n===null){const f=ah(r);n=f!==null?Cc(f):null}}if(n===null)return;if(n._inputState.isSelectionChangeFromMouseDown){if(o!==void 0)for(const f of o.editors)f._inputState.isSelectionChangeFromMouseDown=!1;Xi(n,()=>{const f=fd(),h=i??oo(t,n._rootElement).anchorNode;(tt(h)||gi(h))&&gn(Kx(f,t,n,e))})}const s=Zx(n),a=s[s.length-1],l=a._key,u=wc.get(l),d=u||a;d!==n&&rC(t,d,!1),rC(t,n,!0),n!==a?wc.set(l,n):u&&wc.delete(l)}function sC(e){e._lexicalHandled=!0}function aC(e){return e._lexicalHandled===!0}function HJ(e){const t=$y.get(e);if(t===void 0)return;const r=og.get(t);if(r===void 0)return;$y.delete(e);const n=jh(e);wm(n)?((function(o){if(o._parentEditor!==null){const s=Zx(o),a=s[s.length-1]._key;wc.get(a)===o&&wc.delete(a)}else wc.delete(o._key)})(n),r.editors.delete(n),r.hasShadowEditor=void 0,e.__lexicalEditor=null):n&&Z(198);const i=eP(e);for(let o=0;o<i.length;o++)i[o]();e.__lexicalEventHandles=[]}function Ny(e,t,r){on();const n=e.__key,i=e.getParent();if(i===null)return void(An(e)!==null&&Z(367,n,String(An(e))));const o=(function(a){const l=de();if(!te(l)||!U(a))return l;const{anchor:u,focus:d}=l,f=u.getNode(),h=d.getNode();return Hc(f,a)&&u.set(a.__key,0,"element"),Hc(h,a)&&d.set(a.__key,0,"element"),l})(e);let s=!1;if(te(o)&&t){const a=o.anchor,l=o.focus;a.key===n&&(dg(a,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0),l.key===n&&(dg(l,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else Wt(o)&&t&&e.isSelected()&&e.selectPrevious();if(te(o)&&t&&!s){const a=e.getIndexWithinParent();Ks(e),Ul(o,i,a,-1)}else Ks(e);r||Zt(i)||i.canBeEmpty()||!i.isEmpty()||Ny(i,t),t&&o&&Er(i)&&i.isEmpty()&&i.selectEnd()}const tP=Symbol.for("ephemeral");function ag(e){return e[tP]||!1}const lC={configurable:!0,enumerable:!1,value:void 0,writable:!0};class Ni{__type;__key;__parent;__prev;__next;__state;[Qf];static getType(){const{ownNodeType:t}=oS(this);return t===void 0&&Z(64,this.name),t}static clone(t){Z(65,this.name)}$config(){return{}}config(t,r){const n=r.extends||QP(this.constructor);return Object.assign(r,{extends:n}),typeof t=="string"&&Object.assign(r,{type:t}),{[t]:r}}afterCloneFrom(t){this.__key===t.__key?(this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev,this.__state=t.__state):t.__state&&(this.__state=t.__state.getWritable(this))}resetOnCopyNodeFrom(t){this.__state&&(this.__state=this.__state.getWritable(this).resetOnCopyNode())}static importDOM;constructor(t){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",lC),Object.defineProperty(this,Qf,lC),FP(this,t)}getType(){return this.__type}isInline(){Z(137,this.constructor.name)}isAttached(){let t=this.__key;for(;t!==null;){if(t==="root")return!0;const r=Qt(t);if(r===null)break;t=r.__parent!==null?r.__parent:An(r)}return!1}isSelected(t){const r=t||de();if(r==null)return!1;const n=r.getNodes().some(i=>i.__key===this.__key);if(ne(this))return n;if(te(r)&&r.anchor.type==="element"&&r.focus.type==="element"){if(r.isCollapsed())return!1;const i=this.getParent();if(ct(this)&&this.isInline()&&i){const o=r.isBackward()?r.focus:r.anchor;if(i.is(o.getNode())&&o.offset===i.getChildrenSize()&&this.is(i.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(t===null)return-1;let r=t.getFirstChild(),n=0;for(;r!==null;){if(this.is(r))return n;n++,r=r.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return t===null?null:Qt(t)}getParentOrThrow(){const t=this.getParent();return t===null&&Z(66,this.__key),t}getTopLevelElement(){let t=this;for(;t!==null;){const r=t.getParent();if(Zt(r)||An(t)!==null)return U(t)||t===this&&ct(t)||Z(194),t;t=r}return null}getTopLevelElementOrThrow(){const t=this.getTopLevelElement();return t===null&&Z(67,this.__key),t}getParents(){const t=[];let r=this.getParent();for(;r!==null;)t.push(r),r=r.getParent();return t}getParentKeys(){const t=[];let r=this.getParent();for(;r!==null;)t.push(r.__key),r=r.getParent();return t}getPreviousSibling(){const t=this.getLatest().__prev;return t===null?null:Qt(t)}getPreviousSiblings(){const t=[],r=this.getParent();if(r===null)return t;let n=r.getFirstChild();for(;n!==null&&!n.is(this);)t.push(n),n=n.getNextSibling();return t}getNextSibling(){const t=this.getLatest().__next;return t===null?null:Qt(t)}getNextSiblings(){const t=[];let r=this.getNextSibling();for(;r!==null;)t.push(r),r=r.getNextSibling();return t}getCommonAncestor(t){const r=U(this)?this:this.getParent(),n=U(t)?t:t.getParent(),i=r&&n?jy(r,n):null;return i?i.commonAncestor:null}is(t){return t!=null&&this.__key===t.__key}isBefore(t){const r=jy(this,t);return r!==null&&(r.type==="descendant"||(r.type==="branch"?rO(r)===-1:(r.type!=="same"&&r.type!=="ancestor"&&Z(279),!1)))}isParentOf(t){return Hc(t,this)}getNodesBetween(t){const r=this.isBefore(t),n=[],i=new Set;let o=this;for(;o!==null;){const s=o.__key;if(i.has(s)||(i.add(s),n.push(o)),o===t)break;const a=U(o)?r?o.getFirstChild():o.getLastChild():null;if(a!==null){o=a;continue}const l=r?o.getNextSibling():o.getPreviousSibling();if(l!==null){o=l;continue}const u=o.getParentOrThrow();if(i.has(u.__key)||n.push(u),u===t)break;let d=null,f=u;do{if(f===null&&Z(68),d=r?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;d!==null||i.has(f.__key)||n.push(f)}while(d===null);o=d}return r||n.reverse(),n}isDirty(){const t=Dt()._dirtyLeaves;return t!==null&&t.has(this.__key)}getLatest(){if(ag(this))return this;const t=Qt(this.__key);return t===null&&Z(113),t}getWritable(){if(ag(this))return this;on();const t=da(),r=Dt(),n=t._nodeMap,i=this.__key,o=this.getLatest(),s=r._cloneNotNeeded,a=de();if(a!==null&&a.setCachedNodes(null),s.has(i))return vg(o),o;const l=WP(o);return s.add(i),vg(l),n.set(i,l),l}getTextContent(){return XP(this)}getTextContentSize(){return this.getTextContent().length}createDOM(t,r){Z(70)}updateDOM(t,r,n){Z(71)}getDOMSlot(t){return new cI(t)}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){const t=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...t}}static importJSON(t){Z(18,this.name)}updateFromJSON(t){return(function(r,n){const i=r.getWritable(),o=n.$;let s=o;for(const a of yI(i).flatKeys)a in n&&(s!==void 0&&s!==o||(s={...o}),s[a]=n[a]);return(i.__state||s)&&bI(r).updateFromJSON(s),i})(this,t)}static transform(){return null}remove(t){Ny(this,!0,t)}replace(t,r){on();let n=de();n!==null&&(n=n.clone()),o_(this,t);const i=this.getLatest(),o=this.__key,s=t.__key,a=t.getWritable(),l=this.getParentOrThrow().getWritable(),u=l.__size,d=a.getParent(),f=d!==null?a.getIndexWithinParent():-1;Ks(a),d!==null&&te(n)&&Ul(n,d,f,-1);const h=i.getPreviousSibling(),p=i.getNextSibling(),g=i.__prev,m=i.__next,v=i.__parent;Ny(i,!1,!0),h===null?l.__first=s:h.getWritable().__next=s,a.__prev=g,p===null?l.__last=s:p.getWritable().__prev=s,a.__next=m,a.__parent=v,l.__size=u;let _=0;r&&(U(this)&&U(a)||Z(139),_=a.getChildrenSize(),a.splice(_,0,this.getChildren()));const x=Zi(this);if(x.length>0){Gs(this)&&Gs(a)||Z(368,this.__key,a.__key);for(const w of x){const S=hu(this,w);S!==null&&(WQ(this,w),ZP(a,w,S))}}if(te(n)){gn(n);const w=n.anchor,S=n.focus;w.key===o&&(r&&w.type==="element"?w.set(a.__key,_+w.offset,"element"):fC(w,a)),S.key===o&&(r&&S.type==="element"?S.set(a.__key,_+S.offset,"element"):fC(S,a))}return Hs()===o&&sn(s),a}insertAfter(t,r=!0){on(),o_(this,t);const n=this.getWritable(),i=t.getWritable();this.getParentOrThrow();const o=i.getParent(),s=de();let a=!1,l=!1;if(o!==null){const p=t.getIndexWithinParent();if(te(s)){const g=o.__key,m=s.anchor,v=s.focus;a=m.type==="element"&&m.key===g&&m.offset===p+1,l=v.type==="element"&&v.key===g&&v.offset===p+1}Ks(i),r&&te(s)&&Ul(s,o,p,-1)}else Ks(i);const u=this.getNextSibling(),d=this.getParentOrThrow().getWritable(),f=i.__key,h=n.__next;if(u===null?d.__last=f:u.getWritable().__prev=f,d.__size++,n.__next=f,i.__next=h,i.__prev=n.__key,i.__parent=n.__parent,r&&te(s)){const p=this.getIndexWithinParent();Ul(s,d,p+1);const g=d.__key;a&&s.anchor.set(g,p+2,"element"),l&&s.focus.set(g,p+2,"element")}return t}insertBefore(t,r=!0){on(),o_(this,t);const n=this.getWritable(),i=t.getWritable();this.getParentOrThrow();const o=i.__key,s=de(),a=i.getParent(),l=a!==null?i.getIndexWithinParent():-1;Ks(i),a!==null&&r&&te(s)&&Ul(s,a,l,-1);const u=this.getPreviousSibling(),d=this.getParentOrThrow().getWritable(),f=n.__prev,h=this.getIndexWithinParent();return u===null?d.__first=o:u.getWritable().__next=o,d.__size++,n.__prev=o,i.__prev=f,i.__next=n.__key,i.__parent=n.__parent,r&&te(s)&&Ul(s,this.getParentOrThrow(),h),t}isParentRequired(){return!1}createParentElementNode(){return Pt()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,r){on();const n=To(this);if(n!==null)return n.selectPrevious(t,r);const i=this.getPreviousSibling(),o=this.getParentOrThrow();if(i===null)return o.select(0,0);if(U(i))return i.select();if(!ne(i)){const s=i.getIndexWithinParent()+1;return o.select(s,s)}return i.select(t,r)}selectNext(t,r){on();const n=To(this);if(n!==null)return n.selectNext(t,r);const i=this.getNextSibling(),o=this.getParentOrThrow();if(i===null)return o.select();if(U(i))return i.select(0,0);if(!ne(i)){const s=i.getIndexWithinParent();return o.select(s,s)}return i.select(t,r)}markDirty(){this.getWritable()}reconcileObservedMutation(t,r){this.markDirty()}}function rP(e){return e instanceof Ni}const lg="historic",nP="history-push",Sf="history-merge",iP="paste",oP="cut",sP="collaboration",WJ="skip-scroll-into-view",GJ="skip-dom-selection",Dy="skip-selection-focus",aP="composition-start",oh="composition-end",JJ="!important";function ug(e){const t={};if(!e)return t;let r="",n="",i=null,o=!1,s=!1,a=!1,l=0;const u=e.length;let d=-1;for(let p=0;p<u;p++){const g=e[p];if(o)g==="*"&&e[p+1]==="/"&&(o=!1,p++);else if(s)d===-1&&(d=p),s=!1;else if(i===null)if(g!=="/"||e[p+1]!=="*")if(g!=='"'&&g!=="'")if(g!=="(")if(g!==")")if(a||g!==":"||l!==0){if(g===";"&&l===0){d!==-1&&(a?n+=e.slice(d,p):r+=e.slice(d,p),d=-1);const m=r.trim(),v=n.trim();m!==""&&v!==""&&(t[m]=v),r="",n="",a=!1;continue}d===-1&&(d=p)}else d!==-1&&(r+=e.slice(d,p),d=-1),a=!0;else d===-1&&(d=p),l=Math.max(0,l-1);else d===-1&&(d=p),l++;else d===-1&&(d=p),i=g;else d!==-1&&(a?n+=e.slice(d,p):r+=e.slice(d,p),d=-1),o=!0,p++;else d===-1&&(d=p),g==="\\"?s=!0:g===i&&(i=null)}d!==-1&&(a?n+=e.slice(d,u):r+=e.slice(d,u));const f=r.trim(),h=n.trim();return f!==""&&h!==""&&(t[f]=h),t}function QJ(e,t,r){const n=r.trimEnd(),i=n.length-10;i>=0&&n.slice(i).toLowerCase()===JJ?e.setProperty(t,n.slice(0,i).trim(),"important"):e.setProperty(t,r,"")}function kc(e,t,r=""){if(t===r)return;const n=ug(r),i=ug(t);for(const o in i)delete n[o],QJ(e,o,i[o]);for(const o in n)e.removeProperty(o)}function Yv(e,t){return 16&t?"code":t&Mx?"mark":32&t?"sub":64&t?"sup":null}function Xv(e,t){return 1&t?"strong":2&t?"em":"span"}function lP(e,t,r,n,i){const o=n.classList;let s=Rc(i,"base");s!==void 0&&o.add(...s),s=Rc(i,"underlineStrikethrough");let a=!1;const l=8&t&&4&t;s!==void 0&&(8&r&&4&r?(a=!0,l||o.add(...s)):l&&o.remove(...s));for(const u in ta){const d=ta[u];if(s=Rc(i,u),s!==void 0)if(r&d){if(a&&(u==="underline"||u==="strikethrough")){t&d&&o.remove(...s);continue}((t&d)===0||l&&u==="underline"||u==="strikethrough")&&o.add(...s)}else t&d&&o.remove(...s)}}function uP(e,t,r){const n=r.isComposing(),i=e+(n?Jf:""),o=gr(),s=Cm(o).$getDOMSlot(r,t,o),a=s.getFirstChild();if(a===null||a.nodeType!==Node.TEXT_NODE)return void s.insertChild(Yt().createTextNode(i));const l=a,u=l.nodeValue;if(u!==i)if(n||Za){const[d,f,h]=(function(p,g){const m=p.length,v=g.length;let _=0,x=0;for(;_<m&&_<v&&p[_]===g[_];)_++;for(;x+_<m&&x+_<v&&p[m-x-1]===g[v-x-1];)x++;return[_,m-_-x,g.slice(_,v-x)]})(u,i);f!==0&&l.deleteData(d,f),l.insertData(d,h)}else l.nodeValue=i}function uC(e,t,r,n,i,o){uP(i,e,t);const s=o.theme.text;s!==void 0&&lP(0,0,n,e,s)}function Cp(e,t){const r=Yt().createElement(t);return r.appendChild(e),r}function Fy(e){return e!=null&&e.__isInlineFormattable===!0}class ca extends Ni{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}static getType(){return"text"}static clone(t){return new ca(t.__text,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__text=t.__text,this.__format=t.__format,this.__style=t.__style,this.__mode=t.__mode,this.__detail=t.__detail}constructor(t="",r){super(r),this.__text=t,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const t=this.getLatest();return hJ[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Hs()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(t){const r=ta[t];return(this.getFormat()&r)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(t,r){return uu(this.getLatest().__format,t,r)}canHaveFormat(){return!0}isInline(){return!0}createDOM(t,r){const n=this.__format,i=Yv(0,n),o=Xv(0,n),s=i===null?o:i,a=Yt().createElement(s);let l=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),i!==null&&(l=Yt().createElement(o),a.appendChild(l)),uC(l,this,0,n,this.__text,t);const u=this.__style;return u!==""&&kc(a.style,u),a}updateDOM(t,r,n){const i=this.__text,o=t.__format,s=this.__format,a=Yv(0,o),l=Yv(0,s),u=Xv(0,o),d=Xv(0,s);if((a===null?u:a)!==(l===null?d:l))return!0;if(a===l&&u!==d){const m=r.firstChild;m==null&&Z(48);const v=Yt().createElement(d);return uC(v,this,0,s,i,n),r.replaceChild(v,m),!1}let f=r;l!==null&&a!==null&&(f=r.firstChild,f==null&&Z(49)),uP(i,f,this);const h=n.theme.text;h!==void 0&&o!==s&&lP(0,o,s,f,h);const p=t.__style,g=this.__style;return p!==g&&kc(r.style,g,p),!1}static importDOM(){return{"#text":()=>({conversion:eQ,priority:0}),b:()=>({conversion:XJ,priority:0}),code:()=>({conversion:$s,priority:0}),em:()=>({conversion:$s,priority:0}),i:()=>({conversion:$s,priority:0}),mark:()=>({conversion:$s,priority:0}),s:()=>({conversion:$s,priority:0}),span:()=>({conversion:YJ,priority:0}),strong:()=>({conversion:$s,priority:0}),sub:()=>({conversion:$s,priority:0}),sup:()=>({conversion:$s,priority:0}),u:()=>({conversion:$s,priority:0})}}static importJSON(t){return Sr().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTextContent(t.text).setFormat(t.format).setDetail(t.detail).setMode(t.mode).setStyle(t.style)}exportDOM(t){let{element:r}=super.exportDOM(t);return tt(r)||Z(132),r.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?r.style.textTransform="lowercase":this.hasFormat("uppercase")?r.style.textTransform="uppercase":this.hasFormat("capitalize")&&(r.style.textTransform="capitalize"),this.hasFormat("bold")&&(r=Cp(r,"b")),this.hasFormat("italic")&&(r=Cp(r,"i")),this.hasFormat("strikethrough")&&(r=Cp(r,"s")),this.hasFormat("underline")&&(r=Cp(r,"u")),{element:r}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(t,r){}setFormat(t){const r=this.getWritable();return r.__format=typeof t=="string"?ta[t]:t,r}setDetail(t){const r=this.getWritable();return r.__detail=typeof t=="string"?cJ[t]:t,r}setStyle(t){const r=this.getWritable();return r.__style=t,r}toggleFormat(t){const r=uu(this.getFormat(),t,null);return this.setFormat(r)}toggleDirectionless(){const t=this.getWritable();return t.__detail^=1,t}toggleUnmergeable(){const t=this.getWritable();return t.__detail^=2,t}setMode(t){const r=fJ[t];if(this.__mode===r)return this;const n=this.getWritable();return n.__mode=r,n}setTextContent(t){if(this.__text===t)return this;const r=this.getWritable();return r.__text=t,r}select(t,r){on();let n=t,i=r;const o=de(),s=this.getTextContent(),a=this.__key;if(typeof s=="string"){const l=s.length;n===void 0&&(n=l),i===void 0&&(i=l)}else n=0,i=0;if(!te(o))return yP(a,n,a,i,"text","text");{const l=Hs();l!==o.anchor.key&&l!==o.focus.key||sn(a),o.setTextNodeRange(this,n,this,i)}return o}selectStart(){return this.select(0,0)}selectEnd(){const t=this.getTextContentSize();return this.select(t,t)}spliceText(t,r,n,i){const o=this.getWritable(),s=o.__text,a=n.length;let l=t;l<0&&(l=a+l,l<0&&(l=0));const u=de();if(i&&te(u)){const f=t+a;u.setTextNodeRange(o,f,o,f)}const d=s.slice(0,l)+n+s.slice(l+r);return o.__text=d,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){on();const r=this.getLatest(),n=r.getTextContent();if(n==="")return[];const i=r.__key,o=Hs(),s=n.length;t.sort((R,N)=>R-N),t.push(s);const a=[],l=t.length;for(let R=0,N=0;R<s&&N<=l;N++){const I=t[N];I>R&&(a.push(n.slice(R,I)),R=I)}const u=a.length;if(u===1)return[r];const d=a[0],f=r.getParent();let h;const p=r.getFormat(),g=r.getStyle(),m=r.__detail;let v=!1,_=null,x=null;const w=de();if(te(w)){const[R,N]=w.isBackward()?[w.focus,w.anchor]:[w.anchor,w.focus];R.type==="text"&&R.key===i&&(_=R),N.type==="text"&&N.key===i&&(x=N)}r.isSegmented()?(h=Sr(d),h.__format=p,h.__style=g,h.__detail=m,h.__state=Vk(r,h),v=!0):h=r.setTextContent(d);const S=[h];for(let R=1;R<u;R++){const N=Sr(a[R]);N.__format=p,N.__style=g,N.__detail=m,N.__state=Vk(r,N);const I=N.__key;o===i&&sn(I),S.push(N)}const k=_?_.offset:null,A=x?x.offset:null;let C=0;for(const R of S){if(!_&&!x)break;const N=C+R.getTextContentSize();if(_!==null&&k!==null&&k<=N&&k>=C&&(_.set(R.getKey(),k-C,"text"),k<N&&(_=null)),x!==null&&A!==null&&A<=N&&A>=C){x.set(R.getKey(),A-C,"text");break}C=N}if(f!==null){(function(I){const P=I.getPreviousSibling(),z=I.getNextSibling();P!==null&&vg(P),z!==null&&vg(z)})(this);const R=f.getWritable(),N=this.getIndexWithinParent();v?(R.splice(N,0,S),this.remove()):R.splice(N,1,S),te(w)&&Ul(w,f,N,u-1)}return S}mergeWithSibling(t){const r=t===this.getPreviousSibling();r||t===this.getNextSibling()||Z(50);const n=this.__key,i=t.__key,o=this.__text,s=o.length;Hs()===i&&sn(n);const a=de();if(te(a)){const f=a.anchor,h=a.focus;f!==null&&f.key===i&&bC(f,r,n,t,s),h!==null&&h.key===i&&bC(h,r,n,t,s)}const l=t.__text,u=r?l+o:o+l;this.setTextContent(u);const d=this.getWritable();return t.remove(),d}isTextEntity(){return!1}}function YJ(e){return{forChild:qx(e.style),node:null}}function XJ(e){const t=e,r=t.style.fontWeight==="normal";return{forChild:qx(t.style,r?void 0:"bold"),node:null}}const cC=new WeakMap;function ZJ(e){if(!tt(e))return!1;if(e.nodeName==="PRE")return!0;const t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function eQ(e){const t=e;e.parentElement===null&&Z(129);let r=t.textContent||"";if((function(n){let i,o=n.parentNode;const s=[n];for(;o!==null&&(i=cC.get(o))===void 0&&!ZJ(o);)s.push(o),o=o.parentNode;const a=i===void 0?o:i;for(let l=0;l<s.length;l++)cC.set(s[l],a);return a})(t)!==null)return{node:sh(r)};if(r=r.replace(/\r/g,"").replace(/[ \t\n]+/g," "),r==="")return{node:null};if(r[0]===" "){let n=t,i=!0;for(;n!==null&&(n=dC(n,!1))!==null;){const o=n.textContent||"";if(o.length>0){/[ \t\n]$/.test(o)&&(r=r.slice(1)),i=!1;break}}i&&(r=r.slice(1))}if(r[r.length-1]===" "){let n=t,i=!0;for(;n!==null&&(n=dC(n,!0))!==null;)if((n.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(r=r.slice(0,r.length-1))}return r===""?{node:null}:{node:Sr(r)}}function dC(e,t){let r=e;for(;;){let n;for(;(n=t?r.nextSibling:r.previousSibling)===null;){const o=r.parentElement;if(o===null)return null;r=o}if(r=n,tt(r)){const o=r.style.display;if(o===""&&!bg(r)||o!==""&&!o.startsWith("inline"))return null}let i=r;for(;(i=t?r.firstChild:r.lastChild)!==null;)r=i;if(gi(r))return r;if(r.nodeName==="BR")return null}}const tQ={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function $s(e){const t=tQ[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:qx(e.style,t),node:null}}function Sr(e=""){return Vo(new ca(e))}function ne(e){return e instanceof ca}function qx(e,t){const r=e.fontWeight,n=e.textDecoration.split(" "),i=r==="700"||r==="bold",o=n.includes("line-through"),s=e.fontStyle==="italic",a=n.includes("underline"),l=e.verticalAlign;return u=>((ne(u)||Fy(u))&&(i&&!u.hasFormat("bold")&&u.toggleFormat("bold"),o&&!u.hasFormat("strikethrough")&&u.toggleFormat("strikethrough"),s&&!u.hasFormat("italic")&&u.toggleFormat("italic"),a&&!u.hasFormat("underline")&&u.toggleFormat("underline"),l!=="sub"||u.hasFormat("subscript")||u.toggleFormat("subscript"),l!=="super"||u.hasFormat("superscript")||u.toggleFormat("superscript"),t&&!u.hasFormat(t)&&u.toggleFormat(t)),u)}class cd extends ca{static getType(){return"tab"}static clone(t){return new cd(t.__key)}constructor(t){super(" ",t),this.__detail=2}static importDOM(){return null}createDOM(t){const r=super.createDOM(t),n=Rc(t.theme,"tab");return n!==void 0&&r.classList.add(...n),r}static importJSON(t){return dd().updateFromJSON(t)}setTextContent(t){return super.setTextContent(" ")}spliceText(t,r,n,i){return n===""&&r===0||n===" "&&r===1||Z(286),this}setDetail(t){return t!==2&&Z(127),this}setMode(t){return t!=="normal"&&Z(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function dd(){return Vo(new cd)}function lu(e){return e instanceof cd}class rQ{key;offset;type;_selection;constructor(t,r,n){this._selection=null,this.key=t,this.offset=r,this.type=n}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){return this.key===t.key?this.offset<t.offset:uh(Ri(ui(this,"next")),Ri(ui(t,"next")))<0}getNode(){const t=Qt(this.key);return t===null&&Z(20),t}set(t,r,n,i){const o=this._selection,s=this.key;i&&this.key===t&&this.offset===r&&this.type===n||(this.key=t,this.offset=r,this.type=n,qc()||(Hs()===s&&sn(t),o!==null&&(o.setCachedNodes(null),te(o)&&(o._cachedIsBackward=null),o.dirty=!0)))}}function _s(e,t,r){return new rQ(e,t,r)}function Zv(e,t){let r=t.__key,n=e.offset,i="element";if(ne(t)){i="text";const o=t.getTextContentSize();n>o&&(n=o)}else if(!U(t)){const o=t.getNextSibling();if(ne(o))r=o.__key,n=0,i="text";else{const s=t.getParent();s&&(r=s.__key,n=t.getIndexWithinParent()+1)}}e.set(r,n,i)}function fC(e,t){if(U(t)){const r=t.getLastDescendant();U(r)||ne(r)?Zv(e,r):Zv(e,t)}else Zv(e,t)}class Sm{_nodes;_cachedNodes;dirty;constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!Wt(t))return!1;const r=this._nodes,n=t._nodes;return r.size===n.size&&Array.from(r).every(i=>n.has(i))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new Sm(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const r=this.getNodes().filter(s=>An(s)===null),n=r.length;if(n===0)return;const i=r[n-1];let o;if(ne(i))o=i.select();else{const s=i.getIndexWithinParent()+1;o=i.getParentOrThrow().select(s,s)}o.insertNodes(t);for(let s=0;s<n;s++)r[s].remove()}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const r=this._nodes,n=[];for(const i of r){const o=Qt(i);o!==null&&n.push(o)}return qc()||(this._cachedNodes=n),n}getTextContent(){const t=this.getNodes();let r="";for(let n=0;n<t.length;n++)r+=t[n].getTextContent();return r}deleteNodes(){const t=this.getNodes().filter(r=>An(r)===null);if((de()||fd())===this&&t[0]){const r=Nt(t[0],"next");ch(Do(r,r))}for(const r of t)r.remove();cP()}}function cP(){const e=Kr();if(e.isEmpty()){const t=Pt();e.append(t),t.select()}}function te(e){return e instanceof Eu}class Eu{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(t,r,n,i){this.anchor=t,this.focus=r,t._selection=this,r._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=i,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!te(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const r=(function(n){const i=[],[o,s]=n.getTextSlices();o&&i.push(o.caret.origin);const a=new Set,l=new Set;for(const u of n)if(to(u)){const{origin:d}=u;i.length===0?a.add(d):(l.add(d),i.push(d))}else{const{origin:d}=u;U(d)&&l.has(d)||i.push(d)}if(s&&i.push(s.caret.origin),tl(n.focus)&&U(n.focus.origin)&&n.focus.getNodeAtCaret()===null)for(let u=ao(n.focus.origin,"previous");to(u)&&a.has(u.origin)&&!u.origin.isEmpty()&&u.origin.is(i[i.length-1]);u=uS(u))a.delete(u.origin),i.pop();for(;i.length>1;){const u=i[i.length-1];if(!U(u)||l.has(u)||u.isEmpty()||a.has(u))break;i.pop()}if(i.length===0&&n.isCollapsed()){const u=Ri(n.anchor),d=Ri(n.anchor.getFlipped()),f=p=>eo(p)?p.origin:p.getNodeAtCaret(),h=f(u)||f(d)||(n.anchor.getNodeAtCaret()?u.origin:d.origin);i.push(h)}return i})(fS(qy(this),"next"));return qc()||(this._cachedNodes=r),r}setTextNodeRange(t,r,n,i){return this.anchor.set(t.__key,r,"text"),this.focus.set(n.__key,i,"text"),this}getTextContent(){const t=this.getNodes();if(t.length===0)return"";const r=t[0],n=t[t.length-1],i=this.anchor,o=this.focus,s=i.isBefore(o),[a,l]=Iy(this);let u="",d=!0;for(let f=0;f<t.length;f++){const h=t[f];if(U(h)&&!h.isInline()){d||(u+=`
24
- `);let p="";for(const g of Zi(h)){const m=hu(h,g);m!==null&&(p+=m.getTextContent())}p!==""?(u+=p,d=!1):d=!h.isEmpty()}else if(d=!1,ne(h)){let p=h.getTextContent();h===r?h===n?i.type==="element"&&o.type==="element"&&o.offset!==i.offset||(p=a<l?p.slice(a,l):p.slice(l,a)):p=s?p.slice(a):p.slice(l):h===n&&(p=s?p.slice(0,l):p.slice(0,a)),u+=p}else!ct(h)&&!Qn(h)||h===n&&this.isCollapsed()||(u+=h.getTextContent())}return u}applyDOMRange(t){const r=Dt(),n=r.getEditorState()._selection,i=bP(t.startContainer,t.startOffset,t.endContainer,t.endOffset,r,n);if(i===null)return;const[o,s,a]=i;this.anchor.set(o.key,o.offset,o.type,!0),this.focus.set(s.key,s.offset,s.type,!0),a&&(this.dirty=!0),Pa(this)}clone(){const t=this.anchor,r=this.focus;return new Eu(_s(t.key,t.offset,t.type),_s(r.key,r.offset,r.type),this.format,this.style)}toggleFormat(t){this.format=uu(this.format,t,null),this.dirty=!0}setFormat(t){this.format=t,this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){const r=ta[t];return(this.format&r)!==0}insertRawText(t){this.insertNodes(sh(t))}insertText(t){const r=this.anchor,n=this.focus,i=this.format,o=this.style;let s=r,a=n;!this.isCollapsed()&&n.isBefore(r)&&(s=n,a=r),s.type==="element"&&(function(v,_,x,w){const S=v.getNode(),k=S.getChildAtIndex(v.offset),A=Sr();if(A.setFormat(x),A.setStyle(w),md(k))k.splice(0,0,[A]);else if(k!==null){const C=Zt(S)?Pt().append(A):A;k.insertBefore(C)}else if(Zt(S)){const C=S.getLastChild();U(C)&&!C.isInline()&&C.isEmpty()?C.append(A):S.append(Pt().append(A))}else S.append(A);v.is(_)&&_.set(A.__key,0,"text"),v.set(A.__key,0,"text")})(s,a,i,o),a.type==="element"&&mu(a,Ri(ui(a,"next")));const l=s.offset;let u=a.offset;const d=this.getNodes(),f=d.length;let h=d[0];ne(h)||Z(26);const p=h.getTextContent().length,g=h.getParentOrThrow();let m=d[f-1];if(f===1&&a.type==="element"&&(u=p,a.set(s.key,u,"text")),this.isCollapsed()&&l===p&&(Ci(h)||!h.canInsertTextAfter()||!g.canInsertTextAfter()&&h.getNextSibling()===null)){const v=h.getNextSibling();let _;if(ne(v)&&v.canInsertTextBefore()&&!Ci(v)?_=v:(_=Sr(),_.setFormat(i),_.setStyle(o),g.canInsertTextAfter()?h.insertAfter(_):g.insertAfter(_)),_.select(0,0),h=_,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&l===0&&(Ci(h)||!h.canInsertTextBefore()||!g.canInsertTextBefore()&&h.getPreviousSibling()===null)){const v=h.getPreviousSibling();let _;if(!ne(v)||Ci(v)?(_=Sr(),_.setFormat(i),g.canInsertTextBefore()?h.insertBefore(_):g.insertBefore(_)):_=v,_.select(),h=_,t!=="")return void this.insertText(t)}else if(h.isSegmented()&&l!==p)if(Hs()!==null)h=h.setMode("normal").setFormat(i).setStyle(o);else{const v=Sr(h.getTextContent());v.setFormat(i),h.replace(v),h=v}else if(!this.isCollapsed()&&t!==""){const v=m.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||U(v)&&(!v.canInsertTextBefore()||!v.canInsertTextAfter()))return this.insertText(""),mP(this.anchor,this.focus),void this.insertText(t)}if(f===1){if(Wl(h)){const w=Sr(t);return w.select(),void h.replace(w)}const v=h.getFormat(),_=h.getStyle();if(l!==u||v===i&&_===o){if(lu(h)){const w=Sr(t);return w.setFormat(i),w.setStyle(o),w.select(),void h.replace(w)}}else{if(h.getTextContent()!==""){const w=Sr(t);if(w.setFormat(i),w.setStyle(o),w.select(),l===0)h.insertBefore(w,!1);else{const[S]=h.splitText(l);S.insertAfter(w,!1)}return void(w.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length,this._cachedNodes=null,this._cachedIsBackward=null))}h.setFormat(i),h.setStyle(o)}const x=u-l;h=h.spliceText(l,x,t,!0),h.getTextContent()===""?h.remove():this.anchor.type==="text"&&(this.format=v,this.style=_,h.isComposing()&&(this.anchor.offset-=t.length,this._cachedNodes=null,this._cachedIsBackward=null))}else{const v=new Set([...h.getParentKeys(),...m.getParentKeys()]),_=U(h)?h:h.getParentOrThrow();let x=U(m)?m:m.getParentOrThrow(),w=m;if(!_.is(x)&&x.isInline())do w=x,x=x.getParentOrThrow();while(x.isInline());if(a.type==="text"&&(u!==0||m.getTextContent()==="")||a.type==="element"&&m.getIndexWithinParent()<u)if(ne(m)&&!Wl(m)&&u!==m.getTextContentSize()){if(m.isSegmented()){const R=Sr(m.getTextContent());m.replace(R),m=R}Er(a.getNode())||a.type!=="text"||(ne(m)||Z(395),m=m.spliceText(0,u,"")),v.add(m.__key)}else{const R=m.getParentOrThrow();R.canBeEmpty()||R.getChildrenSize()!==1?m.remove():R.remove()}else v.add(m.__key);const S=x.getChildren(),k=new Set(d),A=_.is(x),C=_.isInline()&&h.getNextSibling()===null?_:h;for(let R=S.length-1;R>=0;R--){const N=S[R];if(N.is(h)||U(N)&&N.isParentOf(h))break;N.isAttached()&&(!k.has(N)||N.is(w)?A||C.insertAfter(N,!1):N.remove())}if(!A){let R=x,N=null;for(;R!==null;){const I=R.getChildren(),P=I.length;(P===0||I[P-1].is(N))&&(v.delete(R.__key),N=R),R=R.getParent()}}if(Wl(h))if(l===p)h.select();else{const R=Sr(t);R.select(),h.replace(R)}else h=h.spliceText(l,p-l,t,!0),h.getTextContent()===""?h.remove():this.anchor.type==="text"&&(this.format=h.getFormat(),this.style=h.getStyle(),h.isComposing()&&(this.anchor.offset-=t.length,this._cachedNodes=null,this._cachedIsBackward=null));for(let R=1;R<f;R++){const N=d[R],I=N.__key;v.has(I)||N.remove()}}}removeText(){const t=de()===this;F0(this,tY(qy(this))),t&&de()!==this&&gn(this)}formatText(t,r=null){fP(this,t,r)}insertNodes(t){if(t.length===0)return;this.isCollapsed()||this.removeText();const r=this.anchor.getNode();if(this.anchor.type==="element"&&U(r)&&An(r)!==null){let m=r.isShadowRoot()?r.getFirstChild()??r.append(Pt()).getFirstChild():r.getFirstChild();if(r.isShadowRoot()&&m!==null&&!U(m)){const v=Pt();m.insertBefore(v),m=v}if(m!==null){m.selectStart();const v=de();return te(v)||Z(369),v.insertNodes(t)}}if(this.anchor.type==="element"&&Zt(r)){const m=t_(t),v=m.getLastDescendant();return r.splice(this.anchor.offset,0,m.getChildren()),void(v!==null&&v.selectEnd())}let n=(this.isBackward()?this.focus:this.anchor).getNode(),i=Kt(n,kn);const o=t[t.length-1];if(U(i)&&"__language"in i){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const m=jd(this);i.splice(m,0,t),o.selectEnd()}return}if(!t.some(m=>(U(m)||ct(m))&&!m.isInline())){U(i)||Z(211,n.constructor.name,n.getType());const m=jd(this);return i.splice(m,0,t),void o.selectEnd()}if(U(i)&&An(i)!==null){const m=jd(this),v=Oy(t);i.splice(m,0,v);const _=v[v.length-1];return void(_!==void 0?_.selectEnd():i.select(m,m))}if(i===null){const m=t_(t),v=m.getLastDescendant();let _=ui(this.anchor,"next");for(const x of m.getChildren())_=iO(x,_);return void(v!==null&&v.selectEnd())}if(U(i)&&!i.isParentRequired()&&!Zt(i.getParentOrThrow())){const m=jd(this),v=Oy(t);i.splice(m,0,v);const _=v[v.length-1];return void(_!==void 0?_.selectEnd():i.select(m,m))}const s=t_(t),a=s.getLastDescendant(),l=s.getChildren(),u=!U(i)||!i.isEmpty()?this.insertParagraph():null;u&&!i.isAttached()&&(n=this.anchor.getNode(),i=Kt(n,kn));const d=l[l.length-1];let f=l[0];var h;U(h=f)&&kn(h)&&!h.isEmpty()&&U(i)&&(!i.isEmpty()||i.canMergeWhenEmpty())&&(U(i)||Z(211,n.constructor.name,n.getType()),i.append(...f.getChildren()),f=l[1]),f&&(i===null&&Z(212,n.constructor.name,n.getType()),(function(m,v){const _=v.getParentOrThrow().getLastChild();let x=v;const w=[v];for(;x!==_;)x.getNextSibling()||Z(140),x=x.getNextSibling(),w.push(x);let S=m;for(const k of w)S=S.insertAfter(k)})(i,f));const p=Kt(a,kn);u&&U(p)&&(u.canMergeWhenEmpty()||kn(d))&&(p.append(...u.getChildren()),u.remove()),U(i)&&i.isEmpty()&&i.remove(),a.selectEnd();const g=U(i)?i.getLastChild():null;Qn(g)&&p!==i&&g.remove()}insertParagraph(){const t=this.anchor.getNode();if(this.anchor.type==="element"&&Zt(t)){const a=Pt();return t.splice(this.anchor.offset,0,[a]),a.select(),a}const r=jd(this),n=Kt(this.anchor.getNode(),kn);if(n!==null&&An(n)!==null)return null;U(n)||Z(213);const i=n.getChildAtIndex(r),o=i?[i,...i.getNextSiblings()]:[],s=n.insertNewAfter(this,!1);return s?(s.append(...o),s.selectStart(),s):null}insertLineBreak(t){const r=Mo();if(this.insertNodes([r]),t){const n=r.getParentOrThrow(),i=r.getIndexWithinParent();n.select(i,i)}}extract(){const t=[...this.getNodes()],r=t.length;let n=t[0],i=t[r-1];const[o,s]=Iy(this),a=this.isBackward(),[l,u]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[d,f]=a?[s,o]:[o,s];if(r===0)return[];if(r===1){if(ne(n)&&!this.isCollapsed()){const h=n.splitText(d,f),p=d===0?h[0]:h[1];return p?(l.set(p.getKey(),0,"text"),u.set(p.getKey(),p.getTextContentSize(),"text"),[p]):[]}return[n]}if(ne(n)&&(d===n.getTextContentSize()?t.shift():d!==0&&([,n]=n.splitText(d),t[0]=n,l.set(n.getKey(),0,"text"))),ne(i)){const h=i.getTextContent().length;f===0?t.pop():f!==h&&([i]=i.splitText(f),t[t.length-1]=i,u.set(i.getKey(),i.getTextContentSize(),"text"))}return t}modify(t,r,n){if(hg(this,t,r,n))return;const i=t==="move",o=Dt(),s=Yn(mi(o));if(!s)return;const a=o._blockCursorElement,l=o._rootElement,u=this.focus.getNode();l===null||a===null||!U(u)||u.isInline()||u.canBeEmpty()||_g(a,o,l);const d=Kc(o,this.focus.key);let f=d;if(this.focus.type==="text"&&(f=ne(u)?Ha(u,d,o):null),this.dirty){const h=Kc(o,this.anchor.key);let p=h;if(this.anchor.type==="text"){const g=this.anchor.getNode();p=ne(g)?Ha(g,h,o):null}p&&f&&fg(s,p,this.anchor.offset,f,this.focus.offset)}if(n==="character"&&ne(u)&&u.isUnmergeable()&&(r?this.focus.offset===0:this.focus.offset===u.getTextContentSize())){const h=Nt(u,r?"previous":"next").getNodeAtCaret();if(ne(h)){if(!i){const p=h.getTextContentSize();return r?this.focus.set(h.__key,p-1,"text"):this.focus.set(h.__key,1,"text"),void(this.dirty=!0)}{const p=o.getElementByKey(h.getKey()),g=p?Ha(h,p,o):null;if(g){const m=r?g.length:0;fg(s,g,m,g,m)}}}}if(pP(s,t,r?"backward":"forward",n),s.rangeCount>0){const h=km(s,o._rootElement),p=h||s.getRangeAt(0),g=this.anchor.getNode(),m=Er(g)?g:BP(g);this.applyDOMRange(p),this.dirty=!0,!i&&(gP(this,r,m),(h?s.direction!=="backward":s.anchorNode===p.startContainer&&s.anchorOffset===p.startOffset)||hP(this))}n==="lineboundary"&&hg(this,t,r,n,"decorators")}forwardDeletion(t,r,n){if(!n&&(t.type==="element"&&U(r)&&t.offset===r.getChildrenSize()||t.type==="text"&&t.offset===r.getTextContentSize())){const i=r.getParent(),o=r.getNextSibling()||(i===null?null:i.getNextSibling());if(U(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(t){const r=this.isCollapsed();if(this.isCollapsed()){const n=this.anchor;let i=n.getNode();if(this.forwardDeletion(n,i,t))return;const o=Tm(ui(n,t?"previous":"next"));if(o.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(const l of o.iterNodeCarets("shadowRoot"))if(to(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(a.type==="merge-block")break;if(U(o.anchor.origin)&&o.anchor.origin.isEmpty()){const u=Ri(l);F0(this,Do(u,u)),o.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:l,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(tl(l)){if(U(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(o.anchor.origin))break}else a={block:l.origin,type:"merge-next-block"};continue}if(ct(l.origin)){if(!l.origin.isIsolated())if(Zi(l.origin).length>0){if(U(o.anchor.origin)&&o.anchor.origin.isEmpty()){o.anchor.origin.remove();const u=cg();u.add(l.origin.getKey()),gn(u)}}else if(a.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&U(o.anchor.origin)&&o.anchor.origin.isEmpty()){o.anchor.origin.remove();const u=cg();u.add(l.origin.getKey()),gn(u)}else l.origin.remove();return}break}}if(a.type==="merge-block"){const{caret:l,block:u}=a;return Zi(u).length>0?void 0:l.origin.isEmpty()&&!u.isEmpty()&&l.origin.getParent()===u.getParent()?void l.origin.remove(!0):(F0(this,Do(!l.origin.isEmpty()&&u.isEmpty()?Ru(Nt(u,l.direction)):o.anchor,l)),this.removeText())}for(let l=n.getNode();l!==null;){if(An(l)!==null)return;if(U(l)&&l.isShadowRoot())break;l=l.getParent()}}const s=this.focus;if(e_(this,t,"character"),this.isCollapsed()){if(t&&n.offset===0&&pC(this,n.getNode()))return}else{const a=s.type==="text"?s.getNode():null;if(i=n.type==="text"?n.getNode():null,a!==null&&a.isSegmented()){const l=s.offset,u=a.getTextContentSize();if(a.is(i)||t&&l!==u||!t&&l!==0)return void gC(a,t,l)}else if(i!==null&&i.isSegmented()){const l=n.offset,u=i.getTextContentSize();if(i.is(a)||t&&l!==0||!t&&l!==u)return void gC(i,t,l)}(function(l,u){const d=l.anchor,f=l.focus,h=d.getNode(),p=f.getNode();if(h===p&&d.type==="text"&&f.type==="text"){const g=d.offset,m=f.offset,v=g<m,_=v?g:m,x=v?m:g,w=x-1;_!==w&&(function(S){return!(MP(S)||iQ(S))})(h.getTextContent().slice(_,x))&&(u?f.set(f.key,w,f.type):d.set(d.key,w,d.type))}})(this,t)}}if(this.removeText(),t&&!r&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const n=this.anchor.getNode();n.isEmpty()&&Er(n.getParent())&&n.getPreviousSibling()===null&&pC(this,n),cP()}}deleteLine(t){const r=Py(this.anchor);if(r!==null&&ct(To(r)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(t);this.isCollapsed()&&e_(this,t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):Kt(this.anchor.getNode(),kn)!==Kt(this.focus.getNode(),kn)?(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(t)):this.removeText()}deleteWord(t){if(this.isCollapsed()){const r=this.anchor,n=r.getNode();if(this.forwardDeletion(r,n,t))return;e_(this,t,"word")}this.isCollapsed()?this.deleteCharacter(t):this.removeText()}isBackward(){const t=this._cachedIsBackward;if(t!==null)return t;const r=this.focus.isBefore(this.anchor);return qc()||(this._cachedIsBackward=r),r}getStartEndPoints(){return[this.anchor,this.focus]}}function Wt(e){return e instanceof Sm}function dP(e,t){if(Wt(e)){for(const _ of e.getNodes())Fy(_)&&_.setFormat(t(_.getFormat()));return}if(e.isCollapsed())return e.setFormat(t(e.format)),void sn(null);const r=[];for(const _ of e.getNodes())ne(_)?r.push(_):U(_)?_.setTextFormat(t(_.getTextFormat())):Fy(_)&&_.setFormat(t(_.getFormat()));const n=r.length;if(n===0)return e.setFormat(t(e.format)),void sn(null);const i=e.anchor,o=e.focus,s=e.isBackward(),a=s?o:i,l=s?i:o;let u=0,d=r[0],f=a.type==="element"?0:a.offset;if(a.type==="text"&&f===d.getTextContentSize()&&(u=1,d=r[1],f=0),d==null)return;const h=n-1;let p=r[h];const g=l.type==="text"?l.offset:p.getTextContentSize();if(d.is(p)){if(f===g)return;const _=t(d.getFormat());if(Ci(d)||f===0&&g===d.getTextContentSize())d.setFormat(_);else{const x=d.splitText(f,g),w=f===0?x[0]:x[1];w.setFormat(_),a.type==="text"&&a.set(w.__key,0,"text"),l.type==="text"&&l.set(w.__key,g-f,"text")}return void(e.format=_)}f===0||Ci(d)||([,d]=d.splitText(f),f=0);const m=t(d.getFormat());d.setFormat(m);const v=t(p.getFormat());g>0&&(g===p.getTextContentSize()||Ci(p)||([p]=p.splitText(g)),p.setFormat(v));for(let _=u+1;_<h;_++){const x=r[_];x.setFormat(t(x.getFormat()))}a.type==="text"&&a.set(d.__key,f,"text"),l.type==="text"&&l.set(p.__key,g,"text"),e.format=m|v}function nQ(e,t){const r=[];for(const[n,i]of Object.entries(t))typeof i=="boolean"&&r.push([n,i]);r.length!==0&&dP(e,n=>{for(const[i,o]of r)n=uu(n,i,o?ta[i]:0);return n})}function fP(e,t,r=null){const n=r===null&&te(e)?uu(e.format,t,null):r;dP(e,i=>uu(i,t,n))}function hC(e){const t=e.offset;if(e.type==="text")return t;const r=e.getNode();return t===r.getChildrenSize()?r.getTextContent().length:0}function Iy(e){const t=e.getStartEndPoints();if(t===null)return[0,0];const[r,n]=t;return r.type==="element"&&n.type==="element"&&r.key===n.key&&r.offset===n.offset?[0,0]:[hC(r),hC(n)]}function pC(e,t){for(let r=t;r;r=r.getParent()){if(U(r)){if(r.collapseAtStart(e))return!0;if(Zt(r))break}if(r.getPreviousSibling())break}return!1}function hP(e){const t=e.focus,r=e.anchor,n=r.key,i=r.offset,o=r.type;r.set(t.key,t.offset,t.type,!0),t.set(n,i,o,!0)}function pP(e,t,r,n){e.modify(t,r,n)}function gP(e,t,r){const n=e.getNodes(),i=n.filter(a=>Hc(a,r));if(i.length===0||i.length===n.length)return!1;const o=t?i[0]:i[i.length-1],s=U(o)?o:o.getParentOrThrow();return t?s.selectStart():s.selectEnd(),!0}function e_(e,t,r){if(hg(e,"extend",t,r))return;const n=Dt(),i=Yn(mi(n));if(!i||typeof i.modify!="function")return;const o=n._blockCursorElement,s=n._rootElement,a=e.anchor,l=e.focus.getNode();s===null||o===null||!U(l)||l.isInline()||l.canBeEmpty()||_g(o,n,s);const u=N=>{const I=N.getNode(),P=n.getElementByKey(N.key);return P!==null&&N.type==="text"&&ne(I)?Ha(I,P,n):P},d=a.getNode(),f=u(a);if(f===null)return;const h=a.offset,p=e.isCollapsed(),g=e.focus,m=p?f:u(g);if(m===null)return;const v=g.offset;if(fg(i,m,v,m,v),pP(i,"move",t?"backward":"forward",r),i.rangeCount===0)return;const _=km(i,s)||i.getRangeAt(0),x=_.startContainer,w=_.startOffset;if(p&&r==="character"&&a.type==="text"&&ne(d)&&d.isUnmergeable()&&h===(t?0:d.getTextContentSize())){const N=Nt(d,t?"previous":"next").getNodeAtCaret();if(ne(N)){const I=t?N.getTextContentSize()-1:1;return e.focus.set(N.__key,I,"text"),void(e.dirty=!0)}}if(p&&r==="character"&&a.type==="text"){const N=t?0:d.getTextContentSize(),I=x===f?w:h!==N?N:-1;if(I>=0)return void(I!==h&&(e.focus.set(a.key,I,"text"),e.dirty=!0))}const[S,k,A,C]=t?[x,w,f,h]:[f,h,x,w],R=Er(d)?d:BP(d);e.applyDOMRange({collapsed:!1,endContainer:A,endOffset:C,startContainer:S,startOffset:k}),e.dirty=!0,!gP(e,t,R)&&t&&hP(e),r==="lineboundary"&&hg(e,"extend",t,r,"decorators")}const iQ=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch{}return()=>!1})();function gC(e,t,r){const n=e,i=n.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,a=0;for(let u=0;u<o;u++){const d=u===o-1;if(a=s,s+=i[u].length,t&&s===r||s>r||d){i.splice(u,1),d&&(a=void 0);break}}const l=i.join("").trim();l===""?n.remove():(n.setTextContent(l),n.select(a,a))}function mC(e,t,r,n){let i,o=t,s=!1;if(tt(e)){let a=!1;const l=e.childNodes,u=l.length,d=n._blockCursorElement;o===u&&u>0&&(a=!0,o=u-1),vd(e,n)!==void 0||yg(e,n)||(s=!0);let f=l[o],h=!1;if(f===d)f=l[o+1],h=!0;else if(d!==null){const p=d.parentNode;e===p&&t>Array.prototype.indexOf.call(p.children,d)&&o--}if(i=dc(f),ne(i))o=fs(i,a?"next":"previous");else{let p=dc(e);if(p===null)return null;if(U(p)){const g=n.getElementByKey(p.getKey());g===null&&Z(214),[p,o]=so(p,g,n).resolveChildIndex(p,g,e,t),U(p)||Z(215),a&&o>=p.getChildrenSize()&&(o=Math.max(0,p.getChildrenSize()-1));let v=p.getChildAtIndex(o);if(U(v)&&(function(_,x,w){const S=_.getParent();return w===null||S===null||!S.canBeEmpty()||S!==w.getNode()})(v,0,r)){const _=a?v.getLastDescendant():v.getFirstDescendant();_===null?p=v:(v=_,p=U(v)?v:v.getParentOrThrow()),o=0}ne(v)?(i=v,p=null,o=fs(v,a?"next":"previous")):v!==p&&a&&!h&&(U(p)||Z(216),o=Math.min(p.getChildrenSize(),o+1))}else{const g=To(p),m=g!==null?g:p,v=m.getIndexWithinParent(),_=n.getElementByKey(p.getKey());let x="after";if(_!==null&&dc(e)===p){const w=so(p,_,n);w.element!==_?x=w.resolveLeafPosition(_,e,t):t===0&&ct(p)&&(x="before")}o=x==="before"?v:v+1,p=m.getParentOrThrow()}if(U(p))return[_s(p.__key,o,"element"),s]}}else i=dc(e);return ne(i)?[_s(i.__key,fs(i,o,"clamp"),"text"),s]:null}function vC(e,t,r){const n=e.offset,i=e.getNode();if(n===0){const o=i.getPreviousSibling(),s=i.getParent();if(t){if((r||!t)&&o===null&&U(s)&&s.isInline()){const a=s.getPreviousSibling();ne(a)&&e.set(a.__key,a.getTextContent().length,"text")}}else U(o)&&!r&&o.isInline()?e.set(o.__key,o.getChildrenSize(),"element"):ne(o)&&!i.isUnmergeable()&&e.set(o.__key,o.getTextContent().length,"text")}else if(n===i.getTextContent().length){const o=i.getNextSibling(),s=i.getParent();if(t&&U(o)&&o.isInline())e.set(o.__key,0,"element");else if((r||t)&&o===null&&U(s)&&s.isInline()&&!s.canInsertTextAfter()&&s.getTextContentSize()>1){const a=s.getNextSibling();ne(a)&&e.set(a.__key,0,"text")}}}function mP(e,t,r){if(e.type==="text"&&t.type==="text"){const n=e.isBefore(t),i=e.is(t);vC(e,n,i),vC(t,!n,i),i&&t.set(e.key,e.offset,e.type)}}function Py(e){const t=Qt(e.key);return t===null?null:Rm(t)}function vP(e,t,r){const n=Py(e),i=Py(t);if(n===i||n!==null&&i!==null&&n.is(i))return!1;const o=r(n,i);if(n!==null)return U(n)?t.set(n.getKey(),o?n.getChildrenSize():0,"element"):t.set(n.getKey(),o?n.getTextContentSize():0,"text"),!0;const s=To(i);if(s===null)return!1;const a=s.getParent();if(a===null)return!1;const l=s.getIndexWithinParent();return t.set(a.getKey(),o?l+1:l,"element"),!0}function _P(e){const t=vP(e.anchor,e.focus,(r,n)=>(function(i,o,s,a){if(s!==null&&a!==null){const d=To(s),f=To(a);if(d!==null&&d.is(f)){for(const h of Am(d).values()){if(h===s.getKey())return!0;if(h===a.getKey())return!1}return!0}return d===null||f===null||d.isBefore(f)}if(s!==null){const d=To(s),f=Qt(o.key);return d===null||f===null||!(!d.is(f)&&!d.isParentOf(f))||d.isBefore(f)}const l=To(a),u=Qt(i.key);return l!==null&&u!==null&&!l.is(u)&&!l.isParentOf(u)&&u.isBefore(l)})(e.anchor,e.focus,r,n));return t&&(e.dirty=!0),t}function bP(e,t,r,n,i,o){if(e===null||r===null||!Bh(i,e,r))return null;const s=mC(e,t,te(o)?o.anchor:null,i);if(s===null)return null;const a=mC(r,n,te(o)?o.focus:null,i);if(a===null)return null;const[l,u]=s,[d,f]=a;if(l.type==="element"&&d.type==="element"){const p=dc(e),g=dc(r);if(ct(p)&&ct(g))return null}const h=i._slotsUsed&&vP(l,d,()=>(e.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return mP(l,d),[l,d,u||f||h]}function jc(e){return U(e)&&!e.isInline()}function yP(e,t,r,n,i,o){const s=da(),a=new Eu(_s(e,t,i),_s(r,n,o),0,"");return a.dirty=!0,s._selection=a,a}function Vx(){const e=_s("root",0,"element"),t=_s("root",0,"element");return new Eu(e,t,0,"")}function cg(){return new Sm(new Set)}function Kx(e,t,r,n){const i=r._window;if(i===null)return null;const o=n||i.event,s=o?o.type:void 0,a=s==="selectionchange",l=!yy&&(a||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&o&&o.detail===3||s==="drop"||s===void 0);let u,d,f,h;if(te(e)&&!l)return e.clone();{if(t===null)return null;const S=oo(t,r._rootElement);if(u=S.anchorNode,d=S.focusNode,f=S.anchorOffset,h=S.focusOffset,(a||s===void 0)&&te(e)&&!Bh(r,u,d))return e.clone()}const p=bP(u,f,d,h,r,e);if(p===null)return null;const[g,m,v]=p;let _=0,x="";if(te(e)){const S=e.anchor;if(g.key===S.key)_=e.format,x=e.style;else{const k=g.getNode();ne(k)?(_=k.getFormat(),x=k.getStyle()):U(k)&&(_=k.getTextFormat(),x=k.getTextStyle())}}const w=new Eu(g,m,_,x);return v&&(w.dirty=!0),w}function de(){return da()._selection}function fd(){return Dt()._editorState._selection}function Ul(e,t,r,n=1){const i=e.anchor,o=e.focus,s=i.getNode(),a=o.getNode();if(!t.is(s)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const u=i.offset;if(r<=u&&n>0||r<u&&n<0){const d=Math.max(0,u+n);i.set(l,d,"element"),o.set(l,d,"element"),_C(e)}}else{const u=e.isBackward(),d=u?o:i,f=d.getNode(),h=u?i:o,p=h.getNode();if(t.is(f)){const g=d.offset;(r<=g&&n>0||r<g&&n<0)&&d.set(l,Math.max(0,g+n),"element")}if(t.is(p)){const g=h.offset;(r<=g&&n>0||r<g&&n<0)&&h.set(l,Math.max(0,g+n),"element")}}_C(e)}function _C(e){const t=e.anchor,r=t.offset,n=e.focus,i=n.offset,o=t.getNode(),s=n.getNode();if(e.isCollapsed()){if(!U(o))return;const a=o.getChildrenSize(),l=r>=a,u=l?o.getChildAtIndex(a-1):o.getChildAtIndex(r);if(ne(u)){let d=0;l&&(d=u.getTextContentSize()),t.set(u.__key,d,"text"),n.set(u.__key,d,"text")}return}if(U(o)){const a=o.getChildrenSize(),l=r>=a,u=l?o.getChildAtIndex(a-1):o.getChildAtIndex(r);if(ne(u)){let d=0;l&&(d=u.getTextContentSize()),t.set(u.__key,d,"text")}}if(U(s)){const a=s.getChildrenSize(),l=i>=a,u=l?s.getChildAtIndex(a-1):s.getChildAtIndex(i);if(ne(u)){let d=0;l&&(d=u.getTextContentSize()),n.set(u.__key,d,"text")}}}function dg(e,t,r,n,i){let o=null,s=0,a=null;n!==null?(o=n.__key,ne(n)?(s=n.getTextContentSize(),a="text"):U(n)&&(s=n.getChildrenSize(),a="element")):i!==null&&(o=i.__key,ne(i)?a="text":U(i)&&(a="element")),o!==null&&a!==null?e.set(o,s,a):(s=t.getIndexWithinParent(),s===-1&&(s=r.getChildrenSize()),e.set(r.__key,s,"element"))}function bC(e,t,r,n,i){e.type==="text"?e.set(r,e.offset+(t?0:i),"text"):e.offset>n.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function fg(e,t,r,n,i){try{e.setBaseAndExtent(t,r,n,i)}catch{}}function yC(e,t,r){const n=Kc(e,t.getKey());if(U(t)){const i=so(t,n,e);return[i.element,r+i.getFirstChildOffset()]}return[n,r]}function oQ(e,t,r,n,i,o){const s=o.getRootNode(),a=wu(s)||ra(s)?ah(s):null;if(i.has(sP)&&a!==o||a!==null&&Xx(a,a))return;const l=oo(n,o);let u;if(!te(t))return void(e!==null&&Bh(r,l.anchorNode,l.focusNode)&&n.removeAllRanges());const d=t.anchor,f=t.focus,h=d.getNode(),p=f.getNode(),[g,m]=yC(r,h,d.offset),[v,_]=yC(r,p,f.offset),x=t.format,w=t.style,S=t.isCollapsed();let k=g,A=v,C=!1;if(d.type==="text"?(k=ne(h)?Ha(h,g,r):null,C=h.getFormat()!==x||h.getStyle()!==w):te(e)&&e.anchor.type==="text"&&(C=!0),f.type==="text"&&(A=ne(p)?Ha(p,v,r):null),k!==null&&A!==null){if(S&&(e===null||C||te(e)&&(e.format!==x||e.style!==w))&&(function(R,N,I,P,z,q){R._inputState.collapsedSelectionFormat={format:N,key:z,offset:P,style:I,timeStamp:q}})(r,x,w,m,d.key,performance.now()),(n.type!=="Range"||!S)&&l.anchorOffset===m&&l.focusOffset===_&&l.anchorNode===k&&l.focusNode===A){if(a===null||!o.contains(a)){const R=a!==null?Cc(a):null;R!==null&&R!==r||i.has(Dy)||o.focus({preventScroll:!0})}if(d.type!=="element")return}if(fg(n,k,m,A,_),Za&&t.isCollapsed()&&o!==null&&!i.has(Dy)){const R=zy(o);if(R===null||!o.contains(R)){const N=ah(o.ownerDocument),I=N!==null?Cc(N):null;I!==null&&I!==r||o.focus({preventScroll:!0})}}if(!i.has(WJ)&&t.isCollapsed()&&o!==null&&o===zy(o)){const R=te(t)&&t.anchor.type==="element"?k.childNodes[m]||null:(u===void 0&&(u=NQ(n,o)),u);if(R!==null){let N;if(gi(R)){const I=R.ownerDocument.createRange();I.selectNode(R),N=I.getBoundingClientRect()}else N=R.getBoundingClientRect();(function(I,P,z){const q=nS(z),H=iS(q);if(q===null||H===null)return;const V=z.getBoundingClientRect();if(P.bottom<V.top)return;let{top:Y,bottom:G}=P,J=0,Q=0,ue=z;for(;ue!==null;){const le=ue===q.body;if(le){const $e=H.visualViewport;if($e){const Se=$e.offsetTop;J=Se,Q=Se+$e.height}else J=0,Q=mi(I).innerHeight;const ze=H.getComputedStyle(q.documentElement),mt=parseFloat(ze.scrollPaddingTop),be=parseFloat(ze.scrollPaddingBottom);isFinite(mt)&&(J+=mt),isFinite(be)&&(Q-=be)}else{const $e=ue===z?V:ue.getBoundingClientRect();J=$e.top,Q=$e.bottom}let Ae=0;if(Y<J?Ae=-(J-Y):G>Q&&(Ae=G-Q),Ae!==0)if(le)H.scrollBy(0,Ae);else{const $e=ue.scrollTop;ue.scrollTop+=Ae;const ze=ue.scrollTop-$e;Y-=ze,G-=ze}if(le)break;ue=ku(ue)}})(r,N,o)}}(function(R){R._inputState.isSelectionChangeFromDOMUpdate=!0})(r)}}function sQ(e){let t=de()||fd();t===null&&(t=Kr().selectEnd()),t.insertNodes(e)}function xP(e,t){for(const r of e.split(/(\r?\n|\t)/))r===`
25
- `||r===`\r
26
- `?t.linebreak():r===" "?t.tab():r!==""&&t.text(r)}function sh(e){const t=[];return xP(e,{linebreak:()=>t.push(Mo()),tab:()=>t.push(dd()),text:r=>t.push(Sr(r))}),t}function Oy(e){const t=[];for(const r of e)Qn(r)||(!U(r)&&!ct(r)||r.isInline()?t.push(r):U(r)&&t.push(...Oy(r.getChildren())));return t}function jd(e){let t=e;e.isCollapsed()||t.removeText();const r=de();te(r)&&(t=r),te(t)||Z(161);const n=t.anchor;let i=n.getNode(),o=n.offset;for(;!kn(i)&&An(i)===null;){const s=i;if([i,o]=aQ(i,o),s.is(i))break}return o}function aQ(e,t){const r=e.getParent();if(!r){const i=Pt();return Kr().append(i),i.select(),[Kr(),0]}if(ne(e)){const i=e.splitText(t);if(i.length===0)return[r,e.getIndexWithinParent()];const o=t===0?0:1;return[r,i[0].getIndexWithinParent()+o]}if(!U(e)||t===0)return[r,e.getIndexWithinParent()];const n=e.getChildAtIndex(t);if(n){const i=new Eu(_s(e.__key,t,"element"),_s(e.__key,t,"element"),0,""),o=e.insertNewAfter(i);o&&o.append(n,...n.getNextSiblings())}return[r,e.getIndexWithinParent()+1]}function xC(e){return Qn(e)||RQ(e)||ne(e)||e.isParentRequired()}function t_(e){const t=Pt();let r=null;for(let n=0;n<e.length;n++){const i=e[n];if(xC(i)){if(r===null){r=i.createParentElementNode(),t.append(r);const o=e[n+1];if(Qn(i)&&(o===void 0||!xC(o)))continue}r.append(i)}else t.append(i),r=null}return t}function hg(e,t,r,n,i="decorators-and-blocks"){if(t==="move"&&n==="character"&&!e.isCollapsed()){const[d,f]=r===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return f.set(d.key,d.offset,d.type),!0}const o=ui(e.focus,r?"previous":"next"),s=n==="lineboundary",a=t==="move";let l=o,u=i==="decorators-and-blocks";if(!dS(l)){for(const d of l){u=!1;const{origin:f}=d;if(!ct(f)||f.isIsolated()||(l=d,!s||!f.isInline()))break}if(u)for(const d of Tm(o).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(to(d))d.origin.isInline()||(l=d);else{if(U(d.origin))continue;ct(d.origin)&&!d.origin.isInline()&&(l=d)}break}}if(l===o)return!1;if(a&&!s&&ct(l.origin)&&l.origin.isKeyboardSelectable()){const d=cg();return d.add(l.origin.getKey()),gn(d),!0}return l=Ri(l),a&&mu(e.anchor,l),mu(e.focus,l),u||!s}let un=null,Pr=null,li=!1,r_=!1,$0=!1;const n_=new Set;let N0=0;const SC={characterData:!0,childList:!0,subtree:!0};function qc(){return li||un!==null&&un._readOnly}function on(){li&&Z(13)}function SP(){N0>99&&Z(14)}function da(){return un===null&&Z(195,EP()),un}function lQ(e){da()!==null&&Pr===null&&(Pr=e),Pr!==e&&aI(378)}function Dt(){return Pr===null&&Z(337,EP()),Pr}function uQ(){Dt()._dirtyType=2}function EP(){let e=0;const t=new Set,r=Vc.version;if(typeof window<"u")for(const i of qP(document)){const o=jh(i);if(wm(o))e++;else if(o){let s=String(o.constructor.version||"<0.17.1");s===r&&(s+=" (separately built, likely a bundler configuration issue)"),t.add(s)}}let n=` Detected on the page: ${e} compatible editor(s) with version ${r}`;return t.size&&(n+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),n}function wP(){return Pr}function EC(e,t,r){const n=t.__type,i=NP(e,n);let o=r.get(n);o===void 0&&(o=Array.from(i.transforms),r.set(n,o));const s=o.length;for(let a=0;a<s&&(o[a](t),t.isAttached());a++);}function wC(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function kP(e,t){if(!t)return;const r=e._updateTags;let n=t;Array.isArray(t)||(n=[t]);for(const i of n)r.add(i)}function cQ(e){return pg(e,Dt()._nodes)}function pg(e,t){const r=e.type,n=t.get(r);n===void 0&&Z(17,r);const i=n.klass;e.type!==i.getType()&&Z(18,i.name);const o=i.importJSON(e),s=e.children;if(U(o)&&Array.isArray(s))for(let l=0;l<s.length;l++){const u=pg(s[l],t);o.append(u)}const a=e.$slots;if(a){Gs(o)||Z(379,i.name);for(const l in a)ZP(o,l,pg(a[l],t))}return o}function kC(e,t,r){const n=un,i=li,o=Pr;un=t,li=!0,Pr=e;try{return r()}finally{un=n,li=i,Pr=o}}function Oa(e,t){const r=$0;$0=!0;try{(function(n,i){const o=n._pendingEditorState,s=n._rootElement,a=n._headless||s===null;if(o===null)return void(!n._updating&&n._deferred.length>0&&CC(n,n._deferred));const l=n._editorState,u=l._selection,d=o._selection,f=n._dirtyType!==0,h=un,p=li,g=Pr,m=n._updating,v=n._observer;let _=null;if(n._pendingEditorState=null,n._editorState=o,!a&&f&&v!==null){Pr=n,un=o,li=!1,n._updating=!0;try{const R=n._dirtyType,N=n._dirtyElements,I=n._dirtyLeaves;v.disconnect(),_=CJ(l,o,n,R,N,I)}catch(R){if(R instanceof Error&&n._onError(R),r_)throw R;return $P(n,null,s,o),vI(n),n._dirtyType=2,r_=!0,Oa(n,l),void(r_=!1)}finally{v.observe(s,SC),n._updating=m,un=h,li=p,Pr=g}}o._readOnly||(o._readOnly=!0);const x=n._dirtyLeaves,w=n._dirtyElements,S=n._normalizedNodes,k=n._updateTags;f&&(n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set),n._updateTags=new Set,(function(R,N){const I=R._decorators;let P=R._pendingDecorators||I;const z=N._nodeMap;let q;for(q in P)z.has(q)||(P===I&&(P=OP(R)),delete P[q])})(n,o);const A=a?null:Yn(mi(n));if(n._editable&&A!==null&&(f||d===null||d.dirty||!d.is(u))&&s!==null&&!k.has(GJ)){Pr=n,un=o;try{if(v!==null&&v.disconnect(),f||d===null||d.dirty){const R=n._blockCursorElement;R!==null&&_g(R,n,s),oQ(u,d,n,A,k,s)}(function(R,N,I){let P=R._blockCursorElement;if(te(I)&&I.isCollapsed()&&I.anchor.type==="element"&&N.contains(zy(N))){const z=I.anchor,q=z.getNode(),H=z.offset;let V=!1,Y=null;if(H===q.getChildrenSize())D0(q.getChildAtIndex(H-1))&&(V=!0);else{const G=q.getChildAtIndex(H);if(G!==null&&D0(G)){const J=G.getPreviousSibling();(J===null||D0(J))&&(V=!0,Y=R.getElementByKey(G.__key))}}if(V){const G=so(q,R.getElementByKey(q.__key),R).element;return P===null&&(R._blockCursorElement=P=(function(J){const Q=J.theme,ue=Yt().createElement("div");ue.contentEditable="false",ue.setAttribute("data-lexical-cursor","true");let le=Q.blockCursor;if(le!==void 0){if(typeof le=="string"){const Ae=Js(le);le=Q.blockCursor=Ae}le!==void 0&&ue.classList.add(...le)}return ue})(R._config)),N.style.caretColor="transparent",void(Y===null?G.appendChild(P):G.insertBefore(P,Y))}}P!==null&&_g(P,R,N)})(n,s,d)}finally{v!==null&&v.observe(s,SC),Pr=g,un=h}}_!==null&&(function(R,N,I,P,z){const q=Array.from(R._listeners.mutation),H=q.length;for(let V=0;V<H;V++){const[Y,G]=q[V];for(const J of G){const Q=N.get(J);Q!==void 0&&Y(Q,{dirtyLeaves:P,prevEditorState:z,updateTags:I})}}})(n,_,k,x,l),te(d)||d===null||u!==null&&u.is(d)||n.dispatchCommand(TI,void 0);const C=n._pendingDecorators;C!==null&&(n._decorators=C,n._pendingDecorators=null,Ef("decorator",n,!0,C)),(function(R,N,I){const P=TC(N),z=TC(I);P!==z&&Ef("textcontent",R,!0,z)})(n,i||l,o),Ef("update",n,!0,{dirtyElements:w,dirtyLeaves:x,editorState:o,mutatedNodes:_,normalizedNodes:S,prevEditorState:i||l,tags:k}),!m&&CC(n,n._deferred),(function(R){const N=R._updates;if(N.length===0)return void(R._cascadeCount=0);if((function(P){n_.has(P)||(n_.add(P),setTimeout(()=>{n_.delete(P),P._cascadeCount=0},0))})(R),R._cascadeCount++>99)return R._updates=[],R._cascadeCount=0,void R._onWarn(new Error(`One or more update listeners are endlessly enqueueing more updates. May have encountered infinite recursion caused by update listeners that trigger additional updates without a stop condition. Editor namespace: ${R._config.namespace}`));const I=N.shift();if(I){const[P,z]=I;Em(R,P,z)}})(n)})(e,t)}finally{$0=r}}function Ef(e,t,r,...n){const i=t._updating;t._updating=r;try{const o=t._listeners[e],s=Array.from(o);for(const[a,l]of s){l&&l();const u=a(...n);o.has(a)?o.set(a,u):u&&u()}}finally{t._updating=i}}function CP(e,t,r,n){const i=Zx(e);let o;if(!$0)for(let s=0;s<i.length;s++)i[s]._updating||(i[s]._cascadeCount=0);for(let s=4;s>=0;s--)for(let a=0;a<i.length;a++){const l=i[a];if(a>0&&l._updating){o=l;break}const u=l._commands.get(t);if(u!==void 0){const d=u[s];if(d.size>0){let f=!1;if(Xi(l,()=>{for(const h of d)if(h(r,n))return void(f=!0)}),f)return f}}}return o&&o.update(()=>{CP(o,t,r,n)}),!1}function CC(e,t){if(e._deferred=[],t.length!==0){const r=e._updating;e._updating=!0;try{for(let n=0;n<t.length;n++)t[n]()}finally{e._updating=r}}}function RC(e,t){const r=e._updates;let n=t||!1;for(;r.length!==0;){const i=r.shift();if(i){const[o,s]=i,a=e._pendingEditorState;let l;s!==void 0&&(l=s.onUpdate,s.skipTransforms&&(n=!0),s.discrete&&(a===null&&Z(191),a._flushSync=!0),l&&e._deferred.push(l),kP(e,s.tag)),a==null?Em(e,o,s):o()}}return n}function Em(e,t,r){const n=e._updateTags;let i,o=!1,s=!1;r!==void 0&&(i=r.onUpdate,kP(e,r.tag),o=r.skipTransforms||!1,s=r.discrete||!1),i&&e._deferred.push(i);const a=e._editorState;let l=e._pendingEditorState,u=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=RP(l||a),u=!0),l._flushSync=s;const d=un,f=li,h=Pr,p=e._updating;un=l,li=!1,e._updating=!0,Pr=e;const g=e._headless||e.getRootElement()===null;Qx(null);try{u&&(g?a._selection!==null&&(l._selection=a._selection.clone()):l._selection=(function(x,w){const S=x.getEditorState()._selection,k=Yn(mi(x));return te(S)||S==null?Kx(S,k,x,w):S.clone()})(e,r&&r.event||null));const v=e._compositionKey;t(),o=RC(e,o),(function(x,w){const S=w.getEditorState()._selection,k=x._selection;if(te(k)){const A=k.anchor,C=k.focus;let R;if(A.type==="text"&&(R=A.getNode(),R.selectionTransform(S,k)),C.type==="text"){const N=C.getNode();R!==N&&N.selectionTransform(S,k)}}})(l,e),e._dirtyType!==0&&(o?(function(x,w){const S=w._dirtyLeaves,k=x._nodeMap;for(const A of S){const C=k.get(A);ne(C)&&C.isAttached()&&C.isSimpleText()&&!C.isUnmergeable()&&Wk(C)}})(l,e):(function(x,w){const S=w._dirtyLeaves,k=w._dirtyElements,A=x._nodeMap,C=Hs(),R=new Map;let N=S,I=N.size,P=k,z=P.size;for(;I>0||z>0;){if(I>0){w._dirtyLeaves=new Set;for(const q of N){const H=A.get(q);ne(H)&&H.isAttached()&&H.isSimpleText()&&!H.isUnmergeable()&&Wk(H),H!==void 0&&wC(H,C)&&EC(w,H,R),S.add(q)}if(N=w._dirtyLeaves,I=N.size,I>0){N0++;continue}}w._dirtyLeaves=new Set,w._dirtyElements=new Map,P.delete("root")&&P.set("root",!0);for(const q of P){const H=q[0],V=q[1];if(k.set(H,V),!V)continue;const Y=A.get(H);Y!==void 0&&wC(Y,C)&&EC(w,Y,R)}N=w._dirtyLeaves,I=N.size,P=w._dirtyElements,z=P.size,N0++}w._dirtyLeaves=S,w._dirtyElements=k})(l,e),RC(e),(function(x,w,S,k){const A=x._nodeMap,C=w._nodeMap,R=[];for(const[P]of k){const z=C.get(P);z!==void 0&&(z.isAttached()||(U(z)&&ng(z,P,A,C,R,k),A.has(P)||k.delete(P),R.push(P)))}for(const P of S){const z=C.get(P);z===void 0||z.isAttached()||(Gs(z)&&z.__slots!==null&&ng(z,P,A,C,R,S),A.has(P)||S.delete(P),R.push(P))}for(const P of R)C.delete(P);const N=Dt(),I=N._compositionKey;I===null||C.has(I)||(N._compositionKey=null)})(a,l,e._dirtyLeaves,e._dirtyElements)),v!==e._compositionKey&&(l._flushSync=!0);const _=l._selection;if(te(_)){e._slotsUsed&&_P(_);const x=l._nodeMap,w=_.anchor.key,S=_.focus.key;x.get(w)!==void 0&&x.get(S)!==void 0||Z(19)}else Wt(_)&&_._nodes.size===0&&(l._selection=null)}catch(v){return v instanceof Error&&e._onError(v),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void Oa(e)}finally{un=d,li=f,Pr=h,e._updating=p,N0=0}e._dirtyType!==0||e._deferred.length>0||(function(v,_){const x=_.getEditorState()._selection,w=v._selection;if(w!==null){if(w.dirty||!w.is(x))return!0}else if(x!==null)return!0;return!1})(l,e)?l._flushSync?(l._flushSync=!1,Oa(e)):u&&xQ(()=>{Oa(e)}):(l._flushSync=!1,u&&(n.clear(),e._deferred=[],e._pendingEditorState=null))}function Xi(e,t,r){Pr===e&&r===void 0?t():Em(e,t,r)}function dQ(e){if(Zt(e)){let t=null;for(const r of e.getChildren())t=r.isInline()?(t||r.replace(r.createParentElementNode())).append(r):null}}class fi extends Ni{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for("ElementNode"),{$transform:dQ,extends:Ni})}constructor(t){super(t),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle="",this.__slotHost=null,this.__slots=null}afterCloneFrom(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__first=t.__first,this.__last=t.__last,this.__size=t.__size,this.__slotHost=t.__slotHost,this.__slotHost!==null&&this.__parent!==null&&Z(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=t.__slots),this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const t=this.getFormat();return dJ[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let r=this.getFirstChild();for(;r!==null;)t.push(r),r=r.getNextSibling();return t}getChildrenKeys(){const t=[];let r=this.getFirstChild();for(;r!==null;)t.push(r.__key),r=r.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&Zi(this).length===0}isDirty(){const t=Dt()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){const t=this.getLatest(),r=this.getParentOrThrow().getLastChild();return r!==null&&r.is(t)}getAllTextNodes(){const t=[];for(const n of Zi(this)){const i=hu(this,n);U(i)&&t.push(...i.getAllTextNodes())}let r=this.getFirstChild();for(;r!==null;){if(ne(r)&&t.push(r),U(r)){const n=r.getAllTextNodes();t.push(...n)}r=r.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;U(t);){const r=t.getFirstChild();if(r===null)break;t=r}return t}getLastDescendant(){let t=this.getLastChild();for(;U(t);){const r=t.getLastChild();if(r===null)break;t=r}return t}getDescendantByIndex(t){const r=this.getChildren(),n=r.length;if(t>=n){const o=r[n-1];return U(o)&&o.getLastDescendant()||o||null}const i=r[t];return U(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const t=this.getLatest().__first;return t===null?null:Qt(t)}getFirstChildOrThrow(){const t=this.getFirstChild();return t===null&&Z(45,this.__key),t}getLastChild(){const t=this.getLatest().__last;return t===null?null:Qt(t)}getLastChildOrThrow(){const t=this.getLastChild();return t===null&&Z(96,this.__key),t}getChildAtIndex(t){const r=this.getChildrenSize();let n,i;if(t<r/2){for(n=this.getFirstChild(),i=0;n!==null&&i<=t;){if(i===t)return n;n=n.getNextSibling(),i++}return null}for(n=this.getLastChild(),i=r-1;n!==null&&i>=t;){if(i===t)return n;n=n.getPreviousSibling(),i--}return null}getTextContent(){let t=XP(this);const r=this.getChildren(),n=r.length;for(let i=0;i<n;i++){const o=r[i];t+=o.getTextContent(),U(o)&&i!==n-1&&!o.isInline()&&(t+=ql)}return t}getTextContentSize(){let t=(function(i){let o=0;for(const s of Zi(i)){const a=hu(i,s);a!==null&&(o+=a.getTextContentSize())}return o})(this);const r=this.getChildren(),n=r.length;for(let i=0;i<n;i++){const o=r[i];t+=o.getTextContentSize(),U(o)&&i!==n-1&&!o.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(t!==""){const r=rg[t];return(this.getFormat()&r)!==0}return!1}hasTextFormat(t){const r=ta[t];return(this.getTextFormat()&r)!==0}getFormatFlags(t,r){return uu(this.getLatest().__textFormat,t,r)}getTextStyle(){return this.getLatest().__textStyle}select(t,r){on();const n=de();let i=t,o=r;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&r===0){const l=this.getFirstChild();if(ne(l)||U(l))return l.select(0,0)}else if(!(t!==void 0&&t!==s||r!==void 0&&r!==s)){const l=this.getLastChild();if(ne(l)||U(l))return l.select()}}i===void 0&&(i=s),o===void 0&&(o=s);const a=this.__key;return te(n)?(n.anchor.set(a,i,"element"),n.focus.set(a,o,"element"),n.dirty=!0,n):yP(a,i,a,o,"element","element")}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();return this.getChildren().forEach(r=>r.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const r=this.getWritable();return r.__dir=t,r}setFormat(t){return this.getWritable().__format=t!==""&&rg[t]||0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){const r=this.getWritable();return r.__textFormat=t,r}setTextStyle(t){const r=this.getWritable();return r.__textStyle=t,r}setIndent(t){return this.getWritable().__indent=t,this}splice(t,r,n){ag(this)&&Z(324,this.__key,this.__type);const i=this.getChildrenSize(),o=this.getWritable();t+r<=i||Z(226,String(t),String(r),String(i));for(const p of n);const s=o.__key,a=[],l=[],u=this.getChildAtIndex(t+r);let d=null,f=i-r+n.length;if(t!==0)if(t===i)d=this.getLastChild();else{const p=this.getChildAtIndex(t);p!==null&&(d=p.getPreviousSibling())}if(r>0){let p=d===null?this.getFirstChild():d.getNextSibling();for(let g=0;g<r;g++){p===null&&Z(100);const m=p.getNextSibling(),v=p.__key;Ks(p.getWritable()),l.push(v),p=m}}let h=d;for(const p of n){h!==null&&p.is(h)&&(d=h=h.getPreviousSibling());const g=p.getWritable();g.__parent===s&&f--,Ks(g);const m=p.__key;if(h===null)o.__first=m,g.__prev=null;else{const v=h.getWritable();v.__next=m,g.__prev=v.__key}p.__key===s&&Z(76),g.__parent=s,a.push(m),h=p}if(t+r===i)h!==null&&(h.getWritable().__next=null,o.__last=h.__key);else if(u!==null){const p=u.getWritable();if(h!==null){const g=h.getWritable();p.__prev=h.__key,g.__next=u.__key}else p.__prev=null}if(o.__size=f,l.length){const p=de();if(te(p)){const g=new Set(l),m=new Set(a),{anchor:v,focus:_}=p;AC(v,g,m)&&dg(v,v.getNode(),this,d,u),AC(_,g,m)&&dg(_,_.getNode(),this,d,u),f!==0||this.canBeEmpty()||Zt(this)||this.remove()}}return o}getDOMSlot(t){return new yc(t)}exportDOM(t){const{element:r}=super.exportDOM(t);if(tt(r)){const n=this.getIndent();n>0&&(r.style.paddingInlineStart=40*n+"px",r.setAttribute("data-lexical-indent",String(n)));const i=this.getDirection();i&&(r.dir=i)}return{element:r}}exportJSON(){const t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},r=this.getTextFormat(),n=this.getTextStyle();return r===0&&n===""||Zt(this)||this.getChildren().some(ne)||(r!==0&&(t.textFormat=r),n!==""&&(t.textStyle=n)),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,r){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,r,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,r){const n=so(this,t,r);let i=n.getFirstChild();for(let o=this.getFirstChild();o;o=o.getNextSibling()){const s=r.getElementByKey(o.getKey());s!==null&&(i==null?(n.insertChild(s),i=s):i!==s&&n.replaceChild(s,i),i=i.nextSibling)}}}function U(e){return e instanceof fi}function AC(e,t,r){let n=e.getNode();for(;n;){const i=n.__key;if(t.has(i)&&!r.has(i))return!0;n=n.getParent()}return!1}class Hx extends Ni{__slotHost;__slots;constructor(t){super(t),this.__slotHost=null,this.__slots=null}afterCloneFrom(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__slotHost=t.__slotHost,this.__slotHost!==null&&this.__parent!==null&&Z(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=t.__slots)}decorate(t,r){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function ct(e){return e instanceof Hx}class hd extends fi{__cachedText;static getType(){return"root"}static clone(){return new hd}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Z(51)}getTextContent(){const t=this.__cachedText;return t===null||!qc()&&Dt()._dirtyType!==0?super.getTextContent():t}remove(){Z(52)}replace(t){Z(53)}insertBefore(t){Z(54)}insertAfter(t){Z(55)}updateDOM(t,r){return!1}splice(t,r,n){for(const i of n)U(i)||ct(i)||Z(282);return super.splice(t,r,n)}static importJSON(t){return Kr().updateFromJSON(t)}collapseAtStart(){return!0}}function Er(e){return e instanceof hd}function RP(e){return new Uh(hI(e._nodeMap),null,e._slotsUsed)}function Wx(){return new Uh(new Map([["root",new hd]]),null,!1)}function My(e){const t=e.exportJSON(),r=e.constructor;if(t.type!==r.getType()&&Z(130,r.name),U(e)){const i=t.children;Array.isArray(i)||Z(59,r.name);const o=e.getChildren();for(let s=0;s<o.length;s++){const a=My(o[s]);i.push(a)}}const n=Zi(e);if(n.length>0){const i={};for(const o of n){const s=hu(e,o);s===null&&Z(366,r.name,o),i[o]=My(s)}t.$slots=i}return t}function fQ(e){return e instanceof Uh}class Uh{_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(t,r=null,n=!1){this._nodeMap=t,this._selection=r||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t,r){return kC(r&&r.editor||null,this,t)}clone(t){const r=new Uh(this._nodeMap,t===void 0?this._selection:t,this._slotsUsed);return r._readOnly=!0,r}toJSON(){return kC(null,this,()=>({root:My(Kr())}))}}class Gx extends fi{static getType(){return"artificial"}createDOM(t){return Yt().createElement("div")}}class pd extends Ni{static getType(){return"linebreak"}static clone(t){return new pd(t.__key)}constructor(t){super(t)}getTextContent(){return`
27
- `}createDOM(){return Yt().createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:t=>AP(t)||TP(t)?null:{conversion:hQ,priority:0}}}static importJSON(t){return Mo().updateFromJSON(t)}}function hQ(e){return{node:Mo()}}function Mo(){return Vo(new pd)}function Qn(e){return e instanceof pd}function AP(e){const t=e.parentElement;if(t!==null&&Wc(t)){const r=t.firstChild;if(r===e||r.nextSibling===e&&gg(r)){const n=t.lastChild;if(n===e||n.previousSibling===e&&gg(n))return!0}}return!1}function TP(e){const t=e.parentElement;if(t!==null&&Wc(t)){const r=t.firstChild;if(r===e||r.nextSibling===e&&gg(r))return!1;const n=t.lastChild;if(n===e||n.previousSibling===e&&gg(n))return!0}return!1}function gg(e){return gi(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}class gd extends fi{static getType(){return"paragraph"}static clone(t){return new gd(t.__key)}createDOM(t){const r=Yt().createElement("p"),n=Rc(t.theme,"paragraph");return n!==void 0&&r.classList.add(...n),r}updateDOM(t,r,n){return!1}static importDOM(){return{p:t=>({conversion:pQ,priority:0})}}exportDOM(t){const{element:r}=super.exportDOM(t);if(tt(r)){this.isEmpty()&&r.append(Yt().createElement("br"));const n=this.getFormatType();n&&(r.style.textAlign=n)}return{element:r}}static importJSON(t){return Pt().updateFromJSON(t)}exportJSON(){const t=super.exportJSON();if(t.textFormat===void 0||t.textStyle===void 0){const r=this.getChildren().find(ne);r?(t.textFormat=r.getFormat(),t.textStyle=r.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,r){const n=Pt();n.setTextFormat(t.format),n.setTextStyle(t.style);const i=this.getDirection();return n.setDirection(i),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,r),n}collapseAtStart(){const t=this.getChildren();if(t.length===0||ne(t[0])&&t[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function pQ(e){const t=Pt();if(ws(t,e),Cu(e,t),t.getFormatType()===""){const r=e.getAttribute("align");r&&r&&r in rg&&t.setFormat(r)}return ho(t,e),{node:t}}function Pt(){return Vo(new gd)}function md(e){return e instanceof gd}function gQ(e){console.warn(e)}const ut=0,nc=1,mQ=4,vQ=-8;function $P(e,t,r,n,i){const o=e._keyToDOMMap;o.clear(),e._editorState=Wx(),e._pendingEditorState=n,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),e._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null};const s=e._observer;s!==null&&(s.disconnect(),e._observer=null),t!==null&&(t.textContent="",(function(a,l){const u=`__lexicalKey_${l._key}`;delete a[u]})(t,e)),r!==null&&(r.textContent="",o.set("root",r),PP(r,e,"root"))}function _Q(e){const t=new Set,r=new Set;for(const{klass:n,ownNodeConfig:i}of sS(e)){const o=n.transform;if(!r.has(o)){r.add(o);const s=n.transform();s&&t.add(s)}if(i){const s=i.$transform;s&&t.add(s)}}return t}const mg={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,r,n)=>{},$exportDOM:(e,t)=>{const r=Yx(t,e.getType());return r&&r.exportDOM!==void 0?r.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,r,n,i)=>U(e)&&e.extractWithChild(t,r,n),$getDOMSlot:(e,t,r)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,r,n)=>null,$shouldExclude:(e,t,r)=>U(e)&&e.excludeFromCopy("html"),$shouldInclude:(e,t,r)=>!t||e.isSelected(t),$updateDOM:(e,t,r,n)=>e.updateDOM(t,r,n._config)};function Jx(e){const t=e||{},r=wP(),n=t.theme||{},i=e===void 0?r:t.parentEditor||null,o=t.disableEvents||!1,s=Wx(),a=t.namespace||(i!==null?i._config.namespace:LP()),l=t.editorState,u=[hd,ca,pd,cd,gd,Gx,...t.nodes||[]],{onError:d,onWarn:f,html:h}=t,p=t.editable===void 0||t.editable;let g;if(e===void 0&&r!==null)g=r._nodes;else{g=new Map;for(let v=0;v<u.length;v++){let _=u[v],x=null,w=null;if(_&&typeof _=="object"){const A=_;_=A.replace,x=A.with,w=A.withKlass||null}if(typeof _!="function"||!_.prototype||!(_===Ni||_.prototype instanceof Ni)){let A="<unknown>";try{A=JSON.parse(fI)}catch{}Z(365,String(v-u.length+(t.nodes?t.nodes.length:0)),typeof _=="function"?`${_.name}${typeof _.getType=="function"?` (type ${String(_.getType())})`:""}`:String(_),String(A))}oS(_);const S=_.getType(),k=_Q(_);g.set(S,{exportDOM:h&&h.export?h.export.get(_):void 0,klass:_,replace:x,replaceWithKlass:w,sharedNodeState:yJ(u[v]),transforms:k})}}const m=new Vc(s,i,g,{disableEvents:o,dom:{...mg,...e&&e.dom},namespace:a,theme:n},d||console.error,f||gQ,(function(v,_){const x=new Map,w=new Set,S=k=>{Object.keys(k).forEach(A=>{let C=x.get(A);C===void 0&&(C=[],x.set(A,C)),C.push(k[A])})};return v.forEach(k=>{const A=k.klass.importDOM;if(A==null||w.has(A))return;w.add(A);const C=A.call(k.klass);C!==null&&S(C)}),_&&S(_),x})(g,h?h.import:void 0),p,e);return l!==void 0&&(m._pendingEditorState=l,m._dirtyType=2),(function(v){v.registerCommand(NI,BJ,ut),v.registerCommand(DI,jJ,ut),v.registerCommand(FI,qJ,ut),v.registerCommand(II,VJ,ut),v.registerCommand(PI,KJ,ut)})(m),m}function bQ(e,t){const r=e.get(t);e.delete(t),r&&r()}function qd(e,t,r){return e.set(t,r),bQ.bind(null,e,t)}class Vc{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_inputState;_createEditorArgs;constructor(t,r,n,i,o,s,a,l,u){this._createEditorArgs=u,this._parentEditor=r,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new by,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=i,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=LP(),this._onError=o,this._onWarn=s,this._htmlConversions=a,this._editable=l,this._headless=r!==null&&r._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null}}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){return qd(this._listeners.update,t)}registerEditableListener(t){return qd(this._listeners.editable,t)}registerDecoratorListener(t){return qd(this._listeners.decorator,t)}registerTextContentListener(t){return qd(this._listeners.textcontent,t)}registerRootListener(t){const r=this._listeners.root;return nl(qd(r,t,t(this._rootElement,null)||void 0),()=>(function(n,i,o){const s=n.get(i);s&&s(),n.set(i,i(...o)||void 0)})(r,t,[null,this._rootElement]))}registerCommand(t,r,n){n===void 0&&Z(35);const i=this._commands;i.has(t)||i.set(t,[new Bd,new Bd,new Bd,new Bd,new Bd]);const o=i.get(t);o===void 0&&Z(36,String(t));const s=(function(l){return 7&l})(n),a=o[s];return s!==n?a.addFront(r):a.addBack(r),()=>{a.delete(r),o.every(l=>l.size===0)&&i.delete(t)}}registerMutationListener(t,r,n){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,o=this._listeners.mutation;let s=o.get(r);s===void 0&&(s=new Set,o.set(r,s)),s.add(i);const a=n&&n.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(r,i),()=>{s.delete(i),s.size===0&&o.delete(r)}}getRegisteredNode(t){const r=this._nodes.get(t.getType());return r===void 0&&Z(37,t.name),r}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,r){const n=this._editorState,i=PC(n).get(r.getType());if(!i)return;const o=new Map;for(const s of i.keys())o.set(s,"created");o.size>0&&t(o,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,r){const n=this.getRegisteredNode(t);return n.transforms.add(r),n}registerNodeTransform(t,r){const n=this.registerNodeTransformToKlass(t,r),i=[n],o=n.replaceWithKlass;if(o!=null){const s=this.registerNodeTransformToKlass(o,r);i.push(s)}return(function(s,a){const l=PC(s.getEditorState()),u=[];for(const d of a){const f=l.get(d);f&&u.push(f)}u.length!==0&&s.update(()=>{for(const d of u)for(const f of d.keys()){const h=Qt(f);h&&h.markDirty()}},s._pendingEditorState===null?{tag:Sf}:void 0)})(this,i.map(s=>s.klass.getType())),()=>{i.forEach(s=>s.transforms.delete(r))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,r){return xe(this,t,r)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const r=this._rootElement;if(t!==r){const n=Rc(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=t,$P(this,r,t,i,{preserveUpdateQueue:!0}),r!==null&&(this._config.disableEvents||HJ(r),n!=null&&r.classList.remove(...n)),t!==null){const o=iS(t),s=t.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=o,this._dirtyType=2,vI(this),this._updateTags.add(Sf),Oa(this),this._config.disableEvents||(function(a,l){const u=a.ownerDocument;$y.set(a,u);let d=og.get(u);d===void 0&&(d={editors:new Set,hasShadowEditor:void 0},og.set(u,d)),d.editors.add(l),d.hasShadowEditor=void 0,a.__lexicalEditor=l;const f=eP(a);f.push(UJ.register(u));for(let h=0;h<Ty.length;h++){const[p,g]=Ty[h],m=typeof g=="function"?v=>{aC(v)||(sC(v),(l.isEditable()||p==="click")&&g(v,l))}:v=>{if(aC(v))return;sC(v);const _=l.isEditable();switch(p){case"cut":return _&&xe(l,jx,v);case"copy":return xe(l,xm,v);case"paste":return _&&xe(l,Ux,v);case"dragstart":return _&&xe(l,WI,v);case"dragover":return _&&xe(l,GI,v);case"dragend":return _&&xe(l,DJ,v);case"focus":return _&&xe(l,PJ,v);case"blur":return _&&xe(l,OJ,v);case"drop":return _&&xe(l,HI,v)}};f.push(zJ(a,p,m))}})(t,this),n!=null&&t.classList.add(...n)}else this._window=null,this._updateTags.add(Sf),Oa(this);Ef("root",this,!1,t,r)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,r){t.isEmpty()&&Z(38);let n=t;n._readOnly&&(n=RP(t),n._selection=t._selection?t._selection.clone():null),mI(this);const i=this._pendingEditorState,o=r!==void 0?r.tag:null;i===null||i.isEmpty()||(o!=null&&this._updateTags.add(o),Oa(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||t._slotsUsed,Xi(this,()=>{if(o&&this._updateTags.add(o),t._parsed)for(const[s,a]of n._nodeMap.entries())U(a)?this._dirtyElements.set(s,!0):this._dirtyLeaves.add(s)},{discrete:!this._updating||void 0})}parseEditorState(t,r){return(function(n,i,o){const s=Wx(),a=un,l=li,u=Pr,d=i._dirtyElements,f=i._dirtyLeaves,h=i._cloneNotNeeded,p=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,un=s,li=!1,Pr=i,Qx(null);try{const g=i._nodes;pg(n.root,g),o&&o(),s._readOnly=!0,s._parsed=!0}catch(g){g instanceof Error&&i._onError(g)}finally{i._dirtyElements=d,i._dirtyLeaves=f,i._cloneNotNeeded=h,i._dirtyType=p,un=a,li=l,Pr=u}return s})(typeof t=="string"?JSON.parse(t):t,this,r)}read(...t){const[r,n]=t.length===1?["force-commit",t[0]]:t;return r==="force-commit"&&Oa(this),(r==="pending"?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(t,r){(function(n,i,o){n._updating?n._updates.push([i,o]):Em(n,i,o)})(this,t,r)}focus(t,r={}){const n=this._rootElement;n!==null&&(n.setAttribute("autocapitalize","off"),Xi(this,()=>{const i=de(),o=Kr();i!==null?i.dirty||gn(i.clone()):o.getChildrenSize()!==0&&(r.defaultSelection==="rootStart"?o.selectStart():o.selectEnd()),du("focus"),CQ(()=>{n.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&n.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;t!==null&&t.blur();const r=Yn(this._window);r!==null&&r.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,Ef("editable",this,!0,t),this._slotsUsed&&this.update(()=>uQ()))}toJSON(){return{editorState:this._editorState.toJSON()}}}Vc.version=fI;let Ly=null;function Qx(e){Ly=e}let yQ=1;function NP(e,t){const r=Yx(e,t);return r===void 0&&Z(30,t),r}function Yx(e,t){return e._nodes.get(t)}const xQ=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function Xx(e,t){const r=t!==void 0?t:(()=>{const o=e.getRootNode();return wu(o)||ra(o)?ah(o):null})();if(!tt(r)||r.hasAttribute("data-lexical-slot"))return!1;const n=cu(r),i=r.nodeName;return rP(n)&&(i==="INPUT"||i==="TEXTAREA"||r.contentEditable==="true"&&jh(r)==null)}function Bh(e,t,r){const n=e.getRootElement();if(!n)return!1;try{if(!t||!n.contains(t)||!n.contains(r))return!1}catch{return!1}return Cc(t)===e&&e.read("latest",()=>!Xx(t))}function wm(e){return e instanceof Vc}function Cc(e){let t=e;for(;t!=null;){const r=jh(t);if(wm(r))return r;t=ku(t)}return null}function jh(e){return e?e.__lexicalEditor:null}function Wl(e){return lu(e)||e.isToken()}function Ci(e){return Wl(e)||e.isSegmented()}function gi(e){return _d(e)&&e.nodeType===3}function wu(e){return _d(e)&&e.nodeType===9}function SQ(e){let t=e;for(;t!=null;){if(gi(t))return t;t=t.firstChild}return null}function uu(e,t,r){const n=ta[t];if(r!==null&&(e&n)===(r&n))return e;let i=e^n;return t==="subscript"?i&=-65:t==="superscript"?i&=-33:t==="lowercase"?(i&=-513,i&=-1025):t==="uppercase"?(i&=-257,i&=-1025):t==="capitalize"&&(i&=-257,i&=-513),i}function DP(e){return ne(e)||Qn(e)||ct(e)}function FP(e,t){const r=(function(){const s=Ly;return Ly=null,s})();if((t=t||r&&r.__key)!=null)return void(e.__key=t);on(),SP();const n=Dt(),i=da(),o=""+yQ++;i._nodeMap.set(o,e),U(e)?n._dirtyElements.set(o,!0):n._dirtyLeaves.add(o),n._cloneNotNeeded.add(o),n._dirtyType===0&&(n._dirtyType=1),e.__key=o}function Ks(e){An(e)!==null&&Z(380,e.__key,String(An(e)));const t=e.getParent();if(t!==null){const r=e.getWritable(),n=t.getWritable(),i=e.getPreviousSibling(),o=e.getNextSibling(),s=o!==null?o.__key:null,a=i!==null?i.__key:null,l=i!==null?i.getWritable():null,u=o!==null?o.getWritable():null;i===null&&(n.__first=s),o===null&&(n.__last=a),l!==null&&(l.__next=s),u!==null&&(u.__prev=a),r.__prev=null,r.__next=null,r.__parent=null,n.__size--}}function vg(e){SP(),ag(e)&&Z(323,e.__key,e.__type);const t=e.getLatest(),r=t.__parent!==null?t.__parent:fu(t)?t.__slotHost:null,n=da(),i=Dt(),o=n._nodeMap,s=i._dirtyElements;r!==null&&(function(l,u,d){let f=l;for(;f!==null;){if(d.has(f))return;const h=u.get(f);if(h===void 0)break;d.set(f,!1),f=h.__parent!==null?h.__parent:fu(h)?h.__slotHost:null}})(r,o,s);const a=t.__key;i._dirtyType===0&&(i._dirtyType=1),U(e)?s.set(a,!0):i._dirtyLeaves.add(a)}function sn(e){on();const t=Dt(),r=t._compositionKey;if(e!==r){if(t._compositionKey=e,r!==null){const n=Qt(r);n!==null&&n.getWritable()}if(e!==null){const n=Qt(e);n!==null&&n.getWritable()}}}function Hs(){return qc()?null:Dt()._compositionKey}function Qt(e,t){const r=(t||da())._nodeMap.get(e);return r===void 0?null:r}function IP(e,t){const r=vd(e,Dt());return r!==void 0?Qt(r,t):null}function PP(e,t,r){e[`__lexicalKey_${t._key}`]=r}function vd(e,t){return e[`__lexicalKey_${t._key}`]}function cu(e,t){let r=e;for(;r!=null;){const n=IP(r,t);if(n!==null)return n;r=ku(r)}return null}function OP(e){const t=e._decorators,r=Object.assign({},t);return e._pendingDecorators=r,r}function TC(e){return e.read(()=>Kr().getTextContent())}function Kr(){return da()._nodeMap.get("root")}function gn(e){on();const t=da();e!==null&&(e.dirty=!0,e.setCachedNodes(null),te(e)&&Dt()._slotsUsed&&_P(e)),t._selection=e}function $C(){on(),mI(Dt())}function dc(e){const t=(function(r,n){let i=r;for(;i!=null;){const o=vd(i,n);if(o!==void 0)return o;i=ku(i)}return null})(e,Dt());return t===null?null:Qt(t)}function MP(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Zx(e){const t=[];for(let r=e;r!==null;r=r._parentEditor)t.push(r);return t}function LP(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function zP(e){return gi(e)?e.nodeValue:null}function eS(e,t,r){const n=Yn(mi(t));if(n===null)return;const i=oo(n,t._rootElement),o=i.anchorNode;let{anchorOffset:s,focusOffset:a}=i;if(o!==null){let l=zP(o);const u=cu(o);if(l!==null&&ne(u)){if((l===Jf||l===Lx)&&r){const d=r.length;l=r,s=d,a=d}l!==null&&tS(u,l,s,a,e)}}}function tS(e,t,r,n,i){let o=e;if(o.isAttached()&&(i||!o.isDirty())){const s=o.isComposing();if(o.isToken()&&s)return;let a=t;if((s||i)&&(t.endsWith(Jf)&&(a=t.slice(0,-Jf.length)),i)){const u=Lx;let d;for(;(d=a.indexOf(u))!==-1;)a=a.slice(0,d)+a.slice(d+u.length),r!==null&&r>d&&(r=Math.max(d,r-u.length)),n!==null&&n>d&&(n=Math.max(d,n-u.length))}const l=o.getTextContent();if(i||a!==l){const u=de();if(a===""){if(sn(null),Oh||el||Mh)o.remove();else{const m=Dt();i_(o,"",u),setTimeout(()=>{m.update(()=>{o.isAttached()&&o.getTextContent()===""&&o.remove()})},20)}return}const d=o.getParent(),f=fd(),h=o.getTextContentSize(),p=Hs(),g=o.getKey();if(o.isToken()&&!s||p!==null&&g===p&&!s||te(f)&&(d!==null&&!d.canInsertTextBefore()&&f.anchor.offset===0||f.anchor.key===e.__key&&f.anchor.offset===0&&!o.canInsertTextBefore()&&!s||f.focus.key===e.__key&&f.focus.offset===h&&!o.canInsertTextAfter()&&!s))return void o.markDirty();if(!te(u)||r===null||n===null)return void i_(o,a,u);if(u.setTextNodeRange(o,r,o,n),o.isSegmented()){const m=Sr(o.getTextContent());o.replace(m),o=m}i_(o,a,u)}}}function i_(e,t,r){if(e.setTextContent(t),te(r)){const n=e.getKey();let i=!1;for(const o of["anchor","focus"]){const s=r[o];s.type==="text"&&s.key===n&&(s.offset=fs(e,s.offset,"clamp"),i=!0)}i&&(r._cachedNodes=null,r._cachedIsBackward=null)}}function Rp(e,t,r){const n=t[r]||!1;return n==="any"||n===e[r]}function EQ(e,t){return Rp(e,t,"altKey")&&Rp(e,t,"ctrlKey")&&Rp(e,t,"shiftKey")&&Rp(e,t,"metaKey")}function jt(e,t,r){if(!EQ(e,r))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;if(e.code.startsWith("Digit")&&/^\d$/.test(t))return e.code===`Digit${t}`;const n="Key"+t.toUpperCase();return e.code===n}const Ns={ctrlKey:!Eo,metaKey:Eo},NC={altKey:Eo,ctrlKey:!Eo};function DC(e){return e.key==="Backspace"}function wQ(e){const t=Kr();if(te(e)){const r=e.anchor,n=e.focus,i=r.getNode();if(Er(i))return r.set(i.getKey(),0,"element"),n.set(i.getKey(),i.getChildrenSize(),"element"),Pa(e),e;const o=i.getTopLevelElementOrThrow(),s=o.getParent();if(s===null)return U(o)&&(r.set(o.getKey(),0,"element"),n.set(o.getKey(),o.getChildrenSize(),"element"),Pa(e)),e;const a=s;return r.set(a.getKey(),0,"element"),n.set(a.getKey(),a.getChildrenSize(),"element"),Pa(e),e}{const r=t.select(0,t.getChildrenSize());return gn(Pa(r)),r}}function Rc(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});const r=e.__lexicalClassNameCache,n=r[t];if(n!==void 0)return n;const i=e[t];if(typeof i=="string"){const o=Js(i);return r[t]=o,o}return i}function rS(e,t,r,n,i){if(r.size===0)return;const o=n.__type,s=n.__key,a=t.get(o);a===void 0&&Z(33,o);const l=a.klass;let u=e.get(l);u===void 0&&(u=new Map,e.set(l,u));const d=u.get(s),f=d==="destroyed"&&i==="created";(d===void 0||f)&&u.set(s,f?"updated":i)}function FC(e,t,r){const n=e.getParent();let i=r,o=e;return n!==null&&(r===0&&(i=o.getIndexWithinParent(),o=n)),o.getChildAtIndex(i-1)}function kQ(e,t){const r=e.offset;if(e.type==="element")return FC(e.getNode(),t,r);{const n=e.getNode();if(r===0||!t){const i=n.getPreviousSibling();return i===null?FC(n.getParentOrThrow(),t,n.getIndexWithinParent()+0):i}}return null}function UP(e){const t=mi(e).event,r=t&&t.inputType;return r==="insertFromPaste"||r==="insertFromPasteAsQuotation"}function xe(e,t,r){return CP(e,t,r,e)}function Kc(e,t){const r=e._keyToDOMMap.get(t);return r===void 0&&Z(75,t),r}function ku(e){const t=e.assignedSlot||e.parentElement;if(t!==null)return t;const r=e.parentNode;return ra(r)?r.host:null}function nS(e){return wu(e)?e:tt(e)?e.ownerDocument:null}function du(e){on(),Dt()._updateTags.add(e)}function CQ(e){on(),Dt()._deferred.push(e)}function Hc(e,t){let r=e.getParent();for(;r!==null;){if(r.is(t))return!0;r=r.getParent()}return!1}function iS(e){const t=nS(e);return t?t.defaultView:null}function mi(e){const t=e._window;return t===null&&Z(78),t}function RQ(e){return U(e)&&e.isInline()||ct(e)&&e.isInline()}function BP(e){let t=e.getLatest();for(;t!==null;){if(An(t)!==null&&U(t))return t;const r=t.getParentOrThrow();if(Zt(r))return r;t=r}return t}function Ac(e){return U(e)&&e.isShadowRoot()}function Zt(e){return Er(e)||Ac(e)}function Pn(e,t=!1){const r=e.constructor.clone(e);return FP(r,null),r.afterCloneFrom(e),t||r.resetOnCopyNodeFrom(e),r}function Vo(e){const t=Dt(),r=e.getType(),n=Yx(t,r);n===void 0&&Z(200,e.constructor.name,r);const{replace:i,replaceWithKlass:o}=n;if(i!==null){const s=i(e),a=s.constructor;return o!==null?s instanceof o||Z(201,o.name,o.getType(),a.name,a.getType(),e.constructor.name,r):s instanceof e.constructor&&a!==e.constructor||Z(202,a.name,a.getType(),e.constructor.name,r),s.__key===e.__key&&Z(203,e.constructor.name,r,a.name,a.getType()),s}return e}function o_(e,t){!Er(e.getParent())||U(t)||ct(t)||Z(99)}function AQ(e){const t=Qt(e);return t===null&&Z(63,e),t}function D0(e){if(!e||e.isInline())return!1;if(ct(e))return!0;if(U(e)){if(e.isShadowRoot()){const t=e.getParent();return!(U(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function _g(e,t,r){r.style.removeProperty("caret-color"),t._blockCursorElement=null;const n=e.parentElement;n!==null&&n.removeChild(e)}function Yn(e){return qo?(e||window).getSelection():null}function TQ(e){const t=iS(e);return t?t.getSelection():null}function ra(e){return Uy(e)&&"host"in e}const $Q=[];function jP(e){const t=e.getRootNode();if(t===e||!ra(t))return $Q;const r=[t];let n=t.host;for(;;){const i=n.getRootNode();if(i===n||!ra(i))break;r.push(i),n=i.host}return r}function*qP(e){const t=[e];let r;for(;r=t.pop();){yield*r.querySelectorAll('[data-lexical-editor="true"]');const n=(wu(r)?r:r.ownerDocument).createTreeWalker(r,NodeFilter.SHOW_ELEMENT);let i;for(;i=n.nextNode();)i.shadowRoot&&t.push(i.shadowRoot)}}function VP(e){return e!==null?e.ownerDocument:document}function Yt(){const e=wP();return VP(e!==null?e._rootElement:null)}function km(e,t){if(t===null||typeof e.getComposedRanges!="function")return null;const r=jP(t);if(r.length===0)return null;const n=e.getComposedRanges;try{const i=n.call(e,{shadowRoots:r})[0];if(i!==void 0)return i}catch{}try{const i=n.apply(e,r)[0];if(i!==void 0)return i}catch{}return null}function NQ(e,t){const r=km(e,t);if(r!==null){const n=DQ(r);if(n!==null)return n}return e.rangeCount>0?e.getRangeAt(0):null}function oo(e,t){const r=km(e,t);return r===null?e:FQ(r,IQ(e))}function DQ(e){const t=e.startContainer.ownerDocument;if(t===null)return null;const r=t.createRange();try{return r.setStart(e.startContainer,e.startOffset),r.setEnd(e.endContainer,e.endOffset),r}catch{return null}}function FQ(e,t){const{startContainer:r,startOffset:n,endContainer:i,endOffset:o}=e;return t==="backward"?{anchorNode:i,anchorOffset:o,direction:t,focusNode:r,focusOffset:n}:{anchorNode:r,anchorOffset:n,direction:t,focusNode:i,focusOffset:o}}function IQ(e){return e.direction}function zy(e){const t=e.getRootNode();return wu(t)||ra(t)?t.activeElement:null}function ah(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){const r=t.shadowRoot.activeElement;if(r===null)break;t=r}return t}function KP(e){const t=e.target;if(t!==null&&tt(t)&&t.shadowRoot!==null&&typeof e.composedPath=="function"){const r=e.composedPath();if(r.length>0)return r[0]}return t}function HP(e){return tt(e)&&e.tagName==="A"}function tt(e){return _d(e)&&e.nodeType===1}function _d(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function Uy(e){return _d(e)&&e.nodeType===11}const PQ=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function bg(e){return!(!tt(e)||!e.style.display.startsWith("inline"))||PQ.test(e.nodeName)}const OQ=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function Wc(e){return(!tt(e)||!e.style.display.startsWith("inline"))&&OQ.test(e.nodeName)}function kn(e){if(ct(e)&&!e.isInline())return!0;if(!U(e)||Zt(e))return!1;const t=e.getFirstChild(),r=t===null||Qn(t)||ne(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&r}function gr(){return Dt()}function Cm(e=gr()){return e._config.dom||mg}function so(e,t,r=gr()){const n=Cm(r).$getDOMSlot(e,t,r);return U(e)&&(MQ(n)||Z(344,e.getKey(),e.getType())),n}function MQ(e){return e instanceof yc}function Ha(e,t,r=gr()){return SQ(so(e,t,r).element)}const IC=new WeakMap,LQ=new Map;function PC(e){if(!e._readOnly&&e.isEmpty())return LQ;e._readOnly||Z(192);let t=IC.get(e);return t||(t=(function(r){const n=new Map;for(const[i,o]of r._nodeMap){const s=o.__type;let a=n.get(s);a||(a=new Map,n.set(s,a)),a.set(i,o)}return n})(e),IC.set(e,t)),t}function WP(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function zQ(e){return(t=WP(e))[tP]=!0,t;var t}function Cu(e,t){const r=e.getAttribute("data-lexical-indent");if(r!==null){const o=parseInt(r,10);if(Number.isFinite(o)&&o>=0)return void t.setIndent(o)}const n=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(n/40);t.setIndent(i)}function ho(e,t){const r=t.getAttribute("dir");return r==="ltr"||r==="rtl"?e.setDirection(r):e}function ws(e,t){const r=t.style.textAlign;return r&&r in rg?e.setFormat(r):e}function UQ(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function GP(e){return e.__lexicalUnmanaged===!0}function BQ(e,t=gr()){const r=t.isEditable();e.contentEditable=r?"true":"false",r?e.__lexicalEditor=t:delete e.__lexicalEditor}function yg(e,t){let r=e;for(;r!=null;){if(r.__lexicalCapturedSelection===!0)return!0;if(tt(r)&&r.hasAttribute("data-lexical-slot")||vd(r,t)!==void 0)return!1;r=ku(r)}return!1}function Vd(e,t){return(function(r,n){return Object.prototype.hasOwnProperty.call(r,n)})(e,t)&&e[t]!==Ni[t]}const OC=new WeakMap;function oS(e){const t=OC.get(e);if(t)return t;const r=e.prototype!=null&&Pk in e.prototype?e.prototype[Pk]():void 0,n=(function(l){if(!(l===Ni||l.prototype instanceof Ni)){let u="<unknown>",d="<unknown>";try{u=l.getType()}catch{}try{Vc.version&&(d=JSON.parse(Vc.version))}catch{}Z(290,l.name,u,d)}return l===Hx||l===fi||l===Ni})(e),i=!n&&Vd(e,"getType")?e.getType():void 0;let o,s=i;if(r)if(i)o=r[i];else{for(const[l,u]of Object.entries(r))s=l,o=u;if(!o)for(const l of Object.getOwnPropertySymbols(r)){const u=r[l];if(u){o=u;break}}}if(!n&&s&&(Vd(e,"getType")||(e.getType=()=>s),Vd(e,"clone")||(e.clone=l=>(Qx(l),new e)),Vd(e,"importJSON")||(e.importJSON=o&&o.$importJSON||(l=>new e().updateFromJSON(l))),!Vd(e,"importDOM")&&o)){const{importDOM:l}=o;l&&(e.importDOM=()=>l)}const a={klass:e,ownNodeConfig:o,ownNodeType:s};return OC.set(e,a),a}function*sS(e){for(let t=e;t&&(t===Ni||rP(t.prototype));){const r=oS(t);yield r,t=r.ownNodeConfig&&r.ownNodeConfig.extends||QP(t)}}function JP(e){const t=gr();return on(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}const Kt=(e,t)=>{let r=e;for(;r!=null&&!Er(r);){if(t(r))return r;r=r.getParent()}return null};function xg(e,t){const r=[];let n=e.__first;for(;n!==null;){const i=t===null?Qt(n):t.get(n);i==null&&Z(174),r.push(n),n=i.__next}return r}function QP(e){const t=Object.getPrototypeOf(e);if(typeof t=="function"&&t!==Function.prototype)return t;const r=e.prototype&&Object.getPrototypeOf(e.prototype);return r?r.constructor:null}const YP=new Map;function Gs(e){return U(e)||ct(e)}function fu(e){return U(e)||ct(e)}function An(e){const t=e.getLatest();return fu(t)?t.__slotHost:null}function To(e){const t=An(e);if(t===null)return null;const r=Qt(t);return U(r)||ct(r)||Z(370),r}function jQ(e){const t=To(e);if(t===null)return null;const r=e.getLatest().__key;for(const[n,i]of Am(t))if(i===r)return n;return null}function Rm(e){let t=e.getLatest();for(;t!==null;){if(An(t)!==null)return t;t=t.getParent()}return null}function Am(e){const t=e.getLatest();return Gs(t)&&t.__slots!==null?t.__slots:YP}function Zi(e){return Array.from(Am(e).keys())}function hu(e,t){const r=Am(e).get(t);return r===void 0?null:Qt(r)}const qQ=["__proto__","constructor","prototype"],MC=Symbol("slotMapOwner");function By(e){let t=e.__slots;return t!==null&&t[MC]===e||(t=new Map(t),t[MC]=e,e.__slots=t),t}const LC=new WeakMap,VQ=[];function KQ(e){for(const{ownNodeConfig:t}of sS(e)){const r=t&&t.slots;if(r)return r}return VQ}function XP(e){let t="";for(const r of Zi(e)){const n=hu(e,r);n!==null&&(t+=n.getTextContent())}return t}function zC(e,t,r){const n=r.get(e),i=r.get(t);return n!==void 0?i!==void 0?n-i:-1:i!==void 0?1:e<t?-1:e>t?1:0}function HQ(e){const t=e.__slots;if(t===null||t.size<2)return;const r=(function(s){let a=LC.get(s);if(a===void 0){const l=KQ(s),u=new Map;for(const d of l)qQ.includes(d)&&Z(371,s.name,d),u.has(d)&&Z(372,s.name,d),u.set(d,u.size);a=u,LC.set(s,a)}return a})(e.constructor);let n=null,i=!0;for(const s of t.keys()){if(n!==null&&zC(n,s,r)>0){i=!1;break}n=s}if(i)return;const o=Array.from(t).sort(([s],[a])=>zC(s,a,r));t.clear();for(const[s,a]of o)t.set(s,a)}function ZP(e,t,r){t!=="__proto__"&&t!=="constructor"&&t!=="prototype"||Z(373,t);const n=e.getLatest();if(n.__slots!==null&&n.__slots.get(t)===r.getLatest().__key)return n;(!U(r)&&!ct(r)||r.isInline())&&Z(374,r.__key);const i=e.getWritable(),o=By(i),s=o.get(t);s!==void 0&&eO(s);const a=r.getWritable(),l=To(a);if(l!==null){const u=jQ(a);u!==null&&By(l.getWritable()).delete(u),a.__slotHost=null}return Ks(a),a.__slotHost=i.__key,o.set(t,a.__key),HQ(i),(function(){const u=gr();u._slotsUsed=!0,u._pendingEditorState&&(u._pendingEditorState._slotsUsed=!0)})(),i}function WQ(e,t){const r=e.getWritable();if(r.__slots===null)return r;const n=r.__slots.get(t);return n!==void 0&&(eO(n),By(r).delete(t)),r}function eO(e){const t=Qt(e);if(t===null)return;const r=t.getWritable();fu(r)||Z(377,e),r.__slotHost=null,r.remove()}const GQ={next:"previous",previous:"next"};class aS{origin;constructor(t){this.origin=t}[Symbol.iterator](){return tO({hasNext:tl,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return Nt(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Nt(this.origin,this.direction)}remove(){const t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,r){const n=this.getNodeAtCaret();return t.is(this.origin)||t.is(n)||(n===null?this.insert(t):n.replace(t,r)),this}splice(t,r,n="next"){const i=n===this.direction?r:Array.from(r).reverse();let o=this;const s=this.getParentAtCaret(),a=new Map;for(let l=o.getAdjacentCaret();l!==null&&a.size<t;l=l.getAdjacentCaret()){const u=l.origin.getWritable();a.set(u.getKey(),u)}for(const l of i){if(a.size>0){const u=o.getNodeAtCaret();if(u){if(a.delete(u.getKey()),a.delete(l.getKey()),!(u.is(l)||o.origin.is(l))){const d=l.getParent();d&&d.is(s)&&l.remove(),u.replace(l)}}else u===null&&Z(263,Array.from(a).join(" "))}else o.insert(l);o=Nt(l,this.direction)}for(const l of a.values())l.remove();return this}}class lh extends aS{type="child";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:ao(t,this.direction)}getParentCaret(t="root"){return Nt(lS(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=gl(this.direction);return Nt(this.getNodeAtCaret(),t)||ao(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof lh&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}}const JQ={root:Er,shadowRoot:Zt};function gl(e){return GQ[e]}function lS(e,t="root"){return e===null||JQ[t](e)?null:An(e)===null?e:null}class pu extends aS{type="sibling";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Nt(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return U(this.origin)?ao(this.origin,this.direction):null}getParentCaret(t="root"){return Nt(lS(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=gl(this.direction);return Nt(this.getNodeAtCaret(),t)||ao(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof pu&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof pu||t instanceof gu)&&this.direction===t.direction&&this.origin.is(t.origin)}}class gu extends aS{type="text";offset;constructor(t,r){super(t),this.offset=r}getLatest(){const t=this.origin.getLatest();return t===this.origin?this:rl(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return Nt(lS(this.getParentAtCaret(),t),this.direction)}getFlipped(){return rl(this.origin,gl(this.direction),this.offset)}isSamePointCaret(t){return t instanceof gu&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof pu||t instanceof gu)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Nt(this.origin,this.direction)}}function eo(e){return e instanceof gu}function tl(e){return e instanceof pu}function to(e){return e instanceof lh}const QQ={next:class extends gu{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends gu{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},YQ={next:class extends pu{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends pu{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},XQ={next:class extends lh{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends lh{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Nt(e,t){return e?new YQ[t](e):null}function rl(e,t,r){return e?new QQ[t](e,fs(e,r)):null}function fs(e,t,r="error"){const n=e.getTextContentSize();let i=t==="next"?n:t==="previous"?0:t;return(i<0||i>n)&&(r!=="clamp"&&aI(284,String(t),String(n),e.getKey()),i=i<0?0:n),i}function UC(e,t){return new eY(e,t)}function ao(e,t){return U(e)?new XQ[t](e):null}function ZQ(e){return e&&e.getChildCaret()||e}function uS(e){return e&&ZQ(e.getAdjacentCaret())}class cS{type="node-caret-range";direction;anchor;focus;constructor(t,r,n){this.anchor=t,this.focus=r,this.direction=n}getLatest(){const t=this.anchor.getLatest(),r=this.focus.getLatest();return t===this.anchor&&r===this.focus?this:new cS(t,r,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t=i=>{const o=this[i].getLatest();return eo(o)?(function(s,a){const{direction:l,origin:u}=s,d=fs(u,a==="focus"?gl(l):l);return UC(s,d-s.offset)})(o,i):null},r=t("anchor"),n=t("focus");if(r&&n){const{caret:i}=r,{caret:o}=n;if(i.isSameNodeCaret(o))return[UC(i,o.offset-i.offset),null]}return[r,n]}iterNodeCarets(t="root"){const r=eo(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),i=eo(n),o=s=>s.isSameNodeCaret(n)?null:uS(s)||s.getParentCaret(t);return tO({hasNext:s=>s!==null&&!(i&&n.isSameNodeCaret(s)),initial:r.isSameNodeCaret(n)?null:o(r),map:s=>s,step:o})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class eY{type="slice";caret;distance;constructor(t,r){this.caret=t,this.distance=r}getSliceIndices(){const{distance:t,caret:{offset:r}}=this,n=r+t;return n<r?[n,r]:[r,n]}getTextContent(){const[t,r]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,r)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:t,direction:r}}=this,[n,i]=this.getSliceIndices(),o=t.getTextContent();return rl(t.setTextContent(o.slice(0,n)+o.slice(i)),r,n)}}function Tm(e){return Do(e,Nt(Kr(),e.direction))}function $m(e){return Do(e,e)}function Do(e,t){return e.direction!==t.direction&&Z(265),new cS(e,t,e.direction)}function tO(e){const{initial:t,hasNext:r,step:n,map:i}=e;let o=t;return{[Symbol.iterator](){return this},next(){if(!r(o))return{done:!0,value:void 0};const s={done:!1,value:i(o)};return o=n(o),s}}}function uh(e,t){const r=jy(e.origin,t.origin);switch(r===null&&Z(275,e.origin.getKey(),t.origin.getKey()),r.type){case"same":{const n=e.type==="text",i=t.type==="text";return n&&i?(function(o,s){return Math.sign(o-s)})(e.offset,t.offset):e.type===t.type?0:n?-1:i?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return rO(r)}}function rO(e){const{a:t,b:r}=e,n=t.__key,i=r.__key;let o=t,s=r;for(;o&&s;o=o.getNextSibling(),s=s.getNextSibling()){if(o.__key===i)return-1;if(s.__key===n)return 1}return o===null?1:-1}function Ap(e,t){return t.is(e)}function BC(e){return U(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function jy(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const r=new Map;for(let[n,i]=BC(e);n;i=n,n=n.getParent())r.set(n,i);for(let[n,i]=BC(t);n;i=n,n=n.getParent()){const o=r.get(n);if(o!==void 0)return o===null?(Ap(e,n)||Z(276),{commonAncestor:n,type:"ancestor"}):i===null?(Ap(t,n)||Z(277),{commonAncestor:n,type:"descendant"}):((U(o)||Ap(e,o))&&(U(i)||Ap(t,i))&&n.is(o.getParent())&&n.is(i.getParent())||Z(278),{a:o,b:i,commonAncestor:n,type:"branch"})}return null}function ui(e,t){const{type:r,key:n,offset:i}=e,o=AQ(e.key);return r==="text"?(ne(o)||Z(266,o.getType(),n),rl(o,t,i)):(U(o)||Z(267,o.getType(),n),Vy(o,e.offset,t))}function mu(e,t){const{origin:r,direction:n}=t,i=n==="next";eo(t)?e.set(r.getKey(),t.offset,"text"):tl(t)?ne(r)?e.set(r.getKey(),fs(r,n),"text"):e.set(r.getParentOrThrow().getKey(),r.getIndexWithinParent()+(i?1:0),"element"):(to(t)&&U(r)||Z(268),e.set(r.getKey(),i?0:r.getChildrenSize(),"element"))}function ch(e){const t=de(),r=te(t)?t:Vx();return F0(r,e),gn(r),r}function F0(e,t){mu(e.anchor,t.anchor),mu(e.focus,t.focus)}function qy(e){const{anchor:t,focus:r}=e,n=ui(t,"next"),i=ui(r,"next"),o=uh(n,i)<=0?"next":"previous";return Do(na(n,o),na(i,o))}function Ru(e){const{direction:t,origin:r}=e,n=Nt(r,gl(t)).getNodeAtCaret();return n?Nt(n,t):ao(r.getParentOrThrow(),t)}function jC(e,t="root"){const r=[e];for(let n=to(e)?e.getParentCaret(t):e.getSiblingCaret();n!==null;n=n.getParentCaret(t))r.push(Ru(n));return r}function s_(e){return!!e&&e.origin.isAttached()}function tY(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const r="root",n="next";let i=t;const o=fS(e,n),s=jC(o.anchor,r),a=jC(o.focus.getFlipped(),r),l=new Set,u=[];for(const g of o.iterNodeCarets(r))if(to(g))l.add(g.origin.getKey());else if(tl(g)){const{origin:m}=g;U(m)&&!l.has(m.getKey())||u.push(m)}for(const g of u)g.remove();for(const g of o.getTextSlices()){if(!g)continue;const{origin:m}=g.caret,v=m.getTextContentSize(),_=Ru(Nt(m,n)),x=m.getMode();if(Math.abs(g.distance)===v&&i==="removeEmptySlices"||x==="token"&&g.distance!==0)_.remove();else if(g.distance!==0){i="removeEmptySlices";let w=g.removeTextSlice();const S=g.caret.origin;if(x==="segmented"){const k=w.origin,A=Sr(k.getTextContent()).setStyle(k.getStyle()).setFormat(k.getFormat());_.replaceOrInsert(A),w=rl(A,n,w.offset)}S.is(s[0].origin)&&(s[0]=w),S.is(a[0].origin)&&(a[0]=w.getFlipped())}}let d,f;for(const g of s)if(s_(g)){d=Ri(g);break}for(const g of a)if(s_(g)){f=Ri(g);break}const h=(function(g,m,v){if(!g||!m)return null;const _=g.getParentAtCaret(),x=m.getParentAtCaret();if(!_||!x)return null;const w=_.getParents().reverse();w.push(_);const S=x.getParents().reverse();S.push(x);const k=Math.min(w.length,S.length);let A;for(A=0;A<k&&w[A]===S[A];A++);const C=(I,P)=>{let z;for(let q=A;q<I.length;q++){const H=I[q];if(Zt(H))return;!z&&P(H)&&(z=H)}return z},R=C(w,kn),N=R&&C(S,I=>v.has(I.getKey())&&kn(I));return N&&Zi(N).length>0?null:R&&N?[R,N]:null})(d,f,l);if(h){const[g,m]=h;ao(g,"previous").splice(0,m.getChildren());let v=m.getParent();for(m.remove(!0);v&&v.isEmpty();){const _=v;v=v.getParent(),_.remove(!0)}}else if(f){const g=(function(_){if(to(_)){const x=_.origin;if(kn(x))return x}else{const x=_.getParentAtCaret();if(x&&kn(x))return x}return null})(f),m=g&&g.getParent(),v=g&&g.getParents().findLast(Ac);if(g&&m&&!Er(m)&&g.isEmpty()&&l.has(g.getKey())&&Zi(g).length===0&&(!v||l.has(v.getKey()))){g.remove(!0);let _=m;for(;_&&!Er(_)&&_.isEmpty();){const x=_.getParent();if(x&&Er(x)&&x.getChildrenSize()<=1)break;const w=_;_=x,w.remove(!0)}}}const p=[d,f,...s,...a].find(s_);if(p)return $m(na(Ri(p),e.direction));Z(269,JSON.stringify(s.map(g=>g.origin.__key)))}function Ri(e){const t=(function(i){let o=i;for(;to(o);){const s=uS(o);if(!to(s))break;o=s}return o})(e.getLatest()),{direction:r}=t;if(ne(t.origin))return eo(t)?t:rl(t.origin,r,r);const n=t.getAdjacentCaret();return tl(n)&&ne(n.origin)?rl(n.origin,r,gl(r)):t}function dS(e){return eo(e)&&e.offset!==fs(e.origin,e.direction)}function na(e,t){return e.direction===t?e:e.getFlipped()}function fS(e,t){return e.direction===t?e:Do(na(e.focus,t),na(e.anchor,t))}function Vy(e,t,r){let n=ao(e,"next");for(let i=0;i<t;i++){const o=n.getAdjacentCaret();if(o===null)break;n=o}return na(n,r)}function rY(e){const{origin:t,offset:r,direction:n}=e;if(r===fs(t,n))return e.getSiblingCaret();if(r===fs(t,gl(n)))return Ru(e.getSiblingCaret());const[i]=t.splitText(r);return ne(i)||Z(281),na(Nt(i,"next"),n)}function nY(e,t){return!0}function nO(e,{$copyElementNode:t=Pn,$splitTextPointCaretNext:r=rY,rootMode:n="shadowRoot",$shouldSplit:i=nY,removeEmptyDestination:o=!1}={}){if(eo(e))return r(e);const s=e.getParentCaret(n);if(s){const{origin:a}=s;if(to(e)){const u=Ru(s);if(o&&a.isEmpty())return a.remove(),u;if(!a.canBeEmpty()||!i(a,"first"))return u}const l=(function(u){const d=[];for(let f=u.getAdjacentCaret();f;f=f.getAdjacentCaret())d.push(f.origin);return d})(e);(l.length>0||!o&&a.canBeEmpty()&&i(a,"last"))&&s.insert(t(a).splice(0,0,l))}return s}function iO(e,t,r){let n=na(t,"next");eo(n)&&(n.offset===0?n=Nt(n.origin,"previous").getFlipped():n.offset===n.origin.getTextContentSize()&&(n=Nt(n.origin,"next"))),n.origin.is(e)&&(tl(n)||Z(342,e.getKey(),e.getType()),n=Ru(n)),(e.is(n.getNodeAtCaret())||e.is(n.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let i=n;i;i=nO(i,r))n=i;return eo(n)&&Z(283),n.insert(e.isInline()?Pt().append(e):e),na(Nt(e.getLatest(),"next"),t.direction)}function hS(e,t){if(!t||e===t)return e;for(const r in t)if(e[r]!==t[r])return{...e,...t};return e}function Js(...e){const t=[];for(const r of e)if(r&&typeof r=="string")for(const[n]of r.matchAll(/\S+/g))t.push(n);return t}function bs(e,...t){const r=Js(...t);r.length>0&&e.classList.add(...r)}function pS(e,...t){const r=Js(...t);r.length>0&&e.classList.remove(...r)}function nl(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function oO(e){const t=gr().getElementByKey(e.getKey());if(t===null)return null;const r=t.ownerDocument.defaultView;return r===null?null:r.getComputedStyle(t)}function sO(e){return oO(Er(e)?e:e.getParentOrThrow())}function Tp(e){const t=sO(e);return t!==null&&t.direction==="rtl"}function aO(e,t,r="self"){const n=e.getStartEndPoints();if(t.isSelected(e)&&!Ci(t)&&n!==null){const[i,o]=n,s=e.isBackward(),a=i.getNode(),l=o.getNode(),u=t.is(a),d=t.is(l);if(u||d){const[f,h]=Iy(e),p=a.is(l),g=t.is(s?l:a),m=t.is(s?a:l);let v,_=0;p?(_=f>h?h:f,v=f>h?f:h):g?(_=s?h:f,v=void 0):m&&(_=0,v=s?f:h);const x=t.__text.slice(_,v);x!==t.__text&&(r==="clone"&&(t=zQ(t)),t.__text=x)}}return t}function iY(e,t){const r=e.getFormatType(),n=e.getIndent();r!==t.getFormatType()&&t.setFormat(r),n!==t.getIndent()&&t.setIndent(n)}function oY(e,t,r){let n=ui(e,r);if(dS(n))return!1;for(;n;n=n.getParentCaret()){const i=n.getParentAtCaret();if(!i||n.getNodeAtCaret())return!1;if(t.is(i))return!0}return!1}function sY(e,t,r=iY){if(!e)return;const n=e.getStartEndPoints();let i=!1,o=null;const s=new Map;if(n){const[a,l]=n,u=Kt(a.getNode(),kn);o=Kt(l.getNode(),kn);const d=e.isBackward()?"previous":"next";i=U(o)&&!o.is(u)&&(function(f,h,p){const g=f.getNode();return(!U(g)||!g.isEmpty())&&oY(f,h,p)})(l,o,gl(d)),U(u)&&s.set(u.getKey(),u),U(o)&&!i&&s.set(o.getKey(),o)}for(const a of e.getNodes())if(U(a)&&kn(a)){if(i&&a.is(o))continue;s.set(a.getKey(),a)}else if(!n){const l=Kt(a,kn);U(l)&&s.set(l.getKey(),l)}for(const a of s.values()){const l=t();r(a,l),a.replace(l,!0)}}function lO(e){const t=uO(e);return t!==null&&t.writingMode==="vertical-rl"}function uO(e){const t=e.anchor.getNode();return U(t)?oO(t):sO(t)}function qC(e,t){let r=lO(e)?!t:t;cO(e)&&(r=!r);const n=ui(e.focus,r?"previous":"next");if(dS(n))return!1;if(eo(n)&&!lu(n.origin)&&n.origin.isUnmergeable()){const i=n.getNodeAtCaret();if(ne(i)&&!lu(i))return!0}for(const i of Tm(n)){if(to(i))return!i.origin.isInline();if(!U(i.origin)){if(ct(i.origin))return!0;break}}return!1}function aY(e,t,r,n){e.modify(t?"extend":"move",r,n)}function cO(e){const t=uO(e);return t!==null&&t.direction==="rtl"}function VC(e,t,r){const n=cO(e);let i;i=lO(e)||n?!r:r,aY(e,t,i,"character")}function lY(e,...t){const r=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",e);for(const i of t)n.append("v",i);throw r.search=n.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function uY(e,t){let r=e;for(;r!=null;){if(r instanceof t)return r;r=r.getParent()}return null}function cY(e){const t=Kt(e,r=>U(r)&&!r.isInline());return U(t)||lY(4,e.__key),t}function Ma(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function $p(e){let t=null;if(Ma(e,DragEvent)?t=e.dataTransfer:Ma(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];const r=t.types,n=r.includes("Files"),i=r.includes("text/html")||r.includes("text/plain");return[n,Array.from(t.files),i]}function KC(e){const t=de();if(!te(t))return!1;const r=new Set,n=t.getNodes();for(let i=0;i<n.length;i++){const o=n[i],s=o.getKey();if(r.has(s))continue;const a=Kt(o,u=>U(u)&&!u.isInline());if(a===null)continue;const l=a.getKey();a.canIndent()&&!r.has(l)&&(r.add(l),e(a))}return r.size>0}const dY=Symbol.for("preact-signals");function gS(){if(Gl>1)return void Gl--;let e,t=!1;for(!(function(){let r=Sg;for(Sg=void 0;r!==void 0;)r.S.v===r.v&&(r.S.i=r.i),r=r.o})();wf!==void 0;){let r=wf;for(wf=void 0,Eg++;r!==void 0;){const n=r.u;if(r.u=void 0,r.f&=-3,!(8&r.f)&&dO(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(Eg=0,Gl--,t)throw e}let Mt,wf;function HC(e){const t=Mt;Mt=void 0;try{return e()}finally{Mt=t}}let Sg,Gl=0,Eg=0,WC=0,I0=0;function GC(e){if(Mt===void 0)return;let t=e.n;return t===void 0||t.t!==Mt?(t={i:0,S:e,p:Mt.s,n:void 0,t:Mt,e:void 0,x:void 0,r:t},Mt.s!==void 0&&(Mt.s.n=t),Mt.s=t,e.n=t,32&Mt.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Mt.s,t.n=void 0,Mt.s.n=t,Mt.s=t),t):void 0}function qn(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function fY(e,t){return new qn(e,t)}function dO(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function JC(e){for(let t=e.s;t!==void 0;t=t.n){const r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function fO(e){let t,r=e.s;for(;r!==void 0;){const n=r.p;r.i===-1?(r.S.U(r),n!==void 0&&(n.n=r.n),r.n!==void 0&&(r.n.p=n)):t=r,r.S.n=r.r,r.r!==void 0&&(r.r=void 0),r=n}e.s=t}function Ku(e,t){qn.call(this,void 0),this.x=e,this.s=void 0,this.g=I0-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function hO(e){const t=e.m;if(e.m=void 0,typeof t=="function"){Gl++;const r=Mt;Mt=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,mS(e),n}finally{Mt=r,gS()}}}function mS(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,hO(e)}function hY(e){if(Mt!==this)throw new Error("Out-of-order effect");fO(this),Mt=e,this.f&=-2,8&this.f&&mS(this),gS()}function ic(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name}function pY(e,t){const r=new ic(e,t);try{r.c()}catch(i){throw r.d(),i}const n=r.d.bind(r);return n[Symbol.dispose]=n,n}qn.prototype.brand=dY,qn.prototype.h=function(){return!0},qn.prototype.S=function(e){const t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:HC(()=>{var r;(r=this.W)==null||r.call(this)}))},qn.prototype.U=function(e){if(this.t!==void 0){const t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&HC(()=>{var n;(n=this.Z)==null||n.call(this)}))}},qn.prototype.subscribe=function(e){return pY(()=>{const t=this.value,r=Mt;Mt=void 0;try{e(t)}finally{Mt=r}},{name:"sub"})},qn.prototype.valueOf=function(){return this.value},qn.prototype.toString=function(){return this.value+""},qn.prototype.toJSON=function(){return this.value},qn.prototype.peek=function(){const e=Mt;Mt=void 0;try{return this.value}finally{Mt=e}},Object.defineProperty(qn.prototype,"value",{get(){const e=GC(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(Eg>100)throw new Error("Cycle detected");(function(t){Gl!==0&&Eg===0&&t.l!==WC&&(t.l=WC,Sg={S:t,v:t.v,i:t.i,o:Sg})})(this),this.v=e,this.i++,I0++,Gl++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{gS()}}}}),Ku.prototype=new qn,Ku.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===I0))return!0;if(this.g=I0,this.f|=1,this.i>0&&!dO(this))return this.f&=-2,!0;const e=Mt;try{JC(this),Mt=this;const t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return Mt=e,fO(this),this.f&=-2,!0},Ku.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}qn.prototype.S.call(this,e)},Ku.prototype.U=function(e){if(this.t!==void 0&&(qn.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Ku.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Ku.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=GC(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),ic.prototype.c=function(){const e=this.S();try{if(8&this.f||this.x===void 0)return;const t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}},ic.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,hO(this),JC(this),Gl++;const e=Mt;return Mt=this,hY.bind(this,e)},ic.prototype.N=function(){2&this.f||(this.f|=2,this.u=wf,wf=this)},ic.prototype.d=function(){this.f|=8,1&this.f||mS(this)},ic.prototype.dispose=function(){this.d()};function gY(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}function Jt(e,...t){const r=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",e);for(const i of t)n.append("v",i);throw r.search=n.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let pO;try{pO="0.48.0+prod.esm"}catch{}const mY=pO??'"<unknown>+source"',vY=new Set(["__proto__","constructor","prototype"]);function gO(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){const r=e,n=t;for(const i in n)!vY.has(i)&&Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=gO(r[i],n[i]));return e}return t}const vS=0,Ky=1,mO=2,a_=3,Np=4,Hu=5,l_=6,Kd=7;function u_(e){return e.id===vS}function vO(e){return e.id===mO}function _Y(e){return(function(t){return t.id===Ky})(e)||Jt(305,String(e.id),String(Ky)),Object.assign(e,{id:mO})}const bY=new Set;let yY=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,r){this.builder=t,this.extension=r,this.configs=new Set,this.state={id:vS}}mergeConfigs(){let t=this.extension.config||{};const r=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):hS;for(const n of this.configs)t=r(t,n);return t}init(t){const r=this.state;vO(r)||Jt(306,String(r.id));const n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},i={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},o=(function(a,l,u){return Object.assign(a,{config:l,id:a_,registerState:u})})(r,this.mergeConfigs(),n);let s;this.state=o,this.extension.init&&(s=this.extension.init(t,o.config,n)),this.state=(function(a,l,u){return Object.assign(a,{id:Np,initResult:l,registerState:u})})(o,s,i)}build(t){const r=this.state;let n;r.id!==Np&&Jt(307,String(r.id),String(Hu)),this.extension.build&&(n=this.extension.build(t,r.config,r.registerState));const i={...r.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=(function(o,s,a){return Object.assign(o,{id:Hu,output:s,registerState:a})})(r,n,i)}register(t,r){this._signal=r;const n=this.state;n.id!==Hu&&Jt(308,String(n.id),String(Hu));const i=this.extension.register&&this.extension.register(t,n.config,n.registerState);return this.state=(function(o){return Object.assign(o,{id:l_})})(n),()=>{const o=this.state;o.id!==Kd&&Jt(309,String(n.id),String(Kd)),this.state=(function(s){return Object.assign(s,{id:Hu})})(o),i&&i()}}afterRegistration(t){const r=this.state;let n;return r.id!==l_&&Jt(310,String(r.id),String(l_)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(t,r.config,r.registerState)),this.state=(function(i){return Object.assign(i,{id:Kd})})(r),n}getSignal(){return this._signal===void 0&&Jt(311),this._signal}getInitResult(){this.extension.init===void 0&&Jt(312,this.extension.name);const t=this.state;return(function(r){return r.id>=Np})(t)||Jt(313,String(t.id),String(Np)),t.initResult}getInitPeer(t){const r=this.builder.extensionNameMap.get(t);return r?r.getExtensionInitDependency():void 0}getExtensionInitDependency(){const t=this.state;return(function(r){return r.id>=a_})(t)||Jt(314,String(t.id),String(a_)),{config:t.config}}getPeer(t){const r=this.builder.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}getInitDependency(t){const r=this.builder.getExtensionRep(t);return r===void 0&&Jt(315,this.extension.name,t.name),r.getExtensionInitDependency()}getDependency(t){const r=this.builder.getExtensionRep(t);return r===void 0&&Jt(315,this.extension.name,t.name),r.getExtensionDependency()}getState(){const t=this.state;return(function(r){return r.id>=Kd})(t)||Jt(316,String(t.id),String(Kd)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||bY}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([r])=>r)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){const t=this.state;(function(r){return r.id>=Hu})(t)||Jt(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}};const QC={tag:Sf};function xY(){const e=Kr();e.isEmpty()&&e.append(Pt())}const SY={config:{setOptions:QC,updateOptions:QC},init:({$initialEditorState:e=xY})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:r},n){const i=n.getInitResult();if(!i.initialized){i.initialized=!0;const{$initialEditorState:o}=i;if(fQ(o))e.setEditorState(o,r);else if(typeof o=="function")e.update(()=>{o(e)},t);else if(o&&(typeof o=="string"||typeof o=="object")){const s=e.parseEditorState(o);e.setEditorState(s,r)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[hd,ca,pd,cd,gd]},YC=Symbol.for("@lexical/extension/LexicalBuilder");function XC(){}function EY(e){throw e}function Dp(e){return Array.isArray(e)?e:[e]}const c_=mY;class kf{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=c_,this.roots=t;for(const r of t)this.addExtension(r)}static fromExtensions(t){const r=[Dp(SY)];for(const n of t)r.push(Dp(n));return new kf(r)}static maybeFromEditor(t){const r=t[YC];return r&&(r.PACKAGE_VERSION!==c_&&Jt(292,r.PACKAGE_VERSION,c_),r instanceof kf||Jt(293)),r}static fromEditor(t){const r=kf.maybeFromEditor(t);return r===void 0&&Jt(294),r}constructEditor(){const{$initialEditorState:t,onError:r,onWarn:n,...i}=this.buildCreateEditorArgs(),o=Object.assign(Jx({...i,...r?{onError:s=>{r(s,o)}}:{},...n?{onWarn:s=>{n(s,o)}}:{}}),{[YC]:this});for(const s of this.sortedExtensionReps())s.build(o);return o}buildEditor(){let t=XC;function r(){try{t()}finally{t=XC}}const n=Object.assign(this.constructEditor(),{dispose:r,[Symbol.dispose]:r});return t=nl(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){const r=this.extensionNameMap.get(t.name);if(r)return r.extension!==t&&Jt(295,t.name),r}addEdge(t,r,n){const i=this.outgoingConfigEdges.get(t);i?i.set(r,n):this.outgoingConfigEdges.set(t,new Map([[r,n]]));const o=this.incomingEdges.get(r);o?o.add(t):this.incomingEdges.set(r,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&Jt(296);const r=Dp(t),[n]=r;typeof n.name!="string"&&Jt(297,typeof n.name);let i=this.extensionNameMap.get(n.name);if(i!==void 0&&i.extension!==n&&Jt(298,n.name),!i){i=new yY(this,n),this.extensionNameMap.set(n.name,i);const o=this.conflicts.get(n.name);typeof o=="string"&&Jt(299,n.name,o);for(const s of n.conflictsWith||[])this.extensionNameMap.has(s)&&Jt(299,n.name,s),this.conflicts.set(s,n.name);for(const s of n.dependencies||[]){const a=Dp(s);this.addEdge(n.name,a[0].name,a.slice(1)),this.addExtension(a)}for(const[s,a]of n.peerDependencies||[])this.addEdge(n.name,s,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const t=[],r=(n,i)=>{let o=n.state;if(vO(o))return;const s=n.extension.name;var a;u_(o)||Jt(300,s,i||"[unknown]"),u_(a=o)||Jt(304,String(a.id),String(vS)),o=Object.assign(a,{id:Ky}),n.state=o;const l=this.outgoingConfigEdges.get(s);if(l)for(const u of l.keys()){const d=this.extensionNameMap.get(u);d&&r(d,s)}o=_Y(o),n.state=o,t.push(n)};for(const n of this.extensionNameMap.values())u_(n.state)&&r(n);for(const n of t)for(const[i,o]of this.outgoingConfigEdges.get(n.extension.name)||[])if(o.length>0){const s=this.extensionNameMap.get(i);if(s)for(const a of o)s.configs.add(a)}for(const[n,...i]of this.roots)if(i.length>0){const o=this.extensionNameMap.get(n.name);o===void 0&&Jt(301,n.name);for(const s of i)o.configs.add(s)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){const r=this.sortedExtensionReps(),n=new AbortController,i=[()=>n.abort()],o=n.signal;for(const s of r){const a=s.register(t,o);a&&i.push(a)}for(const s of r){const a=s.afterRegistration(t);a&&i.push(a)}return nl(...i)}buildCreateEditorArgs(){const t={},r=new Set,n=new Map,i=new Map,o={},s={},a=this.sortedExtensionReps();for(const d of a){const{extension:f}=d;if(f.onError!==void 0&&(t.onError=f.onError),f.onWarn!==void 0&&(t.onWarn=f.onWarn),f.disableEvents!==void 0&&(t.disableEvents=f.disableEvents),f.parentEditor!==void 0&&(t.parentEditor=f.parentEditor),f.editable!==void 0&&(t.editable=f.editable),f.namespace!==void 0&&(t.namespace=f.namespace),f.$initialEditorState!==void 0&&(t.$initialEditorState=f.$initialEditorState),f.nodes)for(const h of gY(f)){if(typeof h!="function"){const p=n.get(h.replace);p&&Jt(302,f.name,h.replace.name,p.extension.name),n.set(h.replace,d)}r.add(h)}if(f.html){if(f.html.export)for(const[h,p]of f.html.export.entries())i.set(h,p);f.html.import&&Object.assign(o,f.html.import)}f.theme&&gO(s,f.theme)}Object.keys(s).length>0&&(t.theme=s),r.size&&(t.nodes=[...r]);const l=Object.keys(o).length>0,u=i.size>0;(l||u)&&(t.html={},l&&(t.html.import=o),u&&(t.html.export=i));for(const d of a)d.init(t);return t.onError||(t.onError=EY),t}}function qh(e,t){const r=kf.maybeFromEditor(e);if(!r)return;const n=r.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}function wY(e){return qh(gr(),e)}class Nm extends Hx{static getType(){return"horizontalrule"}static clone(t){return new Nm(t.__key)}static importJSON(t){return _S().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:kY,priority:0})}}exportDOM(){return{element:Yt().createElement("hr")}}createDOM(t){const r=Yt().createElement("hr");return bs(r,t.theme.hr),r}getTextContent(){return`
28
- `}isInline(){return!1}updateDOM(){return!1}}function kY(){return{node:_S()}}function _S(){return JP(Nm)}function bd(e,...t){const r=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",e);for(const i of t)n.append("v",i);throw r.search=n.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let Tc;function _O(e,t){const{key:r}=t;return e&&r in e?e[r]:t.defaultValue}function bO(e){return Tc&&Tc.editor===e?Tc:void 0}function CY(e,t){if("cfg"in t){const{cfg:r,updater:n}=t;return[r,n(_O(e,r))]}return t}function RY(e,t){let r=t;for(const n of e){const[i,o]=CY(r,n),s=i.key;if(r===t&&_O(r,i)===o)continue;const a=r===t||r===void 0?AY(t):r;a[s]=o,r=a}return r}function AY(e){return Object.create(e||null)}function yO(e,t){return[e,t]}function TY(e,t,r,n=gr()){const i=Tc,o=bO(n);try{return Tc={...o,editor:n,[e]:t},r()}finally{Tc=i}}function $Y(e,t=()=>{}){return(r,n=gr())=>i=>{const o=bO(n),s=o&&o[e],a=RY(r,s||t(n));return a&&a!==s?TY(e,a,i,n):i()}}function xO(e,t,r,n){return Object.assign(Lh(Symbol(t),{isEqual:n,parse:r}),{[e]:!0})}function NY(e){if(!wu(e))return;const t=e;if(t.querySelector("style")===null)return;const r=new Map;function n(i){let o=r.get(i);if(o===void 0){o=new Set;for(let s=0;s<i.style.length;s++)o.add(i.style[s]);r.set(i,o)}return o}try{for(const i of Array.from(t.styleSheets)){let o;try{o=i.cssRules}catch{continue}for(const s of Array.from(o)){if(!Ma(s,CSSStyleRule))continue;let a;try{a=t.querySelectorAll(s.selectorText)}catch{continue}for(const l of Array.from(a)){if(!tt(l))continue;const u=n(l);for(let d=0;d<s.style.length;d++){const f=s.style[d];u.has(f)||l.style.setProperty(f,s.style.getPropertyValue(f),s.style.getPropertyPriority(f))}}}}}catch{}}const SO="@lexical/html/DOM",EO=Symbol.for("@lexical/html/DOMExportContext"),DY=Symbol.for("@lexical/html/DOMImportContext");function FY(e,t,r){return xO(EO,e,t,r)}const IY=FY("isExport",Boolean);function PY(e){const t=qh(e,SO);return t?t.output.defaults:void 0}function OY(e){const t=qh(e,SO);return t?t.output.runtime:void 0}function MY(e=gr()){const t=OY(e);return t?t.getSessionConfig():Cm(e)}const LY=$Y(EO,PY),Dm=Symbol.for("@lexical/html/SelectorImpl");function dh(e,t){const r={kind:"element",predicate:(n=t,n.length===0?tt:n.length===1?n[0]:(o,s)=>{for(const a of n)if(!a(o,s))return!1;return!0}),tags:e};var n;const i=o=>dh(e,[...t,o]);return{[Dm]:r,attr:(o,s,a)=>i(Hy(o,s,a)),classAll:(...o)=>i(kO(o)),classAny:(...o)=>i((function(s){const a=wO(s);return a.length===0?()=>!1:l=>{if(!tt(l))return!1;const u=l.classList;for(const d of a)if(u.contains(d))return!0;return!1}})(o)),styleAny:(o,s,a)=>i((function(l,u,d){if(typeof u=="string")return f=>tt(f)&&f.style.getPropertyValue(l)===u;if(u instanceof RegExp){const f=d&&d.capture,h=u;return(p,g)=>{if(!tt(p))return!1;const m=p.style.getPropertyValue(l);if(!m)return!1;const v=m.match(h);return v!==null&&(f!==void 0&&(g[f]=v),!0)}}bd(362,JSON.stringify(l))})(o,s,a))}}function wO(e){const t=[];for(const r of e)r&&t.push(r);return t}function kO(e){const t=wO(e);return t.length===0?()=>!0:r=>{if(!tt(r))return!1;const n=r.classList;for(const i of t)if(!n.contains(i))return!1;return!0}}function Hy(e,t,r){if(t===!0)return n=>tt(n)&&n.hasAttribute(e);if(typeof t=="string")return n=>tt(n)&&n.getAttribute(e)===t;if(t instanceof RegExp){const n=r&&r.capture,i=t;return(o,s)=>{if(!tt(o))return!1;const a=o.getAttribute(e);if(a==null)return!1;const l=a.match(i);return l!==null&&(n!==void 0&&(s[n]=l),!0)}}bd(361,JSON.stringify(e))}const zY={kind:"text",predicate:gi,tags:new Set},UY={[Dm]:zY},BY={kind:"comment",predicate:e=>e.nodeType===8,tags:new Set},jY={[Dm]:BY},fc={any:()=>dh(new Set,[]),comment:()=>jY,tag(...e){e.length>0||bd(363);const t=new Set;for(const r of e)t.add(r.toUpperCase());return dh(t,[])},text:()=>UY};function CO(e,t){return tt(e)&&e.nodeName===t.toUpperCase()}const RO=/[A-Za-z0-9_-]/;let qY=class{constructor(t,r){this.source=t,this.pos=r}peek(t=0){return this.source[this.pos+t]||""}consume(){return this.source[this.pos++]||""}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){const t=this.pos;for(;!this.eof()&&RO.test(this.peek());)this.pos++;return this.source.slice(t,this.pos)}readQuoted(){const t=this.consume();this.assert(t==='"'||t==="'","expected quote");const r=this.pos;for(;!this.eof()&&this.peek()!==t;)this.peek()==="\\"?this.pos+=2:this.pos++;this.assert(!this.eof(),"unterminated string");const n=this.source.slice(r,this.pos);return this.pos++,n.replace(/\\(.)/g,"$1")}assert(t,r){t||bd(364,String(this.pos+1),r,this.source)}};function VY(e){const t=new Set,r=[],n=[];if(e.skipWhitespace(),e.peek()==="*")e.consume();else if(RO.test(e.peek())){const i=e.readIdent();i&&t.add(i.toUpperCase())}for(;!e.eof();){const i=e.peek();if(i==="."){e.consume();const o=e.readIdent();e.assert(o!=="",'expected class name after "."'),n.push(o)}else if(i==="#"){e.consume();const o=e.readIdent();e.assert(o!=="",'expected id after "#"'),r.push(Hy("id",o))}else{if(i!=="[")break;{e.consume(),e.skipWhitespace();const o=e.readIdent();e.assert(o!=="",'expected attribute name after "["'),e.skipWhitespace();let s=!0;if(e.peek()==="="){e.consume(),e.skipWhitespace();const a=e.peek();a==='"'||a==="'"?s=e.readQuoted():(s=e.readIdent(),e.assert(s!=="","expected attribute value")),e.skipWhitespace()}e.assert(e.peek()==="]",'expected "]"'),e.consume(),r.push(Hy(o,s))}}}return n.length>0&&r.push(kO(n)),{predicates:r,tags:t}}function KY(e){const t=new qY(e,0),r=[];for(;;){const i=VY(t);if(r.push(i),t.skipWhitespace(),t.eof())break;t.assert(t.peek()===",",'expected "," (selector lists are the only supported combinator)'),t.consume(),t.skipWhitespace()}if(r.length===1)return dh(r[0].tags,r[0].predicates);const n=new Set;for(const i of r)for(const o of i.tags)n.add(o);return dh(n,[(i,o)=>{for(const s of r){const a=i.nodeName;if(s.tags.size>0&&!s.tags.has(a))continue;let l=!0;for(const u of s.predicates)if(!u(i,o)){l=!1;break}if(l)return!0}return!1}])}function bS(e,t,r){return xO(DY,e,t,r)}const Wy=bS("textFormat",()=>0),HY=bS("textStyle",()=>({}));function WY(e){if(!tt(e))return!1;if(e.nodeName==="PRE")return!0;const t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function GY(e){if(gi(e))return!0;if(!tt(e))return!1;const t=e.style.display;return t?t.startsWith("inline"):!Wc(e)&&bg(e)}const JY=bS("whitespaceConfig",()=>({isInline:GY,preservesWhitespace:WY}));function yS(e){return jc(e)||ct(e)&&!e.isInline()}function AO(e,t){const r=[];let n=[];const i=()=>{n.length!==0&&(r.push(t().splice(0,0,n)),n=[])};for(const o of e)if(yS(o)){if(i(),U(o)){const s=AO(o.getChildren(),t);o.splice(0,o.getChildrenSize(),s)}r.push(o)}else n.push(o);return i(),r}function TO(e,t){if(!tt(t))return e;const r=t.style.textAlign;if(!xS(r))return e;for(const n of e)jc(n)&&n.getFormatType()===""&&n.setFormat(r);return e}function QY(e,t,r){e.length===1&&Qn(e[0])&&(e=[]);const n=Pt();if(tt(r)){const i=r.style.textAlign;xS(i)&&n.setFormat(i)}return[n.splice(0,0,e)]}const $O={$accepts:yS,$packageRun:QY,name:"BlockSchema"},Au=fc,YY=new Set(["center","end","justify","left","right","start"]);function xS(e){return YY.has(e)}const XY={B:{fontWeight:"bold"},EM:{fontStyle:"italic"},I:{fontStyle:"italic"},S:{textDecoration:"line-through"},STRONG:{fontWeight:"bold"},SUB:{verticalAlign:"sub"},SUP:{verticalAlign:"super"},U:{textDecoration:"underline"}},ZY={CODE:nJ,MARK:Mx},eX=new Set(["font-weight","font-style","text-decoration","vertical-align"]),tX={$import:(e,t)=>{const r=e.get(Wy),n=XY[t.nodeName],i=(function(h){return{fontStyle:h.style.fontStyle,fontWeight:h.style.fontWeight,textDecoration:h.style.textDecoration,verticalAlign:h.style.verticalAlign}})(t),o=n?(s=n,{fontStyle:(a=i).fontStyle||s.fontStyle,fontWeight:a.fontWeight||s.fontWeight,textDecoration:a.textDecoration||s.textDecoration,verticalAlign:a.verticalAlign||s.verticalAlign}):i;var s,a;let l=(u=r,d=(function(h){let p=0,g=0;const{fontWeight:m,fontStyle:v,textDecoration:_,verticalAlign:x}=h;if(m==="700"||m==="bold"?p|=Nk:m!=="normal"&&m!=="400"||(g|=Nk),v==="italic"?p|=Dk:v==="normal"&&(g|=Dk),_){const w=_.split(" ");w.includes("underline")&&(p|=Ik),w.includes("line-through")&&(p|=Fk),w.includes("none")&&(g|=Ik|Fk)}return x==="sub"?(p|=Wv,g|=Gv):x==="super"?(p|=Gv,g|=Wv):x==="baseline"&&(g|=Wv|Gv),{clear:g,set:p}})(o),u&~d.clear|d.set);var u,d;const f=ZY[t.nodeName];return f&&(l|=f),l===r?e.$importChildren(t):e.$importChildren(t,{context:[yO(Wy,l)]})},match:Au.tag("b","strong","em","i","code","mark","s","sub","sup","u","span"),name:"@lexical/html/inline-format"};function ZC(e,t,r){let n=e;for(;;){let i=null;for(;(i=t?n.nextSibling:n.previousSibling)===null;){const s=n.parentNode;if(s===null)return null;n=s}if(n=i,!r.isInline(n))return null;let o=n;for(;(o=t?n.firstChild:n.lastChild)!==null;)n=o;if(gi(n))return n;if(n.nodeName==="BR")return null}}function eR(e,t){return t!==0&&ne(e)?e.setFormat(t):e}function tR(e,t){if(ne(e)){const r=(function(n){let i="";for(const o in n)eX.has(o)||(i+=`${o}: ${n[o]}; `);return i.trimEnd()})(t);r!==""&&e.setStyle(r)}return e}const rX={$import:(e,t)=>{const r=e.get(Wy),n=e.get(HY),i=e.get(JY);if((function(a,l){let u=a.parentNode;for(;u!==null;){if(l.preservesWhitespace(u))return!0;u=u.parentNode}return!1})(t,i)){const a=sh(t.textContent||"");for(const l of a)eR(l,r),tR(l,n);return a}const o=(function(a,l){let u=(a.textContent||"").replace(/\r/g,"").replace(/[ \t\n]+/g," ");if(u.length===0)return"";if(u[0]===" "){let d=a,f=!0;for(;d!==null&&(d=ZC(d,!1,l))!==null;){const h=d.textContent||"";if(h.length>0){/[ \t\n]$/.test(h)&&(u=u.slice(1)),f=!1;break}}f&&(u=u.slice(1))}if(u.length>0&&u[u.length-1]===" "){let d=a,f=!0;for(;d!==null&&(d=ZC(d,!0,l))!==null;)if((d.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){f=!1;break}f&&(u=u.slice(0,-1))}return u})(t,i);if(o==="")return[];const s=Sr(o);return eR(s,r),tR(s,n),[s]},match:Au.text(),name:"@lexical/html/#text"},nX={$import:()=>[],match:Au.tag("script","style"),name:"@lexical/html/script-style-ignore"},iX={$import:(e,t)=>AP(t)||TP(t)?[]:[Mo()],match:Au.tag("br"),name:"@lexical/html/br"},oX={$import:(e,t)=>{const r=Pt();if(ws(r,t),Cu(t,r),r.getFormatType()===""){const n=t.getAttribute("align");n&&xS(n)&&r.setFormat(n)}return ho(r,t),[r.splice(0,0,e.$importChildren(t))]},match:Au.tag("p"),name:"@lexical/html/p"},sX={$import:(e,t,r)=>gr().hasNode(Nm)?[_S()]:r(),match:Au.tag("hr"),name:"@lexical/html/hr"};Au.any();function aX(e,t){const r=[];let n=0,i=0;for(;n<e.length&&i<t.length;)e[n]<=t[i]?r.push(e[n++]):r.push(t[i++]);for(;n<e.length;)r.push(e[n++]);for(;i<t.length;)r.push(t[i++]);return r}function lX(e){const t=[],r=new Map,n=[],i=[],o=[],s=new Set;e.forEach((l,u)=>{const d=(function(h){const p=h[Dm];return p===void 0&&bd(360),p})(l.match),f=l.name||(function(h,p){return h.kind==="text"?`#text@${p}`:h.kind==="comment"?`#comment@${p}`:h.tags.size===0?`*@${p}`:`${Array.from(h.tags).join(",").toLowerCase()}@${p}`})(d,u);if(l.name&&s.add(l.name),t.push({$import:l.$import,name:f,predicate:d.predicate}),d.kind==="text")i.push(u);else if(d.kind==="comment")o.push(u);else if(d.tags.size===0)n.push(u);else for(const h of d.tags){let p=r.get(h);p||(p=[],r.set(h,p)),p.push(u)}});const a=new Map;if(n.length===0)for(const[l,u]of r)a.set(l,u);else for(const[l,u]of r)a.set(l,aX(u,n));return{byTag:a,commentIndices:o,rules:t,textIndices:i,wildcardIndices:n}}function uX(e){const t=[];for(const r of e)if(cX(r))for(const n of r.rules)t.push(n);else t.push(r);return t}function cX(e){return typeof e=="object"&&e!==null&&"__type"in e&&e.__type==="CompiledOverlayRules"}function NO(e){const t=uX(e);return{__type:"CompiledOverlayRules",dispatch:lX(t),rules:t}}fc.any();const vn={any:fc.any,comment:fc.comment,css:KY,tag:fc.tag,text:fc.text},DO=new Set(["STYLE","SCRIPT"]);function dX(e,t){NY(t);const r=wu(t)?t.body.childNodes:t.childNodes,n=[],i=[];for(const o of r)if(!DO.has(o.nodeName)){const s=IO(o,e,i,!1);if(s!==null)for(const a of s)n.push(a)}return(function(o){for(const s of o)s.getParent()&&s.getNextSibling()instanceof Gx&&s.insertAfter(Mo());for(const s of o){const a=s.getParent();a&&a.splice(s.getIndexWithinParent(),1,s.getChildren())}})(i),n}function fX(e,t=null,r=gr()){return LY([yO(IY,!0)],r)(()=>{const n=Kr(),i=MY(r),o=te(t)?Rm(t.anchor.getNode()):null,s=e.append.bind(e);for(const a of(U(o)?o:n).getChildren())FO(r,a,s,t,i);return e})}function hX(e,t=null){return(typeof document>"u"||typeof window>"u"&&global.window===void 0)&&bd(338),lQ(e),fX(Yt().createElement("div"),t,e).innerHTML}function FO(e,t,r,n=null,i=Cm(e)){let o=i.$shouldInclude(t,n,e);const s=i.$shouldExclude(t,n,e);let a=t;n!==null&&ne(t)&&(a=aO(n,t,"clone"));const l=i.$exportDOM(a,e),{element:u,after:d,append:f,$getChildNodes:h}=l;if(!u)return!1;const p=Yt().createDocumentFragment(),g=h?h():U(a)?a.getChildren():[],m=o&&Wt(n)&&U(t)?null:n,v=p.append.bind(p);for(const _ of g){const x=FO(e,_,v,m,i);!o&&x&&i.$extractWithChild(t,_,n,"html",e)&&(o=!0)}if(o&&!s){if((tt(u)||Uy(u))&&(f?f(p):u.append(p)),r(u),d){const _=d.call(a,u);_&&(Uy(u)?u.replaceChildren(_):u.replaceWith(_))}}else r(p);return o}function IO(e,t,r,n,i=new Map,o){const s=[];if(DO.has(e.nodeName))return s;let a=null;const l=(function(g,m){const{nodeName:v}=g,_=m._htmlConversions.get(v.toLowerCase());let x=null;if(_!==void 0)for(const w of _){const S=w(g);S!==null&&(x===null||(x.priority||0)<=(S.priority||0))&&(x=S)}return x!==null?x.conversion:null})(e,t),u=l?l(e):null;let d=null;if(u!==null){d=u.after;const g=u.node;if(a=Array.isArray(g)?g[g.length-1]:g,a!==null){for(const[,m]of i)if(a=m(a,o),!a)break;a&&s.push(...Array.isArray(g)?g:[a])}u.forChild!=null&&i.set(e.nodeName,u.forChild)}const f=e.childNodes;let h=[];const p=(a==null||!Zt(a))&&(a!=null&&jc(a)||n);for(let g=0;g<f.length;g++)h.push(...IO(f[g],t,r,p,new Map(i),a));if(d!=null&&(h=d(h)),Wc(e)&&(h=pX(e,h,p?()=>{const g=new Gx;return r.push(g),g}:Pt)),a==null)if(h.length>0)for(const g of h)s.push(g);else Wc(e)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:bg(g.nextSibling)&&bg(g.previousSibling)})(e)&&s.push(Mo());else U(a)&&a.append(...h);return s}function pX(e,t,r){const n=e.style.textAlign,i=[];let o=[];for(let s=0;s<t.length;s++){const a=t[s];if(jc(a))n&&!a.getFormat()&&a.setFormat(n),i.push(a);else if(o.push(a),s===t.length-1||s<t.length-1&&jc(t[s+1])){const l=r();l.setFormat(n),l.append(...o),i.push(l),o=[]}}return i}function Ta(e,...t){const r=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",e);for(const i of t)n.append("v",i);throw r.search=n.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function gX(e){let t=1,r=e.getParent();for(;r!=null;){if(Rt(r)){const n=r.getParent();if(at(n)){t++,r=n.getParent();continue}Ta(40)}return t}return t}function Gy(e){const t=e.getParent();at(t)||Ta(40);let r=t,n=t;for(;n!==null;)n=n.getParent(),at(n)&&(r=n);return r}function PO(e){let t=[];const r=e.getChildren().filter(Rt);for(let n=0;n<r.length;n++){const i=r[n],o=i.getFirstChild();at(o)?t=t.concat(PO(o)):t.push(i)}return t}function Wi(e){return Rt(e)&&at(e.getFirstChild())}function OO(e,t){return Rt(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function rR(e){const t=de();if(t!==null){let r=t.getNodes();if(te(t)){const[i]=t.getStartEndPoints(),o=i.getNode(),s=o.getParent();if(Zt(o)){const a=o.getFirstChild();if(a)r=a.selectStart().getNodes();else{const l=Pt();o.append(l),r=l.select().getNodes()}}else if(OO(o,r)){const a=Fo(e);if(Zt(s)){o.replace(a);const l=ys();U(o)&&(l.setFormat(o.getFormatType()),l.setIndent(o.getIndent())),a.append(l)}else if(Rt(o)){const l=o.getParentOrThrow();vu(a,l.getChildren()),l.replace(a)}return}}const n=new Set;for(let i=0;i<r.length;i++){const o=r[i];if(U(o)&&o.isEmpty()&&!Rt(o)&&!n.has(o.getKey())){nR(o,e);continue}let s=DP(o)?o.getParent():Rt(o)&&o.isEmpty()?o:null;for(;s!=null;){const a=s.getKey();if(at(s)){if(!n.has(a)){const l=Fo(e);vu(l,s.getChildren()),s.replace(l),n.add(a)}break}{const l=s.getParent();if(Zt(l)&&!n.has(a)){n.add(a),nR(s,e);break}s=l}}}}}function vu(e,t){e.splice(e.getChildrenSize(),0,t)}function nR(e,t){if(at(e))return e;const r=e.getPreviousSibling(),n=e.getNextSibling(),i=ys();let o;if(vu(i,e.getChildren()),at(r)&&t===r.getListType())r.append(i),at(n)&&t===n.getListType()&&(vu(r,n.getChildren()),n.remove()),o=r;else if(at(n)&&t===n.getListType())n.getFirstChildOrThrow().insertBefore(i),o=n;else{const a=Fo(t);a.append(i),e.replace(a),o=a}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());const s=de();return te(s)&&(o.getKey()===s.anchor.key&&s.anchor.set(i.getKey(),s.anchor.offset,"element"),o.getKey()===s.focus.key&&s.focus.set(i.getKey(),s.focus.offset,"element")),e.remove(),o}function SS(e,t){const r=e.getLastChild(),n=t.getFirstChild();r&&n&&Wi(r)&&Wi(n)&&(SS(r.getFirstChild(),n.getFirstChild()),n.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function mX(){const e=de();if(te(e)){const t=new Set,r=e.getNodes(),n=e.anchor.getNode();if(OO(n,r))t.add(Gy(n));else for(let i=0;i<r.length;i++){const o=r[i];if(DP(o)){const s=uY(o,Tu);s!=null&&t.add(Gy(s))}}for(const i of t){let o=i;const s=PO(i);for(const a of s){const l=Pt().setTextStyle(e.style).setTextFormat(e.format);vu(l,a.getChildren()),o.insertAfter(l),o=l,a.__key===e.anchor.key&&mu(e.anchor,Ri(ao(l,"next"))),a.__key===e.focus.key&&mu(e.focus,Ri(ao(l,"next"))),a.remove()}i.remove()}}}function MO(e){const t=e.getListType()!=="check";let r=e.getStart();for(const n of e.getChildren())Rt(n)&&(n.getValue()!==r&&n.setValue(r),t&&n.getLatest().__checked!=null&&n.setChecked(void 0),at(n.getFirstChild())||r++)}function vX(e){const t=new Set;if(Wi(e)||t.has(e.getKey()))return;const r=e.getParent(),n=e.getNextSibling(),i=e.getPreviousSibling();if(Wi(n)&&Wi(i)){const o=i.getFirstChild();if(at(o)){o.append(e);const s=n.getFirstChild();at(s)&&(vu(o,s.getChildren()),n.remove(),t.add(n.getKey()))}}else if(Wi(n)){const o=n.getFirstChild();if(at(o)){const s=o.getFirstChild();s!==null&&s.insertBefore(e)}}else if(Wi(i)){const o=i.getFirstChild();at(o)&&o.append(e)}else if(at(r)){const o=Pn(e),s=Pn(r);o.append(s),s.append(e),i?i.insertAfter(o):n?n.insertBefore(o):r.append(o)}}function iR(e){if(Wi(e))return;const t=e.getParent(),r=t?t.getParent():void 0;if(at(r?r.getParent():void 0)&&Rt(r)&&at(t)){const n=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(n))r.insertBefore(e),t.isEmpty()&&r.remove();else if(e.is(i))r.insertAfter(e),t.isEmpty()&&r.remove();else{const o=Pn(e),s=Pn(t);o.append(s),e.getPreviousSiblings().forEach(u=>s.append(u));const a=Pn(e),l=Pn(t);a.append(l),vu(l,e.getNextSiblings()),r.insertBefore(o),r.insertAfter(a),r.replace(e)}}}function _X(e=!1){const t=de();if(!te(t)||!t.isCollapsed())return!1;const r=t.anchor.getNode();let n=null;if(Rt(r)&&r.getChildrenSize()===0)n=r;else if(ne(r)){const u=r.getParent();Rt(u)&&u.getChildren().every(d=>ne(d)&&d.getTextContent().trim()==="")&&(n=u)}if(n===null)return!1;const i=Gy(n),o=n.getParent();at(o)||Ta(40);const s=o.getParent();let a;if(Zt(s))a=Pt(),i.insertAfter(a);else{if(!Rt(s))return!1;a=Pn(s),s.insertAfter(a)}a.setTextStyle(t.style).setTextFormat(t.format).select();const l=n.getNextSiblings();if(l.length>0){const u=e?(function(f,h){return f.getStart()+h.getIndexWithinParent()})(o,n):1,d=Pn(o).setStart(u);if(Rt(a)){const f=Pn(a);f.append(d),a.insertAfter(f)}else a.insertAfter(d);d.append(...l)}return(function(u){let d=u;for(;d.getNextSibling()==null&&d.getPreviousSibling()==null;){const f=d.getParent();if(f==null||!Rt(f)&&!at(f))break;d=f}d.remove()})(n),!0}let Tu=class extends fi{__value;__checked;$config(){return this.config("listitem",{$transform:t=>{const r=t.getParent();if(at(r))r.getListType()!=="check"&&t.getChecked()!=null&&t.setChecked(void 0);else if(r){const n=t.createParentElementNode();at(n)||Ta(340);const i=[t];for(const o of["previous","next"]){i.reverse();for(const{origin:s}of Nt(t,o)){if(!Rt(s))break;i.push(s)}}t.insertBefore(n),n.splice(0,0,i),Zt(r)||(iO(n,Ru(Nt(n,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),r.isEmpty()&&r.isAttached()&&r.remove())}},extends:fi,importDOM:{li:()=>({conversion:bX,priority:0})}})}constructor(t=1,r=void 0,n){super(n),this.__value=t===void 0?1:t,this.__checked=r}afterCloneFrom(t){super.afterCloneFrom(t),this.__value=t.__value,this.__checked=t.__checked}createDOM(t){const r=Yt().createElement("li");return this.updateListItemDOM(null,r,t),r}updateListItemDOM(t,r,n){(function(s,a){const l=a.getParent();!at(l)||l.getListType()!=="check"||at(a.getFirstChild())?(s.removeAttribute("role"),s.removeAttribute("tabIndex"),s.removeAttribute("aria-checked")):(s.setAttribute("role","checkbox"),s.setAttribute("tabIndex","-1"),s.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(r,this),r.value=this.__value,(function(s,a,l){const u=a.list;if(!u)return;const d=u.listitem,f=u.nested&&u.nested.listitem,h=l.getParent(),p=at(h)&&h.getListType()==="check",g=l.getChecked(),m=l.getChildren().some(x=>at(x)),v=[];u.listitemChecked!==void 0&&v.push(u.listitemChecked),u.listitemUnchecked!==void 0&&v.push(u.listitemUnchecked),f!==void 0&&v.push(...Js(f)),v.length>0&&pS(s,...v);const _=[];if(d!==void 0&&_.push(...Js(d)),p){const x=g?u.listitemChecked:u.listitemUnchecked;x!==void 0&&_.push(x)}f!==void 0&&m&&_.push(...Js(f)),_.length>0&&bs(s,..._)})(r,n.theme,this);const i=t?t.__style:"",o=this.__style;i!==o&&kc(r.style,o,i),(function(s,a,l){const u=a.__textStyle,d=l?l.__textStyle:"";if(l!==null&&d===u)return;const f=ug(u);for(const h in f)s.style.setProperty(`--listitem-marker-${h}`,f[h]);if(d!=="")for(const h in ug(d))h in f||s.style.removeProperty(`--listitem-marker-${h}`)})(r,this,t)}updateDOM(t,r,n){const i=r;return this.updateListItemDOM(t,i,n),!1}updateFromJSON(t){return super.updateFromJSON(t).setValue(t.value).setChecked(t.checked)}exportDOM(t){const r=this.createDOM(t._config),n=this.getFormatType();n&&(r.style.textAlign=n);const i=this.getDirection();return i&&(r.dir=i),Wi(this)?{after(o){if(tt(o)){const s=o.previousElementSibling;if(tt(s)&&s.nodeName==="LI"){for(;o.firstChild;)s.append(o.firstChild);o.remove()}}return o},element:r}:{element:r}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...t){for(let r=0;r<t.length;r++){const n=t[r];if(U(n)&&this.canMergeWith(n)){const i=n.getChildren();this.append(...i),n.remove()}else super.append(n)}return this}replace(t,r){if(Rt(t))return super.replace(t);this.setIndent(0);const n=this.getParentOrThrow();if(!at(n))return t;if(n.__first===this.getKey())n.insertBefore(t);else if(n.__last===this.getKey())n.insertAfter(t);else{const s=Pn(n);let a=this.getNextSibling();for(;a;){const l=a;a=a.getNextSibling(),s.append(l)}n.insertAfter(t),t.insertAfter(s)}const i=this.__key;let o=0;if(r&&(U(t)||Ta(139),o=t.getChildrenSize(),t.splice(o,0,this.getChildren())),r&&U(t)){const s=de();if(te(s))for(const a of s.getStartEndPoints())a.key===i&&a.type==="element"&&a.set(t.getKey(),o+a.offset,"element")}return this.remove(),n.getChildrenSize()===0&&n.remove(),t}insertAfter(t,r=!0){const n=this.getParentOrThrow();if(at(n)||Ta(39),Rt(t))return super.insertAfter(t,r);const i=this.getNextSiblings();if(n.insertAfter(t,r),i.length!==0){const o=Pn(n);i.forEach(s=>o.append(s)),t.insertAfter(o,r)}return t}remove(t){const r=this.getPreviousSibling(),n=this.getNextSibling();super.remove(t),r&&n&&Wi(r)&&Wi(n)&&(SS(r.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(t){super.resetOnCopyNodeFrom(t),t.getChecked()&&this.setChecked(!1)}insertNewAfter(t,r=!0){const n=Pn(this);return this.insertAfter(n,r),n}collapseAtStart(t){if(Wi(this))return!1;const r=this.getParentOrThrow();if(Rt(r.getParentOrThrow()))return iR(this),!0;const n=Pt().append(...this.getChildren()),i=this.getNextSiblings();if(i.length>0){const o=Pn(r);o.append(...i),r.insertAfter(o)}return r.insertAfter(n),this.remove(),r.getChildrenSize()===0&&r.remove(),n.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(t){const r=this.getWritable();return r.__value=t,r}getChecked(){const t=this.getLatest();let r;const n=this.getParent();return at(n)&&(r=n.getListType()),r==="check"?!!t.__checked:void 0}setChecked(t){const r=this.getWritable();return r.__checked=t,r}toggleChecked(){const t=this.getWritable();return t.setChecked(!t.__checked)}getIndent(){const t=this.getParent();if(t===null||!this.isAttached())return this.getLatest().__indent;let r=t.getParentOrThrow(),n=0;for(;Rt(r);)r=r.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(t){typeof t!="number"&&Ta(117),(t=Math.floor(t))>=0||Ta(199);let r=this.getIndent();for(;r!==t;)r<t?(vX(this),r++):(iR(this),r--);return this}canInsertAfter(t){return Rt(t)}canReplaceWith(t){return Rt(t)}canMergeWith(t){return Rt(t)||md(t)}extractWithChild(t,r){if(!te(r))return!1;const n=r.anchor.getNode(),i=r.focus.getNode();return this.isParentOf(n)&&this.isParentOf(i)&&this.getTextContent().length===r.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Fo("bullet")}canMergeWhenEmpty(){return!0}};function bX(e){if(e.classList.contains("task-list-item")){for(const n of e.children)if(n.tagName==="INPUT")return oR(n)}if(e.classList.contains("joplin-checkbox")){for(const n of e.children)if(n.classList.contains("checkbox-wrapper")&&n.children.length>0&&n.children[0].tagName==="INPUT")return oR(n.children[0])}const t=e.getAttribute("aria-checked"),r=ys(t==="true"||t!=="false"&&void 0);return ws(r,e),{after:LO.bind(null,r),node:ho(r,e)}}function oR(e){if(e.getAttribute("type")!=="checkbox")return{node:null};const t=ys(e.hasAttribute("checked"));return{after:LO.bind(null,t),node:t}}function LO(e,t){const r=t[0];return t.length===1&&md(r)&&!e.getFormatType()&&r.getFormatType()?(e.setFormat(r.getFormatType()),r.getChildren()):t}function ys(e){return Vo(new Tu(void 0,e))}function Rt(e){return e instanceof Tu}let Vh=class extends fi{__tag;__start;__listType;$config(){return this.config("list",{$transform:t=>{(function(r){const n=r.getNextSibling();at(n)&&r.getListType()===n.getListType()&&SS(r,n)})(t),MO(t)},extends:fi,importDOM:{ol:()=>({conversion:aR,priority:0}),ul:()=>({conversion:aR,priority:0})}})}constructor(t="number",r=1,n){super(n);const i=yX[t]||t;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=r}afterCloneFrom(t){super.afterCloneFrom(t),this.__listType=t.__listType,this.__tag=t.__tag,this.__start=t.__start}getTag(){return this.getLatest().__tag}setListType(t){const r=this.getWritable();return r.__listType=t,r.__tag=t==="number"?"ol":"ul",r}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(t){const r=this.getWritable();return r.__start=t,r}createDOM(t,r){const n=this.__tag,i=Yt().createElement(n);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,sR(i,t.theme,this),i}updateDOM(t,r,n){return t.__tag!==this.__tag||t.__listType!==this.__listType||(sR(r,n.theme,this),t.__start!==this.__start&&r.setAttribute("start",String(this.__start)),!1)}updateFromJSON(t){return super.updateFromJSON(t).setListType(t.listType).setStart(t.start)}exportDOM(t){const r=this.createDOM(t._config,t);return tt(r)&&(this.__start!==1&&r.setAttribute("start",String(this.__start)),this.__listType==="check"&&r.setAttribute("__lexicalListType","check")),{element:r}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(t,r,n){let i=n;for(let o=0;o<n.length;o++){const s=n[o];Rt(s)||(i===n&&(i=[...n]),i[o]=this.createListItemNode().append(!U(s)||at(s)||s.isInline()?s:Sr(s.getTextContent())))}return super.splice(t,r,i)}extractWithChild(t){return Rt(t)}createListItemNode(){return ys()}};function sR(e,t,r){const n=[],i=[],o=t.list;if(o!==void 0){const s=o[`${r.__tag}Depth`]||[],a=gX(r)-1,l=a%s.length,u=s[l],d=o[r.__tag];let f;const h=o.nested,p=o.checklist;if(h!==void 0&&h.list&&(f=h.list),d!==void 0&&n.push(d),p!==void 0&&r.__listType==="check"&&n.push(p),u!==void 0){n.push(...Js(u));for(let g=0;g<s.length;g++)g!==l&&i.push(r.__tag+g)}if(f!==void 0){const g=Js(f);a>1?n.push(...g):i.push(...g)}}i.length>0&&pS(e,...i),n.length>0&&bs(e,...n)}function aR(e){let t;if((function(r){return tt(r)&&r.nodeName.toLowerCase()==="ol"})(e)){const r=e.start;t=Fo("number",r)}else t=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const n of r.childNodes)if(tt(n)&&n.hasAttribute("aria-checked"))return!0;return!1})(e)?Fo("check"):Fo("bullet");return ho(t,e),{after:r=>(function(n,i){const o=i.createListItemNode.bind(i),s=[];for(let a=0;a<n.length;a++){const l=n[a];if(Rt(l)){s.push(l);const u=l.getChildren();u.length>1&&u.forEach(d=>{at(d)&&s.push(o().append(d))})}else s.push(o().append(l))}return s})(r,t),node:t}}const yX={ol:"number",ul:"bullet"};function Fo(e="number",t=1){return Vo(new Vh(e,t))}function at(e){return e instanceof Vh}function xX(e){const t=[];for(const r of e)if(Rt(r)){t.push(r);const n=r.getChildren();if(n.length>1)for(const i of n)at(i)&&t.push(ys().append(i))}else t.push(ys().append(r));return t}const SX={$import:(e,t)=>{let r;var n;return CO(t,"ol")?r=Fo("number",t.start):r=(n=t).matches('[__lexicallisttype="check"], .contains-task-list, [data-is-checklist="1"]')||n.querySelector(":scope > [aria-checked]")!==null?Fo("check"):Fo("bullet"),ho(r,t),[r.splice(0,0,TO(xX(e.$importChildren(t)),t))]},match:vn.tag("ol","ul"),name:"@lexical/list/list"};function zO(e,t){if(t.length!==1)return t;const r=t[0];return md(r)&&!e.getFormatType()&&r.getFormatType()?(e.setFormat(r.getFormatType()),r.getChildren()):t}function UO(e){const t=s=>yS(s)&&!at(s);if(!e.some(t))return e;const r=[];let n=[];const i=()=>{n.length>0&&(r.push(n),n=[])};for(const s of e)t(s)?(i(),r.push(U(s)?s.getChildren():[s])):n.push(s);i();const o=[];for(const s of r)o.length>0&&o.push(Mo()),o.push(...s);return o}const EX={$import:(e,t)=>{const r=t.getAttribute("aria-checked"),n=ys(r==="true"||r!=="false"&&void 0);return ws(n,t),ho(n,t),[n.splice(0,0,UO(zO(n,e.$importChildren(t))))]},match:vn.tag("li"),name:"@lexical/list/li"};function lR(e,t,r){const n=CO(r,"input")?r:r.querySelector('input[type="checkbox"]');if(!n||n.getAttribute("type")!=="checkbox")return[];const i=ys(n.hasAttribute("checked"));return ws(i,t),ho(i,t),[i.splice(0,0,UO(zO(i,e.$importChildren(t))))]}vn.tag("li").classAll("task-list-item"),vn.tag("li").classAll("joplin-checkbox");const wX=je("UPDATE_LIST_START_COMMAND"),BO=je("INSERT_UNORDERED_LIST_COMMAND"),jO=je("INSERT_ORDERED_LIST_COMMAND"),kX=je("REMOVE_LIST_COMMAND");function CX(e,t){return nl(e.registerCommand(jO,()=>(rR("number"),!0),nc),e.registerCommand(wX,r=>{const{listNodeKey:n,newStart:i}=r,o=Qt(n);return!!at(o)&&(o.getListType()==="number"&&(o.setStart(i),MO(o)),!0)},nc),e.registerCommand(BO,()=>(rR("bullet"),!0),nc),e.registerCommand(kX,()=>(mX(),!0),nc),e.registerCommand(eh,()=>_X(!1),nc),e.registerCommand(Bx,r=>{if((function(){const s=de();if(!te(s)||!s.isCollapsed()||s.anchor.offset!==0)return!1;const a=s.anchor.getNode(),l=Kt(a,Rt);if(!Rt(l))return!1;const u=l.getFirstDescendant();if(u===null||!l.is(a)&&!u.is(a))return!1;const d=l.getParent();if(!at(d)||!l.is(d.getFirstChild()))return!1;const f=d.getPreviousSibling();if(!ct(f)||f.isIsolated()||!f.isKeyboardSelectable()&&f.isInline())return!1;const h=Pt().append(...l.getChildren());return d.insertBefore(h),l.remove(),d.isEmpty()&&d.remove(),h.selectStart(),!0})())return r.preventDefault(),!0;const n=de();if(!te(n)||!n.isCollapsed())return!1;const{anchor:i}=n;if(i.offset!==0)return!1;let o=i.getNode();for(;!Rt(o);){if(o.getPreviousSibling()!==null)return!1;const s=o.getParent();if(s===null)return!1;o=s}return!(!Rt(o)||!o.collapseAtStart(n))&&(r.preventDefault(),!0)},vQ),e.registerNodeTransform(Tu,r=>{const n=r.getFirstChild();if(n){if(ne(n)){const i=n.getStyle(),o=n.getFormat();r.getTextStyle()!==i&&r.setTextStyle(i),r.getTextFormat()!==o&&r.setTextFormat(o)}}else{const i=de();te(i)&&(i.style!==r.getTextStyle()||i.format!==r.getTextFormat())&&i.isCollapsed()&&r.is(i.anchor.getNode())&&r.setTextStyle(i.style).setTextFormat(i.format)}}),e.registerNodeTransform(ca,r=>{const n=r.getParent();if(Rt(n)&&r.is(n.getFirstChild())){const i=r.getStyle(),o=r.getFormat();i===n.getTextStyle()&&o===n.getTextFormat()||n.setTextStyle(i).setTextFormat(o)}}))}function RX(e,t,r,n,i){if(e===null||r.size===0&&n.size===0&&!i)return 0;const o=t._selection,s=e._selection;if(i)return 1;if(!(te(o)&&te(s)&&s.isCollapsed()&&o.isCollapsed()))return 0;const a=(function(_,x,w){const S=_._nodeMap,k=[];for(const A of x){const C=S.get(A);C!==void 0&&k.push(C)}for(const[A,C]of w){if(!C)continue;const R=S.get(A);R===void 0||Er(R)||k.push(R)}return k})(t,r,n);if(a.length===0)return 0;if(a.length>1){const _=t._nodeMap,x=_.get(o.anchor.key),w=_.get(s.anchor.key);return x&&w&&!e._nodeMap.has(x.__key)&&ne(x)&&x.__text.length===1&&o.anchor.offset===1?2:0}const l=a[0],u=e._nodeMap.get(l.__key);if(!ne(u)||!ne(l)||u.__mode!==l.__mode)return 0;const d=u.__text,f=l.__text;if(d===f)return 0;const h=o.anchor,p=s.anchor;if(h.key!==p.key||h.type!=="text")return 0;const g=h.offset,m=p.offset,v=f.length-d.length;return v===1&&m===g-1?2:v===-1&&m===g+1?3:v===-1&&m===g?4:0}function AX(e,t,r){let n=r(),i=0,o=n,s=0,a=null;return(l,u,d,f,h,p)=>{const g=r();if(p.has(aP)&&(o=n,s=i,a=l),p.has(lg))return i=0,n=g,2;p.has(oh)&&a&&(n=o,i=s,l=a);const m=p.has(iP)||p.has(oP)?0:RX(l,u,f,h,e.isComposing()),v=(()=>{const _=d===null||d.editor===e,x=p.has(nP);if(!x&&_&&p.has(Sf))return 0;if(m===1)return 2;if(l===null)return 1;const w=u._selection;return f.size>0||h.size>0?x===!1&&m!==0&&m===i&&g<n+t&&_||f.size===1&&(function(k,A,C){const R=A._nodeMap.get(k),N=C._nodeMap.get(k),I=A._selection,P=C._selection;return!(te(I)&&te(P)&&I.anchor.type==="element"&&I.focus.type==="element"&&P.anchor.type==="text"&&P.focus.type==="text"||!ne(R)||!ne(N)||R.__parent!==N.__parent)&&JSON.stringify(A.read(()=>R.exportJSON()))===JSON.stringify(C.read(()=>N.exportJSON()))})(Array.from(f)[0],l,u)?0:1:w!==null?0:2})();return n=g,i=m,v}}function uR(e,t){e.undoStack=[],e.redoStack=[],e.current=null}function TX(e,t,r,n=Date.now,i,o=null){const s=AX(e,r,n);return nl(e.registerCommand(bm,()=>((function(a,l,u){const d=l.redoStack,f=l.undoStack;if(f.length!==0){const h=l.current,p=f.pop();h!==null&&(d.push(h),a.dispatchCommand(wp,!0)),f.length===0&&a.dispatchCommand(kp,!1),l.current=p||null,p&&p.editor.setEditorState(p.editorState,{tag:lg})}})(e,t),!0),ut),e.registerCommand(ym,()=>((function(a,l,u){const d=l.redoStack,f=l.undoStack;if(d.length!==0){const h=l.current;h!==null&&(f.push(h),a.dispatchCommand(kp,!0));const p=d.pop();d.length===0&&a.dispatchCommand(wp,!1),l.current=p||null,p&&p.editor.setEditorState(p.editorState,{tag:lg})}})(e,t),!0),ut),e.registerCommand(FJ,()=>(uR(t),!1),ut),e.registerCommand(IJ,()=>(uR(t),e.dispatchCommand(wp,!1),e.dispatchCommand(kp,!1),!0),ut),e.registerUpdateListener(({editorState:a,prevEditorState:l,dirtyLeaves:u,dirtyElements:d,tags:f})=>{const h=t.current,p=t.redoStack,g=t.undoStack,m=h===null?null:h.editorState;if(h!==null&&a===m)return;const v=s(l,a,h,u,d,f);if(v===1){if(p.length!==0&&(t.redoStack=[],e.dispatchCommand(wp,!1)),h!==null){g.push({...h});const _=typeof o=="number"||o===null?o:o.peek();_!==null&&g.length>_&&g.splice(0,g.length-_),e.dispatchCommand(kp,!0)}}else if(v===2)return;t.current={editor:e,editorState:a}}))}function $X(){return{current:null,redoStack:[],undoStack:[]}}function NX(e,t){let r=e;for(let n=Nt(e,t);n&&(KO(n.origin)||lu(n.origin));n=n.getAdjacentCaret())r=n.origin;return r}function DX(e){return NX(e,"previous")}function qO(e,t){for(const r of e.childNodes)if(tt(r)&&r.tagName===t||qO(r,t))return!0;return!1}const lf="data-language",Hd="data-highlight-language",Fp="data-theme";class yd extends fi{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(t){return new yd(t.__language,t.__key)}constructor(t,r){super(r),this.__language=t||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(t){super.afterCloneFrom(t),this.__language=t.__language,this.__theme=t.__theme,this.__isSyntaxHighlightSupported=t.__isSyntaxHighlightSupported}createDOM(t){const r=Yt().createElement("code");bs(r,t.theme.code),r.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(r.setAttribute(lf,n),this.getIsSyntaxHighlightSupported()&&r.setAttribute(Hd,n));const i=this.getTheme();i&&r.setAttribute(Fp,i);const o=this.getStyle();return o&&kc(r.style,o),r}updateDOM(t,r,n){const i=this.__language,o=t.__language;i?i!==o&&r.setAttribute(lf,i):o&&r.removeAttribute(lf);const s=this.__isSyntaxHighlightSupported;t.__isSyntaxHighlightSupported&&o?s&&i?i!==o&&r.setAttribute(Hd,i):r.removeAttribute(Hd):s&&i&&r.setAttribute(Hd,i);const a=this.__theme,l=t.__theme;a?a!==l&&r.setAttribute(Fp,a):l&&r.removeAttribute(Fp);const u=this.__style,d=t.__style;return u!==d&&kc(r.style,u,d),!1}exportDOM(t){const r=Yt().createElement("pre");bs(r,t._config.theme.code),r.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(r.setAttribute(lf,n),this.getIsSyntaxHighlightSupported()&&r.setAttribute(Hd,n));const i=this.getTheme();i&&r.setAttribute(Fp,i);const o=this.getStyle();return o&&kc(r.style,o),{element:r}}static importDOM(){return{code:t=>t.textContent!=null&&(/\r?\n/.test(t.textContent)||qO(t,"BR"))?{conversion:cR,priority:1}:null,div:()=>({conversion:FX,priority:1}),pre:()=>({conversion:cR,priority:0}),table:t=>d_(t)?{conversion:IX,priority:3}:null,td:t=>{const r=t,n=r.closest("table");return r.classList.contains("js-file-line")||n&&d_(n)?{conversion:dR,priority:3}:null},tr:t=>{const r=t.closest("table");return r&&d_(r)?{conversion:dR,priority:3}:null}}}static importJSON(t){return Hn().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setLanguage(t.language).setTheme(t.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(t,r=!0){if(!qh(gr(),"@lexical/code")){const s=PX(t);if(s)return s}const{anchor:n,focus:i}=t,o=(n.isBefore(i)?n:i).getNode();if(ne(o)){let s=DX(o);const a=[];for(;;)if(lu(s))a.push(dd()),s=s.getNextSibling();else{if(!KO(s))break;{let g=0;const m=s.getTextContent(),v=s.getTextContentSize();for(;g<v&&m[g]===" ";)g++;if(g!==0&&a.push(VO(" ".repeat(g))),g!==v)break;s=s.getNextSibling()}}const l=o.splitText(n.offset)[0],u=n.offset===0?0:1,d=l.getIndexWithinParent()+u,f=o.getParentOrThrow(),h=[Mo(),...a];f.splice(d,0,h);const p=a[a.length-1];p?p.select():n.offset===0?l.selectPrevious():l.getNextSibling().selectNext(0,0)}if(fh(o)){const{offset:s}=t.anchor;o.splice(s,0,[Mo()]),o.select(s+1,s+1)}return null}canIndent(){return!1}collapseAtStart(){const t=Pt();return this.getChildren().forEach(r=>t.append(r)),this.replace(t),!0}setLanguage(t){const r=this.getWritable();return r.__language=t||void 0,r}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(t){const r=this.getWritable();return r.__isSyntaxHighlightSupported=t,r}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(t){const r=this.getWritable();return r.__theme=t||void 0,r}getTheme(){return this.getLatest().__theme}}function Hn(e,t){return JP(yd).setLanguage(e).setTheme(t)}function fh(e){return e instanceof yd}function cR(e){return{node:Hn(e.getAttribute(lf))}}function FX(e){const t=e,r=fR(t);return r||(function(n){let i=n.parentElement;for(;i!==null;){if(fR(i))return!0;i=i.parentElement}return!1})(t)?{node:r?Hn():null}:{node:null}}function IX(){return{node:Hn()}}function dR(){return{node:null}}function fR(e){return e.style.fontFamily.match("monospace")!==null}function d_(e){return e.classList.contains("js-file-line-container")}function PX(e){const{anchor:t}=e;if(e.isCollapsed()&&t.type==="element"){const r=t.getNode();if(fh(r)){const n=r.getChildrenSize();if(n>=2&&t.offset===n){const i=r.getLastChild();if(Qn(i)&&Qn(i.getPreviousSibling())){const o=Pt();return r.splice(n-2,2,[]).insertAfter(o,!1),o.select(),o}}}}return null}class Fm extends ca{__highlightType;constructor(t="",r,n){super(t,n),this.__highlightType=r}static getType(){return"code-highlight"}static clone(t){return new Fm(t.__text,t.__highlightType||void 0,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__highlightType=t.__highlightType}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(t){const r=this.getWritable();return r.__highlightType=t||void 0,r}canHaveFormat(){return!1}createDOM(t){const r=super.createDOM(t),n=f_(t.theme,this.__highlightType);return bs(r,n),r}updateDOM(t,r,n){const i=super.updateDOM(t,r,n),o=f_(n.theme,t.__highlightType),s=f_(n.theme,this.__highlightType);return o!==s&&(o&&pS(r,o),s&&bs(r,s)),i}static importJSON(t){return VO().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHighlightType(t.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(t){return this}isParentRequired(){return!0}createParentElementNode(){return Hn()}}function f_(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function VO(e="",t){return Vo(new Fm(e,t))}function KO(e){return e instanceof Fm}const HO="data-language";function WO(e){return e.style.fontFamily.match("monospace")!==null}function Jy(e){let t=e.parentElement;for(;t!==null;){if(WO(t))return!0;t=t.parentElement}return!1}const OX=NO([{$import:(e,t)=>e.$importChildren(t),match:vn.tag("tr","td"),name:"@lexical/code/github-code-table/unwrap"}]),MX={$import:(e,t)=>[Hn(t.getAttribute(HO)).splice(0,0,e.$importChildren(t))],match:vn.tag("pre"),name:"@lexical/code/pre"},LX={$import:(e,t,r)=>{const n=t.textContent||"";return/\r?\n/.test(n)||t.querySelector("br")!==null?[Hn(t.getAttribute(HO)).splice(0,0,e.$importChildren(t))]:r()},match:vn.tag("code"),name:"@lexical/code/code-multiline"};function Ip(e){if(!tt(e))return!1;const t=e.style.fontFamily,r=e.style.whiteSpace;return typeof t=="string"&&/monospace/i.test(t)&&typeof r=="string"&&r.startsWith("pre")}function zX(e){let t=!1;const r=[];let n="",i=!1;const o=()=>{i&&(r.push(n),n="",i=!1)};for(const s of Array.from(e.childNodes))if(tt(s))s.tagName==="DIV"?(o(),r.push(s.textContent||""),t=!0):s.tagName==="BR"?(o(),r.push(""),t=!0):(n+=s.textContent||"",i=!0);else if(gi(s)){const a=s.textContent||"";a.length>0&&(n+=a,i=!0)}return o(),t?r:null}vn.tag("div"),vn.tag("div","br");const UX={$import:(e,t,r)=>WO(t)?[Hn().splice(0,0,e.$importChildren(t))]:Jy(t)?e.$importChildren(t):r(),match:vn.tag("div"),name:"@lexical/code/div"};vn.tag("table").classAll("js-file-line-container"),vn.tag("td").classAll("js-file-line");const hR=new Set(["http:","https:","mailto:","sms:","tel:"]);let Kh=class GO extends fi{__url;__target;__rel;__title;static getType(){return"link"}static clone(t){return new GO(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t="",r={},n){super(n);const{target:i=null,rel:o=null,title:s=null}=r;this.__url=t,this.__target=i,this.__rel=o,this.__title=s}afterCloneFrom(t){super.afterCloneFrom(t),this.__url=t.__url,this.__rel=t.__rel,this.__target=t.__target,this.__title=t.__title}createDOM(t){const r=Yt().createElement("a");return this.updateLinkDOM(null,r,t),bs(r,t.theme.link),r}updateLinkDOM(t,r,n){if(HP(r)){t&&t.__url===this.__url||(r.href=this.sanitizeUrl(this.__url));for(const i of["target","rel","title"]){const o=`__${i}`,s=this[o];t&&t[o]===s||(s?r[i]=s:r.removeAttribute(i))}}}updateDOM(t,r,n){return this.updateLinkDOM(t,r,n),!1}static importDOM(){return{a:t=>({conversion:BX,priority:1})}}static importJSON(t){return Gc().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setURL(t.url).setRel(t.rel||null).setTarget(t.target||null).setTitle(t.title||null)}sanitizeUrl(t){const r=t;t=mR(t);try{const n=new URL(mR(t));if(!hR.has(n.protocol))return"about:blank"}catch{const i=r.replace(/[\u0000-\u001F\u007F\s]/g,"").match(/^([a-z][a-z0-9+.-]*):/i);if(i!=null&&!hR.has(`${i[1].toLowerCase()}:`))return"about:blank"}return t}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(t){const r=this.getWritable();return r.__url=t,r}getTarget(){return this.getLatest().__target}setTarget(t){const r=this.getWritable();return r.__target=t,r}getRel(){return this.getLatest().__rel}setRel(t){const r=this.getWritable();return r.__rel=t,r}getTitle(){return this.getLatest().__title}setTitle(t){const r=this.getWritable();return r.__title=t,r}insertNewAfter(t,r=!0){const n=Pn(this);return this.insertAfter(n,r),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,r,n){if(!te(r))return!1;const i=r.anchor.getNode(),o=r.focus.getNode();return(this.is(i)||this.isParentOf(i))&&(this.is(o)||this.isParentOf(o))&&r.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}shouldMergeAdjacentLink(t){return this.getType()===t.getType()&&this.__url===t.__url&&this.__target===t.__target&&this.__rel===t.__rel&&this.__title===t.__title}};function BX(e){let t=null;if(HP(e)){const r=e.textContent;(r!==null&&r!==""||e.children.length>0)&&(t=Gc(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Gc(e="",t){return Vo(new Kh(e,t))}function ts(e){return e instanceof Kh}let JO=class QO extends Kh{__isUnlinked;constructor(t="",r={},n){super(t,r,n),this.__isUnlinked=r.isUnlinked!==void 0&&r.isUnlinked!==null&&r.isUnlinked}afterCloneFrom(t){super.afterCloneFrom(t),this.__isUnlinked=t.__isUnlinked}static getType(){return"autolink"}static clone(t){return new QO(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}shouldMergeAdjacentLink(t){return!1}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(t){const r=this.getWritable();return r.__isUnlinked=t,r}createDOM(t){return this.__isUnlinked?Yt().createElement("span"):super.createDOM(t)}updateDOM(t,r,n){return super.updateDOM(t,r,n)||t.__isUnlinked!==this.__isUnlinked}static importJSON(t){return pR().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setIsUnlinked(t.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(t,r=!0){const n=pR(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,r),n}};function pR(e="",t){return Vo(new JO(e,t))}function oc(e){return e instanceof JO}function gR(e,t){if(e.type==="element"){const r=e.getNode();return U(r)||(function(n,...i){const o=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",n);for(const a of i)s.append("v",a);throw o.search=s.toString(),Error(`Minified Lexical error #${n}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),r.getChildren()[e.offset+t]||null}return null}function jX(e,t={}){let r;if(e&&typeof e=="object"){const{url:d,...f}=e;r=d,t={...f,...t}}else r=e;const{target:n,title:i}=t,o=t.rel===void 0?"noreferrer":t.rel,s=de();if(s===null||!te(s)&&!Wt(s))return;if(Wt(s)){const d=s.getNodes();return d.length===0?void 0:void d.forEach(f=>{if(r===null){const h=Kt(f,p=>!oc(p)&&ts(p));h&&(h.insertBefore(f),h.getChildren().length===0&&h.remove())}else{const h=Kt(f,p=>!oc(p)&&ts(p));if(h)h.setURL(r),n!==void 0&&h.setTarget(n),o!==void 0&&h.setRel(o);else{const p=Gc(r,{rel:o,target:n});f.insertBefore(p),p.append(f)}}})}if(s.isCollapsed()&&r===null)for(const d of s.getNodes()){const f=Kt(d,h=>!oc(h)&&ts(h));return void(f!==null&&(f.getParentOrThrow().splice(f.getIndexWithinParent(),0,f.getChildren()),f.remove()))}const a=s.extract();if(r===null){const d=new Set;return void a.forEach(f=>{const h=Kt(f,p=>!oc(p)&&ts(p));if(h!==null){const p=h.getKey();if(d.has(p))return;(function(g,m){const v=new Set(m.filter(R=>g.isParentOf(R)).map(R=>R.getKey())),_=g.getChildren(),x=R=>v.has(R.getKey())||U(R)&&m.some(N=>g.isParentOf(N)&&R.isParentOf(N)),w=_.filter(x);if(w.length===_.length)return _.forEach(R=>g.insertBefore(R)),void g.remove();const S=_.findIndex(x),k=_.findLastIndex(x),A=S===0,C=k===_.length-1;if(A)w.forEach(R=>g.insertBefore(R));else if(C)for(let R=w.length-1;R>=0;R--)g.insertAfter(w[R]);else{for(let N=w.length-1;N>=0;N--)g.insertAfter(w[N]);const R=_.slice(k+1);if(R.length>0){const N=Pn(g);w[w.length-1].insertAfter(N),R.forEach(I=>N.append(I))}}})(h,a),d.add(p)}})}const l=new Set,u=d=>{l.has(d.getKey())||(l.add(d.getKey()),d.setURL(r),n!==void 0&&d.setTarget(n),o!==void 0&&d.setRel(o),i!==void 0&&d.setTitle(i))};if(a.length===1){const d=a[0],f=Kt(d,ts);if(f!==null)return u(f)}(function(d){const f=de();if(!te(f))return d();const h=Pa(f),p=h.isBackward(),g=gR(h.anchor,p?-1:0),m=gR(h.focus,p?0:-1);if(d(),g||m){const v=de();if(te(v)){const _=v.clone();if(g){const x=g.getParent();x&&_.anchor.set(x.getKey(),g.getIndexWithinParent()+(p?1:0),"element")}if(m){const x=m.getParent();x&&_.focus.set(x.getKey(),m.getIndexWithinParent()+(p?0:1),"element")}gn(Pa(_))}}})(()=>{let d=null;for(const f of a){if(!f.isAttached())continue;const h=Kt(f,ts);if(h){u(h);continue}if(U(f)){if(!f.isInline())continue;if(ts(f)){if(!(oc(f)||d!==null&&d.getParentOrThrow().isParentOf(f))){u(f),d=f;continue}for(const g of f.getChildren())f.insertBefore(g);f.remove();continue}}const p=f.getPreviousSibling();ts(p)&&p.is(d)?p.append(f):(d=Gc(r,{rel:o,target:n,title:i}),f.insertAfter(d),d.append(f))}})}const qX=/^\+?[0-9\s()-]{5,}$/;function mR(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:qX.test(e)?`tel:${e}`:`https://${e}`}vn.tag("a");function wg(e,t,r=null){const n=VP(r),i=r?jP(r):[],o=r!==null&&i.length>0;if(o&&typeof n.caretPositionFromPoint=="function"){const s=n.caretPositionFromPoint(e,t,{shadowRoots:i});if(s!==null&&(function(a,l){for(let u=a;u!==null;){if(u===l)return!0;u=ku(u)}return!1})(s.offsetNode,r))return{node:s.offsetNode,offset:s.offset}}if(o){const s=r.getRootNode();if(ra(s)){const a=s.elementFromPoint(e,t);if(a!==null&&r.contains(a)){const l=(function(u,d,f,h){const p=h.createRange(),g=C=>d<C.top?C.top-d:d>C.bottom?d-C.bottom:0,m=C=>u<C.left?C.left-u:u>C.right?u-C.right:0,v=h.createTreeWalker(f,NodeFilter.SHOW_TEXT);let _=null,x=1/0,w=1/0;for(let C=v.nextNode();C;C=v.nextNode()){p.selectNodeContents(C);for(const R of p.getClientRects()){const N=g(R),I=m(R);(N<x||N===x&&I<w)&&(x=N,w=I,_=C)}}if(_===null)return null;let S=0,k=1/0,A=1/0;for(let C=0;C<=_.length;C++){p.setStart(_,C),p.collapse(!0);const R=p.getBoundingClientRect(),N=g(R),I=Math.abs(u-R.left);(N<k||N===k&&I<A)&&(k=N,A=I,S=C)}return{node:_,offset:S}})(e,t,a,n);if(l!==null)return l}}}if(typeof n.caretRangeFromPoint=="function"){const s=n.caretRangeFromPoint(e,t);return s===null?null:{node:s.startContainer,offset:s.startOffset}}if(typeof n.caretPositionFromPoint=="function"){const s=n.caretPositionFromPoint(e,t);return s===null?null:{node:s.offsetNode,offset:s.offset}}return null}function hc(e,...t){const r=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",e);for(const i of t)n.append("v",i);throw r.search=n.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Qy={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function VX(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:t=>t}).createHTML(e):e}const vR=(e,t)=>{if(!te(t))return t.insertRawText(e),!0;const r=n=>{const i=de();te(i)&&n(i)};return xP(e,{linebreak:()=>r(n=>n.insertParagraph()),tab:()=>r(n=>n.insertNodes([dd()])),text:n=>r(i=>i.insertText(n))}),!0},Yy={"application/x-lexical-editor":[(e,t,r)=>{try{const n=gr(),i=JSON.parse(e);if(i&&i.namespace===n._config.namespace&&Array.isArray(i.nodes))return _R(n,XX(i.nodes),t),!0}catch(n){console.error(n)}return r()}],"text/html":[(e,t,r)=>{try{const n=gr(),i=new DOMParser().parseFromString(VX(e),"text/html");return _R(n,dX(n,i),t),!0}catch(n){return console.error(n),r()}}],"text/plain":[vR],"text/uri-list":[vR]};function KX(e,t,r,n){if(!e)return!1;const i=o=>!!e[o]&&e[o](t,r,i.bind(null,o-1),n);return i(e.length-1)}function YO(e,t,r){const n=t.getData("text/plain");for(const i of(function(o){return Object.keys(o.$importMimeType).filter(s=>o.$importMimeType[s]!==void 0).sort((s,a)=>{const l=o.priority[s],u=o.priority[a];return l===void 0&&u===void 0?s<a?-1:s>a?1:0:l===void 0?1:u===void 0?-1:l-u})})(e)){const o=t.getData(i);if(o&&(i!=="text/html"||o!==n)&&KX(e.$importMimeType[i],o,r,t))return!0}return!1}const HX={$importMimeType:Yy,$insertDataTransfer:(e,t)=>YO({$importMimeType:Yy,priority:Qy},e,t),priority:Qy},WX={build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(r,n)=>YO(t,r,n),priority:t.priority}),config:{$importMimeType:Yy,priority:Qy},mergeConfig(e,t){const r=hS(e,t);if(t.$importMimeType){const n={...e.$importMimeType};for(const[i,o]of Object.entries(t.$importMimeType))if(o){const s=n[i];n[i]=s?[...s,...o]:o}r.$importMimeType=n}return t.priority&&(r.priority={...e.priority,...t.priority}),r},name:"@lexical/clipboard/Import"};function XO(e,t=de()){return t==null&&hc(166),te(t)&&t.isCollapsed()||t.getNodes().length===0?"":hX(e,t)}function ZO(e,t=de()){return t==null&&hc(166),te(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(YX(e,t))}function Xy(e,t,r){(function(){const n=wY(WX.name);return n?n.output:HX})().$insertDataTransfer(e,t)}const e6="application/x-lexical-drag";function GX(e,t){const r={editorKey:t.getKey()};e.setData(e6,JSON.stringify(r))}function JX(e,t,r){const n=e.dataTransfer;if(n===null)return!1;const i=(function(u){const d=u.getData(e6);if(!d)return null;let f;try{f=JSON.parse(d)}catch{return null}return(h=f)!==null&&typeof h=="object"&&"editorKey"in h&&typeof h.editorKey=="string"?f:null;var h})(n);if(i===null)return!1;const o=(function(u,d){const f=wg(u.clientX,u.clientY,d.getRootElement());if(f===null)return null;const h=cu(f.node);if(h===null)return null;if(ne(h))return rl(h,"next",f.offset);if(U(h))return Vy(h,f.offset,"next");const p=h.getParent();return p===null?null:Vy(p,h.getIndexWithinParent()+1,"next")})(e,t);if(o===null)return!1;const s=nO(o);if(s===null)return!1;const a=i.editorKey===t.getKey(),l=de();if(a){if(!te(l)||l.isCollapsed())return!1;if((function(u,d){const{anchor:f,focus:h}=fS(qy(d),"next");return uh(f,u)<0&&uh(u,h)<0})(o,l))return e.preventDefault(),!0;l.removeText()}if(!s.origin.isAttached())return e.preventDefault(),!0;if(r(n,ch($m(s)),t),!a){const u=t.getRootElement(),d=u?u.ownerDocument:null,f=d?(function(h,p){for(const g of qP(p)){const m=jh(g);if(wm(m)&&m.getKey()===h&&tt(g))return g}return null})(i.editorKey,d):null;f!==null&&f.dispatchEvent(new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteByDrag"}))}return e.preventDefault(),!0}function QX(e,t){return JX(e,t,Xy)}function _R(e,t,r){e.dispatchCommand(RJ,{nodes:t,selection:r})||(r.insertNodes(t),(function(n){if(te(n)&&n.isCollapsed()){const i=n.anchor;let o=null;const s=ui(i,"previous");if(s)if(eo(s))o=s.origin;else{const a=Do(s,ao(Kr(),"next").getFlipped());for(const l of a){if(ne(l.origin)){o=l.origin;break}if(U(l.origin)&&!l.origin.isInline())break}}if(o&&ne(o)){const a=o.getFormat(),l=o.getStyle();n.format===a&&n.style===l||(n.format=a,n.style=l,n.dirty=!0)}}})(r))}function Zy(e,t,r,n=[]){let i=t===null||r.isSelected(t);const o=U(r)&&r.excludeFromCopy("html");let s=r;t!==null&&ne(s)&&(s=aO(t,s,"clone"));const a=U(s)?s.getChildren():[],l=(function(d){const f=d.exportJSON(),h=d.constructor;if(f.type!==h.getType()&&hc(58,h.name),U(d)){const p=f.children;Array.isArray(p)||hc(59,h.name)}return f})(s);ne(s)&&s.getTextContentSize()===0&&(i=!1);const u=i&&Wt(t)&&U(r)?null:t;for(let d=0;d<a.length;d++){const f=a[d],h=Zy(e,u,f,l.children);!i&&U(r)&&h&&r.extractWithChild(f,t,"clone")&&(i=!0)}if(i&&!o){const d=Zi(s);if(d.length>0){const f={};for(const h of d){const p=hu(s,h);p===null&&hc(366,s.constructor.name,h);const g=[];Zy(e,null,p,g),g.length===1&&g[0].type===p.getType()||hc(385,h,s.constructor.name,String(g.length),String(g.length>0?g[0].type:"none")),f[h]=g[0]}l.$slots=f}}if(i&&!o)n.push(l);else if(Array.isArray(l.children))for(let d=0;d<l.children.length;d++){const f=l.children[d];n.push(f)}return i}function YX(e,t){const r=[],n=Kr(),i=te(t)?t.anchor.getNode():Wt(t)?t.getNodes()[0]??null:null,o=i!==null?Rm(i):null,s=(U(o)?o:n).getChildren();for(let a=0;a<s.length;a++)Zy(e,t,s[a],r);return{namespace:e._config.namespace,nodes:r}}function XX(e){const t=[];for(const r of e)t.push(cQ(r));return t}let Wu=null;async function bR(e,t,r){if(Wu!==null)return!1;if(t!==null)return new Promise((u,d)=>{e.update(()=>{u(yR(e,t,r))})});const n=e.getRootElement(),i=e._window||window,o=i.document,s=Yn(i);if(n===null||s===null)return!1;const a=o.createElement("span");a.style.position="fixed",a.style.top="-1000px",a.append(o.createTextNode("#")),n.append(a);const l=o.createRange();return l.setStart(a,0),l.setEnd(a,1),s.removeAllRanges(),s.addRange(l),new Promise((u,d)=>{const f=e.registerCommand(xm,h=>(Ma(h,ClipboardEvent)&&(f(),Wu!==null&&(i.clearTimeout(Wu),Wu=null),u(yR(e,h,r))),!0),mQ);Wu=i.setTimeout(()=>{f(),Wu=null,u(!1)},50),o.execCommand("copy"),a.remove()})}function yR(e,t,r){if(r===void 0){const i=Yn(e._window),o=de();if(!o||o.isCollapsed()||!i)return!1;const s=oo(i,e.getRootElement()),a=s.anchorNode,l=s.focusNode;if(a!==null&&l!==null&&!Bh(e,a,l))return!1;r=t6(o)}t.preventDefault();const n=t.clipboardData;return n!==null&&(r6(n,r),!0)}const ZX=[["text/html",XO],["application/x-lexical-editor",ZO]];function t6(e=de()){return(function(t,r){const n={"text/plain":""};for(const[i,o]of Object.entries(t))if(o){const s=tZ(o,r);s!==null&&(n[i]=s)}return n})(eZ(),e)}function r6(e,t){for(const[r]of ZX)t[r]===void 0&&e.setData(r,"");for(const r in t){const n=t[r];n!==void 0&&e.setData(r,n)}}function eZ(e=gr()){const t=qh(e,rZ.name);return t?t.output:n6}const n6={"application/x-lexical-editor":[(e,t)=>e?ZO(gr(),e):t()],"text/html":[(e,t)=>e?XO(gr(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function tZ(e,t){const r=n=>e[n]?e[n](t,r.bind(null,n-1)):null;return r(e.length-1)}const rZ={build:(e,t,r)=>t.$exportMimeType,config:{$exportMimeType:n6},mergeConfig(e,t){const r=hS(e,t);if(t.$exportMimeType){const n={...e.$exportMimeType};for(const[i,o]of Object.entries(t.$exportMimeType))if(o){const s=n[i];n[i]=s?[...s,...o]:o}r.$exportMimeType=n}return r},name:"@lexical/clipboard/GetClipboardData"},nZ={$import:(e,t)=>{const r=Qs(t.nodeName.toLowerCase());return Cu(t,r),ws(r,t),ho(r,t),[r.splice(0,0,e.$importChildren(t))]},match:vn.tag("h1","h2","h3","h4","h5","h6"),name:"@lexical/rich-text/heading"},iZ={$import:(e,t)=>{const r=Sd();return ws(r,t),Cu(t,r),ho(r,t),[r.splice(0,0,e.$importChildren(t))]},match:vn.tag("blockquote"),name:"@lexical/rich-text/blockquote"};vn.tag("blockquote");vn.tag("p"),vn.tag("span");const xR=je("DRAG_DROP_PASTE_FILE"),h_=Lh("shadowRoot",{parse:Boolean});class xd extends fi{static getType(){return"quote"}static clone(t){return new xd(t.__key)}$config(){return this.config("quote",{extends:fi,stateConfigs:[{flat:!0,stateConfig:h_}]})}isShadowRoot(){return zh(this,h_)}setIsShadowRoot(t){return xc(this,h_,t)}createDOM(t){const r=Yt().createElement("blockquote");return bs(r,t.theme.quote),r}updateDOM(t,r){return!1}static importDOM(){return{blockquote:t=>({conversion:oZ,priority:0})}}exportDOM(t){const{element:r}=super.exportDOM(t);if(tt(r)){this.isEmpty()&&r.append(Yt().createElement("br"));const n=this.getFormatType();n&&(r.style.textAlign=n);const i=this.getDirection();i&&(r.dir=i)}return{element:r}}static importJSON(t){return Sd().updateFromJSON(t)}exportJSON(){return super.exportJSON()}insertNewAfter(t,r){const n=Pt(),i=this.getDirection();return n.setDirection(i),this.insertAfter(n,r),n}collapseAtStart(){if(this.isShadowRoot()){for(const r of this.getChildren())this.insertBefore(r);return this.remove(),!0}const t=Pt();return this.getChildren().forEach(r=>t.append(r)),this.replace(t),!0}canMergeWhenEmpty(){return!0}}function Sd(e){const t=Vo(new xd);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function e1(e){return e instanceof xd}let Im=class i6 extends fi{__tag;static getType(){return"heading"}static clone(t){return new i6(t.__tag,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__tag=t.__tag}constructor(t="h1",r){super(r),this.__tag=t}getTag(){return this.getLatest().__tag}setTag(t){const r=this.getWritable();return r.__tag=t,r}createDOM(t){const r=this.__tag,n=Yt().createElement(r),i=t.theme.heading;if(i!==void 0){const o=i[r];bs(n,o)}return n}updateDOM(t,r,n){return t.__tag!==this.__tag}static importDOM(){return{h1:t=>({conversion:Gu,priority:0}),h2:t=>({conversion:Gu,priority:0}),h3:t=>({conversion:Gu,priority:0}),h4:t=>({conversion:Gu,priority:0}),h5:t=>({conversion:Gu,priority:0}),h6:t=>({conversion:Gu,priority:0}),p:t=>{const r=t.firstChild;return r!==null&&SR(r)?{conversion:()=>({node:null}),priority:3}:null},span:t=>SR(t)?{conversion:r=>({node:Qs("h1")}),priority:3}:null}}exportDOM(t){const{element:r}=super.exportDOM(t);if(tt(r)){this.isEmpty()&&r.append(Yt().createElement("br"));const n=this.getFormatType();n&&(r.style.textAlign=n);const i=this.getDirection();i&&(r.dir=i)}return{element:r}}static importJSON(t){return Qs(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,r=!0){const n=t?t.anchor.offset:0,i=this.getLastDescendant(),o=!i||t&&t.anchor.key===i.getKey()&&n===i.getTextContentSize()||!t?Pt():Qs(this.getTag()),s=this.getDirection();if(o.setDirection(s),this.insertAfter(o,r),n===0&&!this.isEmpty()&&t){const a=Pt();a.select(),this.replace(a,!0)}return o}collapseAtStart(){if(this.isEmpty()){const t=Pt();this.getChildren().forEach(r=>t.append(r)),this.replace(t)}return!0}extractWithChild(){return!0}};function SR(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function Gu(e){const t=e.nodeName.toLowerCase();let r=null;return t!=="h1"&&t!=="h2"&&t!=="h3"&&t!=="h4"&&t!=="h5"&&t!=="h6"||(r=Qs(t),Cu(e,r),ws(r,e),ho(r,e)),{node:r}}function oZ(e){const t=Sd();return ws(t,e),Cu(e,t),ho(t,e),{node:t}}function Qs(e="h1"){return Vo(new Im(e))}function sZ(e){return e instanceof Im}function ER(e){const t=cu(e);return ct(t)}function Ju(e,t,r,n){let i=!1,o=null;if(e.isCollapsed()&&e.anchor.type==="text"){const a=e.anchor.getNode();if(ne(a)){o=a;const l=e.anchor.offset,u=l===a.getTextContentSize()&&a.getNextSibling()===null,d=l===0&&a.getPreviousSibling()===null;i=r==="end"&&u||r==="start"&&d||r==="both"&&(u||d)}}let s=!1;for(const[a,l]of Object.entries(n)){if(l==null||!l[t])continue;const u=a;if(l.onlyAtBoundary){if(!(i&&o&&ne(o)&&o.hasFormat(u)))continue;s=!0}e.hasFormat(u)&&e.toggleFormat(u)}s&&e.setStyle("")}const aZ={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function Pp(e,t){return(function(r,n){if(!r.isCollapsed())return!1;const i=ui(r.focus,n),o=Kt(i.origin,Ac);if(!o)return!1;const s=r.focus.getNode();if(!o.is(s)&&!Hc(s,o))return!1;const a=Do(i,Nt(o,n));if(a.getTextSlices().some(f=>f&&f.getTextContentSize()>0))return!1;const l=Do(a.anchor.getSiblingCaret(),a.focus);let u=l.anchor.origin;for(const f of l){if(!tl(f)||!f.origin.is(u.getParent()))return!1;u=f.origin}let d=o;for(const f of Tm(Nt(o,n))){if(!f.origin.is(d.getParent())){if(D0(f.origin)){const h=Nt(d,n);return ch(Do(h,h)),!0}break}if(!Ac(f.origin))break;d=f.origin}return!1})(e,t)||(function(r,n){if(!r.isCollapsed()||r.anchor.type!=="element")return!1;const i=ui(r.anchor,n).getNodeAtCaret();return!(!Ac(i)||i.isInline()||(ch($m(Ri(ao(i,n)))),0))})(e,t)}function wR(e){return ct(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function Op(e){const t=cg();t.add(e),gn(t)}function kR(e,t){if(!e.isCollapsed())return!1;const r=e.focus,n=r.getNode(),i=t?"previous":"next",o=ui(r,i);if(r.type==="element"&&U(n)&&(Er(n)||Ac(n))){const _=o.getNodeAtCaret();return!(_===null||!wR(_))&&(Op(_.__key),!0)}const s=Kt(U(n)?n:n.getParentOrThrow(),_=>U(_)&&!_.isInline()&&Zt(_.getParent()));if(s===null)return!1;const a=Nt(s,i).getNodeAtCaret();if(a===null||!wR(a))return!1;if(s.getTextContentSize()===0)return Op(a.__key),!0;const l=gr().getRootElement();if(l===null)return!1;const u=Yn(l.ownerDocument.defaultView);if(u===null||u.rangeCount===0)return!1;const d=u.anchorNode,f=u.anchorOffset,h=u.focusNode,p=u.focusOffset;u.modify("move",t?"backward":"forward","line");const g=u.anchorNode,m=u.anchorOffset;if(g===null)return CR(u,d,f,h,p),!1;const v=cu(g);return CR(u,d,f,h,p),v===null?!1:(g===d&&m===f||!v.is(s)&&!Hc(v,s))&&(Op(a.__key),!0)}function CR(e,t,r,n,i){t!==null&&n!==null&&e.setBaseAndExtent(t,r,n,i)}function RR(e,t){if(!e.isCollapsed())return!1;const r=e.focus.getNode(),n=Kt(U(r)?r:r.getParentOrThrow(),v=>U(v)&&!v.isInline());if(n===null)return!1;const i=gr(),o=i.getRootElement();if(o===null)return!1;const s=o.ownerDocument.defaultView;if(s===null)return!1;let a=!1;for(const v of n.getChildren())if(U(v)&&v.isInline()){const _=i.getElementByKey(v.getKey());if(_!==null){const x=s.getComputedStyle(_).display;if(x==="inline-grid"||x==="inline-flex"){a=!0;break}}}if(!a)return!1;const l=Nt(n,t?"previous":"next").getNodeAtCaret();if(l===null||!U(l)){if(t){const v=n.getFirstDescendant();ne(v)?v.select(0,0):n.select(0,0)}else{const v=n.getLastDescendant();if(ne(v)){const _=v.getTextContentSize();v.select(_,_)}else{const _=n.getChildrenSize();n.select(_,_)}}return!0}const u=i.getElementByKey(l.getKey());if(u===null)return!1;const d=Yn(s);if(d===null||d.rangeCount===0)return!1;const f=d.getRangeAt(0).cloneRange();f.collapse(!0);const h=f.getBoundingClientRect(),p=u.getBoundingClientRect(),g=p.top+p.height/2;if(h.height>0){const v=wg(h.left,g,o);if(v!==null&&u.contains(v.node)){const _=o.ownerDocument.createRange();return _.setStart(v.node,v.offset),_.collapse(!0),e.applyDOMRange(_),e.dirty=!0,!0}}const m=t?l.getLastDescendant():l.getFirstDescendant();if(ne(m)){const v=t?m.getTextContentSize():0;m.select(v,v)}else{const v=l.getChildrenSize();l.select(t?v:0,t?v:0)}return!0}function Mp(e,t){const r=Nt(e,t),n=r.getAdjacentCaret();n!==null&&U(n.origin)&&!n.origin.isInline()&&n.origin.isShadowRoot()?ch($m(r)):t==="next"?e.selectNext(0,0):e.selectPrevious()}function AR(e,t,r){r.preventDefault(),r.stopPropagation();const n=e.getNodes();if(n.length===0)return!0;const i=n.map(l=>Nt(l,"next")).sort(uh),o=(t?i[0]:i[i.length-1]).origin,s=Kt(o,l=>l!==o&&U(l)&&!l.isInline())??Kr(),a=t?0:s.getChildrenSize();return s.select(a,a),!0}function lZ(e,t=fY(aZ)){return nl(e.registerCommand($I,()=>{const r=de();return Wt(r)?(r.clear(),!0):(te(r)&&Ju(r,"click","both",t.peek()),!1)},ut),e.registerCommand(Hl,r=>{const n=de();return te(n)?(n.deleteCharacter(r),!0):!!Wt(n)&&(n.deleteNodes(),!0)},ut),e.registerCommand(th,r=>{const n=de();return!!te(n)&&(n.deleteWord(r),!0)},ut),e.registerCommand(rh,r=>{const n=de();return!!te(n)&&(n.deleteLine(r),!0)},ut),e.registerCommand(Ec,r=>{const n=de();if(typeof r=="string")n!==null&&n.insertText(r);else{if(n===null)return!1;const i=r.dataTransfer;if(i!=null)Xy(i,n);else if(te(n)){const o=r.data;return o&&n.insertText(o),!0}}return!0},ut),e.registerCommand(R0,()=>{const r=de();return!!te(r)&&(r.removeText(),!0)},ut),e.registerCommand(Ao,r=>{const n=de();return!(!te(n)&&!Wt(n))&&(fP(n,r),!0)},ut),e.registerCommand(AJ,r=>{const n=de();return!(!te(n)&&!Wt(n))&&(nQ(n,r),!0)},ut),e.registerCommand(NJ,r=>{const n=de();if(!te(n)&&!Wt(n))return!1;const i=n.getNodes();for(const o of i){const s=Kt(o,a=>U(a)&&!a.isInline());s!==null&&s.setFormat(r)}return!0},ut),e.registerCommand(Sc,r=>{const n=de();return!!te(n)&&(n.insertLineBreak(r),!0)},ut),e.registerCommand(eh,()=>{const r=de();return!!te(r)&&(r.insertParagraph(),!0)},ut),e.registerCommand(TJ,()=>{const r=dd(),n=de();return te(n)&&(r.setFormat(n.format),r.setStyle(n.style)),sQ([r]),!0},ut),e.registerCommand($J,()=>KC(r=>{const n=r.getIndent();r.setIndent(n+1)}),ut),e.registerCommand(eC,()=>KC(r=>{const n=r.getIndent();n>0&&r.setIndent(Math.max(0,n-1))}),ut),e.registerCommand(UI,r=>{const n=de();if(Wt(n)){const i=n.getNodes();if(i.length>0)return r.preventDefault(),Mp(i[0],"previous"),!0}else if(te(n)&&(!r.shiftKey&&Pp(n,"previous")||!r.shiftKey&&kR(n,!0)||!r.shiftKey&&RR(n,!0)))return r.preventDefault(),!0;return!1},ut),e.registerCommand(BI,r=>{const n=de();if(Wt(n)){const i=n.getNodes();if(i.length>0)return r.preventDefault(),Mp(i[0],"next"),!0}else if(te(n)&&((function(i){const o=i.focus;return o.key==="root"&&o.offset===Kr().getChildrenSize()})(n)||!r.shiftKey&&Pp(n,"next")||!r.shiftKey&&kR(n,!1)||!r.shiftKey&&RR(n,!1)))return r.preventDefault(),!0;return!1},ut),e.registerCommand(LI,r=>{const n=de();if(Wt(n)){const i=n.getNodes();if(i.length>0)return r.preventDefault(),Mp(i[0],Tp(i[0])?"next":"previous"),!0}if(!te(n))return!1;if(!r.shiftKey&&Pp(n,Tp(n.anchor.getNode())?"next":"previous"))return r.preventDefault(),!0;if(r.shiftKey||Ju(n,"arrow","start",t.peek()),qC(n,!0)){const i=r.shiftKey;return r.preventDefault(),VC(n,i,!0),!0}return!1},ut),e.registerCommand(OI,r=>{const n=de();if(Wt(n)){const i=n.getNodes();if(i.length>0)return r.preventDefault(),Mp(i[0],Tp(i[0])?"previous":"next"),!0}if(!te(n))return!1;if(!r.shiftKey&&Pp(n,Tp(n.anchor.getNode())?"previous":"next"))return r.preventDefault(),!0;if(r.shiftKey||Ju(n,"arrow","end",t.peek()),qC(n,!1)){const i=r.shiftKey;return r.preventDefault(),VC(n,i,!1),!0}return!1},ut),e.registerCommand(Bx,r=>{const n=de();if(!Wt(n)&&ER(r.target))return!1;if(te(n)){if((function(i){if(!i.isCollapsed())return!1;const{anchor:o}=i;if(o.offset!==0)return!1;const s=o.getNode();if(Er(s))return!1;const a=cY(s);return a.getIndent()>0&&(a.is(s)||s.is(a.getFirstDescendant()))})(n))return r.preventDefault(),e.dispatchCommand(eC,void 0);if(el&&Bc)return!1}else if(!Wt(n))return!1;return r.preventDefault(),e.dispatchCommand(Hl,!0)},ut),e.registerCommand(VI,r=>{const n=de();return!(!Wt(n)&&ER(r.target))&&!(!te(n)&&!Wt(n))&&(r.preventDefault(),e.dispatchCommand(Hl,!1))},ut),e.registerCommand(nh,r=>{let n=de();if(Wt(n)){const i=n.getNodes();i.length===1&&ct(i[0])&&!i[0].isInline()&&(n=i[0].selectNext())}if(!te(n))return!1;if(Ju(n,"enter","both",t.peek()),r!==null){if((el||Oh||Mh)&&Bc)return!1;if(r.preventDefault(),r.shiftKey)return e.dispatchCommand(Sc,!1)}return e.dispatchCommand(eh,void 0)},ut),e.registerCommand(qI,()=>{const r=de();return!!te(r)&&(e.blur(),!0)},ut),e.registerCommand(HI,r=>{const[,n]=$p(r);if(n.length>0){const i=r.clientX,o=r.clientY,s=wg(i,o,e.getRootElement());if(s!==null){const{offset:a,node:l}=s,u=cu(l);if(u!==null){const d=Vx();if(ne(u))d.anchor.set(u.getKey(),a,"text"),d.focus.set(u.getKey(),a,"text");else{const h=u.getParentOrThrow().getKey(),p=u.getIndexWithinParent()+1;d.anchor.set(h,p,"element"),d.focus.set(h,p,"element")}const f=Pa(d);gn(f)}e.dispatchCommand(xR,n)}return r.preventDefault(),!0}return QX(r,e)},ut),e.registerCommand(WI,r=>{const[n]=$p(r),i=de();return!(n&&!te(i))&&(te(i)&&!i.isCollapsed()&&r.dataTransfer!==null&&(r6(r.dataTransfer,t6(i)),GX(r.dataTransfer,e)),!0)},ut),e.registerCommand(GI,r=>{const[n]=$p(r),i=de();if(n&&!te(i))return!1;const o=r.clientX,s=r.clientY,a=wg(o,s,e.getRootElement());if(a!==null){const l=cu(a.node);ct(l)&&r.preventDefault()}return!0},ut),e.registerCommand(JI,()=>{const r=de();return wQ(te(r)&&Rm(r.anchor.getNode())!==null?r:null),!0},ut),e.registerCommand(xm,r=>(bR(e,Ma(r,ClipboardEvent)?r:null),!0),ut),e.registerCommand(jx,r=>((async function(n,i){await bR(i,Ma(n,ClipboardEvent)?n:null),i.update(()=>{const o=de();te(o)?o.removeText():Wt(o)&&o.getNodes().forEach(s=>s.remove())},{tag:oP})})(r,e),!0),ut),e.registerCommand(Ux,r=>{const[,n,i]=$p(r);return n.length>0&&!i?(e.dispatchCommand(xR,n),!0):_d(r.target)&&Xx(r.target)?!1:de()!==null&&((function(o,s){o.preventDefault(),s.update(()=>{const a=de(),l=Ma(o,InputEvent)||Ma(o,KeyboardEvent)?null:o.clipboardData;l!=null&&a!==null&&Xy(l,a)},{tag:iP})})(r,e),!0)},ut),e.registerCommand(jI,()=>{const r=de();return te(r)&&Ju(r,"space","both",t.peek()),!1},ut),e.registerCommand(KI,()=>{const r=de();return te(r)&&Ju(r,"tab","both",t.peek()),!1},ut),e.registerCommand(MI,r=>{const n=de();if(Wt(n))return AR(n,!1,r);if(!te(n))return!1;const{anchor:i}=n;if(i.type!=="element"||i.offset!==0)return!1;const o=i.getNode();if(!U(o))return!1;const s=o.getFirstChild();if(!ct(s)||!s.isInline())return!1;const a=o.getKey(),l=o.selectEnd();return r.shiftKey&&l.anchor.set(a,0,"element"),r.preventDefault(),r.stopPropagation(),!0},ut),e.registerCommand(zI,r=>{const n=de();if(Wt(n))return AR(n,!0,r);if(!te(n))return!1;const{anchor:i,focus:o}=n,s=Kt(o.getNode(),u=>U(u)&&!u.isInline());if(s===null)return!1;const a=s.getFirstChild();if(!ct(a)||!a.isInline()||Kt(i.getNode(),u=>U(u)&&!u.isInline())!==s)return!1;const l=s.getKey();return(o.type!=="element"||o.key!==l||o.offset!==0)&&(n.focus.set(l,0,"element"),r.shiftKey||n.anchor.set(l,0,"element"),r.preventDefault(),r.stopPropagation(),!0)},ut))}function t1(e,t){const r={};for(const n of e){const i=t(n);i&&(r[i]?r[i].push(n):r[i]=[n])}return r}function ES(e){const t=t1(e,r=>r.type);return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}const TR=/[!-/:-@[-`{-~\s]/,$R=/\s/,r1=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,uZ=/^\s{0,3}$/;function n1(e){if(!md(e))return!1;const t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&ne(t)&&uZ.test(t.getTextContent())}function i1(e){return e.replace(/\\([!-/:-@[-`{-~])/g,"$1").replace(/&#(\d+);/g,(t,r)=>String.fromCodePoint(Number(r)))}const o6=/^(\s*)(\d{1,})\.\s/,s6=/^(\s*)[-*+]\s/,cZ=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,o1=/^(#{1,6})\s/,a6=/^>\s/,l6=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,s1=/^[ \t]*`{3,}$/,dZ=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,fZ=/^(?:\|)(.+)(?:\|)\s?$/;function hZ(e){if(e[0]!=="|")return!1;const{length:t}=e;let r=1,n=0;for(;r<t;){let i=r;for(e[i]===" "&&i++,e[i]===":"&&i++;e[i]==="-";)i++;if(e[i]===":"&&i++,e[i]===" "&&i++,e[i]!=="|")break;n++,r=i+1}return n>0&&(r===t||r===t-1&&/\s/.test(e[r]))}const NR=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,DR=/^<\/[a-z_][\w-]*\s*>/i,FR=e=>new RegExp(`(?:${e.source})$`,e.flags),uf=Lh("mdListMarker",{parse:e=>typeof e=="string"&&/^[-*+]$/.test(e)?e:"-",resetOnCopyNode:!0}),IR=Lh("mdCodeFence",{parse:e=>typeof e=="string"&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),u6=Lh("mdHardLineBreak",{parse:e=>typeof e=="string"&&/^(\\| {2,})$/.test(e)?e:"",resetOnCopyNode:!0});function a1(e){if(e.endsWith("\\"))return[e.slice(0,-1),"\\"];const t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}function pZ(e){const t=e.getChildren(),r=t.length-1,n=t[r];if(!ne(n))return null;const i=n.getTextContent(),o=a1(i);if(o!==null){const[s,a]=o;return n.setTextContent(s),a}return/^ {2,}$/.test(i)&&(function(s,a){for(let l=a-1;l>=0;l--){if(Qn(s[l]))return!1;if(/\S/.test(s[l].getTextContent()))return!0}return!1})(t,r)?(n.setTextContent(""),i):null}function c6(e){const t=Mo(),r=pZ(e);return r!==null&&xc(t,u6,r),t}const d6=e=>(t,r,n,i)=>{const o=e(n);o.append(...r),t.replace(o),i||o.select(0,0)},f6=e=>(t,r,n,i)=>{const o=t.getPreviousSibling(),s=t.getNextSibling(),a=ys(e==="check"?n[3]==="x":void 0),l=n[0].trim()[0],u=e!=="bullet"&&e!=="check"||l!==uf.parse(l)?void 0:l;if(at(s)&&s.getListType()===e){u&&xc(s,uf,u);const f=s.getFirstChild();f!==null?f.insertBefore(a):s.append(a),e==="number"&&s.setStart(Number(n[2])),t.remove()}else if(at(o)&&o.getListType()===e)u&&xc(o,uf,u),o.append(a),t.remove();else{const f=Fo(e,e==="number"?Number(n[2]):void 0);u&&xc(f,uf,u),f.append(a),t.replace(f)}a.append(...r),i||a.select(0,0);const d=(function(f){const h=f.match(/\t/g),p=f.match(/ /g);let g=0;return h&&(g+=h.length),p&&(g+=Math.floor(p.length/4)),g})(n[1]);d&&a.setIndent(d)},wS=(e,t,r,n)=>{const i=[],o=e.getChildren();let s=0;for(const a of o)if(Rt(a)){if(a.getChildrenSize()===1){const p=a.getFirstChild();if(at(p)){const g=wS(p,t,r+1,n);g&&i.push(g);continue}}if(n&&!a.getChildren().some(p=>p.isSelected(n)))continue;const l=" ".repeat(4*r),u=e.getListType(),d=zh(e,uf),f=u==="number"?`${e.getStart()+s}. `:u==="check"?`${d} [${a.getChecked()?"x":" "}] `:d+" ";let h=t(a);u!=="number"&&(h=h.replace(/^(\s{0,3}\d+)(\.\s)/,"$1\\$2")),i.push(l+f+h),s++}return i.join(`
29
- `)},gZ={dependencies:[Im],export:(e,t)=>{if(!sZ(e))return null;const r=Number(e.getTag().slice(1));return"#".repeat(r)+" "+t(e)},regExp:o1,replace:d6(e=>{const t="h"+e[1].length;return Qs(t)}),triggerOnEnter:!0,type:"element"},mZ={dependencies:[xd],export:(e,t)=>{if(!e1(e))return null;const r=t(e).split(`
30
- `),n=[];for(const i of r)n.push("> "+i);return n.join(`
31
- `)},regExp:a6,replace:(e,t,r,n)=>{if(n){const o=e.getPreviousSibling();if(e1(o))return o.splice(o.getChildrenSize(),0,[c6(o),...t]),void e.remove()}const i=Sd();i.append(...t),e.replace(i),n||i.select(0,0)},triggerOnEnter:!0,type:"element"},P0={dependencies:[yd],export:e=>{if(!fh(e))return null;const t=e.getTextContent();let r=zh(e,IR);if(t.indexOf(r)>-1){const n=t.match(/`{3,}/g);if(n){const i=Math.max(...n.map(o=>o.length));r="`".repeat(i+1)}}return r+(e.getLanguage()||"")+(t?`
32
- `+t:"")+`
33
- `+r},handleImportAfterStartMatch:({lines:e,rootNode:t,startLineIndex:r,startMatch:n})=>{const i=n[1],o=i.trim().length,s=e[r],a=n.index+i.length,l=s.slice(a),u=new RegExp(`\`{${o},}$`);if(u.test(l)){const p=l.match(u),g=l.slice(0,l.lastIndexOf(p[0])),m=[...n];return m[2]="",P0.replace(t,null,m,p,[g],!0),[!0,r]}const d=new RegExp(`^[ \\t]*\`{${o},}$`);for(let p=r+1;p<e.length;p++){const g=e[p];if(d.test(g)){const m=g.match(d),v=e.slice(r+1,p),_=s.slice(n[0].length);return _.length>0&&v.unshift(_),P0.replace(t,null,n,m,v,!0),[!0,p]}}const f=e.slice(r+1),h=s.slice(n[0].length);return h.length>0&&f.unshift(h),P0.replace(t,null,n,null,f,!0),[!0,e.length-1]},regExpEnd:{optional:!0,regExp:s1},regExpStart:l6,replace:(e,t,r,n,i,o)=>{let s,a;const l=r[1]?r[1].trim():"```",u=r[2]||void 0;if(!t&&i){if(i.length===1)n?(s=Hn(u),a=i[0]):(s=Hn(u),a=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{for(s=Hn(u),i.length>0&&(i[0].trim().length===0?i.shift():i[0].startsWith(" ")&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();a=i.join(`
34
- `)}xc(s,IR,l);const d=Sr(a);s.append(d),e.append(s)}else t&&d6(d=>Hn(d?d[2]:void 0))(e,t,r,o)},type:"multiline-element"},vZ={dependencies:[Vh,Tu],export:(e,t,r)=>at(e)?wS(e,t,0,r):null,regExp:s6,replace:f6("bullet"),triggerOnEnter:!0,type:"element"},_Z={dependencies:[Vh,Tu],export:(e,t,r)=>at(e)?wS(e,t,0,r):null,regExp:o6,replace:f6("number"),triggerOnEnter:!0,type:"element"},bZ={format:["code"],tag:"`",type:"text-format"},yZ={format:["highlight"],tag:"==",type:"text-format"},xZ={format:["bold","italic"],tag:"***",type:"text-format"},SZ={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},EZ={format:["bold"],tag:"**",type:"text-format"},wZ={format:["bold"],intraword:!1,tag:"__",type:"text-format"},kZ={format:["strikethrough"],tag:"~~",type:"text-format"},CZ={format:["italic"],tag:"*",type:"text-format"},RZ={format:["italic"],intraword:!1,tag:"_",type:"text-format"},AZ={dependencies:[Kh],export:(e,t,r)=>{if(!ts(e)||oc(e))return null;const n=t(e);let i=e.getTitle();return i!=null&&(i=i.replace(/([\\"])/g,"\\$1")),i?`[${n}](${e.getURL()} "${i}")`:`[${n}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{if(Kt(e,ts))return;const[,r,n,i]=t,o=n!=null?i1(n):void 0,s=i!=null?i1(i):void 0,a=Gc(o,{title:s}),l=r.split("[").length-1,u=r.split("]").length-1;let d=r,f="";if(l<u)return;if(l>u){const p=r.split("[");f="["+p[0],d=p.slice(1).join("[")}const h=Sr(d);return h.setFormat(e.getFormat()),a.append(h),e.replace(a),f&&a.insertBefore(Sr(f)),h},trigger:")",type:"text-match"},TZ=[gZ,mZ,vZ,_Z],$Z=[P0],NZ=[bZ,xZ,SZ,EZ,wZ,yZ,CZ,RZ,kZ],DZ=[AZ],Wa=[...TZ,...$Z,...NZ,...DZ];function FZ(e,t=!1){const r=e.split(`
35
- `);let n=0;const i=[];for(let o=0;o<r.length;o++){const s=r[o],a=s.trimEnd(),l=i[i.length-1],u=o<r.length-1?a1(s):null,d=l!==void 0&&a1(l)!==null;if(dZ.test(a))i.push(a);else if(n===0){{const f=a.match(l6);if(f){n=f[1].trim().length,i.push(a);continue}}a===""||l===""||!l||o1.test(l)||o1.test(a)||a6.test(a)||o6.test(a)||s6.test(a)||cZ.test(a)||fZ.test(a)||hZ(a)||d||!t||NR.test(a)||DR.test(a)||FR(DR).test(l)||FR(NR).test(l)||s1.test(l)?i.push(!t&&a!==""||u!==null?s:a):i[i.length-1]=l+" "+(u===null?a:s).trimStart()}else{if(s1.test(a)&&a.trim().length>=n){n=0,i.push(a);continue}i.push(s)}}return i.join(`
36
- `)}function IZ(e,t,r,n,i){for(const o of t){if(!o.export)continue;const s=o.export(e,a=>kg(a,r,n,void 0,void 0,i));if(s!=null)return s}return U(e)?kg(e,r,n,void 0,void 0,i):ct(e)?e.getTextContent():null}function kg(e,t,r,n,i,o=!1){const s=[],a=e.getChildren();n||(n=[]),i||(i=[]);e:for(const l of a){for(const u of r){if(!u.export)continue;const d=u.export(l,f=>kg(f,t,r,n,[...i,...n],o),(f,h)=>PR(f,h,t,n,i,o));if(d!=null){s.push(d);continue e}}Qn(l)?s.push(PZ(l)):ne(l)?s.push(PR(l,l.getTextContent(),t,n,i,o)):U(l)?s.push(kg(l,t,r,n,i,o)):ct(l)&&s.push(l.getTextContent())}return s.join("")}function PZ(e){return zh(e,u6)+`
37
- `}function PR(e,t,r,n,i,o=!1){const s=e.hasFormat("code");let a,l,u,d,f=t;if(s||(f=o?f.replace(/([*_`~])/g,"\\$1"):f.replace(/([*_`~\\])/g,"\\$1")),s){const{fence:x,padded:w}=(function(S){const k=S.match(/`+/g),A=k?Math.max(...k.map(C=>C.length)):0;return{fence:"`".repeat(A+1),padded:S.length===0||S.includes("`")||/^\s/.test(S)&&/\s$/.test(S)?` ${S} `:S}})(t);a="",u="",l=x+w+x,d=!1}else{const x=f.match(/^(\s*)(.*?)(\s*)$/s)||["","",f,""];a=x[1],l=x[2],u=x[3],d=l===""}let h="",p="",g="";const m=OR(e,!0),v=OR(e,!1),_=new Set;for(const x of r){const w=x.format[0],S=x.tag;w!=="code"&&MR(e,w)&&!_.has(w)&&(_.add(w),MR(m,w)&&n.find(k=>k.tag===S)||(n.push({format:w,tag:S}),h+=S))}for(let x=0;x<n.length;x++){const w=l1(e,n[x].format),S=l1(v,n[x].format);if(w&&S)continue;const k=[...n];for(;k.length>x;){const A=k.pop();i&&A&&i.find(C=>C.tag===A.tag)||(A&&typeof A.tag=="string"&&(w?S||(g+=A.tag):p+=A.tag),n.pop())}break}return d&&!e.hasFormat("code")?p+f:p+a+h+l+g+u}function OR(e,t){const r=t?e.getPreviousSibling():e.getNextSibling();return ne(r)?r:null}function l1(e,t){return ne(e)&&e.hasFormat(t)}function MR(e,t){return!!l1(e,t)&&(t==="code"||!e||!/^\s*$/.test(e.getTextContent()))}function OZ(e,t){const r=e.getTextContent(),n=t.transformersByTag["`"],i=[];let o=null;if(n){const f=(function(h){const p=x=>{let w=0;for(let S=x-1;S>=0&&h[S]==="\\";S--)w++;return w%2==1},g=[];let m=0;for(;m<h.length;)if(h[m]==="`"){let x=1;for(;m+x<h.length&&h[m+x]==="`";)x++;g.push({index:m,length:x}),m+=x}else m++;const v=[];let _=0;for(;_<g.length;){const x=g[_];if(p(x.index)){_++;continue}let w=-1;for(let A=_+1;A<g.length;A++)if(g[A].length===x.length){w=A;break}if(w===-1){_++;continue}const S=g[w];let k=h.slice(x.index+x.length,S.index);k.length>=2&&k.startsWith(" ")&&k.endsWith(" ")&&/[^ ]/.test(k)&&(k=k.slice(1,-1)),v.push({content:k,endIndex:S.index+S.length,startIndex:x.index}),_=w+1}return v})(r);for(const h of f)o||(o={content:h.content,endIndex:h.endIndex,startIndex:h.startIndex,tag:"`"}),i.push({end:h.endIndex,start:h.startIndex})}const s=(function(f,h,p=[]){const g=[],m=new Set(Object.keys(h.transformersByTag).filter(w=>w[0]!=="`").map(w=>w[0])),v=w=>{let S=0;for(let k=w-1;k>=0&&f[k]==="\\";k--)S++;return S%2==1},_=w=>p.some(S=>w>=S.start&&w<S.end);let x=0;for(;x<f.length;){const w=f[x];if(!m.has(w)||v(x)||_(x)){x++;continue}let S=1;for(;x+S<f.length&&f[x+S]===w;)S++;const k=LR(w,f,x,S,!0),A=LR(w,f,x,S,!1);(k||A)&&g.push({active:!0,canClose:A,canOpen:k,char:w,index:x,length:S}),x+=S}return g})(r,t,i),a=s.length>0?(function(f,h,p){const g={};let m=0,v=null;for(;m<h.length;){const _=h[m];if(!_.active||!_.canClose||_.length===0){m++;continue}const x=`${_.char}${_.canOpen}${_.length%3}`,w=g[x]??-1;let S=!1;for(let k=m-1;k>w;k--){const A=h[k];if(!A.active||!A.canOpen||A.length===0||A.char!==_.char||(A.canClose||_.canOpen)&&(A.length+_.length)%3==0&&A.length%3!=0&&_.length%3!=0)continue;const C=Math.min(A.length,_.length),R=Object.keys(p.transformersByTag).filter(P=>P[0]===A.char&&P.length<=C).sort((P,z)=>z.length-P.length)[0];if(!R)continue;S=!0;const N=R.length,I={content:f.slice(A.index+A.length,_.index),endIndex:_.index+N,startIndex:A.index+(A.length-N),tag:R};(!v||I.startIndex<v.startIndex||I.startIndex===v.startIndex&&I.endIndex>v.endIndex)&&(v=I);for(let P=k+1;P<m;P++)h[P].active=!1;A.length-=N,_.length-=N,A.active=A.length>0,_.length>0?_.index+=N:(_.active=!1,m++);break}S||(g[x]=m-1,_.canOpen||(_.active=!1),m++)}return v})(r,s,t):null;let l=null,u=null;if(o&&a?a.startIndex<=o.startIndex&&a.endIndex>=o.endIndex?(l=a,u=t.transformersByTag[a.tag]):(l=o,u=n):o?(l=o,u=n):a&&(l=a,u=t.transformersByTag[a.tag]),!l||!u)return null;const d=[r.slice(l.startIndex,l.endIndex),l.tag,l.content];return d.index=l.startIndex,d.input=r,{endIndex:l.endIndex,isCodeSpan:u===n,match:d,startIndex:l.startIndex,transformer:u}}function LR(e,t,r,n,i){if(!zR(t,r,n,i))return!1;if(e==="*")return!0;if(e==="_"){if(!zR(t,r,n,!i))return!0;const o=i?t[r-1]:t[r+n];return o!==void 0&&r1.test(o)}return!0}function zR(e,t,r,n){const i=e[t-1],o=e[t+r],[s,a]=n?[o,i]:[i,o];return s!==void 0&&!$R.test(s)&&(!r1.test(s)||a===void 0||$R.test(a)||r1.test(a))}function Ca(e){return ne(e)&&!e.hasFormat("code")}function Fl(e,t,r){let n=OZ(e,t),i=(function(s,a){const l=s;let u,d,f,h;for(const p of a){if(!p.replace||!p.importRegExp)continue;const g=l.getTextContent().match(p.importRegExp);if(!g)continue;const m=g.index||0,v=p.getEndIndex?p.getEndIndex(l,g):m+g[0].length;v!==!1&&(u===void 0||d===void 0||m<u&&(v>d||v<=u))&&(u=m,d=v,f=p,h=g)}return u===void 0||d===void 0||f===void 0||h===void 0?null:{endIndex:d,match:h,startIndex:u,transformer:f}})(e,r);if(n&&i&&(n.isCodeSpan?i.startIndex<=n.startIndex&&i.endIndex>=n.endIndex?n=null:i=null:n.startIndex<=i.startIndex&&n.endIndex>=i.endIndex||i.startIndex>n.endIndex?i=null:n=null),n){const s=(function(a,l,u,d,f){const h=a.getTextContent();let p,g,m;if(f[0]===h?p=a:l===0?[p,g]=a.splitText(u):[m,p,g]=a.splitText(l,u),p.setTextContent(f[2]),d)for(const v of d.format)p.hasFormat(v)||p.toggleFormat(v);return{nodeAfter:g,nodeBefore:m,transformedNode:p}})(e,n.startIndex,n.endIndex,n.transformer,n.match);Ca(s.nodeAfter)&&Fl(s.nodeAfter,t,r),Ca(s.nodeBefore)&&Fl(s.nodeBefore,t,r),Ca(s.transformedNode)&&Fl(s.transformedNode,t,r)}else if(i){const s=(function(a,l,u,d,f){let h,p,g;return l===0?[h,p]=a.splitText(u):[g,h,p]=a.splitText(l,u),d.replace?{nodeAfter:p,nodeBefore:g,transformedNode:d.replace(h,f)||void 0}:null})(e,i.startIndex,i.endIndex,i.transformer,i.match);if(!s)return;Ca(s.nodeAfter)&&Fl(s.nodeAfter,t,r),Ca(s.nodeBefore)&&Fl(s.nodeBefore,t,r),Ca(s.transformedNode)&&Fl(s.transformedNode,t,r)}const o=i1(e.getTextContent());e.setTextContent(o)}function MZ(e,t,r,n=!1){const i=ES(r),o=(function(u){const d={},f={},h=[];for(const p of u){const{tag:g}=p;d[g]=p;const m=g.replace(/(\*|\^|\+)/g,"\\$1");h.push(m),g.length===1?f[g]=g==="`"?new RegExp("(^|[^\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(^|[^\\\\${m}])(${m})((\\\\${m})?.*?[^${m}\\s](\\\\${m})?)(${m})(?![\\\\${m}])`):f[g]=new RegExp(`(^|[^\\\\])(${m})((\\\\${m})?.*?[^\\s](\\\\${m})?)(${m})(?!\\\\)`)}return{fullMatchRegExpByTag:f,openTagsRegExp:new RegExp(`(${h.join("|")})`,"g"),transformersByTag:d}})(i.textFormat),s=e.split(`
38
- `),a=s.length;for(let u=0;u<a;u++){const d=s[u],[f,h]=LZ(s,u,i.multilineElement,t);f?u=h:zZ(d,t,i.element,o,i.textMatch,n)}const l=t.getChildren();for(const u of l)if(!n&&n1(u)&&t.getChildrenSize()>1)u.remove();else if(U(u))for(const d of u.getAllTextNodes())UZ(d)}function LZ(e,t,r,n){for(const i of r){const{handleImportAfterStartMatch:o,regExpEnd:s,regExpStart:a,replace:l}=i,u=e[t].match(a);if(!u)continue;if(o){const g=o({lines:e,rootNode:n,startLineIndex:t,startMatch:u,transformer:i});if(g===null)continue;if(g)return g}const d=typeof s=="object"&&"regExp"in s?s.regExp:s,f=s&&typeof s=="object"&&"optional"in s?s.optional:!s;let h=t;const p=e.length;for(;h<p;){const g=d?e[h].match(d):null;if(!g&&(!f||f&&h<p-1)){h++;continue}if(g&&t===h&&g.index===u.index){h++;continue}const m=[];if(g&&t===h)m.push(e[t].slice(u[0].length,-g[0].length));else for(let v=t;v<=h;v++)if(v===t){const _=e[v].slice(u[0].length);m.push(_)}else if(v===h&&g){const _=e[v].slice(0,-g[0].length);m.push(_)}else m.push(e[v]);if(l(n,null,u,g,m,!0)!==!1)return[!0,h];break}}return[!1,t]}function zZ(e,t,r,n,i,o){const s=Sr(e),a=Pt();a.append(s),t.append(a);for(const{regExp:l,replace:u}of r){const d=e.match(l);if(d&&(s.setTextContent(e.slice(d[0].length)),u(a,[s],d,!0)!==!1))break}if(Fl(s,n,i),a.getParent()!==null&&e.length>0){const l=a.getPreviousSibling();if(!o&&(md(l)||e1(l)||at(l))){let u=l;if(at(l)){const d=l.getLastDescendant();u=d==null?null:Kt(d,Rt)}u!=null&&u.getTextContentSize()>0&&(u.splice(u.getChildrenSize(),0,[c6(u),...a.getChildren()]),a.remove())}}}function UZ(e){const t=new Set,r=e.getTextContent();let n=r.indexOf(" ");for(;n!==-1;)t.add(n),t.add(n+1),n=r.indexOf(" ",n+1);e.splitText(...t).forEach(i=>{i.getTextContent()===" "&&i.replace(dd())})}function BZ(e,...t){const r=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",e);for(const i of t)n.append("v",i);throw r.search=n.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function UR(e,t,r,n,i){const o=e.getParent();if(!Zt(o)||e.getFirstChild()!==t)return!1;const s=t.getTextContent();if(!i&&s[r-1]!==" ")return!1;for(const{regExp:a,replace:l}of n){const u=s.match(a),d=i||u&&u[0].endsWith(" ")?r:r-1;if(u&&u[0].length===d){const f=t.getNextSiblings(),[h,p]=t.splitText(r);if(l(e,p?[p,...f]:f,u,!1)!==!1)return h.remove(),!0}}return!1}function BR(e,t,r,n,i){const o=e.getParent();if(!Zt(o)||e.getFirstChild()!==t)return!1;const s=t.getTextContent();if(!i&&s[r-1]!==" ")return!1;for(const{regExpStart:a,replace:l,regExpEnd:u}of n){if(u&&!("optional"in u)||u&&"optional"in u&&!u.optional)continue;const d=s.match(a);if(d){const f=i||d[0].endsWith(" ")?r:r-1;if(d[0].length!==f)continue;const h=t.getNextSiblings(),[p,g]=t.splitText(r);if(l(e,g?[g,...h]:h,d,null,null,!1)!==!1)return p.remove(),!0}}return!1}function jZ(e,t){let r=0;const n=e.getTextContent();for(let i=0;i<t;i++)n[i]==="`"&&r++;return r%2!=0}function jR(e,t,r){const n=r.length;for(let i=t;i>=n;i--){const o=i-n;if(h6(e,o,r,0,n)&&e[o+n]!==" ")return o}return-1}function h6(e,t,r,n,i){for(let o=0;o<i;o++)if(e[t+o]!==r[n+o])return!1;return!0}function qZ(e,t=Wa){const r=ES(t),n=r.element.filter(l=>l.triggerOnEnter),i=t1(r.textFormat,({tag:l})=>l[l.length-1]),o=t1(r.textMatch,({trigger:l})=>l),s=new Set([" "]);for(const l of r.textFormat)s.add(l.tag.slice(-1));for(const l of r.textMatch)l.trigger!==void 0&&s.add(l.trigger);for(const l of t){const u=l.type;if(u==="element"||u==="text-match"||u==="multiline-element"){const d=l.dependencies;for(const f of d)e.hasNode(f)||BZ(173,f.getType())}}const a=(l,u,d)=>!!UR(l,u,d,r.element)||!!BR(l,u,d,r.multilineElement)||!!(function(f,h,p){let g=f.getTextContent();const m=p[g[h-1]];if(m==null)return!1;h<g.length&&(g=g.slice(0,h));for(const v of m){if(!v.replace||!v.regExp)continue;const _=g.match(v.regExp);if(_===null)continue;const x=_.index||0,w=x+_[0].length;let S;return x===0?[S]=f.splitText(w):[,S]=f.splitText(x,w),S.selectNext(0,0),v.replace(S,_),!0}return!1})(u,d,o)||!!(function(f,h,p){const g=f.getTextContent(),m=h-1,v=g[m],_=p[v];if(!_)return!1;for(const x of _){const{tag:w}=x,S=w.length,k=m-S+1;if(S>1&&!h6(g,k,w,0,S)||g[k-1]===" ")continue;const A=g[m+1];if(x.intraword===!1&&A&&!TR.test(A))continue;const C=f;let R=C,N=jR(g,k,w),I=R;for(;N<0&&(I=I.getPreviousSibling())&&!Qn(I);)if(ne(I)){if(I.hasFormat("code"))continue;const Q=I.getTextContent();R=I,N=jR(Q,Q.length,w)}if(N<0||R===C&&N+S===k)continue;const P=R.getTextContent();if(N>0&&P[N-1]===v)continue;const z=P[N-1];if(x.intraword===!1&&z&&!TR.test(z)||!x.format.includes("code")&&jZ(R,N))continue;const q=C.getTextContent(),H=q.slice(0,k)+q.slice(m+1);C.setTextContent(H);const V=R===C?H:P;R.setTextContent(V.slice(0,N)+V.slice(N+S));const Y=de(),G=Vx();gn(G);const J=m-S*(R===C?2:1)+1;G.anchor.set(R.__key,N,"text"),G.focus.set(C.__key,J,"text");for(const Q of x.format)G.formatText(Q,ta[Q]);G.anchor.set(G.focus.key,G.focus.offset,G.focus.type);for(const Q of x.format)G.hasFormat(Q)&&G.toggleFormat(Q);return te(Y)&&(G.format=Y.format),!0}return!1})(u,d,i);return nl(e.registerUpdateListener(({tags:l,dirtyLeaves:u,editorState:d,prevEditorState:f})=>{if(l.has(sP)||l.has(lg)||e.isComposing())return;const h=l.has(oh),p=d.read(de),g=f.read(de);if(!te(g)||!te(p)||!p.isCollapsed()||p.is(g)&&!h)return;const m=p.anchor.key,v=p.anchor.offset,_=d._nodeMap.get(m);if(ne(_)&&u.has(m)&&(h||v===1||!(v>g.anchor.offset+1))){if(h){const x=d.read(()=>_.getTextContent())[v-1];if(!s.has(x))return}e.update(()=>{if(!Ca(_))return;const x=_.getParent();x===null||fh(x)||a(x,_,p.anchor.offset)&&du(nP)})}}),e.registerCommand(nh,l=>{if(l!==null&&l.shiftKey)return!1;const u=de();if(!te(u)||!u.isCollapsed())return!1;const d=u.anchor.offset,f=u.anchor.getNode();if(!ne(f)||!Ca(f))return!1;const h=f.getParent();return h===null||fh(h)?!1:d===f.getTextContent().length&&!(!BR(h,f,d,r.multilineElement,!0)&&!UR(h,f,d,n,!0))&&(l!==null&&l.preventDefault(),!0)},nc))}function p6(e,t=Wa,r,n=!1,i=!1){const o=n?e:FZ(e,i),s=Kr();s.clear(),MZ(o,s,t,n),de()!==null&&s.selectStart()}function g6(e=Wa,t,r=!1){return(function(i,o=!1){const s=ES(i),a=[...s.multilineElement,...s.element],l=!o,u=s.textFormat.filter(d=>d.format.length===1).sort((d,f)=>Number(d.format.includes("code"))-Number(f.format.includes("code")));return d=>{const f=[],h=(d||Kr()).getChildren();for(let p=0;p<h.length;p++){const g=h[p],m=IZ(g,a,u,s.textMatch,o);m!=null&&f.push(l&&p>0&&!n1(g)&&!n1(h[p-1])?`
39
- `.concat(m):m)}return f.join(`
40
- `)}})(e,r)(t)}let m6=[Im,xd,Vh,Tu,Kh,yd];function si(e){return"var("+e+")"}let VZ=E([L("flex"),pi("wrap"),ee("center"),c("gap","2px"),c("padding","var("+F.xs+")"),c("border-bottom","1px solid var("+y.borderSubtle+")")]),p_=E([c("background","none"),c("border","1px solid transparent"),c("border-radius",si(X.sm)),c("color",si(y.textSecondary)),c("font-family","inherit"),c("font-size",si($.sizeSm)),c("line-height","1"),c("min-width","26px"),c("padding","5px 6px"),we("pointer"),Ye([c("background",si(y.surfaceSubtle))])]),KZ=E([c("background",si(y.surfaceSubtle)),c("border-color",si(y.border)),c("color",si(y.textPrimary))]),HZ=E([Ws(.4),we("notAllowed")]),g_=E([c("width","1px"),c("align-self","stretch"),c("background",si(y.borderSubtle)),c("margin","2px 4px")]),WZ=E([L("flex"),ee("center"),c("gap",si(F.xs)),c("padding","var("+F.xs+")"),c("border-bottom","1px solid var("+y.borderSubtle+")")]),GZ=E([fo(1),c("background",si(y.surface)),c("border","1px solid var("+y.border+")"),c("border-radius",si(X.sm)),c("color",si(y.textPrimary)),c("font-family","inherit"),c("font-size",si($.sizeSm)),c("padding","3px 6px"),c("outline","none"),la([c("border-color",si(y.brand))])]);function JZ(e){let t=e.disabled,r=e.formats,n=e.editor,i=t!==void 0?t:!1,o=oe(()=>{}),s=o[1],a=o[0],l=(h,p)=>{n.dispatchCommand(h,p)},u=h=>{n.update(()=>{let p=de();if(p!=null&&te(p)){sY(p,h);return}})},d=(h,p,g,m)=>{let v=g!==void 0?g:!1,_=i?p_+" "+HZ:v?p_+" "+KZ:p_;return b("button",{children:h,"aria-label":p,"aria-pressed":v?"true":"false",className:_,title:p,disabled:i,type:"button",onClick:x=>m(),onMouseDown:x=>{x.preventDefault()}})},f=h=>{let p=h.trim();n.update(()=>{jX(p===""?null:p)}),s(g=>{})};return M(qr,{children:[M("div",{children:[d("B","Bold",r.bold,()=>l(Ao,"bold")),d("I","Italic",r.italic,()=>l(Ao,"italic")),d("</>","Inline code",r.code,()=>l(Ao,"code")),b("span",{className:g_}),d("H1","Heading 1",void 0,()=>u(()=>Qs("h1"))),d("H2","Heading 2",void 0,()=>u(()=>Qs("h2"))),d("¶","Paragraph",void 0,()=>u(()=>Pt())),b("span",{className:g_}),d("•","Bulleted list",void 0,()=>l(BO,void 0)),d("1.","Numbered list",void 0,()=>l(jO,void 0)),d("“","Quote",void 0,()=>u(()=>Sd())),d("🔗","Link",void 0,()=>s(h=>{if(!We(h))return""})),b("span",{className:g_}),d("↩","Undo",void 0,()=>l(bm,void 0)),d("↪","Redo",void 0,()=>l(ym,void 0))],"aria-label":"Formatting",className:VZ,role:"toolbar"}),a!==void 0?M("div",{children:[b("input",{"aria-label":"Link URL",className:GZ,autoFocus:!0,placeholder:"https://…",type:"url",value:a,onKeyDown:h=>{switch(h.key){case"Enter":return h.preventDefault(),f(a);case"Escape":return s(g=>{});default:return}},onChange:h=>{let p=h.target.value;s(g=>p)}}),d("Apply","Apply link",void 0,()=>f(a)),d("Remove","Remove link",void 0,()=>f(""))],className:WZ}):null]})}let qR={bold:!1,italic:!1,code:!1},QZ=JZ;function YZ(e){return e.trim()===""}let VR={contents:void 0};function XZ(){let e=VR.contents;if(e!==void 0)return ir(e);let t=Jx({namespace:"reventless-rich-text-probe",nodes:m6,onError:r=>{}});return VR.contents=pr(t),t}function ZZ(e){let t=XZ(),r={contents:""};return t.update(()=>{p6(e,Wa)},{discrete:!0}),t.read(()=>{r.contents=g6(Wa)}),r.contents}function eee(e){return e.trim()!==""?e.trimEnd()!==ZZ(e).trimEnd():!1}function it(e){return"var("+e+")"}let KR=E([L("flex"),he("column"),c("background",it(y.surface)),c("border","1px solid var("+y.border+")"),c("border-radius",it(X.sm)),c("box-sizing","border-box"),c("transition","border-color 120ms"),Uo({NAME:"percent",VAL:100}),fl("hidden"),GD([c("border-color",it(y.brand))])]),tee=E([c("border-color",it(y.error)),GD([c("border-color",it(y.error))])]),ree=E([L("flex"),ee("center"),c("gap","2px"),c("justify-content","flex-end"),c("padding","var("+F.xs+")"),c("border-bottom","1px solid var("+y.borderSubtle+")")]);function nee(e){return E([c("background",e?it(y.surfaceSubtle):"transparent"),c("border","1px solid "+(e?it(y.border):"transparent")),c("border-radius",it(X.sm)),c("color",it(e?y.textPrimary:y.textSecondary)),c("font-family","inherit"),c("font-size",it($.sizeXs)),c("padding","2px var("+F.sm+")"),we("pointer")])}let iee=E([c("background",it(y.surfaceSubtle)),c("border-bottom","1px solid var("+y.borderSubtle+")"),c("color",it(y.textSecondary)),c("font-size",it($.sizeXs)),c("line-height",it($.lineHeightNormal)),c("padding","var("+F.xs+") var("+F.sm+")")]),oee=E([Ot("relative"),L("flex"),he("column")]),see=E([Ot("absolute"),c("top","var("+F.sm+")"),c("left","var("+F.sm+")"),c("color",it(y.textDisabled)),c("font-size",it($.sizeSm)),c("pointer-events","none"),c("user-select","none")]);function aee(e){return E([c("color",it(y.textPrimary)),c("font-size",it($.sizeSm)),c("line-height",it($.lineHeightRelaxed)),c("min-height",e),c("outline","none"),c("padding",it(F.sm)),c("word-break","break-word"),c("overflow-y","auto"),c("tab-size","4")])}let lee=E([c("margin","0 0 var("+F.sm+")")]),uee=E([c("font-size",it($.sizeXl)),c("font-weight",it($.weightBold)),c("line-height",it($.lineHeightTight)),c("margin","var("+F.sm+") 0 var("+F.xs+")")]),cee=E([c("font-size",it($.sizeLg)),c("font-weight",it($.weightBold)),c("line-height",it($.lineHeightTight)),c("margin","var("+F.sm+") 0 var("+F.xs+")")]),dee=E([c("font-size",it($.sizeMd)),c("font-weight",it($.weightBold)),c("margin","var("+F.sm+") 0 var("+F.xs+")")]),fee=E([c("border-left","3px solid var("+y.border+")"),c("color",it(y.textSecondary)),c("margin","var("+F.xs+") 0"),c("padding-left",it(F.md))]),HR=E([c("margin","var("+F.xs+") 0"),c("padding-left","1.5em")]),hee=E([c("margin","2px 0")]),pee=E([c("color",it(y.brand)),c("text-decoration","underline")]),gee=E([c("font-weight",it($.weightBold))]),mee=E([c("font-style","italic")]),vee=E([c("text-decoration","line-through")]),_ee=E([c("background",it(y.surfaceSubtle)),c("border-radius",it(X.sm)),c("font-family",it($.fontFamilyMono)),c("font-size","0.9em"),c("padding","1px 4px")]),bee=E([c("background",it(y.surfaceSubtle)),c("border","1px solid var("+y.borderSubtle+")"),c("border-radius",it(X.md)),c("display","block"),c("font-family",it($.fontFamilyMono)),c("font-size","0.9em"),c("margin","var("+F.xs+") 0"),c("padding",it(F.sm)),c("white-space","pre-wrap")]);function yee(e){return E([c("background","transparent"),c("border","none"),c("color",it(y.textPrimary)),c("font-family",it($.fontFamilyMono)),c("font-size",it($.sizeSm)),c("line-height",it($.lineHeightNormal)),c("min-height",e),c("outline","none"),c("padding",it(F.sm)),c("resize","vertical"),c("box-sizing","border-box"),Uo({NAME:"percent",VAL:100})])}let xee=Object.fromEntries([["paragraph",lee],["quote",fee],["link",pee],["code",bee],["heading",Object.fromEntries([["h1",uee],["h2",cee],["h3",dee]])],["list",Object.fromEntries([["ul",HR],["ol",HR],["listitem",hee]])],["text",Object.fromEntries([["bold",gee],["italic",mee],["strikethrough",vee],["code",_ee]])]]);function See(e){let t=e.readOnly,r=e.hasError,n=e.minHeight,i=e.placeholder,o=e.onBlur,s=e.onChange,a=e.value,l=o!==void 0?o:()=>{},u=i!==void 0?i:"Write markdown…",d=n!==void 0?n:"180px",f=r!==void 0?r:!1,h=t!==void 0?t:!1,p=oe(()=>"Rich"),g=p[1],m=p[0],v=oe(()=>qR),_=v[1],x=oe(()=>a.trim()===""),w=x[1],S=oe(()=>!1),k=S[1],A=Je(null),C=Je(a),R=Je(a),N=Je(!1),I=Je(s);I.current=s;let P=Lt(()=>Jx({namespace:"reventless-rich-text",nodes:m6,onError:J=>{console.error("[RichTextEditor] Lexical error — the document may be incomplete:",J)},theme:xee}),[]),z=()=>{let J={contents:""};return P.read(()=>{J.contents=g6(Wa)}),J.contents},q=J=>{R.current=J,C.current=J,N.current=!0,k(Q=>eee(J)),P.update(()=>{p6(J,Wa)})},H=()=>{let J=z();if(w(Q=>J.trim()===""),_(Q=>{let ue={contents:qR};return P.read(()=>{let le=de();if(le!=null&&te(le)){ue.contents={bold:le.hasFormat("bold"),italic:le.hasFormat("italic"),code:le.hasFormat("code")};return}}),ue.contents}),N.current){N.current=!1,C.current=J;return}else return J!==C.current?(C.current=J,I.current(J)):void 0},V=m==="Rich";Re(()=>{if(!V)return;P.setRootElement(A.current);let J=nl(lZ(P),CX(P),TX(P,$X(),300),qZ(P,Wa),P.registerUpdateListener(Q=>H()));return q(a),()=>{J(),P.setRootElement(null)}},[V]),Re(()=>{V&&a!==C.current&&a!==R.current&&q(a)},[a]),Re(()=>{P.setEditable(!h)},[h]);let Y=(J,Q)=>b("button",{children:Q,"aria-pressed":m===J?"true":"false",className:nee(m===J),type:"button",onClick:ue=>{if(g(le=>J),J==="Source")return k(le=>!1)}}),G;return G=m==="Rich"?M("div",{children:[b("div",{ref:pr(A),"aria-label":"Rich text editor","aria-multiline":!0,className:aee(d),contentEditable:!h,role:"textbox",spellCheck:!0,onBlur:J=>l(),suppressContentEditableWarning:!0}),x[0]&&!h?b("div",{children:u,className:see}):null],className:oee}):b("textarea",{"aria-label":"Markdown source",className:yee(d),spellCheck:!1,placeholder:u,readOnly:h,value:a,onBlur:J=>l(),onChange:J=>{let Q=J.target.value;C.current=Q,R.current=Q,s(Q)}}),M("div",{children:[M("div",{children:[Y("Rich","Rich text"),Y("Source","Markdown")],className:ree}),!h&&V?b(QZ,{editor:P,formats:v[0]}):null,S[0]&&V?b("div",{children:"Editing as rich text will reformat this document — switch to Markdown to keep it as written.",className:iee}):null,G],className:f?KR+" "+tee:KR})}let Eee=See;function hr(e){return"var("+e+")"}let u1=E([c("color",hr(y.brand)),c("text-decoration","none"),Ye([c("text-decoration","underline")])]),wee=E([L("inlineBlock"),c("width","12px"),c("height","12px"),c("border-radius","3px"),c("border","1px solid var("+y.border+")"),c("vertical-align","-1px")]),Ed=E([L("inlineFlex"),ee("center"),c("gap","6px")]),kee=E([c("height","24px"),c("width","24px"),c("object-fit","cover"),c("border-radius",hr(X.sm)),c("border","1px solid var("+y.borderSubtle+")"),c("vertical-align","middle")]),Cee=E([c("max-height","160px"),c("max-width","240px"),c("object-fit","cover"),c("border-radius",hr(X.md)),c("border","1px solid var("+y.borderSubtle+")"),we("zoomIn")]),Ree=E([c("color",hr(y.error)),c("font-size",hr($.sizeXs)),c("font-weight",hr($.weightMedium)),c("white-space","nowrap"),$h(ke(6))]),Aee=E([L("inlineBlock"),c("background",hr(y.surfaceSubtle)),c("border","1px solid var("+y.borderSubtle+")"),c("border-radius","3px"),c("color",hr(y.textSecondary)),c("font-size",hr($.sizeXs)),c("font-weight",hr($.weightMedium)),c("letter-spacing","0.03em"),c("padding","1px 4px"),c("line-height","1.2")]),Tee=E([L("inlineBlock"),c("background",hr(y.surfaceSubtle)),c("border-radius",hr(X.full)),c("width","64px"),c("height","6px"),fl("hidden")]);function $ee(e){return E([c("background",hr(y.brand)),c("border-radius",hr(X.full)),c("height","100%"),c("width",e.toString()+"%")])}let v6=E([c("color",hr(y.textSecondary)),c("font-size",hr($.sizeXs)),c("font-variant-numeric","tabular-nums")]),Nee=E([c("width","220px"),c("max-width","100%")]),Dee=E([L("flex"),he("column"),c("gap","1px"),c("line-height","1.35")]),Fee=E([c("background","none"),c("border","none"),c("padding","0"),we("zoomIn")]),Iee=E([L("flex"),he("column"),c("gap",hr(F.xs)),c("width","100%")]),Pee=E([c("background","none"),c("border","none"),c("padding","0"),c("color",hr(y.textSecondary)),c("font-size",hr($.sizeXs)),c("text-decoration","underline"),we("pointer"),Ye([c("color",hr(y.brand))])]),_6=E([L("flex"),he("column"),ee("flexStart"),c("gap","6px")]),b6=E([c("color",hr(y.textSecondary)),c("font-family",hr($.fontFamilyMono)),c("font-size",hr($.sizeXs))]),Oee=E([L("inlineBlock"),c("background","#ffffff"),c("border","1px solid var("+y.borderSubtle+")"),c("border-radius",hr(X.md)),c("padding","4px"),c("line-height","0")]),Mee=E([c("display","block"),c("max-width","260px"),c("height","auto")]);function Hh(e,t){return e.length>t?e.slice(0,t-1|0)+"…":e}function y6(e){let t=e<0,n=(t?-e:e).toFixed(2).split("."),i=D(n[0],"0"),o=D(n[1],"00"),s=a=>{let l=a.length;return l<=3?a:s(a.slice(0,l-3|0))+","+a.slice(l-3|0)};return(t?"-":"")+s(i)+"."+o}function x6(e){let r=e.toFixed(2).replace(/\.?0+$/,"");return(r===""||r==="-"?"0":r)+"%"}function S6(e){let t=["B","KB","MB","GB","TB","PB"],n=((a,l)=>{for(;;){let u=l,d=a;if(!(d>=1024&&u<(t.length-1|0)))return[d,u];l=u+1|0,a=d/1024}})(e<0?0:e,0),i=n[1],o=n[0];return(i===0?Math.round(o).toString():(Math.round(o*10)/10).toString())+" "+t[i]}function E6(e){let t=e<0?0:Math.floor(e)|0,r=t/86400|0,n=t%86400/3600|0,i=t%3600/60|0,o=t%60;return r>0?r.toString()+"d "+n.toString()+"h":n>0?n.toString()+"h "+i.toString()+"m":i>0?i.toString()+"m "+o.toString()+"s":o.toString()+"s"}function Lee(e){return e.replace(/```[^\n]*\n?/g,"").replace(/`([^`]*)`/g,"$1").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/^\s{0,3}(?:[-*+]|\d+\.)\s+/gm,"").replace(/^>\s?/gm,"").replace(/(\*\*|__)(.*?)\1/g,"$2").replace(/(\*|_)(.*?)\1/g,"$2").replace(/~~(.*?)~~/g,"$1").replace(/\s+/g," ").trim()}function zee(e,t){return lt(t,e,(r,n)=>D(r.split(n)[0],r))}function WR(e){let r=zee(e,["?","#"]).split("/").filter(o=>o!==""),n=D(r[r.length-1|0],""),i;try{i=decodeURIComponent(n)}catch{i=n}return i===""?"file":i}function Uee(e){let t=e.split("."),r=t.length;if(r===0||r===1)return;let n=D(t[r-1|0],"");if(/^[A-Za-z0-9]{1,5}$/.test(n))return n.toUpperCase()}function kS(e){return/^[A-Za-z]{2}$/.test(e)}function w6(e){if(kS(e))return e.toUpperCase().split("").map(t=>D(t.codePointAt(0),65)+127397|0).map(t=>String.fromCodePoint(t)).join("")}let GR={contents:void 0};function Bee(){let e=GR.contents;if(e!==void 0)return ir(e);let t;try{t=pr(new Intl.DisplayNames(["en"],{type:"region"}))}catch{t=void 0}return GR.contents=pr(t),t}function CS(e){if(!kS(e))return e;let t=Bee();if(t===void 0)return e;try{let r=ir(t).of(e.toUpperCase());return r===""?e:r}catch{return e}}let jee=["street","streetaddress","line1","addressline1","address1"],qee=["line2","addressline2","address2","apartment","unit","suite"],Vee=["postalcode","zip","zipcode","postcode"],Kee=["city","town","locality"],Hee=["state","region","province","county"],Wee=["country","countrycode"];function Gee(e){let t=nt(e);if(typeof t=="object")switch(t.TAG){case"JSONString":let r=t._0;return r===""?void 0:r;case"JSONNumber":return t._0.toString();default:return}}function k6(e){let t=nt(e);if(typeof t=="object")switch(t.TAG){case"JSONString":let r=t._0.split(`
41
- `).map(u=>u.trim()).filter(u=>u!=="");return r.length===0?void 0:r;case"JSONObject":let n=et(t._0),i=u=>T(n.find(d=>u.includes(d[0].toLowerCase())),d=>Gee(d[1])),o=i(Vee),s=i(Kee),a=o!==void 0?s!==void 0?o+" "+s:o:s!==void 0?s:void 0,l=se([i(jee),i(qee),a,i(Hee),i(Wee)],u=>u).map(u=>u.trim()).filter(u=>u!=="");return l.length===0?void 0:l;default:return}}function Jee(e){return W(k6(e),t=>t.map(r=>kS(r)?CS(r):r).join(", "))}function Qee(e){let t=w6(e);return t!==void 0?t+" "+CS(e):e}function Lp(e){return fe(W(qf(e,"maximum"),t=>t|0),5,t=>t<=0?5:t)}function JR(e,t){let r=qf(e,"maximum");return r!==void 0&&r>0&&r<=1?t/r*100:t}let RS={};function Or(e,t){RS[Dh(e)]=t}function Yee(e){return O(RS,Dh(e))}function Wh(e,t){return T(wx(e,t),r=>O(RS,Dh(r.semantic)))}function Xee(e,t,r){return T(Wh(e,t),n=>n.cell(e,t,r))}function QR(e,t,r){return T(Wh(e,t),n=>n.detail(e,t,r))}function Zee(e,t){return fe(Wh(e,t),!1,r=>We(r.input))}function ete(e,t,r,n,i,o,s){return W(T(Wh(e,t),a=>a.input),a=>a(e,t,r,n,i,o,s))}function tte(e,t,r,n){return T(T(Wh(e,t),i=>i.validateInput),i=>i(e,t,r,n))}function Cg(e){e.stopPropagation()}function Rg(e,t,r){return r?b("a",{children:t,className:u1,href:e,rel:"noopener noreferrer",target:"_blank",onClick:Cg}):b("a",{children:t,className:u1,href:e,onClick:Cg})}function Tn(e){return T(ce(e),t=>{if(t!=="")return t})}function AS(e){let t=(r,n,i)=>W(Tn(i),e);return{cell:t,detail:t}}function Pm(e){let t=(r,n,i)=>W(vs(i),o=>e(o));return{cell:t,detail:t}}Or("Email",AS(e=>Rg("mailto:"+e,e,!1)));Or("Phone",AS(e=>Rg("tel:"+e,e,!1)));Or("Url",{cell:(e,t,r)=>W(Tn(r),n=>Rg(n,Hh(n,40),!0)),detail:(e,t,r)=>W(Tn(r),n=>Rg(n,n,!0))});Or("Currency",Pm(y6));Or("Percent",Pm(x6));Or("Bytes",Pm(S6));Or("Duration",Pm(E6));Or("Color",AS(e=>M("span",{children:[b("span",{className:wee,style:{background:e}}),e],className:Ed})));function rte(e){let t=e.alt,r=e.src,n=oe(()=>!1),i=n[1];return M(qr,{children:[b("button",{children:b("img",{className:Cee,alt:t,src:r}),className:Fee,title:"Click to enlarge",onClick:o=>{o.stopPropagation(),i(s=>!0)}}),n[0]?b(yF,{slides:[{key:r,src:r,title:t}],index:0,onIndexChange:o=>{},onClose:()=>i(o=>!1)}):null]})}Or("Image",{cell:(e,t,r)=>W(Tn(r),n=>b("img",{className:kee,alt:e,src:Mc(n),onClick:Cg})),detail:(e,t,r)=>W(Tn(r),n=>b(rte,{src:Mc(n),alt:e}))});function nte(e){return/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(e)?!0:/^[0-9A-Za-z_-]{16,}$/.test(e)}function ite(e){return M("span",{children:[b(ad,{name:e,size:"Small"}),e],className:Ed})}function YR(e,t,r){return T(Tn(r),n=>{if(!nte(n))return ite(n)})}Or("UserRef",{cell:YR,detail:YR});Or("Markdown",{cell:(e,t,r)=>W(Tn(r),n=>Hh(Lee(n),80)),detail:(e,t,r)=>W(Tn(r),n=>b(nI,{source:n})),input:(e,t,r,n,i,o,s)=>b(Eee,{value:r,onChange:n,onBlur:i,hasError:s}),validateInput:(e,t,r,n)=>{if(n&&YZ(r))return"Required"}});Or("Rating",{cell:(e,t,r)=>W(vs(r),n=>b(zv,{value:n,max:Lp(t)})),detail:(e,t,r)=>W(vs(r),n=>b(zv,{value:n,max:Lp(t),size:"Medium",showValue:!0})),input:(e,t,r,n,i,o,s)=>b(zv,{value:D(Ya(r),0),max:Lp(t),size:"Medium",showValue:!0,onChange:a=>n(a<=0?"":a.toString()),onBlur:i,hasError:s}),validateInput:(e,t,r,n)=>{if(r==="")return n?"Required":void 0;let i=Ya(r);if(i===void 0)return"Invalid rating";let o=Lp(t);if(i<0||i>o)return"Must be between 0 and "+o.toString()}});function ote(e){return e<0?0:e>100?100:e}Or("Progress",{cell:(e,t,r)=>W(vs(r),n=>{let i=ote(JR(t,n));return M("span",{children:[b("span",{children:b("span",{className:$ee(i)}),className:Tee}),b("span",{children:Math.round(i).toString()+"%",className:v6})],className:Ed})}),detail:(e,t,r)=>W(vs(r),n=>b("div",{children:b(EF,{value:JR(t,n)}),className:Nee}))});function C6(e,t){let r=Mc(e),n=Uee(t);return M("span",{children:[n!==void 0?b("span",{children:n,className:Aee}):null,b("a",{children:t,className:u1,download:"",href:r,rel:"noopener noreferrer",target:"_blank",onClick:Cg})],className:Ed})}function ste(e){let t=e.name,r=e.href,n=oe(()=>!1),i=n[1],o=n[0];return M("span",{children:[M("span",{children:[C6(r,t),ZV(r)?b("button",{children:o?"Hide preview":"Preview","aria-expanded":o,className:Pee,type:"button",onClick:s=>{s.stopPropagation(),i(a=>!a)}}):null],className:Ed}),o?b(tK,{src:Mc(r),title:t,height:"60vh"}):null],className:Iee})}Or("FileUrl",{cell:(e,t,r)=>W(Tn(r),n=>C6(n,Hh(WR(n),40))),detail:(e,t,r)=>W(Tn(r),n=>b(ste,{href:n,name:WR(n)}))});function ate(e){let t=w6(e);return t!==void 0?M("span",{children:[b("span",{children:t,"aria-hidden":!0}),CS(e)],className:Ed}):e}function XR(e,t,r){return W(Tn(r),ate)}Or("Country",{cell:XR,detail:XR});Or("Address",{cell:(e,t,r)=>W(Jee(r),n=>Hh(n,60)),detail:(e,t,r)=>W(k6(r),n=>b("span",{children:n.map((i,o)=>b("span",{children:Qee(i)},o.toString())),className:Dee}))});function lte(e){return W(T(T(K(e),t=>O(t,"maxLength")),vs),t=>t|0)}function m_(e){let t=T(nu(e).channel,n=>_K(n).maxLength),r=lte(e);return t!==void 0?r!==void 0?t<r?t:r:t:r}Or("ChannelText",{cell:(e,t,r)=>W(Tn(r),n=>{let i=T(m_(t),o=>{if(bc(n)>o)return bc(n)-o|0});return M("span",{children:[Hh(n,80),i!==void 0?b("span",{children:i.toString()+" over",className:Ree}):null]})}),detail:(e,t,r)=>{let n=Tn(r),i=nu(t).channel;if(n!==void 0&&i!==void 0)return b(XG,{channelId:i,message:{body:n}})},input:(e,t,r,n,i,o,s)=>{let a=T(nu(t).channel,kF);return b(zG,{value:r,onChange:n,onBlur:i,maxLength:m_(t),channelLabel:W(a,l=>l.label),hasError:s,note:T(a,l=>l.constraints.note),name:e})},validateInput:(e,t,r,n)=>n&&r===""?"Required":T(m_(t),i=>{let o=bc(r);if(o>i)return oI(o-i|0)+" over the "+i.toString()+"-character limit"})});Or("Qr",{cell:(e,t,r)=>{},detail:(e,t,r)=>W(Tn(r),n=>M("span",{children:[b(TV,{value:n}),b("span",{children:n,className:b6})],className:_6}))});Or("Barcode",{cell:(e,t,r)=>{},detail:(e,t,r)=>W(Tn(r),n=>M("span",{children:[b(UV,{value:n}),b("span",{children:n,className:b6})],className:_6}))});Or("Signature",{cell:(e,t,r)=>T(Tn(r),n=>{if(sk(n))return b("span",{children:"✓ Signed",className:v6})}),detail:(e,t,r)=>T(Tn(r),n=>{if(sk(n))return b("span",{children:b("img",{className:Mee,alt:"Signature",src:TF(n)}),className:Oee})}),input:(e,t,r,n,i,o,s)=>b(AK,{value:r,onChange:n,onBlur:i,hasError:s}),validateInput:(e,t,r,n)=>{if(n&&r==="")return"Required"}});function hh(e){return"var("+e+")"}let ute=E([L("inlineFlex"),ee("center"),pi("wrap"),c("gap","4px"),c("font-size",hh($.sizeSm)),c("min-width","0")]),cte=E([c("color",hh(y.textDisabled)),c("font-size",hh($.sizeXs))]),dte=E([c("color",hh(y.brand)),c("text-decoration","none"),Ye([c("text-decoration","underline")])]),fte=E([c("color",hh(y.textPrimary))]);function hte(e){let t=e.segments,r=dl();return b("span",{children:t.map((n,i)=>{let o=i===(t.length-1|0),s=n.href;return M(ax,{children:[s!==void 0?b("a",{children:n.label,className:dte,href:s,onClick:a=>{if(!(a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||a.button!==0))return a.preventDefault(),a.stopPropagation(),r(s)}}):b("span",{children:n.label,className:fte}),o?null:b("span",{children:" › ",className:cte})]},i.toString()+":"+n.label)}),className:ute})}let pte=hte;function ZR(e){return T(T(K(e),t=>O(t,"type")),ce)}function TS(e){return T(T(K(e),t=>O(t,"format")),ce)}function gte(e){return T(K(e),t=>O(t,"items"))}function eA(e){return We(T(T(K(e),t=>O(t,"properties")),K))}function R6(e){let t=K(e);if(t===void 0)return e;let r=O(t,"type"),n=O(t,"properties");return r!==void 0||n!==void 0?e:D(W(lt(["anyOf","oneOf","allOf"],void 0,(i,o)=>i!==void 0?i:T(T(O(t,o),Vt),s=>s.find(a=>Uf(T(T(K(a),l=>O(l,"type")),ce),"null")))),R6),e)}function Jc(e){let t=e.toLowerCase(),r=e.length,n=o=>{let s=o.length;if(r>s&&t.endsWith(o))return e.slice(0,r-s|0)},i=n("ids");return i!==void 0?i:n("id")}function mte(e,t,r){let n=R6(t);if(e==="compositeId")return"KCompositeId";let i=ld(n);if(i!==void 0)return{TAG:"KEnum",_0:i};let o=ZR(n),s=0;if(o!==void 0)switch(o){case"array":let a=gte(n);if(a===void 0)return"KArrayOfStrings";if(eA(a)||ot(ZR(a),"object"))return{TAG:"KArrayOfObjects",_0:a};let l=Jc(e);return l!==void 0?{TAG:"KArrayOfEntityIds",_0:l}:"KArrayOfStrings";case"boolean":return"KBoolean";case"integer":case"number":return"KNumber";case"object":return eA(n)?{TAG:"KNestedObject",_0:n}:"KString";default:s=1}else s=1;if(s===1){let a=TS(n),l=0;if(a!==void 0)switch(a){case"date":case"date-time":return"KDate";default:l=2}else l=2;if(l===2){if(r.isId)return"KString";let u=Jc(e);return u!==void 0?{TAG:"KEntityId",_0:u}:"KString"}}}function vte(e){switch(e){case"sortKey":case"subId":return!0;default:return!1}}function _te(e,t,r){return t.isCompositeId?!0:r.includes(e)}function bte(e,t,r,n,i){return t.hidden||vte(e)||n&&_te(e,t,i)?!1:r?t.summary||t.isId||e==="compositeId"?!0:n?!1:e==="id":!(n&&e==="id")}function yte(e,t,r){if(e==="compositeId"||r.isId)return 0;if(e==="id")return 1;if(r.summary)return 2;if(typeof t!="object")switch(t){case"KBoolean":return 7;case"KCompositeId":return 0;case"KDate":return 4;case"KNumber":return 8;case"KString":return 5;case"KArrayOfStrings":return 11}else switch(t.TAG){case"KEnum":return 6;case"KEntityId":return 9;case"KArrayOfEntityIds":return 10;case"KArrayOfObjects":return 12;case"KNestedObject":return 13}}function xte(e,t){if(typeof e!="object")switch(e){case"KBoolean":return"80px";case"KCompositeId":return"260px";case"KNumber":return"100px";case"KString":return t==="id"?"220px":void 0;case"KDate":case"KArrayOfStrings":return"180px"}else switch(e.TAG){case"KEnum":return"140px";case"KEntityId":return"220px";case"KArrayOfEntityIds":return"260px";case"KArrayOfObjects":case"KNestedObject":return"240px"}}function wi(e,t){let r=t!==void 0?t:"List",n=D(W(T(T(K(e),u=>O(u,"properties")),K),et),[]),i=cm(e),o=r==="List"&&i.length!==0,s=yx(e),a=s.length!==0||n.some(u=>u[0]==="compositeId");return se(n,u=>{let d=u[1],f=u[0],h=nu(d);if(!bte(f,h,o,a,s))return;let p=mte(f,d,h),g=D(T(T(K(d),m=>O(m,"title")),ce),yt(f));return{key:f,label:g,kind:p,ann:h,propSchema:d,priority:yte(f,p,h),width:xte(p,f)}}).toSorted((u,d)=>u.priority-d.priority|0)}function Ste(e,t){return e.length>t?e.slice(0,t-1|0)+"…":e}function A6(e){return b(Zs,{variant:"Neutral",label:e,dot:!1})}function tA(e,t,r,n,i){let o=ua(r,e);return o===void 0?[void 0,t]:(i!==void 0?i.pluginId===o.pluginId&&i.viewName===o.name:!1)?[void 0,t]:[ea(o.pluginId,o.name,t,[]),t]}function rA(e,t,r){if(r===void 0)return[t,!1];let n=r.lookupLabel(e,t);return n!==void 0?[n,!1]:[t,r.isMissing(e,t)]}function Ag(e,t,r){let n=ua(t,e);return r!==void 0&&n!==void 0&&r.pluginId===n.pluginId?r.viewName===n.name:!1}function c1(e,t,r,n,i,o,s,a,l){let u=l!==void 0?l:!1,d=Ag(t,n,s),f=D(a,iF(t)),h=m=>{let v=tA(t,m,n,i,s),_=v[1],x=d?[_,!1]:rA(t,_,o),w=x[0],S=b(_q,{href:v[0],label:w,rawValue:_}),k=f&&w!==_?M("span",{children:[b(ad,{name:w,size:"Small"}),S],style:{display:"inline-flex",alignItems:"center",gap:"6px"}}):S;return x[1]?b("span",{children:k,style:{fontStyle:"italic",opacity:"0.55"},title:"Referenced "+t+" not found (id: "+_+")"}):k},p=m=>{let v=se(m,_=>{let w=tA(t,_,n,i,s)[1],k=rA(t,w,o)[0];if(k!==w)return{name:k}});if(u&&f&&!d&&m.length>=2&&v.length===m.length)return b(eF,{members:v,size:"Small"})},g=nt(r);if(typeof g!="object")return JSON.stringify(r);switch(g.TAG){case"JSONString":return h(g._0);case"JSONArray":let m=g._0,v=se(m,ce),_=v.length===m.length?p(v):void 0;return _!==void 0?_:b("span",{children:m.map((x,w)=>{let S=nt(x);return typeof S!="object"||S.TAG!=="JSONString"?null:M("span",{children:[h(S._0),w<(m.length-1|0)?", ":null]},w.toString())})});default:return JSON.stringify(r)}}function Ete(e){let t=nt(e);if(typeof t!="object"||t.TAG!=="JSONString")return JSON.stringify(e);let r=t._0.split("/").map(n=>({label:n,href:void 0}));return b(pte,{segments:r})}function wo(e,t,r){let n=nt(r);if(typeof n!="object")switch(n){case"JSONFalse":return b(Zs,{variant:"Neutral",label:"No",dot:!1});case"JSONTrue":return b(Zs,{variant:"Success",label:"Yes",dot:!1});case"JSONNull":return"—"}else switch(n.TAG){case"JSONString":let i=n._0,o=ZD(e,i);if(t===void 0)return o!==void 0?o:i;switch(t){case"date":case"date-time":return _x(i);default:return o!==void 0?o:i}case"JSONNumber":return n._0.toString();case"JSONObject":case"JSONArray":return JSON.stringify(r)}}function nA(e,t){let r=K(t);if(r===void 0)return;let n=O(r,"name");if(n!==void 0&&nt(n)!=="JSONNull")return wo("name",void 0,n);let i=wi(e,"Drill"),o=se(i,d=>{let f=d.kind,h;if(typeof f!="object")h=f!=="KArrayOfStrings";else switch(f.TAG){case"KArrayOfEntityIds":case"KArrayOfObjects":case"KNestedObject":h=!1;break;default:h=!0}let p=O(r,d.key);if(!h||p===void 0)return;let g=nt(p);if(!(typeof g!="object"&&g==="JSONNull"))return[d,p]});if(o.length===0)return;let s=o.slice(0,2),a=i.length-s.length|0,l=s.map((d,f)=>{let h=d[1],p=d[0],g=p.kind,m;if(typeof g!="object")m=g==="KDate"?wo(p.key,TS(p.propSchema),h):wo(p.key,void 0,h);else if(g.TAG==="KEnum"){let v=nt(h);m=typeof v!="object"||v.TAG!=="JSONString"?wo(p.key,void 0,h):A6(v._0)}else m=wo(p.key,void 0,h);return M("span",{children:[f>0?" · ":null,m]},f.toString())}),u=a>0?b("span",{children:"+"+a.toString(),style:{marginLeft:"4px",opacity:"0.55"}}):null;return M("span",{children:[l,u],style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap"}})}function Jl(e,t,r,n,i,o,s,a,l){let u=i!==void 0?i:tF;if(n===void 0)return"—";let d=Xee(e,r,n);if(d!==void 0)return d;if(typeof t!="object")switch(t){case"KCompositeId":return Ete(n);case"KDate":return wo(e,TS(r),n);case"KBoolean":case"KNumber":return wo(e,void 0,n);case"KString":let h=nt(n);if(typeof h!="object"||h.TAG!=="JSONString")return wo(e,void 0,n);let p=h._0;return p.length>60?b("span",{children:Ste(p,60),title:p}):wo(e,void 0,n);case"KArrayOfStrings":let g=D(W(Vt(n),m=>se(m,ce)),[]);return b(XD,{items:g})}else switch(t.TAG){case"KEnum":let h=nt(n);return typeof h!="object"||h.TAG!=="JSONString"?wo(e,void 0,n):A6(h._0);case"KEntityId":case"KArrayOfEntityIds":break;case"KArrayOfObjects":let p=t._0,g=D(Vt(n),[]),m=g.length;if(u.collapsed){let S=g[0];return S!==void 0?iA(p,S,o,s,a,l):b(bf,{count:m,label:"items"})}let v=T(g[0],S=>nA(p,S));return v!==void 0?M("span",{children:[v,m>1?b("span",{children:"+"+(m-1|0).toString(),style:{marginLeft:"4px",opacity:"0.55"}}):null],style:{display:"inline-flex",alignItems:"center",flexWrap:"wrap"}}):b(bf,{count:m,label:"items"});case"KNestedObject":let _=t._0;if(u.collapsed)return iA(_,n,o,s,a,l);let x=nA(_,n);if(x!==void 0)return x;let w=D(W(K(n),S=>Object.keys(S).length),0);return b(bf,{count:w,label:"fields"})}let f=fe(wx(e,r),!1,h=>h.semantic==="UserRef");return c1(e,t._0,n,o,s,a,l,f?!0:void 0,!0)}function iA(e,t,r,n,i,o){let s=D(K(t),{}),a=wi(e,"Drill").filter(l=>{let u=l.kind;if(typeof u!="object")return!0;switch(u.TAG){case"KArrayOfObjects":case"KNestedObject":return!1;default:return!0}});return b("div",{children:a.map(l=>M("div",{children:[b("span",{children:l.label,style:{fontSize:"0.85em",minWidth:"80px",opacity:"0.55"}}),b("span",{children:Jl(l.key,l.kind,l.propSchema,O(s,l.key),l.ann,r,n,i,o)})],style:{display:"flex",alignItems:"baseline",gap:"6px"}},l.key)),style:{display:"flex",maxHeight:"120px",overflow:"auto",flexDirection:"column",gap:"2px"}})}function wte(e){if(typeof e!="object")return e!=="KArrayOfStrings";switch(e.TAG){case"KArrayOfEntityIds":case"KArrayOfObjects":case"KNestedObject":return!1;default:return!0}}function kte(e){return typeof e!="object"?e==="KBoolean":e.TAG==="KEnum"}function oA(e,t,r,n){let i=ua(r,e);if(i===void 0)return n;let o=i.name.endsWith("s");return t?o?i.name:i.name+"s":o?i.name.slice(0,i.name.length-1|0):i.name}function Cte(e,t,r,n,i,o,s){return e.map(a=>{let l=a.kind,u;if(typeof l!="object")u=a.label;else switch(l.TAG){case"KEntityId":let d=l._0;u=Ag(d,t,s)?a.label:oA(d,!1,t,a.label);break;case"KArrayOfEntityIds":let f=l._0;u=Ag(f,t,s)?a.label:oA(f,!0,t,a.label);break;default:u=a.label}return{key:a.key,label:u,render:d=>Jl(a.key,a.kind,a.propSchema,n(d,a.key),a.ann,t,r,o,s),sortable:wte(a.kind),width:a.width}})}let T6=mr(void 0),Rte=T6.Provider;function Ate(e){return Ar(Rte,{value:e.execute,children:e.children})}let Tte={make:Ate};function po(){return Ut(T6)}let $te={};function Gh(e,t,r,n){return T(ua(r,t),i=>T(O(e,i.queryField),o=>O(o.labels,n)))}function Om(e,t,r,n){let i=ua(r,t);if(i===void 0)return!1;let o=O(e,i.queryField);return o!==void 0&&o.loaded?no(O(o.labels,n)):!1}function Nte(e){let t=nt(e);if(typeof t!="object")return[];switch(t.TAG){case"JSONString":let r=t._0;return r!==""?[r]:[];case"JSONArray":return se(t._0,ce).filter(n=>n!=="");default:return[]}}function Dte(e,t,r){let n={};return t.forEach(i=>{let o=i.kind;if(typeof o!="object")return;switch(o.TAG){case"KEntityId":case"KArrayOfEntityIds":break;default:return}let s=ua(r,o._0);if(s===void 0)return;let a=s.queryField,u={contents:D(O(n,a),[])};e.forEach(d=>{let f=O(d,i.key);if(f!==void 0){Nte(f).forEach(h=>{if(!u.contents.some(p=>p===h)){u.contents.push(h);return}});return}}),n[a]=u.contents}),n}function Fte(e){return et(e).toSorted((r,n)=>zf(r[0],n[0])).map(r=>r[0]+":"+r[1].toSorted(zf).join(",")).join("|")}function Ite(e){try{let t=atob(e),r=t.indexOf(":");return r>0&&r<(t.length-1|0)?t.slice(r+1|0):void 0}catch{return}}function $6(e,t,r){let n={},i=K(e),o=D(T(T(i,l=>O(l,"data")),K),{}),s=O(o,t),a=s!==void 0?s:T(i,l=>O(l,t));return D(T(T(T(a,K),l=>O(l,"edges")),Vt),[]).forEach(l=>{let u=T(T(K(l),g=>O(g,"node")),K);if(u===void 0)return;let d=T(O(u,"id"),ce),f=D(T(O(u,r),ce),"");if(d===void 0)return;let h=Ite(d),p=r==="id"?h!==void 0?h:d:f===""?d:f;if(n[d]=p,h!==void 0){n[h]=p;return}}),n}function Jh(e,t,r){let n=po(),i=oe(()=>$te),o=i[1],s=Dte(e,t,r),a=Fte(s);return Re(()=>{let l={contents:!1};return a!==""&&n!==void 0&&et(s).forEach(u=>{let d=u[1];if(d.length===0)return;let f=u[0],h=r.find(_=>_.queryField===f);if(h===void 0)return;let p=h.labelField,g=p==="id"?"id":"id "+p,m="query($ids: [ID!]) { "+f+"(first: "+d.length.toString()+", filter: {ids: $ids}) { edges { node { "+g+" } } } }",v={};v.ids=d.map(_=>_),qt(n(m,v).then(_=>{if(!l.contents){let x=$6(_,f,p);o(w=>{let S=bt(et(w));return S[f]={loaded:!0,labels:x},S})}return Promise.resolve()}),_=>(l.contents||(console.warn("[AutoUI] RefLabel batch "+f+" failed; cells fall back to raw ids",_),o(x=>{let w=bt(et(x));return w[f]={loaded:!0,labels:{}},w})),Promise.resolve()))}),()=>{l.contents=!0}},[a,n]),i[0]}let ia="table",$a={contents:[]};function Ko(e){$a.contents.some(t=>t.id===e.id)?$a.contents=$a.contents.map(t=>t.id===e.id?e:t):$a.contents=$a.contents.concat([e])}function N6(e){return $a.contents.find(t=>t.id===e)}function Tg(){return $a.contents}function $S(e){let t=$a.contents.filter(r=>{let n=r.arity;return typeof n!="object"||n.TAG==="Multi"?r.isCapable(e):!1});return t.filter(r=>r.id===ia).concat(t.filter(r=>r.id!==ia))}function NS(e){try{return ms(localStorage.getItem(e))}catch{return}}function D6(e,t){try{return localStorage.setItem(e,t)}catch{return}}function F6(e,t,r){return"autoui.viewmode."+D(e,"default")+"."+t+fe(r,"",n=>"."+n)}function La(e){return"var("+e+")"}let I6=E([L("inlineFlex"),ee("center"),c("border","1px solid var("+y.border+")"),c("border-radius",La(X.md)),c("overflow","hidden")]),DS=E([L("inlineFlex"),ee("center"),c("gap","4px"),c("background","none"),c("border","none"),c("padding","2px var("+F.sm+")"),c("color",La(y.textSecondary)),c("font-size",La($.sizeSm)),we("pointer"),Ye([c("background",La(y.surfaceSubtle)),c("color",La(y.textPrimary))])]),P6=$n([DS,E([c("background",La(y.surfaceSubtle)),c("color",La(y.textPrimary)),c("font-weight",La($.weightMedium))])]),Pte={group:I6,btn:DS,btnActive:P6};function Ote(e){let t=e.onSelect,r=e.activeId;return b("div",{children:e.modes.map(n=>M("button",{children:[n.icon,b("span",{children:n.label})],className:n.id===r?P6:DS,title:n.label,onClick:i=>t(n.id)},n.id)),"aria-label":"View mode",className:I6,role:"group"})}let cf={Style:Pte,make:Ote};function Mte(e){let t=e.source,r=pl(),n=em(),i=wi(t.schema,"List"),o=t.rows.map((f,h)=>{let p=D(K(f),{});return{rowKey:D(T(O(p,"id"),ce),"#"+h.toString()),json:f,dict:p}}),s=Jh(o.map(f=>f.dict),i,r),u={lookupLabel:(f,h)=>Gh(s,f,r,h),isMissing:(f,h)=>Om(s,f,r,h)},d=i.map(f=>({key:f.key,label:f.label,render:h=>Jl(f.key,f.kind,f.propSchema,O(h.dict,f.key),f.ann,r,n,u,void 0),sortable:!1,width:f.width}));return b(Q0,{columns:d,data:o,keyFn:f=>f.rowKey,onRowClick:f=>t.onOpenRow(f.rowKey,f.json)})}let Lte=b("span",{children:"▦","aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}});Ko({id:ia,label:"Table",icon:Lte,arity:"Single",isCapable:e=>!0,render:e=>{let t=e[0];return t!==void 0?b(Mte,{source:t}):null},capability:"always — the universal default"});let sA=["resources","events"],aA=["split","full"],lA=["funnel","scatter"],d1={};function $o(e,t){return T(e.views,r=>O(r,t))}function il(e,t){return T(e.fields,r=>O(r,t))}function lo(e,t){console.error("[AutoUI] ui-hints "+e+": "+t)}function Hi(e,t,r){let n=e[t];if(n===void 0)return;let i=ge.string(n);if(i!==void 0)return i;lo(r+"."+t,"expected a string — dropped")}function uA(e,t,r){let n=e[t];if(n===void 0)return;let i=ge.bool(n);if(i!==void 0)return i;lo(r+"."+t,"expected a boolean — dropped")}function zte(e,t,r){let n=e[t];if(n===void 0)return;let i=ge.array(n);if(i!==void 0)return se(i,ge.string);lo(r+"."+t,"expected an array of strings — dropped")}function cA(e,t,r,n){let i=e[t];if(i===void 0)return;let o=ge.object(i);if(o!==void 0){let s={};return Object.entries(o).forEach(a=>{let l=a[0];ie(n(a[1],r+"."+t+'["'+l+'"]'),u=>{s[l]=u})}),s}lo(r+"."+t,"expected an object — dropped")}function O6(e,t){let r=ge.object(e);if(r!==void 0){let n={};return Object.entries(r).forEach(i=>{let o=i[0],s=ge.string(i[1]);if(s!==void 0){n[o]=s;return}else return lo(t+"."+o,"expected a string — dropped")}),n}lo(t,"expected an object of string values — dropped")}function Ute(e,t){let r=ge.object(e);if(r!==void 0){let n=r.transitions;return{mode:Hi(r,"mode",t),layout:Hi(r,"layout",t),canvas:Hi(r,"canvas",t),role:Hi(r,"role",t),resourceRef:Hi(r,"resourceRef",t),accent:Hi(r,"accent",t),audit:uA(r,"audit",t),presence:uA(r,"presence",t),suppress:zte(r,"suppress",t),transitions:n!==void 0?O6(n,t+".transitions"):void 0}}lo(t,"expected an object — dropped")}function Bte(e,t){let r=ge.object(e);if(r!==void 0){let n=Hi(r,"view",t);if(n!==void 0)return{view:n,label:Hi(r,"label",t),field:Hi(r,"field",t),aggregate:Hi(r,"aggregate",t),viz:Hi(r,"viz",t),xField:Hi(r,"xField",t)};lo(t,"metric without a `view` — dropped");return}lo(t,"expected an object — dropped")}function jte(e,t){let r=e!==void 0?e:"ui-hints",n=ge.object(t);if(n!==void 0){let i=n.dashboard,o;if(i!==void 0){let s=ge.array(i);s!==void 0?o=vD(s,(a,l)=>Bte(a,r+".dashboard["+l.toString()+"]")):(lo(r+".dashboard","expected an array of metrics — dropped"),o=void 0)}else o=void 0;return{views:cA(n,"views",r,Ute),fields:cA(n,"fields",r,O6),dashboard:o}}return lo(r,"expected an object — no hints applied"),d1}function qte(e){let t=ge.object(e);if(t!==void 0){let r={};return Object.entries(t).forEach(n=>{let i=n[0];r[i]=jte('ui-hints["'+i+'"]',n[1])}),r}return lo("ui-hints.json","top-level value is not a {pluginId: hints} object — ignored"),{}}function Vte(e,t){let r={};return Object.entries(e).forEach(n=>{r[n[0]]=n[1]}),Object.entries(t).forEach(n=>{let i=n[0];We(e[i])&&console.info("[AutoUI] uiHints ("+i+"): code-supplied hints replace the ui-hints.json entry"),r[i]=n[1]}),r}function sc(e){return D(W(T(T(K(e),t=>O(t,"properties")),K),t=>Object.keys(t)),[])}function Kte(e,t){return T(T(T(T(T(K(e),r=>O(r,"properties")),K),r=>O(r,t)),K),r=>O(r,"items"))}function v_(e,t){let r=t.split("."),n=D(r[0],t),i=e.readModels.find(s=>s.name===n),o=i!==void 0?i.schema:W(e.stateViewSlices.find(s=>s.name===n),s=>s.schema);return o!==void 0?lt(r.slice(1),{TAG:"Ok",_0:{schema:o}},(s,a)=>{if(s.TAG!=="Ok")return s;let l=s._0.schema,u=Kte(l,a);return u!==void 0?{TAG:"Ok",_0:{schema:u}}:sc(l).includes(a)?fe(T(T(T(K(l),d=>O(d,"properties")),K),d=>O(d,a)),{TAG:"Error",_0:'unresolvable path segment "'+a+'" in "'+t+'"'},d=>({TAG:"Ok",_0:{schema:d}})):{TAG:"Error",_0:'unknown field "'+a+'" in path "'+t+'"'}}):{TAG:"Error",_0:'unknown view "'+n+'" — known views: '+e.readModels.map(s=>s.name).concat(e.stateViewSlices.map(s=>s.name)).join(", ")}}function Hte(e){return e.aggregates.flatMap(t=>t.commands).concat(e.stateChangeSlices.flatMap(t=>t.commands).concat(e.readModels.flatMap(t=>t.commands))).map(t=>t.name)}function M6(e,t){let r=e.readModels.find(n=>n.name===t);return r!==void 0?r.statusField:T(e.stateViewSlices.find(n=>n.name===t),n=>n.statusField)}function Wte(e,t,r){let n=gD(M6(e,t),Vr(r,void 0).statusField);return n!==void 0?Bo(r,n):[]}function Gte(e){return Yr(e).filter(t=>Qa(t[1])).map(t=>t[0])}function dA(e,t){if(N6(e)!==void 0)return;let n=Tg().map(i=>i.id).join(", ");return t+': unknown view-mode id "'+e+'" — registered modes: '+n}function Jte(e,t){let r=[],n=i=>{r.push("[AutoUI] uiHints ("+t.id+"): "+i)};return ie(e.views,i=>{et(i).forEach(o=>{let s=o[1],a=o[0],l=v_(t,a);l.TAG!=="Ok"&&n('views["'+a+'"]: '+l._0),ie(s.role,u=>{if(!sA.includes(u))return n('views["'+a+'"].role: unknown role "'+u+'" — expected '+sA.join(" or "));if(u!=="events")return;let d=s.resourceRef;return d!==void 0?l.TAG==="Ok"&&!sc(l._0.schema).includes(d)?n('views["'+a+'"].resourceRef: unknown field "'+d+'"'):void 0:n('views["'+a+'"]: role "events" requires a resourceRef field')}),ie(s.resourceRef,u=>{if(Uf(s.role,"events"))return n('views["'+a+'"].resourceRef: only meaningful with role "events"')}),ie(s.transitions,u=>{let d=Hte(t),f=M6(t,a),h;h=l.TAG==="Ok"?f!==void 0?Bo(l._0.schema,f):[]:[],h.length===0&&n('views["'+a+'"].transitions: the view declares no status enum, so no transition can apply'),et(u).forEach(p=>{let g=p[1],m=p[0];if(d.includes(g)||n('views["'+a+'"].transitions["'+m+'"]: unknown command "'+g+'" — known commands: '+d.join(", ")),h.length!==0&&!h.includes(m))return n('views["'+a+'"].transitions: unknown target state "'+m+'" — known states: '+h.join(", "))})}),ie(s.mode,u=>ie(dA(u,'views["'+a+'"].mode'),n)),ie(s.layout,u=>{if(!aA.includes(u))return n('views["'+a+'"].layout: unknown layout "'+u+'" — expected '+aA.join(" or "))}),ie(s.suppress,u=>{u.forEach(d=>{if(ie(dA(d,'views["'+a+'"].suppress'),n),d===ia)return n('views["'+a+'"].suppress: the "table" mode is the universal fallback and cannot be suppressed')})})})}),ie(e.fields,i=>{et(i).forEach(o=>{let s=o[0],a=v_(t,s);if(a.TAG!=="Ok")return n('fields["'+s+'"]: '+a._0);let l=sc(a._0.schema);et(o[1]).forEach(u=>{let d=u[1],f=u[0];if(l.includes(f)||n('fields["'+s+'"]: unknown field "'+f+'"'),no(Sx(d)))return n('fields["'+s+'"].'+f+': unknown semantic "'+d+'"')})})}),ie(e.dashboard,i=>{i.forEach(o=>{let s=D(o.aggregate,"count");["count","sum","avg"].includes(s)?s!=="count"&&no(o.field)&&n('dashboard metric on "'+o.view+'": aggregate "'+s+'" requires a field'):n('dashboard metric on "'+o.view+'": unknown aggregate "'+s+'" — expected count, sum, or avg');let a=v_(t,o.view);if(a.TAG!=="Ok")return n("dashboard metric: "+a._0);let l=a._0.schema;ie(o.field,u=>{if(!sc(l).includes(u))return n('dashboard metric on "'+o.view+'": unknown field "'+u+'"')}),ie(o.xField,u=>{if(!sc(l).includes(u))return n('dashboard metric on "'+o.view+'": unknown xField "'+u+'"')}),ie(o.viz,u=>{if(!lA.includes(u))return n('dashboard metric on "'+o.view+'": unknown viz "'+u+'" — expected '+lA.join(", "));if(u==="funnel"&&Wte(t,o.view,l).length===0)return n('dashboard metric on "'+o.view+'": viz "funnel" needs a status enum to order the stages, and this view declares none');if(u!=="scatter")return;let d=o.field,f=o.xField;if(d!==void 0&&f!==void 0){let h=sc(l),p=Gte(l);[["field",d],["xField",f]].forEach(g=>{let m=g[1];if(h.includes(m)&&!p.includes(m))return n('dashboard metric on "'+o.view+'": viz "scatter" '+g[0]+' "'+m+'" is not a numeric field')});return}n('dashboard metric on "'+o.view+'": viz "scatter" needs both a field (the y measure) and an xField (the x measure)')})})}),r.forEach(i=>{console.error(i)}),r}function L6(e,t){let r=$S(e),n=T(t,i=>i.suppress);return n!==void 0?r.filter(i=>i.id===ia?!0:!n.includes(i.id)):r}function z6(e,t,r,n){let i=l=>T(l,u=>n.find(d=>d.id===u)),o=i(e);if(o!==void 0)return o;let s=i(T(t,l=>l.mode));if(s!==void 0)return s;let a=i(r);return a!==void 0?a:n[0]}function __(e){switch(e){case"full":return"Full";case"split":return"Split";default:return}}function Qte(e,t,r,n){if(!n)return"Full";let i=T(e,__);if(i!==void 0)return i;let o=T(T(t,s=>s.layout),__);return o!==void 0?o:D(T(r,__),"Full")}function Yte(e,t){return D(T(e,r=>r.audit),!1)?!0:t}function Xte(e){return D(T(e,t=>t.presence),!1)}function Zte(e){return e.startsWith("https://")?"wss://"+e.slice(8):e.startsWith("http://")?"ws://"+e.slice(7):e.startsWith("/")?(location.protocol==="https:"?"wss":"ws")+"://"+location.host+e:e}let ere="/ui-hints.json";function tre(e){return e.toLowerCase()==="fleet"?"Fleet":"Single"}function rre(e){switch(e.toLowerCase()){case"cognito":return"Cognito";case"inmemory":case"local":return"Local";default:return"Anonymous"}}function nre(e){let t=ge.object(e);if(t===void 0)return{TAG:"Error",_0:"config.json: top-level value is not an object"};let r=s=>T(t[s],ge.string),n=r("apiEndpoint");if(n===void 0)return{TAG:"Error",_0:"config.json: missing required field `apiEndpoint`"};let i=D(r("platformApiEndpoint"),n),o=s=>T(t[s],ge.bool);return{TAG:"Ok",_0:{apiEndpoint:n,platformApiEndpoint:i,platformApiSubscriptionEndpoint:D(r("platformApiSubscriptionEndpoint"),Zte(i)),domainApiEventsEndpoint:r("domainApiEventsEndpoint"),platformApiEventsEndpoint:r("platformApiEventsEndpoint"),clientEventsNamespace:r("clientEventsNamespace"),liveUpdates:D(o("liveUpdates"),!0),liveReconnectRefetch:D(o("liveReconnectRefetch"),!0),region:r("region"),authMode:D(W(r("authMode"),rre),"Anonymous"),cognitoUserPoolId:r("cognitoUserPoolId"),cognitoClientId:r("cognitoClientId"),autoRedirectFirstPage:D(o("autoRedirectFirstPage"),!1),mode:D(W(r("mode"),tre),"Single"),environment:r("environment"),platformName:r("platformName"),accessTiers:se(D(T(t.accessTiers,ge.array),[]),ge.string),viewModes:se(D(T(t.viewModes,ge.array),[]),ge.string),mapStyle:r("mapStyle"),graphLayout:r("graphLayout"),geocoderEndpoint:r("geocoderEndpoint"),uploadEndpoint:r("uploadEndpoint"),assetOrigins:D(W(T(t.assetOrigins,ge.object),s=>Object.fromEntries(se(Object.entries(s),a=>{let l=a[0];return W(ge.string(a[1]),u=>[l,u])}))),{}),uiHintsUrl:D(r("uiHintsUrl"),ere)}}}function ire(e){return qt(fetch(e).then(t=>t.ok?t.json().then(qte):(console.warn("[AutoUI] "+e+": not loaded (status "+t.status.toString()+") — no UI hints applied"),Promise.resolve({}))),t=>(console.warn("[AutoUI] "+e+": not loaded ("+String(t)+") — no UI hints applied"),Promise.resolve({})))}function ore(){return qt(fetch("/config.json").then(e=>e.ok?e.json().then(nre):Promise.resolve({TAG:"Error",_0:"config.json: fetch failed with status "+e.status.toString()})),e=>Promise.resolve({TAG:"Error",_0:"config.json: fetch threw — "+String(e)}))}function $g(e){return D(T(T(ge.object(e),t=>t.errors),ge.array),[]).some(t=>D(W(T(T(T(T(ge.object(t),r=>r.extensions),ge.object),r=>r.code),ge.string),r=>r==="UNAUTHORIZED"),!1))}function sre(e,t,r,n){return(i,o)=>{let s=i.includes("Platform")||i.includes("platform")?t:e,a=Object.fromEntries([["content-type","application/json"]]),l=r();return l!==void 0&&(a.Authorization="Bearer "+l),fetch(s,{method:"POST",headers:a,body:D(JSON.stringify({query:i,variables:o}),"")}).then(u=>(u.status===401&&n(),u.json())).then(u=>($g(u)&&n(),Promise.resolve(D(T(ge.object(u),d=>d.data),null))))}}class df extends Error{}df.prototype.name="InvalidTokenError";function are(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function lre(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return are(t)}catch{return atob(t)}}function ure(e,t){if(typeof e!="string")throw new df("Invalid token specified: must be a string");t||(t={});const r=t.header===!0?0:1,n=e.split(".")[r];if(typeof n!="string")throw new df(`Invalid token specified: missing part #${r+1}`);let i;try{i=lre(n)}catch(o){throw new df(`Invalid token specified: invalid base64 for part #${r+1} (${o.message})`)}try{return JSON.parse(i)}catch(o){throw new df(`Invalid token specified: invalid json for part #${r+1} (${o.message})`)}}let cre=(function(e){return e&&e.name?String(e.name):"UnknownError"}),dre=(function(e){return e&&e.message?String(e.message):""});function FS(e){return{name:cre(e),message:dre(e)}}function IS(e){switch(e.name){case"PasswordResetRequiredException":return"Password reset required — contact your administrator";case"LimitExceededException":case"TooManyRequestsException":return"Too many attempts — please wait a moment and try again";case"UserNotConfirmedException":return"Account not confirmed — check your email";case"NotAuthorizedException":case"UserNotFoundException":return"Incorrect username or password";default:return"Sign-in failed. Please try again."}}const fre=e=>({setHttpHandler(t){e.httpHandler=t},httpHandler(){return e.httpHandler},updateHttpClientConfig(t,r){e.httpHandler?.updateHttpClientConfig(t,r)},httpHandlerConfigs(){return e.httpHandler.httpHandlerConfigs()}}),hre=e=>({httpHandler:e.httpHandler()});var ph;(function(e){e.HTTP="http",e.HTTPS="https"})(ph||(ph={}));var gh;(function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"})(gh||(gh={}));const f1="__smithy_context";class Oi{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){const r=new Oi({...t,headers:{...t.headers}});return r.query&&(r.query=pre(r.query)),r}static isInstance(t){if(!t)return!1;const r=t;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return Oi.clone(this)}}function pre(e){return Object.keys(e).reduce((t,r)=>{const n=e[r];return{...t,[r]:Array.isArray(n)?[...n]:n}},{})}class Qc{statusCode;reason;headers;body;constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;const r=t;return typeof r.statusCode=="number"&&typeof r.headers=="object"}}const gre=e=>t=>async r=>{if(!Oi.isInstance(r.request))return t(r);const{request:n}=r,{handlerProtocol:i=""}=e.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!n.headers[":authority"])delete n.headers.host,n.headers[":authority"]=n.hostname+(n.port?":"+n.port:"");else if(!n.headers.host){let o=n.hostname;n.port!=null&&(o+=`:${n.port}`),n.headers.host=o}return t(r)},mre={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},vre=e=>({applyToStack:t=>{t.add(gre(e),mre)}}),_re=()=>(e,t)=>async r=>{try{const n=await e(r),{clientName:i,commandName:o,logger:s,dynamoDbDocumentClientOptions:a={}}=t,{overrideInputFilterSensitiveLog:l,overrideOutputFilterSensitiveLog:u}=a,d=l??t.inputFilterSensitiveLog,f=u??t.outputFilterSensitiveLog,{$metadata:h,...p}=n.output;return s?.info?.({clientName:i,commandName:o,input:d(r.input),output:f(p),metadata:h}),n}catch(n){const{clientName:i,commandName:o,logger:s,dynamoDbDocumentClientOptions:a={}}=t,{overrideInputFilterSensitiveLog:l}=a,u=l??t.inputFilterSensitiveLog;throw s?.error?.({clientName:i,commandName:o,input:u(r.input),error:n,metadata:n.$metadata}),n}},bre={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},yre=e=>({applyToStack:t=>{t.add(_re(),bre)}}),xre={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},Sre=()=>e=>async t=>e(t),Ere=e=>({applyToStack:t=>{t.add(Sre(),xre)}}),wd=e=>e[f1]||(e[f1]={}),Ys=e=>{if(typeof e=="function")return e;const t=Promise.resolve(e);return()=>t},wre=(e,t)=>{if(!t||t.length===0)return e;const r=[];for(const n of t)for(const i of e)i.schemeId.split("#")[1]===n&&r.push(i);for(const n of e)r.find(({schemeId:i})=>i===n.schemeId)||r.push(n);return r};function kre(e){const t=new Map;for(const r of e)t.set(r.schemeId,r);return t}const Cre=(e,t)=>(r,n)=>async i=>{const o=e.httpAuthSchemeProvider(await t.httpAuthSchemeParametersProvider(e,n,i.input)),s=e.authSchemePreference?await e.authSchemePreference():[],a=wre(o,s),l=kre(e.httpAuthSchemes),u=wd(n),d=[];for(const f of a){const h=l.get(f.schemeId);if(!h){d.push(`HttpAuthScheme \`${f.schemeId}\` was not enabled for this service.`);continue}const p=h.identityProvider(await t.identityProviderConfigProvider(e));if(!p){d.push(`HttpAuthScheme \`${f.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:g={},signingProperties:m={}}=f.propertiesExtractor?.(e,n)||{};f.identityProperties=Object.assign(f.identityProperties||{},g),f.signingProperties=Object.assign(f.signingProperties||{},m),u.selectedHttpAuthScheme={httpAuthOption:f,identity:await p(f.identityProperties),signer:h.signer};break}if(!u.selectedHttpAuthScheme)throw new Error(d.join(`
42
- `));return r(i)},Rre={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},Are=(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:r})=>({applyToStack:n=>{n.addRelativeTo(Cre(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:r}),Rre)}}),Tre=e=>t=>{throw t},$re=(e,t)=>{},Nre=e=>(t,r)=>async n=>{if(!Oi.isInstance(n.request))return t(n);const o=wd(r).selectedHttpAuthScheme;if(!o)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:s={}},identity:a,signer:l}=o,u=await t({...n,request:await l.sign(n.request,a,s)}).catch((l.errorHandler||Tre)(s));return(l.successHandler||$re)(u.response,s),u},Dre={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},Fre=e=>({applyToStack:t=>{t.addRelativeTo(Nre(),Dre)}}),Cf=e=>{if(typeof e=="function")return e;const t=Promise.resolve(e);return()=>t},U6="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fA=Object.entries(U6).reduce((e,[t,r])=>(e[r]=Number(t),e),{}),Ire=U6.split(""),$c=6,Rf=8,Pre=63,Mm=e=>{let t=e.length/4*3;e.slice(-2)==="=="?t-=2:e.slice(-1)==="="&&t--;const r=new ArrayBuffer(t),n=new DataView(r);for(let i=0;i<e.length;i+=4){let o=0,s=0;for(let u=i,d=i+3;u<=d;u++)if(e[u]!=="="){if(!(e[u]in fA))throw new TypeError(`Invalid character ${e[u]} in base64 string.`);o|=fA[e[u]]<<(d-u)*$c,s+=$c}else o>>=$c;const a=i/4*3;o>>=s%Rf;const l=Math.floor(s/Rf);for(let u=0;u<l;u++){const d=(l-u-1)*Rf;n.setUint8(a+u,(o&255<<d)>>d)}}return new Uint8Array(r)},Yc=e=>new TextEncoder().encode(e),mh=e=>typeof e=="string"?Yc(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),PS=e=>{if(typeof e=="string")return e;if(typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)};function Ng(e){let t;typeof e=="string"?t=Yc(e):t=e;const r=typeof t=="object"&&typeof t.length=="number",n=typeof t=="object"&&typeof t.byteOffset=="number"&&typeof t.byteLength=="number";if(!r&&!n)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let i="";for(let o=0;o<t.length;o+=3){let s=0,a=0;for(let u=o,d=Math.min(o+3,t.length);u<d;u++)s|=t[u]<<(d-u-1)*Rf,a+=Rf;const l=Math.ceil(a/$c);s<<=l*$c-a;for(let u=1;u<=l;u++){const d=(l-u)*$c;i+=Ire[(s&Pre<<d)>>d]}i+="==".slice(0,4-l)}return i}class Ql extends Uint8Array{static fromString(t,r="utf-8"){if(typeof t=="string")return r==="base64"?Ql.mutate(Mm(t)):Ql.mutate(Yc(t));throw new Error(`Unsupported conversion from ${typeof t} to Uint8ArrayBlobAdapter.`)}static mutate(t){return Object.setPrototypeOf(t,Ql.prototype),t}transformToString(t="utf-8"){return t==="base64"?Ng(this):PS(this)}}const Yl=e=>encodeURIComponent(e).replace(/[!'()*]/g,Ore),Ore=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function Mre(e){const t=[];for(let r of Object.keys(e).sort()){const n=e[r];if(r=Yl(r),Array.isArray(n))for(let i=0,o=n.length;i<o;i++)t.push(`${r}=${Yl(n[i])}`);else{let i=r;(n||typeof n=="string")&&(i+=`=${Yl(n)}`),t.push(i)}}return t.join("&")}function hA(e,t){return new Request(e,t)}function Lre(e=0){return new Promise((t,r)=>{e&&setTimeout(()=>{const n=new Error(`Request did not complete within ${e} ms`);n.name="TimeoutError",r(n)},e)})}const b_={supported:void 0};class OS{config;configProvider;static create(t){return typeof t?.handle=="function"?t:new OS(t)}constructor(t){typeof t=="function"?this.configProvider=t().then(r=>r||{}):(this.config=t??{},this.configProvider=Promise.resolve(this.config)),b_.supported===void 0&&(b_.supported=typeof Request<"u"&&"keepalive"in hA("https://[::1]"))}destroy(){}async handle(t,{abortSignal:r,requestTimeout:n}={}){this.config||(this.config=await this.configProvider);const i=n??this.config.requestTimeout,o=this.config.keepAlive===!0,s=this.config.credentials;if(r?.aborted){const x=pA(r);return Promise.reject(x)}let a=t.path;const l=Mre(t.query||{});l&&(a+=`?${l}`),t.fragment&&(a+=`#${t.fragment}`);let u="";if(t.username!=null||t.password!=null){const x=t.username??"",w=t.password??"";u=`${x}:${w}@`}const{port:d,method:f}=t,h=`${t.protocol}//${u}${t.hostname}${d?`:${d}`:""}${a}`,p=f==="GET"||f==="HEAD"?void 0:t.body,g={body:p,headers:new Headers(t.headers),method:f,credentials:s};this.config?.cache&&(g.cache=this.config.cache),p&&(g.duplex="half"),typeof AbortController<"u"&&(g.signal=r),b_.supported&&(g.keepalive=o),typeof this.config.requestInit=="function"&&Object.assign(g,this.config.requestInit(t));let m=()=>{};const v=hA(h,g),_=[fetch(v).then(x=>{const w=x.headers,S={};for(const A of w.entries())S[A[0]]=A[1];return x.body!=null?{response:new Qc({headers:S,reason:x.statusText,statusCode:x.status,body:x.body})}:x.blob().then(A=>({response:new Qc({headers:S,reason:x.statusText,statusCode:x.status,body:A})}))}),Lre(i)];return r&&_.push(new Promise((x,w)=>{const S=()=>{const k=pA(r);w(k)};if(typeof r.addEventListener=="function"){const k=r;k.addEventListener("abort",S,{once:!0}),m=()=>k.removeEventListener("abort",S)}else r.onabort=S})),Promise.race(_).finally(m)}updateHttpClientConfig(t,r){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[t]=r,n))}httpHandlerConfigs(){return this.config??{}}}function pA(e){const t=e&&typeof e=="object"&&"reason"in e?e.reason:void 0;if(t){if(t instanceof Error){const i=new Error("Request aborted");return i.name="AbortError",i.cause=t,i}const n=new Error(String(t));return n.name="AbortError",n}const r=new Error("Request aborted");return r.name="AbortError",r}const zre=async e=>typeof Blob=="function"&&e instanceof Blob||e.constructor?.name==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await e.arrayBuffer()):Ure(e):Bre(e);async function Ure(e){const t=await jre(e),r=Mm(t);return new Uint8Array(r)}async function Bre(e){const t=[],r=e.getReader();let n=!1,i=0;for(;!n;){const{done:a,value:l}=await r.read();l&&(t.push(l),i+=l.length),n=a}const o=new Uint8Array(i);let s=0;for(const a of t)o.set(a,s),s+=a.length;return o}function jre(e){return new Promise((t,r)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));const i=n.result??"",o=i.indexOf(","),s=o>-1?o+1:i.length;t(i.substring(s))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(e)})}const B6={},h1={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),B6[e]=t,h1[t]=e}function qre(e){if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2){const n=e.slice(r,r+2).toLowerCase();if(n in h1)t[r/2]=h1[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return t}function Xl(e){let t="";for(let r=0;r<e.byteLength;r++)t+=B6[e[r]];return t}const p1=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return Ql.mutate(e);if(!e)return Ql.mutate(new Uint8Array);const r=t.streamCollector(e);return Ql.mutate(await r)},O0=e=>typeof e=="function"?e():e,j6=(e,t,r,n,i)=>({name:t,namespace:e,traits:r,input:n,output:i}),Vre=e=>(t,r)=>async n=>{const{response:i}=await t(n),{operationSchema:o}=wd(r),[,s,a,l,u,d]=o??[];try{const f=await e.protocol.deserializeResponse(j6(s,a,l,u,d),{...e,...r},i);return{response:i,output:f}}catch(f){if(Object.defineProperty(f,"$response",{value:i,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in f)){const h="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{f.message+=`
43
- `+h}catch{!r.logger||r.logger?.constructor?.name==="NoOpLogger"?console.warn(h):r.logger?.warn?.(h)}typeof f.$responseBodyText<"u"&&f.$response&&(f.$response.body=f.$responseBodyText);try{if(Qc.isInstance(i)){const{headers:p={}}=i,g=Object.entries(p);f.$metadata={httpStatusCode:i.statusCode,requestId:y_(/^x-[\w-]+-request-?id$/,g),extendedRequestId:y_(/^x-[\w-]+-id-2$/,g),cfId:y_(/^x-[\w-]+-cf-id$/,g)}}}catch{}}throw f}},y_=(e,t)=>(t.find(([r])=>r.match(e))||[void 0,void 0])[1];function Kre(e){const t={};if(e=e.replace(/^\?/,""),e)for(const r of e.split("&")){let[n,i=null]=r.split("=");n=decodeURIComponent(n),i&&(i=decodeURIComponent(i)),n in t?Array.isArray(t[n])?t[n].push(i):t[n]=[t[n],i]:t[n]=i}return t}const Xc=e=>{if(typeof e=="string")return Xc(new URL(e));const{hostname:t,pathname:r,port:n,protocol:i,search:o}=e;let s;return o&&(s=Kre(o)),{hostname:t,port:n?parseInt(n):void 0,protocol:i,path:r,query:s}},Hre=e=>{if(typeof e=="object"){if("url"in e){const t=Xc(e.url);if(e.headers){t.headers={};for(const r in e.headers)t.headers[r.toLowerCase()]=e.headers[r].join(", ")}return t}return e}return Xc(e)},Wre=e=>(t,r)=>async n=>{const{operationSchema:i}=wd(r),[,o,s,a,l,u]=i??[],d=r.endpointV2?async()=>Hre(r.endpointV2):e.endpoint,f=await e.protocol.serializeRequest(j6(o,s,a,l,u),n.input,{...e,...r,endpoint:d});return t({...n,request:f})},Gre={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Jre={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function Qre(e){return{applyToStack:t=>{t.add(Wre(e),Jre),t.add(Vre(e),Gre),e.protocol.setSerdeContext(e)}}}const x_=[];function ff(e){if(typeof e=="object")return e;if(e=e|0,x_[e])return x_[e];const t={};let r=0;for(const n of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])(e>>r++&1)===1&&(t[n]=1);return x_[e]=t}const Wd={it:Symbol.for("@smithy/nor-struct-it"),ns:Symbol.for("@smithy/ns")},S_=[],E_={};class cn{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=cn.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(t,r){this.ref=t,this.memberName=r;const n=[];let i=t,o=t;for(this._isMemberSchema=!1;w_(i);)n.push(i[1]),i=i[0],o=O0(i),this._isMemberSchema=!0;if(n.length>0){this.memberTraits={};for(let s=n.length-1;s>=0;--s){const a=n[s];Object.assign(this.memberTraits,ff(a))}}else this.memberTraits=0;if(o instanceof cn){const s=this.memberTraits;Object.assign(this,o),this.memberTraits=Object.assign({},s,o.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=r??o.memberName;return}if(this.schema=O0(o),Yre(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(o),this.traits=0),this._isMemberSchema&&!r)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](t){const r=this.prototype.isPrototypeOf(t);return!r&&typeof t=="object"&&t!==null?t.symbol===this.symbol:r}static of(t){const r=typeof t=="function"||typeof t=="object"&&t!==null;if(typeof t=="number"){if(S_[t])return S_[t]}else if(typeof t=="string"){if(E_[t])return E_[t]}else if(r&&t[Wd.ns])return t[Wd.ns];const n=O0(t);if(n instanceof cn)return n;if(w_(n)){const[o,s]=n;if(o instanceof cn)return Object.assign(o.getMergedTraits(),ff(s)),o;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(t,null,2)}.`)}const i=new cn(n);return r?t[Wd.ns]=i:typeof n=="string"?E_[n]=i:typeof n=="number"?S_[n]=i:i}getSchema(){const t=this.schema;return Array.isArray(t)&&t[0]===0?t[4]:t}getName(t=!1){const{name:r}=this;return!t&&r&&r.includes("#")?r.split("#")[1]:r||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){const t=this.getSchema();return typeof t=="number"?t>=64&&t<128:t[0]===1}isMapSchema(){const t=this.getSchema();return typeof t=="number"?t>=128&&t<=255:t[0]===2}isStructSchema(){const t=this.getSchema();if(typeof t!="object")return!1;const r=t[0];return r===3||r===-3||r===4}isUnionSchema(){const t=this.getSchema();return typeof t!="object"?!1:t[0]===4}isBlobSchema(){const t=this.getSchema();return t===21||t===42}isTimestampSchema(){const t=this.getSchema();return typeof t=="number"&&t>=4&&t<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){const{streaming:t}=this.getMergedTraits();return!!t||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return ff(this.memberTraits)}getOwnTraits(){return ff(this.traits)}getKeySchema(){const[t,r]=[this.isDocumentSchema(),this.isMapSchema()];if(!t&&!r)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const n=this.getSchema(),i=t?15:n[4]??0;return Gd([i,0],"key")}getValueSchema(){const t=this.getSchema(),[r,n,i]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],o=typeof t=="number"?63&t:t&&typeof t=="object"&&(n||i)?t[3+t[0]]:r?15:void 0;if(o!=null)return Gd([o,0],n?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(t){const r=this.getSchema();if(this.isStructSchema()&&r[4].includes(t)){const n=r[4].indexOf(t),i=r[5][n];return Gd(w_(i)?i:[i,0],t)}if(this.isDocumentSchema())return Gd([15,0],t);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${t}.`)}getMemberSchemas(){const t={};try{for(const[r,n]of this.structIterator())t[r]=n}catch{}return t}getEventStreamMember(){if(this.isStructSchema()){for(const[t,r]of this.structIterator())if(r.isStreaming()&&r.isStructSchema())return t}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");const t=this.getSchema(),r=t[4].length;let n=t[Wd.it];if(n&&r===n.length){yield*n;return}n=Array(r);for(let i=0;i<r;++i){const o=t[4][i],s=Gd([t[5][i],0],o);yield n[i]=[o,s]}t[Wd.it]=n}}function Gd(e,t){if(e instanceof cn)return Object.assign(e,{memberName:t,_isMemberSchema:!0});const r=cn;return new r(e,t)}const w_=e=>Array.isArray(e)&&e.length===2,Yre=e=>Array.isArray(e)&&e.length>=5;class Si{namespace;schemas;exceptions;static registries=new Map;constructor(t,r=new Map,n=new Map){this.namespace=t,this.schemas=r,this.exceptions=n}static for(t){return Si.registries.has(t)||Si.registries.set(t,new Si(t)),Si.registries.get(t)}copyFrom(t){const{schemas:r,exceptions:n}=this;for(const[i,o]of t.schemas)r.has(i)||r.set(i,o);for(const[i,o]of t.exceptions)n.has(i)||n.set(i,o)}register(t,r){const n=this.normalizeShapeId(t);for(const i of[this,Si.for(n.split("#")[0])])i.schemas.set(n,r)}getSchema(t){const r=this.normalizeShapeId(t);if(!this.schemas.has(r))throw new Error(`@smithy/core/schema - schema not found for ${r}`);return this.schemas.get(r)}registerError(t,r){const n=t,i=n[1];for(const o of[this,Si.for(i)])o.schemas.set(i+"#"+n[2],n),o.exceptions.set(n,r)}getErrorCtor(t){const r=t;return this.exceptions.has(r)?this.exceptions.get(r):Si.for(r[1]).exceptions.get(r)}getBaseException(){for(const t of this.exceptions.keys())if(Array.isArray(t)){const[,r,n]=t,i=r+"#"+n;if(i.startsWith("smithy.ts.sdk.synthetic.")&&i.endsWith("ServiceException"))return t}}find(t){for(const r of this.schemas.values())if(t(r))return r}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(t){return t.includes("#")?t:this.namespace+"#"+t}}const g1=e=>{if(e!=null){if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&sne.warn(one(`Expected number but observed string: ${e}`)),t}if(typeof e=="number")return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)}},Xre=Math.ceil(2**127*(2-2**-23)),gA=e=>{const t=g1(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>Xre)throw new TypeError(`Expected 32-bit float, got ${e}`);return t},Zre=e=>{if(e!=null){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)}},mA=e=>q6(e,16),vA=e=>q6(e,8),q6=(e,t)=>{const r=Zre(e);if(r!==void 0&&ene(r,t)!==r)throw new TypeError(`Expected ${t}-bit integer, got ${e}`);return r},ene=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},tne=e=>g1(typeof e=="string"?Lm(e):e),rne=e=>gA(typeof e=="string"?Lm(e):e),nne=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,Lm=e=>{const t=e.match(nne);if(t===null||t[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)},Dg=e=>mA(typeof e=="string"?Lm(e):e),ine=e=>vA(typeof e=="string"?Lm(e):e),one=e=>String(new TypeError(e).stack||e).split(`
44
- `).slice(0,5).filter(t=>!t.includes("stackTraceWarning")).join(`
45
- `),sne={warn:console.warn},ane=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MS=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function lne(e){const t=e.getUTCFullYear(),r=e.getUTCMonth(),n=e.getUTCDay(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),a=e.getUTCSeconds(),l=i<10?`0${i}`:`${i}`,u=o<10?`0${o}`:`${o}`,d=s<10?`0${s}`:`${s}`,f=a<10?`0${a}`:`${a}`;return`${ane[n]}, ${l} ${MS[r]} ${t} ${u}:${d}:${f} GMT`}const une=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),cne=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=une.exec(e);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[r,n,i,o,s,a,l,u,d]=t,f=Dg(vh(n)),h=Ga(i,"month",1,12),p=Ga(o,"day",1,31),g=M0(f,h,p,{hours:s,minutes:a,seconds:l,fractionalMilliseconds:u});return d.toUpperCase()!="Z"&&g.setTime(g.getTime()-Sne(d)),g},dne=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),fne=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),hne=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),V6=e=>{if(e==null)return;if(typeof e!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=dne.exec(e);if(t){const[r,n,i,o,s,a,l,u]=t;return M0(Dg(vh(o)),k_(i),Ga(n,"day",1,31),{hours:s,minutes:a,seconds:l,fractionalMilliseconds:u})}if(t=fne.exec(e),t){const[r,n,i,o,s,a,l,u]=t;return vne(M0(gne(o),k_(i),Ga(n,"day",1,31),{hours:s,minutes:a,seconds:l,fractionalMilliseconds:u}))}if(t=hne.exec(e),t){const[r,n,i,o,s,a,l,u]=t;return M0(Dg(vh(u)),k_(n),Ga(i.trimLeft(),"day",1,31),{hours:o,minutes:s,seconds:a,fractionalMilliseconds:l})}throw new TypeError("Invalid RFC-7231 date-time value")},pne=e=>{if(e==null)return;let t;if(typeof e=="number")t=e;else if(typeof e=="string")t=tne(e);else if(typeof e=="object"&&e.tag===1)t=e.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(t)||t===1/0||t===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(t*1e3))},M0=(e,t,r,n)=>{const i=t-1;return bne(e,i,r),new Date(Date.UTC(e,i,r,Ga(n.hours,"hour",0,23),Ga(n.minutes,"minute",0,59),Ga(n.seconds,"seconds",0,60),xne(n.fractionalMilliseconds)))},gne=e=>{const t=new Date().getUTCFullYear(),r=Math.floor(t/100)*100+Dg(vh(e));return r<t?r+100:r},mne=50*365*24*60*60*1e3,vne=e=>e.getTime()-new Date().getTime()>mne?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,k_=e=>{const t=MS.indexOf(e);if(t<0)throw new TypeError(`Invalid month: ${e}`);return t+1},_ne=[31,28,31,30,31,30,31,31,30,31,30,31],bne=(e,t,r)=>{let n=_ne[t];if(t===1&&yne(e)&&(n=29),r>n)throw new TypeError(`Invalid day for ${MS[t]} in ${e}: ${r}`)},yne=e=>e%4===0&&(e%100!==0||e%400===0),Ga=(e,t,r,n)=>{const i=ine(vh(e));if(i<r||i>n)throw new TypeError(`${t} must be between ${r} and ${n}, inclusive`);return i},xne=e=>e==null?0:rne("0."+e)*1e3,Sne=e=>{const t=e[0];let r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);const n=Number(e.substring(1,3)),i=Number(e.substring(4,6));return r*(n*60+i)*60*1e3},vh=e=>{let t=0;for(;t<e.length-1&&e.charAt(t)==="0";)t++;return t===0?e:e.slice(t)},_A=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Nn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),K6=()=>{if(_A)return _A();const e=new Uint8Array(16);return crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,Nn[e[0]]+Nn[e[1]]+Nn[e[2]]+Nn[e[3]]+"-"+Nn[e[4]]+Nn[e[5]]+"-"+Nn[e[6]]+Nn[e[7]]+"-"+Nn[e[8]]+Nn[e[9]]+"-"+Nn[e[10]]+Nn[e[11]]+Nn[e[12]]+Nn[e[13]]+Nn[e[14]]+Nn[e[15]]},za=function(t){return Object.assign(new String(t),{deserializeJSON(){return JSON.parse(String(t))},toString(){return String(t)},toJSON(){return String(t)}})};za.from=e=>e&&typeof e=="object"&&(e instanceof za||"deserializeJSON"in e)?e:typeof e=="string"||Object.getPrototypeOf(e)===String.prototype?za(String(e)):za(JSON.stringify(e));za.fromObject=za.from;const bA=/^-?\d*(\.\d+)?$/;class us{string;type;constructor(t,r){if(this.string=t,this.type=r,!bA.test(t))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](t){if(!t||typeof t!="object")return!1;const r=t;return us.prototype.isPrototypeOf(t)||r.type==="bigDecimal"&&bA.test(r.string)}}class Ene{serdeContext;setSerdeContext(t){this.serdeContext=t}}class wne extends Ene{options;compositeErrorRegistry;constructor(t){super(),this.options=t,this.compositeErrorRegistry=Si.for(t.defaultNamespace);for(const r of t.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(r)}getRequestType(){return Oi}getResponseType(){return Qc}setSerdeContext(t){this.serdeContext=t,this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(t)}updateServiceEndpoint(t,r){if("url"in r){t.protocol=r.url.protocol,t.hostname=r.url.hostname,t.port=r.url.port?Number(r.url.port):void 0,t.path=r.url.pathname,t.fragment=r.url.hash||void 0,t.username=r.url.username||void 0,t.password=r.url.password||void 0,t.query||(t.query={});for(const[n,i]of r.url.searchParams.entries())t.query[n]=i;if(r.headers)for(const n in r.headers)t.headers[n]=r.headers[n].join(", ");return t}else{if(t.protocol=r.protocol,t.hostname=r.hostname,t.port=r.port?Number(r.port):void 0,t.path=r.path,t.query={...r.query},r.headers)for(const n in r.headers)t.headers[n]=r.headers[n];return t}}setHostPrefix(t,r,n){if(this.serdeContext?.disableHostPrefix)return;const i=cn.of(r.input),o=ff(r.traits??{});if(o.endpoint){let s=o.endpoint?.[0];if(typeof s=="string"){for(const[a,l]of i.structIterator()){if(!l.getMergedTraits().hostLabel)continue;const u=n[a];if(typeof u!="string")throw new Error(`@smithy/core/schema - ${a} in input must be a string as hostLabel.`);s=s.replace(`{${a}}`,u)}t.hostname=s+t.hostname}}}deserializeMetadata(t){return{httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:t,requestSchema:r,initialRequest:n}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:t,requestSchema:r,initialRequest:n})}async deserializeEventStream({response:t,responseSchema:r,initialResponseContainer:n}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:t,responseSchema:r,initialResponseContainer:n})}async loadEventStreamCapability(){const{EventStreamSerde:t}=await x0(async()=>{const{EventStreamSerde:r}=await import("./index-BnuMdAWP.js");return{EventStreamSerde:r}},__vite__mapDeps([3]));return new t({marshaller:this.getEventStreamMarshaller(),serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(t,r,n,i,o){return[]}getEventStreamMarshaller(){const t=this.serdeContext;if(!t.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return t.eventStreamMarshaller}}class kne extends wne{async serializeRequest(t,r,n){const i=this.serializer,o={},s={},a=await n.endpoint(),l=cn.of(t?.input),u=l.getSchema();let d;const f=r&&typeof r=="object"?r:{},h=new Oi({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:o,headers:s,body:void 0});if(a&&(this.updateServiceEndpoint(h,a),this.setHostPrefix(h,t,f)),f){const p=l.getEventStreamMember();if(p){if(f[p]){const g={};for(const[m,v]of l.structIterator())m!==p&&f[m]&&(i.write(v,f[m]),g[m]=i.flush());d=await this.serializeEventStream({eventStream:f[p],requestSchema:l,initialRequest:g})}}else i.write(u,f),d=i.flush()}return h.headers=Object.assign(h.headers,s),h.query=o,h.body=d,h.method="POST",h}async deserializeResponse(t,r,n){const i=this.deserializer,o=cn.of(t.output),s={};if(n.statusCode>=300){const l=await p1(n.body,r);throw l.byteLength>0&&Object.assign(s,await i.read(15,l)),await this.handleError(t,r,n,s,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const l in n.headers){const u=n.headers[l];delete n.headers[l],n.headers[l.toLowerCase()]=u}const a=o.getEventStreamMember();if(a)s[a]=await this.deserializeEventStream({response:n,responseSchema:o,initialResponseContainer:s});else{const l=await p1(n.body,r);l.byteLength>0&&Object.assign(s,await i.read(o,l))}return s.$metadata=this.deserializeMetadata(n),s}}function H6(e,t){if(t.timestampFormat.useTrait&&e.isTimestampSchema()&&(e.getSchema()===5||e.getSchema()===6||e.getSchema()===7))return e.getSchema();const{httpLabel:r,httpPrefixHeaders:n,httpHeader:i,httpQuery:o}=e.getMergedTraits();return(t.httpBindings?typeof n=="string"||i?6:o||r?5:void 0:void 0)??t.timestampFormat.default}function Cne(e,t,r){e.__smithy_context?e.__smithy_context.features||(e.__smithy_context.features={}):e.__smithy_context={features:{}},e.__smithy_context.features[t]=r}class Rne{authSchemes=new Map;constructor(t){for(const r in t){const n=t[r];n!==void 0&&this.authSchemes.set(r,n)}}getIdentityProvider(t){return this.authSchemes.get(t)}}class Ane{async sign(t,r,n){return t}}const Tne=e=>function(r){return W6(r)&&r.expiration.getTime()-Date.now()<e},$ne=3e5,Nne=Tne($ne),W6=e=>e.expiration!==void 0,Dne=(e,t,r)=>{if(e===void 0)return;const n=typeof e!="function"?async()=>Promise.resolve(e):e;let i,o,s,a=!1;const l=async u=>{o||(o=n(u));try{i=await o,s=!0,a=!1}finally{o=void 0}return i};return t===void 0?async u=>((!s||u?.forceRefresh)&&(i=await l(u)),i):async u=>((!s||u?.forceRefresh)&&(i=await l(u)),a?i:r(i)?(t(i)&&await l(u),i):(a=!0,i))},Fne=void 0;function Ine(e){return e===void 0?!0:typeof e=="string"&&e.length<=50}function Pne(e){const t=Cf(e.userAgentAppId??Fne),{customUserAgent:r}=e;return Object.assign(e,{customUserAgent:typeof r=="string"?[[r]]:r,userAgentAppId:async()=>{const n=await t();if(!Ine(n)){const i=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console:e.logger;typeof n!="string"?i?.warn("userAgentAppId must be a string or undefined."):n.length>50&&i?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return n}})}class LS{nodes;root;conditions;results;constructor(t,r,n,i){this.nodes=t,this.root=r,this.conditions=n,this.results=i}static from(t,r,n,i){return new LS(t,r,n,i)}}class One{capacity;data=new Map;parameters=[];constructor({size:t,params:r}){this.capacity=t??50,r&&(this.parameters=r)}get(t,r){const n=this.hash(t);if(n===!1)return r();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const i=this.data.keys();let o=0;for(;;){const{value:s,done:a}=i.next();if(this.data.delete(s),a||++o>10)break}}this.data.set(n,r())}return this.data.get(n)}size(){return this.data.size}hash(t){let r="";const{parameters:n}=this;if(n.length===0)return!1;for(const i of n){const o=String(t[i]??"");if(o.includes("|;"))return!1;r+=o+"|;"}return r}}class Lo extends Error{constructor(t){super(t),this.name="EndpointError"}}const Mne="endpoints";function Fg(e){return typeof e!="object"||e==null?e:"ref"in e?`$${Fg(e.ref)}`:"fn"in e?`${e.fn}(${(e.argv||[]).map(Fg).join(", ")})`:JSON.stringify(e,null,2)}const zS={},Lne=(e,t)=>e===t;function zne(...e){for(const t of e)if(t!=null)return t}const Une=e=>{const t=e.split("."),r=[];for(const n of t){const i=n.indexOf("[");if(i!==-1){if(n.indexOf("]")!==n.length-1)throw new Lo(`Path: '${e}' does not end with ']'`);const o=n.slice(i+1,-1);if(Number.isNaN(parseInt(o)))throw new Lo(`Invalid array index: '${o}' in path: '${e}'`);i!==0&&r.push(n.slice(0,i)),r.push(o)}else r.push(n)}return r},G6=(e,t)=>Une(t).reduce((r,n)=>{if(typeof r!="object")throw new Lo(`Index '${n}' in '${t}' not found in '${JSON.stringify(e)}'`);if(Array.isArray(r)){const i=parseInt(n);return r[i<0?r.length+i:i]}return r[n]},e),Bne=e=>e!=null,jne=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),zm=(e,t=!1)=>{if(!t)return jne.test(e);const r=e.split(".");for(const n of r)if(!zm(n))return!1;return!0};function qne(e,t,r){return e?t:r}const Vne=e=>!e,Kne=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),J6=e=>Kne.test(e)||e.startsWith("[")&&e.endsWith("]"),C_={[ph.HTTP]:80,[ph.HTTPS]:443},Hne=e=>{const t=(()=>{try{if(e instanceof URL)return e;if(typeof e=="object"&&"hostname"in e){const{hostname:h,port:p,protocol:g="",path:m="",query:v={}}=e,_=new URL(`${g}//${h}${p?`:${p}`:""}${m}`);return _.search=Object.entries(v).map(([x,w])=>`${x}=${w}`).join("&"),_}return new URL(e)}catch{return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;const r=t.href,{host:n,hostname:i,pathname:o,protocol:s,search:a}=t;if(a)return null;const l=s.slice(0,-1);if(!Object.values(ph).includes(l))return null;const u=J6(i),d=r.includes(`${n}:${C_[l]}`)||typeof e=="string"&&e.includes(`${n}:${C_[l]}`),f=`${n}${d?`:${C_[l]}`:""}`;return{scheme:l,authority:f,path:o,normalizedPath:o.endsWith("/")?o:`${o}/`,isIp:u}};function Wne(e,t,r){if(r===1)return[e];if(e==="")return[""];const n=e.split(t);return r===0?n:n.slice(0,r-1).concat(n.slice(1).join(t))}const Gne=(e,t)=>e===t,Jne=(e,t,r,n)=>e==null||t>=r||e.length<r||/[^\u0000-\u007f]/.test(e)?null:n?e.substring(e.length-r,e.length-t):e.substring(t,r),Qne=e=>encodeURIComponent(e).replace(/[!*'()]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),Yne={booleanEquals:Lne,coalesce:zne,getAttr:G6,isSet:Bne,isValidHostLabel:zm,ite:qne,not:Vne,parseURL:Hne,split:Wne,stringEquals:Gne,substring:Jne,uriEncode:Qne},Q6=(e,t)=>{const r=[],{referenceRecord:n,endpointParams:i}=t;let o=0;for(;o<e.length;){const s=e.indexOf("{",o);if(s===-1){r.push(e.slice(o));break}r.push(e.slice(o,s));const a=e.indexOf("}",s);if(a===-1){r.push(e.slice(s));break}e[s+1]==="{"&&e[a+1]==="}"&&(r.push(e.slice(s+1,a)),o=a+2);const l=e.substring(s+1,a);if(l.includes("#")){const[u,d]=l.split("#");r.push(G6(n[u]??i[u],d))}else r.push(n[l]??i[l]);o=a+1}return r.join("")},Xne=({ref:e},t)=>t.referenceRecord[e]??t.endpointParams[e],Um=(e,t,r)=>{if(typeof e=="string")return Q6(e,r);if(e.fn)return X6.callFunction(e,r);if(e.ref)return Xne(e,r);throw new Lo(`'${t}': ${String(e)} is not a string, function or reference.`)},Y6=({fn:e,argv:t},r)=>{const n=Array(t.length);for(let s=0;s<n.length;++s){const a=t[s];typeof a=="boolean"||typeof a=="number"?n[s]=a:n[s]=X6.evaluateExpression(a,"arg",r)}const i=e.indexOf(".");if(i!==-1){const a=zS[e.slice(0,i)]?.[e.slice(i+1)];if(typeof a=="function")return a(...n)}const o=Yne[e];if(typeof o=="function")return o(...n);throw new Error(`function ${e} not loaded in endpointFunctions.`)},X6={evaluateExpression:Um,callFunction:Y6},Zne=(e,t)=>{const{assign:r}=e;if(r&&r in t.referenceRecord)throw new Lo(`'${r}' is already defined in Reference Record.`);const n=Y6(e,t);t.logger?.debug?.(`${Mne} evaluateCondition: ${Fg(e)} = ${Fg(n)}`);const i=n===""?!0:!!n;return r!=null?{result:i,toAssign:{name:r,value:n}}:{result:i}},eie=(e,t)=>Object.entries(e??{}).reduce((r,[n,i])=>(r[n]=i.map(o=>{const s=Um(o,"Header value entry",t);if(typeof s!="string")throw new Lo(`Header '${n}' value '${s}' is not a string`);return s}),r),{}),Z6=(e,t)=>Object.entries(e).reduce((r,[n,i])=>(r[n]=tM.getEndpointProperty(i,t),r),{}),eM=(e,t)=>{if(Array.isArray(e))return e.map(r=>eM(r,t));switch(typeof e){case"string":return Q6(e,t);case"object":if(e===null)throw new Lo(`Unexpected endpoint property: ${e}`);return tM.getEndpointProperties(e,t);case"boolean":return e;default:throw new Lo(`Unexpected endpoint property type: ${typeof e}`)}},tM={getEndpointProperty:eM,getEndpointProperties:Z6},tie=(e,t)=>{const r=Um(e,"Endpoint URL",t);if(typeof r=="string")try{return new URL(r)}catch(n){throw console.error(`Failed to construct URL with ${r}`,n),n}throw new Lo(`Endpoint URL must be a string, got ${typeof r}`)},R_=1e8,rie=(e,t)=>{const{nodes:r,root:n,results:i,conditions:o}=e;let s=n;const a={},l={referenceRecord:a,endpointParams:t.endpointParams,logger:t.logger};for(;s!==1&&s!==-1&&s<R_;){const u=3*(Math.abs(s)-1),[d,f,h]=[r[u],r[u+1],r[u+2]],[p,g,m]=o[d],v=Zne({fn:p,assign:m,argv:g},l);if(v.toAssign){const{name:_,value:x}=v.toAssign;a[_]=x}s=s>=0===v.result?f:h}if(s>=R_){const u=i[s-R_];if(u[0]===-1){const[,p]=u;throw new Lo(Um(p,"Error",l))}const[d,f,h]=u;return{url:tie(d,l),properties:Z6(f,l),headers:eie(h??{},l)}}throw new Lo("No matching endpoint.")},rM=(e,t=!1)=>{if(t){for(const r of e.split("."))if(!rM(r))return!1;return!0}return!(!zm(e)||e.length<3||e.length>63||e!==e.toLowerCase()||J6(e))},yA=":",nie="/",iie=e=>{const t=e.split(yA);if(t.length<6)return null;const[r,n,i,o,s,...a]=t;if(r!=="arn"||n===""||i===""||a.join(yA)==="")return null;const l=a.map(u=>u.split(nie)).flat();return{partition:n,service:i,region:o,accountId:s,resourceId:l}},oie=[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],sie={partitions:oie};let aie=sie;const lie=e=>{const{partitions:t}=aie;for(const n of t){const{regions:i,outputs:o}=n;for(const[s,a]of Object.entries(i))if(s===e)return{...o,...a}}for(const n of t){const{regionRegex:i,outputs:o}=n;if(new RegExp(i).test(e))return{...o}}const r=t.find(n=>n.id==="aws");if(!r)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...r.outputs}},nM={isVirtualHostableS3Bucket:rM,parseArn:iie,partition:lie};zS.aws=nM;function uie(e,t,r){return e.$source||(e.$source={}),e.$source[t]=r,e}function Ds(e,t,r){e.__aws_sdk_context?e.__aws_sdk_context.features||(e.__aws_sdk_context.features={}):e.__aws_sdk_context={features:{}},e.__aws_sdk_context.features[t]=r}var ol;(function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"})(ol||(ol={}));const Af=3,cie=ol.STANDARD,die=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],fie=["TimeoutError","RequestTimeout","RequestTimeoutException"],hie=[500,502,503,504],pie=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],gie=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],mie=e=>e?.$retryable!==void 0,vie=e=>e.$metadata?.clockSkewCorrected,_ie=e=>{const t=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return e&&e instanceof TypeError?t.has(e.message):!1},iM=e=>e.$metadata?.httpStatusCode===429||die.includes(e.name)||e.$retryable?.throttling==!0,US=(e,t=0)=>mie(e)||vie(e)||fie.includes(e.name)||pie.includes(e?.code||"")||gie.includes(e?.code||"")||hie.includes(e.$metadata?.httpStatusCode||0)||_ie(e)||yie(e)||e.cause!==void 0&&t<=10&&US(e.cause,t+1),bie=e=>{if(e.$metadata?.httpStatusCode!==void 0){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!US(e)}return!1};function yie(e){return e.code==="ERR_HTTP2_STREAM_ERROR"&&e.message.includes("NGHTTP2_REFUSED_STREAM")}class BS{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(t){this.beta=t?.beta??.7,this.minCapacity=t?.minCapacity??1,this.minFillRate=t?.minFillRate??.5,this.scaleConstant=t?.scaleConstant??.4,this.smooth=t?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(t){let r;this.updateMeasuredRate();const n=t;if(n?.errorType==="THROTTLING"||iM(n?.error??t)){const s=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=s,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(s),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());const o=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(o)}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(t){if(this.enabled){if(this.refillTokenBucket(),t>this.availableTokens){const r=(t-this.availableTokens)/this.fillRate*1e3;await new Promise(n=>BS.setTimeoutFn(n,r))}this.availableTokens=this.availableTokens-t}}refillTokenBucket(){const t=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=t;return}const r=(t-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+r),this.lastTimestamp=t}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(t){return this.getPrecise(t*this.beta)}cubicSuccess(t){return this.getPrecise(this.scaleConstant*Math.pow(t-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(t){this.refillTokenBucket(),this.fillRate=Math.max(t,this.minFillRate),this.maxCapacity=Math.max(t,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){const t=this.getCurrentTimeInSeconds(),r=Math.floor(t*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){const n=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(t){return parseFloat(t.toFixed(8))}}const oM=20*1e3,xA=500,xie=1,Sie="amz-sdk-invocation-id",Eie="amz-sdk-request";var wie={};class Kn{static v2026=typeof process<"u"&&wie?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return Kn.v2026?50:100}static throttlingDelay(){return Kn.v2026?1e3:500}static cost(){return Kn.v2026?14:5}static throttlingCost(){return Kn.v2026?5:10}static modifiedCostType(){return Kn.v2026?"THROTTLING":"TRANSIENT"}}class kie{x=Kn.delay();computeNextBackoffDelay(t){const i=Math.random()*Math.min(this.x*2**t,oM);return Math.floor(i)}setDelayBase(t){this.x=t}}class SA{delay;count;cost;longPoll;constructor(t,r,n,i){this.delay=t,this.count=r,this.cost=n,this.longPoll=i}getRetryCount(){return this.count}getRetryDelay(){return Math.min(oM,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}class m1{mode=ol.STANDARD;capacity=xA;retryBackoffStrategy;maxAttemptsProvider;baseDelay;constructor(t){typeof t=="number"?this.maxAttemptsProvider=async()=>t:typeof t=="function"?this.maxAttemptsProvider=t:t&&typeof t=="object"&&(this.maxAttemptsProvider=async()=>t.maxAttempts,this.baseDelay=t.baseDelay,this.retryBackoffStrategy=t.backoff),this.maxAttemptsProvider??=async()=>Af,this.baseDelay??=Kn.delay(),this.retryBackoffStrategy??=new kie}async acquireInitialRetryToken(t){return new SA(Kn.delay(),0,void 0,Kn.v2026&&t.includes(":longpoll"))}async refreshRetryTokenForRetry(t,r){const n=await this.getMaxAttempts(),i=this.shouldRetry(t,r,n);if(i||t.isLongPoll?.()){const o=r.errorType;this.retryBackoffStrategy.setDelayBase(o==="THROTTLING"?Kn.throttlingDelay():this.baseDelay);const s=this.retryBackoffStrategy.computeNextBackoffDelay(t.getRetryCount());let a=s;if(r.retryAfterHint instanceof Date&&(a=Math.max(s,Math.min(r.retryAfterHint.getTime()-Date.now(),s+5e3))),i){const l=this.getCapacityCost(o);return this.capacity-=l,new SA(a,t.getRetryCount()+1,l,t.isLongPoll?.()??!1)}else throw Object.assign(new Error("No retry token available"),{$backoff:Kn.v2026?a:0})}throw new Error("No retry token available")}recordSuccess(t){this.capacity=Math.min(xA,this.capacity+(t.getRetryCost()??xie))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${Af}`),Af}}shouldRetry(t,r,n){return t.getRetryCount()+1<n&&this.capacity>=this.getCapacityCost(r.errorType)&&this.isRetryableError(r.errorType)}getCapacityCost(t){return t===Kn.modifiedCostType()?Kn.throttlingCost():Kn.cost()}isRetryableError(t){return t==="THROTTLING"||t==="TRANSIENT"}async maxAttempts(){return this.maxAttemptsProvider()}}class Cie{mode=ol.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(t,r){const{rateLimiter:n}=r??{};this.rateLimiter=n??new BS,this.standardRetryStrategy=r?new m1({maxAttempts:typeof t=="number"?t:3,...r}):new m1(t)}async acquireInitialRetryToken(t){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(t)}async refreshRetryTokenForRetry(t,r){return this.rateLimiter.updateClientSendingRate(r),this.standardRetryStrategy.refreshRetryTokenForRetry(t,r)}recordSuccess(t){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(t)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}}const Rie=/\d{12}\.ddb/;async function Aie(e,t,r){if(r.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&Ds(e,"PROTOCOL_RPC_V2_CBOR","M"),typeof t.retryStrategy=="function"){const o=await t.retryStrategy();if(typeof o.mode=="string")switch(o.mode){case ol.ADAPTIVE:Ds(e,"RETRY_MODE_ADAPTIVE","F");break;case ol.STANDARD:Ds(e,"RETRY_MODE_STANDARD","E");break}}if(typeof t.accountIdEndpointMode=="function"){const o=e.endpointV2;switch(String(o?.url?.hostname).match(Rie)&&Ds(e,"ACCOUNT_ID_ENDPOINT","O"),await t.accountIdEndpointMode?.()){case"disabled":Ds(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":Ds(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":Ds(e,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const i=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const o=i;o.accountId&&Ds(e,"RESOLVED_ACCOUNT_ID","T");for(const[s,a]of Object.entries(o.$source??{}))Ds(e,s,a)}}const EA="user-agent",A_="x-amz-user-agent",wA=" ",T_="/",Tie=/[^!$%&'*+\-.^_`|~\w]/g,$ie=/[^!$%&'*+\-.^_`|~\w#]/g,kA="-",Nie=1024;function Die(e){let t="";for(const r in e){const n=e[r];if(t.length+n.length+1<=Nie){t.length?t+=","+n:t+=n;continue}break}return t}const Fie=e=>(t,r)=>async n=>{const{request:i}=n;if(!Oi.isInstance(i))return t(n);const{headers:o}=i,s=r?.userAgent?.map(zp)||[],a=(await e.defaultUserAgentProvider()).map(zp);await Aie(r,e,n);const l=r;a.push(`m/${Die(Object.assign({},r.__smithy_context?.features,l.__aws_sdk_context?.features))}`);const u=e?.customUserAgent?.map(zp)||[],d=await e.userAgentAppId();d&&a.push(zp(["app",`${d}`]));const f=[].concat([...a,...s,...u]).join(wA),h=[...a.filter(p=>p.startsWith("aws-sdk-")),...u].join(wA);return e.runtime!=="browser"?(h&&(o[A_]=o[A_]?`${o[EA]} ${h}`:h),o[EA]=f):o[A_]=f,t({...n,request:i})},zp=e=>{const t=e[0].split(T_).map(s=>s.replace(Tie,kA)).join(T_),r=e[1]?.replace($ie,kA),n=t.indexOf(T_),i=t.substring(0,n);let o=t.substring(n+1);return i==="api"&&(o=o.toLowerCase()),[i,o,r].filter(s=>s&&s.length>0).reduce((s,a,l)=>{switch(l){case 0:return a;case 1:return`${s}/${a}`;default:return`${s}#${a}`}},"")},Iie={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},Pie=e=>({applyToStack:t=>{t.add(Fie(e),Iie)}}),Oie=!1,Mie=!1,CA=new Set,Lie=(e,t=zm)=>{if(!CA.has(e)&&!t(e))if(e==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw new Error(`Region not accepted: region="${e}" is not a valid hostname component.`);else CA.add(e)},sM=e=>typeof e=="string"&&(e.startsWith("fips-")||e.endsWith("-fips")),zie=e=>sM(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e,Uie=e=>{const{region:t,useFipsEndpoint:r}=e;if(!t)throw new Error("Region is missing");return Object.assign(e,{region:async()=>{const n=typeof t=="function"?await t():t,i=zie(n);return Lie(i),i},useFipsEndpoint:async()=>{const n=typeof t=="string"?t:await t();return sM(n)?!0:typeof r!="function"?Promise.resolve(!!r):r()}})},RA="content-length";function Bie(e){return t=>async r=>{const n=r.request;if(Oi.isInstance(n)){const{body:i,headers:o}=n;if(i&&Object.keys(o).map(s=>s.toLowerCase()).indexOf(RA)===-1)try{const s=e(i);n.headers={...n.headers,[RA]:String(s)}}catch{}}return t({...r,request:n})}}const jie={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},qie=e=>({applyToStack:t=>{t.add(Bie(e.bodyLengthChecker),jie)}}),Vie=async e=>{const t=e?.Bucket||"";if(typeof e.Bucket=="string"&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),Jie(t)){if(e.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!Gie(t)||t.indexOf(".")!==-1&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e},Kie=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,Hie=/(\d+\.){3}\d+/,Wie=/\.\./,Gie=e=>Kie.test(e)&&!Hie.test(e)&&!Wie.test(e),Jie=e=>{const[t,r,n,,,i]=e.split(":"),o=t==="arn"&&e.split(":").length>=6,s=!!(o&&r&&n&&i);if(o&&!s)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return s},Qie=(e,t,r,n=!1)=>{const i=async()=>{let o;return n?o=r.clientContextParams?.[e]??r[e]??r[t]:o=r[e]??r[t],typeof o=="function"?o():o};return e==="credentialScope"||t==="CredentialScope"?async()=>{const o=typeof r.credentials=="function"?await r.credentials():r.credentials;return o?.credentialScope??o?.CredentialScope}:e==="accountId"||t==="AccountId"?async()=>{const o=typeof r.credentials=="function"?await r.credentials():r.credentials;return o?.accountId??o?.AccountId}:e==="endpoint"||t==="endpoint"?async()=>{if(r.isCustomEndpoint===!1)return;const o=await i();if(o&&typeof o=="object"){if("url"in o)return o.url.href;if("hostname"in o){const{protocol:s,hostname:a,port:l,path:u}=o;return`${s}//${a}${l?":"+l:""}${u}`}}return o}:i},aM=async e=>{},lM=e=>{if(typeof e=="object"){if("url"in e){const t=Xc(e.url);if(e.headers){t.headers={};for(const[r,n]of Object.entries(e.headers))t.headers[r.toLowerCase()]=n.join(", ")}return t}return e}return Xc(e)},Yie=async(e,t,r,n)=>{if(!r.isCustomEndpoint){let s;r.serviceConfiguredEndpoint?s=await r.serviceConfiguredEndpoint():s=await aM(r.serviceId),s&&(r.endpoint=()=>Promise.resolve(lM(s)),r.isCustomEndpoint=!0)}const i=await Xie(e,t,r);if(typeof r.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");const o=r.endpointProvider(i,n);if(r.isCustomEndpoint&&r.endpoint){const s=await r.endpoint();if(s?.headers){o.headers??={};for(const[a,l]of Object.entries(s.headers))o.headers[a]=Array.isArray(l)?l:[l]}}return o},Xie=async(e,t,r)=>{const n={},i=t?.getEndpointParameterInstructions?.()||{};for(const[o,s]of Object.entries(i))switch(s.type){case"staticContextParams":n[o]=s.value;break;case"contextParams":n[o]=e[s.name];break;case"clientContextParams":case"builtInParams":n[o]=await Qie(s.name,o,r,s.type!=="builtInParams")();break;case"operationContextParams":n[o]=s.get(e);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(s))}return Object.keys(i).length===0&&Object.assign(n,r),String(r.serviceId).toLowerCase()==="s3"&&await Vie(n),n},Zie=({config:e,instructions:t})=>(r,n)=>async i=>{e.isCustomEndpoint&&Cne(n,"ENDPOINT_OVERRIDE","N");const o=await Yie(i.input,{getEndpointParameterInstructions(){return t}},{...e},n);n.endpointV2=o,n.authSchemes=o.properties?.authSchemes;const s=n.authSchemes?.[0];if(s){n.signing_region=s.signingRegion,n.signing_service=s.signingName;const l=wd(n)?.selectedHttpAuthScheme?.httpAuthOption;l&&(l.signingProperties=Object.assign(l.signingProperties||{},{signing_region:s.signingRegion,signingRegion:s.signingRegion,signing_service:s.signingName,signingName:s.signingName,signingRegionSet:s.signingRegionSet},s.properties))}return r({...i})},eoe={name:"serializerMiddleware"},toe={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:eoe.name},roe=(e,t)=>({applyToStack:r=>{r.addRelativeTo(Zie({config:e,instructions:t}),toe)}}),noe=e=>{const t=e.tls??!0,{endpoint:r,useDualstackEndpoint:n,useFipsEndpoint:i}=e,o=r!=null?async()=>lM(await Ys(r)()):void 0,a=Object.assign(e,{endpoint:o,tls:t,isCustomEndpoint:!!r,useDualstackEndpoint:Ys(n??!1),useFipsEndpoint:Ys(i??!1)});let l;return a.serviceConfiguredEndpoint=async()=>(e.serviceId&&!l&&(l=aM(e.serviceId)),l),a},ioe=e=>e instanceof Error?e:e instanceof Object?Object.assign(new Error,e):typeof e=="string"?new Error(e):new Error(`AWS SDK error wrapper for ${e}`),ooe=e=>{const{retryStrategy:t,retryMode:r}=e,n=Ys(e.maxAttempts??Af);let i=t?Promise.resolve(t):void 0;const o=async()=>await Ys(r)()===ol.ADAPTIVE?new Cie(n):new m1(n);return Object.assign(e,{maxAttempts:n,retryStrategy:()=>i??=o()})},$l=(e,t)=>{const r=[];if(e&&r.push(e),t)for(const n of t)r.push(n);return r},Sa=(e,t)=>`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`,Ig=()=>{let e=[],t=[],r=!1;const n=new Set,i=f=>f.sort((h,p)=>AA[p.step]-AA[h.step]||TA[p.priority||"normal"]-TA[h.priority||"normal"]),o=f=>{let h=!1;const p=g=>{const m=$l(g.name,g.aliases);if(m.includes(f)){h=!0;for(const v of m)n.delete(v);return!1}return!0};return e=e.filter(p),t=t.filter(p),h},s=f=>{let h=!1;const p=g=>{if(g.middleware===f){h=!0;for(const m of $l(g.name,g.aliases))n.delete(m);return!1}return!0};return e=e.filter(p),t=t.filter(p),h},a=f=>(e.forEach(h=>{f.add(h.middleware,{...h})}),t.forEach(h=>{f.addRelativeTo(h.middleware,{...h})}),f.identifyOnResolve?.(d.identifyOnResolve()),f),l=f=>{const h=[];return f.before.forEach(p=>{p.before.length===0&&p.after.length===0?h.push(p):h.push(...l(p))}),h.push(f),f.after.reverse().forEach(p=>{p.before.length===0&&p.after.length===0?h.push(p):h.push(...l(p))}),h},u=(f=!1)=>{const h=[],p=[],g={};return e.forEach(v=>{const _={...v,before:[],after:[]};for(const x of $l(_.name,_.aliases))g[x]=_;h.push(_)}),t.forEach(v=>{const _={...v,before:[],after:[]};for(const x of $l(_.name,_.aliases))g[x]=_;p.push(_)}),p.forEach(v=>{if(v.toMiddleware){const _=g[v.toMiddleware];if(_===void 0){if(f)return;throw new Error(`${v.toMiddleware} is not found when adding ${Sa(v.name,v.aliases)} middleware ${v.relation} ${v.toMiddleware}`)}v.relation==="after"&&_.after.push(v),v.relation==="before"&&_.before.push(v)}}),i(h).map(l).reduce((v,_)=>(v.push(..._),v),[])},d={add:(f,h={})=>{const{name:p,override:g,aliases:m}=h,v={step:"initialize",priority:"normal",middleware:f,...h},_=$l(p,m);if(_.length>0){if(_.some(x=>n.has(x))){if(!g)throw new Error(`Duplicate middleware name '${Sa(p,m)}'`);for(const x of _){const w=e.findIndex(k=>k.name===x||k.aliases?.some(A=>A===x));if(w===-1)continue;const S=e[w];if(S.step!==v.step||v.priority!==S.priority)throw new Error(`"${Sa(S.name,S.aliases)}" middleware with ${S.priority} priority in ${S.step} step cannot be overridden by "${Sa(p,m)}" middleware with ${v.priority} priority in ${v.step} step.`);e.splice(w,1)}}for(const x of _)n.add(x)}e.push(v)},addRelativeTo:(f,h)=>{const{name:p,override:g,aliases:m}=h,v={middleware:f,...h},_=$l(p,m);if(_.length>0){if(_.some(x=>n.has(x))){if(!g)throw new Error(`Duplicate middleware name '${Sa(p,m)}'`);for(const x of _){const w=t.findIndex(k=>k.name===x||k.aliases?.some(A=>A===x));if(w===-1)continue;const S=t[w];if(S.toMiddleware!==v.toMiddleware||S.relation!==v.relation)throw new Error(`"${Sa(S.name,S.aliases)}" middleware ${S.relation} "${S.toMiddleware}" middleware cannot be overridden by "${Sa(p,m)}" middleware ${v.relation} "${v.toMiddleware}" middleware.`);t.splice(w,1)}}for(const x of _)n.add(x)}t.push(v)},clone:()=>a(Ig()),use:f=>{f.applyToStack(d)},remove:f=>typeof f=="string"?o(f):s(f),removeByTag:f=>{let h=!1;const p=g=>{const{tags:m,name:v,aliases:_}=g;if(m&&m.includes(f)){const x=$l(v,_);for(const w of x)n.delete(w);return h=!0,!1}return!0};return e=e.filter(p),t=t.filter(p),h},concat:f=>{const h=a(Ig());return h.use(f),h.identifyOnResolve(r||h.identifyOnResolve()||(f.identifyOnResolve?.()??!1)),h},applyToStack:a,identify:()=>u(!0).map(f=>{const h=f.step??f.relation+" "+f.toMiddleware;return Sa(f.name,f.aliases)+" - "+h}),identifyOnResolve(f){return typeof f=="boolean"&&(r=f),r},resolve:(f,h)=>{for(const p of u().map(g=>g.middleware).reverse())f=p(f,h);return r&&console.log(d.identify()),f}};return d},AA={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},TA={high:3,normal:2,low:1};class soe{config;middlewareStack=Ig();initConfig;handlers;constructor(t){this.config=t;const{protocol:r,protocolSettings:n}=t;n&&typeof r=="function"&&(t.protocol=new r(n))}send(t,r,n){const i=typeof r!="function"?r:void 0,o=typeof r=="function"?r:n,s=i===void 0&&this.config.cacheMiddleware===!0;let a;if(s){this.handlers||(this.handlers=new WeakMap);const l=this.handlers;l.has(t.constructor)?a=l.get(t.constructor):(a=t.resolveMiddleware(this.middlewareStack,this.config,i),l.set(t.constructor,a))}else delete this.handlers,a=t.resolveMiddleware(this.middlewareStack,this.config,i);if(o)a(t).then(l=>o(null,l.output),l=>o(l)).catch(()=>{});else return a(t).then(l=>l.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}const $_="***SensitiveInformation***";function v1(e,t){if(t==null)return t;const r=cn.of(e);if(r.getMergedTraits().sensitive)return $_;if(r.isListSchema()){if(!!r.getValueSchema().getMergedTraits().sensitive)return $_}else if(r.isMapSchema()){if(!!r.getKeySchema().getMergedTraits().sensitive||!!r.getValueSchema().getMergedTraits().sensitive)return $_}else if(r.isStructSchema()&&typeof t=="object"){const n=t,i={};for(const[o,s]of r.structIterator())n[o]!=null&&(i[o]=v1(s,n[o]));return i}return t}class uM{middlewareStack=Ig();schema;static classBuilder(){return new aoe}resolveMiddlewareWithContext(t,r,n,{middlewareFn:i,clientName:o,commandName:s,inputFilterSensitiveLog:a,outputFilterSensitiveLog:l,smithyContext:u,additionalContext:d,CommandCtor:f}){for(const _ of i.bind(this)(f,t,r,n))this.middlewareStack.use(_);const h=t.concat(this.middlewareStack),{logger:p}=r,g={logger:p,clientName:o,commandName:s,inputFilterSensitiveLog:a,outputFilterSensitiveLog:l,[f1]:{commandInstance:this,...u},...d},{requestHandler:m}=r;let v=n??{};return u.eventStream&&(v={isEventStream:!0,...v}),h.resolve(_=>m.handle(_.request,v),g)}}class aoe{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(t){this._init=t}ep(t){return this._ep=t,this}m(t){return this._middlewareFn=t,this}s(t,r,n={}){return this._smithyContext={service:t,operation:r,...n},this}c(t={}){return this._additionalContext=t,this}n(t,r){return this._clientName=t,this._commandName=r,this}f(t=n=>n,r=n=>n){return this._inputFilterSensitiveLog=t,this._outputFilterSensitiveLog=r,this}ser(t){return this._serializer=t,this}de(t){return this._deserializer=t,this}sc(t){return this._operationSchema=t,this._smithyContext.operationSchema=t,this}build(){const t=this;let r;return r=class extends uM{input;static getEndpointParameterInstructions(){return t._ep}constructor(...[n]){super(),this.input=n??{},t._init(this),this.schema=t._operationSchema}resolveMiddleware(n,i,o){const s=t._operationSchema,a=s?.[4]??s?.input,l=s?.[5]??s?.output;return this.resolveMiddlewareWithContext(n,i,o,{CommandCtor:r,middlewareFn:t._middlewareFn,clientName:t._clientName,commandName:t._commandName,inputFilterSensitiveLog:t._inputFilterSensitiveLog??(s?v1.bind(null,a):u=>u),outputFilterSensitiveLog:t._outputFilterSensitiveLog??(s?v1.bind(null,l):u=>u),smithyContext:t._smithyContext,additionalContext:t._additionalContext})}serialize=t._serializer;deserialize=t._deserializer}}}class pc extends Error{$fault;$response;$retryable;$metadata;constructor(t){super(t.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata}static isInstance(t){if(!t)return!1;const r=t;return pc.prototype.isPrototypeOf(r)||!!r.$fault&&!!r.$metadata&&(r.$fault==="client"||r.$fault==="server")}static[Symbol.hasInstance](t){if(!t)return!1;const r=t;return this===pc?pc.isInstance(t):pc.isInstance(t)?r.name&&this.name?this.prototype.isPrototypeOf(t)||r.name===this.name:this.prototype.isPrototypeOf(t):!1}}const $A=(e,t={})=>{Object.entries(t).filter(([,n])=>n!==void 0).forEach(([n,i])=>{(e[n]==null||e[n]==="")&&(e[n]=i)});const r=e.message||e.Message||"UnknownError";return e.message=r,delete e.Message,e},loe=e=>{switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}},cM=Object.values(gh),uoe=e=>{const t=[];for(const r in gh){const n=gh[r];e[n]!==void 0&&t.push({algorithmId:()=>n,checksumConstructor:()=>e[n]})}for(const[r,n]of Object.entries(e.checksumAlgorithms??{}))t.push({algorithmId:()=>r,checksumConstructor:()=>n});return{addChecksumAlgorithm(r){e.checksumAlgorithms=e.checksumAlgorithms??{};const n=r.algorithmId(),i=r.checksumConstructor();cM.includes(n)?e.checksumAlgorithms[n.toUpperCase()]=i:e.checksumAlgorithms[n]=i,t.push(r)},checksumAlgorithms(){return t}}},coe=e=>{const t={};return e.checksumAlgorithms().forEach(r=>{const n=r.algorithmId();cM.includes(n)&&(t[n]=r.checksumConstructor())}),t},doe=e=>({setRetryStrategy(t){e.retryStrategy=t},retryStrategy(){return e.retryStrategy}}),foe=e=>{const t={};return t.retryStrategy=e.retryStrategy(),t},hoe=e=>Object.assign(uoe(e),doe(e)),poe=e=>Object.assign(coe(e),foe(e));class dM{trace(){}debug(){}info(){}warn(){}error(){}}const goe=e=>e?.body instanceof ReadableStream;function moe(e,t){if(Qc.isInstance(e))for(const r of Object.keys(e.headers)){const n=r.toLowerCase();if(n==="retry-after"){const i=e.headers[r];let o=NaN;if(i.endsWith("GMT"))try{o=(V6(i).getTime()-Date.now())/1e3}catch(s){t?.trace?.("Failed to parse retry-after header"),t?.trace?.(s)}else i.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?o=Number(i.match(/ GMT, ([\d.]+)$/)?.[1]):i.match(/^((\d+)|(\d+\.\d+))$/)?o=Number(i):Date.parse(i)>=Date.now()&&(o=(Date.parse(i)-Date.now())/1e3);return isNaN(o)?void 0:new Date(Date.now()+o*1e3)}else if(n==="x-amz-retry-after"){const i=e.headers[r],o=Number(i);if(isNaN(o)){t?.trace?.(`Failed to parse x-amz-retry-after=${i}`);return}return new Date(Date.now()+o)}}}const voe=e=>(t,r)=>async n=>{let i=await e.retryStrategy();const o=await e.maxAttempts();if(_oe(i)){i=i;let s=await i.acquireInitialRetryToken((r.partition_id??"")+(r.__retryLongPoll?":longpoll":"")),a=new Error,l=0,u=0;const{request:d}=n,f=Oi.isInstance(d);for(f&&(d.headers[Sie]=K6());;)try{f&&(d.headers[Eie]=`attempt=${l+1}; max=${o}`);const{response:h,output:p}=await t(n);return i.recordSuccess(s),p.$metadata.attempts=l+1,p.$metadata.totalRetryDelay=u,{response:h,output:p}}catch(h){const p=boe(h,e.logger);if(a=ioe(h),f&&goe(d))throw(r.logger instanceof dM?console:r.logger)?.warn("An error was encountered in a non-retryable streaming request."),a;try{s=await i.refreshRetryTokenForRetry(s,p)}catch(m){throw typeof m.$backoff=="number"&&await NA(m.$backoff),a.$metadata||(a.$metadata={}),a.$metadata.attempts=l+1,a.$metadata.totalRetryDelay=u,a}l=s.getRetryCount();const g=s.getRetryDelay();u+=g,await NA(g)}}else return i=i,i?.mode&&(r.userAgent=[...r.userAgent||[],["cfg/retry-mode",i.mode]]),i.retry(t,n)},NA=e=>new Promise(t=>setTimeout(t,e)),_oe=e=>typeof e.acquireInitialRetryToken<"u"&&typeof e.refreshRetryTokenForRetry<"u"&&typeof e.recordSuccess<"u",boe=(e,t)=>{const r={error:e,errorType:yoe(e)},n=moe(e.$response,t);return n&&(r.retryAfterHint=n),r},yoe=e=>iM(e)?"THROTTLING":US(e)?"TRANSIENT":bie(e)?"SERVER_ERROR":"CLIENT_ERROR",xoe={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Soe=e=>({applyToStack:t=>{t.add(voe(e),xoe)}}),DA=e=>Qc.isInstance(e)?e.headers?.date??e.headers?.Date:void 0,fM=e=>new Date(Date.now()+e),Eoe=(e,t)=>Math.abs(fM(t).getTime()-e)>=3e5,FA=(e,t)=>{const r=Date.parse(e);return Eoe(r,t)?r-Date.now():t},Tf=(e,t)=>{if(!t)throw new Error(`Property \`${e}\` is not resolved for AWS SDK SigV4Auth`);return t},woe=async e=>{const t=Tf("context",e.context),r=Tf("config",e.config),n=t.endpointV2?.properties?.authSchemes?.[0],o=await Tf("signer",r.signer)(n),s=e?.signingRegion,a=e?.signingRegionSet,l=e?.signingName;return{config:r,signer:o,signingRegion:s,signingRegionSet:a,signingName:l}};class koe{async sign(t,r,n){if(!Oi.isInstance(t))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const i=await woe(n),{config:o,signer:s}=i;let{signingRegion:a,signingName:l}=i;const u=n.context;if(u?.authSchemes?.length??!1){const[f,h]=u.authSchemes;f?.name==="sigv4a"&&h?.name==="sigv4"&&(a=h?.signingRegion??a,l=h?.signingName??l)}return await s.sign(t,{signingDate:fM(o.systemClockOffset),signingRegion:a,signingService:l})}errorHandler(t){return r=>{const n=r.ServerTime??DA(r.$response);if(n){const i=Tf("config",t.config),o=i.systemClockOffset;i.systemClockOffset=FA(n,i.systemClockOffset),i.systemClockOffset!==o&&r.$metadata&&(r.$metadata.clockSkewCorrected=!0)}throw r}}successHandler(t,r){const n=DA(t);if(n){const i=Tf("config",r.config);i.systemClockOffset=FA(n,i.systemClockOffset)}}}const Coe=(e,t,r)=>{let n,i,o,s=!1;const a=async()=>{i||(i=e());try{n=await i,o=!0,s=!1}finally{i=void 0}return n};return async l=>((!o||l?.forceRefresh)&&(n=await a()),n)},Roe="X-Amz-Algorithm",Aoe="X-Amz-Credential",hM="X-Amz-Date",Toe="X-Amz-SignedHeaders",$oe="X-Amz-Expires",pM="X-Amz-Signature",gM="X-Amz-Security-Token",mM="authorization",vM=hM.toLowerCase(),Noe="date",Doe=[mM,vM,Noe],Foe=pM.toLowerCase(),_1="x-amz-content-sha256",Ioe=gM.toLowerCase(),Poe={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Ooe=/^proxy-/,Moe=/^sec-/,N_="AWS4-HMAC-SHA256",Loe="AWS4-HMAC-SHA256-PAYLOAD",zoe="UNSIGNED-PAYLOAD",Uoe=50,_M="aws4_request",Boe=3600*24*7,Up={},D_=[],F_=(e,t,r)=>`${e}/${t}/${r}/${_M}`,joe=async(e,t,r,n,i)=>{const o=await IA(e,t.secretAccessKey,t.accessKeyId),s=`${r}:${n}:${i}:${Xl(o)}:${t.sessionToken}`;if(s in Up)return Up[s];for(D_.push(s);D_.length>Uoe;)delete Up[D_.shift()];let a=`AWS4${t.secretAccessKey}`;for(const l of[r,n,i,_M])a=await IA(e,a,l);return Up[s]=a},IA=(e,t,r)=>{const n=new e(t);return n.update(mh(r)),n.digest()},PA=({headers:e},t,r)=>{const n={};for(const i of Object.keys(e).sort()){if(e[i]==null)continue;const o=i.toLowerCase();(o in Poe||t?.has(o)||Ooe.test(o)||Moe.test(o))&&(!r||r&&!r.has(o))||(n[o]=e[i].trim().replace(/\s+/g," "))}return n},qoe=e=>typeof ArrayBuffer=="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]",I_=async({headers:e,body:t},r)=>{for(const n of Object.keys(e))if(n.toLowerCase()===_1)return e[n];if(t==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof t=="string"||ArrayBuffer.isView(t)||qoe(t)){const n=new r;return n.update(mh(t)),Xl(await n.digest())}return zoe};class Voe{format(t){const r=[];for(const o of Object.keys(t)){const s=Yc(o);r.push(Uint8Array.from([s.byteLength]),s,this.formatHeaderValue(t[o]))}const n=new Uint8Array(r.reduce((o,s)=>o+s.byteLength,0));let i=0;for(const o of r)n.set(o,i),i+=o.byteLength;return n}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,t.value,!1),new Uint8Array(r.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,t.value,!1),new Uint8Array(n.buffer);case"long":const i=new Uint8Array(9);return i[0]=5,i.set(t.value.bytes,1),i;case"binary":const o=new DataView(new ArrayBuffer(3+t.value.byteLength));o.setUint8(0,6),o.setUint16(1,t.value.byteLength,!1);const s=new Uint8Array(o.buffer);return s.set(t.value,3),s;case"string":const a=Yc(t.value),l=new DataView(new ArrayBuffer(3+a.byteLength));l.setUint8(0,7),l.setUint16(1,a.byteLength,!1);const u=new Uint8Array(l.buffer);return u.set(a,3),u;case"timestamp":const d=new Uint8Array(9);return d[0]=8,d.set(jS.fromNumber(t.value.valueOf()).bytes,1),d;case"uuid":if(!Koe.test(t.value))throw new Error(`Invalid UUID received: ${t.value}`);const f=new Uint8Array(17);return f[0]=9,f.set(qre(t.value.replace(/\-/g,"")),1),f}}}var OA;(function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"})(OA||(OA={}));const Koe=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class jS{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776e3||t<-9223372036854776e3)throw new Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let n=7,i=Math.abs(Math.round(t));n>-1&&i>0;n--,i/=256)r[n]=i;return t<0&&MA(r),new jS(r)}valueOf(){const t=this.bytes.slice(0),r=t[0]&128;return r&&MA(t),parseInt(Xl(t),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function MA(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}const Hoe=(e,t)=>{e=e.toLowerCase();for(const r of Object.keys(t))if(e===r.toLowerCase())return!0;return!1},Woe=(e,t={})=>{const{headers:r,query:n={}}=Oi.clone(e);for(const i of Object.keys(r)){const o=i.toLowerCase();(o.slice(0,6)==="x-amz-"&&!t.unhoistableHeaders?.has(o)||t.hoistableHeaders?.has(o))&&(n[i]=r[i],delete r[i])}return{...e,headers:r,query:n}},LA=e=>{e=Oi.clone(e);for(const t of Object.keys(e.headers))Doe.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e},Goe=({query:e={}})=>{const t=[],r={};for(const n of Object.keys(e)){if(n.toLowerCase()===Foe)continue;const i=Yl(n);t.push(i);const o=e[n];typeof o=="string"?r[i]=`${i}=${Yl(o)}`:Array.isArray(o)&&(r[i]=o.slice(0).reduce((s,a)=>s.concat([`${i}=${Yl(a)}`]),[]).sort().join("&"))}return t.sort().map(n=>r[n]).filter(n=>n).join("&")},Joe=e=>Qoe(e).toISOString().replace(/\.\d{3}Z$/,"Z"),Qoe=e=>typeof e=="number"?new Date(e*1e3):typeof e=="string"?Number(e)?new Date(Number(e)*1e3):new Date(e):e;class Yoe{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:t,credentials:r,region:n,service:i,sha256:o,uriEscapePath:s=!0}){this.service=i,this.sha256=o,this.uriEscapePath=s,this.applyChecksum=typeof t=="boolean"?t:!0,this.regionProvider=Ys(n),this.credentialProvider=Ys(r)}createCanonicalRequest(t,r,n){const i=Object.keys(r).sort();return`${t.method}
46
- ${this.getCanonicalPath(t)}
47
- ${Goe(t)}
48
- ${i.map(o=>`${o}:${r[o]}`).join(`
49
- `)}
50
-
51
- ${i.join(";")}
52
- ${n}`}async createStringToSign(t,r,n,i){const o=new this.sha256;o.update(mh(n));const s=await o.digest();return`${i}
53
- ${t}
54
- ${r}
55
- ${Xl(s)}`}getCanonicalPath({path:t}){if(this.uriEscapePath){const r=[];for(const o of t.split("/"))o?.length!==0&&o!=="."&&(o===".."?r.pop():r.push(o));const n=`${t?.startsWith("/")?"/":""}${r.join("/")}${r.length>0&&t?.endsWith("/")?"/":""}`;return Yl(n).replace(/%2F/g,"/")}return t}validateResolvedCredentials(t){if(typeof t!="object"||typeof t.accessKeyId!="string"||typeof t.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(t){const r=Joe(t).replace(/[\-:]/g,"");return{longDate:r,shortDate:r.slice(0,8)}}getCanonicalHeaderList(t){return Object.keys(t).sort().join(";")}}class zA extends Yoe{headerFormatter=new Voe;constructor({applyChecksum:t,credentials:r,region:n,service:i,sha256:o,uriEscapePath:s=!0}){super({applyChecksum:t,credentials:r,region:n,service:i,sha256:o,uriEscapePath:s})}async presign(t,r={}){const{signingDate:n=new Date,expiresIn:i=3600,unsignableHeaders:o,unhoistableHeaders:s,signableHeaders:a,hoistableHeaders:l,signingRegion:u,signingService:d}=r,f=await this.credentialProvider();this.validateResolvedCredentials(f);const h=u??await this.regionProvider(),{longDate:p,shortDate:g}=this.formatDate(n);if(i>Boe)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const m=F_(g,h,d??this.service),v=Woe(LA(t),{unhoistableHeaders:s,hoistableHeaders:l});f.sessionToken&&(v.query[gM]=f.sessionToken),v.query[Roe]=N_,v.query[Aoe]=`${f.accessKeyId}/${m}`,v.query[hM]=p,v.query[$oe]=i.toString(10);const _=PA(v,o,a);return v.query[Toe]=this.getCanonicalHeaderList(_),v.query[pM]=await this.getSignature(p,m,this.getSigningKey(f,h,g,d),this.createCanonicalRequest(v,_,await I_(t,this.sha256))),v}async sign(t,r){return typeof t=="string"?this.signString(t,r):t.headers&&t.payload?this.signEvent(t,r):t.message?this.signMessage(t,r):this.signRequest(t,r)}async signEvent({headers:t,payload:r},{signingDate:n=new Date,priorSignature:i,signingRegion:o,signingService:s,eventStreamCredentials:a}){const l=o??await this.regionProvider(),{shortDate:u,longDate:d}=this.formatDate(n),f=F_(u,l,s??this.service),h=await I_({headers:{},body:r},this.sha256),p=new this.sha256;p.update(t);const g=Xl(await p.digest()),m=[Loe,d,f,i,g,h].join(`
56
- `);return this.signString(m,{signingDate:n,signingRegion:l,signingService:s,eventStreamCredentials:a})}async signMessage(t,{signingDate:r=new Date,signingRegion:n,signingService:i,eventStreamCredentials:o}){return this.signEvent({headers:this.headerFormatter.format(t.message.headers),payload:t.message.body},{signingDate:r,signingRegion:n,signingService:i,priorSignature:t.priorSignature,eventStreamCredentials:o}).then(a=>({message:t.message,signature:a}))}async signString(t,{signingDate:r=new Date,signingRegion:n,signingService:i,eventStreamCredentials:o}={}){const s=o??await this.credentialProvider();this.validateResolvedCredentials(s);const a=n??await this.regionProvider(),{shortDate:l}=this.formatDate(r),u=new this.sha256(await this.getSigningKey(s,a,l,i));return u.update(mh(t)),Xl(await u.digest())}async signRequest(t,{signingDate:r=new Date,signableHeaders:n,unsignableHeaders:i,signingRegion:o,signingService:s}={}){const a=await this.credentialProvider();this.validateResolvedCredentials(a);const l=o??await this.regionProvider(),u=LA(t),{longDate:d,shortDate:f}=this.formatDate(r),h=F_(f,l,s??this.service);u.headers[vM]=d,a.sessionToken&&(u.headers[Ioe]=a.sessionToken);const p=await I_(u,this.sha256);!Hoe(_1,u.headers)&&this.applyChecksum&&(u.headers[_1]=p);const g=PA(u,i,n),m=await this.getSignature(d,h,this.getSigningKey(a,l,f,s),this.createCanonicalRequest(u,g,p));return u.headers[mM]=`${N_} Credential=${a.accessKeyId}/${h}, SignedHeaders=${this.getCanonicalHeaderList(g)}, Signature=${m}`,u}async getSignature(t,r,n,i){const o=await this.createStringToSign(t,r,i,N_),s=new this.sha256(await n);return s.update(mh(o)),Xl(await s.digest())}getSigningKey(t,r,n,i){return joe(this.sha256,t,n,r,i||this.service)}}const Xoe=e=>{let t=e.credentials,r=!!e.credentials,n;Object.defineProperty(e,"credentials",{set(u){u&&u!==t&&u!==n&&(r=!0),t=u;const d=Zoe(e,{credentials:t,credentialDefaultProvider:e.credentialDefaultProvider}),f=ese(e,d);if(r&&!f.attributed){const h=typeof t=="object"&&t!==null;n=async p=>{const m=await f(p);return h&&(!m.$source||Object.keys(m.$source).length===0)?uie(m,"CREDENTIALS_CODE","e"):m},n.memoized=f.memoized,n.configBound=f.configBound,n.attributed=!0}else n=f},get(){return n},enumerable:!0,configurable:!0}),e.credentials=t;const{signingEscapePath:i=!0,systemClockOffset:o=e.systemClockOffset||0,sha256:s}=e;let a;return e.signer?a=Cf(e.signer):e.regionInfoProvider?a=()=>Cf(e.region)().then(async u=>[await e.regionInfoProvider(u,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},u]).then(([u,d])=>{const{signingRegion:f,signingService:h}=u;e.signingRegion=e.signingRegion||f||d,e.signingName=e.signingName||h||e.serviceId;const p={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:s,uriEscapePath:i},g=e.signerConstructor||zA;return new g(p)}):a=async u=>{u=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await Cf(e.region)(),properties:{}},u);const d=u.signingRegion,f=u.signingName;e.signingRegion=e.signingRegion||d,e.signingName=e.signingName||f||e.serviceId;const h={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:s,uriEscapePath:i},p=e.signerConstructor||zA;return new p(h)},Object.assign(e,{systemClockOffset:o,signingEscapePath:i,signer:a})};function Zoe(e,{credentials:t,credentialDefaultProvider:r}){let n;return t?t?.memoized?n=t:n=Dne(t,Nne,W6):r?n=Cf(r(Object.assign({},e,{parentClientConfig:e}))):n=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},n.memoized=!0,n}function ese(e,t){if(t.configBound)return t;const r=async n=>t({...n,callerClientConfig:e});return r.memoized=t.memoized,r.configBound=!0,r}const tse=async(e,t,r)=>({operation:wd(t).operation,region:await Ys(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function rse(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-idp",region:e.region},propertiesExtractor:(t,r)=>({signingProperties:{config:t,context:r}})}}function Tt(e){return{schemeId:"smithy.api#noAuth"}}const nse=e=>{const t=[];switch(e.operation){case"AssociateSoftwareToken":{t.push(Tt());break}case"ChangePassword":{t.push(Tt());break}case"CompleteWebAuthnRegistration":{t.push(Tt());break}case"ConfirmDevice":{t.push(Tt());break}case"ConfirmForgotPassword":{t.push(Tt());break}case"ConfirmSignUp":{t.push(Tt());break}case"DeleteUser":{t.push(Tt());break}case"DeleteUserAttributes":{t.push(Tt());break}case"DeleteWebAuthnCredential":{t.push(Tt());break}case"ForgetDevice":{t.push(Tt());break}case"ForgotPassword":{t.push(Tt());break}case"GetDevice":{t.push(Tt());break}case"GetTokensFromRefreshToken":{t.push(Tt());break}case"GetUser":{t.push(Tt());break}case"GetUserAttributeVerificationCode":{t.push(Tt());break}case"GetUserAuthFactors":{t.push(Tt());break}case"GlobalSignOut":{t.push(Tt());break}case"InitiateAuth":{t.push(Tt());break}case"ListDevices":{t.push(Tt());break}case"ListWebAuthnCredentials":{t.push(Tt());break}case"ResendConfirmationCode":{t.push(Tt());break}case"RespondToAuthChallenge":{t.push(Tt());break}case"RevokeToken":{t.push(Tt());break}case"SetUserMFAPreference":{t.push(Tt());break}case"SetUserSettings":{t.push(Tt());break}case"SignUp":{t.push(Tt());break}case"StartWebAuthnRegistration":{t.push(Tt());break}case"UpdateAuthEventFeedback":{t.push(Tt());break}case"UpdateDeviceStatus":{t.push(Tt());break}case"UpdateUserAttributes":{t.push(Tt());break}case"VerifySoftwareToken":{t.push(Tt());break}case"VerifyUserAttribute":{t.push(Tt());break}default:t.push(rse(e))}return t},ise=e=>{const t=Xoe(e);return Object.assign(t,{authSchemePreference:Ys(e.authSchemePreference??[])})},ose=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"cognito-idp"}),sse={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},ase="3.1033.0",lse={version:ase},use=e=>new TextEncoder().encode(e);var cse=typeof Buffer<"u"&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:use;function _h(e){return e instanceof Uint8Array?e:typeof e=="string"?cse(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function b1(e){return typeof e=="string"?e.length===0:e.byteLength===0}var bM={name:"SHA-256"},UA={name:"HMAC",hash:bM},dse=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]);const fse={};function L0(){return typeof window<"u"?window:typeof self<"u"?self:fse}var hse=(function(){function e(t){this.toHash=new Uint8Array(0),this.secret=t,this.reset()}return e.prototype.update=function(t){if(!b1(t)){var r=_h(t),n=new Uint8Array(this.toHash.byteLength+r.byteLength);n.set(this.toHash,0),n.set(r,this.toHash.byteLength),this.toHash=n}},e.prototype.digest=function(){var t=this;return this.key?this.key.then(function(r){return L0().crypto.subtle.sign(UA,r,t.toHash).then(function(n){return new Uint8Array(n)})}):b1(this.toHash)?Promise.resolve(dse):Promise.resolve().then(function(){return L0().crypto.subtle.digest(bM,t.toHash)}).then(function(r){return Promise.resolve(new Uint8Array(r))})},e.prototype.reset=function(){var t=this;this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0&&(this.key=new Promise(function(r,n){L0().crypto.subtle.importKey("raw",_h(t.secret),UA,!1,["sign"]).then(r,n)}),this.key.catch(function(){}))},e})();function pse(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(d){try{u(n.next(d))}catch(f){s(f)}}function l(d){try{u(n.throw(d))}catch(f){s(f)}}function u(d){d.done?o(d.value):i(d.value).then(a,l)}u((n=n.apply(e,t||[])).next())})}function gse(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(d){return l([u,d])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(u[0]===6&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(d){u=[6,d],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Bi=64,mse=32,vse=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),_se=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],bse=Math.pow(2,53)-1,z0=(function(){function e(){this.state=Int32Array.from(_se),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(t){if(this.finished)throw new Error("Attempted to update an already finished hash.");var r=0,n=t.byteLength;if(this.bytesHashed+=n,this.bytesHashed*8>bse)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=t[r++],n--,this.bufferLength===Bi&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var t=this.bytesHashed*8,r=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(r.setUint8(this.bufferLength++,128),n%Bi>=Bi-8){for(var i=this.bufferLength;i<Bi;i++)r.setUint8(i,0);this.hashBuffer(),this.bufferLength=0}for(var i=this.bufferLength;i<Bi-8;i++)r.setUint8(i,0);r.setUint32(Bi-8,Math.floor(t/4294967296),!0),r.setUint32(Bi-4,t),this.hashBuffer(),this.finished=!0}for(var o=new Uint8Array(mse),i=0;i<8;i++)o[i*4]=this.state[i]>>>24&255,o[i*4+1]=this.state[i]>>>16&255,o[i*4+2]=this.state[i]>>>8&255,o[i*4+3]=this.state[i]>>>0&255;return o},e.prototype.hashBuffer=function(){for(var t=this,r=t.buffer,n=t.state,i=n[0],o=n[1],s=n[2],a=n[3],l=n[4],u=n[5],d=n[6],f=n[7],h=0;h<Bi;h++){if(h<16)this.temp[h]=(r[h*4]&255)<<24|(r[h*4+1]&255)<<16|(r[h*4+2]&255)<<8|r[h*4+3]&255;else{var p=this.temp[h-2],g=(p>>>17|p<<15)^(p>>>19|p<<13)^p>>>10;p=this.temp[h-15];var m=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3;this.temp[h]=(g+this.temp[h-7]|0)+(m+this.temp[h-16]|0)}var v=(((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&u^~l&d)|0)+(f+(vse[h]+this.temp[h]|0)|0)|0,_=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&o^i&s^o&s)|0;f=d,d=u,u=l,l=a+v|0,a=s,s=o,o=i,i=v+_|0}n[0]+=i,n[1]+=o,n[2]+=s,n[3]+=a,n[4]+=l,n[5]+=u,n[6]+=d,n[7]+=f},e})(),yse=(function(){function e(t){this.secret=t,this.hash=new z0,this.reset()}return e.prototype.update=function(t){if(!(b1(t)||this.error))try{this.hash.update(_h(t))}catch(r){this.error=r}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return pse(this,void 0,void 0,function(){return gse(this,function(t){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new z0,this.secret){this.outer=new z0;var t=xse(this.secret),r=new Uint8Array(Bi);r.set(t);for(var n=0;n<Bi;n++)t[n]^=54,r[n]^=92;this.hash.update(t),this.outer.update(r);for(var n=0;n<t.byteLength;n++)t[n]=0}},e})();function xse(e){var t=_h(e);if(t.byteLength>Bi){var r=new z0;r.update(t),t=r.digest()}var n=new Uint8Array(Bi);return n.set(t),n}var Sse=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function Ese(e){if(wse(e)&&typeof e.crypto.subtle=="object"){var t=e.crypto.subtle;return kse(t)}return!1}function wse(e){if(typeof e=="object"&&typeof e.crypto=="object"){var t=e.crypto.getRandomValues;return typeof t=="function"}return!1}function kse(e){return e&&Sse.every(function(t){return typeof e[t]=="function"})}var Cse=(function(){function e(t){Ese(L0())?this.hash=new hse(t):this.hash=new yse(t)}return e.prototype.update=function(t,r){this.hash.update(_h(t))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e})();const Rse=({serviceId:e,clientVersion:t})=>async r=>{const n=typeof window<"u"?window.navigator:void 0,i=n?.userAgent??"",o=n?.userAgentData?.platform??BA.os(i)??"other",s=void 0,a=n?.userAgentData?.brands??[],l=a[a.length-1],u=l?.brand??BA.browser(i)??"unknown",d=l?.version??"unknown",f=[["aws-sdk-js",t],["ua","2.1"],[`os/${o}`,s],["lang/js"],["md/browser",`${u}_${d}`]];e&&f.push([`api/${e}`,t]);const h=await r?.userAgentAppId?.();return h&&f.push([`app/${h}`]),f},BA={os(e){if(/iPhone|iPad|iPod/.test(e))return"iOS";if(/Macintosh|Mac OS X/.test(e))return"macOS";if(/Windows NT/.test(e))return"Windows";if(/Android/.test(e))return"Android";if(/Linux/.test(e))return"Linux"},browser(e){if(/EdgiOS|EdgA|Edg\//.test(e))return"Microsoft Edge";if(/Firefox\//.test(e))return"Firefox";if(/Chrome\//.test(e))return"Chrome";if(/Safari\//.test(e))return"Safari"}},Ase=e=>()=>Promise.reject(e),jA=typeof TextEncoder=="function"?new TextEncoder:null,Tse=e=>{if(typeof e=="string"){if(jA)return jA.encode(e).byteLength;let t=e.length;for(let r=t-1;r>=0;r--){const n=e.charCodeAt(r);n>127&&n<=2047?t++:n>2047&&n<=65535&&(t+=2),n>=56320&&n<=57343&&r--}return t}else{if(typeof e.byteLength=="number")return e.byteLength;if(typeof e.size=="number")return e.size}throw new Error(`Body Length computation failed for ${e}`)},$se=["in-region","cross-region","mobile","standard","legacy"],Nse=({defaultsMode:e}={})=>Coe(async()=>{const t=typeof e=="function"?await e():e;switch(t?.toLowerCase()){case"auto":return Promise.resolve(Dse()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(t?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${$se.join(", ")}, got ${t}`)}}),Dse=()=>{const e=window?.navigator;if(e?.connection){const{effectiveType:t,rtt:r,downlink:n}=e?.connection;if(typeof t=="string"&&t!=="4g"||Number(r)>100||Number(n)<10)return!0}return e?.userAgentData?.mobile||typeof e?.maxTouchPoints=="number"&&e?.maxTouchPoints>1};class Fse{queryCompat;errorRegistry;constructor(t=!1){this.queryCompat=t}resolveRestContentType(t,r){const n=r.getMemberSchemas(),i=Object.values(n).find(o=>!!o.getMergedTraits().httpPayload);if(i){const o=i.getMergedTraits().mediaType;return o||(i.isStringSchema()?"text/plain":i.isBlobSchema()?"application/octet-stream":t)}else if(!r.isUnitSchema()&&Object.values(n).find(s=>{const{httpQuery:a,httpQueryParams:l,httpHeader:u,httpLabel:d,httpPrefixHeaders:f}=s.getMergedTraits();return!a&&!l&&!u&&!d&&f===void 0}))return t}async getErrorSchemaOrThrowBaseException(t,r,n,i,o,s){let a=t;t.includes("#")&&([,a]=t.split("#"));const l={$metadata:o,$fault:n.statusCode<500?"client":"server"};if(!this.errorRegistry)throw new Error("@aws-sdk/core/protocols - error handler not initialized.");try{return{errorSchema:s?.(this.errorRegistry,a)??this.errorRegistry.getSchema(t),errorMetadata:l}}catch{i.message=i.message??i.Message??"UnknownError";const d=this.errorRegistry,f=d.getBaseException();if(f){const g=d.getErrorCtor(f)??Error;throw this.decorateServiceException(Object.assign(new g({name:a}),l),i)}const h=i,p=h?.message??h?.Message??h?.Error?.Message??h?.Error?.message;throw this.decorateServiceException(Object.assign(new Error(p),{name:a},l),i)}}compose(t,r,n){let i=n;r.includes("#")&&([i]=r.split("#"));const o=Si.for(i),s=Si.for("smithy.ts.sdk.synthetic."+n);t.copyFrom(o),t.copyFrom(s),this.errorRegistry=t}decorateServiceException(t,r={}){if(this.queryCompat){const n=t.Message??r.Message,i=$A(t,r);n&&(i.message=n);const o=i.Error??{};o.Type=i.Error?.Type,o.Code=i.Error?.Code,o.Message=i.Error?.message??i.Error?.Message??n,i.Error=o;const s=i.$metadata.requestId;return s&&(i.RequestId=s),i}return $A(t,r)}setQueryCompatError(t,r){const n=r.headers?.["x-amzn-query-error"];if(t!==void 0&&n!=null){const[i,o]=n.split(";"),s=Object.keys(t),a={Code:i,Type:o};t.Code=i,t.Type=o;for(let l=0;l<s.length;l++){const u=s[l];a[u==="message"?"Message":u]=t[u]}delete a.__type,t.Error=a}}queryCompatOutput(t,r){t.Error&&(r.Error=t.Error),t.Type&&(r.Type=t.Type),t.Code&&(r.Code=t.Code)}findQueryCompatibleError(t,r){try{return t.getSchema(r)}catch{return t.find(i=>cn.of(i).getMergedTraits().awsQueryError?.[0]===r)}}}class qS{serdeContext;setSerdeContext(t){this.serdeContext=t}}class Ise{from;to;keys;constructor(t,r){this.from=t,this.to=r;const n=Object.keys(this.from),i=new Set(n);i.delete("__type"),this.keys=i}mark(t){this.keys.delete(t)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){const t=this.keys.values().next().value,r=this.from[t];this.to.$unknown=[t,r]}}}function Pse(e,t,r){if(r?.source){const n=r.source;if(typeof t=="number"&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||n!==String(t)))return n.includes(".")?new us(n,"bigDecimal"):BigInt(n)}return t}const Ose=(e,t)=>p1(e,t).then(r=>(t?.utf8Encoder??PS)(r)),Mse=(e,t)=>Ose(e,t).then(r=>{if(r.length)try{return JSON.parse(r)}catch(n){throw n?.name==="SyntaxError"&&Object.defineProperty(n,"$responseBodyText",{value:r}),n}return{}}),qA=(e,t)=>Object.keys(e).find(r=>r.toLowerCase()===t.toLowerCase()),P_=e=>{let t=e;return typeof t=="number"&&(t=t.toString()),t.indexOf(",")>=0&&(t=t.split(",")[0]),t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},Lse=(e,t)=>{const r=qA(e.headers,"x-amzn-errortype");if(r!==void 0)return P_(e.headers[r]);if(t&&typeof t=="object"){const n=qA(t,"code");if(n&&t[n]!==void 0)return P_(t[n]);if(t.__type!==void 0)return P_(t.__type)}};class zse extends qS{settings;constructor(t){super(),this.settings=t}async read(t,r){return this._read(t,typeof r=="string"?JSON.parse(r,Pse):await Mse(r,this.serdeContext))}readObject(t,r){return this._read(t,r)}_read(t,r){const n=r!==null&&typeof r=="object",i=cn.of(t);if(n){if(i.isStructSchema()){const s=r,a=i.isUnionSchema(),l={};let u;const{jsonName:d}=this.settings;d&&(u={});let f;a&&(f=new Ise(s,l));for(const[h,p]of i.structIterator()){let g=h;d&&(g=p.getMergedTraits().jsonName??g,u[g]=h),a&&f.mark(g),s[g]!=null&&(l[h]=this._read(p,s[g]))}if(a)f.writeUnknown();else if(typeof s.__type=="string")for(const h in s){const p=s[h],g=d?u[h]??h:h;g in l||(l[g]=p)}return l}if(Array.isArray(r)&&i.isListSchema()){const s=i.getValueSchema(),a=[];for(const l of r)a.push(this._read(s,l));return a}if(i.isMapSchema()){const s=i.getValueSchema(),a={};for(const l in r)a[l]=this._read(s,r[l]);return a}}if(i.isBlobSchema()&&typeof r=="string")return Mm(r);const o=i.getMergedTraits().mediaType;if(i.isStringSchema()&&typeof r=="string"&&o)return o==="application/json"||o.endsWith("+json")?za.from(r):r;if(i.isTimestampSchema()&&r!=null)switch(H6(i,this.settings)){case 5:return cne(r);case 6:return V6(r);case 7:return pne(r);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",r),new Date(r)}if(i.isBigIntegerSchema()&&(typeof r=="number"||typeof r=="string"))return BigInt(r);if(i.isBigDecimalSchema()&&r!=null){if(r instanceof us)return r;const s=r;return s.type==="bigDecimal"&&"string"in s?new us(s.string,s.type):new us(String(r),"bigDecimal")}if(i.isNumericSchema()&&typeof r=="string"){switch(r){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return r}if(i.isDocumentSchema())if(n){const s=Array.isArray(r)?[]:{};for(const a in r){const l=r[a];l instanceof us?s[a]=l:s[a]=this._read(i,l)}return s}else return structuredClone(r);return r}}const VA="Ν";class Use{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(t,r)=>{if(r instanceof us){const n=`${VA+"nv"+this.counter++}_`+r.string;return this.values.set(`"${n}"`,r.string),n}if(typeof r=="bigint"){const n=r.toString(),i=`${VA+"b"+this.counter++}_`+n;return this.values.set(`"${i}"`,n),i}return r}}replaceInJson(t){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return t;for(const[r,n]of this.values)t=t.replace(r,n);return t}}class Bse extends qS{settings;buffer;useReplacer=!1;rootSchema;constructor(t){super(),this.settings=t}write(t,r){this.rootSchema=cn.of(t),this.buffer=this._write(this.rootSchema,r)}flush(){const{rootSchema:t,useReplacer:r}=this;if(this.rootSchema=void 0,this.useReplacer=!1,t?.isStructSchema()||t?.isDocumentSchema()){if(!r)return JSON.stringify(this.buffer);const n=new Use;return n.replaceInJson(JSON.stringify(this.buffer,n.createReplacer(),0))}return this.buffer}writeDiscriminatedDocument(t,r){this.write(t,r),typeof this.buffer=="object"&&(this.buffer.__type=cn.of(t).getName(!0))}_write(t,r,n){const i=r!==null&&typeof r=="object",o=cn.of(t);if(i){if(o.isStructSchema()){const s=r,a={},{jsonName:l}=this.settings;let u;l&&(u={});let d=0;for(const[f,h]of o.structIterator()){const p=this._write(h,s[f],o);if(p!==void 0){let g=f;l&&(g=h.getMergedTraits().jsonName??f,u[f]=g),a[g]=p,d++}}if(o.isUnionSchema()&&d===0){const{$unknown:f}=s;if(Array.isArray(f)){const[h,p]=f;a[h]=this._write(15,p)}}else if(typeof s.__type=="string")for(const f in s){const h=s[f],p=l?u[f]??f:f;p in a||(a[p]=this._write(15,h))}return a}if(Array.isArray(r)&&o.isListSchema()){const s=o.getValueSchema(),a=[],l=!!o.getMergedTraits().sparse;for(const u of r)(l||u!=null)&&a.push(this._write(s,u));return a}if(o.isMapSchema()){const s=o.getValueSchema(),a={},l=!!o.getMergedTraits().sparse;for(const u in r){const d=r[u];(l||d!=null)&&(a[u]=this._write(s,d))}return a}if(r instanceof Uint8Array&&(o.isBlobSchema()||o.isDocumentSchema()))return o===this.rootSchema?r:(this.serdeContext?.base64Encoder??Ng)(r);if(r instanceof Date&&(o.isTimestampSchema()||o.isDocumentSchema()))switch(H6(o,this.settings)){case 5:return r.toISOString().replace(".000Z","Z");case 6:return lne(r);case 7:return r.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",r),r.getTime()/1e3}r instanceof us&&(this.useReplacer=!0)}if(!(r===null&&n?.isStructSchema())){if(o.isStringSchema()){if(typeof r>"u"&&o.isIdempotencyToken())return K6();const s=o.getMergedTraits().mediaType;return r!=null&&s&&(s==="application/json"||s.endsWith("+json"))?za.from(r):r}if(typeof r=="number"&&o.isNumericSchema())return Math.abs(r)===1/0||isNaN(r)?String(r):r;if(typeof r=="string"&&o.isBlobSchema())return o===this.rootSchema?r:(this.serdeContext?.base64Encoder??Ng)(r);if(typeof r=="bigint"&&(this.useReplacer=!0),o.isDocumentSchema())if(i){const s=Array.isArray(r)?[]:{};for(const a in r){const l=r[a];l instanceof us?(this.useReplacer=!0,s[a]=l):s[a]=this._write(o,l)}return s}else return structuredClone(r);return r}}}class jse extends qS{settings;constructor(t){super(),this.settings=t}createSerializer(){const t=new Bse(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){const t=new zse(this.settings);return t.setSerdeContext(this.serdeContext),t}}class qse extends kne{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:t,errorTypeRegistries:r,serviceTarget:n,awsQueryCompatible:i,jsonCodec:o}){super({defaultNamespace:t,errorTypeRegistries:r}),this.serviceTarget=n,this.codec=o??new jse({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!i,this.mixin=new Fse(this.awsQueryCompatible)}async serializeRequest(t,r,n){const i=await super.serializeRequest(t,r,n);return i.path.endsWith("/")||(i.path+="/"),i.headers["content-type"]=`application/x-amz-json-${this.getJsonRpcVersion()}`,i.headers["x-amz-target"]=`${this.serviceTarget}.${t.name}`,this.awsQueryCompatible&&(i.headers["x-amzn-query-mode"]="true"),(O0(t.input)==="unit"||!i.body)&&(i.body="{}"),i}getPayloadCodec(){return this.codec}async handleError(t,r,n,i,o){this.awsQueryCompatible&&this.mixin.setQueryCompatError(i,n);const s=Lse(n,i)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,s,this.options.defaultNamespace);const{errorSchema:a,errorMetadata:l}=await this.mixin.getErrorSchemaOrThrowBaseException(s,this.options.defaultNamespace,n,i,o,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),u=cn.of(a),d=i.message??i.Message??"UnknownError",f=this.compositeErrorRegistry.getErrorCtor(a)??Error,h=new f(d),p={},g=this.codec.createDeserializer();for(const[m,v]of u.structIterator())i[m]!=null&&(p[m]=g.readObject(v,i[m]));throw this.awsQueryCompatible&&this.mixin.queryCompatOutput(i,p),this.mixin.decorateServiceException(Object.assign(h,l,{$fault:u.getMergedTraits().error,message:d},p),i)}}class Vse extends qse{constructor({defaultNamespace:t,errorTypeRegistries:r,serviceTarget:n,awsQueryCompatible:i,jsonCodec:o}){super({defaultNamespace:t,errorTypeRegistries:r,serviceTarget:n,awsQueryCompatible:i,jsonCodec:o})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}const bh="ref",Nl=-1,Bp=!0,KA="isSet",yM="PartitionResult",jp="booleanEquals",O_="getAttr",Jd="stringEquals",HA={[bh]:"Endpoint"},M_={[bh]:yM},hf={[bh]:"Region"},Zo={},WA=[hf],GA={conditions:[[KA,[HA]],[KA,WA],["aws.partition",WA,yM],[jp,[{[bh]:"UseFIPS"},Bp]],[jp,[{fn:O_,argv:[M_,"supportsFIPS"]},Bp]],[jp,[{[bh]:"UseDualStack"},Bp]],[jp,[{fn:O_,argv:[M_,"supportsDualStack"]},Bp]],[Jd,[{fn:O_,argv:[M_,"name"]},"aws"]],[Jd,[hf,"us-east-1"]],[Jd,[hf,"us-east-2"]],[Jd,[hf,"us-west-1"]],[Jd,[hf,"us-west-2"]]],results:[[Nl],[Nl,"Invalid Configuration: FIPS and custom endpoint are not supported"],[Nl,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[HA,Zo],["https://cognito-idp-fips.us-east-1.amazonaws.com",Zo],["https://cognito-idp-fips.us-east-2.amazonaws.com",Zo],["https://cognito-idp-fips.us-west-1.amazonaws.com",Zo],["https://cognito-idp-fips.us-west-2.amazonaws.com",Zo],["https://cognito-idp-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",Zo],[Nl,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://cognito-idp-fips.{Region}.{PartitionResult#dnsSuffix}",Zo],[Nl,"FIPS is enabled but this partition does not support FIPS"],["https://cognito-idp.{Region}.amazonaws.com",Zo],["https://cognito-idp.{Region}.{PartitionResult#dualStackDnsSuffix}",Zo],[Nl,"DualStack is enabled but this partition does not support DualStack"],["https://cognito-idp.{Region}.{PartitionResult#dnsSuffix}",Zo],[Nl,"Invalid Configuration: Missing Region"]]},Kse=2,Zr=1e8,Hse=new Int32Array([-1,1,-1,0,17,3,1,4,Zr+16,2,5,Zr+16,3,9,6,5,7,Zr+15,6,8,Zr+14,7,Zr+12,Zr+13,4,11,10,5,Zr+9,Zr+11,5,12,Zr+10,6,13,Zr+9,8,Zr+4,14,9,Zr+5,15,10,Zr+6,16,11,Zr+7,Zr+8,3,Zr+1,18,5,Zr+2,Zr+3]),Wse=LS.from(Hse,Kse,GA.conditions,GA.results),Gse=new One({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Jse=(e,t={})=>Gse.get(e,()=>rie(Wse,{endpointParams:e,logger:t.logger}));zS.aws=nM;class Ne extends pc{constructor(t){super(t),Object.setPrototypeOf(this,Ne.prototype)}}class VS extends Ne{name="AccessDeniedException";$fault="client";constructor(t){super({name:"AccessDeniedException",$fault:"client",...t}),Object.setPrototypeOf(this,VS.prototype)}}class KS extends Ne{name="InternalErrorException";$fault="server";constructor(t){super({name:"InternalErrorException",$fault:"server",...t}),Object.setPrototypeOf(this,KS.prototype)}}class HS extends Ne{name="InvalidParameterException";$fault="client";reasonCode;constructor(t){super({name:"InvalidParameterException",$fault:"client",...t}),Object.setPrototypeOf(this,HS.prototype),this.reasonCode=t.reasonCode}}class WS extends Ne{name="NotAuthorizedException";$fault="client";constructor(t){super({name:"NotAuthorizedException",$fault:"client",...t}),Object.setPrototypeOf(this,WS.prototype)}}class GS extends Ne{name="ResourceNotFoundException";$fault="client";constructor(t){super({name:"ResourceNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,GS.prototype)}}class JS extends Ne{name="TooManyRequestsException";$fault="client";constructor(t){super({name:"TooManyRequestsException",$fault:"client",...t}),Object.setPrototypeOf(this,JS.prototype)}}class QS extends Ne{name="UserImportInProgressException";$fault="client";constructor(t){super({name:"UserImportInProgressException",$fault:"client",...t}),Object.setPrototypeOf(this,QS.prototype)}}class YS extends Ne{name="InternalServerException";$fault="server";constructor(t){super({name:"InternalServerException",$fault:"server",...t}),Object.setPrototypeOf(this,YS.prototype)}}class XS extends Ne{name="LimitExceededException";$fault="client";constructor(t){super({name:"LimitExceededException",$fault:"client",...t}),Object.setPrototypeOf(this,XS.prototype)}}class ZS extends Ne{name="UserNotFoundException";$fault="client";constructor(t){super({name:"UserNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,ZS.prototype)}}class eE extends Ne{name="InvalidLambdaResponseException";$fault="client";constructor(t){super({name:"InvalidLambdaResponseException",$fault:"client",...t}),Object.setPrototypeOf(this,eE.prototype)}}class tE extends Ne{name="TooManyFailedAttemptsException";$fault="client";constructor(t){super({name:"TooManyFailedAttemptsException",$fault:"client",...t}),Object.setPrototypeOf(this,tE.prototype)}}class rE extends Ne{name="UnexpectedLambdaException";$fault="client";constructor(t){super({name:"UnexpectedLambdaException",$fault:"client",...t}),Object.setPrototypeOf(this,rE.prototype)}}class nE extends Ne{name="UserLambdaValidationException";$fault="client";constructor(t){super({name:"UserLambdaValidationException",$fault:"client",...t}),Object.setPrototypeOf(this,nE.prototype)}}class iE extends Ne{name="CodeDeliveryFailureException";$fault="client";constructor(t){super({name:"CodeDeliveryFailureException",$fault:"client",...t}),Object.setPrototypeOf(this,iE.prototype)}}class oE extends Ne{name="InvalidPasswordException";$fault="client";constructor(t){super({name:"InvalidPasswordException",$fault:"client",...t}),Object.setPrototypeOf(this,oE.prototype)}}class sE extends Ne{name="InvalidSmsRoleAccessPolicyException";$fault="client";constructor(t){super({name:"InvalidSmsRoleAccessPolicyException",$fault:"client",...t}),Object.setPrototypeOf(this,sE.prototype)}}class aE extends Ne{name="InvalidSmsRoleTrustRelationshipException";$fault="client";constructor(t){super({name:"InvalidSmsRoleTrustRelationshipException",$fault:"client",...t}),Object.setPrototypeOf(this,aE.prototype)}}class lE extends Ne{name="PreconditionNotMetException";$fault="client";constructor(t){super({name:"PreconditionNotMetException",$fault:"client",...t}),Object.setPrototypeOf(this,lE.prototype)}}class uE extends Ne{name="UnsupportedUserStateException";$fault="client";constructor(t){super({name:"UnsupportedUserStateException",$fault:"client",...t}),Object.setPrototypeOf(this,uE.prototype)}}class cE extends Ne{name="UsernameExistsException";$fault="client";constructor(t){super({name:"UsernameExistsException",$fault:"client",...t}),Object.setPrototypeOf(this,cE.prototype)}}class dE extends Ne{name="AliasExistsException";$fault="client";constructor(t){super({name:"AliasExistsException",$fault:"client",...t}),Object.setPrototypeOf(this,dE.prototype)}}class fE extends Ne{name="InvalidUserPoolConfigurationException";$fault="client";constructor(t){super({name:"InvalidUserPoolConfigurationException",$fault:"client",...t}),Object.setPrototypeOf(this,fE.prototype)}}class hE extends Ne{name="InvalidEmailRoleAccessPolicyException";$fault="client";constructor(t){super({name:"InvalidEmailRoleAccessPolicyException",$fault:"client",...t}),Object.setPrototypeOf(this,hE.prototype)}}class pE extends Ne{name="MFAMethodNotFoundException";$fault="client";constructor(t){super({name:"MFAMethodNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,pE.prototype)}}class gE extends Ne{name="PasswordResetRequiredException";$fault="client";constructor(t){super({name:"PasswordResetRequiredException",$fault:"client",...t}),Object.setPrototypeOf(this,gE.prototype)}}class mE extends Ne{name="UnsupportedOperationException";$fault="client";constructor(t){super({name:"UnsupportedOperationException",$fault:"client",...t}),Object.setPrototypeOf(this,mE.prototype)}}class vE extends Ne{name="UserNotConfirmedException";$fault="client";constructor(t){super({name:"UserNotConfirmedException",$fault:"client",...t}),Object.setPrototypeOf(this,vE.prototype)}}class _E extends Ne{name="UserPoolAddOnNotEnabledException";$fault="client";constructor(t){super({name:"UserPoolAddOnNotEnabledException",$fault:"client",...t}),Object.setPrototypeOf(this,_E.prototype)}}class bE extends Ne{name="CodeMismatchException";$fault="client";constructor(t){super({name:"CodeMismatchException",$fault:"client",...t}),Object.setPrototypeOf(this,bE.prototype)}}class yE extends Ne{name="ExpiredCodeException";$fault="client";constructor(t){super({name:"ExpiredCodeException",$fault:"client",...t}),Object.setPrototypeOf(this,yE.prototype)}}class xE extends Ne{name="PasswordHistoryPolicyViolationException";$fault="client";constructor(t){super({name:"PasswordHistoryPolicyViolationException",$fault:"client",...t}),Object.setPrototypeOf(this,xE.prototype)}}class SE extends Ne{name="SoftwareTokenMFANotFoundException";$fault="client";constructor(t){super({name:"SoftwareTokenMFANotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,SE.prototype)}}class EE extends Ne{name="ConcurrentModificationException";$fault="client";constructor(t){super({name:"ConcurrentModificationException",$fault:"client",...t}),Object.setPrototypeOf(this,EE.prototype)}}class wE extends Ne{name="ForbiddenException";$fault="client";constructor(t){super({name:"ForbiddenException",$fault:"client",...t}),Object.setPrototypeOf(this,wE.prototype)}}class kE extends Ne{name="WebAuthnChallengeNotFoundException";$fault="client";constructor(t){super({name:"WebAuthnChallengeNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,kE.prototype)}}class CE extends Ne{name="WebAuthnClientMismatchException";$fault="client";constructor(t){super({name:"WebAuthnClientMismatchException",$fault:"client",...t}),Object.setPrototypeOf(this,CE.prototype)}}class RE extends Ne{name="WebAuthnCredentialNotSupportedException";$fault="client";constructor(t){super({name:"WebAuthnCredentialNotSupportedException",$fault:"client",...t}),Object.setPrototypeOf(this,RE.prototype)}}class AE extends Ne{name="WebAuthnNotEnabledException";$fault="client";constructor(t){super({name:"WebAuthnNotEnabledException",$fault:"client",...t}),Object.setPrototypeOf(this,AE.prototype)}}class TE extends Ne{name="WebAuthnOriginNotAllowedException";$fault="client";constructor(t){super({name:"WebAuthnOriginNotAllowedException",$fault:"client",...t}),Object.setPrototypeOf(this,TE.prototype)}}class $E extends Ne{name="WebAuthnRelyingPartyMismatchException";$fault="client";constructor(t){super({name:"WebAuthnRelyingPartyMismatchException",$fault:"client",...t}),Object.setPrototypeOf(this,$E.prototype)}}class NE extends Ne{name="DeviceKeyExistsException";$fault="client";constructor(t){super({name:"DeviceKeyExistsException",$fault:"client",...t}),Object.setPrototypeOf(this,NE.prototype)}}class DE extends Ne{name="GroupExistsException";$fault="client";constructor(t){super({name:"GroupExistsException",$fault:"client",...t}),Object.setPrototypeOf(this,DE.prototype)}}class FE extends Ne{name="DuplicateProviderException";$fault="client";constructor(t){super({name:"DuplicateProviderException",$fault:"client",...t}),Object.setPrototypeOf(this,FE.prototype)}}class IE extends Ne{name="ManagedLoginBrandingExistsException";$fault="client";constructor(t){super({name:"ManagedLoginBrandingExistsException",$fault:"client",...t}),Object.setPrototypeOf(this,IE.prototype)}}class PE extends Ne{name="TermsExistsException";$fault="client";constructor(t){super({name:"TermsExistsException",$fault:"client",...t}),Object.setPrototypeOf(this,PE.prototype)}}class OE extends Ne{name="FeatureUnavailableInTierException";$fault="client";constructor(t){super({name:"FeatureUnavailableInTierException",$fault:"client",...t}),Object.setPrototypeOf(this,OE.prototype)}}class ME extends Ne{name="TierChangeNotAllowedException";$fault="client";constructor(t){super({name:"TierChangeNotAllowedException",$fault:"client",...t}),Object.setPrototypeOf(this,ME.prototype)}}class LE extends Ne{name="UserPoolTaggingException";$fault="client";constructor(t){super({name:"UserPoolTaggingException",$fault:"client",...t}),Object.setPrototypeOf(this,LE.prototype)}}class zE extends Ne{name="InvalidOAuthFlowException";$fault="client";constructor(t){super({name:"InvalidOAuthFlowException",$fault:"client",...t}),Object.setPrototypeOf(this,zE.prototype)}}class UE extends Ne{name="ScopeDoesNotExistException";$fault="client";constructor(t){super({name:"ScopeDoesNotExistException",$fault:"client",...t}),Object.setPrototypeOf(this,UE.prototype)}}class BE extends Ne{name="UnsupportedIdentityProviderException";$fault="client";constructor(t){super({name:"UnsupportedIdentityProviderException",$fault:"client",...t}),Object.setPrototypeOf(this,BE.prototype)}}class jE extends Ne{name="RefreshTokenReuseException";$fault="client";constructor(t){super({name:"RefreshTokenReuseException",$fault:"client",...t}),Object.setPrototypeOf(this,jE.prototype)}}class qE extends Ne{name="UnauthorizedException";$fault="client";constructor(t){super({name:"UnauthorizedException",$fault:"client",...t}),Object.setPrototypeOf(this,qE.prototype)}}class VE extends Ne{name="UnsupportedTokenTypeException";$fault="client";constructor(t){super({name:"UnsupportedTokenTypeException",$fault:"client",...t}),Object.setPrototypeOf(this,VE.prototype)}}class KE extends Ne{name="WebAuthnConfigurationMissingException";$fault="client";constructor(t){super({name:"WebAuthnConfigurationMissingException",$fault:"client",...t}),Object.setPrototypeOf(this,KE.prototype)}}class HE extends Ne{name="EnableSoftwareTokenMFAException";$fault="client";constructor(t){super({name:"EnableSoftwareTokenMFAException",$fault:"client",...t}),Object.setPrototypeOf(this,HE.prototype)}}const Qse="AvailableChallenges",Yse="AccessDeniedException",Xse="AliasExistsException",Zse="AnalyticsEndpointId",eae="AuthFlow",tae="AnalyticsMetadata",rae="AnalyticsMetadataType",nae="AuthParameters",iae="AuthParametersType",oae="AuthenticationResult",sae="AuthenticationResultType",aae="AccessToken",lae="CodeDeliveryFailureException",uae="ClientId",cae="ClientIdType",dae="ClientMetadata",fae="CodeMismatchException",hae="ConcurrentModificationException",pae="ChallengeName",gae="ChallengeParameters",mae="DeviceGroupKey",vae="DeviceKey",_ae="DeviceKeyExistsException",bae="DuplicateProviderException",yae="ExpiredCodeException",xae="EncodedData",Sae="ExpiresIn",Eae="EnableSoftwareTokenMFAException",wae="ForbiddenException",kae="FeatureUnavailableInTierException",Cae="GroupExistsException",Rae="IpAddress",Aae="InitiateAuthRequest",Tae="InitiateAuthResponse",$ae="InitiateAuth",Nae="InternalErrorException",Dae="InvalidEmailRoleAccessPolicyException",Fae="InvalidLambdaResponseException",Iae="InvalidOAuthFlowException",Pae="InvalidParameterException",Oae="InvalidPasswordException",Mae="InternalServerException",Lae="InvalidSmsRoleAccessPolicyException",zae="InvalidSmsRoleTrustRelationshipException",Uae="IdToken",Bae="InvalidUserPoolConfigurationException",jae="LimitExceededException",qae="MFAMethodNotFoundException",Vae="ManagedLoginBrandingExistsException",Kae="NotAuthorizedException",Hae="NewDeviceMetadata",Wae="NewDeviceMetadataType",Gae="PasswordHistoryPolicyViolationException",Jae="PreconditionNotMetException",Qae="PasswordResetRequiredException",Yae="ResourceNotFoundException",Xae="RefreshToken",Zae="RefreshTokenReuseException",xM="Session",ele="ScopeDoesNotExistException",tle="SessionType",rle="SoftwareTokenMFANotFoundException",nle="TierChangeNotAllowedException",ile="TermsExistsException",ole="TooManyFailedAttemptsException",sle="TooManyRequestsException",ale="TokenModelType",lle="TokenType",ule="UserContextDataType",cle="UserContextData",dle="UnauthorizedException",fle="UsernameExistsException",hle="UserImportInProgressException",ple="UnsupportedIdentityProviderException",gle="UnexpectedLambdaException",mle="UserLambdaValidationException",vle="UserNotConfirmedException",_le="UserNotFoundException",ble="UnsupportedOperationException",yle="UserPoolAddOnNotEnabledException",xle="UserPoolTaggingException",Sle="UnsupportedTokenTypeException",Ele="UnsupportedUserStateException",wle="WebAuthnClientMismatchException",kle="WebAuthnConfigurationMissingException",Cle="WebAuthnChallengeNotFoundException",Rle="WebAuthnCredentialNotSupportedException",Ale="WebAuthnNotEnabledException",Tle="WebAuthnOriginNotAllowedException",$le="WebAuthnRelyingPartyMismatchException",qe="client",Oe="error",Ve="httpError",Me="message",Nle="reasonCode",SM="smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentityprovider",EM="server",Ee="com.amazonaws.cognitoidentityprovider",wM=Si.for(SM);var Dle=[-3,SM,"CognitoIdentityProviderServiceException",0,[],[]];wM.registerError(Dle,Ne);const Pe=Si.for(Ee);var Fle=[-3,Ee,Yse,{[Oe]:qe,[Ve]:403},[Me],[0]];Pe.registerError(Fle,VS);var Ile=[-3,Ee,Xse,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Ile,dE);var Ple=[-3,Ee,lae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Ple,iE);var Ole=[-3,Ee,fae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Ole,bE);var Mle=[-3,Ee,hae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Mle,EE);var Lle=[-3,Ee,_ae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Lle,NE);var zle=[-3,Ee,bae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(zle,FE);var Ule=[-3,Ee,Eae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Ule,HE);var Ble=[-3,Ee,yae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Ble,yE);var jle=[-3,Ee,kae,{[Oe]:qe,[Ve]:403},[Me],[0]];Pe.registerError(jle,OE);var qle=[-3,Ee,wae,{[Oe]:qe,[Ve]:403},[Me],[0]];Pe.registerError(qle,wE);var Vle=[-3,Ee,Cae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Vle,DE);var Kle=[-3,Ee,Nae,{[Oe]:EM},[Me],[0]];Pe.registerError(Kle,KS);var Hle=[-3,Ee,Mae,{[Oe]:EM},[Me],[0]];Pe.registerError(Hle,YS);var Wle=[-3,Ee,Dae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Wle,hE);var Gle=[-3,Ee,Fae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Gle,eE);var Jle=[-3,Ee,Iae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Jle,zE);var Qle=[-3,Ee,Pae,{[Oe]:qe,[Ve]:400},[Me,Nle],[0,0]];Pe.registerError(Qle,HS);var Yle=[-3,Ee,Oae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Yle,oE);var Xle=[-3,Ee,Lae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Xle,sE);var Zle=[-3,Ee,zae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Zle,aE);var eue=[-3,Ee,Bae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(eue,fE);var tue=[-3,Ee,jae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(tue,XS);var rue=[-3,Ee,Vae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(rue,IE);var nue=[-3,Ee,qae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(nue,pE);var iue=[-3,Ee,Kae,{[Oe]:qe,[Ve]:403},[Me],[0]];Pe.registerError(iue,WS);var oue=[-3,Ee,Gae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(oue,xE);var sue=[-3,Ee,Qae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(sue,gE);var aue=[-3,Ee,Jae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(aue,lE);var lue=[-3,Ee,Zae,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(lue,jE);var uue=[-3,Ee,Yae,{[Oe]:qe,[Ve]:404},[Me],[0]];Pe.registerError(uue,GS);var cue=[-3,Ee,ele,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(cue,UE);var due=[-3,Ee,rle,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(due,SE);var fue=[-3,Ee,ile,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(fue,PE);var hue=[-3,Ee,nle,{[Oe]:qe,[Ve]:403},[Me],[0]];Pe.registerError(hue,ME);var pue=[-3,Ee,ole,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(pue,tE);var gue=[-3,Ee,sle,{[Oe]:qe,[Ve]:429},[Me],[0]];Pe.registerError(gue,JS);var mue=[-3,Ee,dle,{[Oe]:qe,[Ve]:401},[Me],[0]];Pe.registerError(mue,qE);var vue=[-3,Ee,gle,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(vue,rE);var _ue=[-3,Ee,ple,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(_ue,BE);var bue=[-3,Ee,ble,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(bue,mE);var yue=[-3,Ee,Sle,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(yue,VE);var xue=[-3,Ee,Ele,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(xue,uE);var Sue=[-3,Ee,hle,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Sue,QS);var Eue=[-3,Ee,mle,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Eue,nE);var wue=[-3,Ee,fle,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(wue,cE);var kue=[-3,Ee,vle,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(kue,vE);var Cue=[-3,Ee,_le,{[Oe]:qe,[Ve]:404},[Me],[0]];Pe.registerError(Cue,ZS);var Rue=[-3,Ee,yle,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Rue,_E);var Aue=[-3,Ee,xle,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Aue,LE);var Tue=[-3,Ee,Cle,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Tue,kE);var $ue=[-3,Ee,wle,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError($ue,CE);var Nue=[-3,Ee,kle,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Nue,KE);var Due=[-3,Ee,Rle,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Due,RE);var Fue=[-3,Ee,Ale,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Fue,AE);var Iue=[-3,Ee,Tle,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Iue,TE);var Pue=[-3,Ee,$le,{[Oe]:qe,[Ve]:400},[Me],[0]];Pe.registerError(Pue,$E);const Oue=[wM,Pe];var Mue=[0,Ee,cae,8,0],kM=[0,Ee,tle,8,0],L_=[0,Ee,ale,8,0],Lue=[3,Ee,rae,0,[Zse],[0]],zue=[3,Ee,sae,0,[aae,Sae,lle,Xae,Uae,Hae],[[()=>L_,0],1,0,[()=>L_,0],[()=>L_,0],()=>jue]],Uue=[3,Ee,Aae,0,[eae,uae,nae,dae,tae,cle,xM],[0,[()=>Mue,0],[()=>Vue,0],128,()=>Lue,[()=>que,0],[()=>kM,0]],2],Bue=[3,Ee,Tae,0,[pae,xM,gae,oae,Qse],[0,[()=>kM,0],128,[()=>zue,0],64]],jue=[3,Ee,Wae,0,[vae,mae],[0,0]],que=[3,Ee,ule,8,[Rae,xae],[0,0]],Vue=[2,Ee,iae,8,0,0],Kue=[9,Ee,$ae,0,()=>Uue,()=>Bue];const Hue=e=>({apiVersion:"2016-04-18",base64Decoder:e?.base64Decoder??Mm,base64Encoder:e?.base64Encoder??Ng,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Jse,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??nse,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new koe},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Ane}],logger:e?.logger??new dM,protocol:e?.protocol??Vse,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.cognitoidentityprovider",errorTypeRegistries:Oue,xmlNamespace:"http://cognito-idp.amazonaws.com/doc/2016-04-18/",version:"2016-04-18",serviceTarget:"AWSCognitoIdentityProviderService"},serviceId:e?.serviceId??"Cognito Identity Provider",urlParser:e?.urlParser??Xc,utf8Decoder:e?.utf8Decoder??Yc,utf8Encoder:e?.utf8Encoder??PS}),Wue=e=>{const t=Nse(e),r=()=>t().then(loe),n=Hue(e);return{...n,...e,runtime:"browser",defaultsMode:t,bodyLengthChecker:e?.bodyLengthChecker??Tse,credentialDefaultProvider:e?.credentialDefaultProvider??(i=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??Rse({serviceId:n.serviceId,clientVersion:lse.version}),maxAttempts:e?.maxAttempts??Af,region:e?.region??Ase("Region is missing"),requestHandler:OS.create(e?.requestHandler??r),retryMode:e?.retryMode??(async()=>(await r()).retryMode||cie),sha256:e?.sha256??Cse,streamCollector:e?.streamCollector??zre,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(Oie)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(Mie))}},Gue=e=>({setRegion(t){e.region=t},region(){return e.region}}),Jue=e=>({region:e.region()}),Que=e=>{const t=e.httpAuthSchemes;let r=e.httpAuthSchemeProvider,n=e.credentials;return{setHttpAuthScheme(i){const o=t.findIndex(s=>s.schemeId===i.schemeId);o===-1?t.push(i):t.splice(o,1,i)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(i){r=i},httpAuthSchemeProvider(){return r},setCredentials(i){n=i},credentials(){return n}}},Yue=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),Xue=(e,t)=>{const r=Object.assign(Gue(e),hoe(e),fre(e),Que(e));return t.forEach(n=>n.configure(r)),Object.assign(e,Jue(r),poe(r),hre(r),Yue(r))};class CM extends soe{config;constructor(...[t]){const r=Wue(t||{});super(r),this.initConfig=r;const n=ose(r),i=Pne(n),o=ooe(i),s=Uie(o),a=s,l=noe(a),u=ise(l),d=Xue(u,t?.extensions||[]);this.config=d,this.middlewareStack.use(Qre(this.config)),this.middlewareStack.use(Pie(this.config)),this.middlewareStack.use(Soe(this.config)),this.middlewareStack.use(qie(this.config)),this.middlewareStack.use(vre(this.config)),this.middlewareStack.use(yre(this.config)),this.middlewareStack.use(Ere(this.config)),this.middlewareStack.use(Are(this.config,{httpAuthSchemeParametersProvider:tse,identityProviderConfigProvider:async f=>new Rne({"aws.auth#sigv4":f.credentials})})),this.middlewareStack.use(Fre(this.config))}destroy(){super.destroy()}}class RM extends uM.classBuilder().ep(sse).m(function(t,r,n,i){return[roe(n,t.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","InitiateAuth",{}).n("CognitoIdentityProviderClient","InitiateAuthCommand").sc(Kue).build(){}let Zue="reventless.auth.v1",ece=300*1e3;function tce(e){let t=localStorage.getItem(e);if(t!=null)try{let r=JSON.parse(t),n=ge.object(r);if(n===void 0)return;let i=T(n.token,ge.string),o=n.identity,s=T(n.refreshToken,ge.string),a=T(n.expiresAt,ge.float);return i!==void 0&&o!==void 0?W(ge.object(o),l=>{let u=f=>T(l[f],ge.string),d=se(D(T(l.groups,ge.array),[]),ge.string);return{token:i,identity:{userId:D(u("userId"),""),username:D(u("username"),""),groups:d,provider:D(u("provider"),"InMemory")},refreshToken:s,expiresAt:a}}):void 0}catch{return}}function z_(e,t){let r=t.identity.groups.map(d=>d),n=Object.fromEntries([["userId",t.identity.userId],["username",t.identity.username],["groups",r],["provider",t.identity.provider]]),i=[["token",t.token],["identity",n]],o=t.refreshToken,s=o!==void 0?i.concat([["refreshToken",o]]):i,a=t.expiresAt,l=a!==void 0?s.concat([["expiresAt",a]]):s,u=JSON.stringify(Object.fromEntries(l));localStorage.setItem(e,u)}function rce(e){return(e.endsWith("/graphql")?e.slice(0,e.length-8|0):e)+"/__inmemory/login"}function nce(e){let t=n=>D(T(e[n],ge.string),""),r=se(D(T(e.groups,ge.array),[]),ge.string);return{userId:t("userId"),username:t("username"),groups:r,provider:t("provider")}}function AM(e){let t=n=>T(e[n],ge.string),r=se(D(T(e["cognito:groups"],ge.array),[]),ge.string);return{userId:D(t("sub"),""),username:D(gD(t("cognito:username"),t("email")),""),groups:r,provider:"Cognito"}}function TM(e){try{return ure(e)}catch{return}}function ice(e){let t=e.IdToken;if(t===void 0)return;let r=TM(t);if(r===void 0)return;let n=e.ExpiresIn,i=n!==void 0?Date.now()+n*1e3:void 0;return{token:t,identity:AM(r),refreshToken:e.RefreshToken,expiresAt:i}}async function oce(e,t,r,n){try{let i=new CM({region:t}),o=new RM({ClientId:e,AuthFlow:"USER_PASSWORD_AUTH",AuthParameters:Object.fromEntries([["USERNAME",r],["PASSWORD",n]])}),s=await i.send(o),a=T(s.AuthenticationResult,ice);return a!==void 0?{TAG:"Ok",_0:a}:{TAG:"Error",_0:"Cognito returned no usable tokens"}}catch(i){let o=Su(i);return{TAG:"Error",_0:IS(FS(o))}}}async function sce(e,t,r,n){try{let i=new CM({region:t}),o=new RM({ClientId:e,AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:Object.fromEntries([["REFRESH_TOKEN",r]])}),a=(await i.send(o)).AuthenticationResult;if(a===void 0)return{TAG:"Error",_0:"Cognito refresh returned no tokens"};let l=a.IdToken;if(l===void 0)return{TAG:"Error",_0:"Cognito refresh missing IdToken"};let u=TM(l),d=D(W(u,AM),n),f=a.ExpiresIn,h=f!==void 0?Date.now()+f*1e3:void 0,p=a.RefreshToken;return{TAG:"Ok",_0:{token:l,identity:d,refreshToken:p!==void 0?p:r,expiresAt:h}}}catch(i){let o=Su(i);return{TAG:"Error",_0:IS(FS(o))}}}let $M=mr(void 0),ace=$M.Provider;function lce(e){let t=e.storageKey,r=e.region,n=e.cognitoClientId,i=e.apiEndpoint,o=e.authMode,s=t!==void 0?t:Zue,a=oe(()=>tce(s)),l=a[1],u=a[0];Re(()=>{if(u===void 0)return;let v=u.refreshToken;if(v===void 0)return;let _=u.expiresAt;if(_===void 0)return;let x=u.identity;switch(o){case"Anonymous":case"Local":return;case"Cognito":if(n===void 0||r===void 0)return;let w=Math.max(0,_-Date.now()-ece),S=setTimeout(()=>{sce(n,r,v,x).then(k=>{if(k.TAG==="Ok"){let A=k._0;return z_(s,A),l(C=>A)}localStorage.removeItem(s),l(A=>{})})},w);return()=>{clearTimeout(S)}}},[u,o,n,r]);let d=W(u,v=>v.identity),f=We(u);return Ar(ace,{value:{identity:d,isAuthenticated:f,login:async(v,_)=>{try{let x=0;switch(o){case"Anonymous":case"Local":x=1;break;case"Cognito":if(n===void 0)return{TAG:"LoginErr",_0:"Cognito mode missing clientId or region in config.json"};if(r===void 0)return{TAG:"LoginErr",_0:"Cognito mode missing clientId or region in config.json"};let w=await oce(n,r,v,_);if(w.TAG!=="Ok")return{TAG:"LoginErr",_0:w._0};let S=w._0;return z_(s,S),l(k=>S),"LoginOk"}if(x===1){if(i===void 0)return{TAG:"LoginErr",_0:"Local auth mode requires an apiEndpoint"};let w=await fetch(rce(i),{method:"POST",headers:{"content-type":"application/json"},body:D(JSON.stringify({username:v,password:_}),"")}),S=await w.json();if(w.ok){let A=ge.object(S);if(A===void 0)return{TAG:"LoginErr",_0:"Malformed login response"};let C=T(A.token,ge.string),R=T(A.identity,ge.object);if(C===void 0)return{TAG:"LoginErr",_0:"Malformed login response"};if(R===void 0)return{TAG:"LoginErr",_0:"Malformed login response"};let N=nce(R),I={token:C,identity:N,refreshToken:void 0,expiresAt:void 0};return z_(s,I),l(P=>I),"LoginOk"}return{TAG:"LoginErr",_0:D(T(T(ge.object(S),A=>A.error),ge.string),"Login failed")}}}catch(x){let w=Su(x);return{TAG:"LoginErr",_0:IS(FS(w))}}},logout:()=>{localStorage.removeItem(s),l(v=>{})},getToken:()=>W(u,v=>v.token)},children:e.children})}let uce={make:lce};function ml(){return Ut($M)}let cce={background:"var("+y.surface+")",border:"1px solid var("+y.border+")",color:"var("+y.textPrimary+")",cursor:"pointer",display:"inline-flex",fontFamily:"var("+$.fontFamily+")",fontSize:"var("+$.sizeSm+")",fontWeight:"var("+$.weightMedium+")",lineHeight:"1",padding:"0.375rem 0.75rem",borderRadius:"var("+X.md+")",alignItems:"center",gap:"0.375rem"},dce={color:"var("+y.textSecondary+")",fontSize:"0.625rem"},fce={background:"var("+y.surfaceElevated+")",border:"1px solid var("+y.borderSubtle+")",color:"var("+y.textPrimary+")",fontFamily:"var("+$.fontFamily+")",minWidth:"200px",padding:"0.75rem 1rem",position:"absolute",right:"0",top:"calc(100% + 0.5rem)",zIndex:"10",borderRadius:"var("+X.md+")",boxShadow:"var("+pn.md+")"},hce={background:"var("+y.brandSubtle+")",color:"var("+y.brand+")",display:"inline-block",fontSize:"var("+$.sizeXs+")",marginRight:"0.25rem",marginBottom:"0.25rem",padding:"0.125rem 0.5rem",borderRadius:"var("+X.full+")"},pce={border:"none",borderTop:"1px solid var("+y.borderSubtle+")",margin:"0.5rem 0"},gce={background:"transparent",border:"1px solid var("+y.border+")",color:"var("+y.textPrimary+")",cursor:"pointer",fontSize:"var("+$.sizeSm+")",padding:"0.375rem 0.5rem",width:"100%",borderRadius:"var("+X.sm+")"};function mce(e){let t=ml(),r=oe(()=>!1);if(t===void 0)return null;let n=r[1],i=r[0],o=t.identity;return o!==void 0?M("div",{children:[M("button",{children:[o.username,b("span",{children:i?"▴":"▾",style:dce})],"aria-label":"Signed in as "+o.username,style:cce,onClick:s=>n(a=>!a)}),i?M("div",{children:[b("div",{children:o.username,style:{fontSize:"var("+$.sizeMd+")",fontWeight:"var("+$.weightMedium+")",marginBottom:"0.25rem"}}),o.groups.length!==0?b("div",{children:o.groups.map(s=>b("span",{children:s,style:hce},s)),style:{marginBottom:"0.25rem"}}):null,b("hr",{style:pce}),b("button",{children:"Sign out",style:gce,onClick:s=>{n(a=>!1),t.logout()}})],style:fce}):null],style:{position:"relative"}}):null}let vce=mce,_ce={background:"var("+y.surface+")",border:"1px solid var("+y.borderSubtle+")",color:"var("+y.textPrimary+")",fontFamily:"var("+$.fontFamily+")",margin:"6rem auto",maxWidth:"360px",padding:"2rem",borderRadius:"var("+X.md+")"},JA={color:"var("+y.textSecondary+")",display:"block",fontSize:"var("+$.sizeSm+")",marginBottom:"0.25rem"},QA={background:"var("+y.surfaceElevated+")",border:"1px solid var("+y.border+")",color:"var("+y.textPrimary+")",fontSize:"var("+$.sizeMd+")",marginBottom:"1rem",padding:"0.5rem 0.75rem",width:"100%",borderRadius:"var("+X.sm+")",boxSizing:"border-box"};function bce(e){return{background:e?"var("+y.textDisabled+")":"var("+y.brand+")",border:"none",color:"var("+y.textOnBrand+")",cursor:e?"not-allowed":"pointer",fontSize:"var("+$.sizeMd+")",fontWeight:"var("+$.weightMedium+")",padding:"0.625rem",width:"100%",borderRadius:"var("+X.sm+")"}}let yce={color:"var("+y.error+")",fontSize:"var("+$.sizeSm+")",marginBottom:"0.75rem"};function xce(e){let t=ml(),r=oe(()=>""),n=r[1],i=r[0],o=oe(()=>""),s=o[1],a=o[0],l=oe(()=>{}),u=l[1],d=l[0],f=oe(()=>!1),h=f[1],p=f[0],g=m=>{m.preventDefault(),u(v=>{}),h(v=>!0),t!==void 0?qt(t.login(i,a).then(v=>{if(h(x=>!1),typeof v!="object")return;let _=v._0;u(x=>_)}),v=>(h(_=>!1),u(_=>"Unexpected error during sign-in"),Promise.resolve())):(u(v=>"Auth provider missing"),h(v=>!1),Promise.resolve())};return M("div",{children:[b("h1",{children:"Sign in",style:{fontSize:"var("+$.sizeXl+")",fontWeight:"var("+$.weightBold+")",margin:"0 0 1.5rem"}}),M("form",{children:[b("label",{children:"Username",style:JA}),b("input",{style:QA,autoComplete:"username",autoFocus:!0,type:"text",value:i,onChange:m=>{let v=m.target.value;n(_=>v)}}),b("label",{children:"Password",style:JA}),b("input",{style:QA,autoComplete:"current-password",type:"password",value:a,onChange:m=>{let v=m.target.value;s(_=>v)}}),d!==void 0?b("div",{children:d,style:yce}):null,b("button",{children:p?"Signing in…":"Sign in",style:bce(p),disabled:p,type:"submit"})],onSubmit:g})],style:_ce})}let YA=xce;function Sce(e){let t=e.children,r=e.url,n=r!==void 0?r:"",i=t!==void 0?t:"No route matched!";return D(X9(e.routes,n),i)}let Ece=Sce;function wce(e){let t=e.route,n=Ut(Xg).prefix,i=n===""||t.startsWith(n)?t:n+t;return b("a",{children:e.children,href:i,onClick:o=>{if(!o.defaultPrevented&&o.button===0&&!o.altKey&&!o.ctrlKey&&!o.metaKey&&!o.shiftKey)return o.preventDefault(),Oc(i)}})}let kce=wce,Qh=mr(void 0),Cce=Qh.Provider;function Rce(e){let t=e.initialPages,r=t!==void 0?t:[],n=oe(()=>r),i=n[1],o=oe(()=>[]),s=o[1],a=n[0].concat(o[0]);return Ar(Cce,{value:{register:g=>i(m=>m.concat(g)),deregister:g=>i(m=>m.filter(v=>v.fragmentId!==g)),setPluginPages:g=>s(m=>g),getPages:()=>a,getPage:g=>a.find(m=>m.fragmentId===g)},children:e.children})}let Ace={make:Rce};function NM(){let e=Ut(Qh);return e!==void 0?e.getPages():[]}let Tce=[];function $ce(e){return!1}let Nce={activeAccess:Tce,hasAccess:$ce},DM=mr(Nce),Dce=DM.Provider;function Fce(e){let t=e.access;return Ar(Dce,{value:{activeAccess:t,hasAccess:i=>t.some(o=>o===i)},children:e.children})}function Yh(){return Ut(DM).hasAccess}let Ice=Fce;function Nc(e){return"var("+e+")"}let Pce=E([L("flex"),ee("center"),c("gap",Nc(F.sm)),c("padding","var("+F.xs+") var("+F.md+")"),c("color",Nc(y.textDisabled)),c("font-size",Nc($.sizeSm)),we("notAllowed"),KD("none")]),Oce=E([c("font-size","14px"),Li(0)]),Mce=E([fo(1),c("font-weight",Nc($.weightMedium))]),Lce=E([c("font-size",Nc($.sizeXs)),c("color",Nc(y.brand)),we("pointer"),c("text-decoration","none"),Li(0)]);function zce(e){return M("div",{children:[b("span",{children:"[locked]",className:Oce}),b("span",{children:e.label,className:Mce}),b("span",{children:"Upgrade",className:Lce})],className:Pce})}let Uce=zce;function Bce(e,t){return e.length===0?"Absent":e.every(r=>{let n=r.requiredAccess;return n!==void 0?!t(n):!1})?"Locked":"Active"}function oi(e){return"var("+e+")"}let jce=E([L("flex"),he("column"),c("gap",oi(F.xs)),c("padding","var("+F.sm+") 0")]),qce=E([c("color",oi(y.textDisabled)),c("font-size",oi($.sizeXs)),c("font-weight",oi($.weightBold)),c("letter-spacing","0.08em"),c("text-transform","uppercase"),c("padding","var("+F.xs+") var("+F.md+")"),xs(ke(8))]),XA=E([L("flex"),ee("center"),c("gap",oi(F.sm)),c("padding","var("+F.xs+") var("+F.md+")"),c("color",oi(y.textSecondary)),c("font-size",oi($.sizeMd)),we("pointer"),c("border-radius",oi(X.sm)),c("text-decoration","none"),Ye([c("background",oi(y.surfaceSubtle)),c("color",oi(y.textPrimary))])]),Vce=E([c("background",oi(y.surfaceSubtle)),c("color",oi(y.textPrimary)),c("font-weight",oi($.weightMedium))]),Kce=E([c("font-size","12px"),c("color",oi(y.textDisabled)),$h("auto")]);function Hce(e,t){let r=e.url;return r!==void 0?r===t?!0:t.startsWith(r+"/"):!1}function Wce(e){let t=e.hasAccess,r=e.page,n=fe(r.requiredAccess,!1,a=>!t(a)),i=e.isActive?XA+" "+Vce:XA,o=M(qr,{children:[fe(r.menuEntry.icon,null,a=>b("span",{children:a})),b("span",{children:r.menuEntry.label}),n?b("span",{children:"[locked]",className:Kce}):null]}),s=r.url;return!n&&s!==void 0?b(kce,{route:s,children:b("span",{children:o,className:i})}):b("div",{children:o,className:i,role:"button"})}function ZA(e){let t=e.hasAccess,r=e.currentUrl,n=e.pages.toSorted((i,o)=>lx(i.menuEntry.sortOrder,o.menuEntry.sortOrder));return M(qr,{children:[fe(e.label,null,i=>b("div",{children:i,className:qce})),n.map(i=>b(Wce,{page:i,isActive:Hce(i,r),hasAccess:t},i.fragmentId))]})}function Gce(e){let t=e.currentUrl,r=NM(),n=Yh(),i={};r.forEach(a=>{let l=D(a.menuEntry.group,""),u=D(i[l],[]);i[l]=u.concat([a])});let o=D(i[""],[]),s=Object.entries(i).filter(a=>a[0]!=="").toSorted((a,l)=>{let u=lt(a[1],999,(f,h)=>f<h.menuEntry.sortOrder?f:h.menuEntry.sortOrder),d=lt(l[1],999,(f,h)=>f<h.menuEntry.sortOrder?f:h.menuEntry.sortOrder);return lx(u,d)});return M("nav",{children:[o.length!==0?b(ZA,{label:void 0,pages:o,currentUrl:t,hasAccess:n}):null,s.map(a=>{let l=a[1],u=a[0];switch(Bce(l,n)){case"Active":return b(ZA,{label:u,pages:l,currentUrl:t,hasAccess:n},u);case"Locked":return b(Uce,{label:u},u);case"Absent":return null}})],"aria-label":"primary navigation",className:jce})}let Jce=Gce;function Dc(e){return"var("+e+")"}let Qce=E([L("flex"),he("row"),jD({NAME:"vh",VAL:100}),c("overflow","hidden"),c("background",Dc(y.background))]),Yce=E([L("flex"),he("column"),c("width","240px"),Li(0),c("background",Dc(y.surface)),c("border-right","1px solid var("+y.borderSubtle+")"),c("overflow-y","auto")]),Xce=E([c("padding","var("+F.md+") var("+F.lg+")"),c("border-bottom","1px solid var("+y.borderSubtle+")"),c("color",Dc(y.textPrimary)),c("font-size",Dc($.sizeLg)),c("font-weight",Dc($.weightBold)),Li(0)]),Zce=E([L("flex"),he("column"),fo(1),c("overflow","hidden")]),ede=E([L("flex"),he("column"),fo(1),c("overflow","auto"),c("background",Dc(y.background))]);function tde(e){let t=e.loading,r=e.routesReady,n=e.fallback,i=e.appName,o=i!==void 0?i:"Reventless",s=n!==void 0?n:"404 — Page not found",a=r!==void 0?r:!0,l=t!==void 0?t:null,u=R9();return M("div",{children:[M("aside",{children:[M("div",{children:[fe(e.logoUrl,null,d=>b("img",{style:{height:"24px",marginRight:"8px"},alt:o,src:d})),o],className:Xce}),b(Jce,{currentUrl:u})],className:Yce}),M("main",{children:[D(e.headerSlot,null),b("div",{children:a?b(Ece,{url:u,routes:e.router,children:s}):l,className:ede})],className:Zce})],className:Qce})}let rde=tde,nde=[c(y.background,"#0d1117"),c(y.surface,"#161b22"),c(y.surfaceSubtle,"#1c2128"),c(y.surfaceElevated,"#21262d"),c(y.brand,"#2f81f7"),c(y.brandSubtle,"#1f4b8e"),c(y.success,"#3fb950"),c(y.warning,"#d29922"),c(y.error,"#f85149"),c(y.info,"#58a6ff"),c(y.textPrimary,"#e6edf3"),c(y.textSecondary,"#8b949e"),c(y.textDisabled,"#484f58"),c(y.textOnBrand,"#ffffff"),c(y.border,"#30363d"),c(y.borderSubtle,"#21262d"),c(F.xs,"4px"),c(F.sm,"8px"),c(F.md,"16px"),c(F.lg,"24px"),c(F.xl,"32px"),c(F.xxl,"48px"),c($.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),c($.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),c($.sizeXs,"11px"),c($.sizeSm,"12px"),c($.sizeMd,"14px"),c($.sizeLg,"16px"),c($.sizeXl,"20px"),c($.sizeXxl,"24px"),c($.weightNormal,"400"),c($.weightMedium,"500"),c($.weightBold,"600"),c($.lineHeightTight,"1.25"),c($.lineHeightNormal,"1.5"),c($.lineHeightRelaxed,"1.75"),c(X.sm,"4px"),c(X.md,"6px"),c(X.lg,"12px"),c(X.full,"9999px"),c(pn.sm,"0 1px 3px rgba(0,0,0,0.4)"),c(pn.md,"0 4px 12px rgba(0,0,0,0.5)"),c(pn.lg,"0 8px 24px rgba(0,0,0,0.6)")],ide=[c(y.background,"#ffffff"),c(y.surface,"#f6f8fa"),c(y.surfaceSubtle,"#eaeef2"),c(y.surfaceElevated,"#ffffff"),c(y.brand,"#0969da"),c(y.brandSubtle,"#ddf4ff"),c(y.success,"#1a7f37"),c(y.warning,"#9a6700"),c(y.error,"#cf222e"),c(y.info,"#0550ae"),c(y.textPrimary,"#1f2328"),c(y.textSecondary,"#636c76"),c(y.textDisabled,"#bec1c5"),c(y.textOnBrand,"#ffffff"),c(y.border,"#d0d7de"),c(y.borderSubtle,"#eaeef2"),c(F.xs,"4px"),c(F.sm,"8px"),c(F.md,"16px"),c(F.lg,"24px"),c(F.xl,"32px"),c(F.xxl,"48px"),c($.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),c($.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),c($.sizeXs,"11px"),c($.sizeSm,"12px"),c($.sizeMd,"14px"),c($.sizeLg,"16px"),c($.sizeXl,"20px"),c($.sizeXxl,"24px"),c($.weightNormal,"400"),c($.weightMedium,"500"),c($.weightBold,"600"),c($.lineHeightTight,"1.25"),c($.lineHeightNormal,"1.5"),c($.lineHeightRelaxed,"1.75"),c(X.sm,"4px"),c(X.md,"6px"),c(X.lg,"12px"),c(X.full,"9999px"),c(pn.sm,"0 1px 3px rgba(0,0,0,0.08)"),c(pn.md,"0 4px 12px rgba(0,0,0,0.12)"),c(pn.lg,"0 8px 24px rgba(0,0,0,0.16)")],ode=[c(y.background,"#f5f5f5"),c(y.surface,"#ffffff"),c(y.surfaceSubtle,"#eeeeee"),c(y.surfaceElevated,"#ffffff"),c(y.brand,"#424242"),c(y.brandSubtle,"#e0e0e0"),c(y.success,"#388e3c"),c(y.warning,"#f57c00"),c(y.error,"#d32f2f"),c(y.info,"#1976d2"),c(y.textPrimary,"#212121"),c(y.textSecondary,"#757575"),c(y.textDisabled,"#bdbdbd"),c(y.textOnBrand,"#ffffff"),c(y.border,"#bdbdbd"),c(y.borderSubtle,"#e0e0e0"),c(F.xs,"4px"),c(F.sm,"8px"),c(F.md,"16px"),c(F.lg,"24px"),c(F.xl,"32px"),c(F.xxl,"48px"),c($.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),c($.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),c($.sizeXs,"11px"),c($.sizeSm,"12px"),c($.sizeMd,"14px"),c($.sizeLg,"16px"),c($.sizeXl,"20px"),c($.sizeXxl,"24px"),c($.weightNormal,"400"),c($.weightMedium,"500"),c($.weightBold,"600"),c($.lineHeightTight,"1.25"),c($.lineHeightNormal,"1.5"),c($.lineHeightRelaxed,"1.75"),c(X.sm,"4px"),c(X.md,"6px"),c(X.lg,"12px"),c(X.full,"9999px"),c(pn.sm,"0 1px 3px rgba(0,0,0,0.12)"),c(pn.md,"0 4px 12px rgba(0,0,0,0.14)"),c(pn.lg,"0 8px 24px rgba(0,0,0,0.18)")],sde=[c(y.background,"#000000"),c(y.surface,"#0a0a0a"),c(y.surfaceSubtle,"#111111"),c(y.surfaceElevated,"#1a1a1a"),c(y.brand,"#ffdd00"),c(y.brandSubtle,"#332b00"),c(y.success,"#00ff00"),c(y.warning,"#ffaa00"),c(y.error,"#ff4444"),c(y.info,"#44aaff"),c(y.textPrimary,"#ffffff"),c(y.textSecondary,"#cccccc"),c(y.textDisabled,"#555555"),c(y.textOnBrand,"#000000"),c(y.border,"#ffffff"),c(y.borderSubtle,"#888888"),c(F.xs,"4px"),c(F.sm,"8px"),c(F.md,"16px"),c(F.lg,"24px"),c(F.xl,"32px"),c(F.xxl,"48px"),c($.fontFamily,"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),c($.fontFamilyMono,"'SFMono-Regular', Consolas, 'Liberation Mono', monospace"),c($.sizeXs,"11px"),c($.sizeSm,"12px"),c($.sizeMd,"14px"),c($.sizeLg,"16px"),c($.sizeXl,"20px"),c($.sizeXxl,"24px"),c($.weightNormal,"400"),c($.weightMedium,"500"),c($.weightBold,"600"),c($.lineHeightTight,"1.25"),c($.lineHeightNormal,"1.5"),c($.lineHeightRelaxed,"1.75"),c(X.sm,"4px"),c(X.md,"6px"),c(X.lg,"12px"),c(X.full,"9999px"),c(pn.sm,"0 1px 3px rgba(255,255,255,0.1)"),c(pn.md,"0 4px 12px rgba(255,255,255,0.15)"),c(pn.lg,"0 8px 24px rgba(255,255,255,0.2)")];function qp(e,t){let r=t!==void 0?[c(y.brand,t.primaryColor)]:[];return E(e.concat(r))}function ade(e){let t=e.theme,r=t.preset,n;switch(r){case"Dark":n=qp(nde,t.brand);break;case"Light":n=qp(ide,t.brand);break;case"Neutral":n=qp(ode,t.brand);break;case"HighContrast":n=qp(sde,t.brand);break}return b("div",{children:e.children,className:n})}let lde=ade;function ude(e){}let cde={preset:"Light",setPreset:ude},FM=mr(cde),dde=FM.Provider;function fde(){return Ut(FM)}let IM="reventless-ui:theme";function PM(e){switch(e){case"Dark":return"Dark";case"HighContrast":return"HighContrast";case"Neutral":return"Neutral";default:return"Light"}}function y1(e){switch(e){case"Dark":return"Dark";case"Light":return"Light";case"Neutral":return"Neutral";case"HighContrast":return"HighContrast"}}function hde(e){let t=localStorage.getItem(IM);return t==null?e:PM(t)}function pde(e){let t=e.initialPreset,r=t!==void 0?t:"Light",n=oe(()=>hde(r)),i=n[1],o=n[0],s=Jr(l=>{localStorage.setItem(IM,y1(l)),i(u=>l)},[]),a=Lt(()=>({preset:o,setPreset:s}),[o,s]);return b(dde,{value:a,children:b(lde,{theme:{preset:o,brand:e.brand},children:e.children})})}let gde={make:pde},Xh=mr(void 0),mde=Xh.Provider;function vde(e){let t=e.access,r=e.initialPanels,n=r!==void 0?r:[],i=t!==void 0?t:[],o=oe(()=>n),s=o[1],a=oe(()=>[]),l=a[1],u=o[0].concat(a[0]);return Ar(mde,{value:{register:_=>s(x=>x.concat(_)),deregister:_=>s(x=>x.filter(w=>w.extensionPackage!==_)),setPluginPanels:_=>l(x=>_),getPanel:_=>u.find(x=>x.fragmentId===_),getPanelsForPosition:_=>u.filter(x=>x.positions.some(w=>w===_)),hasAccess:_=>i.some(x=>x===_)},children:e.children})}let _de={make:vde};function bde(e){let t=Ut(Xh);return t!==void 0?t.getPanelsForPosition(e):[]}function yde(e){let t=Ut(Xh);if(t!==void 0)return t.getPanel(e)}function WE(e){return"/"+e.environment+"/"+e.platformName}function OM(e){let t=e.split("?")[0],r=t.split("/").filter(l=>l!==""),n=r[0],i=r[1];if(n===void 0||i===void 0)return;let o={environment:n,platformName:i},s=WE(o),a=t.startsWith(s)?t.slice(s.length):"/";return[o,a===""?"/":a]}let xde=mr(void 0),Sde=xde.Provider;function Ede(e){return Ar(Sde,{value:e.scope,children:e.children})}let MM={make:Ede};function wde(e){let t=e.length-1|0,r=0;for(;;){let n=r,i=t;if(i<0)return n;r={hd:e[i],tl:n},t=i-1|0}}let LM=mr(void 0),zM=mr({routes:[],publicLinks:tu()}),UM=mr(!1),kde=LM.Provider;function Cde(e){return Ar(kde,{value:e.value,children:e.children})}let Rde=zM.Provider;function Ade(e){return Ar(Rde,{value:e.value,children:e.children})}let Tde=UM.Provider;function $de(e){return Ar(Tde,{value:e.value,children:e.children})}function Nde(e){let t=oe(()=>({routes:[],publicLinks:tu()})),r=t[1],n=t[0],i=oe(()=>({routes:[],publicLinks:tu()})),o=i[1],s=i[0],a=oe(()=>!1),l=a[1],u=n.routes.concat(s.routes),d=fy(n.publicLinks,s.publicLinks),f={routes:u,publicLinks:d};return b(Cde,{value:{register:(m,v)=>r(_=>({routes:_.routes.concat(m),publicLinks:fy(_.publicLinks,v)})),setPluginRoutes:(m,v)=>{o(_=>({routes:m,publicLinks:v})),l(_=>!0)}},children:b($de,{value:a[0],children:b(Ade,{value:f,children:b(i7.make,{registry:d,children:e.children})})})})}let Dde={make:Nde};function GE(){return Ut(LM)}function Fde(){return Ut(UM)}function Ide(){let e=Ut(zM).routes;return Lt(()=>Q9(wde(e.toReversed())),[e])}function Qd(e){return"var("+e+")"}let Pde=E([c("background",Qd(y.surface)),c("color",Qd(y.textPrimary)),c("border","1px solid var("+y.border+")"),c("border-radius",Qd(X.sm)),c("padding","4px 8px"),c("font-size",Qd($.sizeSm)),c("font-family",Qd($.fontFamily)),we("pointer")]);function Ode(e){switch(e){case"Dark":return"Dark";case"Light":return"Light";case"Neutral":return"Neutral";case"HighContrast":return"High contrast"}}let Mde=["Light","Dark","Neutral","HighContrast"];function Lde(e){let t=fde(),r=t.setPreset,n=i=>{let o=i.target.value;r(PM(o))};return b("select",{children:Mde.map(i=>{let o=y1(i);return b("option",{children:Ode(i),value:o},o)}),className:Pde,value:y1(t.preset),onChange:n})}let zde=Lde;function BM(e){return e.startsWith("/")?!e.startsWith("//"):!1}function Ude(e){let t;e.startsWith("https://")?t="wss://"+e.slice(8):e.startsWith("http://")?t="ws://"+e.slice(7):BM(e)?t=(location.protocol==="https:"?"wss":"ws")+"://"+location.host+e:t=e;let r=t.replace("appsync-api.","appsync-realtime-api.");return r.endsWith("/realtime")?r:r+"/realtime"}function Bde(e){let t=e.startsWith("https://")?e.slice(8):e.startsWith("http://")?e.slice(7):BM(e)?location.host:e,r=t.indexOf("/");return r!==-1?t.slice(0,r):t}function jde(e){return btoa(e).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}function qde(e,t){let r=JSON.stringify(Object.fromEntries([["host",e],["Authorization",t]]));return"header-"+jde(r)}function x1(e,t){if(e.state===t)return;let r=e.state;e.state=t;let n=0;switch(t){case"Closed":case"Connecting":n=1;break;case"Open":let i=e.disconnectedSince;if(i!==void 0){let o=Date.now()-i;e.disconnectedSince=void 0,ie(e.onReconnect,s=>s(o))}break}if(n===1)switch(r){case"Closed":case"Connecting":break;case"Open":e.disconnectedSince=Date.now();break}ie(e.onStateChange,i=>i(t))}function Vde(e){switch(e){case 1:return 1e3;case 2:return 2e3;case 3:return 4e3;case 4:return 8e3;case 5:return 16e3;default:return 3e4}}let Kde='{"type":"connection_init"}';function S1(e,t){let r=e.ws,n=e.getToken();if(r===void 0||n===void 0)return;let i=Object.fromEntries([["host",e.host],["Authorization",n]]),o=JSON.stringify(Object.fromEntries([["type","subscribe"],["id",t.id],["channel",t.channel],["authorization",i]]));try{ir(r).send(o);return}catch{return}}function Hde(e,t){let r=e.ws;if(r===void 0)return;let n=JSON.stringify(Object.fromEntries([["type","unsubscribe"],["id",t]]));try{ir(r).send(n);return}catch{return}}function Wde(e){e.subscriptions.forEach(t=>S1(e,t))}function Gde(e,t){let r;try{r=JSON.parse(t)}catch{r=void 0}let n=T(r,ge.object);if(n===void 0)return;let i=T(n.type,ge.string);if(i!==void 0)switch(i){case"connection_ack":x1(e,"Open"),e.reconnectAttempts=0;let o=e.pendingPostAck;return e.pendingPostAck=[],o.forEach(h=>h()),Wde(e);case"data":let s=T(n.id,ge.string),a=D(n.event,null),l=h=>{let p=ge.string(h);if(p===void 0)return h;try{return JSON.parse(p)}catch{return h}},u=ge.array(a),d=u!==void 0?u.map(l):[l(a)],f=T(s,h=>e.subscriptions.get(h));if(f!==void 0){d.forEach(h=>f.onMessage(h));return}else return;default:return}}function jM(e){if(e.disposed)return;let t=["aws-appsync-event-ws"],r=e.getToken(),n=r!==void 0?t.concat([qde(e.host,r)]):t,i=new WebSocket(e.url,n);e.ws=pr(i),x1(e,"Connecting"),i.onopen=()=>{try{i.send(Kde);return}catch{return}},i.onmessage=o=>Gde(e,o.data),i.onclose=()=>{if(e.ws=void 0,x1(e,"Closed"),e.disposed)return;let o=e.reconnectAttempts+1|0;e.reconnectAttempts=o,e.reconnectTimer=setTimeout(()=>jM(e),Vde(o))},i.onerror=o=>{}}function Jde(e,t,r,n,i){let o={ws:void 0,state:"Closed",url:e,host:t,getToken:r,subscriptions:new Map,pendingPostAck:[],reconnectAttempts:0,reconnectTimer:void 0,disposed:!1,onStateChange:n,disconnectedSince:void 0,onReconnect:i};return jM(o),o}function Qde(e,t,r){let n=crypto.randomUUID(),i={id:n,channel:t,onMessage:r};e.subscriptions.set(n,i);let o=e.state,s=0;switch(o){case"Closed":case"Connecting":s=1;break;case"Open":S1(e,i);break}return s===1&&e.pendingPostAck.push(()=>S1(e,i)),()=>{if(e.subscriptions.has(n))return e.subscriptions.delete(n),Hde(e,n)}}function eT(e){e.disposed=!0;let t=e.reconnectTimer;t!==void 0&&clearTimeout(t),e.reconnectTimer=void 0;let r=e.ws;if(r!==void 0)try{ir(r).close()}catch{}e.ws=void 0,e.subscriptions.clear()}async function Yde(e,t,r,n){let i=JSON.stringify(Object.fromEntries([["channel",r],["events",n.map(s=>JSON.stringify(s))]])),o=Object.fromEntries([["Content-Type","application/json"]]);t!==void 0&&(o.Authorization=t);try{let s=await fetch(e,{method:"POST",headers:o,body:i});return s.ok?{TAG:"Ok",_0:void 0}:{TAG:"Error",_0:"publish failed with status "+s.status.toString()}}catch(s){let a=Su(s);return a.RE_EXN_ID===Yg?{TAG:"Error",_0:D(a._1.message,"publish failed")}:{TAG:"Error",_0:"publish failed"}}}function Pg(e){return e.startsWith("Platform_")||e.startsWith("platform_")?"Platform":"Domain"}let qM=mr(void 0);function Zh(){return Ut(qM)}function tT(){return{client:void 0,registry:new Map,refcount:0,idleTimer:void 0,reconnectListeners:[]}}let Xde=qM.Provider;function Zde(e){let t=e.getToken,r=e.clientEventsNamespace,n=e.liveReconnectRefetch,i=e.liveUpdates,o=e.platformEventsEndpoint,s=e.domainEventsEndpoint,a=n!==void 0?n:!0,l=Je(t);Re(()=>{l.current=t},[t]);let u=()=>l.current(),d=Je(tT()),f=Je(tT()),h=oe(()=>"Closed"),p=h[1],g=h[0],m=oe(()=>"Closed"),v=m[1],_=m[0],x=q=>q==="Domain"?d:f,w=q=>q==="Domain"?s:o,S=q=>{let H=x(q).current,V=H.client;if(V!==void 0)return V;let Y=w(q);if(Y===void 0)return;let G=Ude(Y),J=Bde(Y),Q=Jde(G,J,u,ue=>q==="Domain"?p(le=>ue):v(le=>ue),ue=>{let le=x(q).current;if(!(a&&ue>=2e3))return;le.reconnectListeners.slice().forEach($e=>{try{return $e()}catch{return}})});return H.client=Q,Q},k=q=>{let H=x(q).current,V=H.idleTimer;if(V!==void 0){clearTimeout(V),H.idleTimer=void 0;return}},A=(q,H,V)=>{let Y=x(q).current;if(!i||no(w(q)))return()=>{};k(q),Y.refcount=Y.refcount+1|0;let G=Y.registry.get(H),J;if(G!==void 0){let Q=G.drainTimer;Q!==void 0&&(clearTimeout(Q),G.drainTimer=void 0),J=G}else{let Q={refcount:0,callbacks:[],underlyingUnsub:void 0,drainTimer:void 0};Y.registry.set(H,Q),J=Q}if(J.callbacks.push(V),J.refcount=J.refcount+1|0,J.refcount===1&&no(J.underlyingUnsub)){let Q=S(q);if(Q!==void 0){let ue=Qde(Q,H,le=>{J.callbacks.forEach(Ae=>Ae(le))});J.underlyingUnsub=ue}}return()=>{if(J.callbacks=J.callbacks.filter(Q=>Q!==V),J.refcount=J.refcount-1|0,J.refcount===0&&(J.drainTimer=setTimeout(()=>{let Q=J.underlyingUnsub;Q!==void 0&&Q(),J.underlyingUnsub=void 0,J.drainTimer=void 0,Y.registry.delete(H)},5e3)),Y.refcount=Y.refcount-1|0,Y.refcount===0){let Q=x(q).current,ue=Q.idleTimer;ue!==void 0&&clearTimeout(ue),Q.idleTimer=setTimeout(()=>{let le=Q.client;le!==void 0&&(eT(le),Q.client=void 0),Q.idleTimer=void 0},3e4);return}}},C=q=>i?We(w(Pg(q))):!1;Re(()=>{let q=()=>{};return addEventListener("visibilitychange",q),()=>{removeEventListener("visibilitychange",q)}},[]),Re(()=>(()=>{["Domain","Platform"].forEach(q=>{let H=x(q).current,V=H.idleTimer;V!==void 0&&clearTimeout(V),H.idleTimer=void 0,H.registry.forEach(G=>{let J=G.drainTimer;if(J!==void 0){clearTimeout(J),G.drainTimer=void 0;return}});let Y=H.client;Y!==void 0&&eT(Y),H.client=void 0})}),[]);let R=q=>q==="Domain"?g:_,N=(q,H)=>{let V=x(q).current;return V.reconnectListeners.push(H),()=>{V.reconnectListeners=V.reconnectListeners.filter(Y=>Y!==H)}},I=()=>i&&We(r)?We(s):!1,P=async(q,H,V)=>{let Y=w(q);return Y!==void 0?await Yde(Y,l.current(),H,V):{TAG:"Error",_0:"no events endpoint configured"}},z=Lt(()=>({subscribe:A,isLive:C,apiForReadModel:Pg,statusFor:R,registerReconnect:N,publish:P,clientChannelsAvailable:I,clientNamespace:()=>r}),[i,s,o,g,_,r]);return Ar(Xde,{value:z,children:e.children})}let efe={make:Zde};function rT(e){return Object.fromEntries([["eq",e]])}function tfe(e,t){let r=ge.object(e),n=r!==void 0?Object.fromEntries(Object.entries(r)):{},i=T(n.filter,ge.object),o=i!==void 0?Object.fromEntries(Object.entries(i)):{};return o.environment=rT(t.environment),o.platformName=rT(t.platformName),n.filter=o,n}let rfe=/\$filter\s*:\s*[A-Za-z0-9_]*Filter\b/,nfe=/\$filter\s*:/,nT={};function ife(e){if(nT[e]===void 0){nT[e]=!0,console.warn("PlatformFilter: this query declares a `$filter` variable that is not a fleet-scope `<Type>Filter` input object, so it is left untouched. `$filter` is reserved for platform-scope injection in fleet mode — rename the variable (e.g. `$logFilter`) to avoid ambiguity. Query: "+e);return}}function ofe(e){return t=>((r,n)=>rfe.test(r)?t(r,tfe(n,e)):(nfe.test(r)&&ife(r),t(r,n)))}let sfe={background:"var("+y.surface+")",border:"1px solid var("+y.borderSubtle+")",color:"var("+y.textPrimary+")",fontFamily:"var("+$.fontFamily+")",margin:"6rem auto",maxWidth:"480px",padding:"2rem",borderRadius:"var("+X.md+")"},afe={background:"var("+y.surfaceElevated+")",border:"1px solid var("+y.border+")",color:"var("+y.textPrimary+")",cursor:"pointer",display:"flex",fontSize:"var("+$.sizeMd+")",marginBottom:"0.5rem",padding:"0.75rem 1rem",textAlign:"left",width:"100%",borderRadius:"var("+X.sm+")",alignItems:"center",justifyContent:"space-between"},lfe={background:"var("+y.brandSubtle+")",color:"var("+y.brand+")",fontSize:"var("+$.sizeXs+")",padding:"0.125rem 0.5rem",borderRadius:"var("+X.full+")"};function ufe(e){let t=e.discover,r=po(),n=oe(()=>"Loading"),i=n[1],o=n[0];Re(()=>{r!==void 0?(i(a=>"Loading"),qt(t(r).then(a=>i(l=>({TAG:"Loaded",_0:a}))),a=>{let l=D(T(c9(a),u=>u.message),"Platform discovery failed");return i(u=>({TAG:"Failed",_0:l})),Promise.resolve()})):i(a=>({TAG:"Failed",_0:"PlatformPicker rendered outside AutoGraphQL.Provider"}))},[We(r)]);let s;if(typeof o!="object")s=b("div",{children:"Discovering platforms…",style:{color:"var("+y.textSecondary+")"}});else if(o.TAG==="Loaded"){let a=o._0;s=a.length!==0?a.map(l=>M("button",{children:[l.platformName,b("span",{children:l.environment,style:lfe})],style:afe,onClick:u=>Oc(WE(l)+"/")},l.environment+"/"+l.platformName)):b("div",{children:"No platforms discovered.",style:{color:"var("+y.textSecondary+")"}})}else s=b("div",{children:o._0,style:{color:"var("+y.error+")",fontSize:"var("+$.sizeSm+")"}});return M("div",{children:[b("h1",{children:"Select a platform",style:{fontSize:"var("+$.sizeXl+")",fontWeight:"var("+$.weightBold+")",margin:"0 0 1.5rem"}}),s],style:sfe})}let cfe=ufe;function Gn(e){let t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()}function ro(e,t){let r=new Date(e);return new Date(r.getFullYear(),r.getMonth(),r.getDate()+t).getTime()}function VM(e,t){let r=new Date(e);return new Date(r.getFullYear(),r.getMonth()+t,1).getTime()}function Bm(e){let t=new Date(e).getDay()|0,r=t===0?6:t-1|0;return ro(Gn(e),-r|0)}function KM(e){let t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),1).getTime()}function dfe(e){let t=Bm(KM(e));return Ja(42,r=>ro(t,r))}function HM(e,t){return Gn(e)===Gn(t)}function ffe(e,t){let r=new Date(e),n=new Date(t);return r.getFullYear()===n.getFullYear()?r.getMonth()===n.getMonth():!1}function WM(e,t,r){let n=Gn(r),i=n+864e5;return e<i?t>=n:!1}function iT(e){let t=e.toString();return t.length<2?"0"+t:t}function GM(e){let t=new Date(e);return iT(t.getHours()|0)+":"+iT(t.getMinutes()|0)}function JM(e){return e===Gn(e)}let QM=["January","February","March","April","May","June","July","August","September","October","November","December"];function Gi(e){let t=new Date(e),r=t.getMonth()|0;return D(QM[r],"")+" "+t.getFullYear().toString()}let JE=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function YM(e){return new Date(e).getDate()|0}function oa(e){let r=new Date(e).getDay()|0,n=r===0?6:r-1|0;return D(JE[n],"")+" "+(new Date(e).getDate()|0).toString()}function Mi(e){let t=new Date(e).getTime();if(!Number.isNaN(t))return t}let XM=864e5;function Zc(e){let t=T(T(K(e),n=>AD(n)[0]),K),r=T(T(t,n=>O(n,"__typename")),ce);if(r===void 0)return"Accepted";switch(r){case"CommandPending":return"Pending";case"CommandRejected":let n=T(T(t,o=>O(o,"errorCode")),ce),i=T(T(t,o=>O(o,"errorDetail")),ce);return{TAG:"Rejected",_0:{errorCode:n,detail:i}};default:return"Accepted"}}function Ho(e,t){let r=O(e,t);if(r===void 0)return;let n=ce(r);return n!==void 0?n:T(T(K(r),i=>O(i,"TAG")),ce)}function ZM(e,t,r){if(r===void 0)return e;let n=Ho(t,r);return e.filter(i=>{let o=i.allowedStates;return o!==void 0?n!==void 0?o.includes(n):!1:!0})}function hfe(e){switch(e){case"Added":return"Added";case"BulkInvalidated":return"BulkInvalidated";case"Removed":return"Removed";case"Updated":return"Updated";default:return}}function pfe(e){let t=ge.object(e);if(t===void 0)return;let r=o=>T(t[o],ge.string),n=T(r("changeKind"),hfe),i=r("id");if(n!==void 0&&i!==void 0)return{changeKind:n,id:i,sortKeyValue:r("sortKeyValue")}}function oT(e){return e.replace(/[^A-Za-z0-9-]/g,"-")}let sT="default";function gfe(e,t){let r=oT(e);return typeof t!="object"?"/"+sT+"/"+r+"/*":"/"+sT+"/"+r+"/"+oT(t._0)}function E1(e,t,r,n,i){let o=r!==void 0?r:!0,s=Zh(),a=gfe(e,t),l=Je(n);Re(()=>{l.current=n},[n]);let u=Je(i);Re(()=>{u.current=i},[i]),Re(()=>{if(!o||s===void 0)return;let d=Pg(e),f={contents:void 0},h={contents:void 0},p=setTimeout(()=>{let g=s.subscribe(d,a,v=>{let _=pfe(v);if(_!==void 0)return l.current(_)});f.contents=g;let m=s.registerReconnect(d,()=>ie(u.current,v=>v()));h.contents=m},100);return()=>{clearTimeout(p);let g=f.contents;g!==void 0&&g();let m=h.contents;if(m!==void 0)return m()}},[a,o,s])}function mfe(e,t){let r=T(K(e),i=>O(i,t)),n=T(r,Vt);return n!==void 0?n:D(W(T(T(T(r,K),i=>O(i,"edges")),Vt),i=>se(i,o=>T(K(o),s=>O(s,"node")))),[])}function _u(e,t){let r=t!==void 0?t:!0,n=po(),i=oe(()=>[]),o=i[1],s=oe(()=>"Loading"),a=s[1],l=oe(()=>0),u=l[1],d=Je(void 0);Re(()=>{r?n!==void 0?(a(m=>"Loading"),qt(n(e.queryDocument,{}).then(m=>(o(v=>mfe(m,e.queryField)),a(v=>"Loaded"),Promise.resolve())),m=>(a(v=>({TAG:"Error",_0:"Failed to load data"})),Promise.resolve()))):a(m=>({TAG:"Error",_0:"Not connected"})):a(m=>"Loaded")},[l[0],r]);let f=()=>u(m=>m+1|0),h=m=>{let v=d.current;v!==void 0&&clearTimeout(v),d.current=setTimeout(()=>{d.current=void 0,u(_=>_+1|0)},250)},p=Zh(),g=r&&fe(p,!1,m=>m.isLive(e.queryField));return E1(e.queryField,"All",g,h,f),{rows:i[0],fetchState:s[0],refetch:f}}let aT=["message","body","text","title","content"],e4=["userId","recipientId","recipient","user","targetUserId"],vfe=["createdAt","sentAt","notifiedAt","at","timestamp"],_fe=["read","isRead","seen","acknowledged"];function QE(e,t){return t.some(r=>r.toLowerCase()===e.toLowerCase())}function t4(e){return se(Yr(e),t=>{if(dm(t[1]))return t[0]})}function r4(e,t){return t4(e).find(r=>QE(r,t))}function bfe(e){let t=r4(e,e4);if(t!==void 0)return t;let r=Vr(e,void 0);return Yr(e).map(n=>n[0]).find(n=>fe(O(r.semantics,n),!1,i=>i.semantic==="UserRef"))}function yfe(e){return se(Yr(e),t=>{if(Ex(t[1]))return t[0]}).find(t=>QE(t,vfe))}function xfe(e){return se(Yr(e),t=>{if(ot(Lq(t[1]),"boolean"))return t[0]}).find(t=>QE(t,_fe))}function Sfe(e,t){return se(t4(e),r=>{let n=r.toLowerCase();if(!(r===t||n==="id"||!n.endsWith("id")))return{field:r,stem:r.slice(0,r.length-2|0)}})}function Efe(e){return fe(T(K(e),t=>O(t,"x-reventless-notifications")),!1,t=>{let r=nt(t);return typeof r!="object"?r==="JSONTrue":r.TAG==="JSONString"})}let wfe=["markread","marknotificationread","readnotification","acknowledge","dismiss","markseen"];function kfe(e,t){let r=se(e.linkedWriteSide,n=>t.aggregates.find(i=>i.name===n)).map(n=>n.commands).flat();return e.commands.concat(r).find(n=>wfe.some(i=>n.name.toLowerCase().startsWith(i)))}let lT={contents:[]};function uT(e,t,r){if(!lT.contents.includes(e)){lT.contents.push(e),console.error('[AutoUI] Read model "'+e+'" announces itself as notifications but has no '+t+" field — no notification bell is wired. The convention expects a string field named "+r.join(" | ")+"; see docs/guides/notifications-read-model-convention.md.");return}}function Cfe(e){return se(e.readModels.filter(t=>Efe(t.schema)?!0:t.name.toLowerCase().endsWith("notifications")),t=>{let r=r4(t.schema,aT),n=bfe(t.schema);if(r!==void 0){if(n!==void 0)return{readModel:t,messageField:r,recipientField:n,timestampField:yfe(t.schema),readField:xfe(t.schema),refFields:Sfe(t.schema,n),markReadCommand:kfe(t,e)};uT(t.name,"recipient",e4);return}else{uT(t.name,"message",aT);return}})[0]}function gc(e,t){return T(O(e,t),ce)}function Rfe(e,t,r){let n=gc(e,t.recipientField);return n!==void 0&&r!==void 0&&n!==r.userId?n===r.username:!0}function Og(e,t){return T(T(t.timestampField,r=>gc(e,r)),Mi)}function Afe(e,t,r){let n=t.readField;if(n!==void 0){let o=W(O(e,n),nt);return o==="JSONTrue"&&typeof o!="object"}let i=Og(e,t);return i!==void 0?r!==void 0?i<=r:!1:!0}function Tfe(e,t,r,n){return se(t,i=>{let o=D(K(i),{});if(Rfe(o,e,r))return o}).toSorted((i,o)=>{let s=Og(i,e),a=Og(o,e);return s!==void 0?a!==void 0?a-s:-1:a!==void 0?1:0}).map((i,o)=>({id:D(gc(i,"id"),"#"+o.toString()),message:D(gc(i,e.messageField),""),timestamp:T(e.timestampField,s=>gc(i,s)),read:Afe(i,e,n),refs:se(e.refFields,s=>W(gc(i,s.field),a=>[s.stem,a]))}))}function $fe(e,t){return lt(t,void 0,(r,n)=>{let i=D(K(n),{}),o=Og(i,e);return r!==void 0?o!==void 0?Math.max(r,o):r:o})}function Nfe(e,t){let r=D(T(e.markReadCommand,n=>n.aggregateIdField),"id");return bt([[r,t]])}function Dfe(e,t){let r=e.length,n=t.length,i=mD((r+1|0)*(n+1|0)|0,0),o=(u,d)=>i[(u*(n+1|0)|0)+d|0];for(let u=0;u<r;++u)for(let d=0;d<n;++d)i[((u+1|0)*(n+1|0)|0)+(d+1|0)|0]=e[u]===t[d]?o(u,d)+1|0:o(u,d+1|0)>o(u+1|0,d)?o(u,d+1|0):o(u+1|0,d);let s=[],a=r,l=n;for(;a>0||l>0;){let u=e[a-1|0],d=t[l-1|0];a>0&&l>0&&u===d?(s=[{kind:"Unchanged",text:u}].concat(s),a=a-1|0,l=l-1|0):l>0&&(a===0||o(a,l-1|0)>=o(a-1|0,l))?(s=[{kind:"Added",text:d}].concat(s),l=l-1|0):(s=[{kind:"Removed",text:u}].concat(s),a=a-1|0)}return s}function Vl(e){return"var("+e+")"}let Ffe=E([c("font-family",Vl($.fontFamilyMono)),c("font-size",Vl($.sizeSm)),c("line-height",Vl($.lineHeightNormal)),c("border","1px solid var("+y.border+")"),c("border-radius",Vl(X.md)),fl("auto")]),U_=E([L("flex"),c("padding","1px var("+F.md+")")]),Ife=E([c("background","rgba(248,81,73,0.12)"),c("color",Vl(y.error))]),Pfe=E([c("background","rgba(63,185,80,0.12)"),c("color",Vl(y.success))]),Ofe=E([c("color",Vl(y.textSecondary))]),Mfe=E([c("width","16px"),Li(0),c("user-select","none"),qD(ke(8))]);function Lfe(e){let t=e.before.split(`
57
- `),r=e.after.split(`
58
- `),n=Dfe(t,r);return b("div",{children:n.map((i,o)=>{let s=i.kind,a;switch(s){case"Removed":a=[U_+" "+Ife,"-"];break;case"Added":a=[U_+" "+Pfe,"+"];break;case"Unchanged":a=[U_+" "+Ofe," "];break}return M("div",{children:[b("span",{children:a[1],className:Mfe}),b("span",{children:i.text})],className:a[0]},o.toString())}),className:Ffe})}let zfe=Lfe;function jm(e,t){let r=new Date(t).getTime();if(Number.isNaN(r))return t;let n=(e-r)/1e3;return n<45?"just now":n<3600?Math.floor(n/60).toString()+"m ago":n<86400?Math.floor(n/3600).toString()+"h ago":n<1209600?Math.floor(n/86400).toString()+"d ago":t.slice(0,10)}function Jn(e){return"var("+e+")"}let Ufe=E([L("flex"),he("column"),c("gap","2px"),c("font-family",Jn($.fontFamily)),c("font-size",Jn($.sizeSm))]),cT=E([L("flex"),ee("flexStart"),c("gap","10px"),c("padding",Jn(F.xs)+" "+Jn(F.sm)),c("border-radius",Jn(X.sm))]),Bfe=E([we("pointer"),Ye([c("background",Jn(y.surfaceSubtle))])]),jfe=E([L("flex"),he("column"),c("gap","2px"),c("min-width","0"),c("flex","1")]),qfe=E([c("color",Jn(y.textPrimary))]),Vfe=E([c("font-weight",Jn($.weightMedium))]),Kfe=E([c("color",Jn(y.textSecondary))]),Hfe=E([L("inlineFlex"),ee("center"),c("gap","6px"),c("color",Jn(y.textSecondary)),c("font-size",Jn($.sizeXs)),c("white-space","nowrap")]),Wfe=E([L("inlineBlock"),c("width","8px"),c("height","8px"),c("border-radius","50%"),c("flex-shrink","0")]),Gfe=E([c("background","none"),c("border","none"),c("padding","0"),c("color",Jn(y.brand)),c("font-size",Jn($.sizeXs)),we("pointer"),c("text-align","left"),Ye([c("text-decoration","underline")])]),Jfe=E([c("margin-top","4px"),c("max-width","560px")]),Qfe=E([c("color",Jn(y.textSecondary)),c("padding",Jn(F.md)),sa("center")]);function Yfe(e){let t=e.onClick,r=e.entry,n=oe(()=>!1),i=n[1],o=n[0],s=We(r.before)&&We(r.after),a=D(r.actor,r.subject),l=t!==void 0?cT+" "+Bfe:cT,u=r.actor,d=r.accent,f=r.timestamp;return M("div",{children:[b(ad,{name:a,src:r.actorImageUrl,size:"Medium"}),M("div",{children:[M("span",{children:[u!==void 0?b("span",{children:u+" ",className:Vfe}):null,b("span",{children:r.verb+" ",className:Kfe}),r.subject],className:qfe}),M("span",{children:[d!==void 0?b("span",{className:Wfe,style:{background:d}}):null,f!==void 0?jm(e.nowMs,f):null],className:Hfe}),s?b("button",{children:o?"Hide changes":"Show changes",className:Gfe,onClick:h=>{h.stopPropagation(),i(p=>!p)}}):null,o&&s?b("div",{children:b(zfe,{before:D(r.before,""),after:D(r.after,"")}),className:Jfe}):null],className:jfe})],className:l,onClick:h=>ie(t,p=>p(r))})}function Xfe(e){let t=e.nowMs,r=e.onEntryClick,n=e.emptyLabel,i=e.entries,o=n!==void 0?n:"No activity yet",s=t!==void 0?t:Date.now();return i.length===0?b("div",{children:o,className:Qfe}):b("div",{children:i.map(a=>b(Yfe,{entry:a,nowMs:s,onClick:r},a.id)),className:Ufe})}let Zfe=Xfe;function $t(e){return"var("+e+")"}let ehe=E([Ot("relative"),L("inlineBlock")]),the=E([Ot("relative"),L("inlineFlex"),ee("center"),Qe("center"),c("background","none"),c("border","none"),c("border-radius",$t(X.md)),c("cursor","pointer"),c("color",$t(y.textSecondary)),c("padding","6px"),Ye([c("background",$t(y.surfaceSubtle)),c("color",$t(y.textPrimary))])]),rhe=E([Ot("absolute"),aa(ke(0)),hl(ke(0)),L("inlineFlex"),ee("center"),Qe("center"),c("min-width","16px"),c("height","16px"),c("padding","0 4px"),c("border-radius",$t(X.full)),c("background",$t(y.brand)),c("color",$t(y.textOnBrand)),c("font-family",$t($.fontFamily)),c("font-size","10px"),c("font-weight",$t($.weightBold)),c("line-height","1")]),nhe=E([Ot("absolute"),hl(ke(0)),aa({NAME:"percent",VAL:100}),xs(ke(4)),c("width","320px"),c("background",$t(y.surfaceElevated)),c("border","1px solid var("+y.border+")"),c("border-radius",$t(X.md)),c("box-shadow",$t(pn.md)),c("z-index","200"),c("overflow","hidden"),c("font-family",$t($.fontFamily))]),ihe=E([L("flex"),ee("center"),Qe("spaceBetween"),c("padding","var("+F.sm+") var("+F.md+")"),c("border-bottom","1px solid var("+y.borderSubtle+")"),c("color",$t(y.textSecondary)),c("font-size",$t($.sizeSm)),c("font-weight",$t($.weightMedium)),c("text-transform","uppercase"),c("letter-spacing","0.04em")]),ohe=E([c("background","none"),c("border","none"),c("color",$t(y.brand)),c("font-size",$t($.sizeXs)),c("text-transform","none"),c("letter-spacing","0"),we("pointer"),Ye([c("text-decoration","underline")])]),she=E([c("max-height","360px"),c("overflow-y","auto")]);function ahe(e){return E([L("flex"),ee("flexStart"),c("gap",$t(F.sm)),c("width","100%"),c("background","none"),c("border","none"),c("border-bottom","1px solid var("+y.borderSubtle+")"),c("text-align","left"),c("padding","var("+F.sm+") var("+F.md+")"),we(e?"pointer":"default"),Ye(e?[c("background",$t(y.surfaceSubtle))]:[])])}function lhe(e){return E([c("width","8px"),c("height","8px"),c("border-radius",$t(X.full)),c("margin-top","5px"),c("flex-shrink","0"),c("background",e?"transparent":$t(y.brand))])}let uhe=E([L("flex"),he("column"),c("gap","2px"),c("min-width","0")]);function che(e){return E([c("color",$t(y.textPrimary)),c("font-size",$t($.sizeSm)),c("font-weight",$t(e?$.weightNormal:$.weightMedium)),c("line-height",$t($.lineHeightNormal)),c("word-break","break-word")])}let dhe=E([c("color",$t(y.textDisabled)),c("font-size",$t($.sizeXs))]),fhe=E([c("color",$t(y.textDisabled)),c("font-size",$t($.sizeSm)),c("padding",$t(F.md)),c("text-align","center")]);function hhe(e){return M("svg",{children:[b("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),b("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})],"aria-hidden":!0,height:"18",width:"18",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24"})}function phe(e){let t=e.defaultOpen,r=e.nowMs,n=e.emptyLabel,i=e.onPanelOpen,o=e.onMarkAllRead,s=e.onOpen,a=e.notifications,l=n!==void 0?n:"No notifications",u=t!==void 0?t:!1,d=r!==void 0?r:Date.now(),f=oe(()=>u),h=f[1],p=f[0],g=a.filter(v=>!v.read).length;Re(()=>{if(!p)return;let v=x=>h(w=>!1),_=x=>{if(x.key==="Escape")return h(w=>!1)};return document.addEventListener("click",v),document.addEventListener("keydown",_),()=>{document.removeEventListener("click",v),document.removeEventListener("keydown",_)}},[p]);let m=()=>{let v=!p;v&&ie(i,_=>_()),h(_=>v)};return M("div",{children:[M("button",{children:[b(hhe,{}),g>0?b("span",{children:g>99?"99+":g.toString(),className:rhe}):null],"aria-label":g>0?"Notifications ("+g.toString()+" unread)":"Notifications",className:the,title:"Notifications",type:"button",onClick:v=>{v.stopPropagation(),m()}}),p?M("div",{children:[M("div",{children:["Notifications",o!==void 0&&g>0?b("button",{children:"Mark all read",className:ohe,type:"button",onClick:v=>o()}):null],className:ihe}),a.length===0?b("div",{children:l,className:fhe}):b("div",{children:a.map(v=>{let _=v.timestamp;return M("button",{children:[b("span",{className:lhe(v.read)}),M("span",{children:[b("span",{children:v.message,className:che(v.read)}),_!==void 0?b("span",{children:jm(d,_),className:dhe}):null],className:uhe})],className:ahe(We(s)),type:"button",onClick:x=>{ie(s,w=>w(v)),h(w=>!1)}},v.id)}),className:she})],className:nhe,onClick:v=>{v.stopPropagation()}}):null],className:ehe})}let ghe=phe,n4=mr([]),i4=mr(e=>{}),mhe=n4.Provider,vhe=i4.Provider;function _he(e){let t=e.initial,r=t!==void 0?t:[],n=oe(()=>r),i=n[1],o=Jr(s=>i(a=>s),[]);return Ar(vhe,{value:o,children:Ar(mhe,{value:n[0],children:e.children})})}let bhe={make:_he};function yhe(){return Ut(n4)}function xhe(){return Ut(i4)}function o4(e){return"autoui.notifications.seen."+e}function She(e){let t=localStorage.getItem(o4(e));if(t!=null)return Ya(t)}function Ehe(e,t){localStorage.setItem(o4(e),t.toString())}function whe(e){let t=e.onData,r=_u(e.binding.readModel,void 0);return Re(()=>{t({rows:r.rows,refetch:r.refetch})},[r.rows]),null}function khe(e){let t=yhe(),r=ml(),n=po(),i=pl(),o=dl(),s=oe(()=>({})),a=s[1],l=s[0],d=oe(()=>0)[1],f=S=>(k=>a(A=>{let C=bt(et(A));return C[S]=k,C})),h=W(T(r,S=>S.identity),S=>({userId:S.userId,username:S.username})),p=t.flatMap(S=>{let k=fe(O(l,S.pluginId),[],A=>A.rows);return Tfe(S.binding,k,h,She(S.pluginId)).map(A=>({key:S.pluginId+":"+A.id,appBinding:S,entry:A}))}).toSorted((S,k)=>{let A=T(S.entry.timestamp,Mi),C=T(k.entry.timestamp,Mi);return A!==void 0?C!==void 0?C-A:-1:C!==void 0?1:0}),g=(S,k)=>{let A=S.binding.markReadCommand;if(A!==void 0&&n!==void 0){qt(n(A.mutationDocument,Nfe(S.binding,k)).then(C=>{if(typeof Zc(C)!="object"){let N=S.pluginId;return ie(O(l,N),I=>I.refetch())}}),C=>Promise.resolve());return}},m=S=>ie(p.find(k=>k.key===S.id),k=>{k.entry.read||g(k.appBinding,k.entry.id);let A=k.entry;ie(T9(A.refs,C=>{let R=C[1];return W(ua(i,C[0]),N=>[N,R])}),C=>{let R=C[0];o(ea(R.pluginId,R.name,C[1],[]))})}),v=We(n)&&t.some(S=>We(S.binding.markReadCommand)),_=()=>{p.forEach(S=>{if(!S.entry.read)return g(S.appBinding,S.entry.id)})},x=()=>{t.forEach(S=>{let k=fe(O(l,S.pluginId),[],A=>A.rows);ie($fe(S.binding,k),A=>Ehe(S.pluginId,A))}),d(S=>S+1|0)},w=p.map(S=>({id:S.key,message:S.entry.message,timestamp:S.entry.timestamp,read:S.entry.read}));return t.length===0?null:M(qr,{children:[t.map(S=>b(whe,{binding:S.binding,onData:f(S.pluginId)},S.pluginId)),b(ghe,{notifications:w,onOpen:m,onMarkAllRead:v?_:void 0,onPanelOpen:x})]})}let Che=khe;function Rhe(e,t,r){if(e===void 0)return!0;let n=t.toLowerCase(),i=r.toLowerCase();return e.split(",").map(o=>o.trim().toLowerCase()).filter(o=>o!=="").some(o=>o.startsWith(".")?n.endsWith(o):o.endsWith("/*")?i.startsWith(o.slice(0,o.length-1|0)):i===o)}function Ahe(e){let t=["B","KB","MB","GB"],n=((a,l)=>{for(;;){let u=l,d=a;if(!(d>=1024&&u<(t.length-1|0)))return[d,u];l=u+1|0,a=d/1024}})(e<0?0:e,0),i=n[1],o=n[0];return(i===0?Math.round(o).toString():(Math.round(o*10)/10).toString())+" "+t[i]}function In(e){return"var("+e+")"}let dT=E([L("flex"),he("column"),ee("center"),Qe("center"),c("gap","6px"),c("padding",In(F.lg)),c("border","2px dashed var("+y.border+")"),c("border-radius",In(X.md)),c("color",In(y.textSecondary)),c("font-family",In($.fontFamily)),c("font-size",In($.sizeSm)),we("pointer"),c("transition","border-color 120ms, background 120ms"),sa("center")]),The=E([c("border-color",In(y.brand)),c("background",In(y.brandSubtle))]),$he=E([c("font-size",In($.sizeXs))]),Nhe=E([L("flex"),ee("center"),c("gap","8px"),c("padding",In(F.xs)+" 0"),c("font-family",In($.fontFamily)),c("font-size",In($.sizeSm)),c("color",In(y.textPrimary))]),Dhe=E([c("flex","1"),c("min-width","0"),c("overflow","hidden"),c("text-overflow","ellipsis"),c("white-space","nowrap")]),Fhe=E([c("color",In(y.textSecondary)),c("font-size",In($.sizeXs)),c("white-space","nowrap")]),Ihe=E([c("color",In(y.success))]),fT=E([c("color",In(y.error))]),Phe=E([c("width","120px")]);function Ohe(e){let t=e.onUploaded,r=e.label,n=e.multiple,i=e.accept,o=e.adapter,s=n!==void 0?n:!0,a=r!==void 0?r:"Drop files here or click to browse",l=oe(()=>[]),u=l[1],d=oe(()=>!1),f=d[1],h=Je(null),p=Je(0),g=(k,A)=>u(C=>C.map(R=>R.key===k?{key:R.key,name:R.name,size:R.size,status:A}:R)),m=k=>{p.current=p.current+1|0;let A=p.current.toString()+":"+k.name,C=Rhe(i,k.name,k.type),R=C?{TAG:"Uploading",_0:0}:{TAG:"Rejected",_0:"File type not accepted"};if(u(N=>N.concat([{key:A,name:k.name,size:k.size,status:R}])),C){qt(o.upload(k,N=>g(A,{TAG:"Uploading",_0:N})).then(N=>{if(N.TAG==="Ok"){let I=N._0;g(A,{TAG:"Done",_0:I}),ie(t,P=>P(k.name,I))}else g(A,{TAG:"Failed",_0:N._0});return Promise.resolve()}),N=>(g(A,{TAG:"Failed",_0:"Upload failed"}),Promise.resolve()));return}},v=k=>{(s?k:k.slice(0,1)).forEach(m)},_=k=>{k.preventDefault(),f(C=>!1);let A=k.dataTransfer;if(A!=null)return v(Array.from(A.files))},x=k=>{let A=k.target.files;A!=null&&v(Array.from(A)),k.target.value=""},w=()=>ie(ms(h.current),k=>k.click()),S=d[0]?dT+" "+The:dT;return M("div",{children:[M("div",{children:[b("span",{children:a}),i!==void 0?b("span",{children:"Accepted: "+i,className:$he}):null],className:S,role:"button",onClick:k=>w(),onDragLeave:k=>f(A=>!1),onDragOver:k=>{k.preventDefault(),f(A=>!0)},onDrop:_}),b("input",{ref:pr(h),style:{display:"none"},accept:i,multiple:s,type:"file",onChange:x}),l[0].map(k=>{let A=k.status,C;switch(A.TAG){case"Uploading":C=b("span",{children:b(EF,{value:A._0,showValue:!1}),className:Phe});break;case"Done":C=b("span",{children:"Uploaded",className:Ihe});break;case"Rejected":C=b("span",{children:"Rejected",className:fT,title:A._0});break;case"Failed":C=b("span",{children:"Failed",className:fT,title:A._0});break}return M("div",{children:[b("span",{children:k.name,className:Dhe,title:k.name}),b("span",{children:Ahe(k.size),className:Fhe}),C],className:Nhe},k.key)})]})}let Mhe=Ohe;function Lhe(e){if(e==="")return[];let t;try{t=Vt(JSON.parse(e))}catch{return[e]}return t!==void 0?se(t,ce):[e]}function zhe(e){let t=e.onChange,r=e.value,n=e.multiple,i=Je(n?Lhe(r):r===""?[]:[r]),o=(s,a)=>{let l=n?i.current.concat([a]):[a];i.current=l,t(n?JSON.stringify(l.map(u=>u)):a)};return b(Mhe,{adapter:e.adapter,accept:e.accept,multiple:n,onUploaded:o})}function Uhe(e,t,r,n){if(n&&r==="")return"Required"}function Bhe(e,t,r){let n=!1,i=(s,a,l,u,d,f,h)=>b(zhe,{adapter:e,accept:t,multiple:n,value:l,onChange:u}),o=s=>{let l={...D(Yee(s),{cell:(u,d,f)=>{},detail:(u,d,f)=>{}})};Or(s,(l.validateInput=Uhe,l.input=i,l))};o("File"),o("Image")}var jhe={FRAGMENT:"Fragment",INLINE_DATA_FRAGMENT:"InlineDataFragment",LINKED_FIELD:"LinkedField",LITERAL:"Literal",LIST_VALUE:"ListValue",RELAY_LIVE_RESOLVER:"RelayLiveResolver",OBJECT_VALUE:"ObjectValue",REQUEST:"Request",SCALAR_FIELD:"ScalarField",SPLIT_OPERATION:"SplitOperation",UPDATABLE_QUERY:"UpdatableQuery",VARIABLE:"Variable"},$u=jhe,qhe=function(e,t,r,n,i,o,s,a){if(!e){var l;if(t===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,i,o,s,a],d=0;l=new Error(t.replace(/%s/g,function(){return u[d++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},De=qhe;function qm(e){return function(){return e}}var kd=function(){};kd.thatReturns=qm;kd.thatReturnsFalse=qm(!1);kd.thatReturnsTrue=qm(!0);kd.thatReturnsNull=qm(null);kd.thatReturnsThis=function(){return this};kd.thatReturnsArgument=function(e){return e};var Vm=$u,ep=De;function Vhe(e){ep(!1)}function fa(e){var t=e;return typeof t=="function"?t=t():t.default&&(t=t.default),t}function s4(e){var t=fa(e);return typeof t=="object"&&t!==null&&t.kind===Vm.FRAGMENT}function a4(e){var t=fa(e);return typeof t=="object"&&t!==null&&t.kind===Vm.REQUEST}function Khe(e){var t=fa(e);return typeof t=="object"&&t!==null&&t.kind===Vm.UPDATABLE_QUERY}function l4(e){var t=fa(e);return typeof t=="object"&&t!==null&&t.kind===Vm.INLINE_DATA_FRAGMENT}function YE(e){var t=fa(e);return s4(t)||ep(!1),t}function Hhe(e){var t,r=YE(e),n=(t=r.metadata)===null||t===void 0?void 0:t.refetch,i=n?.connection;return n===null||typeof n!="object"||i===null||typeof i!="object"?null:r}function Whe(e){var t,r=YE(e),n=(t=r.metadata)===null||t===void 0?void 0:t.refetch;return n===null||typeof n!="object"?null:r}function Ghe(e){var t=fa(e);return a4(t)||ep(!1),t}function Jhe(e){var t=fa(e);return Khe(t)||ep(!1),t}function Qhe(e){var t=fa(e);return l4(t)||ep(!1),t}var Wo={getFragment:YE,getNode:fa,getPaginationFragment:Hhe,getRefetchableFragment:Whe,getRequest:Ghe,getUpdatableQuery:Jhe,getInlineDataFragment:Qhe,graphql:Vhe,isFragment:s4,isRequest:a4,isInlineDataFragment:l4},u4={exports:{}};(function(e){function t(r){return r&&r.__esModule?r:{default:r}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(u4);var Ke=u4.exports,c4={exports:{}},d4={exports:{}},f4={exports:{}},h4={exports:{}};(function(e){function t(r){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(h4);var p4=h4.exports,g4={exports:{}};(function(e){var t=p4.default;function r(n,i){if(t(n)!="object"||!n)return n;var o=n[Symbol.toPrimitive];if(o!==void 0){var s=o.call(n,i||"default");if(t(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(g4);var Yhe=g4.exports;(function(e){var t=p4.default,r=Yhe;function n(i){var o=r(i,"string");return t(o)=="symbol"?o:o+""}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(f4);var m4=f4.exports;(function(e){var t=m4;function r(n,i,o){return(i=t(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o,n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(d4);var Xn=d4.exports;(function(e){var t=Xn;function r(i,o){var s=Object.keys(i);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(i);o&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable})),s.push.apply(s,a)}return s}function n(i){for(var o=1;o<arguments.length;o++){var s=arguments[o]!=null?arguments[o]:{};o%2?r(Object(s),!0).forEach(function(a){t(i,a,s[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(s)):r(Object(s)).forEach(function(a){Object.defineProperty(i,a,Object.getOwnPropertyDescriptor(s,a))})}return i}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(c4);var Bt=c4.exports,v4={exports:{}},_4={exports:{}},b4={exports:{}};(function(e){function t(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,o=Array(n);i<n;i++)o[i]=r[i];return o}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(b4);var y4=b4.exports;(function(e){var t=y4;function r(n,i){if(n){if(typeof n=="string")return t(n,i);var o={}.toString.call(n).slice(8,-1);return o==="Object"&&n.constructor&&(o=n.constructor.name),o==="Map"||o==="Set"?Array.from(n):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?t(n,i):void 0}}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(_4);var x4=_4.exports;(function(e){var t=x4;function r(n,i){var o=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!o){if(Array.isArray(n)||(o=t(n))||i&&n&&typeof n.length=="number"){o&&(n=o);var s=0,a=function(){};return{s:a,n:function(){return s>=n.length?{done:!0}:{done:!1,value:n[s++]}},e:function(h){throw h},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
59
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,u=!0,d=!1;return{s:function(){o=o.call(n)},n:function(){var h=o.next();return u=h.done,h},e:function(h){d=!0,l=h},f:function(){try{u||o.return==null||o.return()}finally{if(d)throw l}}}}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(v4);var Tr=v4.exports,S4=Ke.default,hT=S4(Bt),pT=S4(Tr),Xhe=De;function Zhe(e,t,r){var n=(0,pT.default)(t),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;e.relayFieldLogger((0,hT.default)((0,hT.default)({},o),{},{uiContext:r}))}}catch(u){n.e(u)}finally{n.f()}var s=(0,pT.default)(t),a;try{for(s.s();!(a=s.n()).done;){var l=a.value;if(E4(l))switch(l.kind){case"relay_resolver.error":throw new Error("Relay: Resolver error at path '".concat(l.fieldPath,"' in '").concat(l.owner,"'. Message: ").concat(l.error.message));case"relay_field_payload.error":throw new Error("Relay: Unexpected response payload - check server logs for details.");case"missing_expected_data.throw":throw new Error("Relay: Missing expected data at path '".concat(l.fieldPath,"' in '").concat(l.owner,"'."));case"missing_required_field.throw":throw new Error("Relay: Missing @required value at path '".concat(l.fieldPath,"' in '").concat(l.owner,"'."));case"missing_required_field.log":case"missing_expected_data.log":break;default:l.kind,Xhe(!1)}}}catch(u){s.e(u)}finally{s.f()}}function E4(e){switch(e.kind){case"relay_resolver.error":case"relay_field_payload.error":return e.shouldThrow&&!e.handled;case"missing_expected_data.throw":case"missing_required_field.throw":return!e.handled;case"missing_required_field.log":case"missing_expected_data.log":return!1;default:throw e.kind,new Error("Relay: Unexpected event kind")}}function epe(e,t,r){t!=null&&Zhe(e,t,r)}var tp={handlePotentialSnapshotErrors:epe,eventShouldThrow:E4},w4={exports:{}},k4={exports:{}};(function(e){var t=y4;function r(n){if(Array.isArray(n))return t(n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(k4);var tpe=k4.exports,C4={exports:{}};(function(e){function t(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(C4);var rpe=C4.exports,R4={exports:{}};(function(e){function t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
60
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(R4);var npe=R4.exports;(function(e){var t=tpe,r=rpe,n=x4,i=npe;function o(s){return t(s)||r(s)||n(s)||i()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports})(w4);var vl=w4.exports,A4={DEFAULT_HANDLE_KEY:""},ipe=A4,ope=ipe.DEFAULT_HANDLE_KEY,spe=De;function ape(e,t,r){return t&&t!==ope?"__".concat(t,"_").concat(e):(r==null&&spe(!1),"__".concat(r,"_").concat(e))}var T4=ape,lpe={ENABLE_VARIABLE_CONNECTION_KEY:!1,ENABLE_RELAY_RESOLVERS:!1,ENABLE_GETFRAGMENTIDENTIFIER_OPTIMIZATION:!1,ENABLE_FRIENDLY_QUERY_NAME_GQL_URL:!1,ENABLE_DO_NOT_WRAP_LIVE_QUERY:!1,ENABLE_NOTIFY_SUBSCRIPTION:!1,BATCH_ASYNC_MODULE_UPDATES_FN:null,ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT:!1,MAX_DATA_ID_LENGTH:null,STRING_INTERN_LEVEL:0,LOG_MISSING_RECORDS_IN_PROD:!1,ENABLE_STORE_ID_COLLISION_LOGGING:!1,ENABLE_NONCOMPLIANT_ERROR_HANDLING_ON_LISTS:!1,ENABLE_LOOSE_SUBSCRIPTION_ATTRIBUTION:!1,ENABLE_OPERATION_TRACKER_OPTIMISTIC_UPDATES:!1,ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE:!1,PROCESS_OPTIMISTIC_UPDATE_BEFORE_SUBSCRIPTION:!1,MARK_RESOLVER_VALUES_AS_CLEAN_AFTER_FRAGMENT_REREAD:!1,ENABLE_CYLE_DETECTION_IN_VARIABLES:!1,ENABLE_ACTIVITY_COMPATIBILITY:!1,ENABLE_READ_TIME_RESOLVER_STORAGE_KEY_PREFIX:!0,ENABLE_USE_PAGINATION_IS_LOADING_FIX:!1,DISALLOW_NESTED_UPDATES:!1,ENABLE_TYPENAME_PREFIXED_DATA_ID:!1,ENABLE_UI_CONTEXT_ON_RELAY_LOGGER:!1,CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES:!1},go=lpe;function w1(e){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(w1);for(var t=Object.keys(e).sort(),r={},n=0;n<t.length;n++)r[t[n]]=w1(e[t[n]]);return r}function $4(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Set;if(!e||typeof e!="object")return!1;if(t.has(e))return!0;var r=new Set(t);r.add(e);var n=Array.isArray(e)?e:Object.values(e);return n.some(function(i){return $4(i,r)})}var Nu={stableCopy:w1,hasCycle:$4},upe=Ke.default,cpe=upe(vl),dpe=T4,Km=$u,fpe=go,hpe=Nu,N4=hpe.stableCopy,ppe=De,gpe=Km.VARIABLE,mpe=Km.LITERAL,vpe=Km.OBJECT_VALUE,_pe=Km.LIST_VALUE,bpe="__errors",ype="__module_component_",xpe="__module_operation_";function k1(e,t){if(e.kind===gpe)return Cpe(e.variableName,t);if(e.kind===mpe)return e.value;if(e.kind===vpe){var r={};return e.fields.forEach(function(i){r[i.name]=k1(i,t)}),r}else if(e.kind===_pe){var n=[];return e.items.forEach(function(i){i!=null&&n.push(k1(i,t))}),n}}function XE(e,t,r){var n={};return r&&(n[F4.FRAGMENT_POINTER_IS_WITHIN_UNMATCHED_TYPE_REFINEMENT]=!0),e&&e.forEach(function(i){n[i.name]=k1(i,t)}),n}function Spe(e,t){var r=e.dynamicKey,n=e.handle,i=e.key,o=e.name,s=e.args,a=e.filters,l=dpe(n,i,o),u=null;return s&&a&&s.length!==0&&a.length!==0&&(u=s.filter(function(d){return a.indexOf(d.name)>-1})),r&&(u=u!=null?[r].concat((0,cpe.default)(u)):[r]),u===null?l:ZE(l,XE(u,t))}function D4(e,t){if(e.storageKey)return e.storageKey;var r=wpe(e),n=e.name;return r&&r.length!==0?ZE(n,XE(r,t)):n}function Epe(e,t){var r=D4(e,t);return fpe.ENABLE_READ_TIME_RESOLVER_STORAGE_KEY_PREFIX?"$r:"+r:r}function wpe(e){if(e.kind==="RelayResolver"||e.kind==="RelayLiveResolver"){var t;if(e.args==null){var r;return(r=e.fragment)===null||r===void 0?void 0:r.args}return((t=e.fragment)===null||t===void 0?void 0:t.args)==null?e.args:e.args.concat(e.fragment.args)}var n=typeof e.args>"u"?void 0:e.args;return n}function kpe(e,t){return ZE(e,N4(t))}function ZE(e,t){if(!t)return e;var r=[];for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];if(i!=null){var o;r.push(n+":"+((o=JSON.stringify(i))!==null&&o!==void 0?o:"undefined"))}}return r.length===0?e:e+"(".concat(r.join(","),")")}function Cpe(e,t){return t.hasOwnProperty(e)||ppe(!1),N4(t[e])}function Rpe(e){return"".concat(ype).concat(e)}function Ape(e){return"".concat(xpe).concat(e)}var F4={ACTOR_IDENTIFIER_KEY:"__actorIdentifier",CLIENT_EDGE_TRAVERSAL_PATH:"__clientEdgeTraversalPath",FRAGMENTS_KEY:"__fragments",FRAGMENT_OWNER_KEY:"__fragmentOwner",FRAGMENT_POINTER_IS_WITHIN_UNMATCHED_TYPE_REFINEMENT:"$isWithinUnmatchedTypeRefinement",FRAGMENT_PROP_NAME_KEY:"__fragmentPropName",MODULE_COMPONENT_KEY:"__module_component",ERRORS_KEY:bpe,ID_KEY:"__id",REF_KEY:"__ref",REFS_KEY:"__refs",ROOT_ID:"client:root",ROOT_TYPE:"__Root",TYPENAME_KEY:"__typename",INVALIDATED_AT_KEY:"__invalidated_at",RELAY_RESOLVER_VALUE_KEY:"__resolverValue",RELAY_RESOLVER_INVALIDATION_KEY:"__resolverValueMayBeInvalid",RELAY_RESOLVER_SNAPSHOT_KEY:"__resolverSnapshot",RELAY_RESOLVER_ERROR_KEY:"__resolverError",RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS:"__resolverOutputTypeRecordIDs",getArgumentValues:XE,getHandleStorageKey:Spe,getStorageKey:D4,getReadTimeResolverStorageKey:Epe,getStableStorageKey:kpe,getModuleComponentKey:Rpe,getModuleOperationKey:Ape},rr=F4,Tpe=Ke.default,I4=Tpe(Bt),$pe=rr,Npe=$pe.getArgumentValues,Dpe=De;function Fpe(e,t,r){if(e.argumentDefinitions==null)return r;var n;return e.argumentDefinitions.forEach(function(i){if(!r.hasOwnProperty(i.name))switch(n=n||(0,I4.default)({},r),i.kind){case"LocalArgument":n[i.name]=i.defaultValue;break;case"RootArgument":if(!t.hasOwnProperty(i.name)){n[i.name]=void 0;break}n[i.name]=t[i.name];break;default:Dpe(!1)}}),n||r}function Ipe(e,t,r){var n={};return e.argumentDefinitions.forEach(function(i){var o=i.defaultValue;r[i.name]!=null&&(o=r[i.name]),n[i.name]=o}),t!=null&&Object.keys(t).forEach(function(i){n[i]=t[i].get()}),n}function Ppe(e,t,r){if(t==null)return e;var n=(0,I4.default)({},e),i=r?Npe(r,e):{};return t.forEach(function(o){var s,a=(s=i[o.name])!==null&&s!==void 0?s:o.defaultValue;n[o.name]=a}),n}var _l={getLocalVariables:Ppe,getFragmentVariables:Fpe,getOperationVariables:Ipe},B_=[],j_=[];/**
61
- * Checks if two values are equal. Values may be primitives, arrays, or objects.
62
- * Returns true if both arguments have the same keys and values.
63
- *
64
- * @see http://underscorejs.org
65
- * @copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
66
- * @license MIT
67
- */function Ope(e,t){var r=B_.length?B_.pop():[],n=j_.length?j_.pop():[],i=C1(e,t,r,n);return r.length=0,n.length=0,B_.push(r),j_.push(n),i}function C1(e,t,r,n){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;var i=Object.prototype.toString,o=i.call(e);if(o!=i.call(t))return!1;switch(o){case"[object String]":return e==String(t);case"[object Number]":return isNaN(e)||isNaN(t)?!1:e==Number(t);case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}for(var s=r.length;s--;)if(r[s]==e)return n[s]==t;r.push(e),n.push(t);var a=0;if(o==="[object Array]"){if(a=e.length,a!==t.length)return!1;for(;a--;)if(!C1(e[a],t[a],r,n))return!1}else{if(e.constructor!==t.constructor)return!1;if(e.hasOwnProperty("valueOf")&&t.hasOwnProperty("valueOf"))return e.valueOf()==t.valueOf();var l=Object.keys(e);if(l.length!=Object.keys(t).length)return!1;for(var u=0;u<l.length;u++)if(!C1(e[l[u]],t[l[u]],r,n))return!1}return r.pop(),n.pop(),!0}var ha=Ope,Mpe=_l,Lpe=Mpe.getFragmentVariables,rp=rr,zpe=rp.CLIENT_EDGE_TRAVERSAL_PATH,Upe=rp.FRAGMENT_OWNER_KEY,Bpe=rp.FRAGMENT_POINTER_IS_WITHIN_UNMATCHED_TYPE_REFINEMENT,jpe=rp.FRAGMENTS_KEY,P4=rp.ID_KEY,O4=ha,sl=De;function Hm(e,t){typeof t=="object"&&t!==null&&!Array.isArray(t)||sl(!1);var r=t[P4],n=t[jpe],i=t[Upe],o=t[zpe];if(typeof r=="string"&&typeof n=="object"&&n!==null&&typeof n[e.name]=="object"&&n[e.name]!==null&&typeof i=="object"&&i!==null&&(o==null||Array.isArray(o))){var s=i,a=o,l=n[e.name],u=Lpe(e,s.variables,l),d=l[Bpe]===!0;return q4(e,r,u,s,d,a)}return null}function M4(e,t){var r=null;return t.forEach(function(n,i){var o=n!=null?Hm(e,n):null;o!=null&&(r=r||[],r.push(o))}),r==null?null:{kind:"PluralReaderSelector",selectors:r}}function L4(e,t){return t==null?t:e.metadata&&e.metadata.plural===!0?(Array.isArray(t)||sl(!1),M4(e,t)):(Array.isArray(t)&&sl(!1),Hm(e,t))}function qpe(e,t){var r={};for(var n in e)if(e.hasOwnProperty(n)){var i=e[n],o=t[n];r[n]=L4(i,o)}return r}function Vpe(e,t){var r={};for(var n in e)if(e.hasOwnProperty(n)){var i=e[n],o=t[n];r[n]=z4(i,o)}return r}function z4(e,t){return t==null?t:e.metadata&&e.metadata.plural===!0?(Array.isArray(t)||sl(!1),Kpe(e,t)):(Array.isArray(t)&&sl(!1),U4(e,t))}function Kpe(e,t){var r=null;return t.forEach(function(n){var i=n!=null?U4(e,n):null;i!=null&&(r=r||[],r.push(i))}),r}function U4(e,t){typeof t=="object"&&t!==null&&!Array.isArray(t)||sl(!1);var r=t[P4];return typeof r=="string"?r:null}function Hpe(e,t){var r={};for(var n in e)if(e.hasOwnProperty(n)){var i=e[n],o=t[n],s=B4(i,o);Object.assign(r,s)}return r}function B4(e,t){var r;return t==null?{}:((r=e.metadata)===null||r===void 0?void 0:r.plural)===!0?(Array.isArray(t)||sl(!1),j4(e,t)):(Array.isArray(t)&&sl(!1),ew(e,t)||{})}function ew(e,t){var r=Hm(e,t);return r?r.variables:null}function j4(e,t){var r={};return t.forEach(function(n,i){if(n!=null){var o=ew(e,n);o!=null&&Object.assign(r,o)}}),r}function gT(e,t){return e.dataID===t.dataID&&e.node===t.node&&O4(e.variables,t.variables)&&Wpe(e.owner,t.owner)&&e.isWithinUnmatchedTypeRefinement===t.isWithinUnmatchedTypeRefinement&&Gpe(e.clientEdgeTraversalPath,t.clientEdgeTraversalPath)}function Wpe(e,t){return e===t?!0:e.identifier===t.identifier&&O4(e.cacheConfig,t.cacheConfig)}function Gpe(e,t){if(e===t)return!0;if(e==null||t==null||e.length!==t.length)return!1;for(var r=e.length;r--;){var n=e[r],i=t[r];if(n!==i&&(n==null||i==null||n.clientEdgeDestinationID!==i.clientEdgeDestinationID||n.readerClientEdge!==i.readerClientEdge))return!1}return!0}function Jpe(e,t){return e===t?!0:e==null?t==null:t==null?e==null:e.kind==="SingularReaderSelector"&&t.kind==="SingularReaderSelector"?gT(e,t):e.kind==="PluralReaderSelector"&&t.kind==="PluralReaderSelector"?e.selectors.length===t.selectors.length&&e.selectors.every(function(r,n){return gT(r,t.selectors[n])}):!1}function q4(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,o=arguments.length>5?arguments[5]:void 0;return{kind:"SingularReaderSelector",dataID:t,isWithinUnmatchedTypeRefinement:i,clientEdgeTraversalPath:o??null,node:e,variables:r,owner:n}}function Qpe(e,t,r){return{dataID:t,node:e,variables:r}}var Go={areEqualSelectors:Jpe,createReaderSelector:q4,createNormalizationSelector:Qpe,getDataIDsFromFragment:z4,getDataIDsFromObject:Vpe,getSingularSelector:Hm,getPluralSelector:M4,getSelector:L4,getSelectorsFromObject:qpe,getVariablesFromSingularFragment:ew,getVariablesFromPluralFragment:j4,getVariablesFromFragment:B4,getVariablesFromObject:Hpe},Ype=Wo,Xpe=Ype.getFragment,Zpe=tp,e0e=Zpe.eventShouldThrow,t0e=Go,r0e=t0e.getSelector,mT=De,$f=[];function n0e(e,t){$f.push(e);try{return t()}finally{$f.pop()}}function i0e(e,t){if(!$f.length)throw new Error("readFragment should be called only from within a Relay Resolver function.");var r=$f[$f.length-1],n=Xpe(e),i=r0e(n,t);i==null&&mT(!1),i.kind!=="SingularReaderSelector"&&mT(!1);var o=r.getDataForResolverFragment(i,t),s=o.data,a=o.isMissingData,l=o.fieldErrors;if(a||l!=null&&l.some(e0e))throw V4;return s}var V4={},tw={readFragment:i0e,withResolverContext:n0e,RESOLVER_FRAGMENT_ERRORED_SENTINEL:V4},o0e=tw;o0e.readFragment;var K4={exports:{}};(function(e){function t(n,i,o,s,a,l,u){try{var d=n[l](u),f=d.value}catch(h){return void o(h)}d.done?i(f):Promise.resolve(f).then(s,a)}function r(n){return function(){var i=this,o=arguments;return new Promise(function(s,a){var l=n.apply(i,o);function u(f){t(l,s,a,u,d,"next",f)}function d(f){t(l,s,a,u,d,"throw",f)}u(void 0)})}}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(K4);var H4=K4.exports;function s0e(e){return e!=null&&typeof e=="object"&&typeof e.then=="function"}var W4=s0e,a0e=W4,Os=h0e,yh=(function(){e.create=function(n){return new e(n)};function e(r){this._source=r}e.onUnhandledError=function(n){Os=n},e.from=function(n){return l0e(n)?u0e(n):a0e(n)?c0e(n):d0e(n)};var t=e.prototype;return t.catch=function(n){var i=this;return e.create(function(o){var s;return i.subscribe({start:function(l){s=l},next:o.next,complete:o.complete,error:function(l){try{n(l).subscribe({start:function(d){s=d},next:o.next,complete:o.complete,error:o.error})}catch(u){o.error(u,!0)}}}),function(){return s.unsubscribe()}})},t.concat=function(n){var i=this;return e.create(function(o){var s;return i.subscribe({start:function(l){s=l},next:o.next,error:o.error,complete:function(){s=n.subscribe(o)}}),function(){s&&s.unsubscribe()}})},t.do=function(n){var i=this;return e.create(function(o){var s=function(l){return function(){try{n[l]&&n[l].apply(n,arguments)}catch(u){Os(u,!0)}o[l]&&o[l].apply(o,arguments)}};return i.subscribe({start:s("start"),next:s("next"),error:s("error"),complete:s("complete"),unsubscribe:s("unsubscribe")})})},t.finally=function(n){var i=this;return e.create(function(o){var s=i.subscribe(o);return function(){s.unsubscribe(),n()}})},t.ifEmpty=function(n){var i=this;return e.create(function(o){var s=!1,a;return a=i.subscribe({next:function(u){s=!0,o.next(u)},error:o.error,complete:function(){s?o.complete():a=n.subscribe(o)}}),function(){a&&a.unsubscribe()}})},t.subscribe=function(n){return f0e(this._source,n)},t.map=function(n){var i=this;return e.create(function(o){var s=i.subscribe({complete:o.complete,error:o.error,next:function(l){try{var u=n(l);o.next(u)}catch(d){o.error(d,!0)}}});return function(){s.unsubscribe()}})},t.mergeMap=function(n){var i=this;return e.create(function(o){var s=[];function a(u){this._sub=u,s.push(u)}function l(){s.splice(s.indexOf(this._sub),1),s.length===0&&o.complete()}return i.subscribe({start:a,next:function(d){try{o.closed||e.from(n(d)).subscribe({start:a,next:o.next,error:o.error,complete:l})}catch(f){o.error(f,!0)}},error:o.error,complete:l}),function(){s.forEach(function(u){return u.unsubscribe()}),s.length=0}})},t.poll=function(n){var i=this;return e.create(function(o){var s,a,l=function u(){s=i.subscribe({next:o.next,error:o.error,complete:function(){a=setTimeout(u,n)}})};return l(),function(){clearTimeout(a),s.unsubscribe()}})},t.toPromise=function(){var n=this;return new Promise(function(i,o){var s=!1;n.subscribe({next:function(l){s||(s=!0,i(l))},error:o,complete:i})})},e})();function l0e(e){return typeof e=="object"&&e!==null&&typeof e.subscribe=="function"}function u0e(e){return e instanceof yh?e:yh.create(function(t){return e.subscribe(t)})}function c0e(e){return yh.create(function(t){e.then(function(r){t.next(r),t.complete()},t.error)})}function d0e(e){return yh.create(function(t){t.next(e),t.complete()})}function f0e(e,t){var r=!1,n,i=function(u){return Object.defineProperty(u,"closed",{get:function(){return r}})};function o(){if(n){if(n.unsubscribe)n.unsubscribe();else try{n()}catch(l){Os(l,!0)}n=void 0}}var s=i({unsubscribe:function(){if(!r){r=!0;try{t.unsubscribe&&t.unsubscribe(s)}catch(u){Os(u,!0)}finally{o()}}}});try{t.start&&t.start(s)}catch(l){Os(l,!0)}if(r)return s;var a=i({next:function(u){if(!r&&t.next)try{t.next(u)}catch(d){Os(d,!0)}},error:function(u,d){if(r||!t.error)r=!0,Os(u,d||!1),o();else{r=!0;try{t.error(u)}catch(f){Os(f,!0)}finally{o()}}},complete:function(){if(!r){r=!0;try{t.complete&&t.complete()}catch(u){Os(u,!0)}finally{o()}}}});try{n=e(a)}catch(l){a.error(l,!0)}return r&&o(),s}function h0e(e,t){}var bl=yh,G4=Ke.default,p0e=G4(Tr),Vp=G4(Xn),g0e=bl,m0e=De,v0e=(function(){function e(){var r=this;(0,Vp.default)(this,"_complete",!1),(0,Vp.default)(this,"_events",[]),(0,Vp.default)(this,"_sinks",new Set),(0,Vp.default)(this,"_subscription",[]),this._observable=g0e.create(function(n){r._sinks.add(n);for(var i=r._events,o=0;o<i.length&&!n.closed;o++){var s=i[o];switch(s.kind){case"complete":n.complete();break;case"error":n.error(s.error);break;case"next":n.next(s.data);break;default:s.kind,m0e(!1)}}return function(){r._sinks.delete(n)}})}var t=e.prototype;return t.complete=function(){this._complete!==!0&&(this._complete=!0,this._events.push({kind:"complete"}),this._sinks.forEach(function(n){return n.complete()}))},t.error=function(n){this._complete!==!0&&(this._complete=!0,this._events.push({kind:"error",error:n}),this._sinks.forEach(function(i){return i.error(n)}))},t.next=function(n){this._complete!==!0&&(this._events.push({kind:"next",data:n}),this._sinks.forEach(function(i){return i.next(n)}))},t.subscribe=function(n){var i=this._observable.subscribe(n);return this._subscription.push(i),i},t.unsubscribe=function(){var n=(0,p0e.default)(this._subscription),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;o.unsubscribe()}}catch(s){n.e(s)}finally{n.f()}this._subscription=[]},t.getObserverCount=function(){return this._sinks.size},e})(),J4=v0e,rw=bl,vT=J4,Q4=De,_0e=typeof WeakMap=="function",_T=_0e?new WeakMap:new Map;function b0e(e,t){return Y4(e,t.request.identifier,function(){return e.execute({operation:t})})}function Y4(e,t,r){return rw.create(function(n){var i=nw(e),o=i.get(t);return o||r().finally(function(){return i.delete(t)}).subscribe({start:function(a){o={identifier:t,subject:new vT,subjectForInFlightStatus:new vT,subscription:a,promise:null},i.set(t,o)},next:function(a){var l=Kp(i,t);l.subject.next(a),l.subjectForInFlightStatus.next(a)},error:function(a){var l=Kp(i,t);l.subject.error(a),l.subjectForInFlightStatus.error(a)},complete:function(){var a=Kp(i,t);a.subject.complete(),a.subjectForInFlightStatus.complete()},unsubscribe:function(a){var l=Kp(i,t);l.subject.unsubscribe(),l.subjectForInFlightStatus.unsubscribe()}}),o==null&&Q4(!1),y0e(i,o).subscribe(n)})}function y0e(e,t){return rw.create(function(r){var n=t.subject.subscribe(r);return function(){n.unsubscribe();var i=e.get(t.identifier);if(i){var o=i.subscription;o!=null&&i.subject.getObserverCount()===0&&(o.unsubscribe(),e.delete(t.identifier))}}})}function X4(e,t,r){return rw.create(function(n){var i=r.subjectForInFlightStatus.subscribe({error:n.error,next:function(s){if(!e.isRequestActive(r.identifier)){n.complete();return}n.next()},complete:n.complete,unsubscribe:n.complete});return function(){i.unsubscribe()}})}function x0e(e,t){var r=nw(e),n=r.get(t.identifier);if(!n||!e.isRequestActive(n.identifier))return null;var i=new Promise(function(o,s){var a=!1;X4(e,r,n).subscribe({complete:o,error:s,next:function(u){a&&o(u)}}),a=!0});return i}function S0e(e,t){var r=nw(e),n=r.get(t.identifier);return!n||!e.isRequestActive(n.identifier)?null:X4(e,r,n)}function nw(e){var t=_T.get(e);if(t!=null)return t;var r=new Map;return _T.set(e,r),r}function Kp(e,t){var r=e.get(t);return r==null&&Q4(!1),r}var Wm={fetchQuery:b0e,fetchQueryDeduped:Y4,getPromiseForActiveRequest:x0e,getObservableForActiveRequest:S0e},E0e=Ke.default;H4.default;var w0e=E0e(Tr),Z4=bl,k0e=Wm,C0e=k0e.getObservableForActiveRequest,R0e=Wo,A0e=R0e.getFragment,T0e=tp,$0e=T0e.handlePotentialSnapshotErrors,N0e=Go,D0e=N0e.getSelector,U0=De;function F0e(e,t,r){var n,i=A0e(t),o=D0e(i,r);switch(((n=i.metadata)===null||n===void 0?void 0:n.hasClientEdges)!=null&&U0(!1),o==null&&U0(!1),o.kind){case"SingularReaderSelector":return I0e(e,t,o);case"PluralReaderSelector":return P0e(e,t,o)}U0(!1)}function I0e(e,t,r){var n=e.lookup(r);return Z4.create(function(i){i.next(Mg(e,t,r.owner,n));var o=e.subscribe(n,function(s){i.next(Mg(e,t,r.owner,s))});return function(){return o.dispose()}})}function P0e(e,t,r){var n=r.selectors.map(function(i){return e.lookup(i)});return Z4.create(function(i){var o=n.map(function(a,l){return Mg(e,t,r.selectors[l].owner,a)});i.next(bT(o));var s=n.map(function(a,l){return e.subscribe(a,function(u){o[l]=Mg(e,t,r.selectors[l].owner,u),i.next(bT(o))})});return function(){return s.forEach(function(a){return a.dispose()})}})}function Mg(e,t,r,n){var i=n.missingLiveResolverFields!=null&&n.missingLiveResolverFields.length>0,o=n.missingClientEdges!=null&&n.missingClientEdges.length>0;if(i||o)return{state:"loading"};if(n.isMissingData&&(C0e(e,r)!=null||e.getOperationTracker().getPendingOperationsAffectingOwner(r)!=null))return{state:"loading"};try{$0e(e,n.fieldErrors)}catch(s){return{error:s,state:"error"}}return n.data==null&&U0(!1),{state:"ok",value:n.data}}function bT(e){var t=[],r=(0,w0e.default)(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.state==="ok")t.push(i.value);else return i}}catch(o){r.e(o)}finally{r.f()}return{state:"ok",value:t}}var iw={observeFragment:F0e};function eL(e){return O0e(e)&&(Object.freeze(e),Object.getOwnPropertyNames(e).forEach(function(t){var r=e[t];r&&typeof r=="object"&&!Object.isFrozen(r)&&eL(r)})),e}function O0e(e){return e!=null&&(Array.isArray(e)||typeof e=="object"&&e.constructor===Object)}var tL=eL,M0e=Nu,L0e=M0e.stableCopy,z0e=De;function U0e(e,t){var r=e.cacheID!=null?e.cacheID:e.id;return r==null&&z0e(!1),r+JSON.stringify(L0e(t))}var rL=U0e,B0e=rL,j0e=go,q0e=Nu,V0e=q0e.hasCycle,K0e=_l,H0e=K0e.getOperationVariables,nL=Go,W0e=nL.createNormalizationSelector,G0e=nL.createReaderSelector,J0e=rr,Q0e=J0e.ROOT_ID,Y0e=De;function X0e(e,t,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Q0e,i=e.operation,o=H0e(i,e.params.providedVariables,t);j0e.ENABLE_CYLE_DETECTION_IN_VARIABLES&&V0e(o)&&Y0e(!1);var s=iL(e,o,r),a={fragment:G0e(e.fragment,n,o,s),request:s,root:W0e(i,n,o)};return a}function iL(e,t,r){var n={identifier:B0e(e.params,t),node:e,variables:t,cacheConfig:r};return n}var yl={createOperationDescriptor:X0e,createRequestDescriptor:iL},Z0e=Ke.default,ege=Z0e(Xn),tge=iw,rge=tge.observeFragment,nge=yl,ige=nge.createOperationDescriptor;function oge(e,t,r){var n=ige(t,r),i={__id:n.fragment.dataID,__fragments:(0,ege.default)({},n.fragment.node.name,n.request.variables),__fragmentOwner:n.request},o=n.request.node.fragment;return rge(e,o,i)}var sge={observeQuery:oge},age=H4.default,lge=iw,uge=lge.observeFragment;function cge(e,t,r){return R1.apply(this,arguments)}function R1(){return R1=age(function*(e,t,r){var n;try{var i,o=yield new Promise(function(a,l){n=uge(e,t,r).subscribe({next:function(d){d.state==="ok"?a(d.value):d.state==="error"&&l(d.error)}})});return(i=n)===null||i===void 0||i.unsubscribe(),o}catch(a){var s;throw(s=n)===null||s===void 0||s.unsubscribe(),a}}),R1.apply(this,arguments)}var dge={waitForFragmentData:cge},fge=iw;fge.observeFragment;var hge=sge;hge.observeQuery;var pge=dge;pge.waitForFragmentData;function gge(e){return e.ok===!0}function mge(e){return e.ok===!1}var vge={isValueResult:gge,isErrorResult:mge},yT=new Map,_ge=1,bge=yge(),oL=" ",xT="\v";function yge(){for(var e=new Set,t=0;t<10;++t)e.add(t.toString());return e}function xge(e){return e[0]===oL&&bge.has(e[1])||e[0]===xT?xT+e:e}function Sge(e,t){if(t==null||e.length<t)return xge(e);var r=yT.get(e);return r!=null||(r=oL+_ge++,yT.set(e,r)),r}var sL={intern:Sge},ST=go,Ege=sL,wge=Ege.intern,xh="client:";function kge(e,t,r){var n=ST.STRING_INTERN_LEVEL<=0?e:wge(e,ST.MAX_DATA_ID_LENGTH),i=n+":"+t;return r!=null&&(i+=":"+r),i.indexOf(xh)!==0&&(i=xh+i),i}function Cge(e){return e.indexOf(xh)===0}var Rge=0;function Age(){return"".concat(xh,"local:").concat(Rge++)}function Tge(e,t,r){var n="".concat(xh).concat(e,":").concat(t);return r!=null&&(n+=":"+r),n}var ks={generateClientID:kge,generateClientObjectClientID:Tge,generateUniqueClientID:Age,isClientID:Cge},$ge={after:!0,before:!0,find:!0,first:!0,last:!0,surrounds:!0},ET={CURSOR:"cursor",EDGES:"edges",END_CURSOR:"endCursor",HAS_NEXT_PAGE:"hasNextPage",HAS_PREV_PAGE:"hasPreviousPage",NODE:"node",PAGE_INFO_TYPE:"PageInfo",PAGE_INFO:"pageInfo",START_CURSOR:"startCursor"},Nge={inject:function(t){ET=t},get:function(){return ET},isConnectionCall:function(t){return $ge.hasOwnProperty(t.name)}},ow=Nge,Dge=ks,Sh=Dge.generateClientID,Fge=rr,Ige=Fge.getStableStorageKey,aL=T4,Du=ow,Pge=De,lL="connection",A1="__connection_next_edge_index";function Oge(e,t){var r=e.get(t.dataID);if(r){var n=Du.get(),i=n.EDGES,o=n.END_CURSOR,s=n.HAS_NEXT_PAGE,a=n.HAS_PREV_PAGE,l=n.PAGE_INFO,u=n.PAGE_INFO_TYPE,d=n.START_CURSOR,f=r.getLinkedRecord(t.fieldKey),h=f&&f.getLinkedRecord(l);if(!f){r.setValue(null,t.handleKey,void 0,r.getErrors(t.fieldKey));return}var p=Sh(r.getDataID(),t.handleKey),g=r.getLinkedRecord(t.handleKey),m=g??e.get(p),v=m&&m.getLinkedRecord(l);if(m){g==null&&r.setLinkedRecord(m,t.handleKey);var w=m,S=f.getLinkedRecords(i);S&&(S=S.map(function(J){return T1(e,w,J)}));var k=w.getLinkedRecords(i),A=w.getLinkedRecord(l);w.copyFieldsFrom(f),k&&w.setLinkedRecords(k,i),A&&w.setLinkedRecord(A,l);var C=[],R=t.args;if(k&&S)if(R.after!=null){var N,I=(N=v)===null||N===void 0?void 0:N.getValue(o),P=h?.getValue(o),z=v&&R.after===I,q=v&&I===P;if(z||q){var H=new Set;Hp(k,C,H),Hp(S,C,H)}else return}else if(R.before!=null)if(v&&R.before===v.getValue(d)){var V=new Set;Hp(S,C,V),Hp(k,C,V)}else return;else C=S;else S?C=S:C=k;if(C!=null&&C!==k&&w.setLinkedRecords(C,i),v&&h){if(R.after==null&&R.before==null)v.copyFieldsFrom(h);else if(R.before!=null||R.after==null&&R.last){v.setValue(!!h.getValue(a),a);var Y=h.getValue(d);typeof Y=="string"&&v.setValue(Y,d)}else if(R.after!=null||R.before==null&&R.first){v.setValue(!!h.getValue(s),s);var G=h.getValue(o);typeof G=="string"&&v.setValue(G,o)}}}else{var _=e.create(p,f.getType());_.setValue(0,A1),_.copyFieldsFrom(f);var x=f.getLinkedRecords(i);x&&(x=x.map(function(J){return T1(e,_,J)}),_.setLinkedRecords(x,i)),r.setLinkedRecord(_,t.handleKey),v=e.create(Sh(_.getDataID(),l),u),v.setValue(!1,s),v.setValue(!1,a),v.setValue(null,o),v.setValue(null,d),h&&v.copyFieldsFrom(h),_.setLinkedRecord(v,l)}}}function Mge(e,t,r){var n=aL(lL,t,null);return e.getLinkedRecord(n,r)}function Lge(e,t,r){var n=aL(lL,t,null),i=Ige(n,r);return Sh(e,i)}function zge(e,t,r){var n=Du.get(),i=n.CURSOR,o=n.EDGES,s=e.getLinkedRecords(o);if(!s){e.setLinkedRecords([t],o);return}var a;if(r==null)a=s.concat(t);else{a=[];for(var l=!1,u=0;u<s.length;u++){var d=s[u];if(a.push(d),d!=null){var f=d.getValue(i);r===f&&(a.push(t),l=!0)}}l||a.push(t)}e.setLinkedRecords(a,o)}function Uge(e,t,r,n){var i=Du.get(),o=i.NODE,s=Sh(t.getDataID(),r.getDataID()),a=e.get(s);return a||(a=e.create(s,n)),a.setLinkedRecord(r,o),a.getValue("cursor")==null&&a.setValue(null,"cursor"),a}function Bge(e,t,r){var n=Du.get(),i=n.CURSOR,o=n.EDGES,s=e.getLinkedRecords(o);if(!s){e.setLinkedRecords([t],o);return}var a;if(r==null)a=[t].concat(s);else{a=[];for(var l=!1,u=0;u<s.length;u++){var d=s[u];if(d!=null){var f=d.getValue(i);r===f&&(a.push(t),l=!0)}a.push(d)}l||a.unshift(t)}e.setLinkedRecords(a,o)}function jge(e,t){var r=Du.get(),n=r.EDGES,i=r.NODE,o=e.getLinkedRecords(n);if(o){for(var s,a=0;a<o.length;a++){var l=o[a],u=l&&l.getLinkedRecord(i);u!=null&&u.getDataID()===t?s===void 0&&(s=o.slice(0,a)):s!==void 0&&s.push(l)}s!==void 0&&e.setLinkedRecords(s,n)}}function T1(e,t,r){if(r==null)return r;var n=Du.get(),i=n.EDGES,o=t.getValue(A1);typeof o!="number"&&Pge(!1);var s=Sh(t.getDataID(),i,o),a=e.create(s,r.getType());return a.copyFieldsFrom(r),a.getValue("cursor")==null&&a.setValue(null,"cursor"),t.setValue(o+1,A1),a}function Hp(e,t,r){for(var n=Du.get(),i=n.NODE,o=0;o<e.length;o++){var s=e[o];if(s){var a=s.getLinkedRecord(i),l=a&&a.getDataID();if(l){if(r.has(l))continue;r.add(l)}t.push(s)}}}var Gm={buildConnectionEdge:T1,createEdge:Uge,deleteNode:jge,getConnection:Mge,getConnectionID:Lge,insertEdgeAfter:zge,insertEdgeBefore:Bge,update:Oge},qge=Ke.default,Eh=qge(Tr),Fu=Gm,uL=ow,Fc=De;var Vge={update:function(t,r){var n=t.get(r.dataID);if(n!=null){var i=n.getValue(r.fieldKey);typeof i=="string"?t.delete(i):Array.isArray(i)&&i.forEach(function(o){typeof o=="string"&&t.delete(o)})}}},Kge={update:function(t,r){var n=t.get(r.dataID);if(n!=null){var i=r.handleArgs.connections;i==null&&Fc(!1);var o=n.getValue(r.fieldKey),s=Array.isArray(o)?o:[o];s.forEach(function(a){if(typeof a=="string"){var l=(0,Eh.default)(i),u;try{for(l.s();!(u=l.n()).done;){var d=u.value,f=t.get(d);f!=null&&Fu.deleteNode(f,a)}}catch(h){l.e(h)}finally{l.f()}}})}}},Hge={update:cL(Fu.insertEdgeAfter)},Wge={update:cL(Fu.insertEdgeBefore)},Gge={update:dL(Fu.insertEdgeAfter)},Jge={update:dL(Fu.insertEdgeBefore)};function cL(e){return function(t,r){var n,i=t.get(r.dataID);if(i!=null){var o=r.handleArgs.connections;o==null&&Fc(!1);var s,a;try{s=i.getLinkedRecord(r.fieldKey)}catch{}if(!s)try{a=i.getLinkedRecords(r.fieldKey)}catch{}if(!(s==null&&a==null)){var l=uL.get(),u=l.NODE,d=l.EDGES,f=(n=a)!==null&&n!==void 0?n:[s],h=(0,Eh.default)(f),p;try{var g=function(){var x=p.value;if(x==null)return"continue";var w=x.getLinkedRecord("node");if(!w)return"continue";var S=w.getDataID(),k=(0,Eh.default)(o),A;try{for(k.s();!(A=k.n()).done;){var C=A.value,R=t.get(C);if(R!=null){var N=(m=R.getLinkedRecords(d))===null||m===void 0?void 0:m.some(function(P){var z;return(P==null||(z=P.getLinkedRecord(u))===null||z===void 0?void 0:z.getDataID())===S});if(!N){var I=Fu.buildConnectionEdge(t,R,x);I==null&&Fc(!1),e(R,I)}}}}catch(P){k.e(P)}finally{k.f()}};for(h.s();!(p=h.n()).done;)var m,v=g()}catch(_){h.e(_)}finally{h.f()}}}}}function dL(e){return function(t,r){var n,i=t.get(r.dataID);if(i!=null){var o=r.handleArgs,s=o.connections,a=o.edgeTypeName;s==null&&Fc(!1),a==null&&Fc(!1);var l,u;try{l=i.getLinkedRecord(r.fieldKey)}catch{}if(!l)try{u=i.getLinkedRecords(r.fieldKey)}catch{}if(!(l==null&&u==null)){var d=uL.get(),f=d.NODE,h=d.EDGES,p=(n=u)!==null&&n!==void 0?n:[l],g=(0,Eh.default)(p),m;try{var v=function(){var S=m.value;if(S==null)return"continue";var k=S.getDataID(),A=(0,Eh.default)(s),C;try{for(A.s();!(C=A.n()).done;){var R=C.value,N=t.get(R);if(N!=null){var I=(_=N.getLinkedRecords(h))===null||_===void 0?void 0:_.some(function(z){var q;return(z==null||(q=z.getLinkedRecord(f))===null||q===void 0?void 0:q.getDataID())===k});if(!I){var P=Fu.createEdge(t,N,S,a);P==null&&Fc(!1),e(N,P)}}}}catch(z){A.e(z)}finally{A.f()}};for(g.s();!(m=g.n()).done;)var _,x=v()}catch(w){g.e(w)}finally{g.f()}}}}}var Qge={AppendEdgeHandler:Hge,DeleteRecordHandler:Vge,PrependEdgeHandler:Wge,AppendNodeHandler:Gge,PrependNodeHandler:Jge,DeleteEdgeHandler:Kge},Yge=Gm,Qu=Qge,Xge=De;function Zge(e){switch(e){case"connection":return Yge;case"deleteRecord":return Qu.DeleteRecordHandler;case"deleteEdge":return Qu.DeleteEdgeHandler;case"appendEdge":return Qu.AppendEdgeHandler;case"prependEdge":return Qu.PrependEdgeHandler;case"appendNode":return Qu.AppendNodeHandler;case"prependNode":return Qu.PrependNodeHandler}Xge(!1)}var eme=Zge;function tme(e){return!!(e&&e["@@RelayModernEnvironment"])}var sw=tme,rme=Ke.default,aw=rme(Tr),mc=Gm;var nme=Object.freeze({RANGE_ADD:"RANGE_ADD",RANGE_DELETE:"RANGE_DELETE",NODE_DELETE:"NODE_DELETE"}),ime=Object.freeze({APPEND:"append",PREPEND:"prepend"});function ome(e,t,r,n){var i=r?[r]:[],o=n?[n]:[];return e.forEach(function(s){switch(s.type){case"NODE_DELETE":var a=sme(s,t);a&&(i.push(a),o.push(a));break;case"RANGE_ADD":var l=ame(s,t);l&&(i.push(l),o.push(l));break;case"RANGE_DELETE":var u=lme(s,t);u&&(i.push(u),o.push(u));break}}),{optimisticUpdater:function(a,l){i.forEach(function(u){u(a,l)})},updater:function(a,l){o.forEach(function(u){u(a,l)})}}}function sme(e,t){var r=e.deletedIDFieldName,n=lw(t);return n?function(i,o){var s=i.getRootField(n);if(s){var a=s.getValue(r),l=Array.isArray(a)?a:[a];l.forEach(function(u){u&&typeof u=="string"&&i.delete(u)})}}:null}function ame(e,t){var r=e.parentID,n=e.connectionInfo,i=e.edgeName;if(!r)return null;var o=lw(t);return!n||!o?null:function(s,a){var l=s.get(r);if(l){var u=s.getRootField(o);if(u){var d=u.getLinkedRecord(i),f=(0,aw.default)(n),h;try{for(f.s();!(h=f.n()).done;){var p=h.value;if(d){var g=mc.getConnection(l,p.key,p.filters);if(g){var m=mc.buildConnectionEdge(s,g,d);if(m)switch(p.rangeBehavior){case"append":mc.insertEdgeAfter(g,m);break;case"prepend":mc.insertEdgeBefore(g,m);break;default:break}}}}}catch(v){f.e(v)}finally{f.f()}}}}}function lme(e,t){var r=e.parentID,n=e.connectionKeys,i=e.pathToConnection,o=e.deletedIDFieldName;if(!r)return null;var s=lw(t);return s?function(a,l){if(l){var u=[],d=l[s];if(d&&Array.isArray(o)){var f=(0,aw.default)(o),h;try{for(f.s();!(h=f.n()).done;){var p=h.value;d&&typeof d=="object"&&(d=d[p])}}catch(g){f.e(g)}finally{f.f()}Array.isArray(d)?d.forEach(function(g){g&&g.id&&typeof g=="object"&&typeof g.id=="string"&&u.push(g.id)}):d&&d.id&&typeof d.id=="string"&&u.push(d.id)}else d&&typeof o=="string"&&typeof d=="object"&&(d=d[o],typeof d=="string"?u.push(d):Array.isArray(d)&&d.forEach(function(g){typeof g=="string"&&u.push(g)}));ume(r,n,i,a,u)}}:null}function ume(e,t,r,n,i){var o=n.get(e);if(o&&!(r.length<2)){for(var s=o,a=1;a<r.length-1;a++)s&&(s=s.getLinkedRecord(r[a]));if(!(!t||!s)){var l=(0,aw.default)(t),u;try{var d=function(){var h=u.value,p=mc.getConnection(s,h.key,h.filters);p&&i.forEach(function(g){mc.deleteNode(p,g)})};for(l.s();!(u=l.n()).done;)d()}catch(f){l.e(f)}finally{l.f()}}}}function lw(e){return e.fragment.selections&&e.fragment.selections.length>0&&e.fragment.selections[0].kind==="LinkedField"?e.fragment.selections[0].name:null}var Jm={MutationTypes:nme,RangeOperations:ime,convert:ome},cme=Wo,dme=cme.getRequest,fme=sw,hme=yl,pme=hme.createOperationDescriptor,gme=Jm,mme=De;function vme(e,t){fme(e)||mme(!1);var r=dme(t.mutation);if(r.params.operationKind!=="mutation")throw new Error("commitMutation: Expected mutation operation");var n=t.optimisticUpdater,i=t.configs,o=t.optimisticResponse,s=t.variables,a=pme(r,s);if(i){var l=gme.convert(i,r,n);n=l.optimisticUpdater}return e.applyMutation({operation:a,response:o,updater:n})}var _me=vme;function bme(e,t){e.commitUpdate(t)}var yme=bme,xme=Ke.default;xme(Bt);var Sme=Ke.default,wT=Sme(vl),Eme=Wo,wme=Eme.getRequest,kme=ks,Cme=kme.generateUniqueClientID,Rme=sw,Ame=yl,Tme=Ame.createOperationDescriptor,$me=Jm,Nme=De;function Dme(e,t){Rme(e)||Nme(!1);var r=wme(t.mutation);if(r.params.operationKind!=="mutation")throw new Error("commitMutation: Expected mutation operation");if(r.kind!=="Request")throw new Error("commitMutation: Expected mutation to be of type request");var n=t.optimisticResponse,i=t.optimisticUpdater,o=t.updater,s=t.configs,a=t.cacheConfig,l=t.onError,u=t.onUnsubscribe,d=t.variables,f=t.uploadables,h=Tme(r,d,a,Cme());if(typeof n=="function"&&(n=n()),s){var p=$me.convert(s,r,i,o);i=p.optimisticUpdater,o=p.updater}var g=[],m=e.executeMutation({operation:h,optimisticResponse:n,optimisticUpdater:i,updater:o,uploadables:f}).subscribe({next:function(_){var x;Array.isArray(_)?_.forEach(function(w){w.errors&&g.push.apply(g,(0,wT.default)(w.errors))}):_.errors&&g.push.apply(g,(0,wT.default)(_.errors)),(x=t.onNext)===null||x===void 0||x.call(t)},complete:function(){var _=t.onCompleted;if(_){var x=e.lookup(h.fragment);_(x.data,g.length!==0?g:null)}},error:l,unsubscribe:u});return{dispose:m.unsubscribe}}var Fme=Dme,Ime=typeof WeakMap=="function",q_=Ime?new WeakMap:new Map;function fL(e,t){if(t!=null){var r={};return Object.assign(r,e),Object.keys(t).forEach(function(n){var i=t[n].get,o=i();if(!q_.has(i))q_.set(i,o),r[n]=o;else{var s=q_.get(i);r[n]=s}}),r}else return e}fL.tests_only_resetDebugCache=void 0;var Pme=fL,kT=bl;function Ome(e){return function(r,n,i,o,s){var a=e(r,n,i,o,s);return a instanceof Error?kT.create(function(l){return l.error(a)}):kT.from(a)}}var Mme={convertFetch:Ome},Lme=Pme,zme=Mme,Ume=zme.convertFetch,V_=De;function Bme(e,t){var r=Ume(e);function n(i,o,s,a,l){var u=Lme(o,i.providedVariables);if(i.operationKind==="subscription")return t||V_(!1),a&&V_(!1),t(i,u,s);var d=s.poll;return d!=null?(a&&V_(!1),r(i,u,{force:!0}).poll(d)):r(i,u,s,a,l)}return{execute:n}}var jme={create:Bme},qme=Ke.default;qme(Bt);var Vme=Nu;Vme.stableCopy;var Kme=Ke.default,Hme=Kme(Bt),Wme=bl,Gme=yl,Jme=Gme.createOperationDescriptor,Qme=tp,Yme=Qme.handlePotentialSnapshotErrors,Xme=Wm,Zme=Wo,eve=Zme.getRequest,tve=De;function rve(e,t,r,n){var i,o=eve(t);o.params.operationKind!=="query"&&tve(!1);var s=(0,Hme.default)({force:!0},n?.networkCacheConfig),a=Jme(o,r,s),l=(i=n?.fetchPolicy)!==null&&i!==void 0?i:"network-only";function u(d){return Yme(e,d.fieldErrors),d.data}switch(l){case"network-only":return CT(e,a).map(u);case"store-or-network":return e.check(a).status==="available"?Wme.from(e.lookup(a.fragment)).map(u):CT(e,a).map(u);default:throw new Error("fetchQuery: Invalid fetchPolicy "+l)}}function CT(e,t){return Xme.fetchQuery(e,t).map(function(){return e.lookup(t.fragment)})}var nve=rve,ive=yl,ove=ive.createOperationDescriptor,sve=Wo,ave=sve.getRequest;function lve(e,t,r,n){var i=ave(t);if(i.params.operationKind!=="query")throw new Error("fetchQuery: Expected query operation");var o=ove(i,r,n);return e.execute({operation:o}).map(function(){return e.lookup(o.fragment).data}).toPromise()}var uve=lve,cve=(function(){function e(){this._preloadableQueries=new Map,this._callbacks=new Map}var t=e.prototype;return t.set=function(n,i){this._preloadableQueries.set(n,i);var o=this._callbacks.get(n);o?.forEach(function(s){try{s(i)}catch(a){setTimeout(function(){throw a},0)}})},t.get=function(n){return this._preloadableQueries.get(n)},t.onLoad=function(n,i){var o,s=(o=this._callbacks.get(n))!==null&&o!==void 0?o:new Set;s.add(i);var a=function(){s.delete(i)};return this._callbacks.set(n,s),{dispose:a}},t.clear=function(){this._preloadableQueries.clear()},e})(),dve=new cve,fve=dve,hve=Wm,pve=hve.getPromiseForActiveRequest;function gve(e,t,r){var n,i,o=[],s=pve(e,r);if(s!=null)o=[r];else{var a,l,u=e.getOperationTracker(),d=u.getPendingOperationsAffectingOwner(r);o=(a=d?.pendingOperations)!==null&&a!==void 0?a:[],s=(l=d?.promise)!==null&&l!==void 0?l:null}if(!s)return null;var f=(n=(i=o)===null||i===void 0?void 0:i.map(function(g){return g.node.params.name}).join(","))!==null&&n!==void 0?n:null;(f==null||f.length===0)&&(f="Unknown pending operation");var h=t.name,p=f===h?"Relay(".concat(f,")"):"Relay(".concat(f,":").concat(h,")");return s.displayName=p,e.__log({name:"pendingoperation.found",fragment:t,fragmentOwner:r,pendingOperations:o}),{promise:s,pendingOperations:o}}var hL=gve;function mve(e,t){return e===t&&(e===null||typeof e!="object")}var pL=mve;function vve(e,t){return $1(e,t,!0)}function $1(e,t,r){if(e===t||typeof e!="object"||!e||e.constructor!==Object&&!Array.isArray(e)||typeof t!="object"||!t||t.constructor!==Object&&!Array.isArray(t))return t;var n=!1,i=Array.isArray(e)?e:null,o=Array.isArray(t)?t:null;if(i&&o){var s=r&&!Object.isFrozen(o);n=o.reduce(function(h,p,g){var m=i[g],v=$1(m,p,s);return v!==o[g]&&s&&(o[g]=v),h&&v===i[g]},!0)&&i.length===o.length}else if(!i&&!o){var a=e,l=t,u=Object.keys(a),d=Object.keys(l),f=r&&!Object.isFrozen(l);n=d.reduce(function(h,p){var g=a[p],m=$1(g,l[p],f);return m!==l[p]&&f&&(l[p]=m),h&&m===a[p]},!0)&&u.length===d.length}return n?e:t}var Qm=vve,gL=Ke.default,RT=gL(Bt),uw=gL(Xn),_ve=hL,bve=tp,yve=bve.handlePotentialSnapshotErrors,xve=pL,Sve=Qm,mL=go,Eve=yl,wve=Eve.createRequestDescriptor,cw=Go,kve=cw.areEqualSelectors,Cve=cw.createReaderSelector,Rve=cw.getSelectorsFromObject,Ave=ha,AT=De,Tve=(function(){function e(r,n,i,o,s){var a=this;(0,uw.default)(this,"_onChange",function(){a._stale=!0,typeof a._callback=="function"&&a._callback()}),this._callback=o,this._context=r,this._data={},this._fragments=n,this._props={},this._resolvers={},this._stale=!1,this._rootIsQueryRenderer=s,this.setProps(i)}var t=e.prototype;return t.dispose=function(){for(var n in this._resolvers)this._resolvers.hasOwnProperty(n)&&vL(this._resolvers[n])},t.resolve=function(){if(this._stale){var n=this._data,i;for(var o in this._resolvers)if(this._resolvers.hasOwnProperty(o)){var s=this._resolvers[o],a=n[o];if(s){var l=s.resolve();(i||l!==a)&&(i=i||(0,RT.default)({},n),i[o]=l)}else{var u=this._props[o],d=u!==void 0?u:null;(i||!xve(d,a))&&(i=i||(0,RT.default)({},n),i[o]=d)}}this._data=i||n,this._stale=!1}return this._data},t.setCallback=function(n,i){this._callback=i,mL.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT===!0&&this.setProps(n)},t.setProps=function(n){this._props={};var i=Rve(this._fragments,n);for(var o in i)if(i.hasOwnProperty(o)){var s=i[o],a=this._resolvers[o];s==null?(a?.dispose(),a=null):s.kind==="PluralReaderSelector"?a==null?a=new TT(this._context.environment,this._rootIsQueryRenderer,s,this._callback!=null,this._onChange):(a instanceof TT||AT(!1),a.setSelector(s)):a==null?a=new N1(this._context.environment,this._rootIsQueryRenderer,s,this._callback!=null,this._onChange):(a instanceof N1||AT(!1),a.setSelector(s)),this._props[o]=n[o],this._resolvers[o]=a}this._stale=!0},t.setVariables=function(n,i){for(var o in this._resolvers)if(this._resolvers.hasOwnProperty(o)){var s=this._resolvers[o];s&&s.setVariables(n,i)}this._stale=!0},e})(),N1=(function(){function e(r,n,i,o,s){var a=this;(0,uw.default)(this,"_onChange",function(u){a._data=u.data,a._isMissingData=u.isMissingData,a._fieldErrors=u.fieldErrors,a._callback()});var l=r.lookup(i);this._callback=s,this._data=l.data,this._isMissingData=l.isMissingData,this._fieldErrors=l.fieldErrors,this._environment=r,this._rootIsQueryRenderer=n,this._selector=i,mL.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT===!0?o&&(this._subscription=r.subscribe(l,this._onChange)):this._subscription=r.subscribe(l,this._onChange)}var t=e.prototype;return t.dispose=function(){this._subscription&&(this._subscription.dispose(),this._subscription=null)},t.resolve=function(){if(this._isMissingData===!0){var n=_ve(this._environment,this._selector.node,this._selector.owner),i=n?.promise;if(i!=null&&!this._rootIsQueryRenderer){var o,s=(o=n?.pendingOperations)!==null&&o!==void 0?o:[];throw this._environment.__log({name:"suspense.fragment",data:this._data,fragment:this._selector.node,isRelayHooks:!1,isMissingData:this._isMissingData,isPromiseCached:!1,pendingOperations:s}),i}}return yve(this._environment,this._fieldErrors),this._data},t.setSelector=function(n){if(!(this._subscription!=null&&kve(n,this._selector))){this.dispose();var i=this._environment.lookup(n);this._data=Sve(this._data,i.data),this._isMissingData=i.isMissingData,this._fieldErrors=i.fieldErrors,this._selector=n,this._subscription=this._environment.subscribe(i,this._onChange)}},t.setVariables=function(n,i){if(!Ave(n,this._selector.variables)){var o=wve(i,n),s=Cve(this._selector.node,this._selector.dataID,n,o);this.setSelector(s)}},e})(),TT=(function(){function e(r,n,i,o,s){var a=this;(0,uw.default)(this,"_onChange",function(l){a._stale=!0,a._callback()}),this._callback=s,this._data=[],this._environment=r,this._resolvers=[],this._stale=!0,this._rootIsQueryRenderer=n,this._subscribeOnConstruction=o,this.setSelector(i)}var t=e.prototype;return t.dispose=function(){this._resolvers.forEach(vL)},t.resolve=function(){if(this._stale){for(var n=this._data,i,o=0;o<this._resolvers.length;o++){var s=n[o],a=this._resolvers[o].resolve();(i||a!==s)&&(i=i||n.slice(0,o),i.push(a))}!i&&this._resolvers.length!==n.length&&(i=n.slice(0,this._resolvers.length)),this._data=i||n,this._stale=!1}return this._data},t.setSelector=function(n){for(var i=n.selectors;this._resolvers.length>i.length;){var o=this._resolvers.pop();o.dispose()}for(var s=0;s<i.length;s++)s<this._resolvers.length?this._resolvers[s].setSelector(i[s]):this._resolvers[s]=new N1(this._environment,this._rootIsQueryRenderer,i[s],this._subscribeOnConstruction,this._onChange);this._stale=!0},t.setVariables=function(n,i){this._resolvers.forEach(function(o){return o.setVariables(n,i)}),this._stale=!0},e})();function vL(e){e&&e.dispose()}var $ve=Tve,Nve=$ve;function Dve(e,t,r,n,i,o){return new Nve(e,r,n,o,i)}var Fve=Dve,Ive=De,K_,$T;function Pve(e){return K_||(K_=e.createContext(null),$T=e),e!==$T&&Ive(!1),K_}var Ove=Pve,Mve=De,H_,NT;function Lve(e){return H_||(H_=e.createContext(null),NT=e),e!==NT&&Mve(!1),H_}var zve=Lve,_L=Object.freeze({__LIVE_RESOLVER_SUSPENSE_SENTINEL:!0});function Uve(){return _L}function Bve(e){return e===_L}var Ym={isSuspenseSentinel:Bve,suspenseSentinel:Uve},bL={exports:{}};(function(e){function t(r,n){if(r==null)return{};var i={};for(var o in r)if({}.hasOwnProperty.call(r,o)){if(n.indexOf(o)!==-1)continue;i[o]=r[o]}return i}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(bL);var Cd=bL.exports,Xm=Ke.default,jve=Xm(Xn),DT=Xm(Cd),FT=Xm(m4),Ua=Xm(Bt),qve=tL,yL=ks,xL=yL.generateClientObjectClientID;yL.isClientID;var Vve=Ym,SL=Vve.isSuspenseSentinel,pa=rr,D1=pa.ACTOR_IDENTIFIER_KEY,Rn=pa.ERRORS_KEY,dw=pa.ID_KEY,Kve=pa.INVALIDATED_AT_KEY,al=pa.REF_KEY,ed=pa.REFS_KEY,EL=pa.RELAY_RESOLVER_VALUE_KEY;pa.ROOT_ID;var fw=pa.TYPENAME_KEY,W_=ha,bu=De;function Hve(e){return(0,Ua.default)({},e)}function Wve(e,t){for(var r in e)e.hasOwnProperty(r)&&r!==dw&&r!==fw&&(t[r]=e[r])}function Gve(e,t){var r={};return r[dw]=e,r[fw]=t,r}function Jve(e){return e}function Qve(e){return e[dw]}function Yve(e){return Rn in e?Object.keys(e).filter(function(t){return t!==Rn}):Object.keys(e)}function Xve(e){return e[fw]}function Zve(e,t){var r;return(r=e[Rn])===null||r===void 0?void 0:r[t]}function hw(e,t){var r=e[t];return r&&typeof r=="object"&&(!r.hasOwnProperty(al)&&!r.hasOwnProperty(ed)||bu(!1)),r}function e_e(e,t){return t in e}function t_e(e,t){var r=e[t];if(r==null)return r;var n=r;return typeof n=="object"&&n&&typeof n[al]=="string"||bu(!1),n[al]}function r_e(e,t){var r=e[t];if(r==null)return!1;var n=r;return typeof n=="object"&&n&&typeof n[al]=="string"}function n_e(e,t){var r=e[t];return r==null?r:(typeof r=="object"&&Array.isArray(r[ed])||bu(!1),r[ed])}function i_e(e,t){var r=e[t];return r==null?!1:typeof r=="object"&&Array.isArray(r[ed])&&r[ed].every(function(n){return typeof n=="string"})}function o_e(e){if(e==null)return null;var t=e[Kve];return typeof t!="number"?null:t}function s_e(e,t){var r,n=e[Rn],i=t[Rn],o=null;if(n==null&&i==null){var s;for(var a in t)(o||!W_(e[a],t[a]))&&(o=o!==null?o:(0,Ua.default)({},e),o[a]=t[a]);return(s=o)!==null&&s!==void 0?s:e}for(var l in t)if(l!==Rn){var u=t[l],d=i?.[l];if(o==null){var f=e[l],h=n?.[l];if(W_(f,u)&&W_(h,d))continue;o=(0,Ua.default)({},e),n!=null&&(o[Rn]=(0,Ua.default)({},n))}kL(o,l,u),wL(o,l,d)}return(r=o)!==null&&r!==void 0?r:e}function a_e(e,t){if(Rn in e||Rn in t){var r=e[Rn],n=(0,DT.default)(e,[Rn].map(FT.default)),i=t[Rn],o=(0,DT.default)(t,[Rn].map(FT.default)),s=(0,Ua.default)((0,Ua.default)({},n),o);if(r==null&&i==null)return s;var a={};for(var l in r)o.hasOwnProperty(l)||(a[l]=r[l]);for(var u in i)a[u]=i[u];for(var d in a){s[Rn]=a;break}return s}else return(0,Ua.default)((0,Ua.default)({},e),t)}function l_e(e){qve(e)}function wL(e,t,r){var n=e[Rn];if(r!=null&&r.length>0)n==null?e[Rn]=(0,jve.default)({},t,r):n[t]=r;else if(n!=null&&delete n[t]){for(var i in n)if(n.hasOwnProperty(i))return;delete e[Rn]}}function kL(e,t,r){e[t]=r}function u_e(e,t,r){var n={};n[al]=r,e[t]=n}function c_e(e,t,r){var n={};n[ed]=r,e[t]=n}function d_e(e,t,r,n){var i={};i[al]=n,i[D1]=r,e[t]=i}function f_e(e,t){var r=e[t];return r==null?r:(typeof r=="object"&&typeof r[al]=="string"&&r[D1]!=null||bu(!1),[r[D1],r[al]])}function h_e(e,t){var r=hw(e,EL);return r==null||SL(r)?null:(typeof r=="object"&&(r=r.id),typeof r!="string"&&bu(!1),xL(t,r))}function p_e(e,t){var r=hw(e,EL);return r==null||SL(r)?null:(Array.isArray(r)||bu(!1),r.map(function(n){return n==null?null:(typeof n=="object"&&(n=n.id),typeof n!="string"&&bu(!1),xL(t,n))}))}function g_e(e){return e}var zi={clone:Hve,copyFields:Wve,create:Gve,freeze:l_e,fromObject:Jve,getDataID:Qve,getErrors:Zve,getFields:Yve,getInvalidationEpoch:o_e,getLinkedRecordID:t_e,getLinkedRecordIDs:n_e,getType:Xve,getValue:hw,hasValue:e_e,hasLinkedRecordID:r_e,hasLinkedRecordIDs:i_e,merge:a_e,setErrors:wL,setValue:kL,setLinkedRecordID:u_e,setLinkedRecordIDs:c_e,update:s_e,getActorLinkedRecordID:f_e,setActorLinkedRecordID:d_e,getResolverLinkedRecordID:h_e,getResolverLinkedRecordIDs:p_e,toJSON:g_e},m_e={EXISTENT:"EXISTENT",NONEXISTENT:"NONEXISTENT",UNKNOWN:"UNKNOWN"},Zm=m_e,v_e=Ke.default,__e=v_e(Tr),IT=zi,pw=Zm,b_e=pw.EXISTENT,y_e=pw.NONEXISTENT,x_e=pw.UNKNOWN,S_e=(function(){function e(r){var n=this;this._records=new Map,r!=null&&Object.keys(r).forEach(function(i){var o=r[i],s=IT.fromObject(o);n._records.set(i,s)})}e.create=function(n){return new e(n)};var t=e.prototype;return t.clear=function(){this._records=new Map},t.delete=function(n){this._records.set(n,null)},t.get=function(n){return this._records.get(n)},t.getRecordIDs=function(){return Array.from(this._records.keys())},t.getStatus=function(n){return this._records.has(n)?this._records.get(n)==null?y_e:b_e:x_e},t.has=function(n){return this._records.has(n)},t.remove=function(n){this._records.delete(n)},t.set=function(n,i){this._records.set(n,i)},t.size=function(){return this._records.size},t.toJSON=function(){var n={},i=(0,__e.default)(this._records),o;try{for(i.s();!(o=i.n()).done;){var s=o.value,a=s[0],l=s[1];n[a]=IT.toJSON(l)}}catch(u){i.e(u)}finally{i.f()}return n},e})(),Iu=S_e,E_e=De,CL="INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE";function w_e(e){e!==CL&&E_e(!1)}var gw={assertInternalActorIdentifier:w_e,getActorIdentifier:function(t){return t},INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE:CL},F1="actor_key",k_e=gw,C_e=k_e.getActorIdentifier;function R_e(e){if(e!=null&&typeof e=="object"&&typeof e[F1]=="string")return C_e(e[F1])}var A_e={ACTOR_IDENTIFIER_FIELD_NAME:F1,getActorIdentifierFromPayload:R_e},ev=Ke.default,PT=ev(Bt),T_e=ev(Cd),RL=ev(Tr),$_e=ev(vl),N_e=["path","locations"],I1=Symbol("$SELF");function D_e(e){if(e==null)return null;var t=new Map,r=(0,RL.default)(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.path,s=i.locations,a=(0,T_e.default)(i,N_e);if(o!=null){var l=o.length;if(l!==0){for(var u=l-1,d=t,f=0;f<u;f++){var h=o[f],p=d.get(h);if(p instanceof Map){d=p;continue}var g=new Map;Array.isArray(p)&&g.set(I1,p),d.set(h,g),d=g}var m=o[u],v=d.get(m);v instanceof Map&&(d=v,v=d.get(m),m=I1),Array.isArray(v)?v.push(a):d.set(m,[a])}}}}catch(_){r.e(_)}finally{r.f()}return t}function F_e(e,t){var r=e.get(t);if(r==null)return null;if(Array.isArray(r))return r;var n=[];return AL(r,n),n}function AL(e,t){var r=(0,RL.default)(e),n;try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i[0],s=i[1],a=t.length;if(Array.isArray(s)?t.push.apply(t,(0,$_e.default)(s)):AL(s,t),o!==I1)for(var l=t.length,u=a;u<l;u++){var d=t[u];d.path==null?t[u]=(0,PT.default)((0,PT.default)({},d),{},{path:[o]}):d.path.unshift(o)}}}catch(f){r.e(f)}finally{r.f()}}function I_e(e,t){var r=e.get(t);return r instanceof Map?r:null}var P_e={buildErrorTrie:D_e,getNestedErrorTrieByKey:I_e,getErrorsByKey:F_e},O_e="client:__type:",M_e="__TypeSchema";function L_e(e){return O_e+e}var tv={generateTypeID:L_e,TYPE_SCHEMA_TYPE:M_e},TL=Ke.default,z_e=TL(Tr),Yd=TL(vl),$L=A_e;$L.ACTOR_IDENTIFIER_FIELD_NAME;var U_e=$L.getActorIdentifierFromPayload,OT=go,NL=ks,G_=NL.generateClientID,B_e=NL.isClientID,j_e=_l,q_e=j_e.getLocalVariables,mw=P_e,V_e=mw.buildErrorTrie,K_e=mw.getErrorsByKey,MT=mw.getNestedErrorTrieByKey,pt=zi,H_e=Go,W_e=H_e.createNormalizationSelector,Pu=rr,G_e=Pu.ROOT_ID,J_e=Pu.TYPENAME_KEY,LT=Pu.getArgumentValues,Q_e=Pu.getHandleStorageKey,Y_e=Pu.getModuleComponentKey,X_e=Pu.getModuleOperationKey,J_=Pu.getStorageKey,DL=tv,Q_=DL.TYPE_SCHEMA_TYPE,Y_=DL.generateTypeID,ti=De;function Z_e(e,t,r,n,i,o){var s=t.dataID,a=t.node,l=t.variables,u=new ebe(e,l,n,o??!1);return u.normalizeResponse(a,s,r,i)}var ebe=(function(){function e(r,n,i,o){this._actorIdentifier=i.actorIdentifier,this._getDataId=i.getDataID,this._handleFieldPayloads=[],this._treatMissingFieldsAsNull=i.treatMissingFieldsAsNull,this._incrementalPlaceholders=[],this._isClientExtension=!1,this._isUnmatchedAbstractType=!1,this._useExecTimeResolvers=o,this._followupPayloads=[],this._path=i.path?(0,Yd.default)(i.path):[],this._recordSource=r,this._variables=n,this._shouldProcessClientComponents=i.shouldProcessClientComponents,this._log=i.log}var t=e.prototype;return t.normalizeResponse=function(n,i,o,s){var a=this._recordSource.get(i);return a||ti(!1),this._assignClientAbstractTypes(n),this._errorTrie=V_e(s),this._traverseSelections(n,a,o),{errors:s,fieldPayloads:this._handleFieldPayloads,incrementalPlaceholders:this._incrementalPlaceholders,followupPayloads:this._followupPayloads,source:this._recordSource,isFinal:!1}},t._assignClientAbstractTypes=function(n){var i=n.clientAbstractTypes;if(i!=null)for(var o=0,s=Object.keys(i);o<s.length;o++){var a=s[o],l=(0,z_e.default)(i[a]),u;try{for(l.s();!(u=l.n()).done;){var d=u.value,f=Y_(d),h=this._recordSource.get(f);h==null&&(h=pt.create(f,Q_),this._recordSource.set(f,h)),pt.setValue(h,a,!0)}}catch(p){l.e(p)}finally{l.f()}}},t._getVariableValue=function(n){return this._variables.hasOwnProperty(n)||ti(!1),this._variables[n]},t._getRecordType=function(n){var i=n[J_e];return i==null&&ti(!1),i},t._traverseSelections=function(n,i,o){for(var s=0;s<n.selections.length;s++){var a=n.selections[s];switch(a.kind){case"ScalarField":case"LinkedField":this._normalizeField(a,i,o);break;case"Condition":var l=!!this._getVariableValue(a.condition);l===a.passingValue&&this._traverseSelections(a,i,o);break;case"FragmentSpread":{var u=this._variables;this._variables=q_e(this._variables,a.fragment.argumentDefinitions,a.args),this._traverseSelections(a.fragment,i,o),this._variables=u;break}case"InlineFragment":{var d=a.abstractKey;if(d==null){var f=pt.getType(i);f===a.type&&this._traverseSelections(a,i,o)}else{var h=Object.prototype.hasOwnProperty.call(o,d),p=pt.getType(i),g=Y_(p),m=this._recordSource.get(g);m==null&&(m=pt.create(g,Q_),this._recordSource.set(g,m)),pt.setValue(m,d,h),h&&this._traverseSelections(a,i,o)}break}case"TypeDiscriminator":{var v=a.abstractKey,_=Object.prototype.hasOwnProperty.call(o,v),x=pt.getType(i),w=Y_(x),S=this._recordSource.get(w);S==null&&(S=pt.create(w,Q_),this._recordSource.set(w,S)),pt.setValue(S,v,_);break}case"LinkedHandle":case"ScalarHandle":var k=a.args?LT(a.args,this._variables):{},A=J_(a,this._variables),C=Q_e(a,this._variables);this._handleFieldPayloads.push({args:k,dataID:pt.getDataID(i),fieldKey:A,handle:a.handle,handleKey:C,handleArgs:a.handleArgs?LT(a.handleArgs,this._variables):{}});break;case"ModuleImport":this._normalizeModuleImport(a,i,o);break;case"Defer":this._normalizeDefer(a,i,o);break;case"Stream":this._normalizeStream(a,i,o);break;case"ClientExtension":var R=this._isClientExtension;this._isClientExtension=!0,this._traverseSelections(a,i,o),this._isClientExtension=R;break;case"ClientComponent":if(this._shouldProcessClientComponents===!1)break;this._traverseSelections(a.fragment,i,o);break;case"ActorChange":this._normalizeActorChange(a,i,o);break;case"RelayResolver":case"RelayLiveResolver":this._useExecTimeResolvers||this._normalizeResolver(a,i,o);break;case"ClientEdgeToClientObject":this._useExecTimeResolvers||this._normalizeResolver(a.backingField,i,o);break;default:ti(!1)}}},t._normalizeResolver=function(n,i,o){n.fragment!=null&&this._traverseSelections(n.fragment,i,o)},t._normalizeDefer=function(n,i,o){var s=n.if===null||this._getVariableValue(n.if);s===!1?this._traverseSelections(n,i,o):this._incrementalPlaceholders.push({kind:"defer",data:o,label:n.label,path:(0,Yd.default)(this._path),selector:W_e(n,pt.getDataID(i),this._variables),typeName:pt.getType(i),actorIdentifier:this._actorIdentifier})},t._normalizeStream=function(n,i,o){this._traverseSelections(n,i,o);var s=n.if===null||this._getVariableValue(n.if);s===!0&&this._incrementalPlaceholders.push({kind:"stream",label:n.label,path:(0,Yd.default)(this._path),parentID:pt.getDataID(i),node:n,variables:this._variables,actorIdentifier:this._actorIdentifier})},t._normalizeModuleImport=function(n,i,o){typeof o=="object"&&o||ti(!1);var s=pt.getType(i),a=Y_e(n.documentName),l=n.componentModuleProvider||o[a];pt.setValue(i,a,l??null);var u=X_e(n.documentName),d=n.operationModuleProvider||o[u];pt.setValue(i,u,d??null),d!=null&&this._followupPayloads.push({kind:"ModuleImportPayload",args:n.args,data:o,dataID:pt.getDataID(i),operationReference:d,path:(0,Yd.default)(this._path),typeName:s,variables:this._variables,actorIdentifier:this._actorIdentifier})},t._normalizeField=function(n,i,o){typeof o=="object"&&o||ti(!1);var s=n.alias||n.name,a=J_(n,this._variables),l=o[s],u=OT.ENABLE_NONCOMPLIANT_ERROR_HANDLING_ON_LISTS&&Array.isArray(l)&&l.length===0;if(l==null||u){if(l===void 0){var d=this._isClientExtension||this._isUnmatchedAbstractType;if(d)return;if(!this._treatMissingFieldsAsNull)return}n.kind==="ScalarField"&&this._validateConflictingFieldsWithIdenticalId(i,a,null),u?n.kind==="LinkedField"?pt.setLinkedRecordIDs(i,a,[]):pt.setValue(i,a,[]):pt.setValue(i,a,null);var f=this._errorTrie;if(f!=null){var h=K_e(f,s);h!=null&&pt.setErrors(i,a,h)}return}if(n.kind==="ScalarField")this._validateConflictingFieldsWithIdenticalId(i,a,l),pt.setValue(i,a,l);else if(n.kind==="LinkedField"){this._path.push(s);var p=this._errorTrie;this._errorTrie=p==null?null:MT(p,s),n.plural?this._normalizePluralLink(n,i,a,l):this._normalizeLink(n,i,a,l),this._errorTrie=p,this._path.pop()}else ti(!1)},t._normalizeActorChange=function(n,i,o){var s,a=n.linkedField;typeof o=="object"&&o||ti(!1);var l=a.alias||a.name,u=J_(a,this._variables),d=o[l];if(d==null){if(d===void 0){var f=this._isClientExtension||this._isUnmatchedAbstractType;if(f)return;if(!this._treatMissingFieldsAsNull)return}pt.setValue(i,u,null);return}var h=U_e(d);if(h==null){pt.setValue(i,u,null);return}var p=(s=a.concreteType)!==null&&s!==void 0?s:this._getRecordType(d),g=this._getDataId(d,p)||pt.getLinkedRecordID(i,u)||G_(pt.getDataID(i),u);typeof g!="string"&&ti(!1),pt.setActorLinkedRecordID(i,u,h,g),this._followupPayloads.push({kind:"ActorPayload",data:d,dataID:g,path:[].concat((0,Yd.default)(this._path),[l]),typeName:p,variables:this._variables,node:a,actorIdentifier:h})},t._normalizeLink=function(n,i,o,s){var a;typeof s=="object"&&s||ti(!1);var l=this._getDataId(s,(a=n.concreteType)!==null&&a!==void 0?a:this._getRecordType(s))||pt.getLinkedRecordID(i,o)||G_(pt.getDataID(i),o);typeof l!="string"&&ti(!1),this._validateConflictingLinkedFieldsWithIdenticalId(pt.getLinkedRecordID(i,o),l,o),pt.setLinkedRecordID(i,o,l);var u=this._recordSource.get(l);if(u)this._validateRecordType(u,n,s);else{var d=n.concreteType||this._getRecordType(s);u=pt.create(l,d),this._recordSource.set(l,u)}this._traverseSelections(n,u,s)},t._normalizePluralLink=function(n,i,o,s){var a=this;Array.isArray(s)||ti(!1);var l=pt.getLinkedRecordIDs(i,o),u=[];s.forEach(function(d,f){var h;if(d==null){u.push(d);return}a._path.push(String(f));var p=a._errorTrie;a._errorTrie=p==null?null:MT(p,f),typeof d!="object"&&ti(!1);var g=a._getDataId(d,(h=n.concreteType)!==null&&h!==void 0?h:a._getRecordType(d))||l&&l[f]||G_(pt.getDataID(i),o,f);typeof g!="string"&&ti(!1),u.push(g);var m=a._recordSource.get(g);if(m)a._validateRecordType(m,n,d);else{var v=n.concreteType||a._getRecordType(d);m=pt.create(g,v),a._recordSource.set(g,m)}l&&a._validateConflictingLinkedFieldsWithIdenticalId(l[f],g,o),a._traverseSelections(n,m,d),a._errorTrie=p,a._path.pop()}),pt.setLinkedRecordIDs(i,o,u)},t._validateRecordType=function(n,i,o){if(OT.ENABLE_STORE_ID_COLLISION_LOGGING){var s,a=(s=i.concreteType)!==null&&s!==void 0?s:this._getRecordType(o),l=pt.getDataID(n),u=B_e(l)&&l!==G_e||pt.getType(n)===a;if(!u){var d={name:"idCollision.typename",previous_typename:pt.getType(n),new_typename:a};this._log!=null&&this._log(d)}}},t._validateConflictingFieldsWithIdenticalId=function(n,i,o){},t._validateConflictingLinkedFieldsWithIdenticalId=function(n,i,o){},e})(),FL={normalize:Z_e},rv=Ke.default,zT=rv(Bt),tbe=rv(zi),rbe=rv(Iu),nbe=rv(FL);function ibe(e,t,r,n,i){var o,s=e.data,a=e.errors,l=rbe.default.create(),u=tbe.default.create(t.dataID,r);l.set(t.dataID,u);var d=nbe.default.normalize(l,t,s,n,a,i);return(0,zT.default)((0,zT.default)({},d),{},{isFinal:((o=e.extensions)===null||o===void 0?void 0:o.is_final)===!0})}var obe=ibe,sbe=Wo,abe=sbe.getInlineDataFragment,lbe=rr,ube=lbe.FRAGMENTS_KEY,UT=De;function cbe(e,t){var r,n=abe(e);if(t==null)return t;typeof t!="object"&&UT(!1);var i=(r=t[ube])===null||r===void 0?void 0:r[n.name];return i==null&&UT(!1),i}var dbe=cbe,fbe=1e5;function hbe(){return fbe++}var IL=hbe,pbe=IL;function gbe(e,t){return{execute:function(n,i,o,s,a,l,u,d){var f=pbe(),h={start:function(m){e.__log({name:"network.start",networkRequestId:f,params:n,variables:i,cacheConfig:o})},next:function(m){e.__log({name:"network.next",networkRequestId:f,response:m})},error:function(m){e.__log({name:"network.error",networkRequestId:f,error:m})},complete:function(){e.__log({name:"network.complete",networkRequestId:f})},unsubscribe:function(){e.__log({name:"network.unsubscribe",networkRequestId:f})}},p=function(m){e.__log({name:"network.info",networkRequestId:f,info:m})};return t.execute(n,i,o,s,p,l,u,d).do(h)}}}var mbe=gbe,vbe=Ke.default,Xd=vbe(Tr),_be=De,bbe=(function(){function e(){this._ownersToPendingOperations=new Map,this._pendingOperationsToOwners=new Map,this._ownersToPendingPromise=new Map}var t=e.prototype;return t.update=function(n,i){if(i.size!==0){var o=n.identifier,s=new Set,a=(0,Xd.default)(i),l;try{for(a.s();!(l=a.n()).done;){var u=l.value,d=u.identifier,f=this._ownersToPendingOperations.get(d);f!=null?f.has(o)||(f.set(o,n),s.add(d)):(this._ownersToPendingOperations.set(d,new Map([[o,n]])),s.add(d))}}catch(v){a.e(v)}finally{a.f()}if(s.size!==0){var h=this._pendingOperationsToOwners.get(o)||new Set,p=(0,Xd.default)(s),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;this._resolveOwnerResolvers(m),h.add(m)}}catch(v){p.e(v)}finally{p.f()}this._pendingOperationsToOwners.set(o,h)}}},t.complete=function(n){var i=n.identifier,o=this._pendingOperationsToOwners.get(i);if(o!=null){var s=new Set,a=new Set,l=(0,Xd.default)(o),u;try{for(l.s();!(u=l.n()).done;){var d=u.value,f=this._ownersToPendingOperations.get(d);f&&(f.delete(i),f.size>0?a.add(d):s.add(d))}}catch(x){l.e(x)}finally{l.f()}var h=(0,Xd.default)(s),p;try{for(h.s();!(p=h.n()).done;){var g=p.value;this._resolveOwnerResolvers(g),this._ownersToPendingOperations.delete(g)}}catch(x){h.e(x)}finally{h.f()}var m=(0,Xd.default)(a),v;try{for(m.s();!(v=m.n()).done;){var _=v.value;this._resolveOwnerResolvers(_)}}catch(x){m.e(x)}finally{m.f()}this._pendingOperationsToOwners.delete(i)}},t._resolveOwnerResolvers=function(n){var i=this._ownersToPendingPromise.get(n);i?.resolve(),this._ownersToPendingPromise.delete(n)},t.getPendingOperationsAffectingOwner=function(n){var i=n.identifier,o=this._ownersToPendingOperations.get(i);if(o==null||o.size===0)return null;var s=this._ownersToPendingPromise.get(i);if(s!=null)return{promise:s.promise,pendingOperations:s.pendingOperations};var a,l=new Promise(function(d){a=d});a==null&&_be(!1);var u=Array.from(o.values());return this._ownersToPendingPromise.set(i,{promise:l,resolve:a,pendingOperations:u}),{promise:l,pendingOperations:u}},e})(),ybe=bbe;function xbe(e){var t=typeof H0<"u"?H0:typeof window<"u"?window:void 0,r=t&&t.__RELAY_DEVTOOLS_HOOK__;r&&r.registerEnvironment(e)}var Sbe=xbe,Ebe=ks,wbe=Ebe.generateClientID,kbe=rr,Cbe=kbe.ROOT_ID,Rbe=wbe(Cbe,"viewer"),Abe="Viewer",vw={VIEWER_ID:Rbe,VIEWER_TYPE:Abe},PL=vw,Tbe=PL.VIEWER_ID,$be=PL.VIEWER_TYPE;function Nbe(e,t){return t===$be&&e.id==null?Tbe:e.id}var OL=Nbe,Dbe=function(t){},Fbe=Dbe,ML=$u,Ibe=ML.REQUEST,Pbe=ML.SPLIT_OPERATION;function Obe(e){switch(e.kind){case Ibe:return e.operation;case Pbe:default:return e}}var _w=Obe;function BT(e,t,r){for(var n=arguments.length,i=new Array(n>3?n-3:0),o=3;o<n;o++)i[o-3]=arguments[o];var s=0,a=r.replace(/%s/g,function(){return String(i[s++])}),l=new Error(a),u=Object.assign(l,{name:t,messageFormat:r,messageParams:i,type:e,taalOpcodes:[2,2]});if(u.stack===void 0)try{throw u}catch{}return u}var Mbe={create:function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];return BT.apply(void 0,["error",t,r].concat(i))},createWarning:function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];return BT.apply(void 0,["warn",t,r].concat(i))}},X_,Z_,Lbe=typeof window<"u"&&typeof((X_=window)===null||X_===void 0||(Z_=X_.performance)===null||Z_===void 0?void 0:Z_.now)=="function";function jT(){return Lbe?window.performance.now():Date.now()}function zbe(e){var t=jT(),r=e();return[t,jT()-t,r]}var Ube=zbe,LL=Ke.default,Zd=LL(Tr),ef=LL(vl),eb=bl,Bbe=IL,tb=_w,jbe=Mbe,Wp=go,qbe=Nu,Vbe=qbe.stableCopy,Kbe=Ube,zL=ks,qT=zL.generateClientID,Hbe=zL.generateUniqueClientID,Wbe=_l,Gbe=Wbe.getLocalVariables,Gp=zi,UL=Go,rb=UL.createNormalizationSelector,Jbe=UL.createReaderSelector,Jp=Iu,bw=rr,VT=bw.ROOT_TYPE,Qbe=bw.TYPENAME_KEY,Ybe=bw.getStorageKey,Dr=De;function Xbe(e){return new Zbe(e)}var Zbe=(function(){function e(r){var n=this,i,o,s,a=r.actorIdentifier,l=r.getDataID,u=r.getPublishQueue,d=r.getStore,f=r.isClientPayload,h=r.operation,p=r.operationExecutions,g=r.operationLoader,m=r.operationTracker,v=r.optimisticConfig,_=r.scheduler,x=r.shouldProcessClientComponents,w=r.sink,S=r.source,k=r.treatMissingFieldsAsNull,A=r.updater,C=r.log,R=r.normalizeResponse;this._actorIdentifier=a,this._getDataID=l,this._treatMissingFieldsAsNull=k,this._incrementalPayloadsPending=!1,this._incrementalResults=new Map,this._log=C,this._executeId=Bbe(),this._nextSubscriptionId=0,this._operation=h,this._operationExecutions=p,this._operationLoader=g,this._operationTracker=m,this._operationUpdateEpochs=new Map,this._optimisticUpdates=null,this._useExecTimeResolvers=(i=(o=this._operation.request.node.operation.use_exec_time_resolvers)!==null&&o!==void 0?o:((s=this._operation.request.node.operation.exec_time_resolvers_enabled_provider)===null||s===void 0?void 0:s.get())===!0)!==null&&i!==void 0?i:!1,this._execTimeResolverResponseComplete=!1,this._pendingModulePayloadsCount=0,this._getPublishQueue=u,this._scheduler=_,this._sink=w,this._source=new Map,this._state="started",this._getStore=d,this._subscriptions=new Map,this._updater=A,this._isClientPayload=f===!0,this._isSubscriptionOperation=this._operation.request.node.params.operationKind==="subscription",this._shouldProcessClientComponents=x,this._retainDisposables=new Map,this._seenActors=new Set,this._completeFns=[],this._normalizeResponse=R;var N=this._nextSubscriptionId++;Wp.PROCESS_OPTIMISTIC_UPDATE_BEFORE_SUBSCRIPTION&&v!=null&&this._processOptimisticResponse(v.response!=null?{data:v.response}:null,v.updater,!1),S.subscribe({complete:function(){return n._complete(N)},error:function(P){return n._error(P)},next:function(P){try{n._next(N,P)}catch(z){w.error(z)}},start:function(P){var z;n._start(N,P),n._log({name:"execute.start",executeId:n._executeId,params:n._operation.request.node.params,variables:n._operation.request.variables,cacheConfig:(z=n._operation.request.cacheConfig)!==null&&z!==void 0?z:{}})},unsubscribe:function(){n._log({name:"execute.unsubscribe",executeId:n._executeId})}}),!Wp.PROCESS_OPTIMISTIC_UPDATE_BEFORE_SUBSCRIPTION&&v!=null&&this._processOptimisticResponse(v.response!=null?{data:v.response}:null,v.updater,!1)}var t=e.prototype;return t.cancel=function(){var n=this;if(this._state!=="completed"){this._state="completed",this._operationExecutions.delete(this._operation.request.identifier),this._subscriptions.size!==0&&(this._subscriptions.forEach(function(o){return o.unsubscribe()}),this._subscriptions.clear());var i=this._optimisticUpdates;i!==null&&(this._optimisticUpdates=null,i.forEach(function(o){return n._getPublishQueueAndSaveActor().revertUpdate(o)}),this._runPublishQueue()),this._incrementalResults.clear(),this._asyncStoreUpdateDisposable!=null&&(this._asyncStoreUpdateDisposable.dispose(),this._asyncStoreUpdateDisposable=null),this._completeFns=[],this._completeOperationTracker(),this._disposeRetainedData()}},t._updateActiveState=function(){var n;switch(this._state){case"started":{n="active";break}case"loading_incremental":{n="active";break}case"completed":{n="inactive";break}case"loading_final":{n=this._pendingModulePayloadsCount>0||this._useExecTimeResolvers&&!this._execTimeResolverResponseComplete?"active":"inactive";break}default:this._state,Dr(!1)}this._operationExecutions.set(this._operation.request.identifier,n)},t._schedule=function(n,i){var o=this,s=this._scheduler;if(s!=null){var a=this._nextSubscriptionId++;eb.create(function(l){var u=s.schedule(function(){try{n(),l.complete()}catch(d){l.error(d)}},i);return function(){return s.cancel(u)}}).subscribe({complete:function(){return o._complete(a)},error:function(u){return o._error(u)},start:function(u){return o._start(a,u)}})}else n()},t._complete=function(n){this._subscriptions.delete(n),this._subscriptions.size===0&&(this.cancel(),this._sink.complete(),this._log({name:"execute.complete",executeId:this._executeId}))},t._error=function(n){this.cancel(),this._sink.error(n),this._log({name:"execute.error",executeId:this._executeId,error:n})},t._start=function(n,i){this._subscriptions.set(n,i),this._updateActiveState()},t._next=function(n,i){var o=this,s=this._state==="loading_incremental"?"low":"default";this._schedule(function(){o._log({name:"execute.next.start",executeId:o._executeId,response:i,operation:o._operation}),o._handleNext(i),o._maybeCompleteSubscriptionOperationTracking(),o._log({name:"execute.next.end",executeId:o._executeId,response:i,operation:o._operation})},s)},t._handleErrorResponse=function(n){var i=this,o=[];return n.forEach(function(s){if(!(s.data===null&&s.extensions!=null&&!s.hasOwnProperty("errors")))if(s.data==null){var a=s.hasOwnProperty("errors")&&s.errors!=null?s.errors:null,l=a?a.map(function(f){var h=f.message;return h}).join(`
68
- `):"(No errors)",u=jbe.create("RelayNetwork","No data returned for operation `"+i._operation.request.node.params.name+"`, got error(s):\n"+l+"\n\nSee the error `source` property for more information.");throw u.source={errors:a,operation:i._operation.request.node,variables:i._operation.request.variables},u.stack,u}else{var d=s;o.push(d)}}),o},t._handleOptimisticResponses=function(n){var i;if(n.length>1)return n.some(function(a){var l;return((l=a.extensions)===null||l===void 0?void 0:l.isOptimistic)===!0})&&Dr(!1),!1;var o=n[0],s=((i=o.extensions)===null||i===void 0?void 0:i.isOptimistic)===!0;return s&&this._state!=="started"&&Dr(!1),s?(this._processOptimisticResponse(o,null,this._treatMissingFieldsAsNull),this._sink.next(o),!0):!1},t._handleNext=function(n){if(this._state!=="completed"){this._seenActors.clear();var i=Array.isArray(n)?n:[n],o=this._handleErrorResponse(i);if(o.length===0){var s=i.some(function(R){var N;return((N=R.extensions)===null||N===void 0?void 0:N.is_final)===!0});s&&(this._state="loading_final",this._updateActiveState(),this._incrementalPayloadsPending=!1),this._sink.next(n);return}var a=this._handleOptimisticResponses(o);if(!a){var l=eye(o),u=l[0],d=l[1],f=l[2],h=u.length>0,p=f.length>0;if(h){if(this._isSubscriptionOperation){var g=Hbe();this._operation={request:this._operation.request,fragment:Jbe(this._operation.fragment.node,g,this._operation.fragment.variables,this._operation.fragment.owner),root:rb(this._operation.root.node,g,this._operation.root.variables)}}var m=this._processResponses(u);this._processPayloadFollowups(m)}if(p)for(var v=[],_=0;_<f.length;_++){var x,w=f[_],S=new Jp(w.data),s=((x=w.extensions)===null||x===void 0?void 0:x.is_final)===!0,k={errors:[],fieldPayloads:[],followupPayloads:[],incrementalPlaceholders:[],isFinal:s,source:S};this._getPublishQueueAndSaveActor().commitPayload(this._operation,k,this._updater),v.push(k),this._execTimeResolverResponseComplete=s,s&&this._updateActiveState()}if(d.length>0){var A=this._processIncrementalResponses(d);this._processPayloadFollowups(A)}this._isSubscriptionOperation&&(o[0].extensions==null?o[0].extensions={__relay_subscription_root_id:this._operation.fragment.dataID}:o[0].extensions.__relay_subscription_root_id=this._operation.fragment.dataID);var C=this._runPublishQueue(h||p?this._operation:void 0);h&&this._incrementalPayloadsPending&&this._retainData(),this._updateOperationTracker(C),this._sink.next(n)}}},t._processOptimisticResponse=function(n,i,o){var s=this;if(this._optimisticUpdates!==null&&Dr(!1),!(n==null&&i==null)){var a=[];if(n){var l=this._normalizeResponse(n,this._operation.root,VT,{actorIdentifier:this._actorIdentifier,getDataID:this._getDataID,log:this._log,path:[],shouldProcessClientComponents:this._shouldProcessClientComponents,treatMissingFieldsAsNull:o},this._useExecTimeResolvers);KT(l),a.push({operation:this._operation,payload:l,updater:i}),this._processOptimisticFollowups(l,a)}else i&&a.push({operation:this._operation,payload:{errors:null,fieldPayloads:null,incrementalPlaceholders:null,followupPayloads:null,source:Jp.create(),isFinal:!1},updater:i});this._optimisticUpdates=a,a.forEach(function(d){return s._getPublishQueueAndSaveActor().applyUpdate(d)});var u=this._runPublishQueue();Wp.ENABLE_OPERATION_TRACKER_OPTIMISTIC_UPDATES&&this._updateOperationTracker(u)}},t._processOptimisticFollowups=function(n,i){if(n.followupPayloads&&n.followupPayloads.length){var o=n.followupPayloads,s=(0,Zd.default)(o),a;try{for(s.s();!(a=s.n()).done;){var l=a.value;switch(l.kind){case"ModuleImportPayload":var u=this._expectOperationLoader(),d=u.get(l.operationReference);if(d==null)this._processAsyncOptimisticModuleImport(l);else{var f=this._processOptimisticModuleImport(d,l);i.push.apply(i,(0,ef.default)(f))}break;case"ActorPayload":break;default:Dr(!1)}}}catch(h){s.e(h)}finally{s.f()}}},t._normalizeFollowupPayload=function(n,i){var o;i.kind==="SplitOperation"&&n.kind==="ModuleImportPayload"?o=Gbe(n.variables,i.argumentDefinitions,n.args):o=n.variables;var s=rb(i,n.dataID,o),a={data:n.data,extensions:this._state==="loading_final"?{is_final:!0}:void 0};return this._normalizeResponse(a,s,n.typeName,{actorIdentifier:this._actorIdentifier,getDataID:this._getDataID,log:this._log,path:n.path,treatMissingFieldsAsNull:this._treatMissingFieldsAsNull,shouldProcessClientComponents:this._shouldProcessClientComponents},this._useExecTimeResolvers)},t._processOptimisticModuleImport=function(n,i){var o=tb(n),s=[],a=this._normalizeFollowupPayload(i,o);return KT(a),s.push({operation:this._operation,payload:a,updater:null}),this._processOptimisticFollowups(a,s),s},t._processAsyncOptimisticModuleImport=function(n){var i=this;this._expectOperationLoader().load(n.operationReference).then(function(o){if(!(o==null||i._state!=="started")){var s=i._processOptimisticModuleImport(o,n);if(s.forEach(function(l){return i._getPublishQueueAndSaveActor().applyUpdate(l)}),i._optimisticUpdates!=null){var a;(a=i._optimisticUpdates).push.apply(a,(0,ef.default)(s)),i._runPublishQueue()}}})},t._processResponses=function(n){var i=this;return this._log({name:"execute.normalize.start",operation:this._operation}),this._optimisticUpdates!==null&&(this._optimisticUpdates.forEach(function(o){i._getPublishQueueAndSaveActor().revertUpdate(o)}),this._optimisticUpdates=null),this._incrementalPayloadsPending=!1,this._incrementalResults.clear(),this._source.clear(),n.map(function(o){var s=i._normalizeResponse(o,i._operation.root,VT,{actorIdentifier:i._actorIdentifier,getDataID:i._getDataID,log:i._log,path:[],treatMissingFieldsAsNull:i._treatMissingFieldsAsNull,shouldProcessClientComponents:i._shouldProcessClientComponents},i._useExecTimeResolvers);return i._getPublishQueueAndSaveActor().commitPayload(i._operation,s,i._updater),i._log({name:"execute.normalize.end",operation:i._operation}),s})},t._processPayloadFollowups=function(n){var i=this;this._state!=="completed"&&n.forEach(function(o){var s=o.incrementalPlaceholders,a=o.followupPayloads,l=o.isFinal;if(i._state=l?"loading_final":"loading_incremental",i._updateActiveState(),l&&(i._incrementalPayloadsPending=!1),a&&a.length!==0&&a.forEach(function(d){var f,h=i._actorIdentifier;i._actorIdentifier=(f=d.actorIdentifier)!==null&&f!==void 0?f:i._actorIdentifier,i._processFollowupPayload(d),i._actorIdentifier=h}),s&&s.length!==0&&(i._incrementalPayloadsPending=i._state!=="loading_final",s.forEach(function(d){var f,h=i._actorIdentifier;i._actorIdentifier=(f=d.actorIdentifier)!==null&&f!==void 0?f:i._actorIdentifier,i._processIncrementalPlaceholder(o,d),i._actorIdentifier=h}),i._isClientPayload||i._state==="loading_final")){var u=[];s.forEach(function(d){d.kind==="defer"&&u.push(i._processDeferResponse(d.label,d.path,d,{data:d.data,extensions:{is_final:!0}}))}),u.length>0&&i._processPayloadFollowups(u)}})},t._maybeCompleteSubscriptionOperationTracking=function(){!this._isSubscriptionOperation&&!(this._useExecTimeResolvers&&this._execTimeResolverResponseComplete&&this._state==="loading_final")||this._pendingModulePayloadsCount===0&&this._incrementalPayloadsPending===!1&&this._completeOperationTracker()},t._processFollowupPayload=function(n){var i=this;switch(n.kind){case"ModuleImportPayload":var o=this._expectOperationLoader(),s=o.get(n.operationReference);if(s!=null)this._processFollowupPayloadWithNormalizationNode(n,tb(s));else{var a=this._nextSubscriptionId++;this._pendingModulePayloadsCount++;var l=function(){i._pendingModulePayloadsCount--,i._maybeCompleteSubscriptionOperationTracking()},u=eb.from(new Promise(function(d,f){o.load(n.operationReference).then(d,f)}));eb.create(function(d){var f,h=u.subscribe({next:function(g){if(g!=null){var m=function(){try{var x=tb(g),w=Wp.BATCH_ASYNC_MODULE_UPDATES_FN,S=w!=null&&i._pendingModulePayloadsCount>1,k=Kbe(function(){if(i._handleFollowupPayload(n,x),S)i._scheduleAsyncStoreUpdate(w,d.complete);else{var R=i._runPublishQueue();i._updateOperationTracker(R)}}),A=k[0],C=k[1];i._log({name:"execute.async.module",executeId:i._executeId,operationName:x.name,duration:C}),S||d.complete()}catch(R){d.error(R)}},v=i._scheduler;v==null?m():f=v.schedule(m)}else d.complete()},error:d.error});return function(){h.unsubscribe(),i._scheduler!=null&&f!=null&&i._scheduler.cancel(f)}}).subscribe({complete:function(){i._complete(a),l()},error:function(f){i._error(f),l()},start:function(f){return i._start(a,f)}})}break;case"ActorPayload":this._processFollowupPayloadWithNormalizationNode(n,n.node);break;default:Dr(!1)}},t._processFollowupPayloadWithNormalizationNode=function(n,i){this._handleFollowupPayload(n,i),this._maybeCompleteSubscriptionOperationTracking()},t._handleFollowupPayload=function(n,i){var o=this._normalizeFollowupPayload(n,i);this._getPublishQueueAndSaveActor().commitPayload(this._operation,o),this._processPayloadFollowups([o])},t._processIncrementalPlaceholder=function(n,i){var o,s=i.label,a=i.path,l=a.map(String).join("."),u=this._incrementalResults.get(s);u==null&&(u=new Map,this._incrementalResults.set(s,u));var d=u.get(l),f=d!=null&&d.kind==="response"?d.responses:null;u.set(l,{kind:"placeholder",placeholder:i});var h;i.kind==="stream"?h=i.parentID:i.kind==="defer"?h=i.selector.dataID:Dr(!1);var p=n.source.get(h),g=((o=n.fieldPayloads)!==null&&o!==void 0?o:[]).filter(function(k){var A=qT(k.dataID,k.fieldKey);return k.dataID===h||A===h});p==null&&Dr(!1);var m,v,_=this._source.get(h);if(_!=null){m=Gp.update(_.record,p);var x=new Map,w=function(A){var C=tye(A);x.set(C,A)};_.fieldPayloads.forEach(w),g.forEach(w),v=Array.from(x.values())}else m=p,v=g;if(this._source.set(h,{record:m,fieldPayloads:v}),f!=null){var S=this._processIncrementalResponses(f);this._processPayloadFollowups(S)}},t._processIncrementalResponses=function(n){var i=this,o=[];return n.forEach(function(s){var a=s.label,l=s.path,u=s.response,d=i._incrementalResults.get(a);if(d==null&&(d=new Map,i._incrementalResults.set(a,d)),a.indexOf("$defer$")!==-1){var f=l.map(String).join("."),h=d.get(f);if(h==null){h={kind:"response",responses:[s]},d.set(f,h);return}else if(h.kind==="response"){h.responses.push(s);return}var p=h.placeholder;p.kind!=="defer"&&Dr(!1),o.push(i._processDeferResponse(a,l,p,u))}else{var g=l.slice(0,-2).map(String).join("."),m=d.get(g);if(m==null){m={kind:"response",responses:[s]},d.set(g,m);return}else if(m.kind==="response"){m.responses.push(s);return}var v=m.placeholder;v.kind!=="stream"&&Dr(!1),o.push(i._processStreamResponse(a,l,v,u))}}),o},t._processDeferResponse=function(n,i,o,s){var a,l=o.selector.dataID,u=this._actorIdentifier;this._actorIdentifier=(a=o.actorIdentifier)!==null&&a!==void 0?a:this._actorIdentifier;var d=this._normalizeResponse(s,o.selector,o.typeName,{actorIdentifier:this._actorIdentifier,getDataID:this._getDataID,log:this._log,path:o.path,treatMissingFieldsAsNull:this._treatMissingFieldsAsNull,shouldProcessClientComponents:this._shouldProcessClientComponents},this._useExecTimeResolvers);this._getPublishQueueAndSaveActor().commitPayload(this._operation,d);var f=this._source.get(l);f==null&&Dr(!1);var h=f.fieldPayloads;if(h.length!==0){var p,g={errors:null,fieldPayloads:h,incrementalPlaceholders:null,followupPayloads:null,source:Jp.create(),isFinal:((p=s.extensions)===null||p===void 0?void 0:p.is_final)===!0};this._getPublishQueueAndSaveActor().commitPayload(this._operation,g)}return this._actorIdentifier=u,d},t._processStreamResponse=function(n,i,o,s){var a=o.parentID,l=o.node,u=o.variables,d=o.actorIdentifier,f=this._actorIdentifier;this._actorIdentifier=d??this._actorIdentifier;var h=l.selections[0];h!=null&&h.kind==="LinkedField"&&h.plural===!0||Dr(!1);var p=this._normalizeStreamItem(s,a,h,u,i,o.path),g=p.fieldPayloads,m=p.itemID,v=p.itemIndex,_=p.prevIDs,x=p.relayPayload,w=p.storageKey;if(this._getPublishQueueAndSaveActor().commitPayload(this._operation,x,function(k){var A=k.get(a);if(A!=null){var C=A.getLinkedRecords(w);if(C!=null&&!(C.length!==_.length||C.some(function(N,I){return _[I]!==(N&&N.getDataID())}))){var R=(0,ef.default)(C);R[v]=k.get(m),A.setLinkedRecords(R,w)}}}),g.length!==0){var S={errors:null,fieldPayloads:g,incrementalPlaceholders:null,followupPayloads:null,source:Jp.create(),isFinal:!1};this._getPublishQueueAndSaveActor().commitPayload(this._operation,S)}return this._actorIdentifier=f,x},t._normalizeStreamItem=function(n,i,o,s,a,l){var u,d,f,h,p=n.data;typeof p!="object"&&Dr(!1);var g=(u=o.alias)!==null&&u!==void 0?u:o.name,m=Ybe(o,s),v=this._source.get(i);v==null&&Dr(!1);var _=v.record,x=v.fieldPayloads,w=Gp.getLinkedRecordIDs(_,m);w==null&&Dr(!1);var S=a[a.length-1],k=parseInt(S,10);k===S&&k>=0||Dr(!1);var A=(d=o.concreteType)!==null&&d!==void 0?d:p[Qbe];typeof A!="string"&&Dr(!1);var C=(f=(h=this._getDataID(p,A))!==null&&h!==void 0?h:w?.[k])!==null&&f!==void 0?f:qT(i,m,k);typeof C!="string"&&Dr(!1);var R=rb(o,C,s),N=Gp.clone(_),I=(0,ef.default)(w);I[k]=C,Gp.setLinkedRecordIDs(N,m,I),this._source.set(i,{record:N,fieldPayloads:x});var P=this._normalizeResponse(n,R,A,{actorIdentifier:this._actorIdentifier,getDataID:this._getDataID,log:this._log,path:[].concat((0,ef.default)(l),[g,String(k)]),treatMissingFieldsAsNull:this._treatMissingFieldsAsNull,shouldProcessClientComponents:this._shouldProcessClientComponents},this._useExecTimeResolvers);return{fieldPayloads:x,itemID:C,itemIndex:k,prevIDs:w,relayPayload:P,storageKey:m}},t._scheduleAsyncStoreUpdate=function(n,i){var o=this;this._completeFns.push(i),this._asyncStoreUpdateDisposable==null&&(this._asyncStoreUpdateDisposable=n(function(){o._asyncStoreUpdateDisposable=null;var s=o._runPublishQueue();o._updateOperationTracker(s);var a=(0,Zd.default)(o._completeFns),l;try{for(a.s();!(l=a.n()).done;){var u=l.value;u()}}catch(d){a.e(d)}finally{a.f()}o._completeFns=[]}))},t._updateOperationTracker=function(n){n!=null&&n.length>0&&this._operationTracker.update(this._operation.request,new Set(n))},t._completeOperationTracker=function(){this._operationTracker.complete(this._operation.request)},t._getPublishQueueAndSaveActor=function(){return this._seenActors.add(this._actorIdentifier),this._getPublishQueue(this._actorIdentifier)},t._getActorsToVisit=function(){return this._seenActors.size===0?new Set([this._actorIdentifier]):this._seenActors},t._runPublishQueue=function(n){var i=new Set,o=(0,Zd.default)(this._getActorsToVisit()),s;try{for(o.s();!(s=o.n()).done;){var a=s.value,l=this._getPublishQueue(a).run(n);l.forEach(function(u){return i.add(u)})}}catch(u){o.e(u)}finally{o.f()}return Array.from(i)},t._retainData=function(){var n=(0,Zd.default)(this._getActorsToVisit()),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;this._retainDisposables.has(o)||this._retainDisposables.set(o,this._getStore(o).retain(this._operation))}}catch(s){n.e(s)}finally{n.f()}},t._disposeRetainedData=function(){var n=(0,Zd.default)(this._retainDisposables.values()),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;o.dispose()}}catch(s){n.e(s)}finally{n.f()}this._retainDisposables.clear()},t._expectOperationLoader=function(){var n=this._operationLoader;return n||Dr(!1),n},e})();function eye(e){var t=[],r=[],n=[];return e.forEach(function(i){var o;if(i.path!=null||i.label!=null){var s=i.label,a=i.path;(s==null||a==null)&&Dr(!1),r.push({label:s,path:a,response:i})}else((o=i.extensions)===null||o===void 0?void 0:o.is_normalized)===!0?n.push(i):t.push(i)}),[t,r,n]}function tye(e){var t;return(t=JSON.stringify(Vbe(e)))!==null&&t!==void 0?t:""}function KT(e){var t=e.incrementalPlaceholders;t!=null&&t.length!==0&&Dr(!1)}var rye={execute:Xbe},nye=Promise.resolve();function iye(e){nye.then(e).catch(oye)}function oye(e){setTimeout(function(){throw e},0)}var sye=iye,en=zi,aye=Zm,HT=aye.EXISTENT,nb=De,lye=(function(){function e(r,n){this.__sources=[n,r],this._base=r,this._sink=n}var t=e.prototype;return t.unstable_getRawRecordWithChanges=function(n){var i=this._base.get(n),o=this._sink.get(n);if(o===void 0){if(i==null)return i;var s=en.clone(i);return s}else{if(o===null)return null;if(i!=null){var a=en.update(i,o);return a}else{var l=en.clone(o);return l}}},t._getSinkRecord=function(n){var i=this._sink.get(n);if(!i){var o=this._base.get(n);o||nb(!1),i=en.create(n,en.getType(o)),this._sink.set(n,i)}return i},t.copyFields=function(n,i){var o=this._sink.get(n),s=this._base.get(n);o||s||nb(!1);var a=this._getSinkRecord(i);s&&en.copyFields(s,a),o&&en.copyFields(o,a)},t.copyFieldsFromRecord=function(n,i){var o=this._getSinkRecord(i);en.copyFields(n,o)},t.create=function(n,i){this._base.getStatus(n)!==HT&&this._sink.getStatus(n)!==HT||nb(!1);var o=en.create(n,i);this._sink.set(n,o)},t.delete=function(n){this._sink.delete(n)},t.getStatus=function(n){return this._sink.has(n)?this._sink.getStatus(n):this._base.getStatus(n)},t.getType=function(n){for(var i=0;i<this.__sources.length;i++){var o=this.__sources[i].get(n);if(o)return en.getType(o);if(o===null)return null}},t.getValue=function(n,i){for(var o=0;o<this.__sources.length;o++){var s=this.__sources[o].get(n);if(s){var a=en.getValue(s,i);if(a!==void 0)return a}else if(s===null)return null}},t.setValue=function(n,i,o){var s=this._getSinkRecord(n);en.setValue(s,i,o)},t.getErrors=function(n,i){for(var o=0;o<this.__sources.length;o++){var s=this.__sources[o].get(n);if(s){var a=en.getErrors(s,i);if(a!==void 0)return a}else if(s===null)return null}},t.setErrors=function(n,i,o){var s=this._getSinkRecord(n);en.setErrors(s,i,o)},t.getLinkedRecordID=function(n,i){for(var o=0;o<this.__sources.length;o++){var s=this.__sources[o].get(n);if(s){var a=en.getLinkedRecordID(s,i);if(a!==void 0)return a}else if(s===null)return null}},t.setLinkedRecordID=function(n,i,o){var s=this._getSinkRecord(n);en.setLinkedRecordID(s,i,o)},t.getLinkedRecordIDs=function(n,i){for(var o=0;o<this.__sources.length;o++){var s=this.__sources[o].get(n);if(s){var a=en.getLinkedRecordIDs(s,i);if(a!==void 0)return a}else if(s===null)return null}},t.setLinkedRecordIDs=function(n,i,o){var s=this._getSinkRecord(n);en.setLinkedRecordIDs(s,i,o)},e})(),BL=lye,uye=Ke.default,nv=uye(Tr),cye=rr,td=cye.getArgumentValues,dye=["id","__id","__typename","js"];function fye(e,t,r,n,i){var o={};return wh(o,e,t,r,n,i),o}function wh(e,t,r,n,i,o){var s,a=(0,nv.default)(n),l;try{var u=function(){var p=l.value;switch(p.kind){case"LinkedField":p.plural?Object.defineProperty(e,(d=p.alias)!==null&&d!==void 0?d:p.name,{get:gye(p,r,t,i,o),set:hye(p,r,t,i)}):Object.defineProperty(e,(f=p.alias)!==null&&f!==void 0?f:p.name,{get:mye(p,r,t,i,o),set:pye(p,r,t,i)});break;case"ScalarField":var g=(s=p.alias)!==null&&s!==void 0?s:p.name;Object.defineProperty(e,g,{get:function(){var v,_=td((v=p.args)!==null&&v!==void 0?v:[],r),x=t.getValue(p.name,_);return x==null&&(x=bye(p,_,t,i,o)),x},set:dye.includes(p.name)?void 0:function(m){var v,_=td((v=p.args)!==null&&v!==void 0?v:[],r);t.setValue__UNSAFE(m,p.name,_)}});break;case"InlineFragment":t.getType()===p.type&&wh(e,t,r,p.selections,i,o);break;case"ClientExtension":wh(e,t,r,p.selections,i,o);break;case"FragmentSpread":break;case"Condition":case"ActorChange":case"InlineDataFragmentSpread":case"AliasedInlineFragmentSpread":case"ClientEdgeToClientObject":case"ClientEdgeToServerObject":case"Defer":case"ModuleImport":case"RequiredField":case"CatchField":case"Stream":case"RelayResolver":case"RelayLiveResolver":throw new Error("Encountered an unexpected ReaderSelection variant in RelayRecordSourceProxy. This indicates a bug in Relay.");default:throw p.kind,new Error("Encountered an unexpected ReaderSelection variant in RelayRecordSourceProxy. This indicates a bug in Relay.")}};for(a.s();!(l=a.n()).done;){var d,f;u()}}catch(h){a.e(h)}finally{a.f()}}function hye(e,t,r,n){return function(o){var s,a=td((s=e.args)!==null&&s!==void 0?s:[],t);if(o==null)throw new Error("Do not assign null to plural linked fields; assign an empty array instead.");var l=o.map(function(u){if(u==null)throw new Error("When assigning an array of items, none of the items should be null or undefined.");var d=u.__id;if(d==null)throw new Error("The __id field must be present on each item passed to the setter. This indicates a bug in Relay.");var f=n.get(d);if(f==null)throw new Error("Did not find item with data id ".concat(d," in the store."));return f});r.setLinkedRecords(l,e.name,a)}}function pye(e,t,r,n){return function(o){var s,a=td((s=e.args)!==null&&s!==void 0?s:[],t);if(o==null)r.setValue(o,e.name,a);else{var l=o.__id;if(l==null)throw new Error("The __id field must be present on the argument. This indicates a bug in Relay.");var u=n.get(l);if(u==null)throw new Error("Did not find item with data id ".concat(l," in the store."));r.setLinkedRecord(u,e.name,a)}}}function gye(e,t,r,n,i){return function(){var o,s=td((o=e.args)!==null&&o!==void 0?o:[],t),a=r.getLinkedRecords(e.name,s);return a===void 0&&(a=_ye(e,s,r,n,i)),a!=null?a.map(function(l){if(l!=null){var u={};return wh(u,l,t,e.selections,n,i),u}else return l}):a}}function mye(e,t,r,n,i){return function(){var o,s=td((o=e.args)!==null&&o!==void 0?o:[],t),a=r.getLinkedRecord(e.name,s);if(a===void 0&&(a=vye(e,s,r,n,i)),a!=null){var l={};return wh(l,a,t,e.selections,n,i),l}else return a}}function vye(e,t,r,n,i){var o=(0,nv.default)(i),s;try{for(o.s();!(s=o.n()).done;){var a=s.value;if(a.kind==="linked"){var l=a.handle(e,r,t,n);if(l!=null)return n.get(l)}}}catch(u){o.e(u)}finally{o.f()}}function _ye(e,t,r,n,i){var o=(0,nv.default)(i),s;try{for(o.s();!(s=o.n()).done;){var a=s.value;if(a.kind==="pluralLinked"){var l=a.handle(e,r,t,n);if(l!=null)return l.map(function(u){if(u!=null)return n.get(u)})}}}catch(u){o.e(u)}finally{o.f()}}function bye(e,t,r,n,i){var o=(0,nv.default)(i),s;try{for(o.s();!(s=o.n()).done;){var a=s.value;if(a.kind==="scalar"){var l=a.handle(e,r,t,n);if(l!==void 0)return l}}}catch(u){o.e(u)}finally{o.f()}}var jL={createUpdatableProxy:fye},yye=Wo,xye=yye.getFragment,Sye=Go,Eye=Sye.getVariablesFromFragment,wye=rr,kye=wye.ID_KEY,Cye=jL,Rye=Cye.createUpdatableProxy,Aye=De;function Tye(e,t,r,n){var i=xye(e),o=Eye(i,t),s=t[kye],a=r.get(s);return a==null&&Aye(!1),{updatableData:Rye(a,o,i.selections,r,n)}}var qL={readUpdatableFragment:Tye},$ye=Wo,Nye=$ye.getUpdatableQuery,Dye=jL,Fye=Dye.createUpdatableProxy;function Iye(e,t,r,n){var i=Nye(e);return{updatableData:Fye(r.getRoot(),t,i.fragment.selections,r,n)}}var VL={readUpdatableQuery:Iye},Pye=ks,Oye=Pye.generateClientID,Mye=rr,Ea=Mye.getStableStorageKey,Qp=De,Lye=(function(){function e(r,n,i){this._dataID=i,this._mutator=n,this._source=r}var t=e.prototype;return t.copyFieldsFrom=function(n){this._mutator.copyFields(n.getDataID(),this._dataID)},t.getDataID=function(){return this._dataID},t.getType=function(){var n=this._mutator.getType(this._dataID);return n==null&&Qp(!1),n},t.getValue=function(n,i){var o=Ea(n,i);return this._mutator.getValue(this._dataID,o)},t.setValue=function(n,i,o,s){return KL(n)||Qp(!1),this.setValue__UNSAFE(n,i,o,s)},t.getErrors=function(n,i){var o=Ea(n,i);return this._mutator.getErrors(this._dataID,o)},t.setValue__UNSAFE=function(n,i,o,s){var a=Ea(i,o);return this._mutator.setValue(this._dataID,a,n),s!=null&&(s.length===0?this._mutator.setErrors(this._dataID,a):this._mutator.setErrors(this._dataID,a,s)),this},t.getLinkedRecord=function(n,i){var o=Ea(n,i),s=this._mutator.getLinkedRecordID(this._dataID,o);return s!=null?this._source.get(s):s},t.setLinkedRecord=function(n,i,o){n instanceof e||Qp(!1);var s=Ea(i,o),a=n.getDataID();return this._mutator.setLinkedRecordID(this._dataID,s,a),this},t.getOrCreateLinkedRecord=function(n,i,o){var s=this.getLinkedRecord(n,o);if(!s){var a,l=Ea(n,o),u=Oye(this.getDataID(),l);s=(a=this._source.get(u))!==null&&a!==void 0?a:this._source.create(u,i),this.setLinkedRecord(s,n,o)}return s},t.getLinkedRecords=function(n,i){var o=this,s=Ea(n,i),a=this._mutator.getLinkedRecordIDs(this._dataID,s);return a==null?a:a.map(function(l){return l!=null?o._source.get(l):l})},t.setLinkedRecords=function(n,i,o){Array.isArray(n)||Qp(!1);var s=Ea(i,o),a=n.map(function(l){return l&&l.getDataID()});return this._mutator.setLinkedRecordIDs(this._dataID,s,a),this},t.invalidateRecord=function(){this._source.markIDForInvalidation(this._dataID)},e})();function KL(e){return e==null||typeof e!="object"||Array.isArray(e)&&e.every(KL)}var zye=Lye,Uye=zi,HL=Zm,ib=HL.EXISTENT,WT=HL.NONEXISTENT,WL=rr,ob=WL.ROOT_ID,GT=WL.ROOT_TYPE,Bye=qL,jye=Bye.readUpdatableFragment,qye=VL,Vye=qye.readUpdatableQuery,Kye=zye,Yp=De,Hye=(function(){function e(r,n,i,o,s){this.__mutator=r,this._handlerProvider=i||null,this._proxies={},this._getDataID=n,this._invalidatedStore=!1,this._idsMarkedForInvalidation=new Set,this._missingFieldHandlers=o,this._log=s??function(a){}}var t=e.prototype;return t.publishSource=function(n,i){var o=this,s=n.getRecordIDs();s.forEach(function(a){var l=n.getStatus(a);if(l===ib){var u=n.get(a);u&&(o.__mutator.getStatus(a)!==ib&&o.create(a,Uye.getType(u)),o.__mutator.copyFieldsFromRecord(u,a))}else l===WT&&o.delete(a)}),i&&i.length&&i.forEach(function(a){var l=o._handlerProvider&&o._handlerProvider(a.handle);l||Yp(!1),l.update(o,a)})},t.create=function(n,i){this.__mutator.create(n,i),delete this._proxies[n];var o=this.get(n);return o||Yp(!1),o},t.delete=function(n){n===ob&&Yp(!1),delete this._proxies[n],this.__mutator.delete(n)},t.get=function(n){if(!this._proxies.hasOwnProperty(n)){var i=this.__mutator.getStatus(n);i===ib?this._proxies[n]=new Kye(this,this.__mutator,n):this._proxies[n]=i===WT?null:void 0}return this._proxies[n]},t.getRoot=function(){var n=this.get(ob);return n||(n=this.create(ob,GT)),n&&n.getType()===GT||Yp(!1),n},t.invalidateStore=function(){this._invalidatedStore=!0},t.isStoreMarkedForInvalidation=function(){return this._invalidatedStore},t.markIDForInvalidation=function(n){this._idsMarkedForInvalidation.add(n)},t.getIDsMarkedForInvalidation=function(){return this._idsMarkedForInvalidation},t.readUpdatableQuery=function(n,i){return Vye(n,i,this,this._missingFieldHandlers)},t.readUpdatableFragment=function(n,i){return jye(n,i,this,this._missingFieldHandlers)},e})(),GL=Hye,Wye=$u,JT=Wye.LINKED_FIELD,Gye=rr,Jye=Gye.getHandleStorageKey,Qye=ha,Yye=De;function Xye(e,t,r){var n=t.find(function(o){return o.kind===JT&&o.name===e.name&&o.alias===e.alias&&Qye(o.args,e.args)});n&&n.kind===JT||Yye(!1);var i=Jye(e,r);return{kind:"LinkedField",alias:n.alias,name:i,storageKey:i,args:null,concreteType:n.concreteType,plural:n.plural,selections:n.selections}}var JL=Xye,Zye=$u,QT=Zye.SCALAR_FIELD,e1e=rr,t1e=e1e.getHandleStorageKey,r1e=ha,n1e=De;function i1e(e,t,r){var n=t.find(function(o){return o.kind===QT&&o.name===e.name&&o.alias===e.alias&&r1e(o.args,e.args)});n&&n.kind===QT||n1e(!1);var i=t1e(e,r);return{kind:"ScalarField",alias:n.alias,name:i,storageKey:i,args:null}}var o1e=i1e,s1e=Ke.default,Xp=s1e(Tr),a1e=BL,l1e=GL,u1e=_w,c1e=ks,d1e=c1e.isClientID,f1e=JL,h1e=o1e,p1e=_l,YT=p1e.getLocalVariables,XT=zi,QL=Zm,sb=QL.EXISTENT,g1e=QL.UNKNOWN,yw=rr,YL=tv,m1e=YL.TYPE_SCHEMA_TYPE,ab=YL.generateTypeID,tf=De,v1e=yw.getModuleOperationKey,Zp=yw.getStorageKey,lb=yw.getArgumentValues;function _1e(e,t,r,n,i,o,s,a,l,u){l?.({name:"store.datachecker.start",selector:n});var d=n.dataID,f=n.node,h=n.variables,p=new b1e(e,t,r,h,i,o,s,a,l,u),g=p.check(f,d);return l?.({name:"store.datachecker.end",selector:n}),g}var b1e=(function(){function e(r,n,i,o,s,a,l,u,d,f){this._getSourceForActor=r,this._getTargetForActor=n,this._getDataID=l,this._source=r(i),this._mutatorRecordSourceProxyCache=new Map;var h=this._getMutatorAndRecordProxyForActor(i),p=h[0],g=h[1];this._useExecTimeResolvers=f??!1,this._mostRecentlyInvalidatedAt=null,this._handlers=s,this._mutator=p,this._operationLoader=a??null,this._recordSourceProxy=g,this._recordWasMissing=!1,this._variables=o,this._shouldProcessClientComponents=u,this._log=d}var t=e.prototype;return t._getMutatorAndRecordProxyForActor=function(n){var i=this._mutatorRecordSourceProxyCache.get(n);if(i==null){var o=this._getTargetForActor(n),s=new a1e(this._getSourceForActor(n),o),a=new l1e(s,this._getDataID,void 0,this._handlers,this._log);i=[s,a],this._mutatorRecordSourceProxyCache.set(n,i)}return i},t.check=function(n,i){return this._assignClientAbstractTypes(n),this._traverse(n,i),this._recordWasMissing===!0?{status:"missing",mostRecentlyInvalidatedAt:this._mostRecentlyInvalidatedAt}:{status:"available",mostRecentlyInvalidatedAt:this._mostRecentlyInvalidatedAt}},t._getVariableValue=function(n){return this._variables.hasOwnProperty(n)||tf(!1),this._variables[n]},t._handleMissing=function(){this._recordWasMissing=!0},t._handleMissingScalarField=function(n,i){if(!(n.name==="id"&&n.alias==null&&d1e(i))){var o=n.args!=null?lb(n.args,this._variables):{},s=(0,Xp.default)(this._handlers),a;try{for(s.s();!(a=s.n()).done;){var l=a.value;if(l.kind==="scalar"){var u=l.handle(n,this._recordSourceProxy.get(i),o,this._recordSourceProxy);if(u!==void 0)return u}}}catch(d){s.e(d)}finally{s.f()}this._handleMissing()}},t._handleMissingLinkField=function(n,i){var o=n.args!=null?lb(n.args,this._variables):{},s=(0,Xp.default)(this._handlers),a;try{for(s.s();!(a=s.n()).done;){var l=a.value;if(l.kind==="linked"){var u=l.handle(n,this._recordSourceProxy.get(i),o,this._recordSourceProxy);if(u!==void 0&&(u===null||this._mutator.getStatus(u)===sb))return u}}}catch(d){s.e(d)}finally{s.f()}this._handleMissing()},t._handleMissingPluralLinkField=function(n,i){var o=this,s=n.args!=null?lb(n.args,this._variables):{},a=(0,Xp.default)(this._handlers),l;try{for(a.s();!(l=a.n()).done;){var u=l.value;if(u.kind==="pluralLinked"){var d=u.handle(n,this._recordSourceProxy.get(i),s,this._recordSourceProxy);if(d!=null){var f=d.every(function(h){return h!=null&&o._mutator.getStatus(h)===sb});if(f)return d}else if(d===null)return null}}}catch(h){a.e(h)}finally{a.f()}this._handleMissing()},t._traverse=function(n,i){var o=this._mutator.getStatus(i);if(o===g1e&&this._handleMissing(),o===sb){var s=this._source.get(i),a=XT.getInvalidationEpoch(s);a!=null&&(this._mostRecentlyInvalidatedAt=this._mostRecentlyInvalidatedAt!=null?Math.max(this._mostRecentlyInvalidatedAt,a):a),this._traverseSelections(n.selections,i)}},t._traverseSelections=function(n,i){var o=this;n.forEach(function(s){switch(s.kind){case"ScalarField":o._checkScalar(s,i);break;case"LinkedField":s.plural?o._checkPluralLink(s,i):o._checkLink(s,i);break;case"ActorChange":o._checkActorChange(s.linkedField,i);break;case"Condition":var a=!!o._getVariableValue(s.condition);a===s.passingValue&&o._traverseSelections(s.selections,i);break;case"InlineFragment":{var l=s.abstractKey;if(l==null){var u=o._mutator.getType(i);u===s.type&&o._traverseSelections(s.selections,i)}else{var d=o._mutator.getType(i);d==null&&tf(!1);var f=ab(d),h=o._mutator.getValue(f,l);h===!0?o._traverseSelections(s.selections,i):h==null&&o._handleMissing()}break}case"LinkedHandle":{var p=f1e(s,n,o._variables);p.plural?o._checkPluralLink(p,i):o._checkLink(p,i);break}case"ScalarHandle":{var g=h1e(s,n,o._variables);o._checkScalar(g,i);break}case"ModuleImport":o._checkModuleImport(s,i);break;case"Defer":case"Stream":o._traverseSelections(s.selections,i);break;case"FragmentSpread":var m=o._variables;o._variables=YT(o._variables,s.fragment.argumentDefinitions,s.args),o._traverseSelections(s.fragment.selections,i),o._variables=m;break;case"ClientExtension":var v=o._recordWasMissing;o._traverseSelections(s.selections,i),o._recordWasMissing=v;break;case"TypeDiscriminator":var _=s.abstractKey,x=o._mutator.getType(i);x==null&&tf(!1);var w=ab(x),S=o._mutator.getValue(w,_);S==null&&o._handleMissing();break;case"ClientComponent":if(o._shouldProcessClientComponents===!1)break;o._traverseSelections(s.fragment.selections,i);break;case"RelayResolver":case"RelayLiveResolver":o._useExecTimeResolvers||o._checkResolver(s,i);break;case"ClientEdgeToClientObject":o._useExecTimeResolvers||o._checkResolver(s.backingField,i);break;default:tf(!1)}})},t._checkResolver=function(n,i){n.fragment&&this._traverseSelections([n.fragment],i)},t._checkModuleImport=function(n,i){var o=this._operationLoader;o===null&&tf(!1);var s=v1e(n.documentName),a=this._mutator.getValue(i,s);if(a==null){a===void 0&&this._handleMissing();return}var l=o.get(a);if(l!=null){var u=u1e(l),d=this._variables;this._variables=YT(this._variables,u.argumentDefinitions,n.args),this._traverse(u,i),this._variables=d}else this._handleMissing()},t._checkScalar=function(n,i){var o=Zp(n,this._variables),s=this._mutator.getValue(i,o);s===void 0&&(s=this._handleMissingScalarField(n,i),s!==void 0&&this._mutator.setValue(i,o,s))},t._checkLink=function(n,i){var o=Zp(n,this._variables),s=this._mutator.getLinkedRecordID(i,o);s===void 0&&(s=this._handleMissingLinkField(n,i),s!=null?this._mutator.setLinkedRecordID(i,o,s):s===null&&this._mutator.setValue(i,o,null)),s!=null&&this._traverse(n,s)},t._checkPluralLink=function(n,i){var o=this,s=Zp(n,this._variables),a=this._mutator.getLinkedRecordIDs(i,s);a===void 0&&(a=this._handleMissingPluralLinkField(n,i),a!=null?this._mutator.setLinkedRecordIDs(i,s,a):a===null&&this._mutator.setValue(i,s,null)),a&&a.forEach(function(l){l!=null&&o._traverse(n,l)})},t._checkActorChange=function(n,i){var o=Zp(n,this._variables),s=this._source.get(i),a=s!=null?XT.getActorLinkedRecordID(s,o):s;if(a==null)a===void 0&&this._handleMissing();else{var l=a[0],u=a[1],d=this._source,f=this._mutator,h=this._recordSourceProxy,p=this._getMutatorAndRecordProxyForActor(l),g=p[0],m=p[1];this._source=this._getSourceForActor(l),this._mutator=g,this._recordSourceProxy=m,this._assignClientAbstractTypes(n),this._traverse(n,u),this._source=d,this._mutator=f,this._recordSourceProxy=h}},t._assignClientAbstractTypes=function(n){var i=n.clientAbstractTypes;if(i!=null)for(var o=0,s=Object.keys(i);o<s.length;o++){var a=s[o],l=(0,Xp.default)(i[a]),u;try{for(l.s();!(u=l.n()).done;){var d=u.value,f=ab(d);this._source.get(f)==null&&this._mutator.create(f,m1e),this._mutator.getValue(f,a)==null&&this._mutator.setValue(f,a,!0)}}catch(h){l.e(h)}finally{l.f()}}},e})(),y1e={check:_1e},x1e=function(t){typeof t=="object"&&t!=null&&(Array.isArray(t)||t.constructor===Object)&&Object.freeze(t)},S1e=zi,E1e=rr,w1e=E1e.RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS,k1e=De;function C1e(e){var t=S1e.getValue(e,w1e);return t==null?null:(t instanceof Set||k1e(!1),t)}var XL=C1e;function R1e(e){return e!=null&&typeof e=="object"&&typeof e.read=="function"&&typeof e.subscribe=="function"}var A1e=R1e,T1e=Ke.default,is=T1e(Tr),$1e=Qm,N1e=$u,ZT=N1e.RELAY_LIVE_RESOLVER,D1e=go,e$=x1e,ZL=ks,e0=ZL.generateClientID,ub=ZL.generateClientObjectClientID,rt=zi,F1e=Go,I1e=F1e.createNormalizationSelector,t0=Iu,P1e=FL,O1e=P1e.normalize,Ou=rr,cb=Ou.RELAY_RESOLVER_ERROR_KEY,P1=Ou.RELAY_RESOLVER_INVALIDATION_KEY,M1e=Ou.RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS,db=Ou.RELAY_RESOLVER_SNAPSHOT_KEY,fb=Ou.RELAY_RESOLVER_VALUE_KEY,L1e=Ou.getReadTimeResolverStorageKey,z1e=Ou.getStorageKey,U1e=XL,B1e=A1e,j1e=Ym,t$=j1e.isSuspenseSentinel,rs=De,xw="__resolverLiveStateSubscription",r0="__resolverLiveStateValue",n0="__resolverLiveStateDirty",e8="__RELAY_RESOLVER__",q1e="__relay_model_instance";function hb(e,t,r){var n=e.get(t);n||(n=new Set,e.set(t,n)),n.add(r)}var V1e=(function(){function e(r,n){this._resolverIDToRecordIDs=new Map,this._recordIDToResolverIDs=new Map,this._getRecordSource=r,this._store=n,this._handlingBatch=!1,this._liveResolverBatchRecordSource=null}var t=e.prototype;return t.readFromCacheOrEvaluate=function(n,i,o,s,a){var l=this._getRecordSource(),u=Nf(l,n),d=L1e(i,o),f=rt.getLinkedRecordID(u,d),h=f==null?null:l.get(f),p;if(h==null||this._isInvalid(h,a)){var g;h!=null&&r8(h),f=(g=f)!==null&&g!==void 0?g:e0(n,d),h=rt.create(f,e8);var m=s();if(rt.setValue(h,db,m.snapshot),rt.setValue(h,cb,m.error),i.kind===ZT){if(m.resolverResult!=null){m.error!=null&&rs(!1);var v=m.resolverResult;p=this._setLiveStateValue(h,f,v,i,o)}}else p=this._setResolverValue(h,m.resolverResult,i,o);l.set(f,h);var _=Nf(l,n),x=rt.clone(_);if(rt.setLinkedRecordID(x,d,f),l.set(n,x),i.fragment!=null){var w,S=z1e(i.fragment,o),k=e0(n,S);hb(this._resolverIDToRecordIDs,k,f),hb(this._recordIDToResolverIDs,n,k);var A=(w=m.snapshot)===null||w===void 0?void 0:w.seenRecords;if(A!=null){var C=(0,is.default)(A),R;try{for(C.s();!(R=C.n()).done;){var N=R.value;hb(this._recordIDToResolverIDs,N,k)}}catch(G){C.e(G)}finally{C.f()}}}}else if(i.kind===ZT&&rt.getValue(h,n0)){var I;f=(I=f)!==null&&I!==void 0?I:e0(n,d),h=rt.clone(h);var P=rt.getValue(h,r0);B1e(P)||rs(!1),p=this._setLiveResolverValue(h,P,i,o),rt.setValue(h,n0,!1),l.set(f,h)}var z=this._getResolverValue(h),q=rt.getValue(h,db),H=rt.getValue(h,cb),V=null;if(t$(z)){var Y;V=(Y=f)!==null&&Y!==void 0?Y:e0(n,d)}return[z,f,H,q,V,p]},t.getLiveResolverPromise=function(n){var i=this._getRecordSource(),o=i.get(n);o==null&&rs(!1);var s=rt.getValue(o,r0);return new Promise(function(a){var l=s.subscribe(function(){l(),a()})})},t._setLiveStateValue=function(n,i,o,s,a){var l=this._makeLiveStateHandler(i),u=o.subscribe(l);rt.setValue(n,r0,o);var d=this._setLiveResolverValue(n,o,s,a);return rt.setValue(n,n0,!1),rt.setValue(n,xw,u),d},t._makeLiveStateHandler=function(n){var i=this;return function(){var o=i._getRecordSource(),s=o.get(n);if(s&&rt.hasValue(s,r0)){var a=rt.clone(s);rt.setValue(a,n0,!0),i._setLiveResolverUpdate(n,a)}}},t._setLiveResolverUpdate=function(n,i){if(this._handlingBatch)this._liveResolverBatchRecordSource==null&&(this._liveResolverBatchRecordSource=t0.create()),this._liveResolverBatchRecordSource.set(n,i);else{var o=t0.create();o.set(n,i),this._store.publish(o),this._store.notify()}},t.batchLiveStateUpdates=function(n){this._handlingBatch&&rs(!1),this._handlingBatch=!0;try{n()}finally{this._liveResolverBatchRecordSource!=null&&(this._store.publish(this._liveResolverBatchRecordSource),this._store.notify()),this._liveResolverBatchRecordSource=null,this._handlingBatch=!1}},t._setLiveResolverValue=function(n,i,o,s){var a=null,l=null;try{a=i.read()}catch(u){l=u}return rt.setValue(n,cb,l),this._setResolverValue(n,a,o,s)},t._setResolverValue=function(n,i,o,s){var a=o.normalizationInfo,l=null;if(i!=null&&a!=null&&!t$(i)){var u,d=U1e(n),f=new Set,h=this._getRecordSource();if(a.plural){Array.isArray(i)||rs(!1),u=[];for(var p=t0.create(),g=0;g<i.length;g++){var m=i[g];if(m!=null){typeof m!="object"&&rs(!1);var v=n$(a,m),_=ub(v,rt.getDataID(n),g),x=this._normalizeOutputTypeValue(_,m,s,a,[o.path,String(g)],v),w=(0,is.default)(x.getRecordIDs()),S;try{for(w.s();!(S=w.n()).done;){var k=S.value;p.set(k,Nf(x,k)),f.add(k)}}catch(z){w.e(z)}finally{w.f()}u.push(_)}}l=r$(h,p,d)}else{typeof i!="object"&&rs(!1);var A=n$(a,i),C=ub(A,rt.getDataID(n)),R=this._normalizeOutputTypeValue(C,i,s,a,[o.path],A),N=(0,is.default)(R.getRecordIDs()),I;try{for(N.s();!(I=N.n()).done;){var P=I.value;f.add(P)}}catch(z){N.e(z)}finally{N.f()}u=C,l=r$(h,R,d)}rt.setValue(n,M1e,f),e$(u),rt.setValue(n,fb,u)}else e$(i),rt.setValue(n,fb,i);return l},t.notifyUpdatedSubscribers=function(n){this._store.__notifyUpdatedSubscribers(n)},t._getResolverValue=function(n){return rt.getValue(n,fb)},t.invalidateDataIDs=function(n){for(var i=this._getRecordSource(),o=new Set,s=Array.from(n);s.length;){var a=s.pop();o.add(a),n.add(a);var l=this._recordIDToResolverIDs.get(a);if(l!=null){var u=(0,is.default)(l),d;try{for(u.s();!(d=u.n()).done;){var f=d.value;if(!o.has(f)){o.add(f);var h=this._resolverIDToRecordIDs.get(f);if(h==null)continue;var p=(0,is.default)(h),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;t8(m,i),o.has(m)||(o.add(m),s.push(m))}}catch(v){p.e(v)}finally{p.f()}}}}catch(v){u.e(v)}finally{u.f()}}}},t._isInvalid=function(n,i){if(!rt.getValue(n,P1))return!1;var o=rt.getValue(n,db),s=o?.data,a=o?.selector;if(s==null||a==null)return!0;var l=i(a),u=l.data,d=$1e(s,u);if(d!==s)return!0;if(D1e.MARK_RESOLVER_VALUES_AS_CLEAN_AFTER_FRAGMENT_REREAD){var f=rt.clone(n);rt.setValue(f,P1,!1);var h=this._getRecordSource();h.set(rt.getDataID(n),f)}return!1},t._normalizeOutputTypeValue=function(n,i,o,s,a,l){var u=t0.create();switch(s.kind){case"OutputType":{var d=rt.create(n,l);u.set(n,d);var f=I1e(s.normalizationNode,n,o),h=!1,p=this._store.__getNormalizationOptions(a);return O1e(u,f,i,p,void 0,h).source}case"WeakModel":{var g=rt.create(n,l);return rt.setValue(g,q1e,i),u.set(n,g),u}default:s.kind,rs(!1)}},t.ensureClientRecord=function(n,i){var o=ub(i,n),s=this._getRecordSource();if(!s.has(o)){var a=rt.create(o,i);rt.setValue(a,"id",n),s.set(o,a)}return o},t.unsubscribeFromLiveResolverRecords=function(n){return W1e(this._getRecordSource(),n)},t.invalidateResolverRecords=function(n){if(n.size!==0){var i=(0,is.default)(n),o;try{for(i.s();!(o=i.n()).done;){var s=o.value,a=this._getRecordSource().get(s);a!=null&&Sw(a)&&this._getRecordSource().delete(s)}}catch(l){i.e(l)}finally{i.f()}}},e})();function r$(e,t,r){var n=new Set;if(r!=null){var i=(0,is.default)(r),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;t.has(s)||(n.add(s),e.remove(s))}}catch(p){i.e(p)}finally{i.f()}}var a=(0,is.default)(t.getRecordIDs()),l;try{for(a.s();!(l=a.n()).done;){var u=l.value,d=Nf(t,u);if(e.has(u)){var f=Nf(e,u),h=rt.update(f,d);h!==f&&(n.add(u),e.set(u,h),H1e(f,e))}else e.set(u,d)}}catch(p){a.e(p)}finally{a.f()}return n}function K1e(e){var t=new Set;return rt.getFields(e).forEach(function(r){if(rt.hasLinkedRecordID(e,r)){var n=rt.getLinkedRecordID(e,r);n!=null&&t.add(n)}else if(rt.hasLinkedRecordIDs(e,r)){var i;(i=rt.getLinkedRecordIDs(e,r))===null||i===void 0||i.forEach(function(o){o!=null&&t.add(o)})}}),t}function t8(e,t){var r=t.get(e);if(r){var n=rt.clone(r);rt.setValue(n,P1,!0),t.set(e,n)}}function H1e(e,t){var r=K1e(e),n=(0,is.default)(r),i;try{for(n.s();!(i=n.n()).done;){var o=i.value,s=t.get(o);s!=null&&Sw(s)&&t8(o,t)}}catch(a){n.e(a)}finally{n.f()}}function W1e(e,t){if(t.size!==0){var r=(0,is.default)(t),n;try{for(r.s();!(n=r.n()).done;){var i=n.value,o=e.get(i);o!=null&&Sw(o)&&r8(o)}}catch(s){r.e(s)}finally{r.f()}}}function Sw(e){return rt.getType(e)===e8}function r8(e){var t=rt.getValue(e,xw);t?.()}function Nf(e,t){var r=e.get(t);return r==null&&rs(!1),r}function G1e(e){return e}function n$(e,t){var r,n=(r=e.concreteType)!==null&&r!==void 0?r:t.__typename;return n==null&&rs(!1),n}var J1e={LiveResolverCache:V1e,getUpdatedDataIDs:G1e,RELAY_RESOLVER_LIVE_STATE_SUBSCRIPTION_KEY:xw},Q1e=Ke.default,Y1e=Q1e(Bt),n8=zi,i$=Iu,X1e=De,pb=n8.fromObject(Object.freeze({__UNPUBLISH_RECORD_SENTINEL:!0})),i8=(function(){function e(r){this._base=r,this._sink=i$.create()}var t=e.prototype;return t.has=function(n){if(this._sink.has(n)){var i=this._sink.get(n);return i!==pb}else return this._base.has(n)},t.get=function(n){if(this._sink.has(n)){var i=this._sink.get(n);return i===pb?void 0:i}else return this._base.get(n)},t.getStatus=function(n){var i=this.get(n);return i===void 0?"UNKNOWN":i===null?"NONEXISTENT":"EXISTENT"},t.clear=function(){this._base=i$.create(),this._sink.clear()},t.delete=function(n){this._sink.delete(n)},t.remove=function(n){this._sink.set(n,pb)},t.set=function(n,i){this._sink.set(n,i)},t.getRecordIDs=function(){return Object.keys(this.toJSON())},t.size=function(){return Object.keys(this.toJSON()).length},t.toJSON=function(){var n=this,i=(0,Y1e.default)({},this._base.toJSON());return this._sink.getRecordIDs().forEach(function(o){var s=n.get(o);s===void 0?delete i[o]:i[o]=n8.toJSON(s)}),i},t.getOptimisticRecordIDs=function(){return new Set(this._sink.getRecordIDs())},e})();function Z1e(e){return new i8(e)}function exe(e){return e instanceof i8||X1e(!1),e.getOptimisticRecordIDs()}var txe={create:Z1e,getOptimisticRecordIDs:exe},rxe=$u,nxe=rxe.RELAY_LIVE_RESOLVER,o$=De,ixe=(function(){function e(){}var t=e.prototype;return t.readFromCacheOrEvaluate=function(n,i,o,s,a){i.kind===nxe&&o$(!1);var l=s(),u=l.resolverResult,d=l.snapshot,f=l.error;return[u,void 0,f,d,void 0,void 0]},t.invalidateDataIDs=function(n){},t.ensureClientRecord=function(n,i){o$(!1)},t.notifyUpdatedSubscribers=function(n){},e})(),oxe={NoopResolverCache:ixe},iv=Ke.default,s$=iv(Bt),sxe=iv(Xn),axe=iv(Cd),gb=iv(vl),lxe=["message"],a$=go,uxe=Ym,cxe=uxe.isSuspenseSentinel,dxe=_l,ri=zi,Cs=rr,l$=Cs.CLIENT_EDGE_TRAVERSAL_PATH,fxe=Cs.FRAGMENT_OWNER_KEY,hxe=Cs.FRAGMENT_PROP_NAME_KEY,i0=Cs.FRAGMENTS_KEY,o0=Cs.ID_KEY,pxe=Cs.MODULE_COMPONENT_KEY,gxe=Cs.ROOT_ID,B0=Cs.getArgumentValues,mxe=Cs.getModuleComponentKey,s0=Cs.getStorageKey,vxe=oxe,_xe=vxe.NoopResolverCache,o8=tw,bxe=o8.RESOLVER_FRAGMENT_ERRORED_SENTINEL,yxe=o8.withResolverContext,xxe=tv,Sxe=xxe.generateTypeID,Fr=De;function s8(e,t,r,n){var i=new Exe(e,t,r??new _xe,n);return i.read()}var Exe=(function(){function e(r,n,i,o){var s,a,l,u;this._clientEdgeTraversalPath=(s=n.clientEdgeTraversalPath)!==null&&s!==void 0&&s.length?(0,gb.default)(n.clientEdgeTraversalPath):[],this._missingClientEdges=[],this._missingLiveResolverFields=[],this._isMissingData=!1,this._isWithinUnmatchedTypeRefinement=!1,this._fieldErrors=null,this._owner=n.owner,this._useExecTimeResolvers=(a=(l=this._owner.node.operation.use_exec_time_resolvers)!==null&&l!==void 0?l:((u=this._owner.node.operation.exec_time_resolvers_enabled_provider)===null||u===void 0?void 0:u.get())===!0)!==null&&a!==void 0?a:!1,this._recordSource=r,this._seenRecords=new Set,this._selector=n,this._variables=n.variables,this._resolverCache=i,this._fragmentName=n.node.name,this._updatedDataIDs=new Set,this._resolverContext=o}var t=e.prototype;return t.read=function(){var n,i=this._selector,o=i.node,s=i.dataID,a=i.isWithinUnmatchedTypeRefinement,l=o.abstractKey,u=this._recordSource.get(s),d=!a;if(d&&l==null&&u!=null&&(this._recordMatchesTypeCondition(u,o.type)||(d=!1)),d&&l!=null&&u!=null){var f=this._implementsInterface(u,l);f===!1&&(d=!1)}this._isWithinUnmatchedTypeRefinement=!d;var h=this._traverse(o,s,null),p=(n=this._selector.node.metadata)===null||n===void 0?void 0:n.catchTo;return p!=null&&(h=this._catchErrors(h,p,null)),this._updatedDataIDs.size>0&&(this._resolverCache.notifyUpdatedSubscribers(this._updatedDataIDs),this._updatedDataIDs.clear()),{data:h,isMissingData:this._isMissingData&&d,missingClientEdges:this._missingClientEdges.length?this._missingClientEdges:null,missingLiveResolverFields:this._missingLiveResolverFields,seenRecords:this._seenRecords,selector:this._selector,fieldErrors:this._fieldErrors}},t._maybeAddFieldErrors=function(n,i){var o=ri.getErrors(n,i);if(o!=null){var s=this._fragmentName;this._fieldErrors==null&&(this._fieldErrors=[]);for(var a=0;a<o.length;a++){var l,u,d,f=o[a];this._fieldErrors.push({kind:"relay_field_payload.error",owner:s,fieldPath:((l=f.path)!==null&&l!==void 0?l:[]).join("."),error:f,shouldThrow:(u=(d=this._selector.node.metadata)===null||d===void 0?void 0:d.throwOnFieldError)!==null&&u!==void 0?u:!1,handled:!1,uiContext:void 0})}}},t._markDataAsMissing=function(n){var i,o;if(!this._isWithinUnmatchedTypeRefinement){this._fieldErrors==null&&(this._fieldErrors=[]);var s=this._fragmentName;if(this._fieldErrors.push((i=(o=this._selector.node.metadata)===null||o===void 0?void 0:o.throwOnFieldError)!==null&&i!==void 0&&i?{kind:"missing_expected_data.throw",owner:s,fieldPath:n,handled:!1,uiContext:void 0}:{kind:"missing_expected_data.log",owner:s,fieldPath:n,uiContext:void 0}),this._isMissingData=!0,this._clientEdgeTraversalPath.length){var a=this._clientEdgeTraversalPath[this._clientEdgeTraversalPath.length-1];a!==null&&this._missingClientEdges.push({request:a.readerClientEdge.operation,clientEdgeDestinationID:a.clientEdgeDestinationID})}}},t._traverse=function(n,i,o){var s=this._recordSource.get(i);if(this._seenRecords.add(i),s==null)return s===void 0&&this._markDataAsMissing("<record>"),s;var a=o||{},l=this._traverseSelections(n.selections,s,a);return l?a:null},t._getVariableValue=function(n){return this._variables.hasOwnProperty(n)||Fr(!1),this._variables[n]},t._maybeReportUnexpectedNull=function(n){if(n.action!=="NONE"){var i=this._fragmentName;this._fieldErrors==null&&(this._fieldErrors=[]);var o;if(n.field.linkedField!=null){var s;o=(s=n.field.linkedField.alias)!==null&&s!==void 0?s:n.field.linkedField.name}else{var a;o=(a=n.field.alias)!==null&&a!==void 0?a:n.field.name}switch(n.action){case"THROW":this._fieldErrors.push({kind:"missing_required_field.throw",fieldPath:o,owner:i,handled:!1,uiContext:void 0});return;case"LOG":this._fieldErrors.push({kind:"missing_required_field.log",fieldPath:o,owner:i,uiContext:void 0});return;default:n.action}}},t._handleRequiredFieldValue=function(n,i){return i==null?(this._maybeReportUnexpectedNull(n),!1):!0},t._catchErrors=function(n,i,o){var s=n;switch(i){case"RESULT":s=this._asResult(n);break;case"NULL":this._fieldErrors!=null&&this._fieldErrors.length>0&&(s=null);break}var a=this._fieldErrors;if(this._fieldErrors=o,a!=null){this._fieldErrors==null&&(this._fieldErrors=[]);for(var l=0;l<a.length;l++)this._fieldErrors.push(u$(a[l]))}return s},t._asResult=function(n){if(this._fieldErrors==null||this._fieldErrors.length===0)return{ok:!0,value:n};var i=this._fieldErrors.map(function(o){switch(o.kind){case"relay_field_payload.error":var s=o.error;s.message;var a=(0,axe.default)(s,lxe);return a;case"missing_expected_data.throw":case"missing_expected_data.log":return{path:o.fieldPath.split(".")};case"relay_resolver.error":return{message:"Relay: Error in resolver for field at ".concat(o.fieldPath," in ").concat(o.owner)};case"missing_required_field.throw":return{message:"Relay: Missing @required value at path '".concat(o.fieldPath,"' in '").concat(o.owner,"'.")};case"missing_required_field.log":return null;default:o.kind,Fr(!1)}}).filter(Boolean);return{ok:!1,errors:i}},t._traverseSelections=function(n,i,o){for(var s=0;s<n.length;s++){var a=n[s];switch(a.kind){case"RequiredField":var l=this._readClientSideDirectiveField(a,i,o);if(!this._handleRequiredFieldValue(a,l))return!1;break;case"CatchField":{var u,d,f,h=this._fieldErrors;this._fieldErrors=null;var p=this._readClientSideDirectiveField(a,i,o),g=(u=(d=a.field)===null||d===void 0?void 0:d.backingField)!==null&&u!==void 0?u:a.field,m=(f=g?.alias)!==null&&f!==void 0?f:g?.name;m==null&&Fr(!1),o[m]=this._catchErrors(p,a.to,h);break}case"ScalarField":this._readScalar(a,i,o);break;case"LinkedField":a.plural?this._readPluralLink(a,i,o):this._readLink(a,i,o);break;case"Condition":var v=!!this._getVariableValue(a.condition);if(v===a.passingValue){var _=this._traverseSelections(a.selections,i,o);if(!_)return!1}break;case"InlineFragment":{var x=this._readInlineFragment(a,i,o,!1);if(x===!1)return!1;break}case"RelayLiveResolver":case"RelayResolver":{this._useExecTimeResolvers?this._readScalar(a,i,o):this._readResolverField(a,i,o);break}case"FragmentSpread":this._createFragmentPointer(a,i,o);break;case"AliasedInlineFragmentSpread":{this._readAliasedInlineFragment(a,i,o);break}case"ModuleImport":this._readModuleImport(a,i,o);break;case"InlineDataFragmentSpread":this._createInlineDataOrResolverFragmentPointer(a,i,o);break;case"Defer":case"ClientExtension":{var w=this._isMissingData,S=this._missingClientEdges.length;this._clientEdgeTraversalPath.push(null);var k=this._traverseSelections(a.selections,i,o);if(this._isMissingData=w||this._missingClientEdges.length>S||this._missingLiveResolverFields.length>0,this._clientEdgeTraversalPath.pop(),!k)return!1;break}case"Stream":{var A=this._traverseSelections(a.selections,i,o);if(!A)return!1;break}case"ActorChange":this._readActorChange(a,i,o);break;case"ClientEdgeToClientObject":case"ClientEdgeToServerObject":if(this._useExecTimeResolvers&&(a.backingField.kind==="RelayResolver"||a.backingField.kind==="RelayLiveResolver")){var C=a.linkedField;C.plural?this._readPluralLink(C,i,o):this._readLink(C,i,o)}else this._readClientEdge(a,i,o);break;default:Fr(!1)}}return!0},t._readClientSideDirectiveField=function(n,i,o){switch(n.field.kind){case"ScalarField":return this._readScalar(n.field,i,o);case"LinkedField":return n.field.plural?this._readPluralLink(n.field,i,o):this._readLink(n.field,i,o);case"RelayResolver":case"RelayLiveResolver":return this._useExecTimeResolvers?this._readScalar(n.field,i,o):this._readResolverField(n.field,i,o);case"ClientEdgeToClientObject":case"ClientEdgeToServerObject":if(this._useExecTimeResolvers&&(n.field.backingField.kind==="RelayResolver"||n.field.backingField.kind==="RelayLiveResolver")){var s=n.field;return s.linkedField.plural?this._readPluralLink(s.linkedField,i,o):this._readLink(s.linkedField,i,o)}else return this._readClientEdge(n.field,i,o);case"AliasedInlineFragmentSpread":return this._readAliasedInlineFragment(n.field,i,o);default:n.field.kind,Fr(!1)}},t._readResolverField=function(n,i,o){var s,a=ri.getDataID(i),l=this._fieldErrors;this._fieldErrors=null;var u=this._readResolverFieldImpl(n,a),d=(s=n.alias)!==null&&s!==void 0?s:n.name;return this._prependPreviousErrors(l,d),o[d]=u,u},t._readResolverFieldImpl=function(n,i){var o=this,s=n.fragment,a,l=function(x){return a!=null?{data:a.data,isMissingData:a.isMissingData,fieldErrors:a.fieldErrors}:(a=s8(o._recordSource,x,o._resolverCache),{data:a.data,isMissingData:a.isMissingData,fieldErrors:a.fieldErrors})},u=function(){if(s!=null){var x={__id:i,__fragmentOwner:o._owner,__fragments:(0,sxe.default)({},s.name,s.args?B0(s.args,o._variables):{})};o._clientEdgeTraversalPath.length>0&&o._clientEdgeTraversalPath[o._clientEdgeTraversalPath.length-1]!==null&&(x[l$]=(0,gb.default)(o._clientEdgeTraversalPath));var w={getDataForResolverFragment:l};return yxe(w,function(){var C=c$(n,o._variables,x,o._resolverContext),R=C[0],N=C[1];return{resolverResult:R,snapshot:a,error:N}})}else{var S=c$(n,o._variables,null,o._resolverContext),k=S[0],A=S[1];return{resolverResult:k,snapshot:void 0,error:A}}},d=this._resolverCache.readFromCacheOrEvaluate(i,n,this._variables,u,l),f=d[0],h=d[1],p=d[2],g=d[3],m=d[4],v=d[5];return this._propagateResolverMetadata(n.path,g,p,h,m,v),f},t._propagateResolverMetadata=function(n,i,o,s,a,l){var u=this;if(i!=null){if(i.missingClientEdges!=null)for(var d=0;d<i.missingClientEdges.length;d++){var f=i.missingClientEdges[d];this._missingClientEdges.push(f)}if(i.missingLiveResolverFields!=null){this._isMissingData=this._isMissingData||i.missingLiveResolverFields.length>0;for(var h=0;h<i.missingLiveResolverFields.length;h++){var p=i.missingLiveResolverFields[h];this._missingLiveResolverFields.push(p)}}if(i.fieldErrors!=null){this._fieldErrors==null&&(this._fieldErrors=[]);for(var g=0;g<i.fieldErrors.length;g++){var m,v=i.fieldErrors[g];((m=this._selector.node.metadata)===null||m===void 0?void 0:m.throwOnFieldError)===!0?this._fieldErrors.push(v):this._fieldErrors.push(u$(v))}}this._isMissingData=this._isMissingData||i.isMissingData}if(o){var _,x,w={kind:"relay_resolver.error",fieldPath:n,owner:this._fragmentName,error:o,shouldThrow:(_=(x=this._selector.node.metadata)===null||x===void 0?void 0:x.throwOnFieldError)!==null&&_!==void 0?_:!1,handled:!1,uiContext:void 0};this._fieldErrors==null?this._fieldErrors=[w]:this._fieldErrors.push(w)}s!=null&&this._seenRecords.add(s),a!=null&&(this._isMissingData=!0,this._missingLiveResolverFields.push(a)),l?.forEach(function(S){u._updatedDataIDs.add(S)})},t._readClientEdge=function(n,i,o){var s=this,a,l=n.backingField;l.kind==="ClientExtension"&&Fr(!1);var u=(a=l.alias)!==null&&a!==void 0?a:l.name,d={};this._traverseSelections([l],i,d);var f=d[u];if(f==null||cxe(f))return o[u]=f,f;if(n.linkedField.plural){Array.isArray(f)||Fr(!1);var h;n.kind!=="ClientEdgeToClientObject"&&Fr(!1),n.backingField.normalizationInfo==null?h=f.map(function(N){var I,P=(I=n.concreteType)!==null&&I!==void 0?I:N.__typename;typeof P!="string"&&Fr(!1);var z=mb(N,l.path,s._owner.identifier),q=s._resolverCache.ensureClientRecord(z,P),H=n.modelResolvers;if(H!=null){var V=H[P];V===void 0&&Fr(!1);var Y=s._readResolverFieldImpl(V,q);return Y!=null?q:null}return q}):h=f.map(function(N){return mb(N,l.path,s._owner.identifier)}),this._clientEdgeTraversalPath.push(null);var p=this._readLinkedIds(n.linkedField,h,i,o);return this._clientEdgeTraversalPath.pop(),o[u]=p,p}else{var g,m=mb(f,l.path,this._owner.identifier),v,_=(g=n.concreteType)!==null&&g!==void 0?g:f.__typename,x;n.kind==="ClientEdgeToClientObject"?n.backingField.normalizationInfo==null?(typeof _!="string"&&Fr(!1),v=this._resolverCache.ensureClientRecord(m,_),x=null):(v=m,x=null):(v=m,x={readerClientEdge:n,clientEdgeDestinationID:m});var w=n.modelResolvers;if(w!=null){typeof _!="string"&&Fr(!1);var S=w[_];S===void 0&&Fr(!1);var k=this._readResolverFieldImpl(S,v);if(k==null)return o[u]=null,null}this._clientEdgeTraversalPath.push(x);var A=o[u];A==null||typeof A=="object"||Fr(!1);var C=this._fieldErrors;this._fieldErrors=null;var R=this._traverse(n.linkedField,v,A);return this._prependPreviousErrors(C,u),this._clientEdgeTraversalPath.pop(),o[u]=R,R}},t._readScalar=function(n,i,o){var s,a=(s=n.alias)!==null&&s!==void 0?s:n.name,l=s0(n,this._variables),u=ri.getValue(i,l);return u===null||a$.ENABLE_NONCOMPLIANT_ERROR_HANDLING_ON_LISTS&&Array.isArray(u)&&u.length===0?this._maybeAddFieldErrors(i,l):u===void 0&&this._markDataAsMissing(a),o[a]=u,u},t._readLink=function(n,i,o){var s,a=(s=n.alias)!==null&&s!==void 0?s:n.name,l=s0(n,this._variables),u=ri.getLinkedRecordID(i,l);if(u==null)return o[a]=u,u===null?this._maybeAddFieldErrors(i,l):u===void 0&&this._markDataAsMissing(a),u;var d=o[a];d==null||typeof d=="object"||Fr(!1);var f=this._fieldErrors;this._fieldErrors=null;var h=this._traverse(n,u,d);return this._prependPreviousErrors(f,a),o[a]=h,h},t._prependPreviousErrors=function(n,i){if(this._fieldErrors!=null){for(var o=0;o<this._fieldErrors.length;o++){var s=this._fieldErrors[o];s.owner===this._fragmentName&&(s.kind==="missing_expected_data.throw"||s.kind==="missing_expected_data.log"||s.kind==="missing_required_field.throw"||s.kind==="missing_required_field.log")&&(s.fieldPath="".concat(i,".").concat(s.fieldPath))}if(n!=null){for(var a=this._fieldErrors.length-1;a>=0;a--)n.push(this._fieldErrors[a]);this._fieldErrors=n}}else this._fieldErrors=n},t._readActorChange=function(n,i,o){var s,a=(s=n.alias)!==null&&s!==void 0?s:n.name,l=s0(n,this._variables),u=ri.getActorLinkedRecordID(i,l);if(u==null)return o[a]=u,u===void 0?this._markDataAsMissing(a):u===null&&this._maybeAddFieldErrors(i,l),o[a];var d=u[0],f=u[1],h={};return this._createFragmentPointer(n.fragmentSpread,ri.fromObject({__id:f}),h),o[a]={__fragmentRef:h,__viewer:d},o[a]},t._readPluralLink=function(n,i,o){var s=s0(n,this._variables),a=ri.getLinkedRecordIDs(i,s);return(a===null||a$.ENABLE_NONCOMPLIANT_ERROR_HANDLING_ON_LISTS&&Array.isArray(a)&&a.length===0)&&this._maybeAddFieldErrors(i,s),this._readLinkedIds(n,a,i,o)},t._readLinkedIds=function(n,i,o,s){var a=this,l,u=(l=n.alias)!==null&&l!==void 0?l:n.name;if(i==null)return s[u]=i,i===void 0&&this._markDataAsMissing(u),i;var d=s[u];d==null||Array.isArray(d)||Fr(!1);var f=this._fieldErrors;this._fieldErrors=null;var h=d||[];return i.forEach(function(p,g){if(p==null){p===void 0&&a._markDataAsMissing(String(g)),h[g]=p;return}var m=h[g];m==null||typeof m=="object"||Fr(!1);var v=a._fieldErrors;a._fieldErrors=null,h[g]=a._traverse(n,p,m),a._prependPreviousErrors(v,g)}),this._prependPreviousErrors(f,u),s[u]=h,h},t._readModuleImport=function(n,i,o){var s=mxe(n.documentName),a=ri.getValue(i,s),l=a!==void 0?a:n.componentModuleProvider;if(l==null){l===void 0&&this._markDataAsMissing("<module-import>");return}this._createFragmentPointer({kind:"FragmentSpread",name:n.fragmentName,args:n.args},i,o),o[hxe]=n.fragmentPropName,o[pxe]=l},t._readAliasedInlineFragment=function(n,i,o){var s=this._fieldErrors;this._fieldErrors=null;var a=this._readInlineFragment(n.fragment,i,{},!0);this._prependPreviousErrors(s,n.name),a===!1&&(a=null),o[n.name]=a},t._readInlineFragment=function(n,i,o,s){if(n.type==null){var a=this._traverseSelections(n.selections,i,o);return a===!1?!1:o}var l=n.abstractKey;if(l==null)if(this._recordMatchesTypeCondition(i,n.type)){var a=this._traverseSelections(n.selections,i,o);if(!a)return!1}else return null;else{var u=this._implementsInterface(i,l);if(u===!1&&s)return null;var d=this._isMissingData,f=this._isWithinUnmatchedTypeRefinement;this._isWithinUnmatchedTypeRefinement=f||u===!1;var h=this._traverseSelections(n.selections,i,o);if(this._isWithinUnmatchedTypeRefinement=f,u===!1)return this._isMissingData=d,null;if(u==null)return;if(h===!1)return!1}return o},t._recordMatchesTypeCondition=function(n,i){var o=ri.getType(n);return o!=null&&o===i||ri.getDataID(n)===gxe},t._createFragmentPointer=function(n,i,o){var s=o[i0];s==null&&(s=o[i0]={}),typeof s=="object"&&s!=null||Fr(!1),o[o0]==null&&(o[o0]=ri.getDataID(i)),s[n.name]=B0(n.args,this._variables,this._isWithinUnmatchedTypeRefinement),o[fxe]=this._owner,this._clientEdgeTraversalPath.length>0&&this._clientEdgeTraversalPath[this._clientEdgeTraversalPath.length-1]!==null&&(o[l$]=(0,gb.default)(this._clientEdgeTraversalPath))},t._createInlineDataOrResolverFragmentPointer=function(n,i,o){var s=o[i0];s==null&&(s=o[i0]={}),typeof s=="object"&&s!=null||Fr(!1),o[o0]==null&&(o[o0]=ri.getDataID(i));var a={},l=this._fragmentName;this._fragmentName=n.name;var u=this._variables,d=n.args?B0(n.args,this._variables):{};this._variables=dxe.getFragmentVariables(n,this._owner.variables,d),this._traverseSelections(n.selections,i,a),this._variables=u,this._fragmentName=l,s[n.name]=a},t._implementsInterface=function(n,i){var o=ri.getType(n),s=this._recordSource.get(Sxe(o)),a=s!=null?ri.getValue(s,i):null;return a==null&&this._markDataAsMissing("<abstract-type-hint>"),a},e})();function u$(e){switch(e.kind){case"missing_expected_data.throw":case"missing_required_field.throw":case"relay_field_payload.error":case"relay_resolver.error":return(0,s$.default)((0,s$.default)({},e),{},{handled:!0});case"missing_expected_data.log":case"missing_required_field.log":return e;default:e.kind,Fr(!1)}}function c$(e,t,r,n){var i=typeof e.resolverModule=="function"?e.resolverModule:e.resolverModule.default,o=null,s=null;try{var a=[];e.fragment!=null&&a.push(r);var l=e.args?B0(e.args,t):void 0;a.push(l),a.push(n),o=i.apply(null,a)}catch(u){o=null,u!==bxe&&(s=u)}return[o,s]}function mb(e,t,r){if(typeof e=="string")return e;if(typeof e=="object"&&e!=null&&typeof e.id=="string")return e.id;Fr(!1)}var Ew={read:s8},wxe=Ke.default,d$=wxe(Tr),kxe=_w,Cxe=JL,Rxe=XL,Axe=_l,f$=Axe.getLocalVariables,Fs=zi,ov=rr,Txe=tv,h$=Txe.generateTypeID,vb=De,$xe=ov.getReadTimeResolverStorageKey,p$=ov.getStorageKey,Nxe=ov.getModuleOperationKey;function Dxe(e,t,r,n,i,o){var s=t.dataID,a=t.node,l=t.variables,u=new Fxe(e,l,r,n,i,o);u.mark(a,s)}var Fxe=(function(){function e(r,n,i,o,s,a){this._operationLoader=o??null,this._operationName=null,this._useExecTimeResolvers=a??!1,this._recordSource=r,this._references=i,this._variables=n,this._shouldProcessClientComponents=s}var t=e.prototype;return t.mark=function(n,i){(n.kind==="Operation"||n.kind==="SplitOperation")&&(this._operationName=n.name),this._traverse(n,i)},t._traverse=function(n,i){this._references.add(i);var o=this._recordSource.get(i);o!=null&&this._traverseSelections(n.selections,o)},t._getVariableValue=function(n){return this._variables.hasOwnProperty(n)||vb(!1),this._variables[n]},t._traverseSelections=function(n,i){var o=this;n.forEach(function(s){switch(s.kind){case"ActorChange":o._traverseLink(s.linkedField,i);break;case"LinkedField":s.plural?o._traversePluralLink(s,i):o._traverseLink(s,i);break;case"Condition":var a=!!o._getVariableValue(s.condition);a===s.passingValue&&o._traverseSelections(s.selections,i);break;case"InlineFragment":if(s.abstractKey==null){var l=Fs.getType(i);(l!=null&&l===s.type||l===ov.ROOT_TYPE)&&o._traverseSelections(s.selections,i)}else{var u=Fs.getType(i),d=h$(u);o._references.add(d),o._traverseSelections(s.selections,i)}break;case"FragmentSpread":var f=o._variables;o._variables=f$(o._variables,s.fragment.argumentDefinitions,s.args),o._traverseSelections(s.fragment.selections,i),o._variables=f;break;case"LinkedHandle":var h=Cxe(s,n,o._variables);h.plural?o._traversePluralLink(h,i):o._traverseLink(h,i);break;case"Defer":case"Stream":o._traverseSelections(s.selections,i);break;case"ScalarField":case"ScalarHandle":break;case"TypeDiscriminator":{var p=Fs.getType(i),g=h$(p);o._references.add(g);break}case"ModuleImport":o._traverseModuleImport(s,i);break;case"ClientExtension":o._traverseSelections(s.selections,i);break;case"ClientComponent":if(o._shouldProcessClientComponents===!1)break;o._traverseSelections(s.fragment.selections,i);break;case"RelayResolver":case"RelayLiveResolver":o._traverseResolverField(s,i);break;case"ClientEdgeToClientObject":o._traverseClientEdgeToClientObject(s,i);break;default:vb(!1)}})},t._traverseClientEdgeToClientObject=function(n,i){if(this._useExecTimeResolvers){this._traverseLink(n.linkedField,i);return}var o=this._traverseResolverField(n.backingField,i);if(o!=null){var s=this._recordSource.get(o);if(s!=null)if(n.backingField.isOutputType){var a=Rxe(s);if(a!=null){var l=(0,d$.default)(a),u;try{for(l.s();!(u=l.n()).done;){var d=u.value;this._references.add(d)}}catch(x){l.e(x)}finally{l.f()}}}else{var f=n.linkedField,h=f.concreteType;if(h==null)return;if(f.plural){var p=Fs.getResolverLinkedRecordIDs(s,h);if(p!=null){var g=(0,d$.default)(p),m;try{for(g.s();!(m=g.n()).done;){var v=m.value;v!=null&&this._traverse(f,v)}}catch(x){g.e(x)}finally{g.f()}}}else{var _=Fs.getResolverLinkedRecordID(s,h);_!=null&&this._traverse(f,_)}}}},t._traverseResolverField=function(n,i){if(!this._useExecTimeResolvers){var o=$xe(n,this._variables),s=Fs.getLinkedRecordID(i,o);s!=null&&this._references.add(s);var a=n.fragment;return a!=null&&this._traverseSelections([a],i),s}},t._traverseModuleImport=function(n,i){var o=this._operationLoader;o===null&&vb(!1);var s=Nxe(n.documentName),a=Fs.getValue(i,s);if(a!=null){var l=o.get(a);if(l!=null){var u=kxe(l),d=this._variables;this._variables=f$(this._variables,u.argumentDefinitions,n.args),this._traverseSelections(u.selections,i),this._variables=d}}},t._traverseLink=function(n,i){var o=p$(n,this._variables),s=Fs.getLinkedRecordID(i,o);s!=null&&this._traverse(n,s)},t._traversePluralLink=function(n,i){var o=this,s=p$(n,this._variables),a=Fs.getLinkedRecordIDs(i,s);a?.forEach(function(l){l!=null&&o._traverse(n,l)})},e})(),Ixe={mark:Dxe},Pxe=Symbol.iterator;function Oxe(e,t){for(var r=e[Pxe](),n=r.next();!n.done;){var i=n.value;if(t.has(i))return!0;n=r.next()}return!1}var Mxe=Oxe,Lxe=rr,zxe=Lxe.ROOT_ID,Uxe=vw,Bxe=Uxe.VIEWER_ID,jxe=Symbol.iterator;function qxe(e,t){for(var r=e[jxe](),n=r.next();!n.done;){var i=n.value;if(t.has(i)&&i!==zxe&&i!==Bxe)return!0;n=r.next()}return!1}var Vxe=qxe,g$=Qm,m$=go,Kxe=Mxe,Hxe=Vxe,v$=Ew,Wxe=(function(){function e(r,n,i){this._subscriptions=new Set,this.__log=r,this._resolverCache=n,this._resolverContext=i}var t=e.prototype;return t.subscribe=function(n,i){var o=this,s={backup:null,callback:i,snapshot:n,stale:!1},a=function(){o._subscriptions.delete(s)};return this._subscriptions.add(s),{dispose:a}},t.snapshotSubscriptions=function(n){var i=this;this._subscriptions.forEach(function(o){if(!o.stale){o.backup=o.snapshot;return}var s=o.snapshot,a=v$.read(n,s.selector,i._resolverCache,i._resolverContext),l=g$(s.data,a.data);a.data=l,o.backup=a})},t.restoreSubscriptions=function(){this._subscriptions.forEach(function(n){var i=n.backup;n.backup=null,i?(i.data!==n.snapshot.data&&(n.stale=!0),n.snapshot={data:n.snapshot.data,isMissingData:i.isMissingData,missingClientEdges:i.missingClientEdges,missingLiveResolverFields:i.missingLiveResolverFields,seenRecords:i.seenRecords,selector:i.selector,fieldErrors:i.fieldErrors}):n.stale=!0})},t.updateSubscriptions=function(n,i,o,s){var a=this,l=i.size!==0;this._subscriptions.forEach(function(u){var d=a._updateSubscription(n,u,i,l,s);d!=null&&o.push(d)})},t._updateSubscription=function(n,i,o,s,a){var l=i.backup,u=i.callback,d=i.snapshot,f=i.stale,h=s&&Kxe(d.seenRecords,o);if(!(!f&&!h)){var p=h||!l?v$.read(n,d.selector,this._resolverCache,this._resolverContext):l,g=g$(d.data,p.data);if(p={data:g,isMissingData:p.isMissingData,missingClientEdges:p.missingClientEdges,missingLiveResolverFields:p.missingLiveResolverFields,seenRecords:p.seenRecords,selector:p.selector,fieldErrors:p.fieldErrors},i.snapshot=p,i.stale=!1,p.data!==d.data)return this.__log&&m$.ENABLE_NOTIFY_SUBSCRIPTION&&this.__log({name:"store.notify.subscription",sourceOperation:a,snapshot:d,nextSnapshot:p}),u(p),d.selector.owner;if(m$.ENABLE_LOOSE_SUBSCRIPTION_ATTRIBUTION&&(f||Hxe(d.seenRecords,o)))return d.selector.owner}},t.size=function(){return this._subscriptions.size},e})(),Gxe=Wxe,a8=Ke.default,_$=a8(Tr),Jxe=a8(Xn),l8=gw,Qxe=l8.INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE,b$=l8.assertInternalActorIdentifier,Yxe=sye,Xxe=y1e,Zxe=OL,ww=J1e,eSe=ww.LiveResolverCache,tSe=ww.RELAY_RESOLVER_LIVE_STATE_SUBSCRIPTION_KEY,rSe=ww.getUpdatedDataIDs,Kl=zi,y$=txe,nSe=Ew,iSe=Ixe,oSe=Gxe,sSe=rr,u8=rr,_b=u8.ROOT_ID,aSe=u8.ROOT_TYPE,bb=De,lSe=10,uSe=(function(){function e(r,n){var i=this,o,s,a,l,u,d,f,h;(0,Jxe.default)(this,"_gcStep",function(){i._gcRun&&(i._gcRun.next().done?i._gcRun=null:i._gcScheduler(i._gcStep))}),this._currentWriteEpoch=0,this._gcHoldCounter=0,this._gcReleaseBufferSize=(o=n?.gcReleaseBufferSize)!==null&&o!==void 0?o:lSe,this._shouldRetainWithinTTL_EXPERIMENTAL=(s=n?.shouldRetainWithinTTL_EXPERIMENTAL)!==null&&s!==void 0?s:!1,this._gcRun=null,this._gcScheduler=(a=n?.gcScheduler)!==null&&a!==void 0?a:Yxe,this._getDataID=(l=n?.getDataID)!==null&&l!==void 0?l:Zxe,this._globalInvalidationEpoch=null,this._invalidationSubscriptions=new Set,this._invalidatedRecordIDs=new Set,this.__log=(u=n?.log)!==null&&u!==void 0?u:null,this._queryCacheExpirationTime=n?.queryCacheExpirationTime,this._operationLoader=(d=n?.operationLoader)!==null&&d!==void 0?d:null,this._optimisticSource=null,this._recordSource=r,this._releaseBuffer=[],this._roots=new Map,this._shouldScheduleGC=!1,this._resolverCache=new eSe(function(){return i._getMutableRecordSource()},this),this._resolverContext=n?.resolverContext,this._storeSubscriptions=new oSe(n?.log,this._resolverCache,this._resolverContext),this._updatedRecordIDs=new Set,this._shouldProcessClientComponents=(f=n?.shouldProcessClientComponents)!==null&&f!==void 0?f:!1,this._treatMissingFieldsAsNull=(h=n?.treatMissingFieldsAsNull)!==null&&h!==void 0?h:!1,this._actorIdentifier=n?.actorIdentifier,cSe(this._recordSource)}var t=e.prototype;return t.getSource=function(){var n;return(n=this._optimisticSource)!==null&&n!==void 0?n:this._recordSource},t.getOperationLoader=function(){return this._operationLoader},t._getMutableRecordSource=function(){var n;return(n=this._optimisticSource)!==null&&n!==void 0?n:this._recordSource},t.getLiveResolverPromise=function(n){return this._resolverCache.getLiveResolverPromise(n)},t.batchLiveStateUpdates=function(n){this.__log!=null&&this.__log({name:"liveresolver.batch.start"});try{this._resolverCache.batchLiveStateUpdates(n)}finally{this.__log!=null&&this.__log({name:"liveresolver.batch.end"})}},t.check=function(n,i){var o,s,a,l,u,d,f,h=n.root,p=this._getMutableRecordSource(),g=this._globalInvalidationEpoch,m=(o=(s=n.request.node.operation.use_exec_time_resolvers)!==null&&s!==void 0?s:((a=n.request.node.operation.exec_time_resolvers_enabled_provider)===null||a===void 0?void 0:a.get())===!0)!==null&&o!==void 0?o:!1,v=this._roots.get(n.request.identifier),_=v!=null?v.epoch:null;if(g!=null&&(_==null||_<=g))return{status:"stale"};var x=(l=i?.handlers)!==null&&l!==void 0?l:[],w=(u=i?.getSourceForActor)!==null&&u!==void 0?u:function(A){return b$(A),p},S=(d=i?.getTargetForActor)!==null&&d!==void 0?d:function(A){return b$(A),p},k=Xxe.check(w,S,(f=i?.defaultActorIdentifier)!==null&&f!==void 0?f:Qxe,h,x,this._operationLoader,this._getDataID,this._shouldProcessClientComponents,this.__log,m);return fSe(k,_,v?.fetchTime,this._queryCacheExpirationTime)},t.retain=function(n){var i=this,o=n.request.identifier,s=!1,a=function(){if(!s){s=!0;var d=i._roots.get(o);if(d!=null&&(d.refCount--,d.refCount===0)){var f=i._queryCacheExpirationTime,h=d.fetchTime!=null&&f!=null&&d.fetchTime<=Date.now()-f;if(h)i._shouldRetainWithinTTL_EXPERIMENTAL||i._roots.delete(o),i.scheduleGC();else if(i._releaseBuffer.push(o),i._releaseBuffer.length>i._gcReleaseBufferSize){var p=i._releaseBuffer.shift();i._shouldRetainWithinTTL_EXPERIMENTAL||i._roots.delete(p),i.scheduleGC()}}}},l=this._roots.get(o);return l!=null?(l.refCount===0&&(this._releaseBuffer=this._releaseBuffer.filter(function(u){return u!==o})),l.refCount+=1):this._roots.set(o,{operation:n,refCount:1,epoch:null,fetchTime:null}),{dispose:a}},t.lookup=function(n){var i=this.__log;i?.({name:"store.lookup.start",selector:n});var o=this.getSource(),s=nSe.read(o,n,this._resolverCache,this._resolverContext);return i?.({name:"store.lookup.end",selector:n}),s},t.notify=function(n,i){var o=this,s=this.__log;s?.({name:"store.notify.start",sourceOperation:n}),this._currentWriteEpoch++,i===!0&&(this._globalInvalidationEpoch=this._currentWriteEpoch),this._resolverCache.invalidateDataIDs(this._updatedRecordIDs);var a=this.getSource(),l=[];if(this._storeSubscriptions.updateSubscriptions(a,this._updatedRecordIDs,l,n),this._invalidationSubscriptions.forEach(function(h){o._updateInvalidationSubscription(h,i===!0)}),n!=null){var u=n.request.identifier,d=this._roots.get(u);if(d!=null)d.epoch=this._currentWriteEpoch,d.fetchTime=Date.now();else if(n.request.node.params.operationKind==="query"&&this._gcReleaseBufferSize>0&&this._releaseBuffer.length<this._gcReleaseBufferSize){var f={operation:n,refCount:0,epoch:this._currentWriteEpoch,fetchTime:Date.now()};this._releaseBuffer.push(u),this._roots.set(u,f)}}return s?.({name:"store.notify.complete",sourceOperation:n,updatedRecordIDs:this._updatedRecordIDs,invalidatedRecordIDs:this._invalidatedRecordIDs,subscriptionsSize:this._storeSubscriptions.size(),updatedOwners:l}),this._updatedRecordIDs.clear(),this._invalidatedRecordIDs.clear(),l},t.publish=function(n,i){var o=this._getMutableRecordSource();dSe(o,n,this._currentWriteEpoch+1,i,this._updatedRecordIDs,this._invalidatedRecordIDs);var s=this.__log;s?.({name:"store.publish",source:n,optimistic:o===this._optimisticSource})},t.subscribe=function(n,i){return this._storeSubscriptions.subscribe(n,i)},t.holdGC=function(){var n=this;this._gcRun&&(this._gcRun=null,this._shouldScheduleGC=!0),this._gcHoldCounter++;var i=function(){n._gcHoldCounter>0&&(n._gcHoldCounter--,n._gcHoldCounter===0&&n._shouldScheduleGC&&(n.scheduleGC(),n._shouldScheduleGC=!1))};return{dispose:i}},t.toJSON=function(){return"RelayModernStore()"},t.getEpoch=function(){return this._currentWriteEpoch},t.__getUpdatedRecordIDs=function(){return this._updatedRecordIDs},t.lookupInvalidationState=function(n){var i=this,o=new Map;return n.forEach(function(s){var a,l=i.getSource().get(s);o.set(s,(a=Kl.getInvalidationEpoch(l))!==null&&a!==void 0?a:null)}),o.set("global",this._globalInvalidationEpoch),{dataIDs:n,invalidations:o}},t.checkInvalidationState=function(n){var i=this.lookupInvalidationState(n.dataIDs),o=i.invalidations,s=n.invalidations;if(o.get("global")!==s.get("global"))return!0;var a=(0,_$.default)(n.dataIDs),l;try{for(a.s();!(l=a.n()).done;){var u=l.value;if(o.get(u)!==s.get(u))return!0}}catch(d){a.e(d)}finally{a.f()}return!1},t.subscribeToInvalidationState=function(n,i){var o=this,s={callback:i,invalidationState:n},a=function(){o._invalidationSubscriptions.delete(s)};return this._invalidationSubscriptions.add(s),{dispose:a}},t._updateInvalidationSubscription=function(n,i){var o=this,s=n.callback,a=n.invalidationState,l=a.dataIDs,u=i||l.some(function(d){return o._invalidatedRecordIDs.has(d)});u&&s()},t.snapshot=function(){this._optimisticSource!=null&&bb(!1);var n=this.__log;n?.({name:"store.snapshot"}),this._storeSubscriptions.snapshotSubscriptions(this.getSource()),this._gcRun&&(this._gcRun=null,this._shouldScheduleGC=!0),this._optimisticSource=y$.create(this.getSource())},t.restore=function(){var n=this._optimisticSource;n||bb(!1);var i=this.__log;i?.({name:"store.restore"});var o=y$.getOptimisticRecordIDs(n);this._resolverCache.unsubscribeFromLiveResolverRecords(o),this._optimisticSource=null,this._shouldScheduleGC&&this.scheduleGC(),this._storeSubscriptions.restoreSubscriptions(),this._resolverCache.invalidateResolverRecords(o)},t.scheduleGC=function(){if(this._gcHoldCounter>0){this._shouldScheduleGC=!0;return}this._gcRun||(this._gcRun=this._collect(),this._gcScheduler(this._gcStep))},t.__gc=function(){if(this._optimisticSource==null)for(var n=this._collect();!n.next().done;);},t._collect=function*(){if(!(this._shouldRetainWithinTTL_EXPERIMENTAL&&this._queryCacheExpirationTime==null)){var n=this.__log;e:for(;;){n?.({name:"store.gc.start"});var i=this._currentWriteEpoch,o=new Set,s=(0,_$.default)(this._roots.entries()),a;try{for(s.s();!(a=s.n()).done;){var l,u,d,f=a.value,h=f[0],p=f[1],g=p.operation,m=p.refCount,v=p.fetchTime;if(this._shouldRetainWithinTTL_EXPERIMENTAL){var _=this._queryCacheExpirationTime;_==null&&bb(!1);var x=v==null||v<=Date.now()-_,w=x&&m===0&&!this._releaseBuffer.includes(h);if(w)continue}var S=g.root,k=(l=(u=g.request.node.operation.use_exec_time_resolvers)!==null&&u!==void 0?u:((d=g.request.node.operation.exec_time_resolvers_enabled_provider)===null||d===void 0?void 0:d.get())===!0)!==null&&l!==void 0?l:!1;if(iSe.mark(this._recordSource,S,o,this._operationLoader,this._shouldProcessClientComponents,k),yield,i!==this._currentWriteEpoch){n?.({name:"store.gc.interrupted"});continue e}}}catch(P){s.e(P)}finally{s.f()}for(var A=this._recordSource.getRecordIDs(),C=0;C<A.length;C++){var R=A[C];if(!o.has(R)){var N=this._recordSource.get(R);if(N!=null){var I=Kl.getValue(N,tSe);I?.()}this._recordSource.remove(R),this._shouldRetainWithinTTL_EXPERIMENTAL&&this._roots.delete(R)}}n?.({name:"store.gc.end",references:o});return}}},t.__getNormalizationOptions=function(n){return{path:n,getDataID:this._getDataID,log:this.__log,treatMissingFieldsAsNull:this._treatMissingFieldsAsNull,shouldProcessClientComponents:this._shouldProcessClientComponents,actorIdentifier:this._actorIdentifier}},t.__notifyUpdatedSubscribers=function(n){var i=rSe(n),o=this._updatedRecordIDs;this._updatedRecordIDs=i,this.notify(),this._updatedRecordIDs=o},e})();function cSe(e){if(!e.has(_b)){var t=Kl.create(_b,aSe);e.set(_b,t)}}function dSe(e,t,r,n,i,o){n&&n.forEach(function(h){var p=e.get(h),g=t.get(h);if(g!==null){var m;p!=null?m=Kl.clone(p):m=g!=null?Kl.clone(g):null,m&&(Kl.setValue(m,sSe.INVALIDATED_AT_KEY,r),o.add(h),e.set(h,m))}});for(var s=t.getRecordIDs(),a=0;a<s.length;a++){var l=s[a],u=t.get(l),d=e.get(l);if(u&&d){var f=Kl.update(d,u);f!==d&&(i.add(l),e.set(l,f))}else u===null?(e.delete(l),d!==null&&i.add(l)):u&&(e.set(l,u),i.add(l))}}function fSe(e,t,r,n){var i=e.mostRecentlyInvalidatedAt,o=e.status;if(typeof i=="number"&&(t==null||i>t))return{status:"stale"};if(o==="missing")return{status:"missing"};if(r!=null&&n!=null){var s=r<=Date.now()-n;if(s)return{status:"stale"}}return{status:"available",fetchTime:r??null}}var kw=uSe,c8=rr,hSe=c8.ROOT_TYPE,x$=c8.getStorageKey,pSe=qL,gSe=pSe.readUpdatableFragment,mSe=VL,vSe=mSe.readUpdatableQuery,S$=De,_Se=(function(){function e(r,n,i,o){this.__mutator=r,this.__recordSource=n,this._readSelector=i,this._missingFieldHandlers=o}var t=e.prototype;return t.create=function(n,i){return this.__recordSource.create(n,i)},t.delete=function(n){this.__recordSource.delete(n)},t.get=function(n){return this.__recordSource.get(n)},t.getRoot=function(){return this.__recordSource.getRoot()},t.getOperationRoot=function(){var n=this.__recordSource.get(this._readSelector.dataID);return n||(n=this.__recordSource.create(this._readSelector.dataID,hSe)),n},t._getRootField=function(n,i,o){var s=n.node.selections.find(function(a){return a.kind==="LinkedField"&&a.name===i||a.kind==="RequiredField"&&a.field.name===i});return s&&s.kind==="RequiredField"&&(s=s.field),s&&s.kind==="LinkedField"||S$(!1),s.plural!==o&&S$(!1),s},t.getRootField=function(n){var i=this._getRootField(this._readSelector,n,!1),o=x$(i,this._readSelector.variables);return this.getOperationRoot().getLinkedRecord(o)},t.getPluralRootField=function(n){var i=this._getRootField(this._readSelector,n,!0),o=x$(i,this._readSelector.variables);return this.getOperationRoot().getLinkedRecords(o)},t.invalidateStore=function(){this.__recordSource.invalidateStore()},t.readUpdatableQuery=function(n,i){return vSe(n,i,this,this._missingFieldHandlers)},t.readUpdatableFragment=function(n,i){return gSe(n,i,this,this._missingFieldHandlers)},e})(),bSe=_Se,yb,xb,Sb=BL,Eb=GL,E$=bSe,ySe=go,xSe=Ew,w$=Iu,a0=De,wb=typeof H0<"u"?H0:typeof window<"u"?window:void 0,kb=(yb=wb==null||(xb=wb.ErrorUtils)===null||xb===void 0?void 0:xb.applyWithGuard)!==null&&yb!==void 0?yb:function(e,t,r,n,i){return e.apply(t,r)},SSe=(function(){function e(r,n,i,o,s){this._hasStoreSnapshot=!1,this._handlerProvider=n||null,this._pendingBackupRebase=!1,this._pendingData=new Set,this._pendingOptimisticUpdates=new Set,this._store=r,this._appliedOptimisticUpdates=new Set,this._gcHold=null,this._getDataID=i,this._missingFieldHandlers=o,this._log=s}var t=e.prototype;return t.applyUpdate=function(n){!this._appliedOptimisticUpdates.has(n)&&!this._pendingOptimisticUpdates.has(n)||a0(!1),this._pendingOptimisticUpdates.add(n)},t.revertUpdate=function(n){this._pendingOptimisticUpdates.has(n)?this._pendingOptimisticUpdates.delete(n):this._appliedOptimisticUpdates.has(n)&&(this._pendingBackupRebase=!0,this._appliedOptimisticUpdates.delete(n))},t.revertAll=function(){this._pendingBackupRebase=!0,this._pendingOptimisticUpdates.clear(),this._appliedOptimisticUpdates.clear()},t.commitPayload=function(n,i,o){this._pendingBackupRebase=!0,this._pendingData.add({kind:"payload",operation:n,payload:i,updater:o})},t.commitUpdate=function(n){this._pendingBackupRebase=!0,this._pendingData.add({kind:"updater",updater:n})},t.commitSource=function(n){this._pendingBackupRebase=!0,this._pendingData.add({kind:"source",source:n})},t.run=function(n){var i=this._appliedOptimisticUpdates===0&&!!this._gcHold,o=!this._pendingBackupRebase&&this._pendingOptimisticUpdates.size===0&&!i;if(ySe.DISALLOW_NESTED_UPDATES&&this._isRunning===!0&&a0(!1),this._isRunning=!0,o)return this._isRunning=!1,[];this._pendingBackupRebase&&this._hasStoreSnapshot&&(this._store.restore(),this._hasStoreSnapshot=!1);var s=this._commitData();return(this._pendingOptimisticUpdates.size||this._pendingBackupRebase&&this._appliedOptimisticUpdates.size)&&(this._hasStoreSnapshot||(this._store.snapshot(),this._hasStoreSnapshot=!0),this._applyUpdates()),this._pendingBackupRebase=!1,this._appliedOptimisticUpdates.size>0?this._gcHold||(this._gcHold=this._store.holdGC()):this._gcHold&&(this._gcHold.dispose(),this._gcHold=null),this._isRunning=!1,this._store.notify(n,s)},t._publishSourceFromPayload=function(n){var i=this,o=n.payload,s=n.operation,a=n.updater,l=o.source,u=o.fieldPayloads,d=new Sb(this._store.getSource(),l),f=new Eb(d,this._getDataID,this._handlerProvider,this._missingFieldHandlers,this._log);if(u&&u.length&&u.forEach(function(v){var _=i._handlerProvider&&i._handlerProvider(v.handle);_||a0(!1),_.update(f,v)}),a){var h=s.fragment;h==null&&a0(!1);var p=new E$(d,f,h,this._missingFieldHandlers),g=k$(l,h);a(p,g)}var m=f.getIDsMarkedForInvalidation();return this._store.publish(l,m),f.isStoreMarkedForInvalidation()},t._commitData=function(){var n=this;if(!this._pendingData.size)return!1;var i=!1;return this._pendingData.forEach(function(o){if(o.kind==="payload"){var s=n._publishSourceFromPayload(o);i=i||s}else if(o.kind==="source"){var a=o.source;n._store.publish(a)}else{var l=o.updater,u=w$.create(),d=new Sb(n._store.getSource(),u),f=new Eb(d,n._getDataID,n._handlerProvider,n._missingFieldHandlers,n._log);kb(l,null,[f],null,"RelayPublishQueue:commitData"),i=i||f.isStoreMarkedForInvalidation();var h=f.getIDsMarkedForInvalidation();n._store.publish(u,h)}}),this._pendingData.clear(),i},t._applyUpdates=function(){var n=this,i=w$.create(),o=new Sb(this._store.getSource(),i),s=new Eb(o,this._getDataID,this._handlerProvider,this._missingFieldHandlers,this._log),a=function(u){if(u.storeUpdater){var d=u.storeUpdater;kb(d,null,[s],null,"RelayPublishQueue:applyUpdates")}else{var f=u.operation,h=u.payload,p=u.updater,g=h.source,m=h.fieldPayloads;if(g&&s.publishSource(g,m),p){var v;g&&(v=k$(g,f.fragment));var _=new E$(o,s,f.fragment,n._missingFieldHandlers);kb(p,null,[_,v],null,"RelayPublishQueue:applyUpdates")}}};this._pendingBackupRebase&&this._appliedOptimisticUpdates.size&&this._appliedOptimisticUpdates.forEach(a),this._pendingOptimisticUpdates.size&&(this._pendingOptimisticUpdates.forEach(function(l){a(l),n._appliedOptimisticUpdates.add(l)}),this._pendingOptimisticUpdates.clear()),this._store.publish(i)},e})();function k$(e,t){var r=xSe.read(e,t).data;return r}var ESe=SSe,wSe=Ke.default,C$=wSe(Bt),kSe=eme,d8=gw,R$=d8.INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE,l0=d8.assertInternalActorIdentifier,Cb=bl,A$=mbe,CSe=ybe,RSe=Sbe,ASe=OL,TSe=Fbe,$Se=obe,NSe=rye,DSe=kw,FSe=ESe,T$=Iu,f8=(function(){function e(r){var n=this,i,o,s,a,l,u,d,f,h,p,g;this.configName=r.configName,this._treatMissingFieldsAsNull=r.treatMissingFieldsAsNull===!0;var m=r.operationLoader,v=(i=r.store)!==null&&i!==void 0?i:new DSe(new T$,{log:r.log,operationLoader:r.operationLoader,getDataID:r.getDataID,shouldProcessClientComponents:r.shouldProcessClientComponents});this.__log=(o=r.log)!==null&&o!==void 0?o:PSe,this.relayFieldLogger=(s=r.relayFieldLogger)!==null&&s!==void 0?s:TSe,this._defaultRenderPolicy=(a=r.UNSTABLE_defaultRenderPolicy)!==null&&a!==void 0?a:"partial",this._operationLoader=m,this._operationExecutions=new Map,this._network=A$(this,r.network),this._getDataID=(l=r.getDataID)!==null&&l!==void 0?l:ASe,this._missingFieldHandlers=(u=r.missingFieldHandlers)!==null&&u!==void 0?u:[],this._publishQueue=new FSe(v,(d=r.handlerProvider)!==null&&d!==void 0?d:kSe,this._getDataID,this._missingFieldHandlers,this.__log),this._scheduler=(f=r.scheduler)!==null&&f!==void 0?f:null,this._store=v,this.options=r.options,this._isServer=(h=r.isServer)!==null&&h!==void 0?h:!1,this._normalizeResponse=(p=r.normalizeResponse)!==null&&p!==void 0?p:$Se,this.__setNet=function(_){return n._network=A$(n,_)},this._operationTracker=(g=r.operationTracker)!==null&&g!==void 0?g:new CSe,this._shouldProcessClientComponents=r.shouldProcessClientComponents,RSe(this)}var t=e.prototype;return t.getStore=function(){return this._store},t.getNetwork=function(){return this._network},t.getOperationTracker=function(){return this._operationTracker},t.getScheduler=function(){return this._scheduler},t.isRequestActive=function(n){var i=this._operationExecutions.get(n);return i==="active"},t.UNSTABLE_getDefaultRenderPolicy=function(){return this._defaultRenderPolicy},t.applyUpdate=function(n){var i=this,o=function(){i._scheduleUpdates(function(){i._publishQueue.revertUpdate(n),i._publishQueue.run()})};return this._scheduleUpdates(function(){i._publishQueue.applyUpdate(n),i._publishQueue.run()}),{dispose:o}},t.revertUpdate=function(n){var i=this;this._scheduleUpdates(function(){i._publishQueue.revertUpdate(n),i._publishQueue.run()})},t.replaceUpdate=function(n,i){var o=this;this._scheduleUpdates(function(){o._publishQueue.revertUpdate(n),o._publishQueue.applyUpdate(i),o._publishQueue.run()})},t.applyMutation=function(n){var i=this._execute({createSource:function(){return Cb.create(function(s){})},isClientPayload:!1,operation:n.operation,optimisticConfig:n,updater:null}).subscribe({});return{dispose:function(){return i.unsubscribe()}}},t.check=function(n){return this._missingFieldHandlers.length===0&&!ISe(n)?this._store.check(n):this._checkSelectorAndHandleMissingFields(n,this._missingFieldHandlers)},t.commitPayload=function(n,i){this._execute({createSource:function(){return Cb.from({data:i})},isClientPayload:!0,operation:n,optimisticConfig:null,updater:null}).subscribe({})},t.commitUpdate=function(n){var i=this;this._scheduleUpdates(function(){i._publishQueue.commitUpdate(n),i._publishQueue.run()})},t.lookup=function(n){return this._store.lookup(n)},t.subscribe=function(n,i){return this._store.subscribe(n,i)},t.retain=function(n){return this._store.retain(n)},t.isServer=function(){return this._isServer},t._checkSelectorAndHandleMissingFields=function(n,i){var o=this,s=T$.create(),a=this._store.getSource(),l=this._store.check(n,{handlers:i,defaultActorIdentifier:R$,getSourceForActor:function(d){return l0(d),a},getTargetForActor:function(d){return l0(d),s}});return s.size()>0&&this._scheduleUpdates(function(){o._publishQueue.commitSource(s),o._publishQueue.run()}),l},t._scheduleUpdates=function(n){var i=this._scheduler;i!=null?i.schedule(n):n()},t.execute=function(n){var i=this,o=n.operation;return this._execute({createSource:function(){return i.getNetwork().execute(o.request.node.params,o.request.variables,o.request.cacheConfig||{},null,void 0,void 0,void 0,function(){return i.check(o)})},isClientPayload:!1,operation:o,optimisticConfig:null,updater:null})},t.executeSubscription=function(n){var i=this,o=n.operation,s=n.updater;return this._execute({createSource:function(){return i.getNetwork().execute(o.request.node.params,o.request.variables,o.request.cacheConfig||{},null)},isClientPayload:!1,operation:o,optimisticConfig:null,updater:s})},t.executeMutation=function(n){var i=this,o=n.operation,s=n.optimisticResponse,a=n.optimisticUpdater,l=n.updater,u=n.uploadables,d;return(s||a)&&(d={operation:o,response:s,updater:a}),this._execute({createSource:function(){return i.getNetwork().execute(o.request.node.params,o.request.variables,(0,C$.default)((0,C$.default)({},o.request.cacheConfig),{},{force:!0}),u)},isClientPayload:!1,operation:o,optimisticConfig:d,updater:l})},t.executeWithSource=function(n){var i=n.operation,o=n.source;return this._execute({createSource:function(){return o},isClientPayload:!1,operation:i,optimisticConfig:null,updater:null})},t.toJSON=function(){var n;return"RelayModernEnvironment(".concat((n=this.configName)!==null&&n!==void 0?n:"",")")},t._execute=function(n){var i=this,o=n.createSource,s=n.isClientPayload,a=n.operation,l=n.optimisticConfig,u=n.updater,d=this._publishQueue,f=this._store;return Cb.create(function(h){var p=NSe.execute({actorIdentifier:R$,getDataID:i._getDataID,isClientPayload:s,log:i.__log,operation:a,operationExecutions:i._operationExecutions,operationLoader:i._operationLoader,operationTracker:i._operationTracker,optimisticConfig:l,getPublishQueue:function(m){return l0(m),d},scheduler:i._scheduler,shouldProcessClientComponents:i._shouldProcessClientComponents,sink:h,source:o(),getStore:function(m){return l0(m),f},treatMissingFieldsAsNull:i._treatMissingFieldsAsNull,updater:u,normalizeResponse:i._normalizeResponse});return function(){return p.cancel()}})},e})();function ISe(e){return e.root.node.kind==="Operation"&&e.root.node.clientAbstractTypes!=null}f8.prototype["@@RelayModernEnvironment"]=!0;function PSe(){}var OSe=f8,MSe=Jm,LSe=Wo,zSe=LSe.getRequest,USe=yl,BSe=USe.createOperationDescriptor,jSe=Go,qSe=jSe.createReaderSelector;function VSe(e,t){var r=zSe(t.subscription);if(r.params.operationKind!=="subscription")throw new Error("requestSubscription: Must use Subscription operation");var n=t.configs,i=t.onCompleted,o=t.onError,s=t.onNext,a=t.variables,l=t.cacheConfig,u=BSe(r,a,l),d=n?MSe.convert(n,r,null,t.updater):t,f=d.updater,h=e.executeSubscription({operation:u,updater:f}).subscribe({next:function(g){if(s!=null){var m=u.fragment,v;if(Array.isArray(g)){var _,x;v=(_=g[0])===null||_===void 0||(x=_.extensions)===null||x===void 0?void 0:x.__relay_subscription_root_id}else{var w;v=(w=g.extensions)===null||w===void 0?void 0:w.__relay_subscription_root_id}typeof v=="string"&&(m=qSe(m.node,v,m.variables,m.owner));var S=e.lookup(m).data;s(S)}},error:o,complete:i});return{dispose:h.unsubscribe}}var KSe=VSe,HSe=Ke.default;HSe(Bt);var h8=rr;h8.getModuleComponentKey;h8.getModuleOperationKey;var WSe=Object.prototype.hasOwnProperty;function GSe(e){for(var t in e)if(WSe.call(e,t))return!1;return!0}var JSe=GSe,Cw=Go,QSe=Cw.getDataIDsFromFragment,YSe=Cw.getSelector,XSe=Cw.getVariablesFromFragment,ZSe=JSe,rf=go,eEe=Nu,$$=eEe.stableCopy,tEe=sL,N$=tEe.intern;function rEe(e,t){var r=YSe(e,t),n=r==null?"null":r.kind==="SingularReaderSelector"?r.owner.identifier:"["+r.selectors.map(function(u){return u.owner.identifier}).join(",")+"]",i=XSe(e,t),o=QSe(e,t);if(rf.ENABLE_GETFRAGMENTIDENTIFIER_OPTIMIZATION){var s=typeof o>"u"?"missing":o==null?"null":Array.isArray(o)?"["+o.join(",")+"]":o;return s=rf.STRING_INTERN_LEVEL<=1?s:N$(s,rf.MAX_DATA_ID_LENGTH),n+"/"+e.name+"/"+(i==null||ZSe(i)?"{}":JSON.stringify($$(i)))+"/"+s}else{var a,l=(a=JSON.stringify(o))!==null&&a!==void 0?a:"missing";return l=rf.STRING_INTERN_LEVEL<=1?l:N$(l,rf.MAX_DATA_ID_LENGTH),n+"/"+e.name+"/"+JSON.stringify($$(i))+"/"+l}}var nEe=rEe,nf=De;function iEe(e,t){var r,n;((r=e.metadata)===null||r===void 0?void 0:r.plural)===!0&&nf(!1);var i=(n=e.metadata)===null||n===void 0?void 0:n.refetch;i==null&&nf(!1);var o=i.operation.default?i.operation.default:i.operation,s=i.fragmentPathInResult;typeof o=="string"&&nf(!1);var a=i.identifierInfo;return a!=null&&(a.identifierField==null||typeof a.identifierField=="string"||nf(!1),a.identifierQueryVariableName==null||typeof a.identifierQueryVariableName=="string"||nf(!1)),{fragmentRefPathInResponse:s,identifierInfo:a,refetchableRequest:o,refetchMetadata:i}}var p8=iEe,oEe=p8,Rb=De;function sEe(e,t){var r,n,i=oEe(e),o=i.refetchableRequest,s=i.refetchMetadata,a=s.connection;a==null&&Rb(!1);var l=a.path,u=((r=(n=e.metadata)===null||n===void 0?void 0:n.connection)!==null&&r!==void 0?r:[])[0];u==null&&Rb(!1);var d=s.identifierInfo;return d?.identifierField==null||typeof d.identifierField=="string"||Rb(!1),{connectionPathInFragmentData:l,identifierField:d?.identifierField,paginationRequest:o,paginationMetadata:a,stream:u.stream===!0}}var aEe=sEe,g8=Ke.default,u0=g8(Xn),Yu=g8(Bt),D$=De;function lEe(e,t,r,n,i,o){var s,a=o.backward,l=o.forward;if(e==="backward"){var u;a!=null&&a.count!=null&&a.cursor!=null||D$(!1);var d=(0,Yu.default)((0,Yu.default)((0,Yu.default)({},n),i),{},(u={},(0,u0.default)(u,a.cursor,r),(0,u0.default)(u,a.count,t),u));return l&&l.cursor&&(d[l.cursor]=null),l&&l.count&&(d[l.count]=null),d}l!=null&&l.count!=null&&l.cursor!=null||D$(!1);var f=(0,Yu.default)((0,Yu.default)((0,Yu.default)({},n),i),{},(s={},(0,u0.default)(s,l.cursor,r),(0,u0.default)(s,l.count,t),s));return a&&a.cursor&&(f[a.cursor]=null),a&&a.count&&(f[a.count]=null),f}var uEe=lEe,cEe=Ke.default,dEe=cEe(Tr),F$=De;function fEe(e,t){var r=e,n=(0,dEe.default)(t),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;if(r==null)return null;typeof o=="number"?(Array.isArray(r)||F$(!1),r=r[o]):(typeof r=="object"&&!Array.isArray(r)||F$(!1),r=r[o])}}catch(s){n.e(s)}finally{n.f()}return r}var hEe=fEe,m8=vge;m8.isErrorResult;m8.isValueResult;var pEe=Gm,gEe=ow,mEe=_me,vEe=yme,_Ee=Fme,I$=Jm,bEe=jme,yEe=bl,xEe=nve,SEe=uve,c0=Wm,es=Wo,EEe=fve,Rw=ks;Rw.generateClientID;Rw.generateUniqueClientID;Rw.isClientID;var wEe=Fve,kEe=Ove,CEe=zve,REe=sw,v8=Ym;v8.isSuspenseSentinel;v8.suspenseSentinel;var AEe=dbe,P$=_l,TEe=OSe,O$=yl,yi=Go,$Ee=kw,NEe=Iu,Ui=rr,DEe=tw,M$=vw,FEe=KSe,IEe=tL,PEe=nEe,OEe=aEe,MEe=uEe,LEe=hL,zEe=p8,UEe=rL,BEe=hEe,jEe=tp,qEe=jEe.handlePotentialSnapshotErrors,VEe=W4,KEe=pL,HEe=Qm,WEe=A4,GEe=go,JEe=J4,_8=Nu;_8.hasCycle;_8.stableCopy;var QEe={Environment:TEe,Network:bEe,Observable:yEe,RecordSource:NEe,ReplaySubject:JEe,Store:$Ee,areEqualSelectors:yi.areEqualSelectors,createFragmentSpecResolver:wEe,createNormalizationSelector:yi.createNormalizationSelector,createOperationDescriptor:O$.createOperationDescriptor,createReaderSelector:yi.createReaderSelector,createRequestDescriptor:O$.createRequestDescriptor,getArgumentValues:Ui.getArgumentValues,getDataIDsFromFragment:yi.getDataIDsFromFragment,getDataIDsFromObject:yi.getDataIDsFromObject,getNode:es.getNode,getFragment:es.getFragment,getInlineDataFragment:es.getInlineDataFragment,getModuleComponentKey:Ui.getModuleComponentKey,getModuleOperationKey:Ui.getModuleOperationKey,getPaginationFragment:es.getPaginationFragment,getPluralSelector:yi.getPluralSelector,getRefetchableFragment:es.getRefetchableFragment,getRequest:es.getRequest,getRequestIdentifier:UEe,getSelector:yi.getSelector,getSelectorsFromObject:yi.getSelectorsFromObject,getSingularSelector:yi.getSingularSelector,getStorageKey:Ui.getStorageKey,getVariablesFromFragment:yi.getVariablesFromFragment,getVariablesFromObject:yi.getVariablesFromObject,getVariablesFromPluralFragment:yi.getVariablesFromPluralFragment,getVariablesFromSingularFragment:yi.getVariablesFromSingularFragment,handlePotentialSnapshotErrors:qEe,graphql:es.graphql,isFragment:es.isFragment,isInlineDataFragment:es.isInlineDataFragment,isRequest:es.isRequest,readInlineData:AEe,readFragment:DEe.readFragment,MutationTypes:I$.MutationTypes,RangeOperations:I$.RangeOperations,ConnectionHandler:pEe,VIEWER_ID:M$.VIEWER_ID,VIEWER_TYPE:M$.VIEWER_TYPE,applyOptimisticMutation:mEe,commitLocalUpdate:vEe,commitMutation:_Ee,fetchQuery:xEe,fetchQuery_DEPRECATED:SEe,isRelayModernEnvironment:REe,requestSubscription:FEe,ConnectionInterface:gEe,PreloadableQueryRegistry:EEe,RelayFeatureFlags:GEe,DEFAULT_HANDLE_KEY:WEe.DEFAULT_HANDLE_KEY,FRAGMENTS_KEY:Ui.FRAGMENTS_KEY,FRAGMENT_OWNER_KEY:Ui.FRAGMENT_OWNER_KEY,ID_KEY:Ui.ID_KEY,REF_KEY:Ui.REF_KEY,REFS_KEY:Ui.REFS_KEY,ROOT_ID:Ui.ROOT_ID,ROOT_TYPE:Ui.ROOT_TYPE,TYPENAME_KEY:Ui.TYPENAME_KEY,deepFreeze:IEe,isPromise:VEe,isScalarAndEqual:KEe,recycleNodesInto:HEe,getFragmentIdentifier:PEe,getRefetchMetadata:zEe,getPaginationMetadata:OEe,getPaginationVariables:MEe,getPendingOperationsForFragment:LEe,getValueAtPath:BEe,__internal:{createRelayContext:kEe,createRelayLoggingContext:CEe,getOperationVariables:P$.getOperationVariables,getLocalVariables:P$.getLocalVariables,fetchQuery:c0.fetchQuery,fetchQueryDeduped:c0.fetchQueryDeduped,getPromiseForActiveRequest:c0.getPromiseForActiveRequest,getObservableForActiveRequest:c0.getObservableForActiveRequest}},gt=QEe,YEe=kw,b8=YEe;const y8=a9(b8),XEe=u9({__proto__:null,default:y8},[b8]);let L$={kind:"linked",handle:(e,t,r,n)=>{let i=e.name,o=r.id;if(!(t==null||i!=="node"||t.getType()!==gt.ROOT_TYPE))return o}};function ZEe(e,t,r){return new gt.Store(e,{gcReleaseBufferSize:t,queryCacheExpirationTime:r})}function ewe(e,t,r){return new y8(e,{gcReleaseBufferSize:t,queryCacheExpirationTime:r})}function twe(e,t,r){return new XEe(e,{gcReleaseBufferSize:t,queryCacheExpirationTime:r})}let rwe={make:ZEe,makeLiveStore:ewe,_makeLiveStoreCjs:twe};function nwe(e,t,r,n,i,o,s){return new gt.Environment({network:e,store:t,getDataID:r,treatMissingFieldsAsNull:n,missingFieldHandlers:i!==void 0?i.concat([L$]):[L$],relayFieldLogger:o,isServer:s})}function x8(e,t,r){let n=[],i=e.getStore().getSource()._records.get(r);return i!==void 0&&Object.entries(i).forEach(o=>{if(o[0].startsWith("__"+t+"_connection")){n.push(o[1].__ref);return}}),n}function iwe(e,t,r,n){let i=n!==void 0?n:[];gt.commitLocalUpdate(e,o=>{x8(e,t,r).forEach(s=>{if(!i.includes(s))return ie(ms(o.get(s)),a=>{a.invalidateRecord()})})})}let owe={make:nwe,findAllConnectionIds:x8,invalidateAllOfConnection:iwe};var swe=St,awe=gt,lwe=awe.__internal.createRelayContext,Rd=lwe(swe),S8={exports:{}};(function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var o in i)({}).hasOwnProperty.call(i,o)&&(r[o]=i[o])}return r},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(S8);var sv=S8.exports,E8={exports:{}};(function(e){function t(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(E8);var av=E8.exports,w8={exports:{}},k8={exports:{}};(function(e){function t(r,n){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,o){return i.__proto__=o,i},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(k8);var uwe=k8.exports;(function(e){var t=uwe;function r(n,i){n.prototype=Object.create(i.prototype),n.prototype.constructor=n,t(n,i)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(w8);var lv=w8.exports,z$=De;function cwe(e,t){t&&typeof t=="object"||z$(!1);for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];n&&(typeof n=="object"||typeof n=="function")||z$(!1)}}var dwe=cwe;function C8(e){return e.displayName||e.name||"Component"}function fwe(e){return"Relay("+C8(e)+")"}var uv={getComponentName:C8,getContainerName:fwe},hwe=St,R8=hwe.createContext({rootIsQueryRenderer:!1}),pwe=Ke.default,gwe=pwe(sv),mwe=dwe,A8=uv,vwe=A8.getComponentName,_we=A8.getContainerName,bwe=Rd,ywe=R8,xwe=De,O1=St,Swe=gt,Ewe=Swe.getFragment,U$=O1.useContext;function wwe(e,t,r){var n=_we(e);mwe(vwe(e),t);var i={};for(var o in t)i[o]=Ewe(t[o]);var s=r(e,i);s.displayName=n;function a(u,d){var f,h=U$(bwe);h==null&&xwe(!1);var p=U$(ywe);return O1.createElement(s,(0,gwe.default)({},u,{__relayContext:h,__rootIsQueryRenderer:(f=p?.rootIsQueryRenderer)!==null&&f!==void 0?f:!1,componentRef:u.componentRef||d}))}a.displayName=n;var l=O1.forwardRef(a);return l}var Aw=wwe;function kwe(e){return typeof e=="object"&&e!==null&&typeof e.check=="function"&&typeof e.lookup=="function"&&typeof e.retain=="function"&&typeof e.execute=="function"&&typeof e.subscribe=="function"}var Cwe=kwe,Rwe=Cwe,Awe=De;function Twe(e){return $we(e)||Awe(!1),e}function $we(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Rwe(e.environment)}var Tw={assertRelayContext:Twe},np=Ke.default,Nwe=np(sv),Dwe=np(Cd),Fwe=np(av),Iwe=np(lv),B$=np(Xn),Pwe=["componentRef","__relayContext","__rootIsQueryRenderer"],Owe=Aw,Mwe=uv,Lwe=Mwe.getContainerName,zwe=Tw,j$=zwe.assertRelayContext,Uwe=ha,q$=St,$w=gt,V$=$w.createFragmentSpecResolver,K$=$w.getDataIDsFromObject,Bwe=$w.isScalarAndEqual;function jwe(e,t){var r,n=Lwe(e);return r=(function(i){(0,Iwe.default)(o,i);function o(a){var l,u;u=i.call(this,a)||this,(0,B$.default)((0,Fwe.default)(u),"_handleFragmentDataUpdate",function(){var p=u.state.resolver;u.setState(function(g){return p===g.resolver?{data:g.resolver.resolve(),relayProp:d0(g.relayProp.environment)}:null})});var d=j$(a.__relayContext),f=(l=a.__rootIsQueryRenderer)!==null&&l!==void 0?l:!1,h=V$(d,n,t,a,f);return u.state={data:h.resolve(),prevProps:a,prevPropsContext:d,relayProp:d0(d.environment),resolver:h},u}o.getDerivedStateFromProps=function(l,u){var d,f=u.prevProps,h=j$(l.__relayContext),p=(d=l.__rootIsQueryRenderer)!==null&&d!==void 0?d:!1,g=K$(t,f),m=K$(t,l),v=u.resolver;if(u.prevPropsContext.environment!==h.environment||!Uwe(g,m))return v=V$(h,n,t,l,p),{data:v.resolve(),prevPropsContext:h,prevProps:l,relayProp:d0(h.environment),resolver:v};v.setProps(l);var _=v.resolve();return _!==u.data?{data:_,prevProps:l,prevPropsContext:h,relayProp:d0(h.environment)}:null};var s=o.prototype;return s.componentDidMount=function(){this._subscribeToNewResolverAndRerenderIfStoreHasChanged()},s.componentDidUpdate=function(l,u){this.state.resolver!==u.resolver?(u.resolver.dispose(),this._subscribeToNewResolverAndRerenderIfStoreHasChanged()):this._rerenderIfStoreHasChanged()},s.componentWillUnmount=function(){this.state.resolver.dispose()},s.shouldComponentUpdate=function(l,u){if(u.data!==this.state.data)return!0;for(var d=Object.keys(l),f=0;f<d.length;f++){var h=d[f];if(h==="__relayContext"){if(u.prevPropsContext.environment!==this.state.prevPropsContext.environment)return!0}else if(!t.hasOwnProperty(h)&&!Bwe(l[h],this.props[h]))return!0}return!1},s._rerenderIfStoreHasChanged=function(){var l=this.state,u=l.data,d=l.resolver,f=d.resolve();u!==f&&this.setState({data:f})},s._subscribeToNewResolverAndRerenderIfStoreHasChanged=function(){var l=this.state,u=l.data,d=l.resolver,f=d.resolve();d.setCallback(this.props,this._handleFragmentDataUpdate),u!==f&&this.setState({data:f})},s.render=function(){var l=this.props,u=l.componentRef;l.__relayContext,l.__rootIsQueryRenderer;var d=(0,Dwe.default)(l,Pwe);return q$.createElement(e,(0,Nwe.default)({},d,this.state.data,{ref:u,relay:this.state.relayProp}))},o})(q$.Component),(0,B$.default)(r,"displayName",n),r}function d0(e){return{environment:e}}function qwe(e,t){return Owe(e,t,jwe)}var Vwe={createContainer:qwe},cv=St,Nw=gt;Nw.createOperationDescriptor;Nw.deepFreeze;Nw.getRequest;cv.useLayoutEffect;cv.useState;cv.useRef;cv.useMemo;var Kwe=Ke.default,H$=Kwe(Bt),Hwe=gt,Wwe=Hwe.getSelector;function Gwe(e,t){var r={};return Object.keys(e).forEach(function(n){var i,o,s,a=e[n],l=t[n],u=Wwe(a,l),d=u!=null&&u.kind==="PluralReaderSelector"?(i=(o=u.selectors[0])===null||o===void 0?void 0:o.owner.variables)!==null&&i!==void 0?i:{}:(s=u?.owner.variables)!==null&&s!==void 0?s:{};r=(0,H$.default)((0,H$.default)({},r),d)}),r}var T8=Gwe,Jwe=Ke.default,W$=Jwe(Xn),Ab=De,Dw=gt,Qwe=Dw.__internal.fetchQuery,Ywe=Dw.createOperationDescriptor,Xwe=Dw.isRelayModernEnvironment,Zwe=(function(){function e(r){(0,W$.default)(this,"_selectionReferences",[]),(0,W$.default)(this,"_didFetchFinish",!1),r!=null&&(this._cacheSelectionReference=r.cacheSelectionReference,this._selectionReferences=r.selectionReferences)}var t=e.prototype;return t.getSelectionReferences=function(){return{cacheSelectionReference:this._cacheSelectionReference,selectionReferences:this._selectionReferences}},t.lookupInStore=function(n,i,o){return(o==="store-and-network"||o==="store-or-network")&&n.check(i).status==="available"?(this._retainCachedOperation(n,i),n.lookup(i.fragment)):null},t.getFetchResult=function(){if(this._didFetchFinish){if(this._error!=null)return{error:this._error};if(this._snapshot!=null)return{snapshot:this._snapshot}}else return null},t.execute=function(n){var i=this,o=n.environment,s=n.operation,a=n.preservePreviousReferences,l=a===void 0?!1:a,u=o.retain(s),d=function(){i._selectionReferences=i._selectionReferences.concat(u)},f=function(){l||i.disposeSelectionReferences(),i._selectionReferences=i._selectionReferences.concat(u)},h=function(){i._selectionReferences=i._selectionReferences.concat(u)};return Xwe(o)?Qwe(o,s).do({error:d,complete:f,unsubscribe:h}):o.execute({operation:s}).do({error:d,complete:f,unsubscribe:h})},t.setOnDataChange=function(n){this._fetchOptions||Ab(!1),typeof n=="function"&&(this._fetchOptions.onDataChangeCallbacks=this._fetchOptions.onDataChangeCallbacks||[],this._fetchOptions.onDataChangeCallbacks.push(n),this._didFetchFinish&&(this._error!=null?n({error:this._error}):this._snapshot!=null&&n({snapshot:this._snapshot})))},t.fetch=function(n,i){var o=this,s=n.environment,a=n.operation,l=n.onDataChange,u=!1,d;this.disposeRequest();var f=this._fetchOptions&&this._fetchOptions.onDataChangeCallbacks;this._fetchOptions={environment:s,onDataChangeCallbacks:f||[],operation:a},l&&this._fetchOptions.onDataChangeCallbacks.indexOf(l)===-1&&this._fetchOptions.onDataChangeCallbacks.push(l);var h=i?Ywe(a.request.node,a.request.variables,i):a,p=this.execute({environment:s,operation:h}).finally(function(){o._pendingRequest=null}).subscribe({next:function(){o._didFetchFinish=!0,o._error=null,o._onQueryDataAvailable({notifyFirstResult:u})},error:function(m){o._didFetchFinish=!0,o._error=m,o._snapshot=null;var v=o._fetchOptions&&o._fetchOptions.onDataChangeCallbacks;u?v&&v.forEach(function(_){_({error:m})}):d=m}});if(this._pendingRequest={dispose:function(){p.unsubscribe()}},u=!0,d)throw d;return this._snapshot},t.retry=function(n){return this._fetchOptions||Ab(!1),this.fetch({environment:this._fetchOptions.environment,operation:this._fetchOptions.operation,onDataChange:null},n)},t.dispose=function(){this.disposeRequest(),this.disposeSelectionReferences()},t.disposeRequest=function(){this._error=null,this._snapshot=null,this._pendingRequest&&this._pendingRequest.dispose(),this._rootSubscription&&(this._rootSubscription.dispose(),this._rootSubscription=null)},t._retainCachedOperation=function(n,i){this._disposeCacheSelectionReference(),this._cacheSelectionReference=n.retain(i)},t._disposeCacheSelectionReference=function(){this._cacheSelectionReference&&this._cacheSelectionReference.dispose(),this._cacheSelectionReference=null},t.disposeSelectionReferences=function(){this._disposeCacheSelectionReference(),this._selectionReferences.forEach(function(n){return n.dispose()}),this._selectionReferences=[]},t._onQueryDataAvailable=function(n){var i=this,o=n.notifyFirstResult;this._fetchOptions||Ab(!1);var s=this._fetchOptions,a=s.environment,l=s.onDataChangeCallbacks,u=s.operation;if(!this._snapshot&&(this._snapshot=a.lookup(u.fragment),this._rootSubscription=a.subscribe(this._snapshot,function(f){if(i._fetchOptions!=null){var h=i._fetchOptions.onDataChangeCallbacks;Array.isArray(h)&&h.forEach(function(p){return p({snapshot:f})})}}),this._snapshot&&o&&Array.isArray(l))){var d=this._snapshot;l.forEach(function(f){return f({snapshot:d})})}},e})(),Fw=Zwe,Ad=Ke.default,e2e=Ad(sv),Tb=Ad(Cd),of=Ad(av),t2e=Ad(lv),Il=Ad(Xn),Vn=Ad(Bt),r2e=["componentRef"],n2e=["componentRef","__relayContext","__rootIsQueryRenderer"],i2e=["componentRef","__relayContext","__rootIsQueryRenderer"],o2e=Aw,$b=T8,$8=uv,s2e=$8.getComponentName,a2e=$8.getContainerName,l2e=Rd,u2e=Fw,c2e=Tw,Nb=c2e.assertRelayContext,Db=ha,os=De,Fb=St,ga=gt,G$=ga.ConnectionInterface,J$=ga.Observable,f0=ga.RelayFeatureFlags,h0=ga.createFragmentSpecResolver,d2e=ga.createOperationDescriptor,Q$=ga.getDataIDsFromObject,f2e=ga.getRequest,h2e=ga.getVariablesFromObject,p2e=ga.isScalarAndEqual,Y$="forward";function g2e(e){var t=e.path;return t||os(!1),function(r){for(var n=r[e.fragmentName],i=0;i<t.length;i++){if(!n||typeof n!="object")return null;n=n[t[i]]}return n}}function m2e(e){var t=e.count;return t||os(!1),function(r,n){return(0,Vn.default)((0,Vn.default)({},r),{},(0,Il.default)({},t,n))}}function v2e(e){var t=null,r=!1;for(var n in e){var i=e[n],o=i.metadata&&i.metadata.connection;i.metadata!==void 0&&(r=!0),o&&(o.length!==1&&os(!1),t&&os(!1),t=(0,Vn.default)((0,Vn.default)({},o[0]),{},{fragmentName:n}))}return!r||t!==null||os(!1),t||{}}function X$(e){return typeof e=="function"?{error:e,complete:e,unsubscribe:function(r){typeof e=="function"&&e()}}:e||{}}function _2e(e,t,r){var n;s2e(e);var i=a2e(e),o=v2e(t),s=r.getConnectionFromProps||g2e(o),a=r.direction||o.direction;a||os(!1);var l=r.getFragmentVariables||m2e(o);return n=(function(u){(0,t2e.default)(d,u);function d(h){var p,g;g=u.call(this,h)||this,(0,Il.default)((0,of.default)(g),"_handleFragmentDataUpdate",function(){g.setState({data:g._resolver.resolve()})}),(0,Il.default)((0,of.default)(g),"_hasMore",function(){var _=g._getConnectionData();return!!(_&&_.hasMore&&_.cursor)}),(0,Il.default)((0,of.default)(g),"_isLoading",function(){return!!g._refetchSubscription}),(0,Il.default)((0,of.default)(g),"_refetchConnection",function(_,x,w){if(!g._canFetchPage("refetchConnection"))return{dispose:function(){}};g._refetchVariables=w;var S={count:_,cursor:null,totalCount:_},k=g._fetchPage(S,X$(x),{force:!0});return{dispose:k.unsubscribe}}),(0,Il.default)((0,of.default)(g),"_loadMore",function(_,x,w){if(!g._canFetchPage("loadMore"))return{dispose:function(){}};var S=X$(x),k=g._getConnectionData();if(!k)return J$.create(function(P){return P.complete()}).subscribe(S),null;var A=k.edgeCount+_;if(w&&w.force)return g._refetchConnection(A,x);var C=G$.get();C.END_CURSOR,C.START_CURSOR;var R=k.cursor,N={count:_,cursor:R,totalCount:A},I=g._fetchPage(N,S,w);return{dispose:I.unsubscribe}});var m=Nb(h.__relayContext),v=(p=h.__rootIsQueryRenderer)!==null&&p!==void 0?p:!1;return g._isARequestInFlight=!1,g._refetchSubscription=null,g._refetchVariables=null,f0.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT===!0?g._resolver=h0(m,i,t,h,v):g._resolver=h0(m,i,t,h,v,g._handleFragmentDataUpdate),g.state={data:g._resolver.resolve(),prevContext:m,contextForChildren:m,relayProp:g._buildRelayProp(m),resolverGeneration:0},g._isUnmounted=!1,g._hasFetched=!1,g}var f=d.prototype;return f.componentDidMount=function(){this._isUnmounted=!1,f0.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT===!0&&this._subscribeToNewResolverAndRerenderIfStoreHasChanged()},f.componentDidUpdate=function(p,g){f0.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT===!0&&(g.resolverGeneration!==this.state.resolverGeneration?this._subscribeToNewResolverAndRerenderIfStoreHasChanged():this._rerenderIfStoreHasChanged())},f.UNSAFE_componentWillReceiveProps=function(p){var g=this,m,v=Nb(p.__relayContext),_=(m=p.__rootIsQueryRenderer)!==null&&m!==void 0?m:!1,x=Q$(t,this.props),w=Q$(t,p),S=$b(t,this.props),k=$b(t,p);v.environment!==this.state.prevContext.environment||!Db(S,k)||!Db(x,w)?(this._cleanup(),f0.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT===!0?this._resolver=h0(v,i,t,p,_):this._resolver=h0(v,i,t,p,_,this._handleFragmentDataUpdate),this.setState(function(C){return{prevContext:v,contextForChildren:v,relayProp:g._buildRelayProp(v),resolverGeneration:C.resolverGeneration+1}})):this._hasFetched||this._resolver.setProps(p);var A=this._resolver.resolve();A!==this.state.data&&this.setState({data:A})},f.componentWillUnmount=function(){this._isUnmounted=!0,this._cleanup()},f.shouldComponentUpdate=function(p,g){if(g.data!==this.state.data||g.relayProp!==this.state.relayProp||g.resolverGeneration!==this.state.resolverGeneration)return!0;for(var m=Object.keys(p),v=0;v<m.length;v++){var _=m[v];if(_==="__relayContext"){if(g.prevContext.environment!==this.state.prevContext.environment)return!0}else if(!t.hasOwnProperty(_)&&!p2e(p[_],this.props[_]))return!0}return!1},f._buildRelayProp=function(p){return{hasMore:this._hasMore,isLoading:this._isLoading,loadMore:this._loadMore,refetchConnection:this._refetchConnection,environment:p.environment}},f._rerenderIfStoreHasChanged=function(){var p=this.state.data,g=this._resolver.resolve();p!==g&&this.setState({data:g})},f._subscribeToNewResolverAndRerenderIfStoreHasChanged=function(){var p=this.state.data,g=this._resolver.resolve();this._resolver.setCallback(this.props,this._handleFragmentDataUpdate),p!==g&&this.setState({data:g})},f._getConnectionData=function(){var p=this.props;p.componentRef;var g=(0,Tb.default)(p,r2e),m=(0,Vn.default)((0,Vn.default)({},g),this.state.data),v=s(m);if(v==null)return null;var _=G$.get(),x=_.EDGES,w=_.PAGE_INFO,S=_.HAS_NEXT_PAGE,k=_.HAS_PREV_PAGE,A=_.END_CURSOR,C=_.START_CURSOR;typeof v!="object"&&os(!1);var R=v[x],N=v[w];if(R==null||N==null)return null;Array.isArray(R)||os(!1),typeof N!="object"&&os(!1);var I=a===Y$?N[S]:N[k],P=a===Y$?N[A]:N[C];return typeof I!="boolean"||R.length!==0&&typeof P>"u"?null:{cursor:P,edgeCount:R.length,hasMore:I}},f._getQueryFetcher=function(){return this._queryFetcher||(this._queryFetcher=new u2e),this._queryFetcher},f._canFetchPage=function(p){return!this._isUnmounted},f._fetchPage=function(p,g,m){var v=this,_=Nb(this.props.__relayContext),x=_.environment,w=this.props;w.componentRef,w.__relayContext,w.__rootIsQueryRenderer;var S=(0,Tb.default)(w,n2e),k=(0,Vn.default)((0,Vn.default)({},S),this.state.data),A,C=$b(t,S);A=h2e(t,S),A=(0,Vn.default)((0,Vn.default)((0,Vn.default)({},C),A),this._refetchVariables);var R=r.getVariables(k,{count:p.count,cursor:p.cursor},A);typeof R=="object"&&R!==null||os(!1),R=(0,Vn.default)((0,Vn.default)({},R),this._refetchVariables),A=(0,Vn.default)((0,Vn.default)({},R),A);var N=m?{force:!!m.force}:void 0;N!=null&&m?.metadata!=null&&(N.metadata=m?.metadata);var I=f2e(r.query),P=d2e(I,R,N),z=null;this._refetchSubscription&&this._refetchSubscription.unsubscribe(),this._hasFetched=!0;var q=function(Y,G){var J=v._resolver.resolve();v._resolver.setVariables(l(A,p.totalCount),P.request.node);var Q=v._resolver.resolve();Db(J,Q)?G():v.setState({data:Q,contextForChildren:{environment:v.props.__relayContext.environment}},G)},H=function(){v._refetchSubscription===z&&(v._refetchSubscription=null,v._isARequestInFlight=!1)};return this._isARequestInFlight=!0,z=this._getQueryFetcher().execute({environment:x,operation:P,preservePreviousReferences:!0}).mergeMap(function(V){return J$.create(function(Y){q(V,function(){Y.next(),Y.complete()})})}).do({error:H,complete:H,unsubscribe:H}).subscribe(g||{}),this._refetchSubscription=this._isARequestInFlight?z:null,z},f._cleanup=function(){this._resolver.dispose(),this._refetchVariables=null,this._hasFetched=!1,this._refetchSubscription&&(this._refetchSubscription.unsubscribe(),this._refetchSubscription=null,this._isARequestInFlight=!1),this._queryFetcher&&this._queryFetcher.dispose()},f.render=function(){var p=this.props,g=p.componentRef;p.__relayContext,p.__rootIsQueryRenderer;var m=(0,Tb.default)(p,i2e);return Fb.createElement(l2e.Provider,{value:this.state.contextForChildren},Fb.createElement(e,(0,e2e.default)({},m,this.state.data,{ref:g,relay:this.state.relayProp})))},d})(Fb.Component),(0,Il.default)(n,"displayName",i),n}function b2e(e,t,r){return o2e(e,t,function(n,i){return _2e(n,i,r)})}var y2e={createContainer:b2e},dv=Ke.default,N8=dv(Bt),x2e=dv(av),S2e=dv(lv),E2e=dv(Xn),w2e=Rd,Lg=Fw,k2e=R8,C2e=ha,Ib=St,Iw=gt,R2e=Iw.createOperationDescriptor;Iw.deepFreeze;var Pw=Iw.getRequest,ji={},A2e={rootIsQueryRenderer:!0};Ib.Component;function M1(){return{error:null,props:null,retry:null}}function T2e(){return{error:null,props:{},retry:null}}function j0(e,t,r,n){return{error:e||null,props:t?t.data:null,retry:function(o){var s=r.retry(o);s&&typeof n.handleDataChange=="function"?n.handleDataChange({snapshot:s}):e&&typeof n.handleRetryAfterError=="function"&&n.handleRetryAfterError(e)}}}function Ow(e,t){return JSON.stringify({id:e.cacheID?e.cacheID:e.id,variables:t})}function Z$(e,t){var r=e.query,n=t.queryFetcher.getSelectionReferences();t.queryFetcher.disposeRequest();var i;if(r){var o=Pw(r),s=Ow(o.params,e.variables);i=ji[s]?ji[s].queryFetcher:new Lg(n)}else i=new Lg(n);return(0,N8.default)({prevQuery:e.query,prevPropsEnvironment:e.environment,prevPropsVariables:e.variables,queryFetcher:i},D8(e,i,t.retryCallbacks))}function D8(e,t,r,n){var i=e.environment,o=e.query,s=e.variables,a=e.cacheConfig,l=i;if(o){var u=Pw(o),d=R2e(u,s,a),f={environment:l};if(typeof n=="string"&&ji[n]){var h=ji[n].snapshot;return h?{error:null,relayContext:f,renderProps:j0(null,h,t,r),snapshot:h,requestCacheKey:n}:{error:null,relayContext:f,renderProps:M1(),snapshot:null,requestCacheKey:n}}try{var p=t.lookupInStore(l,d,e.fetchPolicy),g=t.fetch({environment:l,onDataChange:null,operation:d}),m=g||p;return n=n||Ow(u.params,e.variables),ji[n]={queryFetcher:t,snapshot:m},m?{error:null,relayContext:f,renderProps:j0(null,m,t,r),snapshot:m,requestCacheKey:n}:{error:null,relayContext:f,renderProps:M1(),snapshot:null,requestCacheKey:n}}catch(_){return{error:_,relayContext:f,renderProps:j0(_,null,t,r),snapshot:null,requestCacheKey:n}}}else{t.dispose();var v={environment:l};return{error:null,relayContext:v,renderProps:T2e(),requestCacheKey:null}}}var Td=Ke.default,$2e=Td(sv),N2e=Td(Cd),Xu=Td(Bt),eN=Td(av),D2e=Td(lv),Pb=Td(Xn),F2e=["componentRef","__relayContext","__rootIsQueryRenderer"],I2e=Aw,Ob=T8,P2e=uv,O2e=P2e.getContainerName,M2e=Rd,L2e=Fw,z2e=Tw,Mb=z2e.assertRelayContext,tN=ha,Lb=St,Mu=gt,U2e=Mu.Observable,rN=Mu.createFragmentSpecResolver,B2e=Mu.createOperationDescriptor,nN=Mu.getDataIDsFromObject,j2e=Mu.getRequest,q2e=Mu.getVariablesFromObject,V2e=Mu.isScalarAndEqual;function K2e(e,t,r){var n,i=O2e(e);return n=(function(o){(0,D2e.default)(s,o);function s(l){var u,d;d=o.call(this,l)||this,(0,Pb.default)((0,eN.default)(d),"_handleFragmentDataUpdate",function(){var g=d.state.resolver;d.setState(function(m){return g===m.resolver?{data:m.resolver.resolve()}:null})}),(0,Pb.default)((0,eN.default)(d),"_refetch",function(g,m,v,_){if(d._isUnmounted)return{dispose:function(){}};var x=Mb(d.props.__relayContext),w=x.environment,S=Ob(t,d.props),k=typeof g=="function"?g(d._getFragmentVariables()):g;k=(0,Xu.default)((0,Xu.default)({},S),k);var A=m?(0,Xu.default)((0,Xu.default)({},k),m):k,C=_?{force:!!_.force}:void 0;C!=null&&_?.metadata!=null&&(C.metadata=_?.metadata);var R=typeof v=="function"?{next:v,error:v}:v||{},N=j2e(r),I=B2e(N,k,C);d.state.localVariables=k,d._refetchSubscription&&d._refetchSubscription.unsubscribe();var P,z=d._getQueryFetcher().lookupInStore(w,I,_?.fetchPolicy);return z!=null?(d.state.resolver.setVariables(A,I.request.node),d.setState(function(q){return{data:q.resolver.resolve(),contextForChildren:{environment:d.props.__relayContext.environment}}},function(){R.next&&R.next(),R.complete&&R.complete()}),{dispose:function(){}}):(d._getQueryFetcher().execute({environment:w,operation:I,preservePreviousReferences:!0}).mergeMap(function(q){return d.state.resolver.setVariables(A,I.request.node),U2e.create(function(H){return d.setState(function(V){return{data:V.resolver.resolve(),contextForChildren:{environment:d.props.__relayContext.environment}}},function(){H.next(),H.complete()})})}).finally(function(){d._refetchSubscription===P&&(d._refetchSubscription=null)}).subscribe((0,Xu.default)((0,Xu.default)({},R),{},{start:function(H){d._refetchSubscription=P=H,R.start&&R.start(H)}})),{dispose:function(){P&&P.unsubscribe()}})});var f=Mb(l.__relayContext),h=(u=l.__rootIsQueryRenderer)!==null&&u!==void 0?u:!1;d._refetchSubscription=null;var p=rN(f,i,t,l,h);return d.state={data:p.resolve(),localVariables:null,prevProps:l,prevPropsContext:f,contextForChildren:f,relayProp:iN(f.environment,d._refetch),resolver:p},d._isUnmounted=!1,d}var a=s.prototype;return a.componentDidMount=function(){this._isUnmounted=!1,this._subscribeToNewResolverAndRerenderIfStoreHasChanged()},a.componentDidUpdate=function(u,d){this.state.resolver!==d.resolver?(d.resolver.dispose(),this._queryFetcher&&this._queryFetcher.dispose(),this._refetchSubscription&&this._refetchSubscription.unsubscribe(),this._subscribeToNewResolverAndRerenderIfStoreHasChanged()):this._rerenderIfStoreHasChanged()},s.getDerivedStateFromProps=function(u,d){var f,h=d.prevProps,p=Mb(u.__relayContext),g=(f=u.__rootIsQueryRenderer)!==null&&f!==void 0?f:!1,m=nN(t,h),v=nN(t,u),_=Ob(t,h),x=Ob(t,u),w=d.resolver;if(d.prevPropsContext.environment!==p.environment||!tN(_,x)||!tN(m,v))return w=rN(p,i,t,u,g),{data:w.resolve(),localVariables:null,prevProps:u,prevPropsContext:p,contextForChildren:p,relayProp:iN(p.environment,d.relayProp.refetch),resolver:w};d.localVariables||w.setProps(u);var S=w.resolve();return S!==d.data?{data:S,prevProps:u}:null},a.componentWillUnmount=function(){this._isUnmounted=!0,this.state.resolver.dispose(),this._queryFetcher&&this._queryFetcher.dispose(),this._refetchSubscription&&this._refetchSubscription.unsubscribe()},a.shouldComponentUpdate=function(u,d){if(d.data!==this.state.data||d.relayProp!==this.state.relayProp)return!0;for(var f=Object.keys(u),h=0;h<f.length;h++){var p=f[h];if(p==="__relayContext"){if(this.state.prevPropsContext.environment!==d.prevPropsContext.environment)return!0}else if(!t.hasOwnProperty(p)&&!V2e(u[p],this.props[p]))return!0}return!1},a._rerenderIfStoreHasChanged=function(){var u=this.state,d=u.data,f=u.resolver,h=f.resolve();d!==h&&this.setState({data:h})},a._subscribeToNewResolverAndRerenderIfStoreHasChanged=function(){var u=this.state,d=u.data,f=u.resolver,h=f.resolve();f.setCallback(this.props,this._handleFragmentDataUpdate),d!==h&&this.setState({data:h})},a._getFragmentVariables=function(){return q2e(t,this.props)},a._getQueryFetcher=function(){return this._queryFetcher||(this._queryFetcher=new L2e),this._queryFetcher},a.render=function(){var u=this.props,d=u.componentRef;u.__relayContext,u.__rootIsQueryRenderer;var f=(0,N2e.default)(u,F2e),h=this.state,p=h.relayProp,g=h.contextForChildren;return Lb.createElement(M2e.Provider,{value:g},Lb.createElement(e,(0,$2e.default)({},f,this.state.data,{ref:d,relay:p})))},s})(Lb.Component),(0,Pb.default)(n,"displayName",i),n}function iN(e,t){return{environment:e,refetch:t}}function H2e(e,t,r){return I2e(e,t,function(n,i){return K2e(n,i,r)})}var W2e={createContainer:H2e},G2e=St;G2e.createContext({wrapPrepareQueryResource:function(t){return t()}});var J2e=Rd,Q2e=De,Y2e=St,X2e=Y2e.useContext;function Z2e(){var e=X2e(J2e);return e==null&&Q2e(!1),e.environment}var F8=Z2e,I8=St;I8.useContext;I8.useEffect;var eke=Ke.default,oN=eke(Bt),tke=De,Lu=gt,sN=Lu.__internal.fetchQueryDeduped,aN=Lu.Observable,lN=Lu.PreloadableQueryRegistry,uN=Lu.ReplaySubject,cN=Lu.createOperationDescriptor,rke=Lu.getRequest,nke=Lu.getRequestIdentifier,dN=100001;function ike(e,t,r,n,i){var o;dN++;var s=(o=n?.fetchPolicy)!==null&&o!==void 0?o:"store-or-network",a=(0,oN.default)((0,oN.default)({},n?.networkCacheConfig),{},{force:!0}),l,u=!1,d=function(ue,le){return u=!0,e.executeWithSource({operation:ue,source:le})},f=new uN,h=aN.create(function(Q){return f.subscribe(Q)}),p,g=null,m=!1,v=function(ue,le){m=!0;var Ae=new uN,$e="raw-network-request-"+nke(ue,r),ze=sN(e,$e,function(){var Se=e.getNetwork();return Se.execute(ue,r,a,void 0,void 0,void 0,void 0,le)}),mt=ze.subscribe({error:function(st){g=st,Ae.error(st)},next:function(st){Ae.next(st)},complete:function(){Ae.complete()}}),be=mt.unsubscribe;return p=be,aN.create(function(Se){var st=Ae.subscribe(Se);return function(){st.unsubscribe(),p()}})},_,x=function(ue,le){m=!0;var Ae=sN(e,ue.request.identifier,le).subscribe({error:function(ze){f.error(ze)},next:function(ze){f.next(ze)},complete:function(){f.complete()}});_=Ae.unsubscribe},w=function(ue){var le=cN(ue,r,a);if(l=e.retain(le),s!=="store-only"){var Ae=s!=="store-or-network"||e.check(le).status!=="available";Ae&&x(le,function(){var $e=v(ue.params,function(){return e.check(le)}),ze=d(le,$e);return ze})}},S,k,A;if(t.kind==="PreloadableConcreteRequest"){var C=t;S=C.params;var R=S;A=R.id,A===null&&tke(!1);var N=lN.get(A);if(N!=null)w(N);else{var I=s==="store-only"?null:v(S),P=lN.onLoad(A,function(Q){k();var ue=cN(Q,r,a);l=e.retain(ue),I!=null&&x(ue,function(){return d(ue,I)})});k=P.dispose}}else{var z=t,q=rke(z);S=q.params,A=S.cacheID!=null?S.cacheID:S.id,w(q)}var H=!1,V=!1,Y=!1,G=function(){V||(l&&l.dispose(),V=!0)},J=function(){Y||(u?_&&_():p&&p(),k&&k(),Y=!0)};return{kind:"PreloadedQuery",environment:e,environmentProviderOptions:i,dispose:function(){H||(G(),J(),H=!0)},releaseQuery:G,cancelNetworkRequest:J,fetchKey:dN,id:A,get isDisposed(){return H||V},get networkError(){return g},name:S.name,networkCacheConfig:a,fetchPolicy:s,source:m?h:void 0,variables:r}}var fv={loadQuery:ike},oke=fv;oke.loadQuery;var ske=St;ske.useMemo;var ake=De,lke=(function(){function e(r){this._capacity=r,this._capacity>0||ake(!1),this._map=new Map}var t=e.prototype;return t.set=function(n,i){if(this._map.delete(n),this._map.set(n,i),this._map.size>this._capacity){var o=this._map.keys().next();o.done||this._map.delete(o.value)}},t.get=function(n){var i=this._map.get(n);return i!=null&&(this._map.delete(n),this._map.set(n,i)),i},t.has=function(n){return this._map.has(n)},t.delete=function(n){this._map.delete(n)},t.size=function(){return this._map.size},t.capacity=function(){return this._capacity-this._map.size},t.clear=function(){this._map.clear()},e})();function uke(e){return new lke(e)}var cke={create:uke},dke=Ke.default,zb=dke(Xn),fke=300*1e3,hke=(function(){function e(r){var n=this;(0,zb.default)(this,"_retainCount",0),(0,zb.default)(this,"_retainDisposable",null),(0,zb.default)(this,"_releaseTemporaryRetain",null),this._retain=function(i){return n._retainCount++,n._retainCount===1&&(n._retainDisposable=r(i)),{dispose:function(){n._retainCount=Math.max(0,n._retainCount-1),n._retainCount===0&&n._retainDisposable!=null&&(n._retainDisposable.dispose(),n._retainDisposable=null)}}}}var t=e.prototype;return t.temporaryRetain=function(n){var i=this,o;if(n.isServer())return{dispose:function(){}};var s=this._retain(n),a=null,l=function(){clearTimeout(a),a=null,i._releaseTemporaryRetain=null,s.dispose()};return a=setTimeout(l,fke),(o=this._releaseTemporaryRetain)===null||o===void 0||o.call(this),this._releaseTemporaryRetain=l,{dispose:function(){var d;(d=i._releaseTemporaryRetain)===null||d===void 0||d.call(i)}}},t.permanentRetain=function(n){var i=this._retain(n);return this.releaseTemporaryRetain(),i},t.releaseTemporaryRetain=function(){var n;(n=this._releaseTemporaryRetain)===null||n===void 0||n.call(this),this._releaseTemporaryRetain=null},t.getRetainCount=function(){return this._retainCount},e})(),pke=hke,P8=Ke.default,p0=P8(Bt),O8=P8(Xn),gke=cke,mke=pke,vke=De,_ke=gt,bke=_ke.isPromise,yke=1e3,M8="store-or-network",L8="store-and-network",xke=typeof WeakMap=="function";function zg(e){return e.request.node.params.metadata.live!==void 0}function L1(e,t,r,n,i){var o=r??(zg(t)?L8:M8),s=n??e.UNSTABLE_getDefaultRenderPolicy(),a="".concat(o,"-").concat(s,"-").concat(t.request.identifier);return i!=null?"".concat(a,"-").concat(i):a}function fN(e,t){var r={__id:e.fragment.dataID,__fragments:(0,O8.default)({},e.fragment.node.name,e.request.variables),__fragmentOwner:e.request};return{cacheIdentifier:t,fragmentNode:e.request.node.fragment,fragmentRef:r,operation:e}}var Ske=2e5;function Ub(e,t,r,n,i,o){var s=zg(t),a=n,l=i,u=new mke(function(f){var h=f.retain(t);return{dispose:function(){s&&l!=null&&l.unsubscribe(),h.dispose(),o(d)}}}),d={cacheIdentifier:e,id:Ske++,processedPayloadsCount:0,operationAvailability:r,getValue:function(){return a},setValue:function(h){a=h},setNetworkSubscription:function(h){s&&l!=null&&l.unsubscribe(),l=h},temporaryRetain:function(h){return u.temporaryRetain(h)},permanentRetain:function(h){return u.permanentRetain(h)},releaseTemporaryRetain:function(){u.releaseTemporaryRetain()}};return d}var Eke=(function(){function e(r){var n=this;(0,O8.default)(this,"_clearCacheEntry",function(i){n._cache.delete(i.cacheIdentifier)}),this._environment=r,this._cache=gke.create(yke)}var t=e.prototype;return t.prepare=function(n,i,o,s,a,l,u){var d=L1(this._environment,n,o,s,l);return this.prepareWithIdentifier(d,n,i,o,s,a,u)},t.prepareWithIdentifier=function(n,i,o,s,a,l,u){var d=this._environment,f=s??(zg(i)?L8:M8),h=a??d.UNSTABLE_getDefaultRenderPolicy(),p=this._cache.get(n),g=null,m=p!=null;p==null&&(p=this._fetchAndSaveQuery(n,i,o,f,h,u,(0,p0.default)((0,p0.default)({},l),{},{unsubscribe:function(x){g?.dispose();var w=l?.unsubscribe;w&&w(x)}}))),g=p.temporaryRetain(d);var v=p.getValue();if(bke(v))throw d.__log({name:"suspense.query",fetchPolicy:f,isPromiseCached:m,operation:i,queryAvailability:p.operationAvailability,renderPolicy:h}),v;if(v instanceof Error)throw v;return v},t.retain=function(n,i){var o=this._environment,s=n.cacheIdentifier,a=n.operation,l=this._getOrCreateCacheEntry(s,a,null,n,null),u=l.permanentRetain(o);return o.__log({name:"queryresource.retain",profilerContext:i,resourceID:l.id}),{dispose:function(){u.dispose()}}},t.releaseTemporaryRetain=function(n){var i=this._cache.get(n.cacheIdentifier);i?.releaseTemporaryRetain()},t.TESTS_ONLY__getCacheEntry=function(n,i,o,s){var a=this._environment,l=L1(a,n,i,o,s);return this._cache.get(l)},t._getOrCreateCacheEntry=function(n,i,o,s,a){var l=this._cache.get(n);return l==null&&(l=Ub(n,i,o,s,a,this._clearCacheEntry),this._cache.set(n,l)),l},t._fetchAndSaveQuery=function(n,i,o,s,a,l,u){var d=this,f=this._environment,h=f.check(i),p=h.status,g=p==="available",m=g||a==="partial"&&p!=="stale",v,_,x=function(){};switch(s){case"store-only":{v=!1,_=!0;break}case"store-or-network":{v=!g,_=m;break}case"store-and-network":{v=!0,_=m;break}case"network-only":default:{v=!0,_=!1;break}}if(_){var w=fN(i,n),S=Ub(n,i,h,w,null,this._clearCacheEntry);this._cache.set(n,S)}if(v){var k=fN(i,n),A;o.subscribe({start:function(z){A=z;var q=d._cache.get(n);q&&q.setNetworkSubscription(A);var H=u?.start;if(H){var V=(0,p0.default)((0,p0.default)({},z),{},{unsubscribe:function(){zg(i)&&z.unsubscribe()}});H(V)}},next:function(){var z=d._getOrCreateCacheEntry(n,i,h,k,A);z.processedPayloadsCount+=1,z.setValue(k),x();var q=u?.next;if(q!=null){var H=f.lookup(i.fragment);q(H)}},error:function(z){var q=d._getOrCreateCacheEntry(n,i,h,z,A);q.processedPayloadsCount===0&&q.setValue(z),x(),A=null,q.setNetworkSubscription(null);var H=u?.error;H&&H(z)},complete:function(){x(),A=null;var z=d._cache.get(n);z&&z.setNetworkSubscription(null);var q=u?.complete;q&&q()},unsubscribe:u?.unsubscribe});var C=this._cache.get(n);if(!C){var R=new Promise(function(P){x=P});R.displayName="Relay("+i.fragment.node.name+")",C=Ub(n,i,h,R,A,this._clearCacheEntry),this._cache.set(n,C)}}else{var N=u?.complete;N&&N()}var I=this._cache.get(n);return I==null&&vke(!1),f.__log({name:"queryresource.fetch",resourceID:I.id,operation:i,profilerContext:l,fetchPolicy:s,renderPolicy:a,queryAvailability:h,shouldFetch:v}),I},e})();function wke(e){return new Eke(e)}var hN=xke?new WeakMap:new Map;function kke(e){var t=hN.get(e);if(t)return t;var r=wke(e);return hN.set(e,r),r}var ip={getQueryResourceForEnvironment:kke,getQueryCacheIdentifier:L1},Cke=St;Cke.useMemo;var z8=St;z8.useCallback;z8.useEffect;var Rke=St,Ake=gt,Tke=Ake.__internal.createRelayLoggingContext,$ke=Tke(Rke),Nke=$ke,Dke=St,Fke=Dke.useContext;function Ike(){return Fke(Nke)}var U8=Ike,Mw=Ke.default,pN=Mw(Bt),ll=Mw(Tr),Pke=Mw(vl),Oke=ip,B8=Oke.getQueryResourceForEnvironment,Mke=F8,Lke=U8,Pl=De,op=St;op.useDebugValue;var Bb=op.useEffect,jb=op.useMemo,gN=op.useRef,g0=op.useState,ma=gt,j8=ma.__internal,zke=j8.fetchQuery,Uke=j8.getPromiseForActiveRequest,m0=ma.RelayFeatureFlags,mN=ma.areEqualSelectors,Bke=ma.createOperationDescriptor,jke=ma.getPendingOperationsForFragment,qke=ma.getSelector,Vke=ma.getVariablesFromFragment,vN=ma.handlePotentialSnapshotErrors,_N=ma.recycleNodesInto;function Kke(e){return e.kind==="bailout"?!1:e.kind==="singular"?e.snapshot.isMissingData:e.snapshots.some(function(t){return t.isMissingData})}function Hke(e){if(e.kind==="bailout")return null;if(e.kind==="singular"){var t;return(t=e.snapshot.missingClientEdges)!==null&&t!==void 0?t:null}else{var r=null,n=(0,ll.default)(e.snapshots),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;if(o.missingClientEdges){var s;r=(s=r)!==null&&s!==void 0?s:[];var a=(0,ll.default)(o.missingClientEdges),l;try{for(a.s();!(l=a.n()).done;){var u=l.value;r.push(u)}}catch(d){a.e(d)}finally{a.f()}}}}catch(d){n.e(d)}finally{n.f()}return r}}function Wke(e){if(e.kind==="bailout")return null;if(e.kind==="singular"){var t;return(t=e.snapshot.missingLiveResolverFields)!==null&&t!==void 0?t:null}else{var r=null,n=(0,ll.default)(e.snapshots),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;if(o.missingLiveResolverFields){var s;r=(s=r)!==null&&s!==void 0?s:[];var a=(0,ll.default)(o.missingLiveResolverFields),l;try{for(a.s();!(l=a.n()).done;){var u=l.value;r.push(u)}}catch(d){a.e(d)}finally{a.f()}}}}catch(d){n.e(d)}finally{n.f()}return r}}function Gke(e,t,r){if(t.kind==="singular")vN(e,t.snapshot.fieldErrors,r);else if(t.kind==="plural"){var n=(0,ll.default)(t.snapshots),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;vN(e,o.fieldErrors,r)}}catch(s){n.e(s)}finally{n.f()}}}function Ug(e,t){if(t.kind==="bailout")return null;var r=e.getStore().getEpoch();if(r===t.epoch)return null;if(t.kind==="singular"){var n=e.lookup(t.snapshot.selector),i=_N(t.snapshot.data,n.data),o={data:i,isMissingData:n.isMissingData,missingClientEdges:n.missingClientEdges,missingLiveResolverFields:n.missingLiveResolverFields,seenRecords:n.seenRecords,selector:n.selector,fieldErrors:n.fieldErrors};return[i!==t.snapshot.data,{kind:"singular",snapshot:o,epoch:r}]}else{for(var s=!1,a=[],l=0;l<t.snapshots.length;l++){var u=t.snapshots[l],d=e.lookup(u.selector),f=_N(u.data,d.data),h={data:f,isMissingData:d.isMissingData,missingClientEdges:d.missingClientEdges,missingLiveResolverFields:d.missingLiveResolverFields,seenRecords:d.seenRecords,selector:d.selector,fieldErrors:d.fieldErrors};f!==u.data&&(s=!0),a.push(h)}return a.length!==t.snapshots.length&&Pl(!1),[s,{kind:"plural",snapshots:a,epoch:r}]}}function Jke(e,t,r,n,i){var o=Vke(t,r),s=(0,pN.default)((0,pN.default)({},o),{},{id:n.clientEdgeDestinationID}),a=Bke(n.request,s,i?.networkCacheConfig),l=B8(e),u=l.prepare(a,zke(e,a),i?.fetchPolicy);return[u,Uke(e,a.request)]}function Qke(e,t,r,n){if(t.kind==="bailout")return function(){};if(t.kind==="singular"){var i=e.subscribe(t.snapshot,function(s){r(function(a){if(a.kind!=="singular"||a.snapshot.selector!==s.selector){var l=Ug(e,a);if(l!=null){var u=l[0],d=l[1];return e.__log({name:"useFragment.subscription.missedUpdates",hasDataChanges:u}),n.current=u,u?d:a}else return a}return n.current=!0,{kind:"singular",snapshot:s,epoch:e.getStore().getEpoch()}})});return function(){i.dispose()}}else{var o=t.snapshots.map(function(s,a){return e.subscribe(s,function(l){r(function(u){var d;if(u.kind!=="plural"||((d=u.snapshots[a])===null||d===void 0?void 0:d.selector)!==l.selector){var f=Ug(e,u);if(f!=null){var h=f[0],p=f[1];return e.__log({name:"useFragment.subscription.missedUpdates",hasDataChanges:h}),n.current=n.current||h,h?p:u}else return u}var g=(0,Pke.default)(u.snapshots);return g[a]=l,n.current=!0,{kind:"plural",snapshots:g,epoch:e.getStore().getEpoch()}})})});return function(){var s=(0,ll.default)(o),a;try{for(s.s();!(a=s.n()).done;){var l=a.value;l.dispose()}}catch(u){s.e(u)}finally{s.f()}}}}function bN(e,t){return t==null?{kind:"bailout"}:t.kind==="PluralReaderSelector"?{kind:"plural",snapshots:t.selectors.map(function(r){return e.lookup(r)}),epoch:e.getStore().getEpoch()}:{kind:"singular",snapshot:e.lookup(t),epoch:e.getStore().getEpoch()}}function Yke(e,t,r,n){var i,o,s=jb(function(){return qke(e,t)},[e,t]),a=(e==null||(i=e.metadata)===null||i===void 0?void 0:i.plural)===!0;a?t==null||Array.isArray(t)||Pl(!1):Array.isArray(t)&&Pl(!1),t==null||a&&Array.isArray(t)&&t.length===0||s!=null||Pl(!1);var l=Mke(),u;m0.ENABLE_UI_CONTEXT_ON_RELAY_LOGGER&&(u=Lke());var d=g0(function(){return bN(l,s)}),f=d[0],h=d[1],p=f,g=g0(p),m=g[0],v=g[1],_=m,x=g0(s),w=x[0],S=x[1],k=g0(l),A=k[0],C=k[1];if(!mN(s,w)||l!==A){S(s),C(l);var R=bN(l,s);h(R),v(R),p=R,_=R}var N=gN(!1);if(Bb(function(){N.current=s},[s]),((o=e.metadata)===null||o===void 0?void 0:o.hasClientEdges)===!0||m0.CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES){var I=jb(function(){var Ae=Hke(p),$e,ze=[];if(Ae!=null&&Ae.length){$e=[];var mt=(0,ll.default)(Ae),be;try{for(mt.s();!(be=mt.n()).done;){var Se=be.value,st=Jke(l,e,t,Se,n),Xt=st[0],wt=st[1];$e.push(Xt),wt!=null&&ze.push(wt)}}catch(Zn){mt.e(Zn)}finally{mt.f()}}return[$e,ze]},[p,l,e,t,n]),P=I[0],z=I[1];if(z.length)throw Promise.all(z);Bb(function(){var Ae=B8(l);if(P!=null&&P.length){var $e=[],ze=(0,ll.default)(P),mt;try{for(ze.s();!(mt=ze.n()).done;){var be=mt.value;$e.push(Ae.retain(be))}}catch(Se){ze.e(Se)}finally{ze.f()}return function(){for(var Se=0,st=$e;Se<st.length;Se++){var Xt=st[Se];Xt.dispose()}}}},[l,P])}if(Kke(p)){var q=Wke(p);if(q!=null&&q.length>0)throw Promise.all(q.map(function(Ae){return l.getStore().getLiveResolverPromise(Ae)}));if(m0.ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE||l!==A||!N.current||!mN(N.current,s)){s==null&&Pl(!1);var H=s.kind==="PluralReaderSelector"?s.selectors[0].owner:s.owner,V=jke(l,e,H);if(V)throw V.promise}}Gke(l,p,u);var Y=gN(!1);if(Bb(function(){var Ae=_,$e=Ug(l,_);if($e!==null){var ze=$e[0],mt=$e[1];ze&&h(mt),Ae=mt}return Qke(l,Ae,h,Y)},[l,_]),Y.current){var G=Ug(l,p);if(G!=null){var J=G[0],Q=G[1];J&&(h(Q),p=Q)}Y.current=!1}var ue;if(a){var le=t==null;ue=jb(function(){return p.kind==="bailout"?le?null:[]:(p.kind!=="plural"&&Pl(!1),p.snapshots.map(function(Ae){return Ae.data}))},[p,le])}else p.kind==="bailout"?ue=null:(p.kind!=="singular"&&Pl(!1),ue=p.snapshot.data);return m0.LOG_MISSING_RECORDS_IN_PROD&&t!=null&&(ue===void 0||Array.isArray(ue)&&ue.length>0&&ue.every(function(Ae){return Ae===void 0})),ue}var Xke=Yke,Lw=Ke.default,yN=Lw(Bt),ul=Lw(Tr),Zke=Lw(vl),eCe=ip,q8=eCe.getQueryResourceForEnvironment,tCe=F8,rCe=U8,Ol=De,sp=St;sp.useDebugValue;var v0=sp.useEffect,qb=sp.useMemo,xN=sp.useRef,nCe=sp.useState,va=gt,V8=va.__internal,iCe=V8.fetchQuery,oCe=V8.getPromiseForActiveRequest,_0=va.RelayFeatureFlags,SN=va.areEqualSelectors,sCe=va.createOperationDescriptor,aCe=va.getPendingOperationsForFragment,lCe=va.getSelector,uCe=va.getVariablesFromFragment,EN=va.handlePotentialSnapshotErrors,wN=va.recycleNodesInto;function cCe(e){return e.kind==="bailout"?!1:e.kind==="singular"?e.snapshot.isMissingData:e.snapshots.some(function(t){return t.isMissingData})}function dCe(e){if(e.kind==="bailout")return null;if(e.kind==="singular"){var t;return(t=e.snapshot.missingClientEdges)!==null&&t!==void 0?t:null}else{var r=null,n=(0,ul.default)(e.snapshots),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;if(o.missingClientEdges){var s;r=(s=r)!==null&&s!==void 0?s:[];var a=(0,ul.default)(o.missingClientEdges),l;try{for(a.s();!(l=a.n()).done;){var u=l.value;r.push(u)}}catch(d){a.e(d)}finally{a.f()}}}}catch(d){n.e(d)}finally{n.f()}return r}}function fCe(e){if(e.kind==="bailout")return null;if(e.kind==="singular"){var t;return(t=e.snapshot.missingLiveResolverFields)!==null&&t!==void 0?t:null}else{var r=null,n=(0,ul.default)(e.snapshots),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;if(o.missingLiveResolverFields){var s;r=(s=r)!==null&&s!==void 0?s:[];var a=(0,ul.default)(o.missingLiveResolverFields),l;try{for(a.s();!(l=a.n()).done;){var u=l.value;r.push(u)}}catch(d){a.e(d)}finally{a.f()}}}}catch(d){n.e(d)}finally{n.f()}return r}}function hCe(e,t,r){if(t.kind==="singular")EN(e,t.snapshot.fieldErrors,r);else if(t.kind==="plural"){var n=(0,ul.default)(t.snapshots),i;try{for(n.s();!(i=n.n()).done;){var o=i.value;EN(e,o.fieldErrors,r)}}catch(s){n.e(s)}finally{n.f()}}}function z1(e,t){if(t.kind==="bailout")return null;var r=e.getStore().getEpoch();if(r===t.epoch)return null;if(t.kind==="singular"){var n=e.lookup(t.snapshot.selector),i=wN(t.snapshot.data,n.data),o={data:i,isMissingData:n.isMissingData,missingClientEdges:n.missingClientEdges,missingLiveResolverFields:n.missingLiveResolverFields,seenRecords:n.seenRecords,selector:n.selector,fieldErrors:n.fieldErrors};return[i!==t.snapshot.data,{kind:"singular",snapshot:o,epoch:r,selector:t.selector,environment:t.environment}]}else{for(var s=!1,a=[],l=0;l<t.snapshots.length;l++){var u=t.snapshots[l],d=e.lookup(u.selector),f=wN(u.data,d.data),h={data:f,isMissingData:d.isMissingData,missingClientEdges:d.missingClientEdges,missingLiveResolverFields:d.missingLiveResolverFields,seenRecords:d.seenRecords,selector:d.selector,fieldErrors:d.fieldErrors};f!==u.data&&(s=!0),a.push(h)}return a.length!==t.snapshots.length&&Ol(!1),[s,{kind:"plural",snapshots:a,epoch:r,selector:t.selector,environment:t.environment}]}}function pCe(e,t,r,n,i){var o=uCe(t,r),s=(0,yN.default)((0,yN.default)({},o),{},{id:n.clientEdgeDestinationID}),a=sCe(n.request,s,i?.networkCacheConfig),l=q8(e),u=l.prepare(a,iCe(e,a),i?.fetchPolicy),d=oCe(e,a.request);return d!=null&&d.displayName==null&&(d.displayName=n.request.params.name),[u,d]}function kN(e,t,r){if(t.kind==="bailout")return function(){};if(t.kind==="singular"){var n=e.subscribe(t.snapshot,function(o){r(function(s){var a=null;if(s.kind!=="singular"||s.snapshot.selector!==o.selector||s.environment!==e){var l=z1(s.environment,s);if(l!=null){var u=l[0],d=l[1];e.__log({name:"useFragment.subscription.missedUpdates",hasDataChanges:u}),a=u?d:s}else a=s}else a={kind:"singular",snapshot:o,epoch:e.getStore().getEpoch(),selector:t.selector,environment:t.environment};return a})});return function(){n.dispose()}}else{var i=t.snapshots.map(function(o,s){return e.subscribe(o,function(a){r(function(l){var u,d=null;if(l.kind!=="plural"||((u=l.snapshots[s])===null||u===void 0?void 0:u.selector)!==a.selector||l.environment!==e){var f=z1(l.environment,l);if(f!=null){var h=f[0],p=f[1];e.__log({name:"useFragment.subscription.missedUpdates",hasDataChanges:h}),d=h?p:l}else d=l}else{var g=(0,Zke.default)(l.snapshots);g[s]=a,d={kind:"plural",snapshots:g,epoch:e.getStore().getEpoch(),selector:t.selector,environment:t.environment}}return d})})});return function(){var o=(0,ul.default)(i),s;try{for(o.s();!(s=o.n()).done;){var a=s.value;a.dispose()}}catch(l){o.e(l)}finally{o.f()}}}}function CN(e,t){return t==null?{kind:"bailout",environment:e}:t.kind==="PluralReaderSelector"?{kind:"plural",snapshots:t.selectors.map(function(r){return e.lookup(r)}),epoch:e.getStore().getEpoch(),selector:t,environment:e}:{kind:"singular",snapshot:e.lookup(t),epoch:e.getStore().getEpoch(),selector:t,environment:e}}function gCe(e,t,r,n){var i,o,s=qb(function(){return lCe(e,t)},[e,t]),a=(e==null||(i=e.metadata)===null||i===void 0?void 0:i.plural)===!0;a?t==null||Array.isArray(t)||Ol(!1):Array.isArray(t)&&Ol(!1),t==null||a&&Array.isArray(t)&&t.length===0||s!=null||Ol(!1);var l=tCe(),u;_0.ENABLE_UI_CONTEXT_ON_RELAY_LOGGER&&(u=rCe());var d=nCe(function(){return CN(l,s)}),f=d[0],h=d[1],p=f,g=p.environment;if(!SN(s,p.selector)||l!==p.environment){var m=CN(l,s);h(m),p=m}var v=xN(!1);if(v0(function(){v.current=s},[s]),((o=e.metadata)===null||o===void 0?void 0:o.hasClientEdges)===!0||_0.CHECK_ALL_FRAGMENTS_FOR_MISSING_CLIENT_EDGES){var _=qb(function(){var z=dCe(p),q,H=[];if(z!=null&&z.length){q=[];var V=(0,ul.default)(z),Y;try{for(V.s();!(Y=V.n()).done;){var G=Y.value,J=pCe(l,e,t,G,n),Q=J[0],ue=J[1];q.push(Q),ue!=null&&H.push(ue)}}catch(le){V.e(le)}finally{V.f()}}return[q,H]},[p,l,e,t,n]),x=_[0],w=_[1];if(w.length){var S=Promise.all(w);throw S.displayName="RelayClientEdge(".concat(w.map(function(z){return z.displayName}).join(","),")"),S}v0(function(){var z=q8(l);if(x!=null&&x.length){var q=[],H=(0,ul.default)(x),V;try{for(H.s();!(V=H.n()).done;){var Y=V.value;q.push(z.retain(Y))}}catch(G){H.e(G)}finally{H.f()}return function(){for(var G=0,J=q;G<J.length;G++){var Q=J[G];Q.dispose()}}}},[l,x])}if(cCe(p)){var k=fCe(p);if(k!=null&&k.length>0){var A=Promise.all(k.map(function(z){return l.getStore().getLiveResolverPromise(z)}));throw A.displayName="RelayLiveResolver("+e.name+")",A}if(_0.ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE||l!==g||!v.current||!SN(v.current,s)){s==null&&Ol(!1);var C=s.kind==="PluralReaderSelector"?s.selectors[0].owner:s.owner,R=aCe(l,e,C);if(R)throw R.promise}}hCe(l,p,u);var N=xN(null);v0(function(){var z=N.current;if(z!=null){if(p.environment===z.environment&&p.selector===z.selector)return;z.dispose()}if(p.kind!=="bailout"){var q=p,H=z1(p.environment,p);if(H!==null){var V=H[0],Y=H[1];if(V){h(Y);return}q=Y}var G=kN(p.environment,q,h);N.current={dispose:G,selector:p.selector,environment:p.environment}}},[p]),v0(function(){if(N.current==null&&p.kind!=="bailout"){var z=kN(p.environment,p,h);N.current={dispose:z,selector:p.selector,environment:p.environment}}return function(){var q;(q=N.current)===null||q===void 0||q.dispose(),N.current=null}},[]);var I;if(a){var P=t==null;I=qb(function(){return p.kind==="bailout"?P?null:[]:(p.kind!=="plural"&&Ol(!1),p.snapshots.map(function(z){return z.data}))},[p,P])}else p.kind==="bailout"?I=null:(p.kind!=="singular"&&Ol(!1),I=p.snapshot.data);return _0.LOG_MISSING_RECORDS_IN_PROD&&t!=null&&(I===void 0||Array.isArray(I)&&I.length>0&&I.every(function(z){return z===void 0})),I}var mCe=gCe,K8=Ke.default;K8(Xke);K8(mCe);var H8=ip;H8.getQueryCacheIdentifier;H8.getQueryResourceForEnvironment;var hv=St;hv.useContext;hv.useEffect;hv.useState;hv.useRef;var vCe=St;vCe.useState;var _Ce=St,W8=gt;W8.createOperationDescriptor;W8.getRequest;_Ce.useMemo;var bCe=gt;bCe.__internal.fetchQuery;var yCe=Ke.default;yCe(Bt);var G8=St;G8.useEffect;G8.useRef;var xCe=Ke.default;xCe(Tr);var pv=St;pv.useCallback;pv.useEffect;pv.useRef;pv.useState;var SCe=St;SCe.useDebugValue;var ECe=gt;ECe.getFragment;var wCe=Ke.default;wCe(Bt);var gv=St,kCe=gt;kCe.commitMutation;gv.useState;gv.useEffect;gv.useRef;gv.useCallback;var J8=gt;J8.ConnectionInterface;J8.getValueAtPath;var zw=St,Q8=gt;Q8.__internal.getObservableForActiveRequest;Q8.getSelector;zw.useEffect;zw.useState;zw.useMemo;var CCe=Ke.default;CCe(Bt);var Uw=St;Uw.useCallback;Uw.useRef;Uw.useState;var ap=gt;ap.__internal.fetchQuery;ap.createOperationDescriptor;ap.getPaginationVariables;ap.getRefetchMetadata;ap.getSelector;var RCe=Ke.default;RCe(Bt);var Bw=St;Bw.useCallback;Bw.useEffect;Bw.useState;var $d=gt;$d.__internal.fetchQuery;$d.RelayFeatureFlags;$d.createOperationDescriptor;$d.getPaginationVariables;$d.getRefetchMetadata;$d.getSelector;var Y8=Ke.default;Y8(Bt);Y8(Tr);var ACe=ip;ACe.getQueryResourceForEnvironment;var zu=gt;zu.__internal.fetchQuery;zu.RelayFeatureFlags;zu.createOperationDescriptor;zu.getPendingOperationsForFragment;zu.getSelector;zu.getVariablesFromFragment;zu.handlePotentialSnapshotErrors;var TCe=Ke.default;TCe(Tr);var $Ce=fv;$Ce.loadQuery;var lp=St;lp.useCallback;lp.useEffect;lp.useInsertionEffect;lp.useRef;lp.useState;var NCe=gt;NCe.getRequest;var DCe=Ke.default;DCe(Tr);var FCe=fv;FCe.loadQuery;var mv=St;mv.useCallback;mv.useEffect;mv.useRef;mv.useState;var X8=gt;X8.RelayFeatureFlags;X8.getRequest;var ICe=Ke.default;ICe(Bt);var PCe=ip;PCe.getQueryResourceForEnvironment;var jw=St;jw.useCallback;jw.useContext;jw.useReducer;var Nd=gt;Nd.__internal.fetchQuery;Nd.createOperationDescriptor;Nd.getFragmentIdentifier;Nd.getRefetchMetadata;Nd.getSelector;Nd.getValueAtPath;var OCe=Ke.default;OCe(Bt);var qw=St;qw.useCallback;qw.useDebugValue;qw.useState;var vv=gt;vv.RelayFeatureFlags;vv.getFragment;vv.getFragmentIdentifier;vv.getPaginationMetadata;var MCe=Ke.default;MCe(Bt);var Uu=St;Uu.useCallback;Uu.useDebugValue;Uu.useEffect;Uu.useLayoutEffect;Uu.useMemo;Uu.useRef;Uu.useState;var Vw=gt;Vw.getFragment;Vw.getFragmentIdentifier;Vw.getPaginationMetadata;var _v=gt;_v.ConnectionInterface;_v.RelayFeatureFlags;_v.getSelector;_v.getValueAtPath;var LCe=St;LCe.useDebugValue;var zCe=gt,Z8=zCe.__internal;Z8.fetchQueryDeduped;Z8.fetchQuery;var UCe=St;UCe.useDebugValue;var BCe=gt;BCe.getFragment;var e5=St;e5.useEffect;e5.useRef;var jCe=St;jCe.useEffect;var qCe=gt;qCe.requestSubscription;var VCe=Rd,KCe=Vwe,HCe=y2e,WCe=W2e,GCe=fv;GCe.loadQuery;var xo=gt,JCe={ConnectionHandler:xo.ConnectionHandler,MutationTypes:xo.MutationTypes,RangeOperations:xo.RangeOperations,ReactRelayContext:VCe,applyOptimisticMutation:xo.applyOptimisticMutation,commitLocalUpdate:xo.commitLocalUpdate,commitMutation:xo.commitMutation,createFragmentContainer:KCe.createContainer,createPaginationContainer:HCe.createContainer,createRefetchContainer:WCe.createContainer,fetchQuery_DEPRECATED:xo.fetchQuery_DEPRECATED,graphql:xo.graphql,readInlineData:xo.readInlineData,requestSubscription:xo.requestSubscription,fetchQuery:xo.fetchQuery},QCe=JCe;function YCe(e){let t=QCe.ReactRelayContext.Provider;return Ar(t,{value:{environment:e.environment},children:e.children})}let XCe={make:YCe},ZCe={Provider:XCe};function eRe(e,t,r){let n=async(i,o,s,a)=>{let l=D(ms(i.text),""),u=l.includes("Platform")||l.includes("platform")?e.platformApiEndpoint:e.apiEndpoint,d=Object.fromEntries([["content-type","application/json"]]),f=t();f!==void 0&&(d.Authorization="Bearer "+f);let p=(await fetch(u,{method:"POST",headers:d,body:D(JSON.stringify({query:l,variables:o}),"")})).json,g=await p();return $g(g)&&r(),g};return owe.make(gt.Network.create(n),rwe.make(new gt.RecordSource,void 0,void 0),void 0,void 0,void 0,void 0,void 0)}function tRe(e){let t=e.config,r=ml(),n=Lt(()=>eRe(t,()=>T(r,i=>i.getToken()),()=>ie(r,i=>i.logout())),[t,r]);return b(ZCe.Provider.make,{environment:n,children:e.children})}let rRe=tRe;function nRe(e){let t=e.lastIndexOf("_");if(t!==-1)return e.slice(0,t)}function iRe(e,t){return e+"_"+t+"EventHistory"}function oRe(e){return`query AuditTrail($entityId: ID, $eventTypes: [String!], $user: String, $timeFrom: String, $timeTo: String, $first: Int, $after: String) {
69
- `+e+`(
70
- filter: {entityId: $entityId, eventTypes: $eventTypes, user: $user, timeFrom: $timeFrom, timeTo: $timeTo}
71
- first: $first
72
- after: $after
73
- ) {
74
- edges {
75
- node {
76
- position
77
- eventType
78
- payload
79
- tags { key value }
80
- meta { user time correlationId causationId }
81
- recordedAt
82
- }
83
- cursor
84
- }
85
- pageInfo { hasNextPage endCursor }
86
- }
87
- }`}function sRe(e){return fe(T(K(e),t=>O(t,"x-reventless-audit")),!1,t=>{let r=nt(t);return typeof r!="object"?r==="JSONTrue":r.TAG==="JSONString"})}let RN={contents:[]};function AN(e){if(!RN.contents.includes(e)){RN.contents.push(e),console.error('[AutoUI] View "'+e+'" opted into an audit trail but no event log could be resolved for it — the view declares no linked write side, so there is no `…EventHistory` field to query. Remove the audit hint, or check that the read model projects an aggregate or slice.');return}}function aRe(e,t){if(!t)return;let r=e.linkedWriteSide[0],n=nRe(e.queryField);if(r!==void 0){if(n!==void 0){let i=iRe(n,r);return{queryField:i,queryDocument:oRe(i),displayName:r}}AN(e.name);return}AN(e.name)}function Ps(e,t){return T(O(e,t),ce)}function lRe(e){let t=D(K(e),{}),r=D(T(O(t,"meta"),K),{}),n=se(D(T(O(t,"tags"),Vt),[]),a=>{let l=D(K(a),{}),u=Ps(l,"key"),d=Ps(l,"value");if(u!==void 0&&d!==void 0)return[u,d]}),i=Ps(t,"position"),o=Ps(t,"eventType");if(i===void 0||o===void 0)return;let s=D(Ps(r,"time"),D(Ps(t,"recordedAt"),""));return{position:i,eventType:o,payload:D(O(t,"payload"),{}),tags:n,actor:Ps(r,"user"),time:s,recordedAt:D(Ps(t,"recordedAt"),s)}}function uRe(e,t){return se(D(T(T(T(T(K(e),r=>O(r,t)),K),r=>O(r,"edges")),Vt),[]),r=>T(T(K(r),n=>O(n,"node")),lRe))}function cRe(e,t){let r=D(T(T(T(T(K(e),n=>O(n,t)),K),n=>O(n,"pageInfo")),K),{});return[D(T(O(r,"hasNextPage"),TD),!1),Ps(r,"endCursor")]}function dRe(e,t){let r=e.startsWith(t)&&e.length>t.length?e.slice(t.length):e;return yt(r).toLowerCase()}function fRe(e){return D(W(K(e),et),[]).filter(t=>t[0]!=="TAG")}function hRe(e){let t={};return e.map(r=>{let n=JSON.stringify(bt(et(t)),null,2);fRe(r.payload).forEach(o=>{t[o[0]]=o[1]});let i=JSON.stringify(bt(et(t)),null,2);return[n,i]})}let pRe="System";function gRe(e,t){let r=hRe(e);return e.map((n,i)=>{let o=D(r[i],["",""]),s=fe(n.tags[0],t,a=>t+" "+a[1]);return{id:n.position,verb:dRe(n.eventType,t),subject:s,actor:D(n.actor,pRe),timestamp:n.time,before:o[0],after:o[1]}}).toReversed()}function mRe(e){let t=[];return e.forEach(r=>ie(r.actor,n=>{if(!t.includes(n)){t.push(n);return}})),t.toSorted(zf)}function vRe(e){let t=[];return e.forEach(r=>{if(!t.includes(r.eventType)){t.push(r.eventType);return}}),t.toSorted(zf)}function ki(e){return"var("+e+")"}let _Re=E([L("flex"),he("column"),ee("center"),Qe("center"),c("gap",ki(F.lg)),c("padding",ki(F.xxl)),Uo({NAME:"percent",VAL:100}),jD({NAME:"percent",VAL:100}),sa("center"),c("min-height","400px")]),bRe=E([c("font-size","48px"),c("line-height","1")]),yRe=E([c("color",ki(y.textPrimary)),c("font-size",ki($.sizeXxl)),c("font-weight",ki($.weightBold)),yn(ke(0))]),xRe=E([c("color",ki(y.textSecondary)),c("font-size",ki($.sizeLg)),c("line-height",ki($.lineHeightRelaxed)),c("max-width","480px"),yn(ke(0))]),SRe=E([c("background",ki(y.brand)),c("color",ki(y.textOnBrand)),c("border-radius",ki(X.md)),c("padding","var("+F.sm+") var("+F.lg+")"),c("font-size",ki($.sizeMd)),c("font-weight",ki($.weightMedium)),c("border","none"),c("cursor","pointer"),xs(ke(8))]);function ERe(e){let t=e.definition;return M("div",{children:[b("div",{children:"[locked]",className:bRe}),b("h2",{children:t.title,className:yRe}),b("p",{children:fe(t.requiredAccess,"This feature requires an upgrade.",r=>'This feature requires the "'+r+'" access tier.'),className:xRe}),b("button",{children:"Upgrade to unlock",className:SRe})],className:_Re})}let wRe=ERe;function kRe(e){let t=e.children,r=e.definition,n=Yh(),i=r.requiredAccess;return i!==void 0&&!n(i)?b(wRe,{definition:r}):t}let CRe=kRe;function t5(e){let t=e.length;return t>1&&e.endsWith("s")?e.slice(0,t-1|0):e}let Kw=["body","text","message","comment","content"],RRe=["author","createdby","user","commenter","postedby"],ARe=["createdat","postedat","at","commentedat"];function r5(e){return se(Yr(e),t=>{if(dm(t[1]))return t[0]})}function Hw(e,t){return r5(e).find(r=>t.includes(r.toLowerCase()))}function TRe(e){let t=Vr(e,void 0),r=Yr(e).map(n=>n[0]).find(n=>fe(O(t.semantics,n),!1,i=>i.semantic==="UserRef"));return r!==void 0?r:Hw(e,RRe)}function $Re(e){return se(Yr(e),t=>{if(Ex(t[1]))return t[0]}).find(t=>ARe.includes(t.toLowerCase()))}function n5(e){return r5(e).filter(t=>{let r=t.toLowerCase();return r!=="id"?r.endsWith("id"):!1})}function NRe(e,t){let r=t5(t).toLowerCase();return n5(e).find(n=>n.toLowerCase()===r+"id")}function DRe(e){let t=n5(e);if(t.length===1)return t[0]}function FRe(e){return fe(T(K(e),t=>O(t,"x-reventless-comments")),!1,t=>{let r=nt(t);return typeof r!="object"?r==="JSONTrue":r.TAG==="JSONString"})}function TN(e,t){let r=e.toLowerCase(),n=t.toLowerCase(),i=t5(t).toLowerCase();return r.endsWith("comments")?r===i+"comments"?!0:r===n+"comments":!1}let IRe=["addcomment","postcomment","comment","writecomment","leavecomment"];function PRe(e,t){let r=se(e.linkedWriteSide,n=>t.aggregates.find(i=>i.name===n)).map(n=>n.commands).flat();return e.commands.concat(r).find(n=>IRe.some(i=>n.name.toLowerCase().startsWith(i)))}let $N={contents:[]};function ORe(e){if(!$N.contents.includes(e)){$N.contents.push(e),console.error('[AutoUI] Read model "'+e+'" announces itself as comments but has no body field — no comment thread is wired. The convention expects a string field named '+Kw.join(" | ")+' (plus an entity ref like "orderId"); see docs/guides/comments-read-model-convention.md.');return}}function MRe(e,t){return se(e.readModels.filter(r=>r.name!==t?FRe(r.schema)?!0:TN(r.name,t):!1),r=>{let n=NRe(r.schema,t),i=n!==void 0?n:TN(r.name,t)?DRe(r.schema):void 0,o=Hw(r.schema,Kw);if(o!==void 0)return i!==void 0?{readModel:r,entityField:i,bodyField:o,authorField:TRe(r.schema),timestampField:$Re(r.schema),postCommand:PRe(r,e)}:void 0;ORe(r.name)})[0]}function Zu(e,t){return T(O(e,t),ce)}function LRe(e,t,r){let n=se(t,o=>{let s=D(K(o),{});if(ot(Zu(s,e.entityField),r))return s}),i=o=>T(T(e.timestampField,s=>Zu(o,s)),Mi);return n.toSorted((o,s)=>{let a=i(o),l=i(s);return a!==void 0?l!==void 0?a-l:-1:l!==void 0?1:0}).map((o,s)=>({id:D(Zu(o,"id"),"#"+s.toString()),body:D(Zu(o,e.bodyField),""),author:T(e.authorField,a=>Zu(o,a)),timestamp:T(e.timestampField,a=>Zu(o,a))}))}function zRe(e,t,r){let n=e.postCommand,i=D(T(n,s=>s.aggregateIdField),e.entityField),o=D(T(n,s=>Hw(s.schema,Kw)),e.bodyField);return bt([[i,t],[o,r]])}function hs(e){return"var("+e+")"}let URe=E([Ot("fixed"),aa(ke(0)),od(ke(0)),hl(ke(0)),vx(ke(0)),c("background","rgba(0,0,0,0.5)"),L("flex"),ee("center"),Qe("center"),c("z-index","1000"),c("backdrop-filter","blur(2px)")]),BRe=E([c("background",hs(y.surface)),c("border","1px solid var("+y.border+")"),c("border-radius",hs(X.lg)),c("box-shadow",hs(pn.lg)),L("flex"),he("column"),c("max-height","90vh"),c("max-width","90vw"),c("min-width","400px"),c("overflow","hidden")]),jRe=E([L("flex"),ee("center"),Qe("spaceBetween"),c("padding","var("+F.md+") var("+F.lg+")"),c("border-bottom","1px solid var("+y.borderSubtle+")"),Li(0)]),qRe=E([c("color",hs(y.textPrimary)),c("font-size",hs($.sizeLg)),c("font-weight",hs($.weightMedium)),yn(ke(0))]),VRe=E([c("background","none"),c("border","none"),c("cursor","pointer"),c("color",hs(y.textSecondary)),c("font-size","18px"),c("padding","0"),c("line-height","1"),Ye([c("color",hs(y.textPrimary))])]),KRe=E([c("padding",hs(F.lg)),c("overflow-y","auto"),fo(1)]),HRe=E([L("flex"),ee("center"),Qe("flexEnd"),c("gap",hs(F.sm)),c("padding","var("+F.md+") var("+F.lg+")"),c("border-top","1px solid var("+y.borderSubtle+")"),Li(0)]);function WRe(e){let t=e.onClose,r=e.isOpen;return Re(()=>{if(!r)return;let n=i=>{if(i.key==="Escape")return t()};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[r]),r?b("div",{children:M("div",{children:[M("div",{children:[b("h2",{children:e.title,className:qRe}),b("button",{children:"x",className:VRe,onClick:n=>t()})],className:jRe}),b("div",{children:e.children,className:KRe}),fe(e.footer,null,n=>b("div",{children:n,className:HRe}))],className:BRe,style:fe(e.width,{},n=>({width:n})),onClick:n=>{n.stopPropagation()}}),className:URe,onClick:n=>t()}):null}let Ww=WRe;function Di(e){return"var("+e+")"}let GRe=E([L("flex"),he("column"),c("gap",Di(F.sm))]),JRe=E([c("overflow-x","auto")]),QRe=E([c("border-collapse","collapse"),c("font-size",Di($.sizeSm)),c("min-width","min-content")]),Gw=[c("border","1px solid var("+y.borderSubtle+")"),c("padding","4px var("+F.sm+")"),c("background",Di(y.surfaceSubtle)),c("white-space","nowrap"),c("font-weight",Di($.weightMedium))],YRe=E(Gw.concat([c("text-align","left"),c("color",Di(y.textSecondary))])),XRe=E(Gw.concat([c("text-align","right"),c("color",Di(y.textSecondary)),c("text-transform","uppercase"),c("letter-spacing","0.04em"),c("font-size",Di($.sizeXs))])),ZRe=E(Gw.concat([c("text-align","left"),c("color",Di(y.textPrimary))]));function eAe(e){return E([c("border","1px solid var("+y.borderSubtle+")"),c("padding","4px var("+F.sm+")"),c("text-align","right"),c("white-space","nowrap"),c("background",e<=0?"transparent":"color-mix(in srgb, var("+y.brand+") "+Math.round(e*100).toString()+"%, transparent)"),c("color",e>=.55?Di(y.textOnBrand):e<=0?Di(y.textDisabled):Di(y.textPrimary))])}let tAe=E([L("flex"),ee("center"),c("gap","6px"),c("font-size",Di($.sizeXs)),c("color",Di(y.textSecondary))]);function rAe(e){return E([c("width","18px"),c("height","10px"),c("background","color-mix(in srgb, var("+y.brand+") "+Math.round(e*100).toString()+"%, transparent)"),c("border","1px solid var("+y.borderSubtle+")")])}function i5(e,t){if(e<=0||t<=0)return 0;let r=e/t;return r<.12?.12:r>1?1:r}function nAe(e){return lt(e,0,(t,r)=>lt(r,t,(n,i)=>i.value>n?i.value:n))}let o5=[.12,.35,.6,.85,1];function iAe(e){let t=e.cells,r=e.colHeaders,n=nAe(t);return M("div",{children:[b("div",{children:M("table",{children:[b("thead",{children:M("tr",{children:[b("th",{children:e.rowDimLabel+" ╲ "+e.colDimLabel,className:YRe,scope:"col"}),r.map(i=>b("th",{children:i.label,className:XRe,scope:"col"},i.value))]})}),b("tbody",{children:e.rowHeaders.map((i,o)=>M("tr",{children:[b("th",{children:i.label,className:ZRe,scope:"row"}),r.map((s,a)=>{let l=D(T(t[o],u=>u[a]),{value:0,display:""});return b("td",{children:b("span",{children:l.display,title:i.label+" × "+s.label+": "+l.display}),className:eAe(i5(l.value,n))},i.value+":"+s.value)})]},i.value))})],className:QRe}),className:JRe}),M("div",{children:["0",o5.map(i=>b("span",{className:rAe(i)},i.toString())),e.maxLabel],className:tAe})],className:GRe})}let oAe=iAe;function sAe(e,t){let r=s=>{throw{RE_EXN_ID:"Undefined_recursive_module",_1:e,Error:new Error}},n=(s,a,l)=>{if(typeof s!="object")switch(s){case"Function":case"Lazy":a[l]=r;return;case"Class":a[l]=[r,r,r,0];return}else{if(s.TAG!=="Module"){a[l]=s._0;return}let u=s._0,d={};a[l]=d;let f=u.length;for(let h=0;h<f;++h){let p=u[h];n(p[0],d,p[1])}return}},i={},o="dummy";return n(t,i,o),i[o]}function aAe(e,t,r){let n=(i,o,s,a,l)=>{if(typeof i!="object")switch(i){case"Function":a[l]=s;return;case"Lazy":case"Class":Object.assign(o,s);return}else{if(i.TAG!=="Module")return;let u=i._0;for(let d=0,f=u.length;d<f;++d){let h=u[d],p=h[1];n(h[0],o[p],s[p],o,p)}return}};if(typeof e!="object")throw{RE_EXN_ID:"Assert_failure",_1:["Primitive_module.res",68,9],Error:new Error};{let i=e._0;for(let o=0,s=i.length;o<s;++o){let a=i[o],l=a[1];n(a[0],t[l],r[l],t,l)}return}}function U1(e){let t=e.parent;if(t!==void 0&&t!=="")return t}function lAe(e,t,r){let n=T(O(e,t),U1);if(n!==void 0){if(n===t)return!0;{let i=n,o=0;for(;;){let s=o,a=i;if(s>r)return!0;let l=T(O(e,a),U1);if(l===void 0)return!1;if(l===t)return!0;o=s+1|0,i=l}}}else return!1}function uAe(e){let t={};e.forEach(l=>{t[l.key]=l});let r=e.length,n={},i=[],o={contents:0},s={contents:0};e.forEach(l=>{let u=U1(l);if(u!==void 0){if(O(t,u)!==void 0){if(lAe(t,l.key,r)){s.contents=s.contents+1|0,i.push(l.key);return}let f=D(O(n,u),[]);n[u]=f.concat([l.key]);return}o.contents=o.contents+1|0,i.push(l.key);return}i.push(l.key)});let a=(l,u)=>{let d=O(t,l);if(d===void 0)return;let f=u>=r?[]:se(D(O(n,l),[]),h=>a(h,u+1|0));return{node:d,children:f}};return{roots:se(i,l=>a(l,0)),detached:o.contents,cycles:s.contents}}function s5(e){return lt(e.children,e.children.length,(t,r)=>t+s5(r)|0)}let cAe="14px";function hn(e){return"var("+e+")"}let dAe=E([L("flex"),he("column"),c("gap",hn(F.sm))]),fAe=E([c("overflow-x","auto"),c("padding-bottom","4px")]),hAe=E([L("flex"),ee("flexStart"),Qe("center"),c("gap",hn(F.lg)),c("min-width","min-content"),c("padding","var("+F.xs+") 0")]),pAe=E([L("flex"),he("column"),ee("center"),c("min-width","min-content")]);function gAe(e){return E([L("flex"),he("column"),c("gap","2px"),c("min-width","132px"),c("max-width","180px"),c("padding","var("+F.xs+") var("+F.sm+")"),c("border","1px solid var("+y.borderSubtle+")"),c("border-top","3px solid "+e),c("border-radius",hn(X.md)),c("background",hn(y.surface)),c("text-align","left"),we("pointer"),Ye([c("background",hn(y.surfaceSubtle))])])}let mAe=E([c("font-size",hn($.sizeSm)),c("font-weight",hn($.weightMedium)),c("color",hn(y.textPrimary)),c("overflow","hidden"),c("text-overflow","ellipsis"),c("white-space","nowrap")]),vAe=E([c("font-size",hn($.sizeXs)),c("color",hn(y.textSecondary)),c("overflow","hidden"),c("text-overflow","ellipsis"),c("white-space","nowrap")]),_Ae=E([c("margin-top","2px"),c("padding","0 6px"),c("border","1px solid var("+y.border+")"),c("border-radius","10px"),c("background",hn(y.surface)),c("color",hn(y.textSecondary)),c("font-size",hn($.sizeXs)),c("line-height","16px"),we("pointer"),Ye([c("color",hn(y.textPrimary))])]),NN=E([c("width","1px"),c("height",cAe),c("background",hn(y.border))]),bAe=E([L("flex"),ee("flexStart"),c("min-width","min-content")]),yAe=E([L("flex"),he("column"),ee("center"),c("min-width","min-content")]),xAe=E([c("padding","0 var("+F.xs+")")]),SAe=E([L("flex"),c("width","100%"),c("height","1px")]);function DN(e){return E([c("flex","1 1 50%"),c("background",e?hn(y.border):"transparent")])}let EAe=E([c("font-size",hn($.sizeXs)),c("color",hn(y.textDisabled))]),wAe="var("+y.brand+")",Jw=sAe(["OrgChart.res",255,4],{TAG:"Module",_0:[["Function","make"]]});function kAe(e){let t=e.depth,r=e.tree,n=oe(()=>!1),i=n[1],o=n[0],s=s5(r),a=r.children.length,l=r.node.subtitle;return M("div",{children:[M("button",{children:[b("span",{children:r.node.title,className:mAe}),l!==void 0&&l!==""?b("span",{children:l,className:vAe}):null],className:gAe(D(r.node.accent,wAe)),title:r.node.title,onClick:u=>ie(r.node.onOpen,d=>d())}),a===0?null:M(qr,{children:[b("button",{children:o?"+"+s.toString():"−","aria-expanded":!o,className:_Ae,title:o?"Expand":"Collapse",onClick:u=>i(d=>!d)}),o?null:M(qr,{children:[b("div",{className:NN}),b("div",{children:r.children.map((u,d)=>M("div",{children:[M("div",{children:[b("div",{className:DN(d>0)}),b("div",{className:DN(d<(a-1|0))})],className:SAe}),b("div",{className:NN}),b("div",{children:b(Jw.make,{tree:u,depth:t+1|0}),className:xAe})],className:yAe},u.node.key)),className:bAe})]})]})],className:pAe})}aAe({_0:[["Function","make"]]},Jw,{make:kAe});function CAe(e){let t=uAe(e.nodes);if(t.roots.length===0)return b(sd,{title:"Nothing to chart",description:"No rows in this window."});let r=se([e.windowNote,t.detached>0?t.detached.toString()+" item(s) whose parent is outside this window":void 0,t.cycles>0?t.cycles.toString()+" item(s) in a parent loop, shown as roots":void 0],n=>n);return M("div",{children:[b("div",{children:b("div",{children:t.roots.map(n=>b(Jw.make,{tree:n,depth:0},n.node.key)),className:hAe}),className:fAe}),r.length===0?null:b("span",{children:r.join(" · "),className:EAe})],className:dAe})}let RAe=CAe;function Fi(e){return"var("+e+")"}let AAe=E([Ot("relative"),c("padding-left","28px"),L("flex"),he("column"),c("gap",Fi(F.md))]),TAe=E([Ot("absolute"),od(ke(7)),aa(ke(8)),vx(ke(0)),c("width","2px"),c("background",Fi(y.borderSubtle))]),$Ae=E([Ot("absolute"),od(ke(-21)),aa(ke(6)),c("width","10px"),c("height","10px"),c("border-radius","50%"),c("background",Fi(y.brand)),c("border","2px solid var("+y.surface+")"),Li(0)]),a5=E([Ot("relative"),L("flex"),he("column"),c("gap","2px")]),NAe=$n([a5,E([c("background","none"),c("border","none"),c("padding","0"),sa("left"),we("pointer"),Ye([c("opacity","0.85")])])]),DAe=E([L("flex"),ee("center"),c("gap",Fi(F.sm))]),FAe=E([c("color",Fi(y.textDisabled)),c("font-size",Fi($.sizeXs)),c("font-family",Fi($.fontFamilyMono))]),IAe=E([c("color",Fi(y.textPrimary)),c("font-size",Fi($.sizeMd)),c("font-weight",Fi($.weightMedium))]),PAe=E([c("color",Fi(y.textSecondary)),c("font-size",Fi($.sizeSm)),c("line-height",Fi($.lineHeightNormal)),$h(ke(0))]);function OAe(e){let t=e.onSelect,r=n=>M(qr,{children:[b("div",{className:$Ae}),M("div",{children:[b("span",{children:n.timestamp,className:FAe}),fe(n.variant,null,i=>b(Zs,{variant:i,label:n.label})),fe(n.variant,b("span",{children:n.label,className:IAe}),i=>null)],className:DAe}),fe(n.detail,null,i=>b("div",{children:i,className:PAe}))]});return M("div",{children:[b("div",{className:TAe}),e.entries.map(n=>t!==void 0?b("button",{children:r(n),className:NAe,type:"button",onClick:i=>t(n.id)},n.id):b("div",{children:r(n),className:a5},n.id))],className:AAe})}let MAe=OAe;function LAe(e){let t=e[0];if(t===void 0)return;let r=lt(e,t.start,(i,o)=>o.start<i?o.start:i),n=lt(e,t.end_,(i,o)=>o.end_>i?o.end_:i);return[Gn(r),ro(Gn(n),1)]}function zAe(e,t){let r=(t-e)/XM;return r<=21?"Days":r<=120?"Weeks":"Months"}function FN(e){let t=new Date(e).getMonth()|0;return D(QM[t],"").slice(0,3)}function UAe(e,t){switch(t){case"Days":return oa(e);case"Weeks":return YM(e).toString()+" "+FN(e);case"Months":let r=new Date(e).getFullYear().toString();return FN(e)+" '"+r.slice(2)}}function BAe(e,t,r){let n=l=>{switch(r){case"Days":return ro(Gn(e),l);case"Weeks":return ro(Bm(e),l*7|0);case"Months":return VM(KM(e),l)}},i=[],o=0;for(;n(o)<t&&o<2e3;){let l=n(o);l>=e&&i.push(l),o=o+1|0}let s=i.length,a=s<=40?1:(s/40|0)+1|0;return vD(i,(l,u)=>{if(Oo(u,a)===0)return[l,UAe(l,r)]})}function Bg(e,t,r){return r<=t?0:(e-t)/(r-t)*100}function Df(e){return e<0?0:e>100?100:e}function B1(e,t,r){let n=Df(Bg(e.start,t,r)),o=Df(Bg(e.end_>e.start?e.end_:e.start,t,r))-n,s=o<.6?.6:o;return[n+s>100?100-s:n,s]}function l5(e){return e.map(t=>se(t.dependsOn,r=>W(e.find(n=>n.key===r?n.key!==t.key:!1),n=>({from:n.key,to_:t.key,violated:t.start<n.end_})))).flat()}function jAe(e){return lt(e,0,(t,r)=>t+r.dependsOn.filter(n=>!e.some(i=>i.key===n)).length|0)}function u5(e){return l5(e).filter(t=>t.violated)}function qAe(e,t){return u5(e).some(r=>r.to_===t)}let Qw="184px";function Ht(e){return"var("+e+")"}let VAe=E([L("flex"),he("column"),c("gap",Ht(F.sm))]),KAe=E([L("flex"),ee("center"),Qe("spaceBetween"),pi("wrap"),c("gap",Ht(F.sm))]),HAe=E([L("inlineFlex"),ee("center"),c("gap",Ht(F.xs))]),c5=E([c("background","none"),c("border","1px solid var("+y.border+")"),c("border-radius",Ht(X.sm)),c("padding","2px var("+F.sm+")"),c("color",Ht(y.textSecondary)),c("font-size",Ht($.sizeSm)),we("pointer"),Ye([c("background",Ht(y.surfaceSubtle)),c("color",Ht(y.textPrimary))])]),WAe=$n([c5,E([c("background",Ht(y.surfaceSubtle)),c("color",Ht(y.textPrimary)),c("font-weight",Ht($.weightMedium))])]),GAe=E([c("font-size",Ht($.sizeMd)),c("font-weight",Ht($.weightMedium)),c("color",Ht(y.textPrimary))]),JAe=E([c("border","1px solid var("+y.borderSubtle+")"),c("border-radius",Ht(X.md)),c("overflow","hidden")]),d5=E([L("flex"),ee("stretch")]),QAe=$n([d5,E([c("background",Ht(y.surfaceSubtle)),c("border-bottom","1px solid var("+y.borderSubtle+")")])]),YAe=E([c("flex","0 0 "+Qw),c("padding","4px var("+F.sm+")"),c("font-size",Ht($.sizeXs)),c("color",Ht(y.textSecondary)),c("text-transform","uppercase"),c("letter-spacing","0.04em")]),XAe=E([Ot("relative"),c("flex","1 1 auto"),c("height","22px"),c("overflow","hidden")]),ZAe=E([Ot("absolute"),c("top","4px"),c("padding-left","3px"),c("border-left","1px solid var("+y.borderSubtle+")"),c("font-size",Ht($.sizeXs)),c("color",Ht(y.textSecondary)),c("white-space","nowrap"),c("pointer-events","none")]),eTe=E([Ot("relative")]),tTe=$n([d5,E([c("height","30px"),c("border-top","1px solid var("+y.borderSubtle+")")])]),rTe=E([c("flex","0 0 "+Qw),L("flex"),ee("center"),c("gap","4px"),c("padding","0 var("+F.sm+")"),c("font-size",Ht($.sizeSm)),c("color",Ht(y.textPrimary)),c("border-right","1px solid var("+y.borderSubtle+")"),c("overflow","hidden")]),nTe=E([c("overflow","hidden"),c("text-overflow","ellipsis"),c("white-space","nowrap")]),iTe=E([c("color",Ht(y.warning)),c("font-size",Ht($.sizeXs)),c("flex","0 0 auto")]),oTe=E([Ot("relative"),c("flex","1 1 auto")]),sTe=E([Ot("absolute"),c("top","0"),c("bottom","0"),c("width","1px"),c("background",Ht(y.borderSubtle)),c("opacity","0.6"),c("pointer-events","none")]);function aTe(e){return E([Ot("absolute"),c("top","5px"),c("height","19px"),c("border","none"),c("border-radius",Ht(X.sm)),c("background",e),c("padding","0"),we("pointer"),Ye([c("filter","brightness(1.12)")])])}let lTe=E([c("outline","2px solid var("+y.warning+")"),c("outline-offset","1px")]),uTe=E([Ot("absolute"),c("top","0"),c("left",Qw),c("right","0"),c("bottom","0"),c("pointer-events","none")]),cTe=E([c("display","block"),c("width","100%"),c("height","100%")]),dTe=E([c("font-size",Ht($.sizeXs)),c("color",Ht(y.textDisabled))]),fTe="var("+y.brand+")";function Ba(e){return(Math.round(e*100)/100).toString()}function hTe(e,t){let r=ro(t,-1);return Gi(e)===Gi(r)?Gi(e):Gi(e)+" – "+Gi(r)}function pTe(e){let t=e.to_,r=e.from,n=e.tasks,i=e.edge,o=S=>n.findIndex(k=>k.key===S),s=o(i.from),a=o(i.to_),l=n[s],u=n[a];if(l===void 0||u===void 0)return null;let d=B1(l,r,t),h=B1(u,r,t)[0],p=d[0]+d[1],g=s*30+30/2,m=a*30+30/2,v=i.violated?e.arrowBadId:e.arrowId,_;if(h>p){let S=Df((p+h)/2);_=[[p,g],[S,g],[S,m],[h,m]]}else{let S=Df(p+1.4),k=Df(h-1.4),A=(g+m)/2;_=[[p,g],[S,g],[S,A],[k,A],[k,m],[h,m]]}let x=i.violated?"var("+y.warning+")":"var("+y.border+")",w=_.length-2|0;return b("g",{children:_.map((S,k)=>{let A=_[k+1|0];return A!==void 0?b("line",{markerEnd:k===w?"url(#"+v+")":void 0,stroke:x,strokeWidth:"1.5",x1:Ba(S[0])+"%",x2:Ba(A[0])+"%",y1:Ba(S[1]),y2:Ba(A[1])},k.toString()):null})})}function gTe(e){let t=e.initialGranularity,r=e.windowNote,n=e.tasks,i=r9(),o=oe(()=>t),s=o[1],a="rv-gantt-arrow-"+i,l="rv-gantt-arrow-bad-"+i,u=LAe(n);if(u===void 0)return b(sd,{title:"Nothing scheduled",description:"No row in this window carries a start and end date."});let d=u[1],f=u[0],h=D(o[0],zAe(f,d)),p=BAe(f,d,h),g=l5(n),m=jAe(n),v=u5(n).length,_=(S,k)=>b("button",{children:k,className:h===S?WAe:c5,onClick:A=>s(C=>S)}),x,w=0;if(r!==void 0||m!==0||v!==0?w=1:x=null,w===1){let S=se([r,m>0?m.toString()+" dependency link(s) outside this window":void 0,v>0?v.toString()+" start(s) before a dependency ends":void 0],k=>k);x=b("span",{children:S.join(" · "),className:dTe})}return M("div",{children:[M("div",{children:[b("span",{children:hTe(f,d),className:GAe}),M("div",{children:[_("Days","Days"),_("Weeks","Weeks"),_("Months","Months")],className:HAe})],className:KAe}),M("div",{children:[M("div",{children:[b("div",{children:"Task",className:YAe}),b("div",{children:p.map(S=>{let k=S[0];return b("span",{children:S[1],className:ZAe,style:{left:Ba(Bg(k,f,d))+"%"}},k.toString())}),className:XAe})],className:QAe}),M("div",{children:[n.map(S=>{let k=B1(S,f,d),A=qAe(n,S.key),C=aTe(D(S.accent,fTe)),R=A?C+" "+lTe:C;return M("div",{children:[M("div",{children:[A?b("span",{children:"▲",className:iTe,title:"Starts before a dependency ends"}):null,b("span",{children:S.title,className:nTe,title:S.title})],className:rTe}),M("div",{children:[p.map(N=>{let I=N[0];return b("div",{className:sTe,style:{left:Ba(Bg(I,f,d))+"%"}},I.toString())}),b("button",{className:R,style:{left:Ba(k[0])+"%",width:Ba(k[1])+"%"},title:S.title+" · "+oa(S.start)+" → "+oa(S.end_),onClick:N=>S.onOpen()})],className:oTe})],className:tTe},S.key)}),b("div",{children:M("svg",{children:[M("defs",{children:[b("marker",{children:b("path",{d:"M0,0 L6,3 L0,6 z",fill:"var("+y.border+")"}),id:a,markerHeight:"6",markerWidth:"6",orient:"auto",refX:"5",refY:"3"}),b("marker",{children:b("path",{d:"M0,0 L6,3 L0,6 z",fill:"var("+y.warning+")"}),id:l,markerHeight:"6",markerWidth:"6",orient:"auto",refX:"5",refY:"3"})]}),g.map(S=>b(pTe,{edge:S,tasks:n,from:f,to_:d,arrowId:a,arrowBadId:l},S.from+"->"+S.to_))],className:cTe}),className:uTe})],className:eTe})],className:JAe}),x],className:VAe})}let mTe=gTe;function On(e){return"var("+e+")"}let vTe=E([c("overflow-x","auto")]),_Te=E([c("border-collapse","collapse"),c("font-size",On($.sizeSm)),c("color",On(y.textPrimary)),c("min-width","min-content")]),Yw=[c("border","1px solid var("+y.borderSubtle+")"),c("padding","4px var("+F.sm+")"),c("text-align","right"),c("white-space","nowrap")],bTe=E(Yw),yTe=E(Yw.concat([c("color",On(y.textDisabled))])),xTe=E([c("border","1px solid var("+y.borderSubtle+")"),c("padding","4px var("+F.sm+")"),c("text-align","left"),c("color",On(y.textSecondary)),c("font-weight",On($.weightMedium)),c("white-space","nowrap")]),STe=E([c("border","1px solid var("+y.borderSubtle+")"),c("padding","4px var("+F.sm+")"),c("text-align","right"),c("background",On(y.surfaceSubtle)),c("color",On(y.textSecondary)),c("font-weight",On($.weightMedium)),c("text-transform","uppercase"),c("letter-spacing","0.04em"),c("font-size",On($.sizeXs)),c("white-space","nowrap")]),ETe=E([c("border","1px solid var("+y.borderSubtle+")"),c("padding","4px var("+F.sm+")"),c("text-align","left"),c("background",On(y.surfaceSubtle)),c("color",On(y.textPrimary)),c("font-weight",On($.weightMedium)),c("white-space","nowrap")]),Vb=E(Yw.concat([c("font-weight",On($.weightMedium))])),IN=E([c("border","1px solid var("+y.borderSubtle+")"),c("padding","4px var("+F.sm+")"),c("background",On(y.surfaceSubtle)),c("color",On(y.textSecondary)),c("font-weight",On($.weightMedium)),c("white-space","nowrap")]),PN="Total";function wTe(e){let t=e.colTotals,r=e.rowTotals,n=e.cells,i=e.colHeaders;return b("div",{children:M("table",{children:[b("thead",{children:M("tr",{children:[b("th",{children:e.rowDimLabel+" ╲ "+e.colDimLabel,className:xTe,scope:"col"}),i.map(o=>b("th",{children:o.label,className:STe,scope:"col"},o.value)),b("th",{children:PN,className:IN,scope:"col"})]})}),b("tbody",{children:e.rowHeaders.map((o,s)=>{let a=D(n[s],[]);return M("tr",{children:[b("th",{children:o.label,className:ETe,scope:"row"}),i.map((l,u)=>{let d=D(a[u],{display:"",empty:!0});return b("td",{children:d.empty?"—":d.display,className:d.empty?yTe:bTe},l.value)}),b("td",{children:D(r[s],""),className:Vb})]},o.value)})}),b("tfoot",{children:M("tr",{children:[b("th",{children:PN,className:IN,scope:"row"}),i.map((o,s)=>b("td",{children:D(t[s],""),className:Vb},o.value)),b("td",{children:e.grandTotal,className:Vb})]})})],className:_Te}),className:vTe})}let kTe=wTe;function Mn(e){return"var("+e+")"}let CTe=E([L("grid"),c("grid-template-columns","repeat(auto-fill, minmax(180px, 1fr))"),c("gap",Mn(F.md))]),RTe=E([L("flex"),he("column"),ee("stretch"),c("gap",Mn(F.xs)),c("padding","0"),c("background","none"),c("border","none"),c("text-align","left"),we("pointer"),Ye([c("opacity","0.88")])]),f5=E([c("width","100%"),c("aspect-ratio","4 / 3"),c("object-fit","cover"),c("background",Mn(y.surfaceSubtle)),c("border","1px solid var("+y.border+")"),c("border-radius",Mn(X.md))]),ATe=$n([f5,E([L("flex"),ee("center"),Qe("center"),c("color",Mn(y.textDisabled)),c("font-size",Mn($.sizeSm))])]),TTe=E([L("flex"),ee("center"),Qe("spaceBetween"),c("gap",Mn(F.sm))]),$Te=E([c("color",Mn(y.textPrimary)),c("font-size",Mn($.sizeSm)),c("font-weight",Mn($.weightMedium)),c("overflow","hidden"),c("text-overflow","ellipsis"),c("white-space","nowrap")]),NTe=E([c("color",Mn(y.textSecondary)),c("font-size",Mn($.sizeXs)),c("overflow","hidden"),c("text-overflow","ellipsis"),c("white-space","nowrap")]),DTe=E([c("background","rgba(255,255,255,0.12)"),c("border","1px solid rgba(255,255,255,0.25)"),c("border-radius",Mn(X.md)),c("color","#f5f5f5"),c("padding","4px var("+F.sm+")"),c("font-size",Mn($.sizeSm)),we("pointer"),Ye([c("background","rgba(255,255,255,0.22)")])]),FTe=E([c("color",Mn(y.textDisabled)),c("font-size",Mn($.sizeSm))]);function ITe(e){return se(e,t=>W(t.src,r=>({key:t.key,src:r,title:t.title,caption:t.caption})))}function PTe(e){let t=e.onOpen,r=e.items,n=oe(()=>{}),i=n[1],o=n[0],s=ITe(r);if(r.length===0)return b("span",{children:"(empty)",className:FTe});let a;if(o!==void 0){let l=T(t,u=>W(s[o],d=>b("button",{children:"Open record →",className:DTe,type:"button",onClick:f=>{i(h=>{}),u(d.key)}})));a=b(yF,{slides:s,index:o,onIndexChange:u=>i(d=>u),onClose:()=>i(u=>{}),action:l})}else a=null;return M(qr,{children:[b("div",{children:r.map(l=>{let u=l.src,d=l.caption;return M("button",{children:[u!==void 0?b("img",{className:f5,alt:l.title,src:u}):b("span",{children:"No image",className:ATe}),M("div",{children:[b("span",{children:l.title,className:$Te}),D(l.badge,null)],className:TTe}),d!==void 0?b("span",{children:d,className:NTe}):null],className:RTe,title:l.title,type:"button",onClick:f=>{if(l.src===void 0)return ie(t,g=>g(l.key));let p=s.findIndex(g=>g.key===l.key);return p!==-1?i(g=>p):ie(t,g=>g(l.key))}},l.key)}),className:CTe}),a]})}let OTe=PTe;const bv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Dd(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Xw(e){return"nodeType"in e}function vi(e){var t,r;return e?Dd(e)?e:Xw(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Zw(e){const{Document:t}=vi(e);return e instanceof t}function up(e){return Dd(e)?!1:e instanceof vi(e).HTMLElement}function h5(e){return e instanceof vi(e).SVGElement}function Fd(e){return e?Dd(e)?e.document:Xw(e)?Zw(e)?e:up(e)||h5(e)?e.ownerDocument:document:document:document}const cl=bv?pD:Re;function e2(e){const t=Je(e);return cl(()=>{t.current=e}),Jr(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.current==null?void 0:t.current(...n)},[])}function MTe(){const e=Je(null),t=Jr((n,i)=>{e.current=setInterval(n,i)},[]),r=Jr(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function kh(e,t){t===void 0&&(t=[e]);const r=Je(e);return cl(()=>{r.current!==e&&(r.current=e)},t),r}function cp(e,t){const r=Je();return Lt(()=>{const n=e(r.current);return r.current=n,n},[...t])}function jg(e){const t=e2(e),r=Je(null),n=Jr(i=>{i!==r.current&&t?.(i,r.current),r.current=i},[]);return[r,n]}function j1(e){const t=Je();return Re(()=>{t.current=e},[e]),t.current}let Kb={};function yv(e,t){return Lt(()=>{if(t)return t;const r=Kb[e]==null?0:Kb[e]+1;return Kb[e]=r,e+"-"+r},[e,t])}function p5(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return n.reduce((o,s)=>{const a=Object.entries(s);for(const[l,u]of a){const d=o[l];d!=null&&(o[l]=d+e*u)}return o},{...t})}}const Ic=p5(1),qg=p5(-1);function LTe(e){return"clientX"in e&&"clientY"in e}function g5(e){if(!e)return!1;const{KeyboardEvent:t}=vi(e.target);return t&&e instanceof t}function zTe(e){if(!e)return!1;const{TouchEvent:t}=vi(e.target);return t&&e instanceof t}function q1(e){if(zTe(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return LTe(e)?{x:e.clientX,y:e.clientY}:null}const ON="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function UTe(e){return e.matches(ON)?e:e.querySelector(ON)}const BTe={display:"none"};function jTe(e){let{id:t,value:r}=e;return Vi.createElement("div",{id:t,style:BTe},r)}function qTe(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Vi.createElement("div",{id:t,style:i,role:"status","aria-live":n,"aria-atomic":!0},r)}function VTe(){const[e,t]=oe("");return{announce:Jr(n=>{n!=null&&t(n)},[]),announcement:e}}const m5=mr(null);function KTe(e){const t=Ut(m5);Re(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function HTe(){const[e]=oe(()=>new Set),t=Jr(n=>(e.add(n),()=>e.delete(n)),[e]);return[Jr(n=>{let{type:i,event:o}=n;e.forEach(s=>{var a;return(a=s[i])==null?void 0:a.call(s,o)})},[e]),t]}const WTe={draggable:`
88
- To pick up a draggable item, press the space bar.
89
- While dragging, use the arrow keys to move the item.
90
- Press space again to drop the item in its new position, or press escape to cancel.
91
- `},GTe={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function JTe(e){let{announcements:t=GTe,container:r,hiddenTextDescribedById:n,screenReaderInstructions:i=WTe}=e;const{announce:o,announcement:s}=VTe(),a=yv("DndLiveRegion"),[l,u]=oe(!1);if(Re(()=>{u(!0)},[]),KTe(Lt(()=>({onDragStart(f){let{active:h}=f;o(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:p}=f;t.onDragMove&&o(t.onDragMove({active:h,over:p}))},onDragOver(f){let{active:h,over:p}=f;o(t.onDragOver({active:h,over:p}))},onDragEnd(f){let{active:h,over:p}=f;o(t.onDragEnd({active:h,over:p}))},onDragCancel(f){let{active:h,over:p}=f;o(t.onDragCancel({active:h,over:p}))}}),[o,t])),!l)return null;const d=Vi.createElement(Vi.Fragment,null,Vi.createElement(jTe,{id:n,value:i.draggable}),Vi.createElement(qTe,{id:a,announcement:s}));return r?l9(d,r):d}var Gr;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Gr||(Gr={}));function Vg(){}function MN(e,t){return Lt(()=>({sensor:e,options:t??{}}),[e,t])}function QTe(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Lt(()=>[...t].filter(n=>n!=null),[...t])}const zo=Object.freeze({x:0,y:0});function YTe(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function XTe(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function ZTe(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),s=i-n,a=o-r;if(n<i&&r<o){const l=t.width*t.height,u=e.width*e.height,d=s*a,f=d/(l+u-d);return Number(f.toFixed(4))}return 0}const e$e=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=[];for(const o of n){const{id:s}=o,a=r.get(s);if(a){const l=ZTe(a,t);l>0&&i.push({id:s,data:{droppableContainer:o,value:l}})}}return i.sort(YTe)};function t$e(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function v5(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:zo}function r$e(e){return function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return i.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...r})}}const n$e=r$e(1);function i$e(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function o$e(e,t,r){const n=i$e(t);if(!n)return e;const{scaleX:i,scaleY:o,x:s,y:a}=n,l=e.left-s-(1-i)*parseFloat(r),u=e.top-a-(1-o)*parseFloat(r.slice(r.indexOf(" ")+1)),d=i?e.width/i:e.width,f=o?e.height/o:e.height;return{width:d,height:f,top:u,right:l+d,bottom:u+f,left:l}}const s$e={ignoreTransform:!1};function dp(e,t){t===void 0&&(t=s$e);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=vi(e).getComputedStyle(e);u&&(r=o$e(r,u,d))}const{top:n,left:i,width:o,height:s,bottom:a,right:l}=r;return{top:n,left:i,width:o,height:s,bottom:a,right:l}}function LN(e){return dp(e,{ignoreTransform:!0})}function a$e(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function l$e(e,t){return t===void 0&&(t=vi(e).getComputedStyle(e)),t.position==="fixed"}function u$e(e,t){t===void 0&&(t=vi(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?r.test(o):!1})}function t2(e,t){const r=[];function n(i){if(t!=null&&r.length>=t||!i)return r;if(Zw(i)&&i.scrollingElement!=null&&!r.includes(i.scrollingElement))return r.push(i.scrollingElement),r;if(!up(i)||h5(i)||r.includes(i))return r;const o=vi(e).getComputedStyle(i);return i!==e&&u$e(i,o)&&r.push(i),l$e(i,o)?r:n(i.parentNode)}return e?n(e):r}function _5(e){const[t]=t2(e,1);return t??null}function Hb(e){return!bv||!e?null:Dd(e)?e:Xw(e)?Zw(e)||e===Fd(e).scrollingElement?window:up(e)?e:null:null}function b5(e){return Dd(e)?e.scrollX:e.scrollLeft}function y5(e){return Dd(e)?e.scrollY:e.scrollTop}function V1(e){return{x:b5(e),y:y5(e)}}var nn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(nn||(nn={}));function x5(e){return!bv||!e?!1:e===document.scrollingElement}function S5(e){const t={x:0,y:0},r=x5(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,s=e.scrollTop>=n.y,a=e.scrollLeft>=n.x;return{isTop:i,isLeft:o,isBottom:s,isRight:a,maxScroll:n,minScroll:t}}const c$e={x:.2,y:.2};function d$e(e,t,r,n,i){let{top:o,left:s,right:a,bottom:l}=r;n===void 0&&(n=10),i===void 0&&(i=c$e);const{isTop:u,isBottom:d,isLeft:f,isRight:h}=S5(e),p={x:0,y:0},g={x:0,y:0},m={height:t.height*i.y,width:t.width*i.x};return!u&&o<=t.top+m.height?(p.y=nn.Backward,g.y=n*Math.abs((t.top+m.height-o)/m.height)):!d&&l>=t.bottom-m.height&&(p.y=nn.Forward,g.y=n*Math.abs((t.bottom-m.height-l)/m.height)),!h&&a>=t.right-m.width?(p.x=nn.Forward,g.x=n*Math.abs((t.right-m.width-a)/m.width)):!f&&s<=t.left+m.width&&(p.x=nn.Backward,g.x=n*Math.abs((t.left+m.width-s)/m.width)),{direction:p,speed:g}}function f$e(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:s}=window;return{top:0,left:0,right:o,bottom:s,width:o,height:s}}const{top:t,left:r,right:n,bottom:i}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:i,width:e.clientWidth,height:e.clientHeight}}function E5(e){return e.reduce((t,r)=>Ic(t,V1(r)),zo)}function h$e(e){return e.reduce((t,r)=>t+b5(r),0)}function p$e(e){return e.reduce((t,r)=>t+y5(r),0)}function g$e(e,t){if(t===void 0&&(t=dp),!e)return;const{top:r,left:n,bottom:i,right:o}=t(e);_5(e)&&(i<=0||o<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const m$e=[["x",["left","right"],h$e],["y",["top","bottom"],p$e]];class r2{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=t2(r),i=E5(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,s,a]of m$e)for(const l of s)Object.defineProperty(this,l,{get:()=>{const u=a(n),d=i[o]-u;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ff{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var i;(i=this.target)==null||i.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function v$e(e){const{EventTarget:t}=vi(e);return e instanceof t?e:Fd(e)}function Wb(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var qi;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(qi||(qi={}));function zN(e){e.preventDefault()}function _$e(e){e.stopPropagation()}var Gt;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Gt||(Gt={}));const w5={start:[Gt.Space,Gt.Enter],cancel:[Gt.Esc],end:[Gt.Space,Gt.Enter,Gt.Tab]},b$e=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Gt.Right:return{...r,x:r.x+25};case Gt.Left:return{...r,x:r.x-25};case Gt.Down:return{...r,y:r.y+25};case Gt.Up:return{...r,y:r.y-25}}};class n2{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new Ff(Fd(r)),this.windowListeners=new Ff(vi(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(qi.Resize,this.handleCancel),this.windowListeners.add(qi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(qi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&g$e(n),r(zo)}handleKeyDown(t){if(g5(t)){const{active:r,context:n,options:i}=this.props,{keyboardCodes:o=w5,coordinateGetter:s=b$e,scrollBehavior:a="smooth"}=i,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=n.current,d=u?{x:u.left,y:u.top}:zo;this.referenceCoordinates||(this.referenceCoordinates=d);const f=s(t,{active:r,context:n.current,currentCoordinates:d});if(f){const h=qg(f,d),p={x:0,y:0},{scrollableAncestors:g}=n.current;for(const m of g){const v=t.code,{isTop:_,isRight:x,isLeft:w,isBottom:S,maxScroll:k,minScroll:A}=S5(m),C=f$e(m),R={x:Math.min(v===Gt.Right?C.right-C.width/2:C.right,Math.max(v===Gt.Right?C.left:C.left+C.width/2,f.x)),y:Math.min(v===Gt.Down?C.bottom-C.height/2:C.bottom,Math.max(v===Gt.Down?C.top:C.top+C.height/2,f.y))},N=v===Gt.Right&&!x||v===Gt.Left&&!w,I=v===Gt.Down&&!S||v===Gt.Up&&!_;if(N&&R.x!==f.x){const P=m.scrollLeft+h.x,z=v===Gt.Right&&P<=k.x||v===Gt.Left&&P>=A.x;if(z&&!h.y){m.scrollTo({left:P,behavior:a});return}z?p.x=m.scrollLeft-P:p.x=v===Gt.Right?m.scrollLeft-k.x:m.scrollLeft-A.x,p.x&&m.scrollBy({left:-p.x,behavior:a});break}else if(I&&R.y!==f.y){const P=m.scrollTop+h.y,z=v===Gt.Down&&P<=k.y||v===Gt.Up&&P>=A.y;if(z&&!h.x){m.scrollTo({top:P,behavior:a});return}z?p.y=m.scrollTop-P:p.y=v===Gt.Down?m.scrollTop-k.y:m.scrollTop-A.y,p.y&&m.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,Ic(qg(f,this.referenceCoordinates),p))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}n2.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=w5,onActivation:i}=t,{active:o}=r;const{code:s}=e.nativeEvent;if(n.start.includes(s)){const a=o.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function UN(e){return!!(e&&"distance"in e)}function BN(e){return!!(e&&"delay"in e)}class i2{constructor(t,r,n){var i;n===void 0&&(n=v$e(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:o}=t,{target:s}=o;this.props=t,this.events=r,this.document=Fd(s),this.documentListeners=new Ff(this.document),this.listeners=new Ff(n),this.windowListeners=new Ff(vi(s)),this.initialCoordinates=(i=q1(o))!=null?i:zo,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(qi.Resize,this.handleCancel),this.windowListeners.add(qi.DragStart,zN),this.windowListeners.add(qi.VisibilityChange,this.handleCancel),this.windowListeners.add(qi.ContextMenu,zN),this.documentListeners.add(qi.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(BN(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(UN(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:i}=this.props;i(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(qi.Click,_$e,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(qi.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:i,props:o}=this,{onMove:s,options:{activationConstraint:a}}=o;if(!i)return;const l=(r=q1(t))!=null?r:zo,u=qg(i,l);if(!n&&a){if(UN(a)){if(a.tolerance!=null&&Wb(u,a.tolerance))return this.handleCancel();if(Wb(u,a.distance))return this.handleStart()}if(BN(a)&&Wb(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Gt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const y$e={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class o2 extends i2{constructor(t){const{event:r}=t,n=Fd(r.target);super(t,y$e,n)}}o2.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n?.({event:r}),!0)}}];const x$e={move:{name:"mousemove"},end:{name:"mouseup"}};var K1;(function(e){e[e.RightClick=2]="RightClick"})(K1||(K1={}));class S$e extends i2{constructor(t){super(t,x$e,Fd(t.event.target))}}S$e.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===K1.RightClick?!1:(n?.({event:r}),!0)}}];const Gb={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class E$e extends i2{constructor(t){super(t,Gb)}static setup(){return window.addEventListener(Gb.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Gb.move.name,t)};function t(){}}}E$e.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:i}=r;return i.length>1?!1:(n?.({event:r}),!0)}}];var If;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(If||(If={}));var Kg;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Kg||(Kg={}));function w$e(e){let{acceleration:t,activator:r=If.Pointer,canScroll:n,draggingRect:i,enabled:o,interval:s=5,order:a=Kg.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:h}=e;const p=C$e({delta:f,disabled:!o}),[g,m]=MTe(),v=Je({x:0,y:0}),_=Je({x:0,y:0}),x=Lt(()=>{switch(r){case If.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case If.DraggableRect:return i}},[r,i,l]),w=Je(null),S=Jr(()=>{const A=w.current;if(!A)return;const C=v.current.x*_.current.x,R=v.current.y*_.current.y;A.scrollBy(C,R)},[]),k=Lt(()=>a===Kg.TreeOrder?[...u].reverse():u,[a,u]);Re(()=>{if(!o||!u.length||!x){m();return}for(const A of k){if(n?.(A)===!1)continue;const C=u.indexOf(A),R=d[C];if(!R)continue;const{direction:N,speed:I}=d$e(A,R,x,t,h);for(const P of["x","y"])p[P][N[P]]||(I[P]=0,N[P]=0);if(I.x>0||I.y>0){m(),w.current=A,g(S,s),v.current=I,_.current=N;return}}v.current={x:0,y:0},_.current={x:0,y:0},m()},[t,S,n,m,o,s,JSON.stringify(x),JSON.stringify(p),g,u,k,d,JSON.stringify(h)])}const k$e={x:{[nn.Backward]:!1,[nn.Forward]:!1},y:{[nn.Backward]:!1,[nn.Forward]:!1}};function C$e(e){let{delta:t,disabled:r}=e;const n=j1(t);return cp(i=>{if(r||!n||!i)return k$e;const o={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[nn.Backward]:i.x[nn.Backward]||o.x===-1,[nn.Forward]:i.x[nn.Forward]||o.x===1},y:{[nn.Backward]:i.y[nn.Backward]||o.y===-1,[nn.Forward]:i.y[nn.Forward]||o.y===1}}},[r,t,n])}function R$e(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return cp(i=>{var o;return t==null?null:(o=n??i)!=null?o:null},[n,t])}function A$e(e,t){return Lt(()=>e.reduce((r,n)=>{const{sensor:i}=n,o=i.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,n)}));return[...r,...o]},[]),[e,t])}var Ch;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ch||(Ch={}));var H1;(function(e){e.Optimized="optimized"})(H1||(H1={}));const jN=new Map;function T$e(e,t){let{dragging:r,dependencies:n,config:i}=t;const[o,s]=oe(null),{frequency:a,measure:l,strategy:u}=i,d=Je(e),f=v(),h=kh(f),p=Jr(function(_){_===void 0&&(_=[]),!h.current&&s(x=>x===null?_:x.concat(_.filter(w=>!x.includes(w))))},[h]),g=Je(null),m=cp(_=>{if(f&&!r)return jN;if(!_||_===jN||d.current!==e||o!=null){const x=new Map;for(let w of e){if(!w)continue;if(o&&o.length>0&&!o.includes(w.id)&&w.rect.current){x.set(w.id,w.rect.current);continue}const S=w.node.current,k=S?new r2(l(S),S):null;w.rect.current=k,k&&x.set(w.id,k)}return x}return _},[e,o,r,f,l]);return Re(()=>{d.current=e},[e]),Re(()=>{f||p()},[r,f]),Re(()=>{o&&o.length>0&&s(null)},[JSON.stringify(o)]),Re(()=>{f||typeof a!="number"||g.current!==null||(g.current=setTimeout(()=>{p(),g.current=null},a))},[a,f,p,...n]),{droppableRects:m,measureDroppableContainers:p,measuringScheduled:o!=null};function v(){switch(u){case Ch.Always:return!1;case Ch.BeforeDragging:return r;default:return!r}}}function k5(e,t){return cp(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function $$e(e,t){return k5(e,t)}function N$e(e){let{callback:t,disabled:r}=e;const n=e2(t),i=Lt(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(n)},[n,r]);return Re(()=>()=>i?.disconnect(),[i]),i}function xv(e){let{callback:t,disabled:r}=e;const n=e2(t),i=Lt(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(n)},[r]);return Re(()=>()=>i?.disconnect(),[i]),i}function D$e(e){return new r2(dp(e),e)}function qN(e,t,r){t===void 0&&(t=D$e);const[n,i]=oe(null);function o(){i(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??r)!=null?u:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const s=N$e({callback(l){if(e)for(const u of l){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){o();break}}}}),a=xv({callback:o});return cl(()=>{o(),e?(a?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),s?.disconnect())},[e]),n}function F$e(e){const t=k5(e);return v5(e,t)}const VN=[];function I$e(e){const t=Je(e),r=cp(n=>e?n&&n!==VN&&e&&t.current&&e.parentNode===t.current.parentNode?n:t2(e):VN,[e]);return Re(()=>{t.current=e},[e]),r}function P$e(e){const[t,r]=oe(null),n=Je(e),i=Jr(o=>{const s=Hb(o.target);s&&r(a=>a?(a.set(s,V1(s)),new Map(a)):null)},[]);return Re(()=>{const o=n.current;if(e!==o){s(o);const a=e.map(l=>{const u=Hb(l);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,V1(u)]):null}).filter(l=>l!=null);r(a.length?new Map(a):null),n.current=e}return()=>{s(e),s(o)};function s(a){a.forEach(l=>{const u=Hb(l);u?.removeEventListener("scroll",i)})}},[i,e]),Lt(()=>e.length?t?Array.from(t.values()).reduce((o,s)=>Ic(o,s),zo):E5(e):zo,[e,t])}function KN(e,t){t===void 0&&(t=[]);const r=Je(null);return Re(()=>{r.current=null},t),Re(()=>{const n=e!==zo;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?qg(e,r.current):zo}function O$e(e){Re(()=>{if(!bv)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r?.()}},e.map(t=>{let{sensor:r}=t;return r}))}function M$e(e,t){return Lt(()=>e.reduce((r,n)=>{let{eventName:i,handler:o}=n;return r[i]=s=>{o(s,t)},r},{}),[e,t])}function C5(e){return Lt(()=>e?a$e(e):null,[e])}const HN=[];function L$e(e,t){t===void 0&&(t=dp);const[r]=e,n=C5(r?vi(r):null),[i,o]=oe(HN);function s(){o(()=>e.length?e.map(l=>x5(l)?n:new r2(t(l),l)):HN)}const a=xv({callback:s});return cl(()=>{a?.disconnect(),s(),e.forEach(l=>a?.observe(l))},[e]),i}function z$e(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return up(t)?t:e}function U$e(e){let{measure:t}=e;const[r,n]=oe(null),i=Jr(u=>{for(const{target:d}of u)if(up(d)){n(f=>{const h=t(d);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),o=xv({callback:i}),s=Jr(u=>{const d=z$e(u);o?.disconnect(),d&&o?.observe(d),n(d?t(d):null)},[t,o]),[a,l]=jg(s);return Lt(()=>({nodeRef:a,rect:r,setRef:l}),[r,a,l])}const B$e=[{sensor:o2,options:{}},{sensor:n2,options:{}}],j$e={current:{}},q0={draggable:{measure:LN},droppable:{measure:LN,strategy:Ch.WhileDragging,frequency:H1.Optimized},dragOverlay:{measure:dp}};class Pf extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const q$e={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Pf,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Vg},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:q0,measureDroppableContainers:Vg,windowRect:null,measuringScheduled:!1},V$e={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Vg,draggableNodes:new Map,over:null,measureDroppableContainers:Vg},Sv=mr(V$e),K$e=mr(q$e);function H$e(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Pf}}}function W$e(e,t){switch(t.type){case Gr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Gr.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Gr.DragEnd:case Gr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Gr.RegisterDroppable:{const{element:r}=t,{id:n}=r,i=new Pf(e.droppable.containers);return i.set(n,r),{...e,droppable:{...e.droppable,containers:i}}}case Gr.SetDroppableDisabled:{const{id:r,key:n,disabled:i}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const s=new Pf(e.droppable.containers);return s.set(r,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case Gr.UnregisterDroppable:{const{id:r,key:n}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const o=new Pf(e.droppable.containers);return o.delete(r),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function G$e(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:i}=Ut(Sv),o=j1(n),s=j1(r?.id);return Re(()=>{if(!t&&!n&&o&&s!=null){if(!g5(o)||document.activeElement===o.target)return;const a=i.get(s);if(!a)return;const{activatorNode:l,node:u}=a;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[l.current,u.current]){if(!d)continue;const f=UTe(d);if(f){f.focus();break}}})}},[n,t,i,s,o]),null}function J$e(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...n}),r):r}function Q$e(e){return Lt(()=>({draggable:{...q0.draggable,...e?.draggable},droppable:{...q0.droppable,...e?.droppable},dragOverlay:{...q0.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Y$e(e){let{activeNode:t,measure:r,initialRect:n,config:i=!0}=e;const o=Je(!1),{x:s,y:a}=typeof i=="boolean"?{x:i,y:i}:i;cl(()=>{if(!s&&!a||!t){o.current=!1;return}if(o.current||!n)return;const u=t?.node.current;if(!u||u.isConnected===!1)return;const d=r(u),f=v5(d,n);if(s||(f.x=0),a||(f.y=0),o.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=_5(u);h&&h.scrollBy({top:f.y,left:f.x})}},[t,s,a,n,r])}const R5=mr({...zo,scaleX:1,scaleY:1});var Ra;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ra||(Ra={}));const A5=n9(function(t){var r,n,i,o;let{id:s,accessibility:a,autoScroll:l=!0,children:u,sensors:d=B$e,collisionDetection:f=e$e,measuring:h,modifiers:p,...g}=t;const m=i9(W$e,void 0,H$e),[v,_]=m,[x,w]=HTe(),[S,k]=oe(Ra.Uninitialized),A=S===Ra.Initialized,{draggable:{active:C,nodes:R,translate:N},droppable:{containers:I}}=v,P=C!=null?R.get(C):null,z=Je({initial:null,translated:null}),q=Lt(()=>{var _r;return C!=null?{id:C,data:(_r=P?.data)!=null?_r:j$e,rect:z}:null},[C,P]),H=Je(null),[V,Y]=oe(null),[G,J]=oe(null),Q=kh(g,Object.values(g)),ue=yv("DndDescribedBy",s),le=Lt(()=>I.getEnabled(),[I]),Ae=Q$e(h),{droppableRects:$e,measureDroppableContainers:ze,measuringScheduled:mt}=T$e(le,{dragging:A,dependencies:[N.x,N.y],config:Ae.droppable}),be=R$e(R,C),Se=Lt(()=>G?q1(G):null,[G]),st=El(),Xt=$$e(be,Ae.draggable.measure);Y$e({activeNode:C!=null?R.get(C):null,config:st.layoutShiftCompensation,initialRect:Xt,measure:Ae.draggable.measure});const wt=qN(be,Ae.draggable.measure,Xt),Zn=qN(be?be.parentElement:null),Mr=Je({activatorEvent:null,active:null,activeNode:be,collisionRect:null,collisions:null,droppableRects:$e,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),j=I.getNodeFor((r=Mr.current.over)==null?void 0:r.id),me=U$e({measure:Ae.dragOverlay.measure}),Ue=(n=me.nodeRef.current)!=null?n:be,Fe=A?(i=me.rect)!=null?i:wt:null,ye=!!(me.nodeRef.current&&me.rect),re=F$e(ye?null:wt),_e=C5(Ue?vi(Ue):null),Ce=I$e(A?j??be:null),Le=L$e(Ce),He=J$e(p,{transform:{x:N.x-re.x,y:N.y-re.y,scaleX:1,scaleY:1},activatorEvent:G,active:q,activeNodeRect:wt,containerNodeRect:Zn,draggingNodeRect:Fe,over:Mr.current.over,overlayNodeRect:me.rect,scrollableAncestors:Ce,scrollableAncestorRects:Le,windowRect:_e}),Ze=Se?Ic(Se,N):null,dt=P$e(Ce),wr=KN(dt),Ge=KN(dt,[wt]),Xe=Ic(He,wr),vr=Fe?n$e(Fe,He):null,kr=q&&vr?f({active:q,collisionRect:vr,droppableRects:$e,droppableContainers:le,pointerCoordinates:Ze}):null,Lr=XTe(kr,"id"),[or,Ln]=oe(null),_o=ye?He:Ic(He,Ge),_i=t$e(_o,(o=or?.rect)!=null?o:null,wt),Jo=Je(null),ya=Jr((_r,nr)=>{let{sensor:br,options:zn}=nr;if(H.current==null)return;const Xr=R.get(H.current);if(!Xr)return;const Ct=_r.nativeEvent,Hr=new br({active:H.current,activeNode:Xr,event:Ct,options:zn,context:Mr,onAbort(ar){if(!R.get(ar))return;const{onDragAbort:Un}=Q.current,Bn={id:ar};Un?.(Bn),x({type:"onDragAbort",event:Bn})},onPending(ar,ei,Un,Bn){if(!R.get(ar))return;const{onDragPending:bi}=Q.current,vt={id:ar,constraint:ei,initialCoordinates:Un,offset:Bn};bi?.(vt),x({type:"onDragPending",event:vt})},onStart(ar){const ei=H.current;if(ei==null)return;const Un=R.get(ei);if(!Un)return;const{onDragStart:Bn}=Q.current,yo={activatorEvent:Ct,active:{id:ei,data:Un.data,rect:z}};_p(()=>{Bn?.(yo),k(Ra.Initializing),_({type:Gr.DragStart,initialCoordinates:ar,active:ei}),x({type:"onDragStart",event:yo}),Y(Jo.current),J(Ct)})},onMove(ar){_({type:Gr.DragMove,coordinates:ar})},onEnd:bo(Gr.DragEnd),onCancel:bo(Gr.DragCancel)});Jo.current=Hr;function bo(ar){return async function(){const{active:Un,collisions:Bn,over:yo,scrollAdjustedTranslate:bi}=Mr.current;let vt=null;if(Un&&bi){const{cancelDrop:yr}=Q.current;vt={activatorEvent:Ct,active:Un,collisions:Bn,delta:bi,over:yo},ar===Gr.DragEnd&&typeof yr=="function"&&await Promise.resolve(yr(vt))&&(ar=Gr.DragCancel)}H.current=null,_p(()=>{_({type:ar}),k(Ra.Uninitialized),Ln(null),Y(null),J(null),Jo.current=null;const yr=ar===Gr.DragEnd?"onDragEnd":"onDragCancel";if(vt){const Rs=Q.current[yr];Rs?.(vt),x({type:yr,event:vt})}})}}},[R]),xl=Jr((_r,nr)=>(br,zn)=>{const Xr=br.nativeEvent,Ct=R.get(zn);if(H.current!==null||!Ct||Xr.dndKit||Xr.defaultPrevented)return;const Hr={active:Ct};_r(br,nr.options,Hr)===!0&&(Xr.dndKit={capturedBy:nr.sensor},H.current=zn,ya(br,nr))},[R,ya]),Qo=A$e(d,xl);O$e(d),cl(()=>{wt&&S===Ra.Initializing&&k(Ra.Initialized)},[wt,S]),Re(()=>{const{onDragMove:_r}=Q.current,{active:nr,activatorEvent:br,collisions:zn,over:Xr}=Mr.current;if(!nr||!br)return;const Ct={active:nr,activatorEvent:br,collisions:zn,delta:{x:Xe.x,y:Xe.y},over:Xr};_p(()=>{_r?.(Ct),x({type:"onDragMove",event:Ct})})},[Xe.x,Xe.y]),Re(()=>{const{active:_r,activatorEvent:nr,collisions:br,droppableContainers:zn,scrollAdjustedTranslate:Xr}=Mr.current;if(!_r||H.current==null||!nr||!Xr)return;const{onDragOver:Ct}=Q.current,Hr=zn.get(Lr),bo=Hr&&Hr.rect.current?{id:Hr.id,rect:Hr.rect.current,data:Hr.data,disabled:Hr.disabled}:null,ar={active:_r,activatorEvent:nr,collisions:br,delta:{x:Xr.x,y:Xr.y},over:bo};_p(()=>{Ln(bo),Ct?.(ar),x({type:"onDragOver",event:ar})})},[Lr]),cl(()=>{Mr.current={activatorEvent:G,active:q,activeNode:be,collisionRect:vr,collisions:kr,droppableRects:$e,draggableNodes:R,draggingNode:Ue,draggingNodeRect:Fe,droppableContainers:I,over:or,scrollableAncestors:Ce,scrollAdjustedTranslate:Xe},z.current={initial:Fe,translated:vr}},[q,be,kr,vr,R,Ue,Fe,$e,I,or,Ce,Xe]),w$e({...st,delta:N,draggingRect:vr,pointerCoordinates:Ze,scrollableAncestors:Ce,scrollableAncestorRects:Le});const sr=Lt(()=>({active:q,activeNode:be,activeNodeRect:wt,activatorEvent:G,collisions:kr,containerNodeRect:Zn,dragOverlay:me,draggableNodes:R,droppableContainers:I,droppableRects:$e,over:or,measureDroppableContainers:ze,scrollableAncestors:Ce,scrollableAncestorRects:Le,measuringConfiguration:Ae,measuringScheduled:mt,windowRect:_e}),[q,be,wt,G,kr,Zn,me,R,I,$e,or,ze,Ce,Le,Ae,mt,_e]),Sl=Lt(()=>({activatorEvent:G,activators:Qo,active:q,activeNodeRect:wt,ariaDescribedById:{draggable:ue},dispatch:_,draggableNodes:R,over:or,measureDroppableContainers:ze}),[G,Qo,q,wt,_,ue,R,or,ze]);return Vi.createElement(m5.Provider,{value:w},Vi.createElement(Sv.Provider,{value:Sl},Vi.createElement(K$e.Provider,{value:sr},Vi.createElement(R5.Provider,{value:_i},u)),Vi.createElement(G$e,{disabled:a?.restoreFocus===!1})),Vi.createElement(JTe,{...a,hiddenTextDescribedById:ue}));function El(){const _r=V?.autoScrollEnabled===!1,nr=typeof l=="object"?l.enabled===!1:l===!1,br=A&&!_r&&!nr;return typeof l=="object"?{...l,enabled:br}:{enabled:br}}}),X$e=mr(null),WN="button",Z$e="Draggable";function T5(e){let{id:t,data:r,disabled:n=!1,attributes:i}=e;const o=yv(Z$e),{activators:s,activatorEvent:a,active:l,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:h}=Ut(Sv),{role:p=WN,roleDescription:g="draggable",tabIndex:m=0}=i??{},v=l?.id===t,_=Ut(v?R5:X$e),[x,w]=jg(),[S,k]=jg(),A=M$e(s,t),C=kh(r);cl(()=>(f.set(t,{id:t,key:o,node:x,activatorNode:S,data:C}),()=>{const N=f.get(t);N&&N.key===o&&f.delete(t)}),[f,t]);const R=Lt(()=>({role:p,tabIndex:m,"aria-disabled":n,"aria-pressed":v&&p===WN?!0:void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[n,p,m,v,g,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:u,attributes:R,isDragging:v,listeners:n?void 0:A,node:x,over:h,setNodeRef:w,setActivatorNodeRef:k,transform:_}}const eNe="Droppable",tNe={timeout:25};function $5(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:i}=e;const o=yv(eNe),{active:s,dispatch:a,over:l,measureDroppableContainers:u}=Ut(Sv),d=Je({disabled:r}),f=Je(!1),h=Je(null),p=Je(null),{disabled:g,updateMeasurementsFor:m,timeout:v}={...tNe,...i},_=kh(m??n),x=Jr(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(_.current)?_.current:[_.current]),p.current=null},v)},[v]),w=xv({callback:x,disabled:g||!s}),S=Jr((R,N)=>{w&&(N&&(w.unobserve(N),f.current=!1),R&&w.observe(R))},[w]),[k,A]=jg(S),C=kh(t);return Re(()=>{!w||!k.current||(w.disconnect(),f.current=!1,w.observe(k.current))},[k,w]),Re(()=>(a({type:Gr.RegisterDroppable,element:{id:n,key:o,disabled:r,node:k,rect:h,data:C}}),()=>a({type:Gr.UnregisterDroppable,key:o,id:n})),[n]),Re(()=>{r!==d.current.disabled&&(a({type:Gr.SetDroppableDisabled,id:n,key:o,disabled:r}),d.current.disabled=r)},[n,o,r,a]),{active:s,rect:h,isOver:l?.id===n,node:k,over:l,setNodeRef:A}}function N5(e,t){ie(ms(e.onPointerDown),r=>r(t))}function D5(e,t){ie(ms(e.onKeyDown),r=>r(t))}function F5(e){return W(e==null?void 0:pr(e),t=>"translate3d("+t.x.toString()+"px, "+t.y.toString()+"px, 0)")}function Rr(e){return"var("+e+")"}let rNe=E([L("flex"),ee("stretch"),c("gap",Rr(F.md)),c("overflow-x","auto"),c("padding-bottom",Rr(F.sm))]),Jb=E([L("flex"),he("column"),c("gap",Rr(F.sm)),c("flex","0 0 240px"),c("padding",Rr(F.sm)),c("background",Rr(y.surfaceSubtle)),c("border","1px solid var("+y.borderSubtle+")"),c("border-radius",Rr(X.md)),c("min-height","120px")]),nNe=E([c("border-color",Rr(y.brand))]),iNe=E([Ws(.45)]),oNe=E([L("flex"),ee("center"),Qe("spaceBetween"),c("gap",Rr(F.sm)),c("font-size",Rr($.sizeSm)),c("font-weight",Rr($.weightMedium)),c("color",Rr(y.textSecondary)),c("text-transform","uppercase"),c("letter-spacing","0.04em")]),GN=E([L("flex"),he("column"),ee("stretch"),c("gap","4px"),c("padding",Rr(F.sm)),c("background",Rr(y.surface)),c("border","1px solid var("+y.border+")"),c("border-radius",Rr(X.sm)),c("text-align","left"),we("pointer"),Ye([c("border-color",Rr(y.brand))])]),sNe=E([we("grab")]),aNe=E([Ws(.85),c("z-index","10"),we("grabbing")]),lNe=E([c("font-size",Rr($.sizeSm)),c("font-weight",Rr($.weightMedium)),c("color",Rr(y.textPrimary))]),uNe=E([c("font-size",Rr($.sizeXs)),c("color",Rr(y.textSecondary)),c("overflow","hidden"),c("text-overflow","ellipsis"),c("white-space","nowrap")]),cNe=E([c("color",Rr(y.textDisabled)),c("font-size",Rr($.sizeSm))]);function dNe(e){let t=e.onClick,r=e.draggable,n=e.card,i=T5({id:n.key,disabled:!r}),o=r?GN+" "+sNe:GN,s=i.isDragging?o+" "+aNe:o,a=F5(i.transform),l=a!==void 0?{transform:a}:void 0,u=i.listeners,d=u==null?void 0:pr(u),f=n.meta;return M("div",{children:[b("span",{children:n.title,className:lNe}),f!==void 0?b("span",{children:f,className:uNe,title:f}):null],ref:pr(i.setNodeRef),className:s,role:"button",style:l,tabIndex:0,onKeyDown:h=>ie(d,p=>D5(p,h)),onClick:h=>ie(t,p=>p(n.key)),onPointerDown:h=>ie(d,p=>N5(p,h))})}function fNe(e){let t=e.accepts,r=e.onCardClick,n=e.draggable,i=e.column,o=t!==void 0?t:!0,s=$5({id:i.value,disabled:!o}),a=s.isOver,l=o?a?Jb+" "+nNe:Jb:Jb+" "+iNe;return M("div",{children:[M("div",{children:[b("span",{children:i.label}),b(bf,{count:i.cards.length,label:""})],className:oNe}),i.cards.length===0?b("span",{children:"—",className:cNe}):i.cards.map(u=>b(dNe,{card:u,draggable:n,onClick:r},u.key))],ref:pr(s.setNodeRef),className:l})}function hNe(e){let t=e.canDrop,r=e.onMove,n=e.onCardClick,i=e.columns,o=We(r),s=QTe(MN(o2,{activationConstraint:{distance:5}}),MN(n2,{})),a=oe(()=>{}),l=a[1],u=a[0],d=h=>t!==void 0&&u!==void 0?t(u,h.value):!0,f=h=>{l(v=>{});let p=h.over;if(r===void 0||p==null)return;let g=i.find(v=>v.cards.some(_=>_.key===h.active.id));if(fe(t,!0,v=>v(h.active.id,p.id))&&fe(g,!0,v=>v.value!==p.id))return r(h.active.id,p.id)};return b(A5,{sensors:pr(s),onDragStart:h=>l(p=>h.active.id),onDragEnd:f,onDragCancel:()=>l(h=>{}),children:b("div",{children:i.map(h=>b(fNe,{column:h,draggable:o,onCardClick:n,accepts:d(h)},h.value)),className:rNe})})}let pNe=hNe;function ht(e){return"var("+e+")"}let gNe=E([L("flex"),he("column"),c("gap",ht(F.sm))]),mNe=E([L("flex"),ee("center"),Qe("spaceBetween"),c("gap",ht(F.sm))]),JN=E([L("inlineFlex"),ee("center"),c("gap",ht(F.xs))]),pf=E([c("background","none"),c("border","1px solid var("+y.border+")"),c("border-radius",ht(X.sm)),c("padding","2px var("+F.sm+")"),c("color",ht(y.textSecondary)),c("font-size",ht($.sizeSm)),we("pointer"),Ye([c("background",ht(y.surfaceSubtle)),c("color",ht(y.textPrimary))])]),vNe=$n([pf,E([c("background",ht(y.surfaceSubtle)),c("color",ht(y.textPrimary)),c("font-weight",ht($.weightMedium))])]),_Ne=E([c("font-size",ht($.sizeMd)),c("font-weight",ht($.weightMedium)),c("color",ht(y.textPrimary))]),bNe=E([L("grid"),c("grid-template-columns","repeat(7, 1fr)"),c("gap","1px")]),yNe=E([c("font-size",ht($.sizeXs)),c("color",ht(y.textSecondary)),c("text-transform","uppercase"),c("letter-spacing","0.04em"),c("padding","2px var("+F.xs+")")]),xNe=E([L("grid"),c("grid-template-columns","repeat(7, 1fr)"),c("gap","1px"),c("background",ht(y.borderSubtle)),c("border","1px solid var("+y.borderSubtle+")"),c("border-radius",ht(X.md)),c("overflow","hidden")]),I5=E([L("flex"),he("column"),c("gap","2px"),c("min-height","96px"),c("padding","4px"),c("background",ht(y.surface))]),SNe=$n([I5,E([c("opacity","0.55")])]),P5=E([c("font-size",ht($.sizeXs)),c("color",ht(y.textSecondary))]),ENe=$n([P5,E([c("color",ht(y.brand)),c("font-weight",ht($.weightMedium))])]);function wNe(e){return E([L("block"),c("width","100%"),c("text-align","left"),c("border","none"),c("border-left","3px solid "+e),c("border-radius",ht(X.sm)),c("background",ht(y.surfaceSubtle)),c("color",ht(y.textPrimary)),c("font-size",ht($.sizeXs)),c("padding","1px var("+F.xs+")"),c("overflow","hidden"),c("text-overflow","ellipsis"),c("white-space","nowrap"),we("pointer"),Ye([c("background",ht(y.surfaceElevated))])])}let kNe=E([c("background","none"),c("border","none"),c("padding","0"),c("text-align","left"),c("font-size",ht($.sizeXs)),c("color",ht(y.brand)),we("pointer"),Ye([c("text-decoration","underline")])]);function CNe(e){return E([L("grid"),c("grid-template-columns","repeat("+e.toString()+", 1fr)"),c("gap","1px"),c("background",ht(y.borderSubtle)),c("border","1px solid var("+y.borderSubtle+")"),c("border-radius",ht(X.md)),c("overflow","hidden")])}let RNe=E([L("flex"),he("column"),c("gap","2px"),c("min-height","200px"),c("padding","4px"),c("background",ht(y.surface))]),ANe=E([c("font-size",ht($.sizeXs)),c("color",ht(y.textSecondary)),c("padding-bottom","2px"),c("border-bottom","1px solid var("+y.borderSubtle+")")]),TNe=E([L("flex"),pi("wrap"),ee("center"),c("gap",ht(F.md)),c("font-size",ht($.sizeXs)),c("color",ht(y.textSecondary))]);function $Ne(e){return E([L("inlineBlock"),c("width","8px"),c("height","8px"),c("border-radius","50%"),c("background",e),c("margin-right","4px")])}let NNe=E([c("font-size",ht($.sizeXs)),c("color",ht(y.textDisabled))]),DNe="var("+y.brand+")";function FNe(e){return D(e.end_,e.start)}function QN(e,t){return e.filter(r=>WM(r.start,FNe(r),t)).toSorted((r,n)=>r.start-n.start)}function INe(e,t){return JM(e.start)||!HM(e.start,t)?e.title:GM(e.start)+" "+e.title}function PNe(e){let t=e.initialDate,r=e.windowNote,n=e.legend,i=e.events,o=n!==void 0?n:[],s=oe(()=>"Month"),a=s[1],l=s[0],u=oe(()=>Gn(D(t,Date.now()))),d=u[1],f=u[0],h=Gn(Date.now()),p=S=>d(k=>{switch(l){case"Month":return VM(k,S);case"Week":return ro(k,S*7|0);case"Day":return ro(k,S)}}),g=(S,k)=>b("button",{children:INe(S,k),className:wNe(D(S.accent,DNe)),title:S.title,onClick:A=>S.onOpen()},S.key),m=()=>{let S=dfe(f);return M(qr,{children:[b("div",{children:JE.map(k=>b("div",{children:k,className:yNe},k)),className:bNe}),b("div",{children:S.map(k=>{let A=QN(i,k),C=A.slice(0,3),R=A.length-C.length|0;return M("div",{children:[b("span",{children:YM(k).toString(),className:k===h?ENe:P5}),C.map(N=>g(N,k)),R>0?b("button",{children:"+"+R.toString()+" more",className:kNe,onClick:N=>{d(I=>k),a(I=>"Day")}}):null],className:ffe(k,f)?I5:SNe},k.toString())}),className:xNe})]})},v=S=>b("div",{children:S.map(k=>M("div",{children:[b("div",{children:oa(k),className:ANe}),QN(i,k).map(A=>g(A,k))],className:RNe},k.toString())),className:CNe(S.length)}),_;switch(l){case"Month":_=m();break;case"Week":_=v(Ja(7,S=>ro(Bm(f),S)));break;case"Day":_=v([Gn(f)]);break}let x;switch(l){case"Month":case"Week":x=Gi(f);break;case"Day":x=oa(f)+" — "+Gi(f);break}let w=(S,k)=>b("button",{children:k,className:l===S?vNe:pf,onClick:A=>a(C=>S)});return M("div",{children:[M("div",{children:[M("div",{children:[b("button",{children:"‹",className:pf,onClick:S=>p(-1)}),b("button",{children:"Today",className:pf,onClick:S=>d(k=>h)}),b("button",{children:"›",className:pf,onClick:S=>p(1)}),b("span",{children:x,className:_Ne})],className:JN}),M("div",{children:[w("Month","Month"),w("Week","Week"),w("Day","Day")],className:JN})],className:mNe}),o.length!==0?b("div",{children:o.map(S=>M("span",{children:[b("span",{className:$Ne(S.accent)}),S.label]},S.label)),className:TNe}):null,_,r!==void 0?b("span",{children:r,className:NNe}):null],className:gNe})}let ONe=PNe;function an(e){return"var("+e+")"}let MNe=E([L("grid"),c("grid-template-columns","repeat(auto-fill, minmax(220px, 1fr))"),c("gap",an(F.md))]),LNe=E([L("flex"),he("column"),ee("stretch"),c("gap",an(F.sm)),c("padding",an(F.md)),c("background",an(y.surface)),c("border","1px solid var("+y.border+")"),c("border-radius",an(X.md)),c("text-align","left"),we("pointer"),Ye([c("border-color",an(y.brand)),c("background",an(y.surfaceSubtle))])]),zNe=E([c("width","100%"),c("height","96px"),c("object-fit","cover"),c("border-radius",an(X.sm))]),UNe=E([L("flex"),ee("center"),Qe("spaceBetween"),c("gap",an(F.sm))]),BNe=E([c("font-size",an($.sizeMd)),c("font-weight",an($.weightMedium)),c("color",an(y.textPrimary)),c("overflow","hidden"),c("text-overflow","ellipsis"),c("white-space","nowrap")]),jNe=E([L("flex"),ee("baseline"),c("gap",an(F.sm)),c("font-size",an($.sizeSm))]),qNe=E([c("color",an(y.textSecondary)),c("white-space","nowrap"),Li(0)]),VNe=E([c("color",an(y.textPrimary)),c("min-width","0"),c("overflow","hidden"),c("text-overflow","ellipsis")]),KNe=E([c("color",an(y.textDisabled)),c("font-size",an($.sizeSm))]);function HNe(e){let t=e.cards;if(t.length===0)return b("span",{children:"(empty)",className:KNe});let r=e.onCardClick;return b("div",{children:t.map(n=>{let i=n.media;return M("button",{children:[i!==void 0?b("img",{className:zNe,alt:n.title,src:i}):null,M("div",{children:[b("span",{children:n.title,className:BNe,title:n.title}),D(n.badge,null)],className:UNe}),n.fields.map(o=>M("div",{children:[b("span",{children:o.label,className:qNe}),b("span",{children:o.value,className:VNe})],className:jNe},o.label))],className:LNe,onClick:o=>ie(r,s=>s(n.key))},n.key)}),className:MNe})}let WNe=HNe;function GNe(e,t){let r=e.indexOf(t);return e.map((n,i)=>{let o=r<0?"Upcoming":i<r?"Done":i===r?"Current":"Upcoming";return[n,o]})}function JNe(e,t,r){return GNe(Bo(e,t),r).map(n=>{let i=n[0];return{key:i,label:yt(i),state:n[1]}})}function uo(e){return"var("+e+")"}let QNe=E([L("flex"),ee("flexStart"),c("gap","0"),c("width","100%")]),YNe=E([L("flex"),he("column"),ee("center"),c("gap","4px"),c("flex","0 0 auto")]);function XNe(e){return E([c("flex","1 1 auto"),c("height","2px"),c("margin","0 6px"),c("margin-top","11px"),c("min-width","16px"),c("background",uo(e?y.brand:y.borderSubtle))])}let s2=[L("inlineFlex"),ee("center"),Qe("center"),c("width","24px"),c("height","24px"),c("border-radius","50%"),c("font-size",uo($.sizeXs)),c("font-weight",uo($.weightMedium)),c("box-sizing","border-box")],ZNe=E(s2.concat([c("background",uo(y.brand)),c("color","#fff")])),e3e=E(s2.concat([c("background",uo(y.surface)),c("color",uo(y.brand)),c("border","2px solid var("+y.brand+")")])),t3e=E(s2.concat([c("background",uo(y.surface)),c("color",uo(y.textDisabled)),c("border","1px solid var("+y.border+")")])),O5=[c("font-size",uo($.sizeXs)),c("text-align","center"),c("max-width","96px")],r3e=E(O5.concat([c("color",uo(y.textPrimary))])),n3e=E(O5.concat([c("color",uo(y.textDisabled))])),i3e=E([c("display","none")]);function o3e(e){switch(e){case"Done":return ZNe;case"Current":return e3e;case"Upcoming":return t3e}}function s3e(e){switch(e){case"Done":case"Current":return r3e;case"Upcoming":return n3e}}function a3e(e,t){switch(e){case"Done":return"✓";case"Current":case"Upcoming":return(t+1|0).toString()}}function l3e(e){let t=e.compact,r=t!==void 0?t:!1;return b("div",{children:e.steps.map((n,i)=>{let o=i===0?null:b("div",{className:XNe(n.state==="Done"||n.state==="Current")},n.key+":c"),s=r?i3e:s3e(n.state);return M(ax,{children:[o,M("div",{children:[b("span",{children:a3e(n.state,i),className:o3e(n.state)}),b("span",{children:n.label,className:s})],className:YNe,role:"listitem"})]},n.key)}),"aria-label":"Progress",className:QNe,role:"list"})}let M5=l3e;function L5(e){switch(e.toLowerCase().replaceAll("_","").replaceAll("-","")){case"accepted":case"approve":case"approved":case"confirmed":case"granted":case"signed":return"Approved";case"awaiting":case"escalated":case"inreview":case"pending":case"submitted":case"underreview":return"Pending";case"na":case"notrequired":case"skipped":case"waived":return"Skipped";case"declined":case"denied":case"refused":case"reject":case"rejected":case"withdrawn":return"Rejected";default:return{TAG:"Other",_0:e}}}function u3e(e){if(typeof e=="object")return yt(e._0);switch(e){case"Approved":return"Approved";case"Rejected":return"Rejected";case"Pending":return"Pending";case"Skipped":return"Skipped"}}function c3e(e){if(typeof e=="object")return"Neutral";switch(e){case"Approved":return"Success";case"Rejected":return"Error";case"Pending":return"Info";case"Skipped":return"Neutral"}}function d3e(e){if(typeof e=="object")return"•";switch(e){case"Approved":return"✓";case"Rejected":return"✕";case"Pending":return"•";case"Skipped":return"–"}}function f3e(e){if(typeof e=="object")return"var("+y.border+")";switch(e){case"Approved":return"var("+y.success+")";case"Rejected":return"var("+y.error+")";case"Pending":return"var("+y.info+")";case"Skipped":return"var("+y.border+")"}}function mn(e){return"var("+e+")"}let h3e=E([L("flex"),he("column"),c("gap",mn(F.md)),c("font-family",mn($.fontFamily))]),p3e=E([L("flex"),he("column")]),g3e=E([L("flex"),ee("stretch"),c("gap",mn(F.sm))]),m3e=E([L("flex"),he("column"),ee("center"),c("flex","0 0 22px")]);function v3e(e){return E([L("inlineFlex"),ee("center"),Qe("center"),c("width","20px"),c("height","20px"),c("border-radius","50%"),c("box-sizing","border-box"),c("border","2px solid "+e),c("color",e),c("background",mn(y.surface)),c("font-size","11px"),c("line-height","1"),c("flex","0 0 auto")])}let _3e=E([c("flex","1 1 auto"),c("width","1px"),c("min-height","12px"),c("background",mn(y.borderSubtle))]),YN=E([L("flex"),he("column"),c("gap","2px"),c("flex","1 1 auto"),c("min-width","0"),c("padding-bottom",mn(F.sm))]),b3e=E([we("pointer"),Ye([c("background",mn(y.surfaceSubtle))]),c("border-radius",mn(X.sm)),c("padding-left","4px"),c("margin-left","-4px")]),y3e=E([L("flex"),ee("center"),pi("wrap"),c("gap",mn(F.xs))]),x3e=E([c("font-size",mn($.sizeSm)),c("font-weight",mn($.weightMedium)),c("color",mn(y.textPrimary))]),S3e=E([L("flex"),ee("center"),c("gap","6px"),c("font-size",mn($.sizeXs)),c("color",mn(y.textSecondary))]),E3e=E([c("font-size",mn($.sizeSm)),c("color",mn(y.textSecondary)),c("white-space","pre-wrap")]),w3e=E([c("font-size",mn($.sizeXs)),c("color",mn(y.textDisabled))]);function k3e(e){let t=e.entries;if(t.length===0)return b(sd,{title:"No approvals",description:"Nothing in this window carries a decision."});let r=e.windowNote,n=e.nowMs,i=e.steps,o=t.length-1|0;return M("div",{children:[i!==void 0&&i.length>1?b(M5,{steps:i}):null,b("div",{children:t.map((s,a)=>{let l=We(s.onOpen),u=s.actor,d=s.at,f,h=0;u!==void 0||d!==void 0?h=1:f=null,h===1&&(f=M("div",{children:[u!==void 0?M(qr,{children:[b(ad,{name:u,src:s.actorImageUrl,size:"Small"}),b("span",{children:u})]}):null,d!==void 0?b("span",{children:jm(D(n,Date.now()),d),title:D(bx(d),d)}):null],className:S3e}));let p=s.note;return M("div",{children:[M("div",{children:[b("span",{children:d3e(s.decision),className:v3e(f3e(s.decision))}),a===o?null:b("div",{className:_3e})],className:m3e}),M("div",{children:[M("div",{children:[b("span",{children:s.step,className:x3e}),b(Zs,{variant:c3e(s.decision),label:u3e(s.decision)})],className:y3e}),f,p!==void 0&&p!==""?b("div",{children:p,className:E3e}):null],className:l?YN+" "+b3e:YN,onClick:g=>ie(s.onOpen,m=>m())})],className:g3e},s.key)}),className:p3e}),r!==void 0?b("span",{children:r,className:w3e}):null],className:h3e})}let C3e=k3e;function Io(e){return e.toLowerCase().replaceAll("_","").replaceAll("-","").replaceAll(" ","")}let R3e=["approved","approve","accepted","granted","signed","confirmed","rejected","reject","declined","denied","refused","withdrawn","pending","awaiting","submitted","inreview","underreview","escalated","skipped","waived","notrequired"],A3e=["decision","outcome","verdict","approval","approvalstatus","result"],T3e=["step","stage","level","tier","approvalstep","approvallevel","phase"],$3e=["note","notes","comment","comments","reason","remarks","justification","rationale"];function N3e(e){let t=ld(e);if(t!==void 0&&t.length>=2&&t.length<=12)return t}function D3e(e){return e.filter(t=>R3e.includes(Io(t))).length>=2}function z5(e){return se(Yr(e),t=>{let r=t[1],n=t[0];if(dm(r))return W(N3e(r),i=>[n,i])})}function F3e(e){let t=z5(e),r=t.find(n=>A3e.includes(Io(n[0])));return r!==void 0?r:t.find(n=>D3e(n[1]))}function I3e(e,t){let r=Yr(e).map(n=>n[0]).find(n=>fe(O(t.semantics,n),!1,i=>i.semantic==="UserRef"));return r!==void 0?r:Yr(e).map(n=>n[0]).find(n=>fe(Jc(n),!1,iF))}function U5(e,t){let r=D(t,Vr(e,void 0)),n=F3e(e),i=r.dateSpan;if(n===void 0||i===void 0)return;let o=n[0],s=z5(e).find(a=>{let l=a[0];return l!==o?T3e.includes(Io(l)):!1});return{decisionField:o,dateField:i.startField,stepField:W(s,a=>a[0]),stepValues:fe(s,[],a=>a[1]),actorField:I3e(e,r),noteField:se(Yr(e),a=>{let l=a[0];if(dm(a[1])&&$3e.includes(Io(l)))return l})[0]}}function P3e(e){return We(U5(e,void 0))}function a2(e){return e.rows.map((t,r)=>{let n=D(K(t),{});return{key:D(T(O(n,"id"),ce),"#"+r.toString()),json:t,dict:n}})}function Ls(e,t){return T(O(e,t),ce)}function XN(e,t){return T(Ls(e,t),Mi)}function ZN(e,t){if(t===void 0)return e.length;let r=e.findIndex(n=>Io(n)===Io(t));return r!==-1?r:e.length}function O3e(e,t,r){let n=r!==void 0?r:f=>f,s=a2(e).map(f=>{let h=T(t.stepField,g=>Ls(f.dict,g)),p=Ls(f.dict,t.decisionField);return[f,h,p]}).slice();t.stepField!==void 0?s.sort((f,h)=>ZN(t.stepValues,f[1])-ZN(t.stepValues,h[1])|0):s.sort((f,h)=>{let p=XN(f[0].dict,t.dateField),g=XN(h[0].dict,t.dateField);return p!==void 0?g!==void 0?p-g:-1:g!==void 0?1:0});let l=s.map(f=>{let h=f[0];return{key:h.key,step:D(W(f[1],yt),D(T(e.semantics.labelField,p=>Ls(h.dict,p)),"Decision")),decision:fe(f[2],"Pending",L5),actor:W(T(t.actorField,p=>Ls(h.dict,p)),n),at:Ls(h.dict,t.dateField),note:T(t.noteField,p=>Ls(h.dict,p)),onOpen:()=>e.onOpenRow(h.key,h.json)}}),u=se(s,f=>W(f[1],Io)),d=t.stepValues.filter(f=>!u.includes(Io(f))).map(f=>({key:"pending:"+f,step:yt(f),decision:"Pending"}));return l.concat(d)}function M3e(e,t){let r=t.stepField;if(r===void 0)return[];let n=a2(e),i=se(n,s=>{let a=Ls(s.dict,r),l=Ls(s.dict,t.decisionField);if(a===void 0||l===void 0)return;let u=L5(l);if(!(typeof u!="object"&&u==="Pending"))return Io(a)}),o=t.stepValues.find(s=>!i.includes(Io(s)));return t.stepValues.map(s=>({key:s,label:yt(s),state:i.includes(Io(s))?"Done":ot(o,s)?"Current":"Upcoming"}))}function _a(e){return e.rows.map((t,r)=>{let n=D(K(t),{});return{key:D(T(O(n,"id"),ce),"#"+r.toString()),json:t,dict:n}})}function co(e,t){return T(O(e,t),ce)}function Bu(e,t){return D(T(e.semantics.labelField,r=>co(t.dict,r)),t.key)}function B5(e,t,r){ie(t.find(n=>n.key===r),n=>e.onOpenRow(n.key,n.json))}function L3e(e){let t=e.source,r=pl(),n=em(),i=_a(t),o=wi(t.schema,"List"),s=Jh(i.map(p=>p.dict),o,r),u={lookupLabel:(p,g)=>Gh(s,p,r,g),isMissing:(p,g)=>Om(s,p,r,g)},d=se([t.semantics.labelField,t.semantics.imageField,t.semantics.statusField,"id"],p=>p),f=o.filter(p=>!d.includes(p.key)).slice(0,4),h=i.map(p=>{let g=W(T(t.semantics.statusField,v=>Ho(p.dict,v)),v=>b(Zs,{variant:"Neutral",label:yt(v),dot:!1})),m=T(t.semantics.imageField,v=>co(p.dict,v));return{key:p.key,title:Bu(t,p),media:m,badge:g,fields:f.map(v=>({label:v.label,value:Jl(v.key,v.kind,v.propSchema,O(p.dict,v.key),v.ann,r,n,u,void 0)}))}});return b(WNe,{cards:h,onCardClick:p=>B5(t,i,p)})}function z3e(e){let t=_a(e),r=D(e.semantics.statusField,""),n=Bo(e.schema,r),i=a=>D(Ho(a.dict,r),""),o=a=>a.map(l=>({value:l,label:l===""?"(no status)":yt(l),cards:t.filter(u=>i(u)===l).map(u=>{let d=se(cm(e.schema),f=>{if(f!==r)return co(u.dict,f)})[0];return{key:u.key,title:Bu(e,u),meta:d}})})),s=lt(t.map(i).filter(a=>!n.includes(a)),[],(a,l)=>a.includes(l)?a:a.concat([l]));return o(n).concat(o(s))}function U3e(e){let t=e.source,r=_a(t),n=D(t.semantics.statusField,""),i=z3e(t),o=f=>D(T(r.find(h=>h.key===f),h=>Ho(h.dict,n)),""),s=(f,h)=>T(t.statusCommandFor,p=>p(o(f),h)),a=t.onCommand,l=a!==void 0&&We(t.statusCommandFor)?(f,h)=>ie(s(f,h),p=>a(p.command,f,p.patch)):void 0,d=t.statusCommandFor!==void 0?(f,h)=>We(s(f,h)):void 0;return b(pNe,{columns:i,onCardClick:f=>B5(t,r,f),onMove:l,canDrop:d})}let rd=["var("+y.brand+")","#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74"];function j5(e,t){return D(e.accent,rd[Oo(t,rd.length)])}function B3e(e){return e.map((t,r)=>{let n=j5(t,r),i=t.semantics.dateSpan;return i!==void 0?se(_a(t),o=>W(T(co(o.dict,i.startField),Mi),s=>{let a=T(T(i.endField,l=>co(o.dict,l)),Mi);return{key:r.toString()+":"+o.key,title:Bu(t,o),start:s,end_:a,accent:n,onOpen:()=>t.onOpenRow(o.key,o.json)}})):[]}).flat()}function j3e(e){let t=e.sources,r=B3e(t),n=t.length>1?t.map((o,s)=>({label:o.readModelName,accent:j5(o,s)})):[],i=lt(t,0,(o,s)=>o+s.rows.length|0);return b(ONe,{events:r,legend:n,windowNote:"Showing the "+i.toString()+" loaded item(s)"})}function q3e(e){return e.map((r,n)=>{let i=W(r.semantics.dateSpan,o=>o.startField);return _a(r).map(o=>{let s=T(i,d=>co(o.dict,d)),a=T(s,Mi),l=s!==void 0?D(bx(s),s):"",u=W(T(r.semantics.statusField,d=>Ho(o.dict,d)),yt);return{entry:{id:n.toString()+":"+o.key,timestamp:l,label:Bu(r,o),detail:u,variant:void 0},sort:a,open_:()=>r.onOpenRow(o.key,o.json)}})}).flat().toSorted((r,n)=>{let i=r.sort,o=n.sort;return i!==void 0?o!==void 0?o-i:-1:o!==void 0?1:0})}function V3e(e){let t=e.sources,r=q3e(t),n=o=>ie(r.find(s=>s.entry.id===o),s=>s.open_()),i=lt(t,0,(o,s)=>o+s.rows.length|0);return M("div",{children:[b(MAe,{entries:r.map(o=>o.entry),onSelect:n}),b("span",{children:"Showing the "+i.toString()+" loaded item(s)",style:{color:"var("+y.textDisabled+")",fontSize:"var("+$.sizeXs+")"}})],style:{display:"flex",flexDirection:"column",gap:"var("+F.sm+")"}})}function q5(e,t){let r=O(e,t);if(r===void 0)return[];let n=ce(r);return n!==void 0?[n]:se(D(Vt(r),[]),ce)}function K3e(e,t){let r=t.map(n=>n.key);return se(Yr(e.schema),n=>{let i=n[0];return W(Jc(i),o=>i)}).filter(n=>t.some(i=>q5(i.dict,n).some(o=>o!==i.key?r.includes(o):!1)))}function H3e(e){let t=_a(e),r=K3e(e,t),n=e.semantics.dateSpan,i=W(n,s=>s.startField),o=T(n,s=>s.endField);return i!==void 0?o!==void 0?se(t,s=>W(T(co(s.dict,i),Mi),a=>{let l=D(T(co(s.dict,o),Mi),a);return{key:s.key,title:Bu(e,s),start:a,end_:l<a?a:l,accent:e.accent,dependsOn:r.map(u=>q5(s.dict,u)).flat(),onOpen:()=>e.onOpenRow(s.key,s.json)}})):[]:[]}function W3e(e){let t=e.source,r=H3e(t),n=t.rows.length,i=r.length,o=i===n?"Showing the "+n.toString()+" loaded item(s)":"Showing "+i.toString()+" of "+n.toString()+" loaded item(s) — the rest carry no start date";return b(mTe,{tasks:r,windowNote:o})}function G3e(e,t){let r=e.semantics.labelField,n=T(e.semantics.statusField,i=>co(t.dict,i));return n!==void 0?n:T(cm(e.schema).find(i=>Uf(i,r)?Uf(i,e.semantics.parentField):!1),i=>co(t.dict,i))}function J3e(e){let t=_a(e),r=e.semantics.parentField;return t.map(n=>({key:n.key,title:Bu(e,n),subtitle:G3e(e,n),parent:T(r,i=>co(n.dict,i)),accent:e.accent,onOpen:()=>e.onOpenRow(n.key,n.json)}))}function Q3e(e){let t=J3e(e.source),n="Showing the "+t.length.toString()+" loaded item(s)";return b(RAe,{nodes:t,windowNote:n})}function Y3e(e){let t=e.source,r=pl(),n=a2(t),i=wi(t.schema,"List"),o=Jh(n.map(f=>f.dict),i,r),s=U5(t.schema,t.semantics);if(s===void 0)return null;let l=O3e(t,s,f=>{let h=T(s.actorField,Jc);return h!==void 0?D(Gh(o,h,r,f),f):f}),u=M3e(t,s),d=t.rows.length;return b(C3e,{entries:l,steps:u,windowNote:"Showing the "+d.toString()+" loaded decision(s)"})}function X3e(e){return se(Yr(e),t=>{let r=ld(t[1]);if(r!==void 0&&r.length>=2&&r.length<=12)return[t[0],r]})}function V5(e){let t=X3e(e),r=Vr(e,void 0).statusField,n=r!==void 0&&t.some(s=>s[0]===r)?t.filter(s=>s[0]===r).concat(t.filter(s=>s[0]!==r)):t,i=n[0],o=n[1];if(i!==void 0&&o!==void 0)return[i,o]}function Z3e(e){return W(V5(e.schema),t=>{let r=t[1],n=r[1],i=r[0],o=t[0],s=o[1],a=o[0],l=_a(e),u=(_,x)=>D(Ho(_.dict,x),""),d=(_,x)=>lt(l.map(w=>u(w,_)).filter(w=>!x.includes(w)),[],(w,S)=>w.includes(S)?w:w.concat([S])),f=s.concat(d(a,s)),h=n.concat(d(i,n)),p=f.map(_=>h.map(x=>lt(l,0,(w,S)=>u(S,a)===_&&u(S,i)===x?w+1|0:w))),g=p.map(_=>lt(_,0,(x,w)=>x+w|0)),m=h.map((_,x)=>lt(p,0,(w,S)=>w+S[x]|0)),v=lt(g,0,(_,x)=>_+x|0);return{rowField:a,colField:i,rowValues:f,colValues:h,counts:p,rowTotals:g,colTotals:m,grandTotal:v}})}function eDe(e){let t=oe(()=>"Numbers"),r=t[1],n=t[0],i=Z3e(e.source);if(i===void 0)return null;let o=p=>p===""?"(none)":yt(p),s=yt(i.rowField),a=yt(i.colField),l=i.rowValues.map(p=>[p,o(p)]),u=i.colValues.map(p=>[p,o(p)]),d=lt(i.counts,0,(p,g)=>lt(g,p,(m,v)=>v>m?v:m)),f=(p,g)=>b("button",{children:g,style:{background:"none",backgroundColor:n===p?"var("+y.surfaceSubtle+")":"transparent",border:"1px solid var("+y.border+")",color:n===p?"var("+y.textPrimary+")":"var("+y.textSecondary+")",cursor:"pointer",fontSize:"var("+$.sizeSm+")",padding:"2px var("+F.sm+")",borderRadius:"var("+X.sm+")"},type:"button",onClick:m=>r(v=>p)}),h;return h=n==="Numbers"?b(kTe,{rowDimLabel:s,colDimLabel:a,rowHeaders:l.map(p=>({value:p[0],label:p[1]})),colHeaders:u.map(p=>({value:p[0],label:p[1]})),cells:i.counts.map(p=>p.map(g=>({display:g.toString(),empty:g===0}))),rowTotals:i.rowTotals.map(p=>p.toString()),colTotals:i.colTotals.map(p=>p.toString()),grandTotal:i.grandTotal.toString()}):b(oAe,{rowDimLabel:s,colDimLabel:a,rowHeaders:l.map(p=>({value:p[0],label:p[1]})),colHeaders:u.map(p=>({value:p[0],label:p[1]})),cells:i.counts.map(p=>p.map(g=>({value:g,display:g.toString()}))),maxLabel:d.toString()}),M("div",{children:[M("div",{children:[f("Numbers","Numbers"),f("Heat","Heat")],style:{display:"inline-flex",alignSelf:"flex-end",gap:"var("+F.xs+")"}}),h],style:{display:"flex",flexDirection:"column",gap:"var("+F.sm+")"}})}function tDe(e){return e.map((t,r)=>{let n=t.semantics.imageField;return _a(t).map(i=>{let o=T(T(n,a=>co(i.dict,a)),a=>{if(a!=="")return Mc(a)}),s=W(T(t.semantics.statusField,a=>Ho(i.dict,a)),yt);return{item:{key:r.toString()+":"+i.key,src:o,title:Bu(t,i),caption:s},open_:()=>t.onOpenRow(i.key,i.json)}})}).flat()}function rDe(e){let t=e.sources,r=tDe(t),n=o=>ie(r.find(s=>s.item.key===o),s=>s.open_()),i=lt(t,0,(o,s)=>o+s.rows.length|0);return M("div",{children:[b(OTe,{items:r.map(o=>o.item),onOpen:n}),b("span",{children:"Showing the "+i.toString()+" loaded item(s)",style:{color:"var("+y.textDisabled+")",fontSize:"var("+$.sizeXs+")"}})],style:{display:"flex",flexDirection:"column",gap:"var("+F.sm+")"}})}function ba(e){return b("span",{children:e,"aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}})}function Id(e,t){let r=e[0];return r!==void 0?t(r):null}Ko({id:"cards",label:"Cards",icon:ba("▤"),arity:"Single",isCapable:e=>!0,render:e=>Id(e,t=>b(L3e,{source:t})),capability:"always — richer with label/image semantics and summary fields"});Ko({id:"board",label:"Board",icon:ba("▥"),arity:"Single",isCapable:e=>{let t=Vr(e,void 0);return fe(t.statusField,!1,r=>Bo(e,r).length!==0)},render:e=>Id(e,t=>b(U3e,{source:t})),capability:"statusField — status/state/stage string enum (≤ 8 values) supplying the columns"});Ko({id:"calendar",label:"Calendar",icon:ba("▣"),arity:{TAG:"Multi",min:1},isCapable:e=>We(Vr(e,void 0).dateSpan),render:e=>b(j3e,{sources:e}),capability:"dateSpan — a start*/end* date-time pair or a lone non-infrastructure date field"});Ko({id:"timeline",label:"Timeline",icon:ba("▚"),arity:"Single",isCapable:e=>We(Vr(e,void 0).dateSpan),render:e=>b(V3e,{sources:e}),capability:"dateSpan — a date field to place rows on a most-recent-first chronological stream"});Ko({id:"gantt",label:"Gantt",icon:ba("▬"),arity:"Single",isCapable:e=>We(T(Vr(e,void 0).dateSpan,t=>t.endField)),render:e=>Id(e,t=>b(W3e,{source:t})),capability:"dateSpan with a declared end field — a start*/end* date-time pair; dependency connectors come from entity-ref fields whose ids point at other loaded rows"});Ko({id:"hierarchy",label:"Hierarchy",icon:ba("⑂"),arity:"Single",isCapable:e=>We(Vr(e,void 0).parentField),render:e=>Id(e,t=>b(Q3e,{source:t})),capability:"parentField — a parent*/manager/reportsTo/supervisor string field (or one annotated `parent-ref`) whose values point at other rows of the same collection"});Ko({id:"approvals",label:"Approvals",icon:ba("✓"),arity:"Single",isCapable:P3e,render:e=>Id(e,t=>b(Y3e,{source:t})),capability:"a decision enum — a small string enum named decision/outcome/verdict/approval/result, or any small enum declaring two or more approval values (approved/rejected/pending/…) — plus a date field to sequence the chain"});Ko({id:"pivot",label:"Pivot",icon:ba("⊞"),arity:"Single",isCapable:e=>We(V5(e)),render:e=>Id(e,t=>b(eDe,{source:t})),capability:"two small string enums (2–12 values) as the row and column dimensions"});Ko({id:"gallery",label:"Gallery",icon:ba("▨"),arity:"Single",isCapable:e=>We(Vr(e,void 0).imageField),render:e=>b(rDe,{sources:e}),capability:"imageField — a string field named image/imageUrl/photo/avatar/thumbnail (or annotated `image`) supplying each row's picture"});function e3(e,t){return e===t?0:e<t?-1:1}function nDe(e){return typeof e!="object"?e==="KBoolean"?[["true","Yes"],["false","No"]]:void 0:e.TAG==="KEnum"?e._0.map(t=>[t,t]):void 0}function gf(e,t){if(t===void 0)return"";let r=nt(t),n=0;if(typeof r!="object"){if(r==="JSONNull")return"";n=2}else switch(r.TAG){case"JSONString":return r._0;case"JSONNumber":return r._0.toString();case"JSONObject":return JSON.stringify(t);default:n=2}if(n===2&&typeof e!="object")switch(e){case"KBoolean":return typeof r!="object"?r==="JSONFalse"?"No":"Yes":JSON.stringify(t);case"KArrayOfStrings":if(typeof r=="object")return se(r._0,ce).join(", ");break}return typeof r!="object"?r==="JSONFalse"?"false":"true":JSON.stringify(t)}function iDe(e,t,r){let n=s=>s!==void 0?nt(s)==="JSONNull":!0,i=n(t),o=n(r);if(i)return o?0:1;if(o)return-1;if(typeof e!="object")switch(e){case"KBoolean":let s=u=>{if(u===void 0)return 0;let d=nt(u);if(typeof d=="object")return 0;switch(d){case"JSONTrue":return 1;default:return 0}};return s(t)-s(r);case"KDate":return e3(gf(e,t),gf(e,r));case"KNumber":let a=D(T(t,vs),0),l=D(T(r,vs),0);return a-l}return e3(gf(e,t),gf(e,r))}function oDe(e,t,r){if(r==="")return!0;if(typeof e=="object")return e.TAG==="KEnum"?fe(T(t,ce),!1,i=>i===r):!0;if(e!=="KBoolean")return!0;let n=W(t,nt);if(n===void 0||typeof n=="object")return!1;switch(n){case"JSONFalse":return r==="false";case"JSONTrue":return r==="true";default:return!1}}function sDe(e,t,r){if(r==="")return!0;let n=r.toLowerCase();return t.some(i=>gf(i.kind,O(e,i.key)).toLowerCase().includes(n))}function aDe(e,t,r){let n=et(r).filter(i=>i[1]!=="");return n.length===0?e:e.filter(i=>n.every(o=>{let s=o[0],a=t.find(l=>l.key===s);return a!==void 0?oDe(a.kind,O(i,s),o[1]):!0}))}function lDe(e,t,r){return r===""?e:e.filter(n=>sDe(n,t,r))}function uDe(e,t,r,n){if(r===void 0)return e;let i=t.find(s=>s.key===r);if(i===void 0)return e;let o=n==="Asc"?1:-1;return e.toSorted((s,a)=>iDe(i.kind,O(s,r),O(a,r))*o)}function cDe(e,t){return se(e,r=>{if(!kte(r.kind))return;let n=nDe(r.kind);if(n===void 0)return;let i=n.map(o=>({label:o[1],value:o[0]}));return{key:r.key,label:r.label,options:i,value:D(O(t,r.key),"")}})}function ko(e){return"var("+e+")"}let dDe=E([Ot("relative"),L("inlineFlex"),ee("center")]),fDe=E([c("background",ko(y.surface)),c("border","1px solid var("+y.border+")"),c("border-radius",ko(X.md)),c("padding","var("+F.xs+") var("+F.md+")"),c("padding-left","32px"),c("font-size",ko($.sizeMd)),c("color",ko(y.textPrimary)),c("outline","none"),c("width","240px"),la([c("border-color",ko(y.brand))]),wj([c("color",ko(y.textDisabled))])]),hDe=E([Ot("absolute"),od(ke(10)),c("color",ko(y.textDisabled)),c("font-size",ko($.sizeSm)),c("pointer-events","none")]),pDe=E([Ot("absolute"),hl(ke(8)),c("background","none"),c("border","none"),c("cursor","pointer"),c("color",ko(y.textDisabled)),c("font-size",ko($.sizeSm)),c("padding","0"),c("line-height","1"),Ye([c("color",ko(y.textSecondary))])]);function gDe(e){let t=e.placeholder,r=e.onChange,n=e.value,i=t!==void 0?t:"Search...";return M("div",{children:[b("span",{children:"/",className:hDe}),b("input",{className:fDe,placeholder:i,type:"text",value:n,onChange:o=>r(o.target.value)}),n!==""?b("button",{children:"x",className:pDe,onClick:o=>r("")}):null],className:dDe})}let K5=gDe;function Na(e){return"var("+e+")"}let mDe=E([L("flex"),ee("center"),c("gap",Na(F.sm)),pi("wrap")]),vDe=E([L("flex"),ee("center"),c("gap","4px")]),_De=E([c("color",Na(y.textSecondary)),c("font-size",Na($.sizeSm)),c("white-space","nowrap")]),bDe=E([c("background",Na(y.surface)),c("border","1px solid var("+y.border+")"),c("border-radius",Na(X.sm)),c("padding","2px var("+F.sm+")"),c("font-size",Na($.sizeSm)),c("color",Na(y.textPrimary)),c("cursor","pointer"),c("outline","none"),la([c("border-color",Na(y.brand))])]);function yDe(e){let t=e.onChange,r=e.filter;return M("div",{children:[b("span",{children:r.label+":",className:_De}),M("select",{children:[b("option",{children:"All",value:""}),r.options.map(n=>b("option",{children:n.label,value:n.value},n.value))],className:bDe,value:r.value,onChange:n=>t(r.key,n.target.value)})],className:vDe})}function xDe(e){let t=e.onSearchChange,r=e.searchValue,n=e.onFilterChange;return M("div",{children:[r!==void 0&&t!==void 0?b(K5,{value:r,onChange:t}):null,e.filters.map(i=>b(yDe,{filter:i,onChange:n},i.key))],className:mDe})}let H5=xDe;function t3(e){try{return decodeURIComponent(e)}catch{return e}}function SDe(e,t){return encodeURIComponent(e)+"/"+encodeURIComponent(t)}function r3(e){let t=e.split("/");if(t.length!==2)return[e,void 0];let r=t[0],n=t[1];return[t3(r),t3(n)]}function Ai(e){return"var("+e+")"}let EDe=E([L("flex"),he("column"),ee("center"),Qe("center"),c("gap",Ai(F.md)),fo(1),c("min-height","160px"),sa("center"),c("padding",Ai(F.lg))]),wDe=E([c("font-size","32px"),c("color",Ai(y.error)),c("line-height","1")]),kDe=E([c("color",Ai(y.textPrimary)),c("font-size",Ai($.sizeLg)),c("font-weight",Ai($.weightMedium)),yn(ke(0))]),CDe=E([c("color",Ai(y.textSecondary)),c("font-size",Ai($.sizeSm)),c("line-height",Ai($.lineHeightNormal)),yn(ke(0))]),RDe=E([c("background",Ai(y.brand)),c("color",Ai(y.textOnBrand)),c("border","none"),c("border-radius",Ai(X.md)),c("padding","var("+F.xs+") var("+F.md+")"),c("font-size",Ai($.sizeSm)),c("cursor","pointer"),xs(ke(4))]);function ADe(e){let t=e.title,r=t!==void 0?t:"Something went wrong";return M("div",{children:[b("div",{children:"X",className:wDe}),b("h3",{children:r,className:kDe}),fe(e.detail,null,n=>b("p",{children:n,className:CDe})),fe(e.onRetry,null,n=>b("button",{children:"Try again",className:RDe,onClick:i=>n()}))],className:EDe})}let Da=ADe;function Ji(e){return"var("+e+")"}let TDe=E([Ot("relative"),L("inlineBlock")]),$De=E([c("background","none"),c("border","1px solid var("+y.border+")"),c("border-radius",Ji(X.sm)),c("cursor","pointer"),c("color",Ji(y.textSecondary)),c("padding","2px var("+F.sm+")"),c("font-size",Ji($.sizeSm)),Ye([c("background",Ji(y.surfaceSubtle)),c("color",Ji(y.textPrimary))])]),NDe=E([Ot("absolute"),hl(ke(0)),aa({NAME:"percent",VAL:100}),xs(ke(4)),c("background",Ji(y.surfaceElevated)),c("border","1px solid var("+y.border+")"),c("border-radius",Ji(X.md)),c("box-shadow",Ji(pn.md)),c("min-width","160px"),c("z-index","200"),c("overflow","hidden"),Sj(ke(4),ke(0))]);function DDe(e){return E([L("block"),Uo({NAME:"percent",VAL:100}),c("background","none"),c("border","none"),c("text-align","left"),c("padding","var("+F.xs+") var("+F.md+")"),c("font-size",Ji($.sizeMd)),c("color",Ji(e?y.error:y.textPrimary)),we("pointer"),Ye([c("background",Ji(y.surfaceSubtle))])])}let FDe=E([c("border","none"),c("border-top","1px solid var("+y.borderSubtle+")"),mj(ke(4),ke(0))]);function IDe(e){let t=e.triggerLabel,r=t!==void 0?t:"...",n=oe(()=>!1),i=n[1],o=n[0];return Re(()=>{if(!o)return;let s=a=>i(l=>!1);return document.addEventListener("click",s),()=>{document.removeEventListener("click",s)}},[o]),M("div",{children:[b("button",{children:r,className:$De,onClick:s=>{s.stopPropagation(),i(a=>!a)}}),o?b("div",{children:e.items.map((s,a)=>{if(typeof s!="object")return b("hr",{className:FDe},a.toString());let l=s.onClick,u=s.label;return b("button",{children:u,className:DDe(s.danger),onClick:d=>{i(f=>!1),l()}},u)}),className:NDe,onClick:s=>{s.stopPropagation()}}):null],className:TDe})}let PDe=IDe;function W1(e){return"var("+e+")"}let ODe=E([L("grid"),c("grid-template-columns","minmax(0, 1fr) minmax(0, 1.4fr)"),c("gap",W1(F.lg)),c("align-items","start"),HD("(max-width: 720px)",[c("grid-template-columns","minmax(0, 1fr)")])]),W5=E([c("min-width","0"),c("overflow","auto")]),MDe=$n([W5,E([c("border-left","1px solid var("+y.border+")"),c("padding-left",W1(F.lg)),HD("(max-width: 720px)",[c("border-left","none"),c("padding-left","0"),c("border-top","1px solid var("+y.border+")"),c("padding-top",W1(F.lg))])])]);function LDe(e){return M("div",{children:[b("div",{children:e.master,className:W5}),b("div",{children:e.detail,className:MDe})],className:ODe})}let zDe=LDe;function Rh(e){return"var("+e+")"}let UDe=E([L("flex"),he("column"),ee("center"),Qe("center"),c("gap",Rh(F.md)),fo(1),c("min-height","160px"),c("color",Rh(y.textSecondary))]),BDe=E([c("width","32px"),c("height","32px"),c("border","3px solid var("+y.borderSubtle+")"),c("border-top-color",Rh(y.brand)),c("border-radius","50%"),c("animation","rv-spin 0.7s linear infinite")]),jDe=E([c("font-size",Rh($.sizeSm)),c("color",Rh(y.textSecondary))]);Tj("@keyframes rv-spin",[xr("from",[c("transform","rotate(0deg)")]),xr("to",[c("transform","rotate(360deg)")])]);function qDe(e){return M("div",{children:[b("div",{className:BDe}),fe(e.label,null,t=>b("span",{children:t,className:jDe}))],className:UDe})}let Of=qDe;function VDe(e,t){return D(T(O(e,t),ce),"")}function KDe(e,t,r){let n={},i=[];e.forEach(s=>{let a=VDe(s,t),l=O(n,a);l!==void 0?l.push(s):(n[a]=[s],i.push(a))});let o=s=>{if(s==="")return r.length+1|0;let a=r.indexOf(s);return a!==-1?a:r.length};return i.toSorted((s,a)=>{let l=o(s),u=o(a);return l!==u?l-u|0:s<a?-1:s>a?1:0}).map(s=>[s,D(O(n,s),[])])}function At(e){return"var("+e+")"}let G5="168px",HDe=E([L("flex"),he("column"),c("gap",At(F.sm))]),WDe=E([L("flex"),ee("center"),Qe("spaceBetween"),c("gap",At(F.sm))]),n3=E([L("inlineFlex"),ee("center"),c("gap",At(F.xs))]),mf=E([c("background","none"),c("border","1px solid var("+y.border+")"),c("border-radius",At(X.sm)),c("padding","2px var("+F.sm+")"),c("color",At(y.textSecondary)),c("font-size",At($.sizeSm)),we("pointer"),Ye([c("background",At(y.surfaceSubtle)),c("color",At(y.textPrimary))])]),GDe=$n([mf,E([c("background",At(y.surfaceSubtle)),c("color",At(y.textPrimary)),c("font-weight",At($.weightMedium))])]),JDe=E([c("font-size",At($.sizeMd)),c("font-weight",At($.weightMedium)),c("color",At(y.textPrimary))]),QDe=E([c("border","1px solid var("+y.borderSubtle+")"),c("border-radius",At(X.md)),c("overflow","hidden")]),J5=E([L("flex"),ee("stretch")]),YDe=$n([J5,E([c("background",At(y.surfaceSubtle)),c("border-bottom","1px solid var("+y.borderSubtle+")")])]),XDe=$n([J5,E([c("border-top","1px solid var("+y.borderSubtle+")")])]),ZDe=E([c("flex","0 0 "+G5),c("padding","4px var("+F.sm+")"),c("font-size",At($.sizeXs)),c("color",At(y.textSecondary)),c("text-transform","uppercase"),c("letter-spacing","0.04em")]),Q5=E([c("flex","0 0 "+G5),c("padding","6px var("+F.sm+")"),c("font-size",At($.sizeSm)),c("font-weight",At($.weightMedium)),c("color",At(y.textPrimary)),c("border-right","1px solid var("+y.borderSubtle+")"),c("overflow","hidden"),c("text-overflow","ellipsis"),c("white-space","nowrap")]),eFe=$n([Q5,E([c("color",At(y.textDisabled)),c("font-style","italic")])]);function G1(e){return E([L("grid"),c("flex","1 1 auto"),c("grid-template-columns","repeat("+e.toString()+", minmax(0, 1fr))")])}let tFe=E([c("background",At(y.surfaceSubtle))]),rFe=E([c("padding","4px var("+F.xs+")"),c("font-size",At($.sizeXs)),c("color",At(y.textSecondary)),c("border-left","1px solid var("+y.borderSubtle+")")]),Y5=E([L("flex"),he("column"),c("gap","2px"),c("min-height","48px"),c("padding","3px"),c("border-left","1px solid var("+y.borderSubtle+")")]),nFe=$n([Y5,E([c("background",At(y.surfaceSubtle))])]);function i3(e){return E([L("block"),c("width","100%"),c("text-align","left"),c("border","none"),c("border-left","3px solid "+e),c("border-radius",At(X.sm)),c("background",At(y.surfaceSubtle)),c("color",At(y.textPrimary)),c("font-size",At($.sizeXs)),c("padding","1px var("+F.xs+")"),c("overflow","hidden"),c("text-overflow","ellipsis"),c("white-space","nowrap"),we("pointer"),Ye([c("background",At(y.surfaceElevated))])])}let iFe=E([we("grab")]),oFe=E([Ws(.85),c("z-index","10"),we("grabbing")]),sFe=E([c("font-size",At($.sizeXs)),c("color",At(y.textDisabled))]),o3="var("+y.brand+")";function aFe(e){return D(e.end_,e.start)}function lFe(e,t){return e.filter(r=>WM(r.start,aFe(r),t)).toSorted((r,n)=>r.start-n.start)}function uFe(e,t){return JM(e.start)||!HM(e.start,t)?e.title:GM(e.start)+" "+e.title}function cFe(e){let t=e.draggable,r=e.event,n=T5({id:r.key,disabled:!t}),i=t?i3(D(r.accent,o3))+" "+iFe:i3(D(r.accent,o3)),o=n.isDragging?i+" "+oFe:i,s=W(F5(n.transform),u=>({transform:u})),a=n.listeners,l=a==null?void 0:pr(a);return b("button",{children:uFe(r,e.day),ref:pr(n.setNodeRef),className:o,style:s,title:r.title,onKeyDown:u=>ie(l,d=>D5(d,u)),onClick:u=>r.onOpen(),onPointerDown:u=>ie(l,d=>N5(d,u))})}function dFe(e){let t=e.draggable,r=e.today,n=e.days,i=e.lane,o=i.unassigned?"":i.resourceId,s=$5({id:o}),a=!i.unassigned&&s.isOver?G1(n.length)+" "+tFe:G1(n.length);return M("div",{children:[b("div",{children:i.label,className:i.unassigned?eFe:Q5}),b("div",{children:n.map(l=>b("div",{children:lFe(i.events,l).map(u=>b(cFe,{event:u,day:l,draggable:t},u.key)),className:l===r?nFe:Y5},l.toString())),ref:pr(s.setNodeRef),className:a})],className:XDe})}function fFe(e){let t=e.onReassign,r=e.initialDate,n=e.windowNote,i=e.lanes,o=oe(()=>"Week"),s=o[1],a=o[0],l=oe(()=>Gn(D(r,Date.now()))),u=l[1],d=l[0],f=Gn(Date.now()),h=We(t),p;p=a==="Week"?Ja(7,x=>ro(Bm(d),x)):[Gn(d)];let g=x=>u(w=>a==="Week"?ro(w,x*7|0):ro(w,x)),m=x=>{let w=x.over;if(t===void 0||w==null||w.id==="")return;let S=i.find(k=>k.events.some(A=>A.key===x.active.id));if(fe(S,!0,k=>k.resourceId!==w.id))return t(x.active.id,w.id)},v=(x,w)=>b("button",{children:w,className:a===x?GDe:mf,onClick:S=>s(k=>x)}),_;return _=a==="Week"?Gi(d):oa(d)+" — "+Gi(d),M("div",{children:[M("div",{children:[M("div",{children:[b("button",{children:"‹",className:mf,onClick:x=>g(-1)}),b("button",{children:"Today",className:mf,onClick:x=>u(w=>f)}),b("button",{children:"›",className:mf,onClick:x=>g(1)}),b("span",{children:_,className:JDe})],className:n3}),M("div",{children:[v("Week","Week"),v("Day","Day")],className:n3})],className:WDe}),b(A5,{onDragEnd:m,children:M("div",{children:[M("div",{children:[b("div",{children:"Resource",className:ZDe}),b("div",{children:p.map(x=>b("div",{children:oa(x),className:rFe},x.toString())),className:G1(p.length)})],className:YDe}),i.map(x=>b(dFe,{lane:x,days:p,today:f,draggable:h},x.unassigned?"\0unassigned":x.resourceId))],className:QDe})}),n!==void 0?b("span",{children:n,className:sFe}):null],className:HDe})}let hFe=fFe;function X5(e,t){let r=T(T(T(K(e),o=>O(o,"properties")),K),o=>O(o,t));if(r===void 0)return;let n=T(T(K(r),o=>O(o,"const")),ce);if(n!==void 0)return n;let i=ld(r);if(i!==void 0&&i.length===1)return i[0]}function Z5(e){return e.filter(t=>t.level==="Instance")}function pFe(e,t,r){return t!==void 0&&Bo(e,t).length!==0?Z5(r).some(n=>{let i=n.allowedStates;return i!==void 0?i.length!==0:!1}):!1}function gFe(e,t,r){let n=Z5(r),i=Bo(e,t),o=l=>({commandName:l.name,label:l.label,toState:X5(l.schema,t)}),s=i.map(l=>{let u=se(n,d=>{let f=d.allowedStates;if(f!==void 0&&f.includes(l))return o(d)});return{value:l,label:yt(l),terminal:u.length===0,outgoing:u}}),a=n.filter(l=>no(l.allowedStates)).map(o);return{statusField:t,states:s,anyState:a}}function tr(e){return"var("+e+")"}let mFe=E([L("flex"),he("column"),c("gap",tr(F.md))]),vFe=E([c("font-size",tr($.sizeLg)),c("font-weight",tr($.weightMedium)),c("color",tr(y.textPrimary)),yn(ke(0))]),_Fe=E([c("font-size",tr($.sizeXs)),c("color",tr(y.textDisabled))]),bFe=E([L("flex"),c("flex-wrap","wrap"),ee("flexStart"),c("gap",tr(F.md))]),yFe=E([L("flex"),he("column"),c("gap",tr(F.sm)),c("flex","0 1 240px"),c("padding",tr(F.md)),c("background",tr(y.surface)),c("border","1px solid var("+y.border+")"),c("border-radius",tr(X.md))]),xFe=E([L("flex"),ee("center"),Qe("spaceBetween"),c("gap",tr(F.sm))]),SFe=E([c("font-size",tr($.sizeXs)),c("color",tr(y.textDisabled)),c("text-transform","uppercase"),c("letter-spacing","0.04em")]),EFe=E([L("flex"),he("column"),c("gap","4px")]),wFe=E([L("inlineFlex"),ee("center"),c("gap","4px"),c("align-self","flex-start"),c("padding","2px var("+F.sm+")"),c("background",tr(y.surfaceSubtle)),c("border","1px solid var("+y.borderSubtle+")"),c("border-radius",tr(X.sm)),c("font-size",tr($.sizeSm)),c("color",tr(y.textPrimary))]),kFe=E([c("color",tr(y.textSecondary))]),CFe=E([c("font-size",tr($.sizeXs)),c("color",tr(y.textDisabled))]),RFe=E([L("flex"),he("column"),c("gap",tr(F.sm)),c("padding-top",tr(F.sm))]),AFe=E([c("font-size",tr($.sizeXs)),c("font-weight",tr($.weightMedium)),c("color",tr(y.textSecondary)),c("text-transform","uppercase"),c("letter-spacing","0.04em")]),TFe=E([L("flex"),c("flex-wrap","wrap"),c("gap","6px")]);function s3(e){let t=e.toState;return M("span",{children:[e.label,t!==void 0?b("span",{children:" → "+yt(t),className:kFe}):null],className:wFe},e.commandName)}function $Fe(e){let t=e.title,r=e.statusField,n=gFe(e.schema,r,e.commands);return M("div",{children:[t!==void 0?b("h3",{children:t,className:vFe}):null,b("div",{children:"Lifecycle on “"+yt(r)+"”",className:_Fe}),b("div",{children:n.states.map(i=>M("div",{children:[M("div",{children:[b(Zs,{variant:"Neutral",label:i.label,dot:!0}),i.terminal?b("span",{children:"end",className:SFe}):null],className:xFe}),i.terminal?b("span",{children:"No commands available",className:CFe}):b("div",{children:i.outgoing.map(s3),className:EFe})],className:yFe},i.value)),className:bFe}),n.anyState.length!==0?M("div",{children:[b("span",{children:"Any state",className:AFe}),b("div",{children:n.anyState.map(s3),className:TFe})],className:RFe}):null],className:mFe})}let NFe=$Fe;function DFe(e){switch(e){case"Hints":return"hints";case"DeclaredTarget":return"declared-target";case"SchemaTarget":return"schema-target";case"StemMatch":return"stem-match";case"Setter":return"setter"}}function FFe(e,t){return e+"→"+t}function l2(e){return D(W(T(T(K(e),t=>O(t,"properties")),K),t=>Object.keys(t)),[])}function ez(e){return se(D(T(T(K(e),t=>O(t,"required")),Vt),[]),ce)}function Qb(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[^A-Za-z0-9]+/g," ").toLowerCase().split(" ").filter(t=>t.length>=3)}function IFe(e,t,r){let n=Qb(e).concat(Qb(t)),i=Qb(r);return n.some(o=>i.some(s=>s.startsWith(o)?!0:o.startsWith(s)))}function PFe(e){return e.filter(t=>t.level==="Instance")}function Yb(e,t){let r=e.allowedStates;return r!==void 0&&r.length!==0?r.includes(t):!0}function OFe(e,t,r){return l2(e.schema).includes(t)?bt([[t,r]]):{}}function MFe(e,t){let r=e.filter(n=>l2(n.schema).includes(t)?ez(n.schema).every(i=>i===t||i==="id"?!0:ot(i,n.aggregateIdField)):!1);if(r.length===1)return r[0]}function Xb(e){if(e.length===1)return e[0]}function tz(e,t,r){let n=PFe(t),i=MFe(n,e);return(o,s)=>{let a=(h,p)=>{if(Yb(h,o))return{command:h.name,patch:OFe(h,e,s),tier:p}},l=T(T(T(r,h=>h[s]),h=>n.find(p=>p.name===h)),h=>a(h,"Hints"));if(l!==void 0)return l;let u=T(Xb(n.filter(h=>Yb(h,o)?ot(h.targetState,s):!1)),h=>a(h,"DeclaredTarget"));if(u!==void 0)return u;let d=T(Xb(n.filter(h=>Yb(h,o)?ot(X5(h.schema,e),s):!1)),h=>a(h,"SchemaTarget"));if(d!==void 0)return d;let f=T(Xb(n.filter(h=>{let p=h.allowedStates;return p!==void 0&&p.includes(o)?IFe(h.name,h.label,s):!1})),h=>a(h,"StemMatch"));return f!==void 0?f:T(i,h=>a(h,"Setter"))}}function LFe(e,t,r,n){let i=tz(t,r,n),o=Bo(e,t),s={};return o.forEach(a=>{o.forEach(l=>{if(a!==l)return ie(i(a,l),u=>{s[FFe(a,l)]=u})})}),s}let yu="resources",xu="events";function zFe(e){return e.find(t=>ot(t.role,yu))}function rz(e){return e.filter(t=>ot(t.role,xu))}function UFe(e,t){return e.toString()+"::"+t}function BFe(e){let t=e.indexOf("::");if(t!==-1)return W(_D(e.slice(0,t)),r=>[r,e.slice(t+2|0)])}function Dl(e,t){return T(O(e,t),ce)}function jFe(e){let t=zFe(e),r=rz(e),n=t!==void 0?t.rows.map(d=>{let f=D(K(d),{}),h=D(Dl(f,"id"),""),p=D(T(t.semantics.labelField,g=>Dl(f,g)),h);return[h,p]}):[],i=n.map(d=>d[0]),o=r.map((d,f)=>se(d.rows,h=>{let p=D(K(h),{}),g=D(Dl(p,"id"),""),m=d.semantics.dateSpan;if(m!==void 0)return W(T(Dl(p,m.startField),Mi),v=>{let _=T(T(m.endField,R=>Dl(p,R)),Mi),x=D(T(d.semantics.labelField,R=>Dl(p,R)),g),w=D(T(d.resourceRef,R=>Dl(p,R)),""),S=UFe(f,g),k=d.accent;return[w,{key:S,title:x,start:v,end_:_,accent:k,onOpen:()=>d.onOpenRow(g,h)}]})})).flat(),s=d=>se(o,f=>{if(d(f[0]))return f[1]}),a=n.map(d=>{let f=d[0];return{resourceId:f,label:d[1],unassigned:!1,events:s(h=>h===f)}}),l=s(d=>!i.includes(d)),u=l.length!==0?[{resourceId:"",label:"Unassigned",unassigned:!0,events:l}]:[];return a.concat(u)}function qFe(e){let t=e.sources,r=jFe(t),n=rz(t),o=n.some(a=>We(a.onCommand)&&We(a.assignCommand)?We(a.resourceRef):!1)?(a,l)=>ie(BFe(a),u=>{let d=u[1];ie(n[u[0]],f=>{let h=f.onCommand,p=f.assignCommand,g=f.resourceRef;if(h!==void 0&&p!==void 0&&g!==void 0)return h(p,d,bt([[g,l]]))})}):void 0,s=lt(n,0,(a,l)=>a+l.rows.length|0);return b(hFe,{lanes:r,windowNote:"Showing the "+s.toString()+" scheduled item(s)",onReassign:o})}let VFe=b("span",{children:"☰","aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}}),vf="scheduler";function nz(e){return We(Vr(e,void 0).dateSpan)?Yr(e).some(t=>We(Jc(t[0]))):!1}function KFe(e,t,r){return r?!1:nz(t)}function HFe(e,t){let r=e.filter(i=>i.level==="Instance").filter(i=>l2(i.schema).includes(t)?ez(i.schema).every(o=>o===t||o==="id"?!0:ot(o,i.aggregateIdField)):!1);return r.length!==1?void 0:r[0].name}function WFe(e,t,r){let n=r!==void 0?r:(o,s)=>{},i={};return Tg().filter(o=>{let s=o.arity;return typeof s!="object"?!1:s.TAG!=="Multi"}).forEach(o=>{let s={},a={},l=(u,d,f)=>{let h=O(u,d);h!==void 0?h.push(f):u[d]=[f]};e.forEach(u=>{let d=T(t,p=>$o(p,u.name)),f=D(T(d,p=>p.canvas),o.label),h=T(d,p=>p.role);if(h!==void 0)return h===yu?l(s,f,u):h===xu?ie(T(d,p=>p.resourceRef),p=>l(a,f,[u,p])):void 0}),et(a).forEach(u=>{let d=u[0],f=D(O(s,d),[]),h=f.length;if(h!==1)return h!==0?n(d,f.length):void 0;let p=f[0];u[1].forEach(g=>{i[g[0].name]={resource:p,resourceRef:g[1]}})})}),i}Ko({id:vf,label:"Scheduler",icon:VFe,arity:{TAG:"Slots",_0:[{role:yu,min:1,max:1},{role:xu,min:1}]},isCapable:nz,render:e=>b(qFe,{sources:e}),capability:"role join: a resources source (lanes) + an events source with a date span and an entity-ref to the resource"});function Xs(e){return"var("+e+")"}let b0=E([L("inlineFlex"),ee("center"),c("gap","6px"),c("background","none"),c("border","1px solid var("+y.border+")"),c("border-radius",Xs(X.full)),c("padding","2px var("+F.sm+")"),c("color",Xs(y.textSecondary)),c("font-size",Xs($.sizeXs)),c("line-height","1.5")]),Zb=E([we("pointer"),Ye([c("background",Xs(y.surfaceSubtle)),c("color",Xs(y.textPrimary))])]),GFe=E([Ws(.6),we("notAllowed")]);function u2(e){return E([L("inlineBlock"),c("width","8px"),c("height","8px"),c("border-radius","50%"),c("background",e)])}let JFe=u2(Xs(y.success)),QFe=u2(Xs(y.border)),YFe=u2(Xs(y.border)),XFe=$j([[0,[Ws(.4)]],[50,[Ws(1)]],[100,[Ws(.4)]]]),ZFe=E([L("inlineBlock"),c("width","8px"),c("height","8px"),c("border-radius","50%"),c("background",Xs(y.warning)),kj(XFe),Cj({NAME:"ms",VAL:1200}),Rj("infinite"),Aj("easeInOut")]);function eIe(e){let t=e.onToggle,r=e.reconnecting,n=e.canBeLive,i=e.live,o=r!==void 0?r:!1,s=n?i&&o?[b0+" "+Zb,ZFe,"Reconnecting…"]:i?[b0+" "+Zb,JFe,"Live"]:[b0+" "+Zb,QFe,"Snapshot"]:[b0+" "+GFe,YFe,"Off"],a=n?u=>t():void 0,l=n?i&&o?"Live updates on — reconnecting to the server":i?"Live updates on — click for snapshot mode":"Snapshot mode — click for live updates":"Live updates disabled globally";return M("button",{children:[b("span",{className:s[1]}),s[2]],className:s[0],title:l,disabled:!n,type:"button",onClick:a})}let tIe=eIe;function sf(e){return"var("+e+")"}let rIe=E([L("inlineFlex"),ee("center"),c("gap","6px"),c("background",sf(y.brand)),c("color",sf(y.textOnBrand)),c("border","none"),c("border-radius",sf(X.full)),c("padding","var("+F.xs+") var("+F.md+")"),c("font-size",sf($.sizeSm)),c("font-weight",sf($.weightMedium)),we("pointer"),Ye([c("opacity","0.85")])]),nIe=E([L("flex"),ee("center"),Qe("center"),c("padding","var("+F.xs+") 0")]);function iIe(e){let t=e.onClick,r=e.count,n=r===1?"1 new item — click to refresh":r.toString()+" new items — click to refresh";return b("div",{children:b("button",{children:n,className:rIe,type:"button",onClick:i=>t()}),className:nIe})}let oIe=iIe;function Vs(e){return"var("+e+")"}function iz(e){switch(e){case"Success":return y.success;case"Warning":return y.warning;case"Error":return y.error;case"Info":return y.info}}function sIe(e){return E([L("flex"),ee("flexStart"),c("gap",Vs(F.sm)),c("padding","var("+F.sm+") var("+F.md+")"),c("border-radius",Vs(X.md)),c("border-left","3px solid var("+iz(e)+")"),c("background",Vs(y.surfaceElevated)),c("font-size",Vs($.sizeMd)),c("line-height",Vs($.lineHeightNormal))])}function aIe(e){return E([c("color",Vs(iz(e))),c("font-size","16px"),Li(0),xs(ke(1))])}let lIe=E([fo(1)]),uIe=E([c("font-weight",Vs($.weightMedium)),c("color",Vs(y.textPrimary)),um(ke(2))]),cIe=E([c("color",Vs(y.textSecondary))]);function dIe(e){switch(e){case"Success":return"OK";case"Warning":return"!";case"Error":return"X";case"Info":return"i"}}function fIe(e){let t=e.variant,r=t!==void 0?t:"Info";return M("div",{children:[b("span",{children:dIe(r),className:aIe(r)}),M("div",{children:[fe(e.title,null,n=>b("div",{children:n,className:uIe})),b("div",{children:e.message,className:cIe})],className:lIe})],className:sIe(r),role:"alert"})}let hIe=fIe;function pIe(e,t){switch(e.TAG){case"Valid":return!0;case"Invalid":return!1;case"Pending":return!1}}function gIe(e){return pIe(e)}function c2(e){switch(e.TAG){case"Invalid":return e._1;case"Valid":case"Pending":return 0}}function mo(e){return[e._0,c2(e)]}function oz(e,t){return yD(t,e,(r,n)=>n(r))}function vo(e){switch(e.TAG){case"Invalid":return e;case"Valid":case"Pending":return{TAG:"Valid",_0:e._0}}}let a3=21;function sz(e,t,r){let n=K(e),i=D(T(T(n,a=>O(a,"data")),K),{}),o=O(i,t),s=o!==void 0?o:T(n,a=>O(a,t));return se(D(T(T(T(s,K),a=>O(a,"edges")),Vt),[]),a=>{let l=T(T(K(a),f=>O(f,"node")),K);if(l===void 0)return;let u=T(O(l,"id"),ce),d=D(T(O(l,r),ce),D(u,""));return W(u,f=>({id:f,label:d}))})}function mIe(e,t){let r=po(),n=oe(()=>({loading:!0,options:[],hasMore:!1})),i=n[1];return Re(()=>{let o={contents:!1};if(i(s=>({loading:!0,options:[],hasMore:!1})),r!==void 0){let s=t==="id"?"id":"id "+t,a="query { "+e+"(first: "+a3.toString()+") { edges { node { "+s+" } } } }";qt(r(a,{}).then(l=>{if(!o.contents){let u=sz(l,e,t),d=u.length>=a3,f=d?u.slice(0,20):u;i(h=>({loading:!1,options:f,hasMore:d}))}return Promise.resolve()}),l=>(o.contents||(console.warn("[AutoUI] RefField "+e+" fetch failed",l),i(u=>({loading:!1,options:[],hasMore:!1}))),Promise.resolve()))}else o.contents||i(s=>({loading:!1,options:[],hasMore:!1}));return()=>{o.contents=!0}},[r,e,t]),n[0]}function vIe(e,t,r){let n=po(),i=oe(()=>({loading:!1,options:[],error:!1})),o=i[1];return Re(()=>{if(r===""){o(l=>({loading:!1,options:[],error:!1}));return}let s={contents:!1};o(l=>({loading:!0,options:l.options,error:l.error}));let a=setTimeout(()=>{if(s.contents)return;if(n===void 0)return o(f=>({loading:!1,options:[],error:!1}));let l=t==="id"?"id":"id "+t,u="query($q: String!) { "+e+"(first: 20, filter: {searchPrefix: $q}) { edges { node { "+l+" } } } }",d={};d.q=r,qt(n(u,d).then(f=>{if(!s.contents){let h=sz(f,e,t);o(p=>({loading:!1,options:h,error:!1}))}return Promise.resolve()}),f=>(s.contents||(console.warn("[AutoUI] RefField "+e+" searchPrefix failed; falling back to client-side filter",f),o(h=>({loading:!1,options:[],error:!0}))),Promise.resolve()))},250);return()=>{s.contents=!0,clearTimeout(a)}},[n,r,e]),i[0]}function _Ie(e,t,r){let n=po(),i=oe(()=>{}),o=i[1];return Re(()=>{let s={contents:!1},a=0;if(n!==void 0&&t!==void 0&&t!==""){let l=r==="id"?"id":"id "+r,u="query($id: ID!) { "+e+"(id: $id) { "+l+" } }",d={};d.id=t,qt(n(u,d).then(f=>{if(!s.contents){let h=K(f),p=D(T(T(h,_=>O(_,"data")),K),{}),g=O(p,e),m=g!==void 0?g:T(h,_=>O(_,e)),v=T(m,K);if(v!==void 0){let _=D(T(O(v,"id"),ce),t),x=D(T(O(v,r),ce),_);o(w=>({id:_,label:x}))}else o(_=>{})}return Promise.resolve()}),f=>Promise.resolve())}else a=1;return a===1&&o(l=>{}),()=>{s.contents=!0}},[n,t,r]),i[0]}function cr(e){return"var("+e+")"}function _f(e){if(e==="")return[];let t=Vt(JSON.parse(e));return t!==void 0?se(t,ce):[e]}let bIe=E([Ot("relative"),Uo({NAME:"percent",VAL:100})]),l3=E([c("background",cr(y.surface)),c("border","1px solid var("+y.border+")"),c("border-radius",cr(X.sm)),c("padding","var("+F.xs+") var("+F.sm+")"),c("font-size",cr($.sizeMd)),c("color",cr(y.textPrimary)),c("outline","none"),Uo({NAME:"percent",VAL:100}),bj(ke(34)),L("flex"),ee("center"),pi("wrap"),c("gap","4px"),we("pointer"),sa("left"),la([c("border-color",cr(y.brand))])]),yIe=E([c("border-color",cr(y.brand))]),xIe=E([c("border-color",cr(y.error))]),SIe=E([c("color",cr(y.textSecondary))]),EIe=E([L("inlineFlex"),ee("center"),c("background",cr(y.surfaceSubtle)),c("border","1px solid var("+y.borderSubtle+")"),c("border-radius",cr(X.sm)),c("padding","2px 6px"),c("font-size",cr($.sizeSm)),c("gap","4px")]),wIe=E([we("pointer"),c("color",cr(y.textSecondary)),c("font-weight",cr($.weightBold))]),kIe=E([c("border","none"),c("background","transparent"),c("outline","none"),c("color",cr(y.textPrimary)),c("font-size",cr($.sizeMd)),fo(1),VD(ke(40))]),CIe=E([Ot("absolute"),aa({NAME:"percent",VAL:100}),od("zero"),hl("zero"),xs(ke(2)),c("background",cr(y.surfaceElevated)),c("border","1px solid var("+y.border+")"),c("border-radius",cr(X.sm)),c("box-shadow",cr(pn.md)),gj("none"),yn("zero"),xj("zero"),vj(ke(240)),yj("auto"),Ej(20)]),RIe=E([c("padding","var("+F.xs+") var("+F.sm+")"),we("pointer"),c("color",cr(y.textPrimary)),c("font-size",cr($.sizeMd))]),AIe=E([c("background",cr(y.surfaceSubtle))]),TIe=E([c("background",cr(y.brandSubtle))]),u3=E([c("padding","var("+F.xs+") var("+F.sm+")"),c("color",cr(y.textSecondary)),c("font-size",cr($.sizeSm))]),$Ie=(function(e,t){return e.contains(t)});function NIe(e){let t=e.getBoundingClientRect(),r=window.innerHeight-t.bottom-12,n=t.top-12,i=r<240&&n>r,s=Math.max(120,Math.min(240,i?n:r));return[i,s]}function DIe(e){let t=e.autoFocus,r=e.hasError,n=e.onBlur,i=e.onChange,o=e.value,s=e.required,a=e.multi,l=e.labelField,u=e.queryField,d=e.fieldKey,f=n!==void 0?n:()=>{},h=r!==void 0?r:!1,p=t!==void 0?t:!1,g=mIe(u,l),m=g.options,v=g.loading,_=Je(void 0),x;if(a)x="Search";else{let ye=_.current;if(ye!==void 0)x=ye;else if(v)x="Inline";else{let re=g.hasMore?"Search":"Inline";_.current=re,x=re}}let w=oe(()=>!1),S=w[1],k=w[0],A=oe(()=>0),C=A[1],R=A[0],N=oe(()=>""),I=N[1],P=N[0],z=oe(()=>[!1,240]),q=z[1],H=z[0],V=Je(null),Y=Je(null),G=a||o===""?!1:!m.some(ye=>ye.id===o),J=_Ie(e.singleQueryField,G?o:void 0,l),Q=ye=>{let re=W(m.find(Ce=>Ce.id===ye),Ce=>Ce.label),_e=T(J,Ce=>{if(Ce.id===ye)return Ce.label});return re!==void 0?re:_e!==void 0?_e:ye};Re(()=>{if(!k)return;let ye=re=>{let _e=re.target,Ce=V.current;if(Ce!=null&&!$Ie(Ce,_e))return S(Le=>!1)};return document.addEventListener("mousedown",ye),()=>{document.removeEventListener("mousedown",ye)}},[k]),pD(()=>{if(k){let ye=V.current;ye!=null&&q(re=>NIe(ye))}},[k]);let ue=x==="Search"&&P!=="",le=vIe(u,l,ue?P:""),Ae;if(P==="")Ae=m;else{let ye=P.toLowerCase();Ae=m.filter(re=>re.label.toLowerCase().startsWith(ye))}let $e=ue&&!le.error?le.options:Ae,ze=$e.length,mt=v||ue&&le.loading,be=ye=>{let re=_f(o),_e=re.some(Le=>Le===ye)?re.filter(Le=>Le!==ye):re.concat([ye]);i(d,JSON.stringify(_e.map(Le=>Le))),I(Le=>""),C(Le=>0);let Ce=Y.current;if(Ce!=null){Ce.focus();return}},Se=ye=>{let re=$e[ye];if(re!==void 0){if(a)return be(re.id);{let _e=re.id;return i(d,_e),S(Ce=>!1),I(Ce=>"")}}},st=ye=>{switch(ye.key){case"ArrowDown":return ye.preventDefault(),k?C(Le=>ze===0?0:Oo(Le+1|0,ze)):S(Le=>!0);case"ArrowUp":return ye.preventDefault(),C(Le=>ze===0?0:Oo((Le-1|0)+ze|0,ze));case"Backspace":if(!(a&&P===""))return;let _e=_f(o);if(_e.length===0)return;let Ce=_e.slice(0,_e.length-1|0);return i(d,JSON.stringify(Ce.map(Le=>Le)));case"Enter":return k?(ye.preventDefault(),Se(R)):void 0;case"Escape":return k?S(Le=>!1):void 0;default:return}},Xt=k?l3+" "+yIe:l3,wt=h?Xt+" "+xIe:Xt,Zn=()=>_f(o).map(re=>M("span",{children:[Q(re),b("span",{children:"×",className:wIe,onClick:_e=>{_e.stopPropagation(),be(re)}})],className:EIe},re)),Mr=(H[1]|0).toString()+"px",j=H[0]?{bottom:"100%",marginTop:"0",marginBottom:"2px",maxHeight:Mr,top:"auto"}:{maxHeight:Mr},me;if(mt)me=b("li",{children:"Loading…",className:u3});else if(ze===0)me=b("li",{children:P===""?"No options":"No matches",className:u3});else{let ye=a?_f(o):o===""?[]:[o];me=$e.map((re,_e)=>{let Ce=ye.some(Ze=>Ze===re.id),He=O9([[RIe],_e===R?[AIe]:[],Ce?[TIe]:[]]).join(" ");return b("li",{children:re.label,"aria-selected":Ce,className:He,role:"option",onMouseDown:Ze=>{Ze.preventDefault(),Se(_e)},onMouseEnter:Ze=>C(dt=>_e)},re.id)})}let Ue=b("ul",{children:me,className:CIe,role:"listbox",style:j}),Fe;return Fe=x==="Inline"?b("button",{children:o===""?b("span",{children:s?"Select…":"—",className:SIe}):Q(o),className:wt,autoFocus:p,type:"button",onKeyDown:st,onBlur:ye=>f(),onClick:ye=>S(re=>!re)}):M("div",{children:[a?Zn():null,b("input",{ref:pr(Y),className:kIe,autoFocus:p,placeholder:s?"Search…":"—",type:"text",value:a||k?P:o===""?"":Q(o),onKeyDown:st,onFocus:ye=>S(re=>!0),onBlur:ye=>f(),onChange:ye=>{let re=ye.target.value;I(_e=>re)}})],className:wt,onClick:ye=>S(re=>!0)}),M("div",{children:[Fe,k?Ue:null],ref:pr(V),className:bIe})}let FIe=DIe;function az(e){if(!e.includes("."))return e;let t=e.replace(/0+$/,"");return t.endsWith(".")?t.slice(0,t.length-1|0):t}function IIe(e){return t=>{let r=mo(t),n=r[0];return n>=e?vo(t):{TAG:"Invalid",_0:n,_1:{hd:"Must be at least "+az(e.toString()),tl:r[1]}}}}function PIe(e){return t=>{let r=mo(t),n=r[0];return n<=e?vo(t):{TAG:"Invalid",_0:n,_1:{hd:"Must be at most "+az(e.toString()),tl:r[1]}}}}function OIe(e){let t=mo(e),r=t[0];return isFinite(r)&&(r|0)===r?vo(e):{TAG:"Invalid",_0:r,_1:{hd:"Must be a whole number",tl:t[1]}}}let MIe="Must not be empty";function LIe(e){let t=mo(e),r=t[0];return r.length>0?vo(e):{TAG:"Invalid",_0:r,_1:{hd:MIe,tl:t[1]}}}let zIe=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function UIe(e){let t=mo(e),r=t[0];return zIe.exec(r)!==null?vo(e):{TAG:"Invalid",_0:r,_1:{hd:"Must be a valid email address",tl:t[1]}}}function BIe(e){let t=mo(e),r=t[0],n;try{new URL(r),n=!0}catch{n=!1}return n?vo(e):{TAG:"Invalid",_0:r,_1:{hd:"Must be a valid URL",tl:t[1]}}}let jIe=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function qIe(e){let t=mo(e),r=t[0];return jIe.exec(r)!==null?vo(e):{TAG:"Invalid",_0:r,_1:{hd:"Must be a valid UUID",tl:t[1]}}}let VIe=/^c[a-z0-9]{23,24}$/;function KIe(e){let t=mo(e),r=t[0];return VIe.exec(r)!==null?vo(e):{TAG:"Invalid",_0:r,_1:{hd:"Must be a valid CUID",tl:t[1]}}}function HIe(e){let t=mo(e),r=t[0],n=Date.parse(r);return Number.isNaN(n)?{TAG:"Invalid",_0:r,_1:{hd:"Must be a valid ISO 8601 date-time",tl:t[1]}}:vo(e)}function WIe(e){return t=>{let r=mo(t),n=r[0];return n.length>=e?vo(t):{TAG:"Invalid",_0:n,_1:{hd:"Must be at least "+e.toString()+" characters",tl:r[1]}}}}function GIe(e){return t=>{let r=mo(t),n=r[0];return n.length<=e?vo(t):{TAG:"Invalid",_0:n,_1:{hd:"Must be at most "+e.toString()+" characters",tl:r[1]}}}}function JIe(e,t){return r=>{let n=mo(r),i=n[0];return e.exec(i)!==null?vo(r):{TAG:"Invalid",_0:i,_1:{hd:D(t,"Does not match the required pattern"),tl:n[1]}}}}function QIe(e){let t=c2(e);if(t!==0)return t.hd}function YIe(e){switch(e){case"Email":return UIe;case"Url":return BIe;case"Uuid":return qIe;case"Cuid":return KIe;case"DateTime":return HIe}}function XIe(e,t,r){if(e==="")return t?LIe({TAG:"Pending",_0:e}):{TAG:"Valid",_0:e};let n=[];return ie(r.minLength,i=>{n.push(WIe(i))}),ie(r.maxLength,i=>{n.push(GIe(i))}),ie(r.format,i=>{n.push(YIe(i))}),ie(r.pattern,i=>{n.push(JIe(i,r.patternHint))}),n.length===0?{TAG:"Valid",_0:e}:oz({TAG:"Pending",_0:e},ux(n))}function ZIe(e,t,r){if(e==="")return t?{TAG:"Invalid",_0:e,_1:{hd:"Required",tl:0}}:{TAG:"Valid",_0:e};let n=Ya(e);if(n===void 0)return{TAG:"Invalid",_0:e,_1:{hd:"Must be a number",tl:0}};let i=[];D(r.integer,!1)&&i.push(OIe),ie(r.min,a=>{i.push(IIe(a))}),ie(r.max,a=>{i.push(PIe(a))});let o=oz({TAG:"Pending",_0:n},ux(i)),s=c2(o);return s!==0?{TAG:"Invalid",_0:e,_1:s}:{TAG:"Valid",_0:e}}function ePe(e,t,r){let i=_f(e).length;if(i===0&&t)return{TAG:"Invalid",_0:e,_1:{hd:"Required",tl:0}};let o={contents:0};return ie(r.maxItems,a=>{if(i>a){o.contents={hd:"Select at most "+a.toString()+" items",tl:o.contents};return}}),ie(r.minItems,a=>{if(i<a&&(t||i>0)){o.contents={hd:"Select at least "+a.toString()+" items",tl:o.contents};return}}),o.contents!==0?{TAG:"Invalid",_0:e,_1:o.contents}:{TAG:"Valid",_0:e}}function c3(e,t){return t&&e===""?{TAG:"Invalid",_0:e,_1:{hd:"Required",tl:0}}:{TAG:"Valid",_0:e}}function tPe(e,t){let r=e.propSchema;if(r!==void 0&&Zee(e.key,r)){let i=e.fieldType,o;if(typeof i!="object")o=!1;else switch(i.TAG){case"TextField":case"NumberField":o=i.required;break;case"EnumField":o=i.required;break;case"RefField":o=i.required;break}let s=tte(e.key,r,t,o);return s!==void 0?{TAG:"Invalid",_0:t,_1:{hd:s,tl:0}}:{TAG:"Valid",_0:t}}let n=e.fieldType;if(typeof n!="object")return{TAG:"Valid",_0:t};switch(n.TAG){case"TextField":return XIe(t,n.required,n.constraints);case"NumberField":return ZIe(t,n.required,n.constraints);case"EnumField":return c3(t,n.required);case"RefField":return n.multi?ePe(t,n.required,n.constraints):c3(t,n.required)}}function Hg(e,t){let r=W(O(e,t),nt);if(typeof r=="object"&&r.TAG==="JSONNumber")return r._0|0}function d3(e,t){let r=W(O(e,t),nt);if(typeof r=="object"&&r.TAG==="JSONNumber")return r._0}function Wg(e,t){let r=W(O(e,t),nt);if(typeof r=="object"&&r.TAG==="JSONString")return r._0}function rPe(e){let t=Wg(e,"format");if(Wg(e,"x-reventless-format")==="cuid")return"Cuid";if(t!==void 0)switch(t){case"date-time":return"DateTime";case"email":return"Email";case"uri":return"Url";case"uuid":return"Uuid";default:return}}function nPe(e){let t=Hg(e,"minLength"),r=Hg(e,"maxLength"),n=W(Wg(e,"pattern"),s=>new RegExp(s)),i=rPe(e),o=Wg(e,"description");return{minLength:t,maxLength:r,pattern:n,format:i,patternHint:o}}function f3(e,t){let r=d3(e,"minimum"),n=d3(e,"maximum");return{min:r,max:n,integer:t}}function iPe(e){let t=Hg(e,"minItems"),r=Hg(e,"maxItems");return{minItems:t,maxItems:r}}function oPe(e,t){let r=t!==void 0?t:[],n={};r.forEach(d=>{n[d.propertyKey]=d});let i=nt(e);if(typeof i!="object")return[];if(i.TAG!=="JSONObject")return[];let o=i._0,s=O(o,"required"),a;if(s!==void 0){let d=nt(s);a=typeof d!="object"?[]:d.TAG==="JSONArray"?se(d._0,f=>{let h=nt(f);if(!(typeof h!="object"||h.TAG!=="JSONString"))return h._0}):[]}else a=[];let l=O(o,"properties");if(l===void 0)return[];let u=nt(l);return typeof u!="object"?[]:u.TAG==="JSONObject"?se(et(u._0),d=>{let f=d[1],h=d[0],p=nt(f);if(typeof p!="object"||p.TAG!=="JSONObject")return;let g=p._0;if(We(O(g,"const")))return;let m=O(g,"type"),v;if(m!==void 0){let C=nt(m);v=typeof C!="object"||C.TAG!=="JSONString"?"string":C._0}else v="string";let _=a.some(C=>C===h),x=O(n,h),w;if(x!==void 0)w=x.multi?x.entityNamePlural:x.entityName;else{let C=O(g,"title");if(C!==void 0){let R=nt(C);w=typeof R!="object"||R.TAG!=="JSONString"?yt(h):R._0}else w=yt(h)}let S=O(g,"enum"),k;if(S!==void 0){let C=nt(S);k=typeof C!="object"||C.TAG!=="JSONArray"?void 0:se(C._0,R=>{let N=nt(R);if(!(typeof N!="object"||N.TAG!=="JSONString"))return N._0})}else k=void 0;let A;if(x!==void 0)A={TAG:"RefField",queryField:x.queryField,singleQueryField:x.singleQueryField,labelField:x.labelField,multi:x.multi,required:_,constraints:x.multi?iPe(g):{}};else if(v==="boolean")A="BoolField";else if(k!==void 0)A={TAG:"EnumField",options:k,required:_};else switch(v){case"integer":A={TAG:"NumberField",required:_,constraints:f3(g,!0)};break;case"number":A={TAG:"NumberField",required:_,constraints:f3(g,!1)};break;default:A={TAG:"TextField",required:_,constraints:nPe(g)}}return W(A,C=>({key:h,label:w,fieldType:C,propSchema:f}))}):[]}function sPe(e){let t={};return e.forEach(r=>{let n=r.fieldType,i;i=typeof n!="object"?"false":n.TAG==="EnumField"?D(n.options[0],""):"",t[r.key]=i}),t}function dn(e){return"var("+e+")"}let aPe=E([L("flex"),he("column"),c("gap",dn(F.md))]),lPe=E([L("flex"),he("column"),c("gap","4px")]),h3=E([c("color",dn(y.textSecondary)),c("font-size",dn($.sizeSm)),c("font-weight",dn($.weightMedium))]),uPe=E([c("color",dn(y.error)),$h(ke(2))]),p3=E([c("background",dn(y.surface)),c("border","1px solid var("+y.border+")"),c("border-radius",dn(X.sm)),c("padding","var("+F.xs+") var("+F.sm+")"),c("font-size",dn($.sizeMd)),c("color",dn(y.textPrimary)),c("outline","none"),Uo({NAME:"percent",VAL:100}),c("transition","border-color 120ms, box-shadow 120ms"),la([c("border-color",dn(y.brand))])]),cPe=E([c("border-color",dn(y.error)),la([c("border-color",dn(y.error)),c("box-shadow","0 0 0 2px color-mix(in srgb, var("+y.error+") 25%, transparent)")])]),dPe=E([c("color",dn(y.error)),c("font-size",dn($.sizeXs)),c("min-height","1.1em"),c("line-height","1.1"),xs(ke(2))]),fPe=E([we("pointer"),qD(ke(6))]),g3=E([c("background",dn(y.brand)),c("color",dn(y.textOnBrand)),c("border","none"),c("border-radius",dn(X.sm)),c("padding","var("+F.xs+") var("+F.md+")"),c("font-size",dn($.sizeMd)),we("pointer"),pj("flexStart"),c("transition","opacity 120ms")]),hPe=E([Ws(.5),we("notAllowed")]);function pPe(e){let t=e.autoFocus,r=e.showError,n=e.errorMessage,i=e.onBlur,o=e.onChange,s=e.value,a=e.field,l=r!==void 0?r:!1,u=t!==void 0?t:!1,d=a.fieldType,f;if(typeof d!="object")f=!1;else switch(d.TAG){case"TextField":case"NumberField":f=d.required;break;case"EnumField":f=d.required;break;case"RefField":f=d.required;break}let h=l&&We(n),p=h?p3+" "+cPe:p3,g=x=>i(a.key),m=a.propSchema,v=m!==void 0?ete(a.key,m,s,x=>o(a.key,x),()=>i(a.key),f,h):void 0,_;if(v!==void 0)_=v;else{let x=a.fieldType;if(typeof x!="object")_=M("label",{children:[b("input",{className:fPe,checked:s==="true",type:"checkbox",onBlur:g,onChange:w=>o(a.key,w.target.checked?"true":"false")}),"Enabled"],className:h3});else switch(x.TAG){case"TextField":let w=x.constraints.format,S;if(w!==void 0)switch(w){case"Email":S="email";break;case"Url":S="url";break;default:S="text"}else S="text";_=b("input",{className:p,autoFocus:u,type:S,value:s,onBlur:g,onChange:k=>o(a.key,k.target.value)});break;case"NumberField":_=b("input",{className:p,autoFocus:u,type:"number",value:s,onBlur:g,onChange:k=>o(a.key,k.target.value)});break;case"EnumField":_=b("select",{children:x.options.map(k=>b("option",{children:k,value:k},k)),className:p,value:s,onBlur:g,onChange:k=>o(a.key,k.target.value)});break;case"RefField":_=b(FIe,{fieldKey:a.key,queryField:x.queryField,singleQueryField:x.singleQueryField,labelField:x.labelField,multi:x.multi,required:x.required,value:s,onChange:o,onBlur:()=>i(a.key),hasError:h,autoFocus:u});break}}return M("div",{children:[M("label",{children:[a.label,f?b("span",{children:"*",className:uPe}):null],className:h3}),_,b("div",{children:h?D(n,""):null,className:dPe})],className:lPe})}function gPe(e){let t=e.refFields,r=e.initialValues,n=e.submitLabel,i=e.onSubmit,o=e.schema,s=n!==void 0?n:"Submit",a=t!==void 0?t:[],l=Lt(()=>oPe(o,a),[o,a]),u=oe(()=>D(r,sPe(l))),d=u[1],f=u[0],h=oe(()=>({})),p=h[1],g=h[0],m=oe(()=>!1),v=m[1],_=m[0],x=Lt(()=>l.map(I=>{let P=D(O(f,I.key),"");return[I.key,tPe(I,P)]}),[l,f]),w=x.every(I=>gIe(I[1])),S={};x.forEach(I=>{let P=QIe(I[1]);if(P!==void 0){S[I[0]]=P;return}});let k=(I,P)=>d(z=>{let q=bt(et(z));return q[I]=P,q}),A=I=>p(P=>{let z=bt(et(P));return z[I]=!0,z}),C=I=>{if(I.preventDefault(),v(P=>!0),w)return i(f)},R=_&&!w,N=R?g3+" "+hPe:g3;return M("form",{children:[l.map((I,P)=>{let z=D(O(g,I.key),!1);return b(pPe,{field:I,value:D(O(f,I.key),""),onChange:k,onBlur:A,errorMessage:O(S,I.key),showError:z||_,autoFocus:P===0},I.key)}),b("button",{children:s,className:N,disabled:R,type:"submit"})],className:aPe,noValidate:!0,onSubmit:C})}let mPe=gPe;function vPe(e){return"var("+e+")"}let _Pe=E([L("flex"),he("column"),c("gap",vPe(F.md))]);function bPe(e){let t=e.submitLabel,r=e.onSubmit,n=e.refFields,i=e.injectNewId,o=e.aggregateIdField,s=e.aggregateId,a=e.schema,l=i!==void 0?i:!1,u=n!==void 0?n:[],d=t!==void 0?t:"Submit",f=oe(()=>{}),h=f[1],p=oe(()=>!1),g=p[1],v=oe(()=>crypto.randomUUID())[0],_=S=>{let k=bt(et(S));ie(s,A=>{k[D(o,"id")]=A}),l&&(k[D(o,"id")]=v),g(A=>!0),h(A=>{}),r(k).then(A=>{if(g(C=>!1),typeof A=="object"){let C=A._0;h(R=>C)}return Promise.resolve()})},x=s!==void 0?o!==void 0||l?o:void 0:l?o:void 0,w=x!==void 0?D(W(K(a),S=>{let k=bt(et(S));return ie(T(O(k,"properties"),K),A=>{let C=bt(et(A).filter(R=>R[0]!==x));k.properties=C}),k}),a):a;return M("div",{children:[fe(f[0],null,S=>b(hIe,{variant:"Error",message:S})),p[0]?b(Of,{label:"Submitting..."}):null,b(mPe,{schema:w,onSubmit:_,submitLabel:d,refFields:u})],className:_Pe})}let d2=bPe;function yPe(e){let t={},r=e.startsWith("?")?e.slice(1):e;return r===""||r.split("&").forEach(n=>{let i=n.split("="),o=i.length;if(!(o>=3))switch(o){case 0:return;case 1:let s=i[0];if(s!==""){t[decodeURIComponent(s)]="";return}else return;case 2:let a=i[0],l=i[1];if(a!==""){t[decodeURIComponent(a)]=decodeURIComponent(l);return}else return}}),t}function xPe(e,t){return e===t?0:e<t?-1:1}function lz(e){let t=et(e).filter(r=>r[1]!=="").toSorted((r,n)=>xPe(r[0],n[0]));return t.length===0?"":"?"+t.map(r=>encodeURIComponent(r[0])+"="+encodeURIComponent(r[1])).join("&")}function SPe(e){if(e.path===0)return"/";let r=[];return P9(e.path,n=>{r.push(n)}),"/"+r.join("/")}function m3(e,t){let r=t.filter(o=>o[1]==="").map(o=>o[0]),n=t.filter(o=>o[1]!==""),i=et(e).filter(o=>{let s=o[0];return r.includes(s)?!1:!n.some(a=>a[0]===s)});return bt(i.concat(n))}function EPe(){let e=S9(),t=yPe(e.search),r=SPe(e),n=e.hash===""?"":"#"+e.hash,i=l=>{let u=lz(l);Oc(r+u+n)};return{params:t,get:l=>O(t,l),set:(l,u)=>i(m3(t,[[l,u]])),setMany:l=>i(m3(t,l))}}function Ev(e){let t=e.isId||e.isCompositeId||e.isSubId||e.isCompositeSubId||We(e.index)||e.scan,r=e.isId||e.isSubId||e.isCompositeSubId||We(e.index)||e.scanSort;return{filter:t,sort:r}}function v3(e){return Ev(e.ann)}function uz(e){let t=We(Fq(e)),r=cm(e).length!==0,n=yx(e).length!==0;return{search:t||r||n}}function J1(e){let r=D(W(T(T(K(e),s=>O(s,"properties")),K),et),[]).map(s=>Ev(nu(s[1]))),n=r.some(s=>s.filter),i=r.some(s=>s.sort),o=uz(e);return{hasFilter:n,hasSort:i,hasSearch:o.search}}function _3(e,t){let r={},n={};return et(e).forEach(i=>{let o=i[1];if(o==="")return;let s=i[0],a=t.find(l=>l.key===s);if(a!==void 0){Ev(a.ann).filter?r[s]=o:n[s]=o;return}n[s]=o}),[r,n]}function b3(e,t,r){if(e===void 0)return"NoSort";let n=r.find(i=>i.key===e);return n!==void 0?Ev(n.ann).sort?{TAG:"ServerSort",_0:e,_1:t}:{TAG:"ClientSort",_0:e,_1:t}:"NoSort"}function wPe(e,t,r,n){let i={};if(r.search&&t!==""&&(i.search=t),et(e).forEach(o=>{let s=o[1],a=o[0],l=n.find(f=>f.key===a),u=W(l,f=>f.kind),d;if(u!==void 0&&typeof u!="object")switch(u){case"KBoolean":d=s==="true";break;case"KNumber":d=D(W(Ya(s),f=>f),s);break;default:d=s}else d=s;i[a+"Eq"]=d}),et(i).length!==0)return i}function kPe(e){if(typeof e!="object"||e.TAG!=="ServerSort")return;let t=e._1==="Asc"?"ASC":"DESC";return bt([["field",e._0],["direction",t]])}let CPe=bt([["ProductsNotAvailable",{template:"These products aren't available yet: {{missing}}.",idFields:[{field:"missing",entityStem:"product"}]}],["OrderAlreadyPlaced",{template:"This order has already been placed.",idFields:[]}],["CategoryAlreadyArchived",{template:"This category is already archived.",idFields:[]}]]);function RPe(e,t){return e!==void 0?t!==void 0?t+" ("+e+")":"Command rejected: "+e:t!==void 0?t:"Command rejected"}function y3(e,t){return fe(T(K(e),r=>O(r,t)),[],r=>{let n=nt(r);if(typeof n!="object")return[];switch(n.TAG){case"JSONString":let i=n._0;return i!==""?[i]:[];case"JSONArray":return se(n._0,ce).filter(o=>o!=="");default:return[]}})}function APe(e){return T(e,t=>{try{return JSON.parse(t)}catch{return}})}function x3(e,t){return lt(et(t),e,(r,n)=>r.replaceAll("{{"+n[0]+"}}",n[1]))}function TPe(e,t,r,n){let i=ua(t,r);if(i===void 0)return Promise.resolve(n);let o=i.queryField,s=i.labelField,a=s==="id"?"id":"id "+s,l="query($ids: [ID!]) { "+o+"(first: "+n.length.toString()+", filter: {ids: $ids}) { edges { node { "+a+" } } } }",u={};return u.ids=n.map(d=>d),qt(e(l,u).then(d=>{let f=$6(d,o,s);return Promise.resolve(n.map(h=>{let p=O(f,h);return p!==void 0?p:h}))}),d=>Promise.resolve(n))}function wv(e,t,r,n){let i=RPe(r,n);if(r===void 0)return Promise.resolve(i);let o=O(CPe,r);if(o===void 0)return Promise.resolve(i);if(o.idFields.length===0)return Promise.resolve(o.template);let s=APe(n);if(s===void 0)return Promise.resolve(o.template);if(e!==void 0){let l=o.idFields.map(u=>{let d=u.field,f=y3(s,d);return f.length===0?Promise.resolve([d,""]):TPe(e,t,u.entityStem,f).then(h=>Promise.resolve([d,h.join(", ")]))});return Promise.all(l).then(u=>{let d={};return u.forEach(f=>{d[f[0]]=f[1]}),Promise.resolve(x3(o.template,d))})}let a={};return o.idFields.forEach(l=>{let u=l.field,d=y3(s,u);a[u]=d.join(", ")}),Promise.resolve(x3(o.template,a))}function $Pe(e){let t=e.resource,r=_u(t,void 0),n=t.name,i=r.rows,o=t.schema,s=e.resourceSemantics,u={readModelName:n,rows:i,schema:o,semantics:s,onOpenRow:(A,C)=>{},role:yu},d=e.eventReadModelName,f=e.eventRows,h=e.eventSchema,p=e.eventSemantics,g=e.eventAccent,m=e.onOpenEvent,v=e.onCommand,_=xu,x=e.resourceRef,w=e.assignCommand,S={readModelName:d,rows:f,schema:h,semantics:p,accent:g,onOpenRow:m,onCommand:v,role:_,resourceRef:x,assignCommand:w},k=r.fetchState;return typeof k!="object"?k==="Loading"?b(Of,{}):e.mode.render([u,S]):b(Da,{detail:k._0,onRetry:()=>r.refetch()})}let NPe=$Pe,cz=mr(void 0),DPe=cz.Provider;function FPe(e){return Ar(DPe,{value:e.refresh,children:e.children})}let S3={make:FPe};function IPe(){return Ut(cz)}function E3(e){try{return ms(localStorage.getItem(e))}catch{return}}function w3(e,t){try{return localStorage.setItem(e,t)}catch{return}}let k3={hasNextPage:!1,hasPreviousPage:!1,startCursor:void 0,endCursor:void 0};function dr(e){return"var("+e+")"}let ey=E([L("flex"),he("column"),c("gap",dr(F.lg))]),C3=E([L("flex"),ee("center"),Qe("spaceBetween"),c("margin-bottom",dr(F.sm))]),PPe=E([c("font-size",dr($.sizeXl)),c("font-weight",dr($.weightMedium)),c("color",dr(y.textPrimary)),yn(ke(0))]),OPe=E([L("flex"),c("gap",dr(F.sm))]),MPe=E([L("flex"),he("column"),c("gap",dr(F.lg))]),LPe=E([L("flex"),he("column"),c("gap",dr(F.sm))]),zPe=E([c("font-size",dr($.sizeSm)),c("font-weight",dr($.weightMedium)),c("color",dr(y.textSecondary)),c("text-transform","uppercase"),c("letter-spacing","0.04em"),yn(ke(0))]),UPe=E([c("background",dr(y.brand)),c("color",dr(y.textOnBrand)),c("border","none"),c("border-radius",dr(X.md)),c("padding","var("+F.xs+") var("+F.md+")"),c("font-size",dr($.sizeSm)),c("cursor","pointer")]),BPe=E([L("inlineFlex"),ee("center"),c("gap","4px"),c("background","none"),c("border","none"),c("padding","0"),c("color",dr(y.brand)),c("font-size",dr($.sizeSm)),we("pointer"),c("text-decoration","none"),Ye([c("text-decoration","underline")])]),jPe=E([L("flex"),ee("center"),Qe("flexEnd"),c("gap",dr(F.xs)),c("padding-top",dr(F.sm))]),R3=E([c("background","none"),c("border","1px solid var("+y.border+")"),c("border-radius",dr(X.sm)),c("padding","2px var("+F.sm+")"),c("color",dr(y.textSecondary)),c("font-size",dr($.sizeSm)),we("pointer"),Ye([c("background",dr(y.surfaceSubtle)),c("color",dr(y.textPrimary))]),WD([c("opacity","0.4"),we("notAllowed")])]);function qPe(e,t){let r=D(T(T(K(e),i=>O(i,"properties")),K),{}),n={};return et(t).forEach(i=>{let o=i[1],s=i[0],a=D(T(T(T(O(r,s),K),d=>O(d,"type")),ce),"string"),l,u=0;switch(a){case"array":if(o==="")l=[];else try{l=JSON.parse(o)}catch{l=[o]}break;case"boolean":l=o==="true";break;case"integer":case"number":u=1;break;case"object":if(o==="")l=null;else try{l=JSON.parse(o)}catch{l=null}break;default:l=o}u===1&&(l=D(W(Ya(o),d=>d),o)),n[s]=l}),n}let A3={contents:[]},T3={contents:[]};function VPe(e,t,r){let n=D(e,"<no-plugin>")+"."+t+"."+r;if(!A3.contents.some(i=>i===n)){A3.contents.push(n),console.warn("[AutoUI] Read model "+t+' declared statusField="'+r+`" but the list-view rows don't include that field; per-row command filtering is disabled.`);return}}function KPe(e,t,r){let n=D(e,"<no-plugin>")+"."+t;if(!T3.contents.some(i=>i===n)){T3.contents.push(n),console.warn("[AutoUI] Read model "+t+' statusField="'+r+'" value is neither a string nor a TAG-shaped object; per-row command filter cannot match against allowedStates.');return}}let $3={contents:[]};function HPe(e,t){let r=D(e,"<no-plugin>")+"."+t;if(!$3.contents.some(n=>n===r)){$3.contents.push(r),console.warn("[AutoUI] Read model "+t+" produced duplicate row keys — row identity is ambiguous and row clicks may open the wrong row. Give each row a unique id, or annotate the distinguishing field with @subId.");return}}function WPe(e){let t=e.schedulerJoin,r=e.uiHints,n=e.liveDefault,i=e.sortKeyField,o=e.byIdsQueryDocument,s=e.byIdsQueryField,a=e.detailQueryDocument,l=e.singleQueryField,u=e.drillPath,d=e.openRowId,f=e.pluginId,h=e.detailView,p=e.rows,g=e.readModel,m=u!==void 0?u:[],v=n!==void 0?n:!0,_=po(),x=oe(()=>[]),w=x[1],S=x[0],k=oe(()=>"Loading"),A=k[1],C=k[0],R=oe(()=>0),N=R[1],I=oe(()=>{}),P=I[1],z=oe(()=>{}),q=z[1],H=z[0],V=oe(()=>({})),Y=V[1],G=V[0],J=oe(()=>"Loaded"),Q=J[1],ue=J[0],le=oe(()=>k3),Ae=le[1],$e=le[0],ze=oe(()=>{}),mt=ze[1],be=ze[0],Se=Zh(),st=fe(Se,!1,B=>B.isLive(g.queryField)),Xt="reventless.live."+D(f,"default")+"."+g.name,wt=oe(()=>{let B=E3(Xt);if(B===void 0)return v;switch(B){case"false":return!1;case"true":return!0;default:return v}}),Zn=wt[1],Mr=wt[0],j=()=>{let B=!Mr;w3(Xt,B?"true":"false"),Zn(ae=>B)},me=st&&Mr,Ue=T(r,B=>$o(B,g.name)),Fe=L6(g.schema,Ue),ye=fe(T(Ue,B=>B.suppress),!1,B=>B.includes(vf)),re;if(t!==void 0&&KFe(!0,g.schema,ye)){let B=N6(vf);re=B!==void 0&&!Fe.some(ae=>ae.id===B.id)?Fe.concat([B]):Fe}else re=Fe;let _e=F6(f,g.name,void 0),Ce=oe(()=>NS(_e)),Le=Ce[1],He=B=>{D6(_e,B),Le(ae=>B)},Ze=z6(Ce[0],Ue,rF(g.schema),re),dt=t!==void 0&&Ze!==void 0?Ze.id===vf:!1,wr=We(h)&&!dt,Ge="reventless.layout."+D(f,"default")+"."+g.name,Xe=oe(()=>E3(Ge)),vr=Xe[1],kr=Qte(Xe[0],Ue,Oq(g.schema),wr),Lr=Se!==void 0&&me?Se.statusFor(Pg(g.queryField))!=="Open":!1,or=oe(()=>0),Ln=or[1],_o=or[0],_i=Je({}),Jo=Je(void 0),ya=Je(new Map),xl=B=>{ya.current.set(B,Date.now())},Qo=B=>{let ae=ya.current.get(B);return ae!==void 0?Date.now()-ae<6e4:!1},sr=EPe(),Sl=lz(sr.params),El=dl(),_r=W(f,B=>zs(wa(B,g.name))+Sl),nr=xx(g.schema),br=B=>W(T(O(B,"id"),ce),ae=>{let ve=T(nr,pe=>T(O(B,pe),ce));return ve!==void 0?SDe(ae,ve):ae}),zn=B=>nr!==void 0?r3(B)[0]:B,Xr=B=>{if(nr===void 0)return bt([["id",B]]);let ae=r3(B),ve=ae[1],pe=ae[0];return bt(ve!==void 0?[["id",pe],["subId",ve]]:[["id",pe]])},Ct=d!==void 0?d:H,Hr=B=>f!==void 0?El(ea(f,g.name,B,[])+Sl):q(ae=>B),bo=()=>_r!==void 0?El(_r):q(B=>{}),ar=J1(g.schema),ei=uz(g.schema),Un=ar.hasFilter||ar.hasSort||ar.hasSearch,Bn;if(Un){let B=[];et(sr.params).forEach(ae=>{let ve=ae[1];if(ve==="")return;let pe=ae[0];if(pe==="after"||pe==="before"||pe==="sort"||pe==="dir"){B.push(pe+"="+ve);return}if(pe==="q"&&ei.search){B.push(pe+"="+ve);return}if(!pe.startsWith("f."))return;let Ie=pe.slice(2);if((Be=>fe(Be.find(Et=>Et.key===Ie),!1,Et=>v3(Et).filter))(wi(g.schema,void 0))){B.push(pe+"="+ve);return}}),Bn=B.toSorted((ae,ve)=>ae===ve?0:ae<ve?-1:1).join("|")}else Bn="";Re(()=>{if(_!==void 0){A(ae=>"Loading"),Y(ae=>({}));let B;if(Un){let ae=wi(g.schema,void 0),ve={};et(sr.params).forEach(jn=>{let qu=jn[0];if(qu.startsWith("f.")){ve[qu.slice(2)]=jn[1];return}});let pe=_3(ve,ae),Ie=D(sr.get("q"),""),Te=wPe(pe[0],Ie,ei,ae),Et=sr.get("dir")==="desc"?"Desc":"Asc",zr=b3(sr.get("sort"),Et,ae),Wr=kPe(zr),xn={};ie(Te,jn=>{xn.filter=jn}),ie(Wr,jn=>{xn.orderBy=jn});let $r=sr.get("before"),Sn=0;$r!==void 0&&$r!==""?(xn.before=$r,xn.last=50):Sn=1,Sn===1&&(xn.first=50,ie(sr.get("after"),jn=>{if(jn!==""){xn.after=jn;return}})),B=xn}else B={};qt(_(g.queryDocument,B).then(ae=>{let ve=T(K(ae),Be=>O(Be,g.queryField)),pe=T(ve,Vt),Ie=pe!==void 0?pe:D(W(T(T(T(ve,K),Be=>O(Be,"edges")),Vt),Be=>se(Be,Et=>T(K(Et),zr=>O(zr,"node")))),[]),Te=D(W(T(T(T(ve,K),Be=>O(Be,"pageInfo")),K),Be=>({hasNextPage:fe(W(O(Be,"hasNextPage"),nt),!1,Et=>Et==="JSONTrue"),hasPreviousPage:fe(W(O(Be,"hasPreviousPage"),nt),!1,Et=>Et==="JSONTrue"),startCursor:T(O(Be,"startCursor"),ce),endCursor:T(O(Be,"endCursor"),ce)})),k3);return w(Be=>Ie),Ae(Be=>Te),A(Be=>"Loaded"),Promise.resolve()}),ae=>(A(ve=>({TAG:"Error",_0:"Failed to load data"})),Promise.resolve()))}else A(B=>({TAG:"Error",_0:"Not connected"}))},[R[0],Bn]);let yo=B=>{if(a!==void 0&&l!==void 0&&_!==void 0){Q(ae=>"Loading"),qt(_(a,Xr(B)).then(ae=>{let ve=T(K(ae),Ie=>O(Ie,l)),pe=0;return ve!==void 0&&nt(ve)!=="JSONNull"?(Y(Ie=>{let Te=bt(et(Ie));return Te[B]=ve,Te}),Q(Ie=>"Loaded")):pe=1,pe===1&&(Y(Ie=>bt(et(Ie).filter(Te=>Te[0]!==B))),Q(Ie=>({TAG:"Error",_0:"Detail not found"}))),Promise.resolve()}),ae=>(Q(ve=>({TAG:"Error",_0:"Failed to load detail"})),Promise.resolve()));return}};Re(()=>{let B=d!==void 0?d:H;B!==void 0&&(no(O(G,B))?yo(B):Q(ae=>"Loaded"))},[d,H]);let bi=pl(),vt=em(),yr=wi(g.schema,void 0),g2=(p!==void 0?p:S).map(B=>D(K(B),{})),hp=Jh(g2,yr,bi),pp={lookupLabel:(B,ae)=>Gh(hp,B,bi,ae),isMissing:(B,ae)=>Om(hp,B,bi,ae)},gp=$e.hasNextPage||$e.hasPreviousPage,Pd=W(f,B=>({pluginId:B,viewName:g.name})),v2=Cte(yr,bi,vt,O,!0,pp,Pd).map(B=>{if(!B.sortable||!gp)return B;let ae=fe(yr.find(ve=>ve.key===B.key),!1,ve=>v3(ve).sort);return{key:B.key,label:B.label,render:B.render,sortable:ae,width:B.width}}),_2=sr.get("sort"),mp=sr.get("dir")==="desc"?"Desc":"Asc",b2=B=>w(ae=>ae.map(ve=>{let pe=T(T(K(ve),Te=>O(Te,"id")),ce);if(pe===void 0)return ve;let Ie=B.find(Te=>ot(T(T(K(Te),Be=>O(Be,"id")),ce),pe));return Ie!==void 0?Ie:ve})),vp=i!==void 0?se(S,B=>T(T(K(B),ae=>O(ae,i)),ce)):[],Mz=B=>{let ae=$e.hasNextPage,ve=vp.length;if(B===void 0||i===void 0||!ae||ve<=0)return!1;let pe=vp[0];if(mp==="Asc"){let Te=lt(vp,pe,(Be,Et)=>Be>Et?Be:Et);return B>Te}let Ie=lt(vp,pe,(Te,Be)=>Te<Be?Te:Be);return B<Ie},Lz=()=>{let B=Object.keys(_i.current);if(_i.current={},Jo.current=void 0,B.length===0)return;if(B.length>10)return N(ve=>ve+1|0);let ae=0;if(s!==void 0&&o!==void 0){if(_!==void 0){let ve=bt([["ids",B.map(pe=>pe)]]);qt(_(o,ve).then(pe=>{let Ie=D(T(T(K(pe),Te=>O(Te,s)),Vt),[]);return b2(Ie),Promise.resolve()}),pe=>Promise.resolve());return}ae=1}else ae=1;if(ae===1){let ve=0;if(nr!==void 0||l===void 0||a===void 0)ve=2;else{if(_!==void 0){B.forEach(pe=>{let Ie=bt([["id",pe]]);qt(_(a,Ie).then(Te=>{let Be=T(K(Te),Et=>O(Et,l));return Be!==void 0&&nt(Be)!=="JSONNull"&&b2([Be]),Promise.resolve()}),Te=>Promise.resolve())});return}ve=2}if(ve===2)return N(pe=>pe+1|0)}},y2=B=>{_i.current[B]=!0;let ae=Jo.current;ae!==void 0&&clearTimeout(ae),Jo.current=setTimeout(Lz,150)},x2=B=>{let ae=ve=>T(T(K(ve),pe=>O(pe,"id")),ce);w(ve=>{let pe=ve.map(Be=>{let Et=ae(Be);if(Et===void 0)return Be;let zr=B.find(Wr=>ot(ae(Wr),Et));return zr!==void 0?zr:Be}),Ie=se(pe,ae),Te=B.filter(Be=>{let Et=ae(Be);return Et!==void 0?!Ie.includes(Et):!1});return pe.concat(Te)})},zz=B=>{let ae=S.some(pe=>ot(T(T(K(pe),Ie=>O(Ie,"id")),ce),B.id));switch(B.changeKind){case"Added":if(Qo(B.id)){if(ya.current.delete(B.id),ae)return;{let pe=B.id,Ie=0;if(nr!==void 0)return N(Te=>Te+1|0);if(s!==void 0&&o!==void 0){if(_!==void 0){let Te=bt([["ids",[pe]]]);qt(_(o,Te).then(Be=>{let Et=D(T(T(K(Be),zr=>O(zr,s)),Vt),[]);return x2(Et),Promise.resolve()}),Be=>Promise.resolve());return}Ie=1}else Ie=1;if(Ie===1){let Te=0;if(l!==void 0&&a!==void 0){if(_!==void 0){let Be=bt([["id",pe]]);qt(_(a,Be).then(Et=>{let zr=T(K(Et),Wr=>O(Wr,l));return zr!==void 0&&nt(zr)!=="JSONNull"&&x2([zr]),Promise.resolve()}),Et=>Promise.resolve());return}Te=2}else Te=2;if(Te===2)return N(Be=>Be+1|0)}}}else return Mz(B.sortKeyValue)?void 0:Ln(pe=>pe+1|0);case"Updated":return ae?y2(B.id):void 0;case"Removed":return ae?nr!==void 0?y2(B.id):w(pe=>pe.filter(Ie=>Uf(T(T(K(Ie),Te=>O(Te,"id")),ce),B.id))):void 0;case"BulkInvalidated":return Ln(pe=>0),N(pe=>pe+1|0)}},Uz=()=>N(B=>B+1|0);E1(g.queryField,"All",me,zz,Uz);let Bz=B=>{if(Ct===void 0||B.id!==zn(Ct))return;let ae=B.changeKind;if(nr!==void 0)switch(ae){case"Updated":case"Removed":return yo(Ct);case"Added":case"BulkInvalidated":return}else switch(ae){case"Updated":return yo(Ct);case"Removed":return mt(ve=>Ct);case"Added":case"BulkInvalidated":return}},jz=()=>{if(Ct!==void 0&&a!==void 0&&l!==void 0&&_!==void 0){qt(_(a,Xr(Ct)).then(B=>{let ae=T(K(B),pe=>O(pe,l)),ve=0;return ae!==void 0&&nt(ae)!=="JSONNull"?(Y(pe=>{let Ie=bt(et(pe));return Ie[Ct]=ae,Ie}),Q(pe=>"Loaded")):ve=1,ve===1&&mt(pe=>Ct),Promise.resolve()}),B=>Promise.resolve());return}};E1(g.queryField,{_0:D(W(Ct,zn),"")},me&&We(Ct),Bz,jz),Re(()=>{mt(B=>{})},[D(Ct,"")]);let Av=D(sr.get("q"),""),Tv={};et(sr.params).forEach(B=>{let ae=B[0];if(ae.startsWith("f.")){Tv[ae.slice(2)]=B[1];return}});let S2=cDe(yr,Tv),qz=S2.length!==0,Vz=W(_2,B=>({key:B,direction:mp==="Asc"?"Asc":"Desc"})),Kz=(B,ae)=>{let ve=ae==="Asc"?"asc":"desc";sr.setMany([["sort",B],["dir",ve],["after",""],["before",""]])},E2=B=>sr.setMany([["q",B],["after",""],["before",""]]),Hz=(B,ae)=>sr.setMany([["f."+B,ae],["after",""],["before",""]]),Wz=()=>ie($e.endCursor,B=>sr.setMany([["after",B],["before",""]])),Gz=()=>ie($e.startCursor,B=>sr.setMany([["before",B],["after",""]])),Od=g.commands.filter(B=>B.level==="Instance"),Jz=Od.length!==0,ju;if(Jz){let ve={key:"__actions",label:"",render:pe=>{let Ie=T(O(pe,"id"),ce),Te=g.statusField;Te!==void 0&&(O(pe,Te)!==void 0?Ho(pe,Te)===void 0&&KPe(f,g.name,Te):VPe(f,g.name,Te));let Et=ZM(Od,pe,g.statusField).map(zr=>({TAG:"Action",label:zr.label,onClick:()=>P(Wr=>({command:zr,rowId:Ie})),danger:!1}));return b(PDe,{items:Et,triggerLabel:"..."})},sortable:!1,width:"56px"};ju=v2.concat([ve])}else ju=v2;let Qz=g.commands.filter(B=>B.level==="Collection"),w2=B=>{let ae=B.map(Et=>D(K(Et),{})),ve=_3(Tv,yr),Ie=Un&&ei.search?"":Av,Te=b3(_2,mp,yr),Be;return Be=typeof Te!="object"||Te.TAG==="ServerSort"?[void 0,mp]:[Te._0,Te._1],uDe(lDe(aDe(ae,yr,ve[1]),yr,Ie),yr,Be[0],Be[1])},k2=B=>{if(Ze!==void 0&&Ze.id!==ia){let ae=Vr(g.schema,T(r,$r=>il($r,g.name))),ve=W(ae.statusField,$r=>tz($r,Od,T(Ue,Sn=>Sn.transitions))),pe=($r,Sn,jn)=>{let qu=Od.find(kl=>kl.name===$r);if(_===void 0||qu===void 0)return;let Nv={};et(D(K(jn),{})).forEach(kl=>{Nv[kl[0]]=kl[1]}),Nv[D(qu.aggregateIdField,"id")]=Sn,xl(Sn),qt(_(qu.mutationDocument,Nv).then(kl=>{let Md=Zc(kl);return typeof Md!="object"?Md==="Accepted"?st||N(Cl=>Cl+1|0):st||setTimeout(()=>N(Cl=>Cl+1|0),500):(console.warn("[AutoUI] "+g.name+": command "+$r+" rejected"+fe(Md._0.errorCode,"",Cl=>" ("+Cl+")")),N(Cl=>Cl+1|0)),Promise.resolve()}),kl=>(N(Md=>Md+1|0),Promise.resolve()))},Ie=w2(B).map($r=>$r);if(t!==void 0&&Ze.id===vf){let $r=Vr(t.resource.schema,T(r,Sn=>il(Sn,t.resource.name)));return b(NPe,{mode:Ze,resource:t.resource,resourceSemantics:$r,resourceRef:t.resourceRef,assignCommand:HFe(Od,t.resourceRef),eventReadModelName:g.name,eventSchema:g.schema,eventRows:Ie,eventSemantics:ae,eventAccent:T(Ue,Sn=>Sn.accent),onOpenEvent:(Sn,jn)=>ie(T(K(jn),br),Hr),onCommand:pe})}let Te=g.name,Be=g.schema,Et=T(Ue,$r=>$r.accent),zr=($r,Sn)=>ie(T(K(Sn),br),Hr),Wr=W(ve,$r=>pe),xn={readModelName:Te,rows:Ie,schema:Be,semantics:ae,accent:Et,onOpenRow:zr,onCommand:Wr,statusCommandFor:ve};return Ze.render([xn])}else{let ae=w2(B),ve=W(h,Wr=>(xn=>ie(br(xn),Hr))),pe=Wr=>D(br(Wr),JSON.stringify(Wr)),Ie=(Wr,xn)=>{let $r=xn.map(pe),Sn={};return $r.forEach(jn=>{Sn[jn]=!0}),Object.keys(Sn).length!==$r.length&&HPe(f,g.name),b(Q0,{columns:Wr,data:xn,keyFn:pe,sortState:Vz,onSort:Kz,onRowClick:ve,activeKey:Ct})},Te=Iq(g.schema);if(Te===void 0)return Ie(ju,ae);let Be=KDe(ae,Te,Bo(g.schema,Te)),Et=Be.length;if(Et===1||Et===0)return Ie(ju,ae);let zr=ju.filter(Wr=>Wr.key!==Te);return b("div",{children:Be.map(Wr=>{let xn=Wr[0];return M("div",{children:[b("div",{children:yt(xn),className:zPe}),Ie(zr,Wr[1])],className:LPe},xn)}),className:MPe})}},Yz=p!==void 0?k2(p):typeof C!="object"?C==="Loading"?b(Of,{}):k2(S):b(Da,{detail:C._0,onRetry:()=>N(B=>B+1|0)}),xa;if(Ct!==void 0&&h!==void 0){let ae=(p!==void 0?p:S).find(Ie=>ot(T(K(Ie),br),Ct)),ve=O(G,Ct);xa=[Ct,h,ve!==void 0?ve:ae]}else xa=void 0;let C2=B=>{let ae=B[2],ve=B[0];if(ot(be,ve))return b(Da,{title:"Entity removed",detail:"This entity no longer exists. Return to the list to continue.",onRetry:()=>bo()});if(ae!==void 0)return B[1](zn(ve),m,ir(ae));let pe=0;if(typeof C!="object"){if(C==="Loading")return b(Of,{});if(typeof ue=="object")return b(Da,{detail:ue._0,onRetry:()=>N(Ie=>Ie+1|0)});if(ue!=="Loading")return b(Da,{title:"Row not found",detail:"The row data is no longer in the current page."});pe=2}else pe=2;return pe===2&&typeof ue!="object"&&ue==="Loading"?b(Of,{}):b(Da,{detail:C._0,onRetry:()=>N(Ie=>Ie+1|0)})},Xz=wr?b("div",{children:[["full","Full","▭"],["split","Split","▤"]].map(B=>{let ae=B[1],ve=B[0],pe;return pe=kr==="Full"?ve==="full":ve==="split",M("button",{children:[b("span",{children:B[2],"aria-hidden":!0,style:{fontSize:"0.9em",lineHeight:"1"}}),b("span",{children:ae})],className:pe?cf.Style.btnActive:cf.Style.btn,title:ae,onClick:Ie=>{w3(Ge,ve),vr(Te=>ve)}},ve)}),"aria-label":"Layout",className:cf.Style.group,role:"group"}):null,R2=M("div",{children:[b("h2",{children:g.name,className:PPe}),M("div",{children:[re.length>1?b(cf.make,{modes:re,activeId:fe(Ze,ia,B=>B.id),onSelect:He}):null,Xz,b(tIe,{live:Mr,canBeLive:st,reconnecting:Lr,onToggle:j}),Qz.map(B=>b("button",{children:"+ "+B.label,className:UPe,onClick:ae=>P(ve=>({command:B,rowId:void 0}))},B.name))],className:OPe})],className:C3}),Zz=M(qr,{children:[qz?b(H5,{filters:S2,onFilterChange:Hz,searchValue:Av,onSearchChange:E2}):b(K5,{value:Av,onChange:E2}),_o>0?b(oIe,{count:_o,onClick:()=>{Ln(B=>0),sr.setMany([["after",""],["before",""]]),N(B=>B+1|0)}}):null]}),e9=gp?M("div",{children:[b("button",{children:"‹ Prev",className:R3,disabled:!$e.hasPreviousPage,onClick:B=>Gz()}),b("button",{children:"Next ›",className:R3,disabled:!$e.hasNextPage,onClick:B=>Wz()})],className:jPe}):null,A2=M(qr,{children:[Zz,Yz,e9]}),$v;if(kr==="Full")$v=xa!==void 0?b(S3.make,{refresh:()=>N(B=>B+1|0),children:M("div",{children:[b("div",{children:b("button",{children:"← "+g.name,className:BPe,onClick:B=>bo()}),className:C3}),C2([xa[0],xa[1],xa[2]])],className:ey})}):M("div",{children:[R2,A2],className:ey});else{let B=xa!==void 0?C2(xa):b(sd,{title:"Select an item",description:"Choose a row on the left to see its details here."});$v=b(S3.make,{refresh:()=>N(ae=>ae+1|0),children:M("div",{children:[R2,b(zDe,{master:A2,detail:B})],className:ey})})}return M(qr,{children:[$v,fe(I[0],null,B=>b(Ww,{isOpen:!0,onClose:()=>P(ae=>{}),title:B.command.label,children:b(d2,{schema:B.command.schema,aggregateId:B.rowId,aggregateIdField:B.command.aggregateIdField,injectNewId:B.command.level==="Collection",refFields:B.command.refFields,onSubmit:ae=>{if(_!==void 0){let ve=B.rowId;return ve!==void 0?xl(ve):ie(O(ae,D(B.command.aggregateIdField,"id")),xl),qt(_(B.command.mutationDocument,qPe(B.command.schema,ae)).then(pe=>{let Ie=Zc(pe);if(typeof Ie!="object")return Ie==="Accepted"?(P(Te=>{}),st||N(Te=>Te+1|0),Promise.resolve("Ok")):(P(Te=>{}),st||setTimeout(()=>N(Te=>Te+1|0),500),Promise.resolve("Ok"));{let Te=Ie._0;return wv(_,bi,Te.errorCode,Te.detail).then(Be=>Promise.resolve({TAG:"Err",_0:Be}))}}),pe=>Promise.resolve({TAG:"Err",_0:"Request failed"}))}return P(ve=>{}),Promise.resolve("Ok")},submitLabel:"Execute"})}))]})}let GPe=WPe;function JPe(e,t,r){if(e.length<2)return[];let n=lt(e,Number.MAX_VALUE,(a,l)=>a<l?a:l),o=lt(e,Number.MIN_VALUE,(a,l)=>a>l?a:l)-n,s=t/(e.length-1|0);return e.map((a,l)=>({x:l*s,y:o===0?r/2:r-(a-n)/o*r}))}function QPe(e){return e.map(t=>t.x.toString()+","+t.y.toString()).join(" ")}function YPe(e){let t=e.color,r=e.height,n=e.width,i=n!==void 0?n:80,o=r!==void 0?r:24,s=t!==void 0?t:"",a=JPe(e.values,i,o),l=s===""?"var("+y.brand+")":s;return a.length<2?null:b("svg",{children:b("polyline",{fill:"none",points:QPe(a),stroke:l,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),style:{display:"block",overflow:"visible"},height:o.toString(),width:i.toString(),viewBox:"0 0 "+i.toString()+" "+o.toString()})}let XPe=YPe;function Wn(e){return"var("+e+")"}let ZPe=E([L("flex"),he("column"),c("gap",Wn(F.xs)),c("padding",Wn(F.lg)),c("background",Wn(y.surface)),c("border","1px solid var("+y.border+")"),c("border-radius",Wn(X.md))]),eOe=E([c("color",Wn(y.textSecondary)),c("font-size",Wn($.sizeSm)),c("font-weight",Wn($.weightMedium))]),tOe=E([L("flex"),ee("baseline"),c("gap",Wn(F.sm))]),rOe=E([c("color",Wn(y.textPrimary)),c("font-size",Wn($.sizeXxl)),c("font-weight",Wn($.weightBold)),c("line-height",Wn($.lineHeightTight))]);function nOe(e){switch(e){case"Up":return y.success;case"Down":return y.error;case"Neutral":return y.textDisabled}}function iOe(e){return E([c("color",Wn(nOe(e))),c("font-size",Wn($.sizeSm)),c("font-weight",Wn($.weightMedium))])}function oOe(e){let t=e.trendLabel,r=e.trend,n;if(r!==void 0&&t!==void 0){let i;switch(r){case"Up":i="^";break;case"Down":i="v";break;case"Neutral":i="-";break}n=b("span",{children:i+" "+t,className:iOe(r)})}else n=null;return M("div",{children:[b("div",{children:e.label,className:eOe}),M("div",{children:[b("span",{children:e.value,className:rOe}),n],className:tOe}),fe(e.sublabel,null,i=>b("div",{children:i,style:{color:"var("+y.textDisabled+")",fontSize:"var("+$.sizeXs+")"}})),D(e.footer,null)],className:ZPe})}let sOe=oOe;function dz(e){return"var("+e+")"}let aOe=E([L("grid"),c("grid-template-columns","repeat(auto-fill, minmax(180px, 1fr))"),c("gap",dz(F.md))]),lOe=E([we("pointer"),c("border-radius",dz(X.md)),Ye([c("filter","brightness(0.98)")])]);function uOe(e){let t=e.kpis;return t.length===0?null:b("div",{children:t.map(r=>{let n=W(r.spark,s=>b(XPe,{values:s,width:120,height:24})),i=b(sOe,{label:r.label,value:r.value,trend:r.trend,trendLabel:r.trendLabel,sublabel:r.sublabel,footer:n}),o=r.onOpen;return o!==void 0?b("div",{children:i,className:lOe,role:"button",tabIndex:0,onKeyDown:s=>{if(s.key==="Enter")return o()},onClick:s=>o()},r.key):b("div",{children:i},r.key)}),className:aOe})}let cOe=uOe,Gg=["var("+y.brand+")","#7c9c5e","#b0743c","#7466a3","#4d8a8a","#a35f74"];function fz(e,t){return D(e.color,Gg[Oo(t,Gg.length)])}function dOe(e){let t=lt(e,0,(n,i)=>n+(i.value>0?i.value:0));if(t<=0)return[];let r={contents:0};return e.map(n=>{let i=r.contents,o=(n.value>0?n.value:0)/t;return r.contents=i+o,[i,i+o]})}function y0(e,t,r,n){let i=(n-.25)*2*Math.PI;return[e+r*Math.cos(i),t+r*Math.sin(i)]}function Br(e){return(Math.round(e*1e3)/1e3).toString()}function ty(e,t,r,n,i,o){let s=y0(e,t,r,i),a=s[1],l=s[0],u=y0(e,t,r,o),d=u[1],f=u[0],h=o-i>.5?"1":"0";if(n<=0)return"M "+Br(e)+" "+Br(t)+" L "+Br(l)+" "+Br(a)+" A "+Br(r)+" "+Br(r)+" 0 "+h+" 1 "+Br(f)+" "+Br(d)+" Z";let p=y0(e,t,n,i),g=y0(e,t,n,o);return"M "+Br(l)+" "+Br(a)+" A "+Br(r)+" "+Br(r)+" 0 "+h+" 1 "+Br(f)+" "+Br(d)+" L "+Br(g[0])+" "+Br(g[1])+" A "+Br(n)+" "+Br(n)+" 0 "+h+" 0 "+Br(p[0])+" "+Br(p[1])+" Z"}function fOe(e){let t=e.innerRatio,r=e.size,n=e.slices,i=r!==void 0?r:120,o=t!==void 0?t:0,s=dOe(n);if(s.length===0)return null;let a=i/2,l=i/2-1,u=o>0?l*o:0;return b("svg",{children:s.map((d,f)=>{let h=d[1],p=d[0],g=n[f],m=fz(g,f),v=h-p>=.999?ty(a,a,l,u,p,p+.5)+" "+ty(a,a,l,u,p+.5,h):ty(a,a,l,u,p,h);return b("path",{children:b("title",{children:g.label}),d:v,fill:m},g.label+f.toString())}),style:{display:"block",height:"auto",maxWidth:"100%"},height:i.toString(),width:i.toString(),viewBox:"0 0 "+i.toString()+" "+i.toString()})}let hOe=fOe,pOe=["var("+y.brand+")","var("+y.success+")"];function gOe(e){let t=e.flatMap(i=>i.values),r=lt(t,Number.MAX_VALUE,(i,o)=>i<o?i:o),n=lt(t,Number.MIN_VALUE,(i,o)=>i>o?i:o);return[r,n]}function mOe(e){let t=e.height,r=e.width,n=e.series,i=r!==void 0?r:320,o=t!==void 0?t:120;if(n.length===0||n.every(g=>g.values.length<2))return null;let s=gOe(n),a=s[0],l=s[1]-a,u=l===0?1:l,d=o-16,f=lt(n,0,(g,m)=>g>m.values.length?g:m.values.length),h=i/(f-1|0),p=8+d;return b("svg",{children:n.map((g,m)=>{let v=D(g.color,D(pOe[m],"var("+y.brand+")")),x=g.values.map((k,A)=>{let C=A*h,R=8+d-(k-a)/u*d;return[C,R]}).map(k=>k[0].toString()+","+k[1].toString()).join(" "),w=(g.values.length-1|0)*h,S="0,"+p.toString()+" "+x+(" "+w.toString()+","+p.toString());return M("g",{children:[b("polygon",{fill:v,fillOpacity:"0.15",points:S,stroke:"none"}),b("polyline",{fill:"none",points:x,stroke:v,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]},g.label)}),style:{display:"block",height:"auto",maxWidth:"100%"},height:o.toString(),width:i.toString(),viewBox:"0 0 "+i.toString()+" "+o.toString()})}let vOe=mOe;function _Oe(e){let t=e.size,r=t!==void 0?t:120;return b(hOe,{slices:e.slices,size:r,innerRatio:.6})}let bOe=_Oe;function Zl(e){return"var("+e+")"}function yOe(e){return E([L("flex"),he("column"),ee("center"),c("gap","2px"),c("width","100%"),c("max-width",e.toString()+"px")])}let xOe=E([Ot("relative"),c("width","100%"),c("line-height","0")]),SOe=E([Ot("absolute"),c("left","0"),c("right","0"),c("bottom","0"),c("text-align","center"),c("line-height","1.1"),c("font-size",Zl($.sizeXl)),c("font-weight",Zl($.weightMedium)),c("color",Zl(y.textPrimary))]),EOe=E([L("flex"),Qe("spaceBetween"),c("width","100%"),c("font-size",Zl($.sizeXs)),c("color",Zl(y.textDisabled))]),wOe=E([c("font-size",Zl($.sizeSm)),c("color",Zl(y.textSecondary))]);function kOe(e,t,r){if(r<=t)return 0;let n=(e-t)/(r-t);return n<0?0:n>1?1:n}function En(e){return(Math.round(e*100)/100).toString()}function N3(e,t,r,n){let i=Math.PI+n*Math.PI;return[e+r*Math.cos(i),t+r*Math.sin(i)]}function D3(e,t,r,n,i){let o=N3(e,t,r,n),s=N3(e,t,r,i);return"M "+En(o[0])+" "+En(o[1])+" A "+En(r)+" "+En(r)+" 0 0 1 "+En(s[0])+" "+En(s[1])}function COe(e){let t=e.size,r=e.caption,n=e.max,i=e.min,o=e.value,s=i!==void 0?i:0,a=t!==void 0?t:160;if(n<=s)return null;let l=kOe(o,s,n),u=a*.09,d=a/2,f=a/2-u/2,h=f+u/2,p=h+u/2;return M("div",{children:[M("div",{children:[M("svg",{children:[b("path",{d:D3(d,h,f,0,1),fill:"none",stroke:"var("+y.surfaceSubtle+")",strokeLinecap:"round",strokeWidth:En(u)}),l<=0?null:b("path",{d:D3(d,h,f,0,l),fill:"none",stroke:"var("+y.brand+")",strokeLinecap:"round",strokeWidth:En(u)})],"aria-label":En(o)+" of "+En(n),role:"img",style:{display:"block",height:"auto",maxWidth:"100%"},height:En(p),width:En(a),viewBox:"0 0 "+En(a)+" "+En(p)}),b("div",{children:D(e.display,En(o)),className:SOe})],className:xOe}),M("div",{children:[b("span",{children:En(s)}),b("span",{children:En(n)})],className:EOe}),r!==void 0?b("div",{children:r,className:wOe}):null],className:yOe(a)})}let ROe=COe;function Mf(e){return"var("+e+")"}let AOe=E([L("flex"),he("column"),c("gap","6px")]),TOe=E([c("overflow-x","auto")]),$Oe=E([L("flex"),c("gap","4px"),ee("flexStart")]);function NOe(e){return E([L("grid"),c("grid-template-rows","repeat(7, "+e.toString()+"px)"),c("gap","2px"),ee("center"),c("font-size",Mf($.sizeXs)),c("color",Mf(y.textDisabled)),c("line-height","1")])}function DOe(e){return E([L("grid"),c("grid-auto-flow","column"),c("grid-auto-columns",e.toString()+"px"),c("grid-template-rows","repeat(7, "+e.toString()+"px)"),c("gap","2px")])}function FOe(e){return E([c("border-radius","2px"),c("border","1px solid var("+y.borderSubtle+")"),c("background",e<=0?"transparent":"color-mix(in srgb, var("+y.brand+") "+Math.round(e*100).toString()+"%, transparent)")])}let IOe=E([c("visibility","hidden")]),POe=E([L("flex"),ee("center"),pi("wrap"),c("gap",Mf(F.md)),c("font-size",Mf($.sizeXs)),c("color",Mf(y.textSecondary))]),OOe=E([L("flex"),ee("center"),c("gap","4px")]);function MOe(e){return E([c("width","10px"),c("height","10px"),c("border-radius","2px"),c("border","1px solid var("+y.borderSubtle+")"),c("background","color-mix(in srgb, var("+y.brand+") "+Math.round(e*100).toString()+"%, transparent)")])}function LOe(e){let t=new Date(e).getDay()|0;return t===0?6:t-1|0}function zOe(e){let t=e[0];if(t===void 0)return[];let r=Ja(LOe(t.time),n=>{});for(e.forEach(n=>{r.push(n)});r.length%7!==0;)r.push(void 0);return Ja(r.length/7|0,n=>r.slice(n*7|0,(n*7|0)+7|0))}function UOe(e){return lt(e,0,(t,r)=>r.value>t?r.value:t)}function F3(e){return e===Math.trunc(e)?Math.trunc(e).toString():e.toString()}function BOe(e){return e%2===0?D(JE[e],""):""}function jOe(e){let t=e.cellSize,r=e.days,n=t!==void 0?t:11,i=zOe(r);if(i.length===0)return null;let o=UOe(r),s=r[0],a=r[r.length-1|0],l=s!==void 0&&a!==void 0?Gi(s.time)+" – "+Gi(a.time):"";return M("div",{children:[b("div",{children:M("div",{children:[b("div",{children:Ja(7,u=>b("span",{children:BOe(u)},u.toString())),className:NOe(n)}),b("div",{children:i.map((u,d)=>u.map((f,h)=>f!==void 0?b("div",{className:FOe(i5(f.value,o)),title:oa(f.time)+" "+Gi(f.time)+": "+F3(f.value)},f.time.toString()):b("div",{className:IOe},"b:"+d.toString()+":"+h.toString()))),className:DOe(n)})],className:$Oe}),className:TOe}),M("div",{children:[b("span",{children:l}),M("span",{children:["less",o5.map(u=>b("span",{className:MOe(u)},u.toString())),"more (max "+F3(o)+")"],className:OOe})],className:POe})],className:AOe})}let qOe=jOe;function hi(e){return"var("+e+")"}let VOe=E([L("flex"),he("column"),c("gap","2px")]),KOe=E([L("flex"),he("column"),c("gap","3px")]),HOe=E([L("flex"),Qe("spaceBetween"),ee("baseline"),c("gap",hi(F.sm)),c("font-size",hi($.sizeSm))]),WOe=E([c("color",hi(y.textPrimary))]),GOe=E([c("color",hi(y.textPrimary)),c("font-weight",hi($.weightMedium)),c("white-space","nowrap")]),JOe=E([c("color",hi(y.textSecondary)),c("font-weight",hi($.weightNormal))]),QOe=E([c("background",hi(y.surfaceSubtle)),c("border-radius",hi(X.sm)),c("height","14px"),fl("hidden")]);function YOe(e,t){return E([c("background",t),c("border-radius",hi(X.sm)),c("height","100%"),c("width",e.toString()+"%"),c("min-width",e>0?"2px":"0")])}let XOe=E([c("padding","2px 0 4px"),c("font-size",hi($.sizeXs)),c("color",hi(y.textDisabled))]),ZOe=E([c("padding-top","4px"),c("font-size",hi($.sizeXs)),c("color",hi(y.textDisabled))]);function I3(e,t){return t<=0?0:Math.round(e/t*1e3)/10}function e6e(e){return e===Math.trunc(e)?Math.trunc(e).toString():e.toString()}function t6e(e){let t=fe(e[0],0,r=>r.value);return e.map((r,n)=>{let i=e[n-1|0];return{conversion:I3(r.value,t),dropOff:i!==void 0&&i.value>0&&r.value<i.value?I3(i.value-r.value,i.value):void 0}})}function r6e(e){let t=e.stages;if(t.length===0)return null;let r=e.note,n=t6e(t),i=fe(t[0],0,o=>o.value);return M("div",{children:[t.map((o,s)=>{let a=n[s],l=i<=0?0:o.value/i*100,u=T(a,d=>d.dropOff);return M("div",{children:[u!==void 0?b("div",{children:"↓ "+u.toString()+"% drop-off",className:XOe}):null,M("div",{children:[M("div",{children:[b("span",{children:o.label,className:WOe}),M("span",{children:[e6e(o.value),s===0?null:b("span",{children:" · "+fe(a,0,d=>d.conversion).toString()+"%",className:JOe})],className:GOe})],className:HOe}),b("div",{children:b("div",{className:YOe(l,D(o.color,"var("+y.brand+")"))}),className:QOe})],className:KOe})]},o.label+":"+s.toString())}),r!==void 0?b("div",{children:r,className:ZOe}):null],className:VOe})}let n6e=r6e;function Lf(e){return"var("+e+")"}let i6e=E([L("flex"),he("column"),c("gap","2px")]),o6e=E([L("flex"),c("gap","4px")]),hz=[c("font-size",Lf($.sizeXs)),c("color",Lf(y.textDisabled)),c("white-space","nowrap")],s6e=E(hz.concat([L("flex"),he("column"),Qe("spaceBetween"),c("text-align","right")]));function a6e(e){return E(hz.concat([L("flex"),Qe("spaceBetween"),c("margin-left",e.toString()+"px")]))}let l6e=E([L("flex"),Qe("spaceBetween"),c("gap",Lf(F.sm)),c("font-size",Lf($.sizeXs)),c("color",Lf(y.textSecondary))]);function u6e(e){let t=e[0];if(t!==void 0)return lt(e,{xMin:t.x,xMax:t.x,yMin:t.y,yMax:t.y},(r,n)=>({xMin:n.x<r.xMin?n.x:r.xMin,xMax:n.x>r.xMax?n.x:r.xMax,yMin:n.y<r.yMin?n.y:r.yMin,yMax:n.y>r.yMax?n.y:r.yMax}))}function Nr(e){return(Math.round(e*100)/100).toString()}function P3(e,t,r){return r<=t?.5:(e-t)/(r-t)}function c6e(e){let t=e.height,r=e.width,n=e.yLabel,i=e.xLabel,o=e.points,s=r!==void 0?r:320,a=t!==void 0?t:200,l=u6e(o);if(l===void 0)return null;let u=3.5+1,d=s-u*2,f=a-u*2,h,p=0;return i!==void 0||n!==void 0?p=1:h=null,p===1&&(h=M("div",{children:[b("span",{children:"↑ "+D(n,"y")}),b("span",{children:D(i,"x")+" →"})],className:l6e})),M("div",{children:[M("div",{children:[M("div",{children:[b("span",{children:Nr(l.yMax)}),b("span",{children:Nr(l.yMin)})],className:s6e,style:{width:"34px"}}),M("svg",{children:[b("line",{stroke:"var("+y.borderSubtle+")",strokeWidth:"1",x1:Nr(u),x2:Nr(s-u),y1:Nr(a-u),y2:Nr(a-u)}),b("line",{stroke:"var("+y.borderSubtle+")",strokeWidth:"1",x1:Nr(u),x2:Nr(u),y1:Nr(u),y2:Nr(a-u)}),o.map((g,m)=>{let v=u+P3(g.x,l.xMin,l.xMax)*d,_=u+(1-P3(g.y,l.yMin,l.yMax))*f;return b("circle",{children:b("title",{children:g.label+" — "+D(i,"x")+": "+Nr(g.x)+", "+D(n,"y")+": "+Nr(g.y)}),cx:Nr(v),cy:Nr(_),fill:D(g.color,"var("+y.brand+")"),fillOpacity:"0.75",r:Nr(3.5)},g.label+":"+m.toString())})],style:{display:"block",height:"auto",maxWidth:"100%",minWidth:"0"},height:Nr(a),width:Nr(s),viewBox:"0 0 "+Nr(s)+" "+Nr(a)})],className:o6e}),M("div",{children:[b("span",{children:Nr(l.xMin)}),b("span",{children:Nr(l.xMax)})],className:a6e(38)}),h],className:i6e})}let d6e=c6e;function Po(e){return"var("+e+")"}let f6e=E([L("flex"),he("column"),c("gap","6px"),yn(ke(0)),c("padding","0"),c("list-style","none")]),pz=[L("grid"),c("grid-template-columns","1.5rem 1fr auto"),ee("center"),c("gap",Po(F.sm)),c("font-size",Po($.sizeSm)),c("color",Po(y.textPrimary))],h6e=E(pz),p6e=E(pz.concat([we("pointer"),c("background","transparent"),c("border","none"),c("padding","2px 0"),c("text-align","left"),c("width","100%"),c("font","inherit"),Ye([c("color",Po(y.brand))])])),g6e=E([c("align-self","start"),c("font-size",Po($.sizeXs)),c("color",Po(y.textDisabled)),c("text-align","right"),c("font-variant-numeric","tabular-nums")]),m6e=E([L("flex"),he("column"),c("gap","3px"),VD(ke(0))]),v6e=E([c("overflow","hidden"),c("text-overflow","ellipsis"),c("white-space","nowrap")]),_6e=E([c("background",Po(y.surfaceSubtle)),c("border-radius",Po(X.sm)),c("height","6px"),fl("hidden")]);function b6e(e){return E([c("background",Po(y.brand)),c("border-radius",Po(X.sm)),c("height","100%"),c("width",e.toString()+"%"),c("min-width",e>0?"2px":"0")])}let y6e=E([c("align-self","start"),c("font-weight",Po($.weightMedium)),c("white-space","nowrap"),c("font-variant-numeric","tabular-nums")]);function x6e(e,t){return t<=0||e<=0?0:e/t*100}function S6e(e){let t=e.limit,r=t!==void 0?t:10,n=e.entries.slice(0,r);if(n.length===0)return null;let i=lt(n,0,(o,s)=>s.value>o?s.value:o);return b("ol",{children:n.map((o,s)=>{let a=M(qr,{children:[b("span",{children:(s+1|0).toString(),className:g6e}),M("span",{children:[b("span",{children:o.label,className:v6e,title:o.label}),b("span",{children:b("span",{className:b6e(x6e(o.value,i))}),className:_6e})],className:m6e}),b("span",{children:o.display,className:y6e})]}),l=o.onOpen;return b("li",{children:l!==void 0?b("button",{children:a,className:p6e,type:"button",onClick:u=>l()}):b("div",{children:a,className:h6e})},o.key)}),className:f6e})}let E6e=S6e;function w6e(e){return lt(e.segments,0,(t,r)=>t+(r.value>0?r.value:0))}function k6e(e){let t=e.height,r=e.width,n=e.bars,i=r!==void 0?r:320,o=t!==void 0?t:120;if(n.length===0)return null;let s=lt(n,0,(f,h)=>{let p=w6e(h);return f>p?f:p}),a=s===0?1:s,l=n.length,u=(i-2*(l+1|0))/l,d=o-4;return b("svg",{children:n.map((f,h)=>{let p=2+h*(u+2),g={contents:o};return b("g",{children:f.segments.map((m,v)=>{let _=m.value>0?m.value:0,x=_/a*d,w=g.contents-x;return g.contents=w,_===0?null:b("rect",{children:b("title",{children:f.label+" — "+m.key+": "+_.toString()}),height:x.toString(),width:u.toString(),fill:D(m.color,"var("+y.brand+")"),x:p.toString(),y:w.toString()},m.key+":"+v.toString())})},f.label+":"+h.toString())}),style:{display:"block",height:"auto",maxWidth:"100%"},height:o.toString(),width:i.toString(),viewBox:"0 0 "+i.toString()+" "+o.toString()})}let C6e=k6e;function fr(e){return"var("+e+")"}let R6e=E([L("flex"),he("column"),c("gap",fr(F.lg))]),A6e=E([c("font-size",fr($.sizeXl)),c("font-weight",fr($.weightMedium)),c("color",fr(y.textPrimary)),yn(ke(0))]),T6e=E([L("grid"),c("grid-template-columns","repeat(auto-fill, minmax(300px, 1fr))"),c("gap",fr(F.md))]),ac=E([L("flex"),he("column"),c("gap",fr(F.sm)),c("padding",fr(F.lg)),c("background",fr(y.surface)),c("border","1px solid var("+y.border+")"),c("border-radius",fr(X.md))]),lc=E([c("font-size",fr($.sizeSm)),c("font-weight",fr($.weightMedium)),c("color",fr(y.textSecondary))]),$6e=E([L("flex"),ee("center"),c("gap",fr(F.lg))]),O3=E([L("flex"),he("column"),c("gap","4px"),c("font-size",fr($.sizeSm)),c("color",fr(y.textSecondary))]),M3=E([L("flex"),ee("center"),c("gap","6px")]);function L3(e){return E([L("inlineBlock"),c("width","8px"),c("height","8px"),c("border-radius","50%"),c("background",e)])}let N6e=E([c("font-size",fr($.sizeXs)),c("color",fr(y.textDisabled))]),D6e=E([L("flex"),Qe("spaceBetween"),ee("center"),c("gap",fr(F.sm))]),F6e=E([L("inlineFlex"),c("gap",fr(F.xs))]);function I6e(e){return E([c("background",e?fr(y.surfaceSubtle):"transparent"),c("border","1px solid var("+y.border+")"),c("border-radius",fr(X.sm)),c("padding","2px var("+F.sm+")"),c("font-size",fr($.sizeXs)),c("color",fr(e?y.textPrimary:y.textSecondary)),we("pointer")])}function Jg(e,t){return T(O(e,t),vs)}function fp(e){return e.map(t=>D(K(t),{}))}function Q1(e,t,r){switch(t){case"avg":case"sum":break;default:return e.length}if(r===void 0)return e.length;let n=se(fp(e),o=>Jg(o,r)),i=lt(n,0,(o,s)=>o+s);return t==="sum"?i:n.length===0?0:i/n.length}function Qg(e){let t=Math.round(e*100)/100;return t===Math.trunc(t)?Math.trunc(t).toString():t.toString()}function Is(e){let t=D(e.aggregate,"count"),r=e.label;if(r!==void 0)return r;let n=e.field;switch(t){case"avg":return n!==void 0?e.view+" — avg "+yt(n):e.view;case"sum":return n!==void 0?e.view+" — total "+yt(n):e.view;default:return e.view}}function gz(e,t,r,n){let i=Ja(r,o=>[]);return fp(e).forEach(o=>ie(T(T(O(o,t),ce),Mi),s=>{let a=Math.floor((n-s)/864e5)|0;if(a>=0&&a<r)return ie(i[(r-1|0)-a|0],l=>{l.push(o)})})),i}function Y1(e,t,r,n,i,o){return gz(e,t,r,n).map(s=>Q1(s.map(a=>a),i,o))}function mz(e,t){return se(fp(e),r=>Ho(r,t))}function vz(e,t,r){let n=Bo(t,r),i=lt(e.filter(o=>!n.includes(o)),[],(o,s)=>o.includes(s)?o:o.concat([s]));return n.concat(i)}function P6e(e,t,r){let n=mz(e,r);return se(vz(n,t,r),i=>{let o=n.filter(s=>s===i).length;if(o!==0)return{label:yt(i),value:o}})}function _z(e){return Gg[Oo(e,Gg.length)]}function O6e(e,t,r,n,i,o){let s=gz(e,t,r,n),a=f=>se(f,h=>Ho(h,o)),l=s.flatMap(a),u=vz(l,i,o).filter(f=>l.some(h=>h===f)),d=s.map((f,h)=>{let p=a(f);return{label:oa(n-((r-1|0)-h|0)*864e5),segments:u.map((g,m)=>({key:yt(g),value:p.filter(v=>v===g).length,color:_z(m)}))}});return{statuses:u,bars:d}}function M6e(e,t,r){let n=Bo(t,r),i=mz(e,r),o=se(i,s=>{let a=n.indexOf(s);if(!(a<0))return a});return{stages:n.map((s,a)=>({label:yt(s),value:o.filter(l=>l>=a).length})),excluded:i.length-o.length|0}}function L6e(e,t){return W(Yr(e).find(r=>r[0]===t),r=>r[1])}function bz(e,t){return W(O(e.semantics,t),r=>r.semantic)}function z6e(e,t,r){let n=L6e(e,t);if(n===void 0)return;let i=qf(n,"maximum");if(i===void 0)return ot(bz(r,t),"Percent")?{min:0,max:100}:void 0;let o=D(qf(n,"minimum"),0);if(i>o)return{min:o,max:i}}function z3(e,t,r){let n=bz(e,t);if(n===void 0)return Qg(r);switch(n){case"Currency":return y6(r);case"Percent":return x6(r);case"Bytes":return S6(r);case"Duration":return E6(r);default:return Qg(r)}}function U6e(e,t,r,n){return se(fp(e),i=>W(Jg(i,t),o=>{let s=D(T(O(i,"id"),ce),"");return{id:s,label:D(T(O(i,r),ce),s===""?"—":s),value:o}})).toSorted((i,o)=>o.value-i.value).slice(0,n)}function B6e(e,t,r,n){return se(fp(e),i=>{let o=Jg(i,t),s=Jg(i,r);if(o!==void 0&&s!==void 0)return{label:D(T(O(i,n),ce),D(T(O(i,"id"),ce),"—")),x:o,y:s}})}function j6e(e,t,r,n,i,o){return Y1(e,t,r,n,i,o).map((s,a)=>({time:Gn(n-((r-1|0)-a|0)*XM),value:s}))}function q6e(e){let t=oe(()=>"Days30"),r=t[1],n=t[0],i=(s,a)=>b("button",{children:a,className:I6e(n===s),type:"button",onClick:l=>r(u=>s)}),o;return o=n==="Days30"?e.body:b(qOe,{days:e.yearDays}),M("div",{children:[M("div",{children:[b("span",{children:e.title,className:lc}),M("div",{children:[i("Days30","30 days"),i("Year","Year")],className:F6e})],className:D6e}),o],className:ac})}function V6e(e){let t=e.mockRows,r=e.uiHints,n=e.readModels,i=e.metrics,o=e.pluginId,s=dl(),a=se(lt(i.map(C=>C.view),[],(C,R)=>C.includes(R)?C:C.concat([R])),C=>n.find(R=>R.name===C)),l=a.map(C=>{let R=_u(C,no(t));return[C,R]}),u=C=>t!==void 0?D(O(t,C),[]):fe(l.find(R=>R[0].name===C),[],R=>R[1].rows),d=Date.now(),f=se(i,C=>W(a.find(R=>R.name===C.view),R=>({metric:C,readModel:R,rows:u(R.name),semantics:Vr(R.schema,T(r,N=>il(N,R.name)))}))),h=f.map((C,R)=>{let N=D(C.metric.aggregate,"count"),I=W(C.semantics.dateSpan,P=>Y1(C.rows,P.startField,14,d,N,C.metric.field));return{key:R.toString()+":"+C.readModel.name,label:Is(C.metric),value:Qg(Q1(C.rows,N,C.metric.field)),sublabel:C.readModel.name,spark:I,onOpen:()=>s(zs(wa(o,C.readModel.name)))}}),p=C=>{let R=C.readModel.statusField;return R!==void 0?R:C.semantics.statusField},g=se(f,C=>W(C.semantics.dateSpan,R=>{let N=D(C.metric.aggregate,"count"),I=Is(C.metric)+" — trend",P=p(C),z;if(N==="count"&&P!==void 0){let H=O6e(C.rows,R.startField,30,d,C.readModel.schema,P),V=H.statuses;z=V.length===0?void 0:M(qr,{children:[b(C6e,{bars:H.bars}),b("div",{children:V.map((Y,G)=>M("span",{children:[b("span",{className:L3(_z(G))}),yt(Y)],className:M3},Y)),className:O3})]})}else z=void 0;let q;if(z!==void 0)q=z;else{let H=Y1(C.rows,R.startField,30,d,N,C.metric.field);q=b(vOe,{series:[{label:Is(C.metric),values:H}]})}return b(q6e,{title:I,body:q,yearDays:j6e(C.rows,R.startField,365,d,N,C.metric.field)},"trend:"+Is(C.metric))})),m=se(f,C=>{let R=C.metric.aggregate,N=C.metric.field;if(R==="avg"&&N!==void 0)return W(z6e(C.readModel.schema,N,C.semantics),I=>{let P=Q1(C.rows,"avg",N);return M("div",{children:[b("span",{children:Is(C.metric),className:lc}),b(ROe,{value:P,min:I.min,max:I.max,display:z3(C.semantics,N,P),caption:C.readModel.name+" · "+yt(N)})],className:ac},"gauge:"+Is(C.metric))})}),v=[],_=se(f,C=>{let R=C.metric.aggregate,N=C.metric.field;if(R===void 0)return;switch(R){case"avg":case"sum":break;default:return}if(N===void 0||v.includes(C.readModel.name+":"+N))return;v.push(C.readModel.name+":"+N);let I=U6e(C.rows,N,C.readModel.labelField,10).map(P=>({key:P.id===""?P.label:P.id,label:P.label,display:z3(C.semantics,N,P.value),value:P.value,onOpen:P.id===""?void 0:()=>s(ea(o,C.readModel.name,P.id,[]))}));if(I.length!==0)return M("div",{children:[b("span",{children:C.readModel.name+" — top by "+yt(N),className:lc}),b(E6e,{entries:I})],className:ac},"top:"+C.readModel.name+":"+N)}),x=se(f,C=>{let R=C.metric.viz,N=C.metric.field,I=C.metric.xField;if(R===void 0||R!=="scatter"||N===void 0||I===void 0)return;let P=B6e(C.rows,I,N,C.readModel.labelField);if(P.length!==0)return M("div",{children:[b("span",{children:C.readModel.name+" — "+yt(N)+" by "+yt(I),className:lc}),b(d6e,{points:P,xLabel:yt(I),yLabel:yt(N)})],className:ac},"scatter:"+Is(C.metric))}),w=se(f,C=>{let R=C.metric.viz,N=p(C);if(R===void 0||R!=="funnel"||N===void 0)return;let I=M6e(C.rows,C.readModel.schema,N),P=I.stages;if(P.length===0)return;let z=I.excluded;return M("div",{children:[b("span",{children:Is(C.metric)+" — "+yt(N)+" funnel",className:lc}),b(n6e,{stages:P,note:z===0?void 0:z.toString()+" row(s) with an unlisted "+yt(N)+" excluded"})],className:ac},"funnel:"+Is(C.metric))}),S=se(f,C=>{let R=D(C.metric.aggregate,"count"),N=ot(C.metric.viz,"funnel")?void 0:p(C);if(R!=="count"||N===void 0)return;let I=P6e(C.rows,C.readModel.schema,N);if(I.length!==0)return M("div",{children:[b("span",{children:C.readModel.name+" — by "+yt(N),className:lc}),M("div",{children:[b(bOe,{slices:I}),b("div",{children:I.map((P,z)=>M("span",{children:[b("span",{className:L3(fz(P,z))}),P.label+" ("+Qg(P.value)+")"],className:M3},P.label)),className:O3})],className:$6e})],className:ac},"status:"+C.readModel.name)}),k=We(t)?[]:se(l,C=>{let R=C[0],N=C[1].fetchState;return typeof N!="object"?N==="Loading"?R.name+": loading…":void 0:R.name+": "+N._0}),A=[w,x,m,g,_,S].flatMap(C=>C);return M("div",{children:[b("h2",{children:"Dashboard",className:A6e}),b(cOe,{kpis:h}),A.length!==0?b("div",{children:A,className:T6e}):null,k.length!==0?b("span",{children:k.join(" · "),className:N6e}):null],className:R6e})}let K6e=V6e,yz={actor:"",eventType:"",timeFrom:"",timeTo:""};function U3(e){return e.actor!==""||e.eventType!==""||e.timeFrom!==""?!0:e.timeTo!==""}function fn(e){return"var("+e+")"}let H6e=E([L("flex"),he("column"),c("gap",fn(F.sm))]),W6e=E([L("flex"),ee("center"),c("gap",fn(F.md)),pi("wrap"),c("padding-bottom",fn(F.xs)),c("border-bottom","1px solid var("+y.border+")")]),G6e=E([L("flex"),ee("center"),c("gap","4px")]),B3=E([c("color",fn(y.textSecondary)),c("font-size",fn($.sizeSm)),c("white-space","nowrap")]),j3=E([c("background",fn(y.surface)),c("border","1px solid var("+y.border+")"),c("border-radius",fn(X.sm)),c("padding","2px var("+F.sm+")"),c("font-size",fn($.sizeSm)),c("color",fn(y.textPrimary)),c("outline","none"),la([c("border-color",fn(y.brand))])]),J6e=E([c("background","none"),c("border","none"),c("padding","0"),c("color",fn(y.brand)),c("font-size",fn($.sizeSm)),we("pointer"),Ye([c("text-decoration","underline")])]),Q6e=E([L("flex"),Qe("center"),c("padding-top",fn(F.xs))]),Y6e=E([c("background",fn(y.surface)),c("border","1px solid var("+y.border+")"),c("border-radius",fn(X.sm)),c("padding","4px var("+F.md+")"),c("font-size",fn($.sizeSm)),c("color",fn(y.textPrimary)),we("pointer"),Ye([c("border-color",fn(y.brand))])]);function X6e(e){let t=e.emptyLabel,r=e.onLoadMore,n=e.loading,i=e.hasMore,o=e.onFilterChange,s=e.filter,a=i!==void 0?i:!1,l=n!==void 0?n:!1,u=t!==void 0?t:"No recorded history for this record",d=se([["actor","Actor",e.actors.map(h=>({label:h,value:h})),s.actor],["eventType","Event",e.eventTypes.map(h=>({label:yt(h),value:h})),s.eventType]],h=>{let p=h[2];if(p.length!==0)return{key:h[0],label:h[1],options:p,value:h[3]}});return M("div",{children:[M("div",{children:[b(H5,{filters:d,onFilterChange:(h,p)=>{switch(h){case"actor":return o({actor:p,eventType:s.eventType,timeFrom:s.timeFrom,timeTo:s.timeTo});case"eventType":return o({actor:s.actor,eventType:p,timeFrom:s.timeFrom,timeTo:s.timeTo});default:return}}}),M("div",{children:[b("span",{children:"From:",className:B3}),b("input",{className:j3,type:"date",value:s.timeFrom,onChange:h=>o({actor:s.actor,eventType:s.eventType,timeFrom:h.target.value,timeTo:s.timeTo})}),b("span",{children:"To:",className:B3}),b("input",{className:j3,type:"date",value:s.timeTo,onChange:h=>o({actor:s.actor,eventType:s.eventType,timeFrom:s.timeFrom,timeTo:h.target.value})})],className:G6e}),U3(s)?b("button",{children:"Clear filters",className:J6e,onClick:h=>o(yz)}):null],className:W6e}),b(Zfe,{entries:e.entries,emptyLabel:U3(s)?"No events match these filters":u,onEntryClick:e.onEntryClick,nowMs:e.nowMs}),a?b("div",{children:b("button",{children:l?"Loading…":"Load earlier events",className:Y6e,disabled:l,onClick:h=>ie(r,p=>p())}),className:Q6e}):null],className:H6e})}let Z6e=X6e;function eMe(e){if(e!=="")return e+"T00:00:00.000Z"}function tMe(e){if(e!=="")return e+"T23:59:59.999Z"}function rMe(e,t,r){let n={};return n.entityId=e,n.first=50,ie(r,i=>{n.after=i}),t.actor!==""&&(n.user=t.actor),t.eventType!==""&&(n.eventTypes=[t.eventType]),ie(eMe(t.timeFrom),i=>{n.timeFrom=i}),ie(tMe(t.timeTo),i=>{n.timeTo=i}),n}function nMe(e){let t=e.entityId,r=e.binding,n=po(),i=Yh(),o=fe(e.requiredAccess,!1,z=>!i(z)),s=oe(()=>[]),a=s[1],l=s[0],u=oe(()=>yz),d=u[1],f=u[0],h=oe(()=>!0),p=h[1],g=oe(()=>{}),m=g[1],v=g[0],_=oe(()=>!1),x=_[1],S=oe(()=>{})[1],k=oe(()=>0),A=k[1],C=k[0],R=Je(void 0),N=f.actor+"|"+f.eventType+"|"+f.timeFrom+"|"+f.timeTo;Re(()=>{if(!o)if(n!==void 0){let z=C===0,q=z?void 0:R.current;p(H=>!0),m(H=>{}),qt(n(r.queryDocument,rMe(t,f,q)).then(H=>{let V=uRe(H,r.queryField),Y=cRe(H,r.queryField),G=Y[1],J=Y[0];return a(Q=>z?V:V.concat(Q)),x(Q=>J),S(Q=>G),R.current=G,p(Q=>!1),Promise.resolve()}),H=>(p(V=>!1),m(V=>"Could not load the history for this record."),Promise.resolve()))}else m(z=>"Not connected")},[N,C,o]);let I=z=>{R.current=void 0,A(q=>0),a(q=>[]),d(q=>z)},P=()=>A(z=>z+1|0);return o?null:v!==void 0?b(Da,{title:"History unavailable",detail:v,onRetry:()=>A(z=>z+1|0)}):b(Z6e,{entries:gRe(l,r.displayName),actors:mRe(l),eventTypes:vRe(l),filter:f,onFilterChange:I,hasMore:_[0],loading:h[0],onLoadMore:P})}let iMe=nMe;function ps(e){return"var("+e+")"}let oMe=E([L("flex"),he("column"),c("gap",ps(F.lg))]),sMe=E([L("flex"),ee("center"),Qe("spaceBetween"),c("gap",ps(F.md))]),aMe=E([c("font-size",ps($.sizeXl)),c("font-weight",ps($.weightMedium)),c("color",ps(y.textPrimary)),yn(ke(0))]),lMe=E([L("flex"),pi("wrap"),ee("center"),c("gap",ps(F.md)),c("font-size",ps($.sizeSm)),c("color",ps(y.textSecondary))]),uMe=E([L("inlineFlex"),ee("center"),c("gap","4px"),we("pointer")]);function cMe(e){return E([L("inlineBlock"),c("width","8px"),c("height","8px"),c("border-radius","50%"),c("background",e)])}let dMe=E([c("font-size",ps($.sizeXs)),c("color",ps(y.textDisabled))]);function fMe(e){let t=e.uiHints,r=e.pluginId,n=dl(),i=oe(()=>[]),o=i[1],s=i[0],a=e.readModels.map((f,h)=>{let p=!s.includes(f.name),g=_u(f,p);return[f,h,p,g]}),l=(f,h)=>D(T(T(t,p=>$o(p,f.name)),p=>p.accent),rd[Oo(h,rd.length)]),u=se(a,f=>{if(!f[2])return;let h=f[0];return{readModelName:h.name,rows:f[3].rows,schema:h.schema,semantics:Vr(h.schema,T(t,p=>il(p,h.name))),accent:l(h,f[1]),onOpenRow:(p,g)=>n(ea(r,h.name,p,[]))}}),d=se(a,f=>{let h=f[0],p=f[3].fetchState;if(f[2])return typeof p!="object"?p==="Loading"?h.name+": loading…":void 0:h.name+": "+p._0});return M("div",{children:[b("div",{children:b("h2",{children:e.canvasName,className:aMe}),className:sMe}),b("div",{children:a.map(f=>{let h=f[0];return M("label",{children:[b("input",{checked:f[2],type:"checkbox",onChange:p=>{let g=h.name;o(m=>m.includes(g)?m.filter(v=>v!==g):m.concat([g]))}}),b("span",{className:cMe(l(h,f[1]))}),h.name],className:uMe},h.name)}),className:lMe}),e.mode.render(u),d.length!==0?b("span",{children:d.join(" · "),className:dMe}):null],className:oMe})}let hMe=fMe;function eu(e){return"var("+e+")"}let pMe=E([L("flex"),ee("center"),c("gap",eu(F.xs)),c("font-size",eu($.sizeSm)),c("color",eu(y.textSecondary))]),gMe=E([c("color",eu(y.brand)),c("text-decoration","none"),Ye([c("text-decoration","underline")])]),mMe=E([c("color",eu(y.textPrimary)),c("font-weight",eu($.weightMedium))]),vMe=E([c("color",eu(y.textDisabled)),KD("none")]);function _Me(e){let t=e.crumbs;return b("nav",{children:t.map((r,n)=>{let i=n===(t.length-1|0);return M(ax,{children:[n>0?b("span",{children:"/","aria-hidden":!0,className:vMe}):null,i||no(r.href)?b("span",{children:r.label,className:mMe}):b("a",{children:r.label,className:gMe,href:D(r.href,"#")})]},r.label)}),"aria-label":"breadcrumbs",className:pMe})}let bMe=_Me;function _t(e){return"var("+e+")"}let yMe=E([L("flex"),he("column"),c("gap",_t(F.lg)),c("padding","0 var("+F.md+")"),c("min-width","0")]),xMe=E([L("flex"),ee("center"),c("font-size",_t($.sizeMd)),c("padding","var("+F.sm+") 0"),c("border-bottom","1px solid var("+y.borderSubtle+")")]),SMe=E([L("flex"),ee("center"),Qe("spaceBetween"),c("gap",_t(F.md)),c("padding-bottom",_t(F.md)),c("border-bottom","1px solid var("+y.borderSubtle+")")]),EMe=E([c("font-size",_t($.sizeXl)),c("font-weight",_t($.weightMedium)),c("color",_t(y.textPrimary)),yn(ke(0))]),wMe=E([L("flex"),pi("wrap"),c("gap",_t(F.sm)),c("padding-bottom",_t(F.sm))]),kMe=E([c("background",_t(y.surface)),c("color",_t(y.textPrimary)),c("border","1px solid var("+y.border+")"),c("border-radius",_t(X.md)),c("padding","var("+F.xs+") var("+F.md+")"),c("font-size",_t($.sizeSm)),we("pointer"),Ye([c("background",_t(y.surfaceElevated))])]),CMe=E([L("flex"),he("column"),c("gap",_t(F.sm)),c("min-width","0")]),q3=E([L("flex"),ee("start"),c("gap",_t(F.md)),c("padding","var("+F.xs+") 0"),c("border-bottom","1px solid var("+y.borderSubtle+")"),JD([c("border-bottom","none")])]),V3=E([c("color",_t(y.textSecondary)),c("font-size",_t($.sizeMd)),c("font-weight",_t($.weightMedium)),c("white-space","nowrap"),c("padding-top","2px"),Li(0),c("min-width","200px")]),ry=E([c("color",_t(y.textPrimary)),c("font-size",_t($.sizeMd)),c("word-break","break-word"),c("min-width","0")]),RMe=E([L("flex"),ee("start"),c("gap",_t(F.md)),c("padding","var("+F.xs+") 0"),c("border-bottom","1px solid var("+y.borderSubtle+")"),JD([c("border-bottom","none")])]),AMe=E([c("color",_t(y.textSecondary)),c("font-size",_t($.sizeMd)),c("font-weight",_t($.weightMedium)),c("padding-top","2px"),Li(0),c("min-width","200px")]),TMe=E([L("flex"),he("column"),c("gap",_t(F.sm)),fo(1),c("padding",_t(F.md)),c("background",_t(y.surfaceSubtle)),c("border-radius",_t(X.md)),c("border","1px solid var("+y.borderSubtle+")"),c("min-width","0")]),$Me=E([L("flex"),he("column"),c("gap",_t(F.sm)),c("min-width","0")]),NMe=E([L("flex"),ee("center"),Qe("spaceBetween"),c("gap",_t(F.md)),c("padding-bottom",_t(F.xs)),c("border-bottom","1px solid var("+y.borderSubtle+")")]),DMe=E([c("color",_t(y.textPrimary)),c("font-size",_t($.sizeMd)),c("font-weight",_t($.weightMedium))]),K3=E([c("overflow-x","auto"),c("max-width","100%"),c("border","1px solid var("+y.borderSubtle+")"),c("border-radius",_t(X.md))]),uc=E([c("color",_t(y.textDisabled)),c("font-size",_t($.sizeSm))]);function xz(e,t){return D(T(T(K(e),r=>O(r,"title")),ce),yt(t))}function H3(e){return T(T(K(e),t=>O(t,"type")),ce)}function W3(e){return T(T(K(e),t=>O(t,"format")),ce)}function FMe(e){return T(K(e),t=>O(t,"items"))}function G3(e){return We(T(T(K(e),t=>O(t,"properties")),K))}function IMe(e){let t=e.toLowerCase(),r=t.length;return r>2&&t.endsWith("id")&&t!=="id"?!0:r>3?t.endsWith("ids"):!1}function J3(e){let t=e.toLowerCase(),r=e.length,n=s=>{let a=s.length;if(r>a&&t.endsWith(s))return e.slice(0,r-a|0)},i=n("ids");if(i!==void 0)return i;let o=n("id");if(o!==void 0)return o}function PMe(e,t){let r=H3(t);if(r!==void 0)switch(r){case"array":let i=FMe(t);if(i===void 0)return"ArrayOfScalars";let o=H3(i);if(G3(i)||ot(o,"object"))return{TAG:"ArrayOfObjects",_0:i};if(!ot(o,"string"))return"ArrayOfScalars";let s=J3(e);return s!==void 0?{TAG:"EntityRefArray",_0:s}:"ArrayOfStrings";case"boolean":return"Bool";case"object":return G3(t)?{TAG:"NestedObject",_0:t}:{TAG:"Scalar",_0:"object",_1:void 0}}if(!IMe(e))return{TAG:"Scalar",_0:D(r,"string"),_1:W3(t)};let n=J3(e);return n!==void 0?{TAG:"EntityRef",_0:n}:{TAG:"Scalar",_0:D(r,"string"),_1:W3(t)}}function ny(e,t,r,n){let i=nt(e);if(typeof i!="object")switch(i){case"JSONFalse":return b(Zs,{variant:"Neutral",label:"false",dot:!1});case"JSONTrue":return b(Zs,{variant:"Success",label:"true",dot:!1});case"JSONNull":return b("span",{children:"—",className:uc})}else switch(i.TAG){case"JSONString":let o=i._0;return t==="date-time"?_x(o):D(ZD(r,o),o);case"JSONNumber":return i._0.toString();case"JSONObject":case"JSONArray":return JSON.stringify(e)}}function OMe(e){return D(W(Vt(e),t=>t.map(r=>{let n=nt(r);if(typeof n!="object")switch(n){case"JSONFalse":return"false";case"JSONTrue":return"true";case"JSONNull":return"—"}else switch(n.TAG){case"JSONString":return n._0;case"JSONNumber":return n._0.toString();case"JSONObject":case"JSONArray":return JSON.stringify(r)}})),[])}function Q3(e){return D(W(Vt(e),t=>se(t,K)),[])}function Sz(e,t){let r=T(O(e,"id"),ce);if(r!==void 0)return r;let n=T(O(e,"compositeId"),ce);return n!==void 0?n:"#"+t.toString()}function Y3(e){return e.map((t,r)=>({key:Sz(t,r),row:t}))}function MMe(e,t,r){for(;;){let n=t,i=n[0];if(i===void 0)return e;let o=e[e.length-1|0];if(o===void 0)return;let s=We(K(o.data)),a=Vt(o.data),l;if(s){let u=D(K(o.data),{}),d=T(T(K(o.schema),p=>O(p,"properties")),K),f=T(d,p=>O(p,i)),h=O(u,i);l=h!==void 0&&f!==void 0?{data:h,schema:f,label:xz(f,i)}:void 0}else if(We(a)){let u=D(a,[]),d=D(T(K(o.schema),h=>O(h,"items")),o.schema),f=u.find((h,p)=>{let g=D(K(h),{});return Sz(g,p)===i});l=f!==void 0?{data:f,schema:d,label:i}:void 0}else l=void 0;if(l===void 0)return;e.push(l),r.push(i),t=n.slice(1)}}function LMe(e){let t=e.headerAccessory,r=e.entityPanel,n=e.uiHints,i=e.viewName,o=e.pluginId,s=e.drillPath,a=e.labelField,l=e.aggregateId,u=e.statusField,d=e.commands,f=e.rootLabel,h=e.schema,p=e.data,g=d!==void 0?d:[],m=s!==void 0?s:[],v=po(),_=pl(),x=em(),w=IPe(),S=Zh(),k=S!==void 0&&i!==void 0?S.isLive(i):!1,A=o!==void 0&&i!==void 0?{pluginId:o,viewName:i}:void 0,C=dl(),R=oe(()=>[]),N=R[1],I=oe(()=>{}),P=I[1],z=oe(()=>({})),q=z[1],H=z[0],V=We(o)&&We(i),Y=V?m:R[0],G=re=>{if(o!==void 0&&i!==void 0&&l!==void 0)return C(ea(o,i,l,re));N(_e=>re)},J=MMe([{data:p,schema:h,label:f}],Y,[]),Q=D(K(p),{}),ue=wi(h,"Drill"),le=Jh([Q],ue,_),ze={lookupLabel:(re,_e)=>Gh(le,re,_,_e),isMissing:(re,_e)=>Om(le,re,_,_e)},mt=(re,_e)=>{let Ce=D(T(T(K(re),He=>O(He,"properties")),K),{}),Le={};return et(_e).forEach(He=>{let Ze=He[1],dt=He[0],wr=D(T(T(T(O(Ce,dt),K),vr=>O(vr,"type")),ce),"string"),Ge,Xe=0;switch(wr){case"array":if(Ze==="")Ge=[];else try{Ge=JSON.parse(Ze)}catch{Ge=[Ze]}break;case"boolean":Ge=Ze==="true";break;case"integer":case"number":Xe=1;break;case"object":if(Ze==="")Ge=null;else try{Ge=JSON.parse(Ze)}catch{Ge=null}break;default:Ge=Ze}Xe===1&&(Ge=D(W(Ya(Ze),vr=>vr),Ze)),Le[dt]=Ge}),Le},be=(re,_e,Ce)=>M("div",{children:[b("div",{children:_e,className:V3}),b("div",{children:Ce,className:ry})],className:q3},re),Se=(re,_e,Ce)=>{if(Ag(re,_,A))return Ce;let Le=ua(_,re);if(Le===void 0)return Ce;let He=Le.name.endsWith("s");return _e?He?Le.name:Le.name+"s":He?Le.name.slice(0,Le.name.length-1|0):Le.name},st=re=>{let _e=nt(re.data);if(typeof _e!="object"){if(_e==="JSONNull")return b("span",{children:"—",className:uc})}else switch(_e.TAG){case"JSONObject":let Ce=D(K(re.data),{}),Le=wi(re.schema,"Drill");return Le.length===0?b("span",{children:"(no fields)",className:uc}):b("div",{children:Le.map(Ge=>{let Xe=Ge.key,vr=Ge.propSchema,kr=O(Ce,Xe),Lr=xz(vr,Xe),or=PMe(Xe,vr);if(kr===void 0)return be(Xe,Lr,b("span",{children:"—",className:uc}));if(typeof or!="object")switch(or){case"Bool":return be(Xe,Lr,ny(kr,void 0,Xe))}else switch(or.TAG){case"Scalar":let Ln=QR(Xe,vr,kr);return Ln!==void 0?be(Xe,Lr,Ln):be(Xe,Lr,ny(kr,or._1,Xe));case"EntityRef":let _o=or._0;return be(Xe,Se(_o,!1,Lr),c1(Xe,_o,kr,_,x,ze,A,void 0,void 0));case"EntityRefArray":let _i=or._0;return be(Xe,Se(_i,!0,Lr),c1(Xe,_i,kr,_,x,ze,A,void 0,void 0));case"NestedObject":let Jo=QR(Xe,vr,kr);if(Jo!==void 0)return be(Xe,Lr,Jo);let ya=wi(or._0,"Drill"),xl=D(T(O(Ce,Xe),K),{});return M("div",{children:[b("div",{children:Lr,className:AMe}),b("div",{children:ya.map(vt=>{let yr=O(xl,vt.key);return M("div",{children:[b("div",{children:vt.label,className:V3}),b("div",{children:Jl(vt.key,vt.kind,vt.propSchema,yr,void 0,_,x,ze,A),className:ry})],className:q3},vt.key)}),className:TMe})],className:RMe},Xe);case"ArrayOfObjects":let Qo=or._0,sr=Y3(Q3(kr)),Sl=sr.length,El=D(i,f),_r=El+"."+Xe,nr=T(n,vt=>$o(vt,_r)),br=L6(Qo,nr),zn=F6(o,El,Xe),Xr=O(H,Xe),Ct=Xr!==void 0?Xr:NS(zn),Hr=z6(Ct,nr,rF(Qo),br),bo=vt=>{D6(zn,vt),q(yr=>{let Rs=bt(et(yr));return Rs[Xe]=vt,Rs})},ar=D(Vt(kr),[]),ei=vt=>{let yr=Vr(Qo,T(n,wl=>il(wl,_r))),Rs=T(nr,wl=>wl.accent),hp={readModelName:_r,rows:ar,schema:Qo,semantics:yr,accent:Rs,onOpenRow:(wl,m2)=>{let pp=A9(ar,Pd=>Pd===m2),gp=pp!==void 0?fe(sr[pp],wl,Pd=>Pd.key):wl;G(Y.concat([Xe,gp]))}};return vt.render([hp])},Bn=wi(Qo,"Drill").map(vt=>({key:vt.key,label:vt.label,render:yr=>Jl(vt.key,vt.kind,vt.propSchema,O(yr.row,vt.key),void 0,_,x,ze,A),sortable:!1,width:vt.width})),yo=Sl===0?b("span",{children:"(empty)",className:uc}):b("div",{children:b(Q0,{columns:Bn,data:sr,keyFn:vt=>vt.key,onRowClick:vt=>G(Y.concat([Xe,vt.key])),density:"Comfortable"}),className:K3}),bi=Hr!==void 0&&Hr.id!==ia?ei(Hr):yo;return M("div",{children:[M("div",{children:[b("span",{children:Lr,className:DMe}),M("span",{children:[br.length>1?b(cf.make,{modes:br,activeId:fe(Hr,ia,vt=>vt.id),onSelect:bo}):null,b(bf,{count:Sl,label:"items",onClick:()=>G(Y.concat([Xe]))})],style:{display:"inline-flex",alignItems:"center",gap:"8px"}})],className:NMe}),bi],className:$Me},Xe)}return be(Xe,Lr,b(XD,{items:OMe(kr)}))}),className:CMe});case"JSONArray":let He=Y3(Q3(re.data)),Ze=D(T(K(re.schema),Ge=>O(Ge,"items")),re.schema),wr=wi(Ze,"Drill").map(Ge=>({key:Ge.key,label:Ge.label,render:Xe=>Jl(Ge.key,Ge.kind,Ge.propSchema,O(Xe.row,Ge.key),void 0,_,x,ze,A),sortable:!1,width:Ge.width}));return He.length===0?b("span",{children:"(empty)",className:uc}):b("div",{children:b(Q0,{columns:wr,data:He,keyFn:Ge=>Ge.key,onRowClick:Ge=>G(Y.concat([Ge.key])),density:"Comfortable"}),className:K3})}return b("div",{children:ny(re.data,void 0,void 0),className:ry})},Xt=a!==void 0&&a!=="id"?T(T(T(K(p),re=>O(re,a)),ce),re=>{if(re!=="")return re}):void 0,wt=D(Xt,D(l,f)),Zn=re=>o!==void 0&&i!==void 0&&l!==void 0?ea(o,i,l,Y.slice(0,re)):"#",Mr=J!==void 0?J.map((re,_e)=>{let Ce=_e===(J.length-1|0);return{label:_e===0?wt:re.label,href:Ce?void 0:Zn(_e)}}):[{label:wt,href:void 0}],j=re=>{let _e=re.target,Ce=_e.tagName,Le=re.metaKey||re.ctrlKey||re.shiftKey||re.altKey||re.button!==0;if(Ce!=="A"||Le)return;if(re.preventDefault(),V){let Ge=_e.pathname,Xe=_e.search;return C(Ge+Xe)}let dt=_e.parentNode.querySelectorAll("a").findIndex(Ge=>Ge===_e),wr=dt<0?0:dt;G(Y.slice(0,wr))},me;if(J!==void 0){let re=J[J.length-1|0];me=re!==void 0?st(re):null}else me=b(Da,{title:"Drill path no longer valid",detail:"The data shape has changed since this view was opened.",onRetry:()=>G([])});let Ue=Y.length===0,Fe=Ue?ZM(g.filter(re=>re.level==="Instance"),Q,u):[],ye;if(Ue&&u!==void 0){let re=JNe(h,u,D(Ho(Q,u),""));ye=re.length!==0?b(M5,{steps:re}):void 0}else ye=void 0;return M("div",{children:[Ue?M("div",{children:[b("h2",{children:wt,className:EMe}),t!==void 0&&l!==void 0?t(l):null],className:SMe}):b("div",{children:b(bMe,{crumbs:Mr}),className:xMe,onClick:j}),D(ye,null),Fe.length!==0?b("div",{children:Fe.map(re=>b("button",{children:re.label,className:kMe,onClick:_e=>P(Ce=>re)},re.name)),className:wMe}):null,me,Ue&&r!==void 0&&l!==void 0?r(l):null,fe(I[0],null,re=>b(Ww,{isOpen:!0,onClose:()=>P(_e=>{}),title:re.label,children:b(d2,{schema:re.schema,aggregateId:l,aggregateIdField:re.aggregateIdField,refFields:re.refFields,onSubmit:_e=>v!==void 0?qt(v(re.mutationDocument,mt(re.schema,_e)).then(Ce=>{let Le=Zc(Ce);if(typeof Le!="object")return Le==="Accepted"?(P(He=>{}),k||ie(w,He=>He()),Promise.resolve("Ok")):(P(He=>{}),k||setTimeout(()=>ie(w,He=>He()),500),Promise.resolve("Ok"));{let He=Le._0;return wv(v,_,He.errorCode,He.detail).then(Ze=>Promise.resolve({TAG:"Err",_0:Ze}))}}),Ce=>Promise.resolve({TAG:"Err",_0:"Request failed"})):(P(Ce=>{}),Promise.resolve("Ok")),submitLabel:"Execute"})}))],className:yMe})}let X3=LMe;function cs(e){return"var("+e+")"}let zMe=E([L("flex"),he("column"),c("gap",cs(F.md))]),UMe=E([L("flex"),ee("center"),Qe("spaceBetween"),c("padding-bottom",cs(F.sm)),c("border-bottom","1px solid var("+y.border+")")]),BMe=E([c("font-size",cs($.sizeLg)),c("font-weight",cs($.weightMedium)),c("color",cs(y.textPrimary)),yn(ke(0))]),jMe=E([L("flex"),pi("wrap"),c("gap",cs(F.sm))]),qMe=E([c("background",cs(y.surface)),c("color",cs(y.textPrimary)),c("border","1px solid var("+y.border+")"),c("border-radius",cs(X.md)),c("padding","var("+F.xs+") var("+F.md+")"),c("font-size",cs($.sizeSm)),c("cursor","pointer")]);function VMe(e,t){let r=D(T(T(K(e),i=>O(i,"properties")),K),{}),n={};return et(t).forEach(i=>{let o=i[1],s=i[0],a=D(T(T(T(O(r,s),K),d=>O(d,"type")),ce),"string"),l,u=0;switch(a){case"array":if(o==="")l=[];else try{l=JSON.parse(o)}catch{l=[o]}break;case"boolean":l=o==="true";break;case"integer":case"number":u=1;break;case"object":if(o==="")l=null;else try{l=JSON.parse(o)}catch{l=null}break;default:l=o}u===1&&(l=D(W(Ya(o),d=>d),o)),n[s]=l}),n}function KMe(e){let t=e.contextId,r=e.slice,n=po(),i=pl(),o=oe(()=>{}),s=o[1];return M("div",{children:[b("div",{children:b("h2",{children:r.name,className:BMe}),className:UMe}),b("div",{children:r.commands.map(a=>b("button",{children:a.label,className:qMe,onClick:l=>s(u=>a)},a.name)),className:jMe}),fe(o[0],null,a=>b(Ww,{isOpen:!0,onClose:()=>s(l=>{}),title:a.label,children:b(d2,{schema:a.schema,aggregateId:t,aggregateIdField:a.aggregateIdField,injectNewId:a.level==="Collection",refFields:a.refFields,onSubmit:l=>n!==void 0?qt(n(a.mutationDocument,VMe(a.schema,l)).then(u=>{let d=Zc(u);if(typeof d=="object"){let f=d._0;return wv(n,i,f.errorCode,f.detail).then(h=>Promise.resolve({TAG:"Err",_0:h}))}return s(f=>{}),Promise.resolve("Ok")}),u=>Promise.resolve({TAG:"Err",_0:"Request failed"})):(s(u=>{}),Promise.resolve("Ok")),submitLabel:"Execute"})}))],className:zMe})}let HMe=KMe;function ja(e){return"var("+e+")"}let WMe=E([L("flex"),he("column"),c("gap",ja(F.xl))]),GMe=E([c("font-size",ja($.sizeXl)),c("font-weight",ja($.weightMedium)),c("color",ja(y.textPrimary)),yn(ke(0))]),JMe=E([L("flex"),he("column"),c("gap",ja(F.md)),c("padding",ja(F.lg)),c("background",ja(y.surfaceSubtle)),c("border","1px solid var("+y.borderSubtle+")"),c("border-radius",ja(X.md))]);function Ez(e){return e.filter(t=>pFe(t.schema,t.statusField,t.commands))}function QMe(e){let t=Ez(e.views);return M("div",{children:[b("h2",{children:"Lifecycles",className:GMe}),t.length!==0?t.map(r=>b("div",{children:b(NFe,{schema:r.schema,statusField:D(r.statusField,""),commands:r.commands,title:r.name}),className:JMe},r.name)):b(sd,{title:"No lifecycles",description:"No view in this plugin declares a status enum with state-scoped commands."})],className:WMe})}let YMe=QMe;function xt(e){return"var("+e+")"}let XMe=E([L("flex"),he("column"),c("gap",xt(F.md)),c("font-family",xt($.fontFamily))]),ZMe=E([L("flex"),ee("center"),c("gap",xt(F.sm)),c("color",xt(y.textSecondary)),c("font-size",xt($.sizeSm)),c("font-weight",xt($.weightMedium)),c("text-transform","uppercase"),c("letter-spacing","0.04em")]),e4e=E([L("inlineFlex"),ee("center"),c("padding","0 6px"),c("border-radius",xt(X.full)),c("background",xt(y.surfaceElevated)),c("color",xt(y.textPrimary)),c("font-size",xt($.sizeXs)),c("letter-spacing","0")]),t4e=E([L("flex"),he("column"),c("gap",xt(F.md))]),r4e=E([L("flex"),ee("flexStart"),c("gap",xt(F.sm))]),n4e=E([L("flex"),he("column"),c("gap","2px"),c("min-width","0"),fo(1)]),i4e=E([L("flex"),ee("baseline"),c("gap",xt(F.sm))]),o4e=E([c("color",xt(y.textPrimary)),c("font-size",xt($.sizeSm)),c("font-weight",xt($.weightMedium))]),s4e=E([c("color",xt(y.textDisabled)),c("font-size",xt($.sizeXs))]),a4e=E([c("color",xt(y.textPrimary)),c("font-size",xt($.sizeSm)),c("line-height",xt($.lineHeightNormal)),c("white-space","pre-wrap"),c("word-break","break-word")]),l4e=E([c("color",xt(y.textDisabled)),c("font-size",xt($.sizeSm)),c("padding","var("+F.sm+") 0")]),u4e=E([L("flex"),he("column"),ee("flexEnd"),c("gap",xt(F.sm))]),c4e=E([c("width","100%"),c("min-height","64px"),c("padding",xt(F.sm)),c("background",xt(y.surface)),c("border","1px solid var("+y.border+")"),c("border-radius",xt(X.md)),c("color",xt(y.textPrimary)),c("font-family",xt($.fontFamily)),c("font-size",xt($.sizeSm)),c("resize","vertical")]),d4e=E([c("background",xt(y.brand)),c("border","none"),c("border-radius",xt(X.md)),c("color",xt(y.textOnBrand)),c("padding","4px var("+F.md+")"),c("font-size",xt($.sizeSm)),c("font-weight",xt($.weightMedium)),we("pointer"),WD([c("opacity","0.5"),we("default")])]),f4e=E([c("color",xt(y.error)),c("font-size",xt($.sizeXs)),c("align-self","flex-start")]);function h4e(e){let t=e.comment,r=t.timestamp;return M("div",{children:[b(ad,{name:D(t.author,"?"),src:t.authorImageUrl,size:"Medium"}),M("div",{children:[M("div",{children:[b("span",{children:D(t.author,"Unknown"),className:o4e}),r!==void 0?b("span",{children:jm(e.nowMs,r),className:s4e}):null],className:i4e}),b("span",{children:t.body,className:a4e})],className:n4e})],className:r4e})}function p4e(e){let t=e.nowMs,r=e.error,n=e.posting,i=e.onPost,o=e.emptyLabel,s=e.title,a=e.comments,l=s!==void 0?s:"Comments",u=o!==void 0?o:"No comments yet",d=n!==void 0?n:!1,f=t!==void 0?t:Date.now(),h=oe(()=>""),p=h[1],g=h[0],m=g.trim(),v=m!==""&&!d,_=()=>{if(v)return ie(i,x=>x(m)),p(x=>"")};return M("div",{children:[M("div",{children:[l,b("span",{children:a.length.toString(),className:e4e})],className:ZMe}),a.length===0?b("div",{children:u,className:l4e}):b("div",{children:a.map(x=>b(h4e,{comment:x,nowMs:f},x.id)),className:t4e}),i!==void 0?M("div",{children:[b("textarea",{className:c4e,disabled:d,placeholder:"Write a comment…",value:g,onKeyDown:x=>{if(x.key==="Enter"&&(x.metaKey||x.ctrlKey))return x.preventDefault(),_()},onChange:x=>{let w=x.target.value;p(S=>w)}}),r!==void 0?b("span",{children:r,className:f4e}):null,b("button",{children:d?"Posting…":"Comment",className:d4e,disabled:!v,onClick:x=>_()})],className:u4e}):null],className:XMe})}let g4e=p4e;function m4e(e){let t=e.entityId,r=e.binding,n=po(),i=pl(),o=Yh(),s=fe(e.requiredAccess,!1,v=>!o(v)),a=_u(r.readModel,!s),l=oe(()=>!1),u=l[1],d=oe(()=>{}),f=d[1],h=v=>{let _=r.postCommand;if(n!==void 0&&_!==void 0){u(x=>!0),f(x=>{}),qt(n(_.mutationDocument,zRe(r,t,v)).then(x=>{u(S=>!1);let w=Zc(x);if(typeof w!="object")return a.refetch(),Promise.resolve();{let S=w._0;return wv(n,i,S.errorCode,S.detail).then(k=>(f(A=>k),Promise.resolve()))}}),x=>(u(w=>!1),f(w=>"Could not post the comment."),Promise.resolve()));return}};if(s)return null;let p=LRe(r,a.rows,t),g=r.postCommand;return b(g4e,{comments:p,onPost:n!==void 0&&g!==void 0?h:void 0,posting:l[0],error:d[0]})}let v4e=m4e;function gs(e){return"var("+e+")"}let _4e=E([L("flex"),he("column"),c("gap",gs(F.lg))]),b4e=E([L("flex"),ee("center"),Qe("spaceBetween"),c("gap",gs(F.md))]),y4e=E([c("font-size",gs($.sizeXl)),c("font-weight",gs($.weightMedium)),c("color",gs(y.textPrimary)),yn(ke(0))]),x4e=E([L("flex"),pi("wrap"),ee("center"),c("gap",gs(F.md)),c("font-size",gs($.sizeSm)),c("color",gs(y.textSecondary))]),S4e=E([L("inlineFlex"),ee("center"),c("gap","4px"),we("pointer")]);function E4e(e){return E([L("inlineBlock"),c("width","8px"),c("height","8px"),c("border-radius","50%"),c("background",e)])}let w4e=E([c("font-size",gs($.sizeXs)),c("color",gs(y.textDisabled))]);function k4e(e){let t=e.uiHints,r=e.resource,n=e.pluginId,i=dl(),o=oe(()=>[]),s=o[1],a=o[0],l=R=>Vr(R.schema,T(t,N=>il(N,R.name))),u=_u(r,!0),d=r.name,f=u.rows,h=r.schema,p=l(r),v={readModelName:d,rows:f,schema:h,semantics:p,onOpenRow:(R,N)=>i(ea(n,r.name,R,[])),role:yu},_=e.events.map((R,N)=>{let I=!a.includes(R.readModel.name),P=_u(R.readModel,I);return[R,N,I,P]}),x=(R,N)=>D(T(T(t,I=>$o(I,R.name)),I=>I.accent),rd[Oo(N,rd.length)]),w=se(_,R=>{if(!R[2])return;let N=R[0];return{readModelName:N.readModel.name,rows:R[3].rows,schema:N.readModel.schema,semantics:l(N.readModel),accent:x(N.readModel,R[1]),onOpenRow:(I,P)=>i(ea(n,N.readModel.name,I,[])),role:xu,resourceRef:N.resourceRef}}),S=[v].concat(w),k=u.fetchState,A;A=typeof k!="object"?k==="Loading"?[r.name+": loading…"]:[]:[r.name+": "+k._0];let C=A.concat(se(_,R=>{let N=R[0],I=R[3].fetchState;if(R[2])return typeof I!="object"?I==="Loading"?N.readModel.name+": loading…":void 0:N.readModel.name+": "+I._0}));return M("div",{children:[b("div",{children:b("h2",{children:e.canvasName,className:y4e}),className:b4e}),b("div",{children:_.map(R=>{let N=R[0];return M("label",{children:[b("input",{checked:R[2],type:"checkbox",onChange:I=>{let P=N.readModel.name;s(z=>z.includes(P)?z.filter(q=>q!==P):z.concat([P]))}}),b("span",{className:E4e(x(N.readModel,R[1]))}),N.readModel.name],className:S4e},N.readModel.name)}),className:x4e}),e.mode.render(S),C.length!==0?b("span",{children:C.join(" · "),className:w4e}):null],className:_4e})}let C4e=k4e;function R4e(e){if(typeof e=="object")return"heuristic:"+e._0;switch(e){case"Annotation":return"annotation";case"Type":return"type";case"Hint":return"hint"}}function wz(e,t,r){return t!==void 0?Object.entries(LFe(e.schema,t,e.commands,T(r,n=>n.transitions))):[]}function A4e(e,t,r){let n=e.name,i=e.schema,o=Vr(i,t),s=et(o.semantics).map(d=>{let f=d[1];return bt([["field",d[0]],["semantic",Dh(f.semantic)],["provenance",R4e(f.provenance)]])}),a=[];ie(o.geo,d=>{a.push(["geo",d.latField+"/"+d.lngField])}),ie(o.dateSpan,d=>{a.push(["dateSpan",fe(d.endField,d.startField,f=>d.startField+".."+f)])}),ie(o.statusField,d=>{a.push(["status",d])}),ie(o.labelField,d=>{a.push(["label",d])}),ie(o.imageField,d=>{a.push(["image",d])}),ie(o.parentField,d=>{a.push(["parent",d])});let l=$S(i).map(d=>d.id),u=wz(e,o.statusField,r).map(d=>{let f=d[1];return[d[0],f.command+" ("+DFe(f.tier)+")"]});return bt([["view",n],["capableModes",l],["roles",bt(a)],["transitions",bt(u)],["fields",s]])}function T4e(e,t,r){return bt([["plugin",e],["views",t.map(n=>A4e(n,T(r,i=>il(i,n.name)),T(r,i=>$o(i,n.name))))]])}function $4e(e,t){return e.map(r=>{let n=r.name,i=r.schema,o=Vr(i,T(t,g=>il(g,n))),s=$S(i).map(g=>g.id).join(", "),a=[];ie(o.geo,g=>{a.push("geo="+g.latField+"/"+g.lngField)}),ie(o.dateSpan,g=>{a.push("dateSpan="+fe(g.endField,g.startField,m=>g.startField+".."+m))}),ie(o.statusField,g=>{a.push("status="+g)}),ie(o.labelField,g=>{a.push("label="+g)}),ie(o.imageField,g=>{a.push("image="+g)}),ie(o.parentField,g=>{a.push("parent="+g)});let l=a.length===0?"":"; "+a.join("; "),u=Object.keys(o.semantics).length,d=wz(r,o.statusField,T(t,g=>$o(g,n))),f=o.statusField,h=d.length,p=f!==void 0?"; "+h.toString()+" transition(s)":"";return n+": modes "+s+l+p+"; "+u.toString()+" field semantic(s)"})}function N4e(e,t,r){console.log('[AutoUI] Inference report — plugin "'+e+'"'),$4e(t,r).forEach(n=>{console.log(" "+n)}),console.log(JSON.stringify(T4e(e,t,r),null,2))}function iy(e){return e.replace(/[^A-Za-z0-9-]/g,"-")}function D4e(e,t,r){return"/"+iy(e)+"/"+iy(t)+"/"+iy(r)}function F4e(e){return Object.fromEntries([["kind",e.kind],["senderId",e.senderId],["sentAt",e.sentAt],["body",e.body]])}function I4e(e){let t=ge.object(e);if(t===void 0)return;let r=o=>T(t[o],ge.string),n=r("kind"),i=r("senderId");if(n!==void 0&&i!==void 0)return{kind:n,senderId:i,sentAt:D(T(t.sentAt,ge.float),0),body:D(t.body,null)}}function P4e(e,t,r,n,i){let o=n!==void 0?n:!0,s=Zh(),a=T(s,h=>h.clientNamespace()),l=o&&We(a)&&fe(s,!1,h=>h.clientChannelsAvailable()),u=a!==void 0?D4e(a,e,t):void 0,d=Je(i);return d.current=i,Re(()=>{let h=l?s:void 0;if(h!==void 0&&u!==void 0)return h.subscribe("Domain",u,p=>{let g=I4e(p);if(g!==void 0&&g.senderId!==r)return d.current(g)})},[l,D(u,""),r]),{available:l,publish:(h,p)=>{let g=l?s:void 0;if(g===void 0||u===void 0)return;let m=Date.now(),v={kind:h,senderId:r,sentAt:m,body:p};g.publish("Domain",u,[F4e(v)]).then(_=>{_.TAG!=="Ok"&&console.warn("[AutoClientChannel] publish to "+u+" failed: "+_._0)})}}}let X1="heartbeat",Z1="hello",kz="leave";function Z3(e){let t=ge.object(e);if(t===void 0)return;let r=i=>T(t[i],ge.string),n=r("userId");if(n!==void 0&&n!=="")return[n,D(r("username"),n)]}function O4e(e,t,r){let n=t.kind;if(n===kz){let a=Z3(t.body);if(a===void 0)return e;let l=a[0];return e.filter(u=>u.userId!==l)}if(n!==X1&&n!==Z1)return e;let i=Z3(t.body);if(i===void 0)return e;let o=i[0];return e.filter(a=>a.userId!==o).concat([{userId:o,username:i[1],lastSeen:r}])}function M4e(e,t){return e.filter(r=>t-r.lastSeen<25e3)}function L4e(e,t){return Object.fromEntries([["userId",e],["username",t]])}function z4e(e,t,r,n,i){let o="presence",s=i!==void 0?i:!0,a=oe(()=>[]),l=a[1],u=Je(void 0),f=P4e(o,t,r,s&&r!=="",g=>{if(l(v=>O4e(v,g,Date.now())),g.kind!==Z1)return;let m=u.current;if(m!==void 0){setTimeout(()=>m(),Math.random()*1e3);return}}),h=f.available,p=f.publish;return Re(()=>{if(!h)return;let g=L4e(r,n),m=()=>p(X1,g);u.current=m,p(Z1,g),p(X1,g);let v=setInterval(m,1e4);return()=>{clearInterval(v),u.current=void 0,p(kz,g)}},[h,r,n,t]),Re(()=>{if(!h)return;let g=setInterval(()=>l(m=>M4e(m,Date.now())),1e4);return()=>{clearInterval(g)}},[h]),h?a[0]:[]}function V0(e){return"var("+e+")"}let U4e=E([L("inlineFlex"),ee("center"),c("gap",V0(F.xs))]),B4e=E([c("font-family",V0($.fontFamily)),c("font-size",V0($.sizeSm)),c("color",V0(y.textSecondary)),c("white-space","nowrap")]);function j4e(e){return e===1?"1 other here":e.toString()+" others here"}function q4e(e){let t=e.showLabel,r=e.max,n=e.size,i=e.people,o=n!==void 0?n:"Small",s=r!==void 0?r:4,a=t!==void 0?t:!0;if(i.length===0)return null;let l=i.map(u=>({name:u.username,imageUrl:u.imageUrl}));return M("span",{children:[b(eF,{members:l,size:o,max:s}),a?b("span",{children:j4e(i.length),className:B4e}):null],className:U4e,title:i.map(u=>u.username).join(", ")})}let V4e=q4e;function K4e(e){let t=ml(),r=T(t,a=>a.identity),n=fe(r,"",a=>a.userId),i=fe(r,"",a=>a.username),s=z4e(void 0,e.readModel+"-"+e.entityId,n,i===""?n:i,n!=="").map(a=>({userId:a.userId,username:a.username}));return b(V4e,{people:s})}let H4e=K4e;function Cz(e){return e===""?e:e.slice(0,1).toUpperCase()+e.slice(1,e.length)}function kv(e){return e.endsWith("s")?e:e+"s"}function qa(e){let t=e.length;return t>1&&e.endsWith("s")?e.slice(0,t-1|0):e}let ex={contents:[]},tx={contents:[]};function rx(e,t,r){if(r!=="id")return;let n=e+"."+t;if(!ex.contents.some(i=>i===n)){ex.contents.push(n),console.warn("[AutoUI] Entity "+n+' has labelField="id" — dropdown labels will render as raw UUIDs. Add a @displayName annotation on the source state to fix.');return}}function nx(e,t,r,n){if(r==="id"||n.length!==0&&n.some(o=>o===r))return;let i=e+"."+t;if(!tx.contents.some(o=>o===i)){tx.contents.push(i),console.warn("[AutoUI] Entity "+i+' labelField="'+r+'" is not @searchable; searchPrefix will scan the table — OK at small scale, consider annotating for production.');return}}function Rz(e){let t=[];return e.forEach(r=>{r.readModels.forEach(n=>{rx(r.id,n.name,n.labelField),nx(r.id,n.name,n.labelField,n.searchableFields),t.push({pluginId:r.id,name:n.name,queryField:n.queryField,singleQueryField:qa(n.queryField),labelField:n.labelField})}),r.stateViewSlices.forEach(n=>{rx(r.id,n.name,n.labelField),nx(r.id,n.name,n.labelField,n.searchableFields),t.push({pluginId:r.id,name:n.name,queryField:n.queryField,singleQueryField:qa(n.queryField),labelField:n.labelField})})}),t}function K0(e,t){let r=e.toLowerCase(),n=o=>{let s=o.length,a=e.length;if(a>s&&r.endsWith(o))return e.slice(0,a-s|0)};if(!t)return n("id");let i=n("ids");return i!==void 0?i:n("id")}function f2(e){return e.endsWith("s")?[qa(e),e]:[e,kv(e)]}function nd(e,t){return e.find(r=>r.name===t)}function h2(e,t){let r=Cz(t),n=kv(r),i=nd(e,n);return i!==void 0?i:nd(e,r)}function Az(e){return se(D(T(T(K(e),t=>O(t,"required")),Vt),[]),ce)}function Tz(e,t,r,n){return se(e.references,i=>{let o=O(n,i.fieldName),s=T(o,K),a=T(T(s,p=>O(p,"type")),ce),l=ot(a,"array"),u=i.plugin,d=u!==void 0?t.filter(p=>p.pluginId===u):t,f=nd(d,i.entity),h=f!==void 0?f:h2(d,i.entity);if(h!==void 0){let p=f2(h.name);return{propertyKey:i.fieldName,queryField:h.queryField,singleQueryField:h.singleQueryField,labelField:h.labelField,multi:l,required:r.some(g=>g===i.fieldName),entityName:p[0],entityNamePlural:p[1]}}console.warn("[AutoUI] Command "+e.name+" field "+i.fieldName+': explicit @ref to "'+i.entity+'" did not resolve to a registered entity. Falling back to text input.')})}function $z(e,t,r,n,i,o){let s=[];return i!==void 0&&et(i).forEach(a=>{let l=a[0],u=K(a[1]);if(We(T(u,w=>O(w,"const"))))return;let f=T(T(u,w=>O(w,"type")),ce),h=T(T(T(T(u,w=>O(w,"items")),K),w=>O(w,"type")),ce),p;if(f!==void 0)switch(f){case"array":p=h==="string"?!0:void 0;break;case"string":p=!1;break;default:p=void 0}else p=void 0;if(p===void 0)return;let g=!1;if(e.level==="Collection"&&!p){let w;if(t!==void 0)if(ot(e.aggregateIdField,l))w=!0;else{let S=K0(l,!1);w=S!==void 0?S.toLowerCase()===t.name.toLowerCase():!1}else w=ot(e.aggregateIdField,l);g=w}if(g)return;let m=e.aggregateIdField,v;if(m!==void 0&&t!==void 0&&m===l&&!p){let w=nd(r,kv(t.name));v=w!==void 0?w:nd(r,t.name)}else v=void 0;let _;if(v!==void 0)_=v;else{let w=K0(l,p);_=w!==void 0?h2(r,w):void 0}if(_!==void 0){_.pluginId!==o&&console.warn("[AutoUI] Command "+e.name+" field "+l+' resolved cross-plugin to "'+_.name+'" in plugin "'+_.pluginId+'" via naming heuristic. Add @ref("'+_.pluginId+"."+_.name+'") to make the cross-plugin reference explicit, or @ref("<LocalEntity>") to target a same-plugin entity.');let w=f2(_.name),S=_.queryField,k=_.singleQueryField,A=_.labelField,C=n.some(P=>P===l),R=w[0],N=w[1],I={propertyKey:l,queryField:S,singleQueryField:k,labelField:A,multi:p,required:C,entityName:R,entityNamePlural:N};s.push(I);return}if(K0(l,p)!==void 0){console.warn("[AutoUI] Command "+e.name+" field "+l+" looks like a reference but no matching entity was registered. Falling back to text input.");return}}),s}function Nz(e,t,r,n){let i=Az(e.schema),o=T(T(K(e.schema),a=>O(a,"properties")),K);if(e.references.length===0)return $z(e,t,r,i,o,n);let s=D(o,{});return Tz(e,r,i,s)}function Dz(e,t){let r=(n,i)=>({name:n.name,label:n.label,schema:n.schema,mutationDocument:n.mutationDocument,requiredRole:n.requiredRole,level:n.level,aggregateIdField:n.aggregateIdField,refFields:Nz(n,i,t,e.id),references:n.references,allowedStates:n.allowedStates,targetState:n.targetState});return{id:e.id,name:e.name,readModels:e.readModels.map(n=>({name:n.name,schema:n.schema,queryDocument:n.queryDocument,queryField:n.queryField,sortIndex:n.sortIndex,commands:n.commands.map(i=>r(i,void 0)),linkedWriteSide:n.linkedWriteSide,labelField:n.labelField,searchableFields:n.searchableFields,statusField:n.statusField})),aggregates:e.aggregates.map(n=>({name:n.name,schema:n.schema,commands:n.commands.map(i=>r(i,n)),linkedViews:n.linkedViews})),stateViewSlices:e.stateViewSlices,stateChangeSlices:e.stateChangeSlices.map(n=>({name:n.name,commands:n.commands.map(i=>r(i,void 0)),linkedViews:n.linkedViews,consistencyRead:n.consistencyRead}))}}let W4e={capitalize:Cz,pluralize:kv,singularize:qa,warnedIdLabel:ex,warnedUnsearchable:tx,warnIfIdLabel:rx,warnIfUnsearchable:nx,buildRegistry:Rz,stemFromKey:K0,entityDisplayNames:f2,findByName:nd,findByStem:h2,requiredSet:Az,resolveExplicitRefs:Tz,resolveByHeuristic:$z,resolveForCommand:Nz,enrichPlugin:Dz};function Cv(e){let t=ge.object(e);if(t===void 0)return;let r=T(t.properties,ge.object);if(r!==void 0)return r;let n=T(T(T(t.items,ge.object),i=>i.properties),ge.object);return n!==void 0?n:lt(["anyOf","oneOf","allOf"],void 0,(i,o)=>i!==void 0?i:T(T(t[o],ge.array),s=>lt(s,void 0,(a,l)=>a!==void 0?a:Cv(l))))}function Fz(e,t,r){let n=t!==void 0?t:3,i=r!==void 0?r:!0,o=Object.keys(e);return(i&&!o.includes("id")?["id"].concat(o):o).map(a=>{if(n<=0)return a;let l=T(e[a],Cv);return l!==void 0?a+" { "+Fz(l,n-1|0,!1)+" }":a}).join(" ")}function G4e(e,t){return Object.keys(e).filter(i=>{let o=e[i];return o!==void 0?no(Cv(o)):!0}).join(" ")}function Iz(e,t,r){let n=Object.keys(e),i=n.includes("id")?n:["id"].concat(n);return se(i,o=>{let s=e[o];if(s===void 0)return o;let a=Cv(s);if(a===void 0)return o;let l=G4e(a);if(l!=="")return o+" { "+l+" }"}).join(" ")}function Rv(e){return D(T(T(ge.object(e),t=>t.properties),ge.object),{})}function eD(e,t,r,n,i,o){let s=n!==void 0?n:!1,a=i!==void 0?i:!1,l=o!==void 0?o:!1,u=Iz(Rv(t)),d=s||l;if((d||a)&&r!==void 0){let h=r+"Filter",p=r+"OrderBy",g=["$first: Int","$after: String","$last: Int","$before: String"],m=d?["$filter: "+h].concat(g):g,v=a?m.concat(["$orderBy: "+p]):m,_=["first: $first","after: $after","last: $last","before: $before"],x=d?["filter: $filter"].concat(_):_,w=a?x.concat(["orderBy: $orderBy"]):x,S=v.join(", "),k=w.join(", ");return"query("+S+") { "+e+"("+k+") { pageInfo { hasNextPage hasPreviousPage startCursor endCursor } edges { cursor node { "+u+" } } } }"}return"{ "+e+" { edges { node { "+u+" } } } }"}function tD(e,t){let r=Fz(Rv(t),void 0,void 0),n=xx(t);return n!==void 0?"query($id: ID!, $subId: String!) { "+e+"(id: $id, "+n+": $subId) { "+r+" } }":"query($id: ID!) { "+e+"(id: $id) { "+r+" } }"}function J4e(e,t){let r=Iz(Rv(t));return"query($ids: [String!]!) { "+e+"ByIds(ids: $ids) { "+r+" } }"}function Q4e(e){return yx(e).length===0?no(xx(e)):!1}function Y4e(e){let t=Object.keys(Rv(e));return t.includes("updatedAt")?"updatedAt":t.includes("createdAt")?"createdAt":void 0}function X4e(e,t,r,n,i,o,s,a,l,u,d){let f=[],h=i!==void 0?i:[],p=o!==void 0?o:[],g=s!==void 0?s:[],m={},v={},_={};W(d,j=>Jte(j,e));let x=h.length===0?[e]:h,w=Rz(x),S=Dz(e,w),k={},A=(j,me)=>{let Ue=O(k,j);Ue!==void 0?k[j]=Ue.concat(me):k[j]=me};S.aggregates.forEach(j=>{j.linkedViews.forEach(me=>A(me,j.commands))}),S.stateChangeSlices.forEach(j=>{let me=j.commands.filter(Fe=>Fe.level==="Collection"),Ue=j.commands.filter(Fe=>Fe.level==="Instance");j.linkedViews.forEach(Fe=>A(Fe,me)),ie(j.consistencyRead,Fe=>A(Fe,Ue))});let C=[],R=tu(),N=S.id,I=(j,me,Ue,Fe,ye,re)=>{let _e=Q4e(j.schema),Ce=_e?j.queryField+"ByIds":void 0,Le=_e?J4e(j.queryField,j.schema):void 0,He=Y4e(j.schema),Ze=D(Pq(j.schema),!0),dt=j.name,wr=zs(wa(N,dt)),Ge=O(v,dt),Xe=Ue+dt,vr={label:dt,icon:void 0,group:S.name,sortOrder:j.sortIndex},Lr={fragmentId:Xe,title:dt,menuEntry:vr,requiredAccess:Ge,url:wr},or=N+"."+dt,Ln=(_o,_i)=>b(GPe,{readModel:j,detailView:me,pluginId:N,openRowId:_o,drillPath:_i,singleQueryField:Fe,detailQueryDocument:ye,byIdsQueryField:Ce,byIdsQueryDocument:Le,sortKeyField:He,liveDefault:Ze,uiHints:d,schedulerJoin:re},or);return C.push(ec(rc(N,dt),_o=>{let _i=rV(_o);return b(CRe,{definition:Lr,children:Ln(_i[0],_i[1])})})),t7(R,N,dt,wa(N,dt)),Lr},P=S.readModels.filter(j=>!p.includes(j.name)).map(j=>{let me=D(O(k,j.name),j.commands),Ue=qa(j.queryField),Fe=J1(j.schema);return j.queryDocument===""?{name:j.name,schema:j.schema,queryDocument:eD(j.queryField,j.schema,Ue,Fe.hasFilter,Fe.hasSort,Fe.hasSearch),queryField:j.queryField,sortIndex:j.sortIndex,commands:me,linkedWriteSide:j.linkedWriteSide,labelField:j.labelField,searchableFields:j.searchableFields,statusField:j.statusField}:{name:j.name,schema:j.schema,queryDocument:j.queryDocument,queryField:j.queryField,sortIndex:j.sortIndex,commands:me,linkedWriteSide:j.linkedWriteSide,labelField:j.labelField,searchableFields:j.searchableFields,statusField:j.statusField}}),z=S.stateViewSlices.filter(j=>!p.includes(j.name)).map(j=>{let me=D(O(k,j.name),[]),Ue=qa(j.queryField),Fe=J1(j.schema),ye=eD(j.queryField,j.schema,Ue,Fe.hasFilter,Fe.hasSort,Fe.hasSearch);return{name:j.name,schema:j.schema,queryDocument:ye,queryField:j.queryField,sortIndex:j.sortIndex,commands:me,linkedWriteSide:j.linkedWriteSide,labelField:j.labelField,searchableFields:j.searchableFields,statusField:j.statusField}}),q=WFe(P.concat(z),d,(j,me)=>{console.warn("[AutoUI] "+S.id+': scheduler canvas "'+j+'" has '+me.toString()+" resource models — its events list omits the scheduler toggle (the generated page still renders)")}),H=S.aggregates,V={readModels:P,aggregates:H},Y=j=>W(MRe(V,j),me=>{let Ue=O(v,me.readModel.name);return Fe=>b(v4e,{binding:me,entityId:Fe,requiredAccess:Ue})}),G=j=>{let me=D(d,d1),Ue=Yte($o(me,j.name),sRe(j.schema));return W(aRe(j,Ue),Fe=>{let ye=O(v,j.name);return re=>b(iMe,{binding:Fe,entityId:re,requiredAccess:ye})})},J=j=>{let me=D(d,d1);if(Xte($o(me,j.name)))return Ue=>b(H4e,{readModel:j.name,entityId:Ue})},Q=j=>{let me=Y(j.name),Ue=G(j);if(!(me===void 0&&Ue===void 0))return Fe=>M(qr,{children:[fe(me,null,ye=>ye(Fe)),fe(Ue,null,ye=>ye(Fe))]})},ue=P.map(j=>{let me=qa(j.queryField),Ue=tD(me,j.schema),Fe=D(W(se(j.linkedWriteSide,_e=>S.aggregates.find(Ce=>Ce.name===_e))[0],_e=>_e.commands),j.commands),ye=O(m,j.name);return I(j,ye!==void 0?ye:(_e,Ce,Le)=>b(X3,{data:Le,schema:j.schema,rootLabel:j.name,commands:Fe,statusField:j.statusField,aggregateId:_e,labelField:j.labelField,drillPath:Ce,pluginId:S.id,viewName:j.name,uiHints:d,entityPanel:Q(j),headerAccessory:J(j)}),S.id+".",me,Ue,O(q,j.name))}),le=z.map(j=>{let me=qa(j.queryField),Ue=tD(me,j.schema),Fe=O(m,j.name);return I(j,Fe!==void 0?Fe:(re,_e,Ce)=>b(X3,{data:Ce,schema:j.schema,rootLabel:j.name,commands:j.commands,statusField:j.statusField,aggregateId:re,labelField:j.labelField,drillPath:_e,pluginId:S.id,viewName:j.name,uiHints:d,entityPanel:Q(j),headerAccessory:J(j)}),S.id+".slice.",me,Ue,O(q,j.name))}),Ae=S.stateChangeSlices.filter(j=>!g.includes(j.name)).map(j=>({fragmentId:S.id+".commands."+j.name,title:j.name,description:"Auto-generated command panel for "+j.name,extensionPackage:S.id,positions:f,component:me=>b(HMe,{slice:j,contextId:me.contextId}),requiredAccess:O(_,j.name),minWidth:void 0})),$e=P.concat(z).toSorted((j,me)=>j.sortIndex===me.sortIndex?zf(j.name,me.name):lx(j.sortIndex,me.sortIndex));We(NS("autoui.inferenceReport"))&&N4e(S.id,$e.map(j=>({name:j.name,schema:j.schema,commands:j.commands})),d);let ze=se(Tg(),j=>{let me=j.arity;if(!(typeof me!="object"||me.TAG!=="Multi"))return[j,me.min]}).flatMap(j=>{let me=j[1],Ue=j[0],Fe={};return $e.forEach(ye=>{let re=T(d,He=>$o(He,ye.name)),_e=fe(T(re,He=>He.suppress),!1,He=>He.includes(Ue.id));if(!(Ue.isCapable(ye.schema)&&!_e))return;let Ce=D(T(re,He=>He.canvas),Ue.label),Le=O(Fe,Ce);Le!==void 0?Le.push(ye):Fe[Ce]=[ye]}),se(et(Fe),ye=>{let re=ye[1];if(re.length<me)return;let _e=ye[0],Ce=S.id+".canvas."+_e,Le={label:_e,icon:void 0,group:S.name,sortOrder:900},He=zs(wa(N,_e)),Ze={fragmentId:Ce,title:_e,menuEntry:Le,requiredAccess:void 0,url:He};return C.push(ec(rc(N,_e),dt=>b(hMe,{pluginId:N,mode:Ue,canvasName:_e,readModels:re,uiHints:d}))),Ze})}),mt=se(Tg(),j=>{let me=j.arity;if(!(typeof me!="object"||me.TAG==="Multi"))return[j,me._0]}).flatMap(j=>{let me=j[1],Ue=j[0],Fe={},ye={},re=(He,Ze,dt)=>{let wr=O(He,Ze);wr!==void 0?wr.push(dt):He[Ze]=[dt]};$e.forEach(He=>{let Ze=T(d,Ge=>$o(Ge,He.name)),dt=D(T(Ze,Ge=>Ge.canvas),Ue.label),wr=T(Ze,Ge=>Ge.role);if(wr!==void 0)return wr===yu?re(Fe,dt,He):wr===xu?ie(T(Ze,Ge=>Ge.resourceRef),Ge=>re(ye,dt,[He,Ge])):void 0});let _e=(He,Ze)=>fe(me.find(dt=>dt.role===He),Ze,dt=>dt.min),Ce=_e(yu,1),Le=_e(xu,1);return se(et(Fe),He=>{let Ze=He[1],dt=He[0],wr=D(O(ye,dt),[]),Ge=Ze[0];if(Ge===void 0||!(Ze.length>=Ce&&wr.length>=Le))return;let Xe=wr.map(Ln=>({readModel:Ln[0],resourceRef:Ln[1]})),vr=S.id+".scheduler."+dt,kr={label:dt,icon:void 0,group:S.name,sortOrder:910},Lr=zs(wa(N,dt)),or={fragmentId:vr,title:dt,menuEntry:kr,requiredAccess:void 0,url:Lr};return C.push(ec(rc(N,dt),Ln=>b(C4e,{pluginId:N,canvasName:dt,mode:Ue,resource:Ge,events:Xe,uiHints:d}))),or})}),be=P.concat(z).flatMap(j=>Dq(j.schema).map(me=>({view:j.name,label:me[2],field:me[0],aggregate:me[1]}))),Se=D(T(d,j=>j.dashboard),[]),st=Se.map(j=>[j.view,D(j.field,"")]),Xt=Se.concat(be.filter(j=>!st.some(me=>me[0]===j.view?me[1]===D(j.field,""):!1))),wt;if(Xt.length!==0){let j="Dashboard",me=P.concat(z),Ue=S.id+".dashboard",Fe={label:j,icon:void 0,group:S.name,sortOrder:-100},ye=zs(wa(N,j)),re={fragmentId:Ue,title:j,menuEntry:Fe,requiredAccess:void 0,url:ye};C.push(ec(rc(N,j),_e=>b(K6e,{pluginId:N,metrics:Xt,readModels:me,uiHints:d}))),wt=[re]}else wt=[];let Zn=Ez(P.concat(z)),Mr;if(Zn.length!==0){let j="Lifecycles",me=S.id+".lifecycles",Ue={label:j,icon:void 0,group:S.name,sortOrder:-50},Fe=zs(wa(N,j)),ye={fragmentId:me,title:j,menuEntry:Ue,requiredAccess:void 0,url:Fe};C.push(ec(rc(N,j),re=>b(YMe,{views:Zn}))),Mr=[ye]}else Mr=[];return{pages:wt.concat(Mr.concat(ue.concat(le.concat(ze.concat(mt))))),panels:Ae,routes:C,publicLinks:R}}let rD=new Map;function Z4e(e,t){let r=rD.get(e);if(!(r!==void 0?r===t:!1)){hD.registerRemotes([{name:e,entry:t}]),rD.set(e,t);return}}async function eLe(e,t,r){Z4e(e,r);try{let n=await hD.loadRemote(e+"/"+t);return n==null?{TAG:"Error",_0:"Module Federation returned null for "+e+"/"+t+" — the plugin's vite federation config probably doesn't expose this fragment."}:{TAG:"Ok",_0:n.default}}catch(n){let i=Su(n);if(i.RE_EXN_ID!==Yg)return{TAG:"Error",_0:"Failed to load "+e+"/"+t+" from "+r};let o=D(i._1.message,"unknown error");return{TAG:"Error",_0:"Failed to load "+e+"/"+t+" from "+r+": "+o}}}const tLe=mr(null),oy={didCatch:!1,error:null};class rLe extends o9{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=oy}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var r,n,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:o,reason:"imperative-api"}),this.setState(oy)}}componentDidCatch(t,r){var n,i;(n=(i=this.props).onError)===null||n===void 0||n.call(i,t,r)}componentDidUpdate(t,r){const{didCatch:n}=this.state,{resetKeys:i}=this.props;if(n&&r.error!==null&&nLe(t.resetKeys,i)){var o,s;(o=(s=this.props).onReset)===null||o===void 0||o.call(s,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(oy)}}render(){const{children:t,fallbackRender:r,FallbackComponent:n,fallback:i}=this.props,{didCatch:o,error:s}=this.state;let a=t;if(o){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")a=r(l);else if(n)a=Ar(n,l);else if(i!==void 0)a=i;else throw s}return Ar(tLe.Provider,{value:{didCatch:o,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function nLe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((r,n)=>!Object.is(r,t[n]))}function iLe(e){let t=D(e.error.message,"unknown error");return b("div",{children:"Plugin fragment crashed: "+t,style:{color:"#a00",fontFamily:"system-ui",padding:"1rem"}})}function oLe(e,t){console.error("Fragment crashed:",e)}function sLe(e){let t=e.fallbackComponent;return Ar(rLe,{FallbackComponent:t!==void 0?t:iLe,onError:oLe,children:e.children})}let aLe=sLe;function lLe(e){let t=e.remoteEntryUrl,r=e.fragmentId,n=e.pluginId,i=oe(()=>"Loading"),o=i[1],s=i[0];return Re(()=>{o(l=>"Loading");let a={contents:!1};return eLe(n,r,t).then(l=>{if(a.contents)return;if(l.TAG==="Ok"){let d=l._0;return o(f=>({TAG:"Loaded",_0:d}))}let u=l._0;o(d=>({TAG:"Failed",_0:u}))}),()=>{a.contents=!0}},[n,r,t]),typeof s!="object"?b("div",{children:"Loading panel…",style:{fontFamily:"system-ui",padding:"0.75rem"}}):s.TAG==="Loaded"?b(aLe,{children:Ar(s._0,e.panelProps)}):b("div",{children:"Panel error: "+s._0,style:{color:"#a00",padding:"0.75rem"}})}let uLe=lLe;function ni(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function Ml(e){return ni(e)==="object"}function cLe(e){return Array.isArray(e)&&e.length>0&&e.every(t=>"message"in t)}function nD(e,t){return e.length<124?e:t}const dLe="graphql-transport-ws";var xi;(function(e){e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(xi||(xi={}));var Ir;(function(e){e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete"})(Ir||(Ir={}));function Pz(e){if(!Ml(e))throw new Error(`Message is expected to be an object, but got ${ni(e)}`);if(!e.type)throw new Error("Message is missing the 'type' property");if(typeof e.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${ni(e.type)}`);switch(e.type){case Ir.ConnectionInit:case Ir.ConnectionAck:case Ir.Ping:case Ir.Pong:{if(e.payload!=null&&!Ml(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break}case Ir.Subscribe:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ni(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!Ml(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${ni(e.payload)}`);if(typeof e.payload.query!="string")throw new Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${ni(e.payload.query)}`);if(e.payload.variables!=null&&!Ml(e.payload.variables))throw new Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${ni(e.payload.variables)}`);if(e.payload.operationName!=null&&ni(e.payload.operationName)!=="string")throw new Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${ni(e.payload.operationName)}`);if(e.payload.extensions!=null&&!Ml(e.payload.extensions))throw new Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${ni(e.payload.extensions)}`);break}case Ir.Next:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ni(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!Ml(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${ni(e.payload)}`);break}case Ir.Error:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ni(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!cLe(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break}case Ir.Complete:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ni(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${e.type}"`)}return e}function fLe(e,t){return Pz(typeof e=="string"?JSON.parse(e,t):e)}function af(e,t){return Pz(e),JSON.stringify(e,t)}var Pc=function(e){return this instanceof Pc?(this.v=e,this):new Pc(e)},hLe=function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(p){return function(g){return Promise.resolve(g).then(p,f)}}function a(p,g){n[p]&&(i[p]=function(m){return new Promise(function(v,_){o.push([p,m,v,_])>1||l(p,m)})},g&&(i[p]=g(i[p])))}function l(p,g){try{u(n[p](g))}catch(m){h(o[0][3],m)}}function u(p){p.value instanceof Pc?Promise.resolve(p.value.v).then(d,f):h(o[0][2],p)}function d(p){l("next",p)}function f(p){l("throw",p)}function h(p,g){p(g),o.shift(),o.length&&l(o[0][0],o[0][1])}};function pLe(e){const{url:t,connectionParams:r,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:o=0,keepAlive:s=0,disablePong:a,connectionAckWaitTimeout:l=0,retryAttempts:u=5,retryWait:d=async function(Y){let G=1e3;for(let J=0;J<Y;J++)G*=2;await new Promise(J=>setTimeout(J,G+Math.floor(Math.random()*2700+300)))},shouldRetry:f=sy,isFatalConnectionProblem:h,on:p,webSocketImpl:g,generateID:m=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,Y=>{const G=Math.random()*16|0;return(Y=="x"?G:G&3|8).toString(16)})},jsonMessageReplacer:v,jsonMessageReviver:_}=e;let x;if(g){if(!mLe(g))throw new Error("Invalid WebSocket implementation provided");x=g}else typeof WebSocket<"u"?x=WebSocket:typeof global<"u"?x=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(x=window.WebSocket||window.MozWebSocket);if(!x)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const w=x,S=(()=>{const V=(()=>{const G={};return{on(J,Q){return G[J]=Q,()=>{delete G[J]}},emit(J){var Q;"id"in J&&((Q=G[J.id])===null||Q===void 0||Q.call(G,J))}}})(),Y={connecting:p?.connecting?[p.connecting]:[],opened:p?.opened?[p.opened]:[],connected:p?.connected?[p.connected]:[],ping:p?.ping?[p.ping]:[],pong:p?.pong?[p.pong]:[],message:p?.message?[V.emit,p.message]:[V.emit],closed:p?.closed?[p.closed]:[],error:p?.error?[p.error]:[]};return{onMessage:V.on,on(G,J){const Q=Y[G];return Q.push(J),()=>{Q.splice(Q.indexOf(J),1)}},emit(G,...J){for(const Q of[...Y[G]])Q(...J)}}})();function k(V){const Y=[S.on("error",G=>{Y.forEach(J=>J()),V(G)}),S.on("closed",G=>{Y.forEach(J=>J()),V(G)})]}let A,C=0,R,N=!1,I=0,P=!1;async function z(){clearTimeout(R);const[V,Y]=await(A??(A=new Promise((Q,ue)=>(async()=>{if(N){if(await d(I),!C)return A=void 0,ue({code:1e3,reason:"All Subscriptions Gone"});I++}S.emit("connecting",N);const le=new w(typeof t=="function"?await t():t,dLe);let Ae,$e;function ze(){isFinite(s)&&s>0&&(clearTimeout($e),$e=setTimeout(()=>{le.readyState===w.OPEN&&(le.send(af({type:Ir.Ping})),S.emit("ping",!1,void 0))},s))}k(be=>{A=void 0,clearTimeout(Ae),clearTimeout($e),ue(be),be instanceof iD&&(le.close(4499,"Terminated"),le.onerror=null,le.onclose=null)}),le.onerror=be=>S.emit("error",be),le.onclose=be=>S.emit("closed",be),le.onopen=async()=>{try{S.emit("opened",le);const be=typeof r=="function"?await r():r;if(le.readyState!==w.OPEN)return;le.send(af(be?{type:Ir.ConnectionInit,payload:be}:{type:Ir.ConnectionInit},v)),isFinite(l)&&l>0&&(Ae=setTimeout(()=>{le.close(xi.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},l)),ze()}catch(be){S.emit("error",be),le.close(xi.InternalClientError,nD(be instanceof Error?be.message:new Error(be).message,"Internal client error"))}};let mt=!1;le.onmessage=({data:be})=>{try{const Se=fLe(be,_);if(S.emit("message",Se),Se.type==="ping"||Se.type==="pong"){S.emit(Se.type,!0,Se.payload),Se.type==="pong"?ze():a||(le.send(af(Se.payload?{type:Ir.Pong,payload:Se.payload}:{type:Ir.Pong})),S.emit("pong",!1,Se.payload));return}if(mt)return;if(Se.type!==Ir.ConnectionAck)throw new Error(`First message cannot be of type ${Se.type}`);clearTimeout(Ae),mt=!0,S.emit("connected",le,Se.payload,N),N=!1,I=0,Q([le,new Promise((st,Xt)=>k(Xt))])}catch(Se){le.onmessage=null,S.emit("error",Se),le.close(xi.BadResponse,nD(Se instanceof Error?Se.message:new Error(Se).message,"Bad response"))}}})())));V.readyState===w.CLOSING&&await Y;let G=()=>{};const J=new Promise(Q=>G=Q);return[V,G,Promise.race([J.then(()=>{if(!C){const Q=()=>V.close(1e3,"Normal Closure");isFinite(o)&&o>0?R=setTimeout(()=>{V.readyState===w.OPEN&&Q()},o):Q()}}),Y])]}function q(V){if(sy(V)&&(gLe(V.code)||[xi.InternalServerError,xi.InternalClientError,xi.BadRequest,xi.BadResponse,xi.Unauthorized,xi.SubprotocolNotAcceptable,xi.SubscriberAlreadyExists,xi.TooManyInitialisationRequests].includes(V.code)))throw V;if(P)return!1;if(sy(V)&&V.code===1e3)return C>0;if(!u||I>=u||!f(V)||h?.(V))throw V;return N=!0}n||(async()=>{for(C++;;)try{const[,,V]=await z();await V}catch(V){try{if(!q(V))return}catch(Y){return i?.(Y)}}})();function H(V,Y){const G=m(V);let J=!1,Q=!1,ue=()=>{C--,J=!0};return(async()=>{for(C++;;)try{const[le,Ae,$e]=await z();if(J)return Ae();const ze=S.onMessage(G,mt=>{switch(mt.type){case Ir.Next:{Y.next(mt.payload);return}case Ir.Error:{Q=!0,J=!0,Y.error(mt.payload),ue();return}case Ir.Complete:{J=!0,ue();return}}});le.send(af({id:G,type:Ir.Subscribe,payload:V},v)),ue=()=>{!J&&le.readyState===w.OPEN&&le.send(af({id:G,type:Ir.Complete},v)),C--,J=!0,Ae()},await $e.finally(ze);return}catch(le){if(!q(le))return}})().then(()=>{Q||Y.complete()}).catch(le=>{Y.error(le)}),()=>{J||ue()}}return{on:S.on,subscribe:H,iterate(V){const Y=[],G={done:!1,error:null,resolve:()=>{}},J=H(V,{next(ue){Y.push(ue),G.resolve()},error(ue){G.done=!0,G.error=ue,G.resolve()},complete(){G.done=!0,G.resolve()}}),Q=(function(){return hLe(this,arguments,function*(){for(;;){for(Y.length||(yield Pc(new Promise(Ae=>G.resolve=Ae)));Y.length;)yield yield Pc(Y.shift());if(G.error)throw G.error;if(G.done)return yield Pc(void 0)}})})();return Q.throw=async ue=>(G.done||(G.done=!0,G.error=ue,G.resolve()),{done:!0,value:void 0}),Q.return=async()=>(J(),{done:!0,value:void 0}),Q},async dispose(){if(P=!0,A){const[V]=await A;V.close(1e3,"Normal Closure")}},terminate(){A&&S.emit("closed",new iD)}}}class iD extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function sy(e){return Ml(e)&&"code"in e&&"reason"in e}function gLe(e){return[1e3,1001,1006,1005,1012,1013,1014].includes(e)?!1:e>=1e3&&e<=1999}function mLe(e){return typeof e=="function"&&"constructor"in e&&"CLOSED"in e&&"CLOSING"in e&&"CONNECTING"in e&&"OPEN"in e}function vLe(e,t){let r=t!==void 0?{Authorization:"Bearer "+t}:void 0;return pLe({url:e,connectionParams:r,lazy:!0,retryAttempts:5})}function Ah(e,t){return T(e[t],ge.string)}function No(e,t){return D(Ah(e,t),"")}function _Le(e,t){return W(T(e[t],ge.float),r=>r|0)}function bLe(e,t){return se(D(T(e[t],ge.array),[]),ge.string)}function yLe(e){let t=ge.object(e);return t!==void 0?{label:No(t,"label"),icon:Ah(t,"icon"),group:Ah(t,"group"),sortOrder:D(_Le(t,"sortOrder"),0)}:{label:"",icon:void 0,group:void 0,sortOrder:0}}function xLe(e){return W(ge.object(e),t=>({fragmentId:No(t,"fragmentId"),title:No(t,"title"),description:No(t,"description"),positions:bLe(t,"positions"),requiredAccess:Ah(t,"requiredAccess")}))}function SLe(e){return W(ge.object(e),t=>({fragmentId:No(t,"fragmentId"),title:No(t,"title"),menuEntry:D(W(t.menuEntry,yLe),{label:No(t,"title"),icon:void 0,group:void 0,sortOrder:0}),requiredAccess:Ah(t,"requiredAccess")}))}function ELe(e){return W(ge.object(e),t=>({pluginId:No(t,"pluginId"),remoteEntryUrl:No(t,"remoteEntryUrl"),panels:se(D(T(t.panels,ge.array),[]),xLe),pages:se(D(T(t.pages,ge.array),[]),SLe),registeredAt:No(t,"registeredAt"),updatedAt:No(t,"updatedAt")}))}function wLe(e){return se(D(T(T(T(T(ge.object(e),t=>t.data),ge.object),t=>t.Platform_UIFragments),ge.array),[]),ELe)}let kLe=`{
92
- Platform_UIFragments {
93
- pluginId
94
- remoteEntryUrl
95
- panels { fragmentId title description positions requiredAccess }
96
- pages {
97
- fragmentId
98
- title
99
- menuEntry { label icon group sortOrder }
100
- requiredAccess
101
- }
102
- registeredAt
103
- updatedAt
104
- }
105
- }`;function ix(e){let t=ce(e);return t!==void 0?JSON.parse(t):e}function oD(e){switch(e){case"boolean":return"Boolean";case"integer":return"Int";case"number":return"Float";default:return"String"}}function sD(e){let t=e.toLowerCase();return t.length>=2?t.endsWith("id"):!1}function CLe(e){let t=e.toLowerCase();return t.length>3?t.endsWith("ids"):!1}function RLe(e,t){let r=D(T(O(t,"type"),ce),"string");return r!=="array"?sD(e)&&r==="string"?"ID":oD(r):"["+D(W(T(T(T(O(t,"items"),K),i=>O(i,"type")),ce),i=>i==="string"&&(CLe(e)||sD(e))?"ID":oD(i)),"String")+"!]"}function ALe(e,t,r){let n=D(W(T(T(K(t),u=>O(u,"properties")),K),u=>Object.keys(u).filter(d=>d!=="TAG").map(d=>{let f=D(W(T(O(u,d),K),h=>RLe(d,h)),"String");return[d,f]})),[]),o=(r!==void 0?[]:[["id","ID"]]).concat(n),s="__typename ... on CommandAccepted { msgId entityId eventCount } ... on CommandRejected { msgId errorCode errorDetail } ... on CommandPending { msgId }";if(o.length===0)return"mutation { "+e+" { "+s+" } }";let a=o.map(u=>"$"+u[0]+": "+u[1]+"!").join(", "),l=o.map(u=>{let d=u[0];return d+": $"+d}).join(", ");return"mutation "+e+"("+a+") { "+e+"("+l+") { "+s+" } }"}function TLe(e){let t=e.split(".");return D(t[t.length-1|0],e)}function $Le(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function NLe(e){return se(D(Vt(e),[]),t=>W(K(t),r=>{let n=i=>D(T(O(r,i),ce),"");return{fieldName:n("fieldName"),entity:n("entity"),plugin:T(O(r,"plugin"),ce)}}))}function aD(e){return se(D(Vt(e),[]),t=>W(T(K(t),r=>{let n=T(O(r,"apiExposed"),TD);if(!ot(n,!1))return r}),r=>{let n=p=>D(T(O(r,p),ce),""),i=n("name"),s=n("level")==="Instance"?"Instance":"Collection",a=D(W(O(r,"schema"),ix),null),l=n("mutationField"),u=T(O(r,"aggregateIdField"),ce),d=D(W(O(r,"references"),NLe),[]),f=W(T(O(r,"allowedStates"),Vt),p=>se(p,ce)),h=T(O(r,"targetState"),ce);return{name:i,label:$Le(TLe(i)),schema:a,mutationDocument:ALe(l,a,u),requiredRole:void 0,level:s,aggregateIdField:u,refFields:[],references:d,allowedStates:f,targetState:h}}))}function DLe(e){return se(D(Vt(e),[]),t=>W(K(t),r=>{let n=f=>D(T(O(r,f),ce),""),i=f=>D(T(O(r,f),Vt),[]),o=(f,h)=>se(D(T(O(f,h),Vt),[]),ce),s=se(i("readModels"),f=>W(K(f),h=>{let p=g=>D(T(O(h,g),ce),"");return{name:p("name"),schema:D(W(O(h,"schema"),ix),null),queryDocument:"",queryField:p("queryField"),sortIndex:0,commands:[],linkedWriteSide:o(h,"linkedWriteSide"),labelField:p("labelField"),searchableFields:o(h,"searchableFields"),statusField:T(O(h,"statusField"),ce)}})),a=se(i("aggregates"),f=>W(K(f),h=>({name:(g=>D(T(O(h,g),ce),""))("name"),schema:null,commands:aD(D(O(h,"commands"),[])),linkedViews:o(h,"linkedViews")}))),l=se(i("stateViewSlices"),f=>W(K(f),h=>{let p=g=>D(T(O(h,g),ce),"");return{name:p("name"),schema:D(W(O(h,"schema"),ix),null),queryField:p("queryField"),sortIndex:0,linkedWriteSide:o(h,"linkedWriteSide"),labelField:p("labelField"),searchableFields:o(h,"searchableFields"),statusField:T(O(h,"statusField"),ce)}})),u=se(i("stateChangeSlices"),f=>W(K(f),h=>({name:(g=>D(T(O(h,g),ce),""))("name"),commands:aD(D(O(h,"commands"),[])),linkedViews:o(h,"linkedViews"),consistencyRead:T(O(h,"consistencyRead"),ce)}))),d=n("pluginId");return{id:d,name:d,readModels:s,aggregates:a,stateViewSlices:l,stateChangeSlices:u}}))}function FLe(e){return D(W(T(T(T(ge.object(e),t=>t.data),ge.object),t=>t.Platform_ComponentDefinitions),DLe),[])}let ILe=`{
106
- Platform_ComponentDefinitions {
107
- pluginId
108
- readModels { name queryField schema linkedWriteSide labelField searchableFields statusField }
109
- aggregates { name commands { name schema level aggregateIdField mutationField references { fieldName entity plugin } allowedStates targetState apiExposed } linkedViews }
110
- stateViewSlices { name queryField schema linkedWriteSide labelField searchableFields statusField }
111
- stateChangeSlices { name commands { name schema level aggregateIdField mutationField references { fieldName entity plugin } allowedStates targetState apiExposed } linkedViews consistencyRead }
112
- }
113
- }`;function ox(e,t){return e+"/"+t}function PLe(e){let t=new Map;return e.forEach(r=>{let n=r.remoteEntryUrl;if(n.length>0){r.pages.forEach(i=>{t.set(ox(r.pluginId,i.fragmentId),n)}),r.panels.forEach(i=>{t.set(ox(r.pluginId,i.fragmentId),n)});return}}),t}function OLe(e,t,r){return e.get(ox(t,r))}function MLe(e,t,r){return e.map(n=>{let i=OLe(r,t,n.fragmentId);return i!==void 0?{fragmentId:n.fragmentId,title:n.title,description:n.description,extensionPackage:n.extensionPackage,positions:n.positions,component:o=>b(uLe,{pluginId:t,fragmentId:n.fragmentId,remoteEntryUrl:i,panelProps:o}),requiredAccess:n.requiredAccess,minWidth:n.minWidth}:n})}function lD(e,t){let r=t+".",n=e.startsWith(r)?e.slice(r.length):e;return D(W([".list",".detail"].find(o=>n.endsWith(o)),o=>n.slice(0,n.length-o.length|0)),n)}function LLe(e,t){let r=t.find(n=>n.pluginId===e?n.remoteEntryUrl.length>0:!1);return r!==void 0?[r.pages.map(n=>lD(n.fragmentId,e)),r.panels.map(n=>lD(n.fragmentId,e))]:[[],[]]}function uD(e,t,r){let n=Object.fromEntries([["content-type","application/json"]]);return r!==void 0&&(n.Authorization="Bearer "+r),qt(fetch(e,{method:"POST",headers:n,body:D(JSON.stringify({query:t}),"")}).then(i=>i.json()),i=>Promise.resolve(null))}function zLe(e,t,r,n,i,o,s,a){let l=PLe(s);n(W4e.buildRegistry(o)),i(se(o,p=>W(Cfe(p),g=>({pluginId:p.id,binding:g}))));let u=[],d=[],f=[],h={contents:tu()};o.forEach(p=>{let g=LLe(p.id,s),m=X4e(p,void 0,void 0,void 0,o,g[0],g[1],void 0,void 0,void 0,a[p.id]),v=MLe(m.panels,p.id,l);m.pages.forEach(_=>{u.push(_)}),v.forEach(_=>{d.push(_)}),m.routes.forEach(_=>{f.push(_)}),h.contents=fy(h.contents,m.publicLinks)}),ie(e,p=>p.setPluginPages(u)),ie(t,p=>p.setPluginPanels(d)),ie(r,p=>p.setPluginRoutes(f,h.contents)),s.forEach(p=>{})}function cD(e,t,r,n,i,o,s,a,l){let u=uD(e.platformApiEndpoint,ILe,t),d=uD(e.platformApiEndpoint,kLe,t);return Promise.all([u,d]).then(f=>{let h=f[1],p=f[0];($g(p)||$g(h))&&r();let g=FLe(p),m=wLe(h);zLe(n,i,o,s,a,g,m,l)})}let ULe=`subscription OnPluginStatusChange {
114
- onPluginStatusChange { pluginId status }
115
- }`,BLe=`subscription OnUIFragmentChange {
116
- onUIFragmentChange { pluginId changeKind }
117
- }`;function jLe(e){let t=e.uiHints,r=e.config,n=t!==void 0?t:{},i=Ut(Qh),o=Ut(Xh),s=GE(),a=Zq(),l=xhe(),u=ml(),d=T(u,f=>f.getToken());return Re(()=>{cD(r,d,()=>ie(u,f=>f.logout()),i,o,s,a,l,n)},[d]),Re(()=>{try{let f=vLe(r.platformApiSubscriptionEndpoint,d),h=()=>{cD(r,d,()=>ie(u,m=>m.logout()),i,o,s,a,l,n)},p=f.subscribe({query:ULe,variables:void 0},{next:m=>h(),error:m=>{},complete:()=>{}}),g=f.subscribe({query:BLe,variables:void 0},{next:m=>h(),error:m=>{},complete:()=>{}});return()=>{p(),g(),f.dispose()}}catch{return}},[d]),null}let qLe=jLe;function Ti(e){return"var("+e+")"}let VLe=E([c("background",Ti(y.surfaceElevated)),c("border","1px solid var("+y.border+")"),c("border-radius",Ti(X.md)),c("padding",Ti(F.lg)),L("flex"),he("column"),ee("center"),Qe("center"),c("gap",Ti(F.sm)),c("min-height","160px"),sa("center"),Uo({NAME:"percent",VAL:100}),c("box-sizing","border-box")]),KLe=E([c("font-size","32px"),c("line-height","1"),um(ke(4))]),HLe=E([c("color",Ti(y.textPrimary)),c("font-size",Ti($.sizeMd)),c("font-weight",Ti($.weightMedium)),um(ke(4))]),WLe=E([c("color",Ti(y.textSecondary)),c("font-size",Ti($.sizeSm)),c("line-height",Ti($.lineHeightNormal))]),GLe=E([c("color",Ti(y.textDisabled)),c("font-size",Ti($.sizeXs)),c("font-family",Ti($.fontFamilyMono)),xs(ke(8))]);function JLe(e){let t=e.definition;return M("div",{children:[b("div",{children:"[locked]",className:KLe}),b("div",{children:t.title,className:HLe}),b("div",{children:t.description,className:WLe}),b("div",{children:t.extensionPackage,className:GLe})],className:VLe})}let QLe=JLe,YLe=E([L("flex"),ee("center"),Qe("center"),c("min-height","160px"),c("color","var("+y.textSecondary+")"),c("font-size","var("+$.sizeSm+")")]);function XLe(e){return b("div",{children:"Loading…",className:YLe})}E([L("flex"),ee("center"),Qe("center"),c("min-height","160px"),c("color","var("+y.error+")"),c("font-size","var("+$.sizeSm+")")]);function ZLe(e){let t=Yh(),r=yde(e.fragmentId);if(r===void 0)return null;let n=r.requiredAccess;return n!==void 0&&!t(n)?b(QLe,{definition:r}):b(s9,{children:r.component(e.props),fallback:b(XLe,{})})}let e8e=ZLe;function t8e(e){let t=bde(e.name),r=e.contextId,n=e.resourceId,i={contextId:r,resourceId:n};return t.length!==0?b("div",{children:t.map(o=>b(e8e,{fragmentId:o.fragmentId,props:i},o.fragmentId)),style:{display:"flex",flexDirection:"column",gap:"1rem"}}):null}let r8e=t8e;function n8e(e){return M("div",{children:[M("header",{children:[b("h1",{children:"Platform overview",style:{margin:"0"}}),b("p",{children:"Summary panels contributed by connected plugins appear below.",style:{color:"#666",margin:"0.25rem 0 0"}})]}),b(r8e,{name:"platform-summary"})],style:{display:"flex",fontFamily:"system-ui",padding:"1.5rem",flexDirection:"column",gap:"1.5rem"}})}let i8e=n8e,o8e="host.home",s8e="/",a8e={label:"Home",icon:void 0,group:void 0,sortOrder:0},l8e=s8e,u8e={fragmentId:o8e,title:"Home",menuEntry:a8e,requiredAccess:void 0,url:l8e};function c8e(e){let t=e.config,r=Ut(Qh),n=GE(),i=NM(),o=Zg();return Re(()=>{t.autoRedirectFirstPage||(ie(r,s=>s.register([u8e])),ie(n,s=>s.register([ec(wD(a=>a),b(i8e,{}))],tu())))},[]),Re(()=>{if(t.autoRedirectFirstPage&&(o===""||o==="/")){let s=i.find(a=>We(a.url));if(s!==void 0){let a=s.url;a!==void 0&&Oc(a)}}},[i.length,o]),null}let d8e=c8e;function f8e(e){return T(K(e),t=>{let r=T(O(t,"uploadUrl"),ce),n=T(O(t,"storageRef"),ce);if(r!==void 0&&n!==void 0)return{uploadUrl:r,storageRef:n}})}function h8e(e,t,r,n,i){return new Promise((o,s)=>{let a=new XMLHttpRequest;a.open("PUT",e),a.setRequestHeader("Content-Type",n),a.upload.onprogress=l=>{if(l.lengthComputable&&l.total>0)return i(l.loaded/l.total*100)},a.onload=()=>{let l=a.status;return l>=200&&l<300?(i(100),o({TAG:"Ok",_0:t})):o({TAG:"Error",_0:"Upload failed (status "+l.toString()+")"})},a.onerror=()=>o({TAG:"Error",_0:"Upload failed (network error)"}),a.send(r)})}function p8e(e,t){let r=t!==void 0?t:()=>{};return{upload:(n,i)=>{let o=n.type,s=bt([["content-type","application/json"]]);ie(r(),l=>{s.authorization="Bearer "+l});let a=D(JSON.stringify({fileName:n.name,contentType:o}),"{}");return qt(fetch(e,{method:"POST",headers:s,body:a}).then(l=>l.ok?l.json().then(f8e):Promise.resolve(void 0)).then(l=>l!==void 0?h8e(l.uploadUrl,l.storageRef,n,o,i):Promise.resolve({TAG:"Error",_0:"Could not obtain an upload target"})),l=>Promise.resolve({TAG:"Error",_0:"Upload request failed"}))}}}let g8e=[],m8e=[],v8e=[],_8e={pages:g8e,panels:m8e,routes:v8e};function Oz(e){return M("div",{children:[b("h1",{children:"Shell failed to boot"}),b("pre",{children:e.message})],style:{color:"#a00",fontFamily:"system-ui",padding:"2rem"}})}function p2(e){return b("div",{children:"Loading…",style:{fontFamily:"system-ui",padding:"2rem"}})}function b8e(e){let t=e.extensions,r=Ut(Qh),n=Ut(Xh),i=GE();return Re(()=>{t.pages.length!==0&&ie(r,o=>o.register(t.pages)),t.panels.length!==0&&ie(n,o=>o.register(t.panels)),t.routes.length!==0&&ie(i,o=>o.register(t.routes,tu()))},[]),null}function sx(e){let t=e.config,r=Ide(),n=Fde(),i=M("div",{children:[b(Che,{}),b(zde,{}),b(vce,{})],style:{borderBottom:"1px solid var("+y.borderSubtle+")",display:"flex",padding:"0.5rem 1rem",alignItems:"center",justifyContent:"flex-end",gap:"0.5rem"}});return M(qr,{children:[b(d8e,{config:t}),b(qLe,{config:t,uiHints:e.uiHints}),b(b8e,{extensions:e.extensions}),b(rde,{appName:"Reventless",router:r,headerSlot:i,routesReady:n,loading:b(p2,{})})]})}function y8e(e){let t=e.discoverPlatforms,r=Zg(),n=OM(r);if(n===void 0)return t!==void 0?b(cfe,{discover:t}):b(Oz,{message:"config.json sets mode = fleet but the app supplied no discoverPlatforms adapter to ShellApp"});let i=n[0];return b(MM.make,{scope:i,children:b(k9,{value:{prefix:WE(i),path:n[1]},children:b(sx,{config:e.config,extensions:e.extensions,uiHints:e.uiHints})})})}function dD(e){let t=e.access;return b(Ice,{access:t,children:b(Ace.make,{children:b(_de.make,{access:t,children:b(Dde.make,{children:b(Xq.make,{children:b(bhe.make,{children:e.children})})})})})})}function x8e(e){let t=e.uiHints,r=e.extensions,n=e.config,i=ml(),o=n.mode,s;if(o==="Single"){let u=n.environment,d=n.platformName;s=u!==void 0&&d!==void 0?b(MM.make,{scope:{environment:u,platformName:d},children:b(sx,{config:n,extensions:r,uiHints:t})}):b(sx,{config:n,extensions:r,uiHints:t})}else s=b(y8e,{config:n,extensions:r,uiHints:t,discoverPlatforms:e.discoverPlatforms});if(n.authMode==="Anonymous")return b(dD,{access:n.accessTiers,children:s});if(i===void 0)return b(YA,{});let l=i.identity;return l!==void 0&&i.isAuthenticated?b(dD,{access:l.groups.concat(n.accessTiers),children:s}):b(YA,{})}function S8e(e){let t=e.config,r=ml();o7(t.assetOrigins);let n=Zg(),i=t.mode,o;o=i==="Single"?void 0:W(OM(n),d=>d[0]);let s=fe(o,"",d=>d.environment+"|"+d.platformName),a=Lt(()=>{let d=sre(t.apiEndpoint,t.platformApiEndpoint,()=>T(r,f=>f.getToken()),()=>ie(r,f=>f.logout()));return o!==void 0?ofe(o)(d):d},[t,r,s]),l=()=>T(r,d=>d.getToken()),u=Je(l);return u.current=l,Re(()=>{ie(t.uploadEndpoint,d=>Bhe(p8e(d,()=>u.current()),void 0))},[t.uploadEndpoint]),b(Tte.make,{execute:a,children:b(rRe,{config:t,children:b(efe.make,{domainEventsEndpoint:t.domainApiEventsEndpoint,platformEventsEndpoint:t.platformApiEventsEndpoint,liveUpdates:t.liveUpdates,liveReconnectRefetch:t.liveReconnectRefetch,clientEventsNamespace:t.clientEventsNamespace,getToken:l,children:b(gde.make,{initialPreset:"Light",children:b(x8e,{config:t,extensions:e.extensions,uiHints:e.uiHints,discoverPlatforms:e.discoverPlatforms})})})})})}function E8e(e,t){let r=oe(()=>{}),n=r[1];return Re(()=>{ire(e.uiHintsUrl).then(i=>n(o=>i))},[e.uiHintsUrl]),W(r[0],i=>Vte(i,D(t.uiHints,{})))}function w8e(e){let t=e.extensions,r=e.config,n=E8e(r,t);return b(uce.make,{authMode:r.authMode,apiEndpoint:r.apiEndpoint,cognitoClientId:r.cognitoClientId,cognitoUserPoolId:r.cognitoUserPoolId,region:r.region,children:n!==void 0?b(S8e,{config:r,extensions:t,uiHints:n,discoverPlatforms:e.discoverPlatforms}):b(p2,{})})}function k8e(e){let t=e.registerModes,r=e.extensions,n=r!==void 0?r:_8e,i=oe(()=>"LoadingConfig"),o=i[1],s=i[0];return Re(()=>{ore().then(a=>{if(a.TAG==="Ok"){let u=a._0;return t!==void 0?qt(t(u).then(()=>o(d=>({TAG:"Ready",_0:u}))),d=>(console.error("[ShellApp] optional view modes failed to register — continuing without them: "+String(d)),o(f=>({TAG:"Ready",_0:u})),Promise.resolve())):(o(d=>({TAG:"Ready",_0:u})),Promise.resolve())}let l=a._0;return o(u=>({TAG:"Failed",_0:l})),Promise.resolve()})},[]),typeof s!="object"?b(p2,{}):s.TAG==="Ready"?b(w8e,{config:s._0,extensions:n,discoverPlatforms:e.discoverPlatforms}):b(Oz,{message:s._0})}let C8e={make:k8e},fD=document.querySelector("#root");fD!=null&&t9(fD).render(b(C8e.make,{registerModes:p9}));export{qt as $,ms as A,We as B,y as C,Vr as D,Or as E,PS as F,Yc as G,X as R,F as S,$ as T,nu as a,Yr as b,mte as c,ce as d,D as e,se as f,O as g,yt as h,T as i,Vt as j,bt as k,ie as l,fe as m,pr as n,Oo as o,_a as p,B5 as q,lt as r,co as s,Bu as t,fde as u,ir as v,Ko as w,Ya as x,vs as y,K as z};