From 951fd6d07bbb6dae7e16990f715bf0c2bde9d068 Mon Sep 17 00:00:00 2001 From: goldbuick Date: Mon, 22 Apr 2024 14:23:05 +0000 Subject: [PATCH] Build: (60928f3) ci: version bump to v0.0.4 --- assets/{index-BKNWeMqb.js => index-BhlBfVGs.js} | 4 ++-- assets/{instance-DdM-nTie.js => instance-Cr_eYlJb.js} | 2 +- index.html | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename assets/{index-BKNWeMqb.js => index-BhlBfVGs.js} (99%) rename assets/{instance-DdM-nTie.js => instance-Cr_eYlJb.js} (99%) diff --git a/assets/index-BKNWeMqb.js b/assets/index-BhlBfVGs.js similarity index 99% rename from assets/index-BKNWeMqb.js rename to assets/index-BhlBfVGs.js index 9f9d2fb6b..04685073c 100644 --- a/assets/index-BKNWeMqb.js +++ b/assets/index-BhlBfVGs.js @@ -3667,7 +3667,7 @@ No matching component was found for: * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Bf=K;function ZX(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var JX=typeof Object.is=="function"?Object.is:ZX,QX=Bf.useState,ej=Bf.useEffect,tj=Bf.useLayoutEffect,nj=Bf.useDebugValue;function rj(t,e){var n=e(),r=QX({inst:{value:n,getSnapshot:e}}),i=r[0].inst,s=r[1];return tj(function(){i.value=n,i.getSnapshot=e,vS(i)&&s({inst:i})},[t,n,e]),ej(function(){return vS(i)&&s({inst:i}),t(function(){vS(i)&&s({inst:i})})},[t]),nj(n),n}function vS(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!JX(t,n)}catch{return!0}}function ij(t,e){return e()}var sj=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ij:rj;O3.useSyncExternalStore=Bf.useSyncExternalStore!==void 0?Bf.useSyncExternalStore:sj;N3.exports=O3;var oj=N3.exports;const aj=Jf(oj);var k3={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(IL,function(){return n.importState=function(i){var s=new n;return s.importState(i),s},n;function n(){return function(i){var s=0,o=0,a=0,l=1;i.length==0&&(i=[+new Date]);var c=r();s=c(" "),o=c(" "),a=c(" ");for(var h=0;h>>0,l-=i,l*=i,i=l>>>0,l-=i,i+=l*4294967296}return(i>>>0)*23283064365386963e-26};return s.version="Mash 0.9",s}})})(k3);var lj=k3.exports;const cj=Jf(lj);cj("089fad0j9awfem09wavefc09uwaef");function Gv(t,e,n){return Math.max(e,Math.min(n,t))}function OP(t){return 2*Math.floor(t/2)}function uj(t,e){return Math.round(t/e)*e}const yS=new Set,Oc={emit(t,e,n,r){Oc.invoke(dj(t,e,n,r))},invoke(t){yS.forEach(e=>e.handle(t))},connect(t){yS.add(t)},disconnect(t){yS.delete(t)}},fj="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let hj=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t));for(;t--;)e+=fj[n[t]&63];return e};function GT(){return hj()}function dj(t,e,n,r){return{id:GT(),target:t,sender:e,data:n,player:r}}function pj(t){const[e,...n]=t.split(":");return{target:e,path:n.join(":")}}function WT(t,e,n){const r=GT(),i=t.toLowerCase(),s=e.map(a=>a.toLowerCase()),o={id(){return r},name(){return t},tags(){return e},emit(a,l,c){Oc.emit(a,r,l,c)},reply(a,l,c,h){o.emit(`${a.sender}:${l}`,c,h)},handle(a){const{target:l,path:c}=pj(a.target),h=l.toLowerCase();s.findIndex(d=>d==="all"||d===h)!==-1&&n(a),(r===l||h==="all"||i===h)&&n({...a,target:c})}};return Oc.connect(o),o}function mj(t){const e=new Set;function n(r){e.has(r.id)||(e.add(r.id),Oc.invoke(r))}return WT("forward",["all"],r=>{e.has(r.id)||(e.add(r.id),t(r))}),n}function gj(t){return new Worker("/assets/instance-DdM-nTie.js",{name:t==null?void 0:t.name})}/*! + */var Bf=K;function ZX(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var JX=typeof Object.is=="function"?Object.is:ZX,QX=Bf.useState,ej=Bf.useEffect,tj=Bf.useLayoutEffect,nj=Bf.useDebugValue;function rj(t,e){var n=e(),r=QX({inst:{value:n,getSnapshot:e}}),i=r[0].inst,s=r[1];return tj(function(){i.value=n,i.getSnapshot=e,vS(i)&&s({inst:i})},[t,n,e]),ej(function(){return vS(i)&&s({inst:i}),t(function(){vS(i)&&s({inst:i})})},[t]),nj(n),n}function vS(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!JX(t,n)}catch{return!0}}function ij(t,e){return e()}var sj=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ij:rj;O3.useSyncExternalStore=Bf.useSyncExternalStore!==void 0?Bf.useSyncExternalStore:sj;N3.exports=O3;var oj=N3.exports;const aj=Jf(oj);var k3={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(IL,function(){return n.importState=function(i){var s=new n;return s.importState(i),s},n;function n(){return function(i){var s=0,o=0,a=0,l=1;i.length==0&&(i=[+new Date]);var c=r();s=c(" "),o=c(" "),a=c(" ");for(var h=0;h>>0,l-=i,l*=i,i=l>>>0,l-=i,i+=l*4294967296}return(i>>>0)*23283064365386963e-26};return s.version="Mash 0.9",s}})})(k3);var lj=k3.exports;const cj=Jf(lj);cj("089fad0j9awfem09wavefc09uwaef");function Gv(t,e,n){return Math.max(e,Math.min(n,t))}function OP(t){return 2*Math.floor(t/2)}function uj(t,e){return Math.round(t/e)*e}const yS=new Set,Oc={emit(t,e,n,r){Oc.invoke(dj(t,e,n,r))},invoke(t){yS.forEach(e=>e.handle(t))},connect(t){yS.add(t)},disconnect(t){yS.delete(t)}},fj="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let hj=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t));for(;t--;)e+=fj[n[t]&63];return e};function GT(){return hj()}function dj(t,e,n,r){return{id:GT(),target:t,sender:e,data:n,player:r}}function pj(t){const[e,...n]=t.split(":");return{target:e,path:n.join(":")}}function WT(t,e,n){const r=GT(),i=t.toLowerCase(),s=e.map(a=>a.toLowerCase()),o={id(){return r},name(){return t},tags(){return e},emit(a,l,c){Oc.emit(a,r,l,c)},reply(a,l,c,h){o.emit(`${a.sender}:${l}`,c,h)},handle(a){const{target:l,path:c}=pj(a.target),h=l.toLowerCase();s.findIndex(d=>d==="all"||d===h)!==-1&&n(a),(r===l||h==="all"||i===h)&&n({...a,target:c})}};return Oc.connect(o),o}function mj(t){const e=new Set;function n(r){e.has(r.id)||(e.add(r.id),Oc.invoke(r))}return WT("forward",["all"],r=>{e.has(r.id)||(e.add(r.id),t(r))}),n}function gj(t){return new Worker("/assets/instance-Cr_eYlJb.js",{name:t==null?void 0:t.name})}/*! * https://github.com/Starcounter-Jack/JSON-Patch * (c) 2017-2022 Joachim Wester * MIT licensed @@ -3676,7 +3676,7 @@ No matching component was found for: * https://github.com/Starcounter-Jack/JSON-Patch * (c) 2017-2021 Joachim Wester * MIT license - */var jT=new WeakMap,wj=function(){function t(e){this.observers=new Map,this.obj=e}return t}(),Mj=function(){function t(e,n){this.callback=e,this.observer=n}return t}();function Tj(t){return jT.get(t)}function Aj(t,e){return t.observers.get(e)}function Cj(t,e){t.observers.delete(e.callback)}function Rj(t,e){e.unobserve()}function bj(t,e){var n=[],r,i=Tj(t);if(!i)i=new wj(t),jT.set(t,i);else{var s=Aj(i,e);r=s&&s.observer}if(r)return r;if(r={},i.value=fi(t),e){r.callback=e,r.next=null;var o=function(){Nw(r)},a=function(){clearTimeout(r.next),r.next=setTimeout(o)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return r.patches=n,r.object=t,r.unobserve=function(){Nw(r),clearTimeout(r.next),Cj(i,r),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},i.observers.set(e,new Mj(e,r)),r}function Nw(t,e){e===void 0&&(e=!1);var n=jT.get(t.object);$T(n.value,t.object,t.patches,"",e),t.patches.length&&f_(n.value,t.patches);var r=t.patches;return r.length>0&&(t.patches=[],t.callback&&t.callback(r)),r}function $T(t,e,n,r,i){if(e!==t){typeof e.toJSON=="function"&&(e=e.toJSON());for(var s=Pw(e),o=Pw(t),a=!1,l=o.length-1;l>=0;l--){var c=o[l],h=t[c];if(bw(e,c)&&!(e[c]===void 0&&h!==void 0&&Array.isArray(e)===!1)){var d=e[c];typeof h=="object"&&h!=null&&typeof d=="object"&&d!=null&&Array.isArray(h)===Array.isArray(d)?$T(h,d,n,r+"/"+sc(c),i):h!==d&&(i&&n.push({op:"test",path:r+"/"+sc(c),value:fi(h)}),n.push({op:"replace",path:r+"/"+sc(c),value:fi(d)}))}else Array.isArray(t)===Array.isArray(e)?(i&&n.push({op:"test",path:r+"/"+sc(c),value:fi(h)}),n.push({op:"remove",path:r+"/"+sc(c)}),a=!0):(i&&n.push({op:"test",path:r,value:t}),n.push({op:"replace",path:r,value:e}))}if(!(!a&&s.length==o.length))for(var l=0;lnew Proxy(t,e);const Ow=Object.getPrototypeOf,kw=new WeakMap,F3=t=>t&&(kw.has(t)?kw.get(t):Ow(t)===Object.prototype||Ow(t)===Array.prototype),jv=t=>typeof t=="object"&&t!==null,Oj=t=>{if(Array.isArray(t))return Array.from(t);const e=Object.getOwnPropertyDescriptors(t);return Object.values(e).forEach(n=>{n.configurable=!0}),Object.create(Ow(t),e)},KT=t=>t[YT]||t,B3=(t,e,n,r)=>{if(!F3(t))return t;let i=r&&r.get(t);if(!i){const l=KT(t);i=(c=>Object.values(Object.getOwnPropertyDescriptors(c)).some(h=>!h.configurable&&!h.writable))(l)?[l,Oj(l)]:[l],r==null||r.set(t,i)}const[s,o]=i;let a=n&&n.get(s);return a&&a[1].f===!!o||(a=((l,c)=>{const h={f:c};let d=!1;const p=(y,S)=>{if(!d){let E=h[sd].get(l);if(E||(E={},h[sd].set(l,E)),y===Od)E[Od]=!0;else{let g=E[y];g||(g=new Set,E[y]=g),g.add(S)}}},m={get:(y,S)=>S===YT?l:(p("k",S),B3(Reflect.get(y,S),h[sd],h.c,h.t)),has:(y,S)=>S===Lj?(d=!0,h[sd].delete(l),!0):(p("h",S),Reflect.has(y,S)),getOwnPropertyDescriptor:(y,S)=>(p("o",S),Reflect.getOwnPropertyDescriptor(y,S)),ownKeys:y=>(p(Od),Reflect.ownKeys(y))};return c&&(m.set=m.deleteProperty=()=>!1),[m,h]})(s,!!o),a[1].p=Nj(o||s,a[0]),n&&n.set(s,a)),a[1][sd]=e,a[1].c=n,a[1].t=r,a[1].p},z3=(t,e,n,r,i=Object.is)=>{if(i(t,e))return!1;if(!jv(t)||!jv(e))return!0;const s=n.get(KT(t));if(!s)return!0;if(r){const a=r.get(t);if(a&&a.n===e)return a.g;r.set(t,{n:e,g:!1})}let o=null;try{for(const a of s.h||[])if(o=Reflect.has(t,a)!==Reflect.has(e,a),o)return o;if(s[Od]===!0){if(o=((a,l)=>{const c=Reflect.ownKeys(a),h=Reflect.ownKeys(l);return c.length!==h.length||c.some((d,p)=>d!==h[p])})(t,e),o)return o}else for(const a of s.o||[])if(o=!!Reflect.getOwnPropertyDescriptor(t,a)!=!!Reflect.getOwnPropertyDescriptor(e,a),o)return o;for(const a of s.k||[])if(o=z3(t[a],e[a],n,r,i),o)return o;return o===null&&(o=!0),o}finally{r&&r.set(t,{n:e,g:o})}},kj=t=>F3(t)&&t[YT]||null,DP=(t,e=!0)=>{kw.set(t,e)},Dj=(t,e,n)=>{const r=[],i=new WeakSet,s=(o,a)=>{if(i.has(o))return;jv(o)&&i.add(o);const l=jv(o)&&e.get(KT(o));if(l){var c,h;if((c=l.h)==null||c.forEach(p=>{const m=`:has(${String(p)})`;r.push(a?[...a,m]:[m])}),l[Od]===!0){const p=":ownKeys";r.push(a?[...a,p]:[p])}else{var d;(d=l.o)==null||d.forEach(p=>{const m=`:hasOwn(${String(p)})`;r.push(a?[...a,m]:[m])})}(h=l.k)==null||h.forEach(p=>{n&&!("value"in(Object.getOwnPropertyDescriptor(o,p)||{}))||s(o[p],a?[...a,p]:[p])})}else a&&r.push(a)};return s(t),r};var $v={ZSS_LANG_DEV:"false",ZSS_STATS_DEV:"false",ZSS_SHOW_CODE:"false",ZSS_BRANCH_NAME:"main",ZSS_BRANCH_VERSION:"0.0.3",ZSS_COMMIT_HASH:"295766cd0a025452e00ff642b55a1495810fec25",ZSS_COMMIT_MESSAGE:"ci: version bump to v0.0.3",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const _S=t=>typeof t=="object"&&t!==null,Wa=new WeakMap,S0=new WeakSet,Uj=(t=Object.is,e=(c,h)=>new Proxy(c,h),n=c=>_S(c)&&!S0.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),r=c=>{switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:throw c}},i=new WeakMap,s=(c,h,d=r)=>{const p=i.get(c);if((p==null?void 0:p[0])===h)return p[1];const m=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return DP(m,!0),i.set(c,[h,m]),Reflect.ownKeys(c).forEach(y=>{if(Object.getOwnPropertyDescriptor(m,y))return;const S=Reflect.get(c,y),{enumerable:E}=Reflect.getOwnPropertyDescriptor(c,y),g={value:S,enumerable:E,configurable:!0};if(S0.has(S))DP(S,!1);else if(S instanceof Promise)delete g.value,g.get=()=>d(S);else if(Wa.has(S)){const[x,_]=Wa.get(S);g.value=s(x,_(),d)}Object.defineProperty(m,y,g)}),Object.preventExtensions(m)},o=new WeakMap,a=[1,1],l=c=>{if(!_S(c))throw new Error("object required");const h=o.get(c);if(h)return h;let d=a[0];const p=new Set,m=(R,P=++a[0])=>{d!==P&&(d=P,p.forEach(O=>O(R,P)))};let y=a[1];const S=(R=++a[1])=>(y!==R&&!p.size&&(y=R,g.forEach(([P])=>{const O=P[1](R);O>d&&(d=O)})),d),E=R=>(P,O)=>{const X=[...P];X[1]=[R,...X[1]],m(X,O)},g=new Map,x=(R,P)=>{if(($v?"production":void 0)!=="production"&&g.has(R))throw new Error("prop listener already exists");if(p.size){const O=P[3](E(R));g.set(R,[P,O])}else g.set(R,[P])},_=R=>{var P;const O=g.get(R);O&&(g.delete(R),(P=O[1])==null||P.call(O))},M=R=>(p.add(R),p.size===1&&g.forEach(([O,X],j)=>{if(($v?"production":void 0)!=="production"&&X)throw new Error("remove already exists");const H=O[3](E(j));g.set(j,[O,H])}),()=>{p.delete(R),p.size===0&&g.forEach(([O,X],j)=>{X&&(X(),g.set(j,[O]))})}),C=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),I=e(C,{deleteProperty(R,P){const O=Reflect.get(R,P);_(P);const X=Reflect.deleteProperty(R,P);return X&&m(["delete",[P],O]),X},set(R,P,O,X){const j=Reflect.has(R,P),H=Reflect.get(R,P,X);if(j&&(t(H,O)||o.has(O)&&t(H,o.get(O))))return!0;_(P),_S(O)&&(O=kj(O)||O);let J=O;if(O instanceof Promise)O.then(ee=>{O.status="fulfilled",O.value=ee,m(["resolve",[P],ee])}).catch(ee=>{O.status="rejected",O.reason=ee,m(["reject",[P],ee])});else{!Wa.has(O)&&n(O)&&(J=l(O));const ee=!S0.has(J)&&Wa.get(J);ee&&x(P,ee)}return Reflect.set(R,P,J,X),m(["set",[P],O,H]),!0}});o.set(c,I);const N=[C,S,s,M];return Wa.set(I,N),Reflect.ownKeys(c).forEach(R=>{const P=Object.getOwnPropertyDescriptor(c,R);"value"in P&&(I[R]=c[R],delete P.value,delete P.writable),Object.defineProperty(C,R,P)}),I})=>[l,Wa,S0,t,e,n,r,i,s,o,a],[Fj]=Uj();function qT(t={}){return Fj(t)}function Bj(t,e,n){const r=Wa.get(t);($v?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");let i;const s=[],o=r[3];let a=!1;const c=o(h=>{if(s.push(h),n){e(s.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,c()}}function UP(t,e){const n=Wa.get(t);($v?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");const[r,i,s]=n;return s(r,i(),e)}var zj={ZSS_LANG_DEV:"false",ZSS_STATS_DEV:"false",ZSS_SHOW_CODE:"false",ZSS_BRANCH_NAME:"main",ZSS_BRANCH_VERSION:"0.0.3",ZSS_COMMIT_HASH:"295766cd0a025452e00ff642b55a1495810fec25",ZSS_COMMIT_MESSAGE:"ci: version bump to v0.0.3",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{use:FP}=Bd,{useSyncExternalStore:Hj}=aj,Vj=(t,e)=>{const n=K.useRef();K.useEffect(()=>{n.current=Dj(t,e,!0)}),K.useDebugValue(n.current)},Gj=new WeakMap;function h_(t,e){const n=e==null?void 0:e.sync,r=K.useRef(),i=K.useRef();let s=!0;const o=Hj(K.useCallback(c=>{const h=Bj(t,c,n);return c(),h},[t,n]),()=>{const c=UP(t,FP);try{if(!s&&r.current&&i.current&&!z3(r.current,c,i.current,new WeakMap))return r.current}catch{}return c},()=>UP(t,FP));s=!1;const a=new WeakMap;K.useEffect(()=>{r.current=o,i.current=a}),(zj?"production":void 0)!=="production"&&Vj(o,a);const l=K.useMemo(()=>new WeakMap,[]);return B3(o,a,l,Gj)}let xS=!1;const Ts=qT({state:{player:"",layers:[],layout:[],layoutreset:!1,layoutfocus:""}}),SS=WT("gadgetclient",["ready","second"],t=>{switch(t.target){case"ready":t.player&&Ts.state.player===""&&(Ts.state.player=t.player,SS.emit("vm:login",void 0,Ts.state.player));break;case"second":Ts.state.player&&SS.emit("vm:doot",void 0,Ts.state.player);break;case"reset":t.player===Ts.state.player&&(xS=!1,Ts.state=t.data);break;case"patch":if(t.player===Ts.state.player&&!xS)try{f_(Ts.state,t.data,!0)}catch(e){e instanceof XT&&(xS=!0,SS.reply(t,"desync",void 0,Ts.state.player))}break}});function Wj(){return Ts.state}const BP=1,zP=2,ES=4,wS=8,Ap=32,oa=64,Oi=128,d_=31,Dw=63,Tc=127,Xj=2147483647,vl=Math.floor,ev=Math.abs,H3=(t,e)=>tt>e?t:e,V3=t=>t!==0?t<0:1/t<0,G3=Number.MAX_SAFE_INTEGER,jj=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&vl(t)===t),Hf=()=>new Set,MS=t=>t[t.length-1],$j=(t,e)=>{for(let n=0;nt.toLowerCase(),qj=/^\s*/g,Zj=t=>t.replace(qj,""),Jj=/([A-Z])/g,HP=(t,e)=>Zj(t.replace(Jj,n=>`${e}${Kj(n)}`)),Qj=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let i=0;iCp.encode(t),t$=Cp?e$:Qj;let kd=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});kd&&kd.decode(new Uint8Array).length===1&&(kd=null);const _l=t=>new Error(t),So=()=>{throw _l("Method unimplemented")},To=()=>{throw _l("Unexpected case")};class em{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const cl=()=>new em,n$=t=>{let e=t.cpos;for(let n=0;n{const e=new Uint8Array(n$(t));let n=0;for(let r=0;r{const n=t.cbuf.length;n-t.cpos{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},Uw=cr,Rt=(t,e)=>{for(;e>Tc;)cr(t,Oi|Tc&e),e=vl(e/128);cr(t,Tc&e)},ZT=(t,e)=>{const n=V3(e);for(n&&(e=-e),cr(t,(e>Dw?Oi:0)|(n?oa:0)|Dw&e),e=vl(e/64);e>0;)cr(t,(e>Tc?Oi:0)|Tc&e),e=vl(e/128)},Fw=new Uint8Array(3e4),i$=Fw.length/3,s$=(t,e)=>{if(e.length{const n=unescape(encodeURIComponent(e)),r=n.length;Rt(t,r);for(let i=0;i{const n=t.cbuf.length,r=t.cpos,i=H3(n-r,e.length),s=e.length-i;t.cbuf.set(e.subarray(0,i),r),t.cpos+=i,s>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(Yc(n*2,s)),t.cbuf.set(e.subarray(i)),t.cpos=s)},Nr=(t,e)=>{Rt(t,e.byteLength),p_(t,e)},JT=(t,e)=>{r$(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},a$=(t,e)=>JT(t,4).setFloat32(0,e,!1),l$=(t,e)=>JT(t,8).setFloat64(0,e,!1),c$=(t,e)=>JT(t,8).setBigInt64(0,e,!1),VP=new DataView(new ArrayBuffer(4)),u$=t=>(VP.setFloat32(0,t),VP.getFloat32(0)===t),Rp=(t,e)=>{switch(typeof e){case"string":cr(t,119),_f(t,e);break;case"number":jj(e)&&ev(e)<=Xj?(cr(t,125),ZT(t,e)):u$(e)?(cr(t,124),a$(t,e)):(cr(t,123),l$(t,e));break;case"bigint":cr(t,122),c$(t,e);break;case"object":if(e===null)cr(t,126);else if(Yj(e)){cr(t,117),Rt(t,e.length);for(let n=0;n0&&Rt(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const WP=t=>{t.count>0&&(ZT(t.encoder,t.count===1?t.s:-t.s),t.count>1&&Rt(t.encoder,t.count-2))};class tv{constructor(){this.encoder=new em,this.s=0,this.count=0}write(e){this.s===e?this.count++:(WP(this),this.count=1,this.s=e)}toUint8Array(){return WP(this),Os(this.encoder)}}const XP=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);ZT(t.encoder,e),t.count>1&&Rt(t.encoder,t.count-2)}};class TS{constructor(){this.encoder=new em,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(XP(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return XP(this),Os(this.encoder)}}class f${constructor(){this.sarr=[],this.s="",this.lensE=new tv}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new em;return this.sarr.push(this.s),this.s="",_f(e,this.sarr.join("")),p_(e,this.lensE.toUint8Array()),Os(e)}}const W3=_l("Unexpected end of array"),X3=_l("Integer out of Range");class m_{constructor(e){this.arr=e,this.pos=0}}const Kc=t=>new m_(t),h$=t=>t.pos!==t.arr.length,d$=(t,e)=>{const n=new Uint8Array(t.arr.buffer,t.pos+t.arr.byteOffset,e);return t.pos+=e,n},Wr=t=>d$(t,bt(t)),Vf=t=>t.arr[t.pos++],bt=t=>{let e=0,n=1;const r=t.arr.length;for(;t.posG3)throw X3}throw W3},QT=t=>{let e=t.arr[t.pos++],n=e&Dw,r=64;const i=(e&oa)>0?-1:1;if(!(e&Oi))return i*n;const s=t.arr.length;for(;t.posG3)throw X3}throw W3},p$=t=>{let e=bt(t);if(e===0)return"";{let n=String.fromCodePoint(Vf(t));if(--e<100)for(;e--;)n+=String.fromCodePoint(Vf(t));else for(;e>0;){const r=e<1e4?e:1e4,i=t.arr.subarray(t.pos,t.pos+r);t.pos+=r,n+=String.fromCodePoint.apply(null,i),e-=r}return decodeURIComponent(escape(n))}},m$=t=>kd.decode(Wr(t)),xf=kd?m$:p$,eA=(t,e)=>{const n=new DataView(t.arr.buffer,t.arr.byteOffset+t.pos,e);return t.pos+=e,n},g$=t=>eA(t,4).getFloat32(0,!1),v$=t=>eA(t,8).getFloat64(0,!1),y$=t=>eA(t,8).getBigInt64(0,!1),_$=[t=>{},t=>null,QT,g$,v$,y$,t=>!1,t=>!0,xf,t=>{const e=bt(t),n={};for(let r=0;r{const e=bt(t),n=[];for(let r=0;r_$[127-Vf(t)](t);class jP extends m_{constructor(e,n){super(e),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),h$(this)?this.count=bt(this)+1:this.count=-1),this.count--,this.s}}class nv extends m_{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=QT(this);const e=V3(this.s);this.count=1,e&&(this.s=-this.s,this.count=bt(this)+2)}return this.count--,this.s}}class AS extends m_{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const e=QT(this),n=e&1;this.diff=vl(e/2),this.count=1,n&&(this.count=bt(this)+2)}return this.s+=this.diff,this.count--,this.s}}class x${constructor(e){this.decoder=new nv(e),this.str=xf(this.decoder),this.spos=0}read(){const e=this.spos+this.decoder.read(),n=this.str.slice(this.spos,e);return this.spos=e,n}}const Bs=()=>new Map,Bw=t=>{const e=Bs();return t.forEach((n,r)=>{e.set(r,n)}),e},Ll=(t,e,n)=>{let r=t.get(e);return r===void 0&&t.set(e,r=n()),r},S$=(t,e)=>{const n=[];for(const[r,i]of t)n.push(e(i,r));return n},E$=(t,e)=>{for(const[n,r]of t)if(e(r,n))return!0;return!1};class w${constructor(){this._observers=Bs()}on(e,n){return Ll(this._observers,e,Hf).add(n),n}once(e,n){const r=(...i)=>{this.off(e,r),n(...i)};this.on(e,r)}off(e,n){const r=this._observers.get(e);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(e))}emit(e,n){return yl((this._observers.get(e)||Bs()).values()).forEach(r=>r(...n))}destroy(){this._observers=Bs()}}const M$=crypto.getRandomValues.bind(crypto),j3=()=>M$(new Uint32Array(1))[0],T$="10000000-1000-4000-8000"+-1e11,A$=()=>T$.replace(/[018]/g,t=>(t^j3()&15>>t/4).toString(16)),$P=t=>new Promise(t);Promise.all.bind(Promise);const YP=t=>t===void 0?null:t;class C${constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}}let $3=new C$,R$=!0;try{typeof localStorage<"u"&&localStorage&&($3=localStorage,R$=!1)}catch{}const b$=$3,P$=Object.assign,I$=Object.keys,L$=(t,e)=>{for(const n in t)e(t[n],n)},KP=t=>I$(t).length,N$=t=>{for(const e in t)return!1;return!0},O$=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},k$=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),D$=(t,e)=>t===e||KP(t)===KP(e)&&O$(t,(n,r)=>(n!==void 0||k$(e,r))&&e[r]===n),tA=(t,e,n=0)=>{try{for(;nt,F$=(t,e)=>e.includes(t);var Y3={};const Pp=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";let ao;const B$=()=>{if(ao===void 0)if(Pp){ao=Bs();const t=process.argv;let e=null;for(let n=0;n{if(t.length!==0){const[e,n]=t.split("=");ao.set(`--${HP(e,"-")}`,n),ao.set(`-${HP(e,"-")}`,n)}})):ao=Bs();return ao},zw=t=>B$().has(t),Hw=t=>YP(Pp?Y3[t.toUpperCase().replaceAll("-","_")]:b$.getItem(t)),z$=t=>zw("--"+t)||Hw(t)!==null;z$("production");const qP=Pp&&F$(Y3.FORCE_COLOR,["true","1","2"]),H$=!zw("no-colors")&&(!Pp||process.stdout.isTTY||qP)&&(!Pp||zw("color")||qP||Hw("COLORTERM")!==null||(Hw("TERM")||"").includes("color")),V$=t=>new Uint8Array(t),G$=t=>{const e=V$(t.byteLength);return e.set(t),e};class W${constructor(e,n){this.left=e,this.right=n}}const Zo=(t,e)=>new W$(t,e);typeof DOMParser<"u"&&new DOMParser;const X$=t=>S$(t,(e,n)=>`${n}:${e};`).join(""),ya=Symbol,K3=ya(),q3=ya(),j$=ya(),$$=ya(),Y$=ya(),Z3=ya(),K$=ya(),J3=ya(),q$=ya(),Z$=t=>{var r;t.length===1&&((r=t[0])==null?void 0:r.constructor)===Function&&(t=t[0]());const e=[];let n=0;for(;n{var o;t.length===1&&((o=t[0])==null?void 0:o.constructor)===Function&&(t=t[0]());const e=[],n=[],r=Bs();let i=[],s=0;for(;s0||c.length>0?(e.push("%c"+a),n.push(c)):e.push(a)}else break}}for(s>0&&(i=n,i.unshift(e.join("")));s{console.log(...eY(t)),nY.forEach(e=>e.print(t))},nY=Hf(),Q3=t=>({[Symbol.iterator](){return this},next:t}),rY=(t,e)=>Q3(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),CS=(t,e)=>Q3(()=>{const{done:n,value:r}=t.next();return{done:n,value:n?void 0:e(r)}});class nA{constructor(e,n){this.clock=e,this.len=n}}class tm{constructor(){this.clients=new Map}}const e4=(t,e,n)=>e.clients.forEach((r,i)=>{const s=t.doc.store.clients.get(i);for(let o=0;o{let n=0,r=t.length-1;for(;n<=r;){const i=vl((n+r)/2),s=t[i],o=s.clock;if(o<=e){if(e{const n=t.clients.get(e.client);return n!==void 0&&iY(n,e.clock)!==null},rA=t=>{t.clients.forEach(e=>{e.sort((i,s)=>i.clock-s.clock);let n,r;for(n=1,r=1;n=s.clock?i.len=Yc(i.len,s.clock+s.len-i.clock):(r{const e=new tm;for(let n=0;n{if(!e.clients.has(i)){const s=r.slice();for(let o=n+1;o{Ll(t.clients,e,()=>[]).push(new nA(n,r))},oY=()=>new tm,aY=t=>{const e=oY();return t.clients.forEach((n,r)=>{const i=[];for(let s=0;s0&&e.clients.set(r,i)}),e},uh=(t,e)=>{Rt(t.restEncoder,e.clients.size),yl(e.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{t.resetDsCurVal(),Rt(t.restEncoder,n);const i=r.length;Rt(t.restEncoder,i);for(let s=0;s{const e=new tm,n=bt(t.restDecoder);for(let r=0;r0){const o=Ll(e.clients,i,()=>[]);for(let a=0;a{const r=new tm,i=bt(t.restDecoder);for(let s=0;s0){const s=new kc;return Rt(s.restEncoder,0),uh(s,r),s.toUint8Array()}return null},n4=j3;class fh extends w${constructor({guid:e=A$(),collectionid:n=null,gc:r=!0,gcFilter:i=()=>!0,meta:s=null,autoLoad:o=!1,shouldLoad:a=!0}={}){super(),this.gc=r,this.gcFilter=i,this.clientID=n4(),this.guid=e,this.collectionid=n,this.share=new Map,this.store=new f4,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=a,this.autoLoad=o,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=$P(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});const l=()=>$P(c=>{const h=d=>{(d===void 0||d===!0)&&(this.off("sync",h),c())};this.on("sync",h)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const e=this._item;e!==null&&!this.shouldLoad&&nn(e.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(yl(this.subdocs).map(e=>e.guid))}transact(e,n=null){return nn(this,e,n)}get(e,n=Er){const r=Ll(this.share,e,()=>{const s=new n;return s._integrate(this,null),s}),i=r.constructor;if(n!==Er&&i!==n)if(i===Er){const s=new n;s._map=r._map,r._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=s}),s._start=r._start;for(let o=s._start;o!==null;o=o.right)o.parent=s;return s._length=r._length,this.share.set(e,s),s._integrate(this,null),s}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return r}getArray(e=""){return this.get(e,Ef)}getText(e=""){return this.get(e,Dc)}getMap(e=""){return this.get(e,Wf)}getXmlElement(e=""){return this.get(e,Xf)}getXmlFragment(e=""){return this.get(e,Uc)}toJSON(){const e={};return this.share.forEach((n,r)=>{e[r]=n.toJSON()}),e}destroy(){yl(this.subdocs).forEach(n=>n.destroy());const e=this._item;if(e!==null){this._item=null;const n=e.content;n.doc=new fh({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=e,nn(e.parent.doc,r=>{const i=n.doc;e.deleted||r.subdocsAdded.add(i),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class r4{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return bt(this.restDecoder)}readDsLen(){return bt(this.restDecoder)}}class i4 extends r4{readLeftID(){return Ot(bt(this.restDecoder),bt(this.restDecoder))}readRightID(){return Ot(bt(this.restDecoder),bt(this.restDecoder))}readClient(){return bt(this.restDecoder)}readInfo(){return Vf(this.restDecoder)}readString(){return xf(this.restDecoder)}readParentInfo(){return bt(this.restDecoder)===1}readTypeRef(){return bt(this.restDecoder)}readLen(){return bt(this.restDecoder)}readAny(){return bp(this.restDecoder)}readBuf(){return G$(Wr(this.restDecoder))}readJSON(){return JSON.parse(xf(this.restDecoder))}readKey(){return xf(this.restDecoder)}}class lY{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=bt(this.restDecoder),this.dsCurrVal}readDsLen(){const e=bt(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class Gf extends lY{constructor(e){super(e),this.keys=[],bt(e),this.keyClockDecoder=new AS(Wr(e)),this.clientDecoder=new nv(Wr(e)),this.leftClockDecoder=new AS(Wr(e)),this.rightClockDecoder=new AS(Wr(e)),this.infoDecoder=new jP(Wr(e),Vf),this.stringDecoder=new x$(Wr(e)),this.parentInfoDecoder=new jP(Wr(e),Vf),this.typeRefDecoder=new nv(Wr(e)),this.lenDecoder=new nv(Wr(e))}readLeftID(){return new Sf(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Sf(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return bp(this.restDecoder)}readBuf(){return Wr(this.restDecoder)}readJSON(){return bp(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e{r=Yc(r,e[0].id.clock);const i=Ao(e,r);Rt(t.restEncoder,e.length-i),t.writeClient(n),Rt(t.restEncoder,r);const s=e[i];s.write(t,r-s.id.clock);for(let o=i+1;o{const r=new Map;n.forEach((i,s)=>{hr(e,s)>i&&r.set(s,i)}),g_(e).forEach((i,s)=>{n.has(s)||r.set(s,0)}),Rt(t.restEncoder,r.size),yl(r.entries()).sort((i,s)=>s[0]-i[0]).forEach(([i,s])=>{cY(t,e.clients.get(i),i,s)})},uY=(t,e)=>{const n=Bs(),r=bt(t.restDecoder);for(let i=0;i{const r=[];let i=yl(n.keys()).sort((m,y)=>m-y);if(i.length===0)return null;const s=()=>{if(i.length===0)return null;let m=n.get(i[i.length-1]);for(;m.refs.length===m.i;)if(i.pop(),i.length>0)m=n.get(i[i.length-1]);else return null;return m};let o=s();if(o===null)return null;const a=new f4,l=new Map,c=(m,y)=>{const S=l.get(m);(S==null||S>y)&&l.set(m,y)};let h=o.refs[o.i++];const d=new Map,p=()=>{for(const m of r){const y=m.id.client,S=n.get(y);S?(S.i--,a.clients.set(y,S.refs.slice(S.i)),n.delete(y),S.i=0,S.refs=[]):a.clients.set(y,[m]),i=i.filter(E=>E!==y)}r.length=0};for(;;){if(h.constructor!==is){const y=Ll(d,h.id.client,()=>hr(e,h.id.client))-h.id.clock;if(y<0)r.push(h),c(h.id.client,h.id.clock-1),p();else{const S=h.getMissing(t,e);if(S!==null){r.push(h);const E=n.get(S)||{refs:[],i:0};if(E.refs.length===E.i)c(S,hr(e,S)),p();else{h=E.refs[E.i++];continue}}else(y===0||y0)h=r.pop();else if(o!==null&&o.i0){const m=new kc;return sA(m,a,new Map),Rt(m.restEncoder,0),{missing:l,update:m.toUint8Array()}}return null},hY=(t,e)=>sA(t,e.doc.store,e.beforeState),dY=(t,e,n,r=new Gf(t))=>nn(e,i=>{i.local=!1;let s=!1;const o=i.doc,a=o.store,l=uY(r,o),c=fY(i,a,l),h=a.pendingStructs;if(h){for(const[p,m]of h.missing)if(mm)&&h.missing.set(p,m)}h.update=Kv([h.update,c.update])}}else a.pendingStructs=c;const d=ZP(r,i,a);if(a.pendingDs){const p=new Gf(Kc(a.pendingDs));bt(p.restDecoder);const m=ZP(p,i,a);d&&m?a.pendingDs=Kv([d,m]):a.pendingDs=d||m}else a.pendingDs=d;if(s){const p=a.pendingStructs.update;a.pendingStructs=null,a4(i.doc,p)}},n,!1),a4=(t,e,n,r=Gf)=>{const i=Kc(e);dY(i,t,n,new r(i))},pY=(t,e,n)=>a4(t,e,n,i4),mY=(t,e,n=new Map)=>{sA(t,e.store,n),uh(t,aY(e.store))},gY=(t,e=new Uint8Array([0]),n=new kc)=>{const r=l4(e);mY(n,t,r);const i=[n.toUint8Array()];if(t.store.pendingDs&&i.push(t.store.pendingDs),t.store.pendingStructs&&i.push(LY(t.store.pendingStructs.update,e)),i.length>1){if(n.constructor===nm)return PY(i.map((s,o)=>o===0?s:OY(s)));if(n.constructor===kc)return Kv(i)}return i[0]},vY=(t,e)=>gY(t,e,new nm),yY=t=>{const e=new Map,n=bt(t.restDecoder);for(let r=0;ryY(new r4(Kc(t))),c4=(t,e)=>(Rt(t.restEncoder,e.size),yl(e.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{Rt(t.restEncoder,n),Rt(t.restEncoder,r)}),t),_Y=(t,e)=>c4(t,g_(e.store)),xY=(t,e=new o4)=>(t instanceof Map?c4(e,t):_Y(e,t),e.toUint8Array()),SY=t=>xY(t,new s4);class EY{constructor(){this.l=[]}}const JP=()=>new EY,QP=(t,e)=>t.l.push(e),eI=(t,e)=>{const n=t.l,r=n.length;t.l=n.filter(i=>e!==i),r===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},u4=(t,e,n)=>tA(t.l,[e,n]);class Sf{constructor(e,n){this.client=e,this.clock=n}}const E0=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,Ot=(t,e)=>new Sf(t,e),wY=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw To()},Vu=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!t4(e.ds,t.id),Vw=(t,e)=>{const n=Ll(t.meta,Vw,Hf),r=t.doc.store;n.has(e)||(e.sv.forEach((i,s)=>{i{}),n.add(e))};class f4{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const g_=t=>{const e=new Map;return t.clients.forEach((n,r)=>{const i=n[n.length-1];e.set(r,i.id.clock+i.length)}),e},hr=(t,e)=>{const n=t.clients.get(e);if(n===void 0)return 0;const r=n[n.length-1];return r.id.clock+r.length},h4=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{const r=n[n.length-1];if(r.id.clock+r.length!==e.id.clock)throw To()}n.push(e)},Ao=(t,e)=>{let n=0,r=t.length-1,i=t[r],s=i.id.clock;if(s===e)return r;let o=vl(e/(s+i.length-1)*r);for(;n<=r;){if(i=t[o],s=i.id.clock,s<=e){if(e{const n=t.clients.get(e.client);return n[Ao(n,e.clock)]},RS=MY,Gw=(t,e,n)=>{const r=Ao(e,n),i=e[r];return i.id.clock{const n=t.doc.store.clients.get(e.client);return n[Gw(t,n,e.clock)]},tI=(t,e,n)=>{const r=e.clients.get(n.client),i=Ao(r,n.clock),s=r[i];return n.clock!==s.id.clock+s.length-1&&s.constructor!==rs&&r.splice(i+1,0,ty(t,s,n.clock-s.id.clock+1)),s},TY=(t,e,n)=>{const r=t.clients.get(e.id.client);r[Ao(r,e.id.clock)]=n},d4=(t,e,n,r,i)=>{if(r===0)return;const s=n+r;let o=Gw(t,e,n),a;do a=e[o++],se.deleteSet.clients.size===0&&!E$(e.afterState,(n,r)=>e.beforeState.get(r)!==n)?!1:(rA(e.deleteSet),hY(t,e),uh(t,e.deleteSet),!0),rI=(t,e,n)=>{const r=e._item;(r===null||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)&&Ll(t.changed,e,Hf).add(n)},rv=(t,e)=>{let n=t[e],r=t[e-1],i=e;for(;i>0;n=r,r=t[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof qn&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}const s=e-i;return s&&t.splice(e+1-s,s),s},CY=(t,e,n)=>{for(const[r,i]of t.clients.entries()){const s=e.clients.get(r);for(let o=i.length-1;o>=0;o--){const a=i[o],l=a.clock+a.len;for(let c=Ao(s,a.clock),h=s[c];c{t.clients.forEach((n,r)=>{const i=e.clients.get(r);for(let s=n.length-1;s>=0;s--){const o=n[s],a=H3(i.length-1,1+Ao(i,o.clock+o.len-1));for(let l=a,c=i[l];l>0&&c.id.clock>=o.clock;c=i[l])l-=1+rv(i,l)}})},p4=(t,e)=>{if(ea.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(n,l)})),a.push(()=>{n.changedParentTypes.forEach((l,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(l=l.filter(h=>h.target._item===null||!h.target._item.deleted),l.forEach(h=>{h.currentTarget=c,h._path=null}),l.sort((h,d)=>h.path.length-d.path.length),u4(c._dEH,l,n))})}),a.push(()=>r.emit("afterTransaction",[n,r])),tA(a,[]),n._needFormattingCleanup&&YY(n)}finally{r.gc&&CY(s,i,r.gcFilter),RY(s,i),n.afterState.forEach((h,d)=>{const p=n.beforeState.get(d)||0;if(p!==h){const m=i.clients.get(d),y=Yc(Ao(m,p),1);for(let S=m.length-1;S>=y;)S-=1+rv(m,S)}});for(let h=o.length-1;h>=0;h--){const{client:d,clock:p}=o[h].id,m=i.clients.get(d),y=Ao(m,p);y+11||y>0&&rv(m,y)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(tY(J3,K3,"[yjs] ",q3,Z3,"Changed the client-id because another client seems to be using it."),r.clientID=n4()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const h=new nm;nI(h,n)&&r.emit("update",[h.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const h=new kc;nI(h,n)&&r.emit("updateV2",[h.toUint8Array(),n.origin,r,n])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=n;(a.size>0||c.size>0||l.size>0)&&(a.forEach(h=>{h.clientID=r.clientID,h.collectionid==null&&(h.collectionid=r.collectionid),r.subdocs.add(h)}),c.forEach(h=>r.subdocs.delete(h)),r.emit("subdocs",[{loaded:l,added:a,removed:c},r,n]),c.forEach(h=>h.destroy())),t.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t])):p4(t,e+1)}}},nn=(t,e,n=null,r=!0)=>{const i=t._transactionCleanups;let s=!1,o=null;t._transaction===null&&(s=!0,t._transaction=new AY(t,n,r),i.push(t._transaction),i.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{o=e(t._transaction)}finally{if(s){const a=t._transaction===i[0];t._transaction=null,a&&p4(i,0)}}return o};function*bY(t){const e=bt(t.restDecoder);for(let n=0;nKv(t,i4,nm),IY=(t,e)=>{if(t.constructor===rs){const{client:n,clock:r}=t.id;return new rs(Ot(n,r+e),t.length-e)}else if(t.constructor===is){const{client:n,clock:r}=t.id;return new is(Ot(n,r+e),t.length-e)}else{const n=t,{client:r,clock:i}=n.id;return new qn(Ot(r,i+e),null,Ot(r,i+e-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(e))}},Kv=(t,e=Gf,n=kc)=>{if(t.length===1)return t[0];const r=t.map(h=>new e(Kc(h)));let i=r.map(h=>new oA(h,!0)),s=null;const o=new n,a=new aA(o);for(;i=i.filter(p=>p.curr!==null),i.sort((p,m)=>{if(p.curr.id.client===m.curr.id.client){const y=p.curr.id.clock-m.curr.id.clock;return y===0?p.curr.constructor===m.curr.constructor?0:p.curr.constructor===is?1:-1:y}else return m.curr.id.client-p.curr.id.client}),i.length!==0;){const h=i[0],d=h.curr.id.client;if(s!==null){let p=h.curr,m=!1;for(;p!==null&&p.id.clock+p.length<=s.struct.id.clock+s.struct.length&&p.id.client>=s.struct.id.client;)p=h.next(),m=!0;if(p===null||p.id.client!==d||m&&p.id.clock>s.struct.id.clock+s.struct.length)continue;if(d!==s.struct.id.client)Ya(a,s.struct,s.offset),s={struct:p,offset:0},h.next();else if(s.struct.id.clock+s.struct.length0&&(s.struct.constructor===is?s.struct.length-=y:p=IY(p,y)),s.struct.mergeWith(p)||(Ya(a,s.struct,s.offset),s={struct:p,offset:0},h.next())}}else s={struct:h.curr,offset:0},h.next();for(let p=h.curr;p!==null&&p.id.client===d&&p.id.clock===s.struct.id.clock+s.struct.length&&p.constructor!==is;p=h.next())Ya(a,s.struct,s.offset),s={struct:p,offset:0}}s!==null&&(Ya(a,s.struct,s.offset),s=null),lA(a);const l=r.map(h=>iA(h)),c=sY(l);return uh(o,c),o.toUint8Array()},LY=(t,e,n=Gf,r=kc)=>{const i=l4(e),s=new r,o=new aA(s),a=new n(Kc(t)),l=new oA(a,!1);for(;l.curr;){const h=l.curr,d=h.id.client,p=i.get(d)||0;if(l.curr.constructor===is){l.next();continue}if(h.id.clock+h.length>p)for(Ya(o,h,Yc(p-h.id.clock,0)),l.next();l.curr&&l.curr.id.client===d;)Ya(o,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===d&&l.curr.id.clock+l.curr.length<=p;)l.next()}lA(o);const c=iA(a);return uh(s,c),s.toUint8Array()},m4=t=>{t.written>0&&(t.clientStructs.push({written:t.written,restEncoder:Os(t.encoder.restEncoder)}),t.encoder.restEncoder=cl(),t.written=0)},Ya=(t,e,n)=>{t.written>0&&t.currClient!==e.id.client&&m4(t),t.written===0&&(t.currClient=e.id.client,t.encoder.writeClient(e.id.client),Rt(t.encoder.restEncoder,e.id.clock+n)),e.write(t.encoder,n),t.written++},lA=t=>{m4(t);const e=t.encoder.restEncoder;Rt(e,t.clientStructs.length);for(let n=0;n{const i=new n(Kc(t)),s=new oA(i,!1),o=new r,a=new aA(o);for(let c=s.curr;c!==null;c=s.next())Ya(a,e(c),0);lA(a);const l=iA(i);return uh(o,l),o.toUint8Array()},OY=t=>NY(t,U$,Gf,nm),iI="You must not compute changes after the event-handler fired.";class v_{constructor(e,n){this.target=e,this.currentTarget=e,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=kY(this.currentTarget,this.target))}deletes(e){return t4(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw _l(iI);const e=new Map,n=this.target;this.transaction.changed.get(n).forEach(i=>{if(i!==null){const s=n._map.get(i);let o,a;if(this.adds(s)){let l=s.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(s))if(l!==null&&this.deletes(l))o="delete",a=MS(l.content.getContent());else return;else l!==null&&this.deletes(l)?(o="update",a=MS(l.content.getContent())):(o="add",a=void 0)}else if(this.deletes(s))o="delete",a=MS(s.content.getContent());else return;e.set(i,{action:o,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw _l(iI);const n=this.target,r=Hf(),i=Hf(),s=[];if(e={added:r,deleted:i,delta:s,keys:this.keys},this.transaction.changed.get(n).has(null)){let a=null;const l=()=>{a&&s.push(a)};for(let c=n._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((a===null||a.delete===void 0)&&(l(),a={delete:0}),a.delete+=c.length,i.add(c)):this.adds(c)?((a===null||a.insert===void 0)&&(l(),a={insert:[]}),a.insert=a.insert.concat(c.content.getContent()),r.add(c)):((a===null||a.retain===void 0)&&(l(),a={retain:0}),a.retain+=c.length);a!==null&&a.retain===void 0&&l()}this._changes=e}return e}}const kY=(t,e)=>{const n=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let r=0,i=e._item.parent._start;for(;i!==e._item&&i!==null;)i.deleted||r++,i=i.right;n.unshift(r)}e=e._item.parent}return n},g4=80;let cA=0;class DY{constructor(e,n){e.marker=!0,this.p=e,this.index=n,this.timestamp=cA++}}const UY=t=>{t.timestamp=cA++},v4=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=cA++},FY=(t,e,n)=>{if(t.length>=g4){const r=t.reduce((i,s)=>i.timestamp{if(t._start===null||e===0||t._searchMarker===null)return null;const n=t._searchMarker.length===0?null:t._searchMarker.reduce((s,o)=>ev(e-s.index)e;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&ev(n.index-i){for(let r=t.length-1;r>=0;r--){const i=t[r];if(n>0){let s=i.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(i.index-=s.length);if(s===null||s.marker===!0){t.splice(r,1);continue}i.p=s,s.marker=!0}(e0&&e===i.index)&&(i.index=Yc(e,i.index+n))}},__=(t,e,n)=>{const r=t,i=e.changedParentTypes;for(;Ll(i,t,()=>[]).push(n),t._item!==null;)t=t._item.parent;u4(r._eH,n,e)};class Er{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=JP(),this._dEH=JP(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,n){this.doc=e,this._item=n}_copy(){throw So()}clone(){throw So()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,n){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){QP(this._eH,e)}observeDeep(e){QP(this._dEH,e)}unobserve(e){eI(this._eH,e)}unobserveDeep(e){eI(this._dEH,e)}toJSON(){}}const y4=(t,e,n)=>{e<0&&(e=t._length+e),n<0&&(n=t._length+n);let r=n-e;const i=[];let s=t._start;for(;s!==null&&r>0;){if(s.countable&&!s.deleted){const o=s.content.getContent();if(o.length<=e)e-=o.length;else{for(let a=e;a0;a++)i.push(o[a]),r--;e=0}}s=s.right}return i},_4=t=>{const e=[];let n=t._start;for(;n!==null;){if(n.countable&&!n.deleted){const r=n.content.getContent();for(let i=0;i{let n=0,r=t._start;for(;r!==null;){if(r.countable&&!r.deleted){const i=r.content.getContent();for(let s=0;s{const n=[];return Lp(t,(r,i)=>{n.push(e(r,i,t))}),n},BY=t=>{let e=t._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};n=e.content.getContent(),r=0,e=e.right}const i=n[r++];return n.length<=r&&(n=null),{done:!1,value:i}}}},S4=(t,e)=>{const n=y_(t,e);let r=t._start;for(n!==null&&(r=n.p,e-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(e{let i=n;const s=t.doc,o=s.clientID,a=s.store,l=n===null?e._start:n.right;let c=[];const h=()=>{c.length>0&&(i=new qn(Ot(o,hr(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new Fc(c)),i.integrate(t,0),c=[])};r.forEach(d=>{if(d===null)c.push(d);else switch(d.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(d);break;default:switch(h(),d.constructor){case Uint8Array:case ArrayBuffer:i=new qn(Ot(o,hr(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new rm(new Uint8Array(d))),i.integrate(t,0);break;case fh:i=new qn(Ot(o,hr(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new im(d)),i.integrate(t,0);break;default:if(d instanceof Er)i=new qn(Ot(o,hr(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new _a(d)),i.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),h()},E4=()=>_l("Length exceeded!"),w4=(t,e,n,r)=>{if(n>e._length)throw E4();if(n===0)return e._searchMarker&&Ip(e._searchMarker,n,r.length),qv(t,e,null,r);const i=n,s=y_(e,n);let o=e._start;for(s!==null&&(o=s.p,n-=s.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n{let i=(e._searchMarker||[]).reduce((s,o)=>o.index>s.index?o:s,{index:0,p:e._start}).p;if(i)for(;i.right;)i=i.right;return qv(t,e,i,n)},M4=(t,e,n,r)=>{if(r===0)return;const i=n,s=r,o=y_(e,n);let a=e._start;for(o!==null&&(a=o.p,n-=o.index);a!==null&&n>0;a=a.right)!a.deleted&&a.countable&&(n0&&a!==null;)a.deleted||(r0)throw E4();e._searchMarker&&Ip(e._searchMarker,i,-s+r)},Zv=(t,e,n)=>{const r=e._map.get(n);r!==void 0&&r.delete(t)},uA=(t,e,n,r)=>{const i=e._map.get(n)||null,s=t.doc,o=s.clientID;let a;if(r==null)a=new Fc([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:a=new Fc([r]);break;case Uint8Array:a=new rm(r);break;case fh:a=new im(r);break;default:if(r instanceof Er)a=new _a(r);else throw new Error("Unexpected content type")}new qn(Ot(o,hr(s.store,o)),i,i&&i.lastId,null,null,e,n,a).integrate(t,0)},fA=(t,e)=>{const n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},T4=t=>{const e={};return t._map.forEach((n,r)=>{n.deleted||(e[r]=n.content.getContent()[n.length-1])}),e},A4=(t,e)=>{const n=t._map.get(e);return n!==void 0&&!n.deleted},HY=(t,e)=>{const n={};return t._map.forEach((r,i)=>{let s=r;for(;s!==null&&(!e.sv.has(s.id.client)||s.id.clock>=(e.sv.get(s.id.client)||0));)s=s.left;s!==null&&Vu(s,e)&&(n[i]=s.content.getContent()[s.length-1])}),n},w0=t=>rY(t.entries(),e=>!e[1].deleted);class VY extends v_{constructor(e,n){super(e,n),this._transaction=n}}class Ef extends Er{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const n=new Ef;return n.push(e),n}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Ef}clone(){const e=new Ef;return e.insert(0,this.toArray().map(n=>n instanceof Er?n.clone():n)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}_callObserver(e,n){super._callObserver(e,n),__(this,e,new VY(this,e))}insert(e,n){this.doc!==null?nn(this.doc,r=>{w4(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}push(e){this.doc!==null?nn(this.doc,n=>{zY(n,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,n=1){this.doc!==null?nn(this.doc,r=>{M4(r,this,e,n)}):this._prelimContent.splice(e,n)}get(e){return S4(this,e)}toArray(){return _4(this)}slice(e=0,n=this.length){return y4(this,e,n)}toJSON(){return this.map(e=>e instanceof Er?e.toJSON():e)}map(e){return x4(this,e)}forEach(e){Lp(this,e)}[Symbol.iterator](){return BY(this)}_write(e){e.writeTypeRef(hK)}}const GY=t=>new Ef;class WY extends v_{constructor(e,n,r){super(e,n),this.keysChanged=r}}class Wf extends Er{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,n){super._integrate(e,n),this._prelimContent.forEach((r,i)=>{this.set(i,r)}),this._prelimContent=null}_copy(){return new Wf}clone(){const e=new Wf;return this.forEach((n,r)=>{e.set(r,n instanceof Er?n.clone():n)}),e}_callObserver(e,n){__(this,e,new WY(this,e,n))}toJSON(){const e={};return this._map.forEach((n,r)=>{if(!n.deleted){const i=n.content.getContent()[n.length-1];e[r]=i instanceof Er?i.toJSON():i}}),e}get size(){return[...w0(this._map)].length}keys(){return CS(w0(this._map),e=>e[0])}values(){return CS(w0(this._map),e=>e[1].content.getContent()[e[1].length-1])}entries(){return CS(w0(this._map),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this._map.forEach((n,r)=>{n.deleted||e(n.content.getContent()[n.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?nn(this.doc,n=>{Zv(n,this,e)}):this._prelimContent.delete(e)}set(e,n){return this.doc!==null?nn(this.doc,r=>{uA(r,this,e,n)}):this._prelimContent.set(e,n),n}get(e){return fA(this,e)}has(e){return A4(this,e)}clear(){this.doc!==null?nn(this.doc,e=>{this.forEach(function(n,r,i){Zv(e,i,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(dK)}}const XY=t=>new Wf,Za=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&D$(t,e);class Ww{constructor(e,n,r,i){this.left=e,this.right=n,this.index=r,this.currentAttributes=i}forward(){switch(this.right===null&&To(),this.right.content.constructor){case Qn:this.right.deleted||hh(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const sI=(t,e,n)=>{for(;e.right!==null&&n>0;){switch(e.right.content.constructor){case Qn:e.right.deleted||hh(e.currentAttributes,e.right.content);break;default:e.right.deleted||(n{const i=new Map,s=r?y_(e,n):null;if(s){const o=new Ww(s.p.left,s.p,s.index,i);return sI(t,o,n-s.index)}else{const o=new Ww(null,e._start,0,i);return sI(t,o,n)}},C4=(t,e,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===Qn&&Za(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const i=t.doc,s=i.clientID;r.forEach((o,a)=>{const l=n.left,c=n.right,h=new qn(Ot(s,hr(i.store,s)),l,l&&l.lastId,c,c&&c.id,e,null,new Qn(a,o));h.integrate(t,0),n.right=h,n.forward()})},hh=(t,e)=>{const{key:n,value:r}=e;r===null?t.delete(n):t.set(n,r)},R4=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===Qn&&Za(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},b4=(t,e,n,r)=>{const i=t.doc,s=i.clientID,o=new Map;for(const a in r){const l=r[a],c=n.currentAttributes.get(a)??null;if(!Za(c,l)){o.set(a,c);const{left:h,right:d}=n;n.right=new qn(Ot(s,hr(i.store,s)),h,h&&h.lastId,d,d&&d.id,e,null,new Qn(a,l)),n.right.integrate(t,0),n.forward()}}return o},bS=(t,e,n,r,i)=>{n.currentAttributes.forEach((p,m)=>{i[m]===void 0&&(i[m]=null)});const s=t.doc,o=s.clientID;R4(n,i);const a=b4(t,e,n,i),l=r.constructor===String?new Co(r):r instanceof Er?new _a(r):new qc(r);let{left:c,right:h,index:d}=n;e._searchMarker&&Ip(e._searchMarker,n.index,l.getLength()),h=new qn(Ot(o,hr(s.store,o)),c,c&&c.lastId,h,h&&h.id,e,null,l),h.integrate(t,0),n.right=h,n.index=d,n.forward(),C4(t,e,n,a)},oI=(t,e,n,r,i)=>{const s=t.doc,o=s.clientID;R4(n,i);const a=b4(t,e,n,i);e:for(;n.right!==null&&(r>0||a.size>0&&(n.right.deleted||n.right.content.constructor===Qn));){if(!n.right.deleted)switch(n.right.content.constructor){case Qn:{const{key:l,value:c}=n.right.content,h=i[l];if(h!==void 0){if(Za(h,c))a.delete(l);else{if(r===0)break e;a.set(l,c)}n.right.delete(t)}else n.currentAttributes.set(l,c);break}default:r0){let l="";for(;r>0;r--)l+=` + */var jT=new WeakMap,wj=function(){function t(e){this.observers=new Map,this.obj=e}return t}(),Mj=function(){function t(e,n){this.callback=e,this.observer=n}return t}();function Tj(t){return jT.get(t)}function Aj(t,e){return t.observers.get(e)}function Cj(t,e){t.observers.delete(e.callback)}function Rj(t,e){e.unobserve()}function bj(t,e){var n=[],r,i=Tj(t);if(!i)i=new wj(t),jT.set(t,i);else{var s=Aj(i,e);r=s&&s.observer}if(r)return r;if(r={},i.value=fi(t),e){r.callback=e,r.next=null;var o=function(){Nw(r)},a=function(){clearTimeout(r.next),r.next=setTimeout(o)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return r.patches=n,r.object=t,r.unobserve=function(){Nw(r),clearTimeout(r.next),Cj(i,r),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},i.observers.set(e,new Mj(e,r)),r}function Nw(t,e){e===void 0&&(e=!1);var n=jT.get(t.object);$T(n.value,t.object,t.patches,"",e),t.patches.length&&f_(n.value,t.patches);var r=t.patches;return r.length>0&&(t.patches=[],t.callback&&t.callback(r)),r}function $T(t,e,n,r,i){if(e!==t){typeof e.toJSON=="function"&&(e=e.toJSON());for(var s=Pw(e),o=Pw(t),a=!1,l=o.length-1;l>=0;l--){var c=o[l],h=t[c];if(bw(e,c)&&!(e[c]===void 0&&h!==void 0&&Array.isArray(e)===!1)){var d=e[c];typeof h=="object"&&h!=null&&typeof d=="object"&&d!=null&&Array.isArray(h)===Array.isArray(d)?$T(h,d,n,r+"/"+sc(c),i):h!==d&&(i&&n.push({op:"test",path:r+"/"+sc(c),value:fi(h)}),n.push({op:"replace",path:r+"/"+sc(c),value:fi(d)}))}else Array.isArray(t)===Array.isArray(e)?(i&&n.push({op:"test",path:r+"/"+sc(c),value:fi(h)}),n.push({op:"remove",path:r+"/"+sc(c)}),a=!0):(i&&n.push({op:"test",path:r,value:t}),n.push({op:"replace",path:r,value:e}))}if(!(!a&&s.length==o.length))for(var l=0;lnew Proxy(t,e);const Ow=Object.getPrototypeOf,kw=new WeakMap,F3=t=>t&&(kw.has(t)?kw.get(t):Ow(t)===Object.prototype||Ow(t)===Array.prototype),jv=t=>typeof t=="object"&&t!==null,Oj=t=>{if(Array.isArray(t))return Array.from(t);const e=Object.getOwnPropertyDescriptors(t);return Object.values(e).forEach(n=>{n.configurable=!0}),Object.create(Ow(t),e)},KT=t=>t[YT]||t,B3=(t,e,n,r)=>{if(!F3(t))return t;let i=r&&r.get(t);if(!i){const l=KT(t);i=(c=>Object.values(Object.getOwnPropertyDescriptors(c)).some(h=>!h.configurable&&!h.writable))(l)?[l,Oj(l)]:[l],r==null||r.set(t,i)}const[s,o]=i;let a=n&&n.get(s);return a&&a[1].f===!!o||(a=((l,c)=>{const h={f:c};let d=!1;const p=(y,S)=>{if(!d){let E=h[sd].get(l);if(E||(E={},h[sd].set(l,E)),y===Od)E[Od]=!0;else{let g=E[y];g||(g=new Set,E[y]=g),g.add(S)}}},m={get:(y,S)=>S===YT?l:(p("k",S),B3(Reflect.get(y,S),h[sd],h.c,h.t)),has:(y,S)=>S===Lj?(d=!0,h[sd].delete(l),!0):(p("h",S),Reflect.has(y,S)),getOwnPropertyDescriptor:(y,S)=>(p("o",S),Reflect.getOwnPropertyDescriptor(y,S)),ownKeys:y=>(p(Od),Reflect.ownKeys(y))};return c&&(m.set=m.deleteProperty=()=>!1),[m,h]})(s,!!o),a[1].p=Nj(o||s,a[0]),n&&n.set(s,a)),a[1][sd]=e,a[1].c=n,a[1].t=r,a[1].p},z3=(t,e,n,r,i=Object.is)=>{if(i(t,e))return!1;if(!jv(t)||!jv(e))return!0;const s=n.get(KT(t));if(!s)return!0;if(r){const a=r.get(t);if(a&&a.n===e)return a.g;r.set(t,{n:e,g:!1})}let o=null;try{for(const a of s.h||[])if(o=Reflect.has(t,a)!==Reflect.has(e,a),o)return o;if(s[Od]===!0){if(o=((a,l)=>{const c=Reflect.ownKeys(a),h=Reflect.ownKeys(l);return c.length!==h.length||c.some((d,p)=>d!==h[p])})(t,e),o)return o}else for(const a of s.o||[])if(o=!!Reflect.getOwnPropertyDescriptor(t,a)!=!!Reflect.getOwnPropertyDescriptor(e,a),o)return o;for(const a of s.k||[])if(o=z3(t[a],e[a],n,r,i),o)return o;return o===null&&(o=!0),o}finally{r&&r.set(t,{n:e,g:o})}},kj=t=>F3(t)&&t[YT]||null,DP=(t,e=!0)=>{kw.set(t,e)},Dj=(t,e,n)=>{const r=[],i=new WeakSet,s=(o,a)=>{if(i.has(o))return;jv(o)&&i.add(o);const l=jv(o)&&e.get(KT(o));if(l){var c,h;if((c=l.h)==null||c.forEach(p=>{const m=`:has(${String(p)})`;r.push(a?[...a,m]:[m])}),l[Od]===!0){const p=":ownKeys";r.push(a?[...a,p]:[p])}else{var d;(d=l.o)==null||d.forEach(p=>{const m=`:hasOwn(${String(p)})`;r.push(a?[...a,m]:[m])})}(h=l.k)==null||h.forEach(p=>{n&&!("value"in(Object.getOwnPropertyDescriptor(o,p)||{}))||s(o[p],a?[...a,p]:[p])})}else a&&r.push(a)};return s(t),r};var $v={ZSS_LANG_DEV:"false",ZSS_STATS_DEV:"false",ZSS_SHOW_CODE:"false",ZSS_BRANCH_NAME:"main",ZSS_BRANCH_VERSION:"0.0.4",ZSS_COMMIT_HASH:"60928f32c5a040095ea1f619ee2c92712e1adecb",ZSS_COMMIT_MESSAGE:"ci: version bump to v0.0.4",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const _S=t=>typeof t=="object"&&t!==null,Wa=new WeakMap,S0=new WeakSet,Uj=(t=Object.is,e=(c,h)=>new Proxy(c,h),n=c=>_S(c)&&!S0.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),r=c=>{switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:throw c}},i=new WeakMap,s=(c,h,d=r)=>{const p=i.get(c);if((p==null?void 0:p[0])===h)return p[1];const m=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return DP(m,!0),i.set(c,[h,m]),Reflect.ownKeys(c).forEach(y=>{if(Object.getOwnPropertyDescriptor(m,y))return;const S=Reflect.get(c,y),{enumerable:E}=Reflect.getOwnPropertyDescriptor(c,y),g={value:S,enumerable:E,configurable:!0};if(S0.has(S))DP(S,!1);else if(S instanceof Promise)delete g.value,g.get=()=>d(S);else if(Wa.has(S)){const[x,_]=Wa.get(S);g.value=s(x,_(),d)}Object.defineProperty(m,y,g)}),Object.preventExtensions(m)},o=new WeakMap,a=[1,1],l=c=>{if(!_S(c))throw new Error("object required");const h=o.get(c);if(h)return h;let d=a[0];const p=new Set,m=(R,P=++a[0])=>{d!==P&&(d=P,p.forEach(O=>O(R,P)))};let y=a[1];const S=(R=++a[1])=>(y!==R&&!p.size&&(y=R,g.forEach(([P])=>{const O=P[1](R);O>d&&(d=O)})),d),E=R=>(P,O)=>{const X=[...P];X[1]=[R,...X[1]],m(X,O)},g=new Map,x=(R,P)=>{if(($v?"production":void 0)!=="production"&&g.has(R))throw new Error("prop listener already exists");if(p.size){const O=P[3](E(R));g.set(R,[P,O])}else g.set(R,[P])},_=R=>{var P;const O=g.get(R);O&&(g.delete(R),(P=O[1])==null||P.call(O))},M=R=>(p.add(R),p.size===1&&g.forEach(([O,X],j)=>{if(($v?"production":void 0)!=="production"&&X)throw new Error("remove already exists");const H=O[3](E(j));g.set(j,[O,H])}),()=>{p.delete(R),p.size===0&&g.forEach(([O,X],j)=>{X&&(X(),g.set(j,[O]))})}),C=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),I=e(C,{deleteProperty(R,P){const O=Reflect.get(R,P);_(P);const X=Reflect.deleteProperty(R,P);return X&&m(["delete",[P],O]),X},set(R,P,O,X){const j=Reflect.has(R,P),H=Reflect.get(R,P,X);if(j&&(t(H,O)||o.has(O)&&t(H,o.get(O))))return!0;_(P),_S(O)&&(O=kj(O)||O);let J=O;if(O instanceof Promise)O.then(ee=>{O.status="fulfilled",O.value=ee,m(["resolve",[P],ee])}).catch(ee=>{O.status="rejected",O.reason=ee,m(["reject",[P],ee])});else{!Wa.has(O)&&n(O)&&(J=l(O));const ee=!S0.has(J)&&Wa.get(J);ee&&x(P,ee)}return Reflect.set(R,P,J,X),m(["set",[P],O,H]),!0}});o.set(c,I);const N=[C,S,s,M];return Wa.set(I,N),Reflect.ownKeys(c).forEach(R=>{const P=Object.getOwnPropertyDescriptor(c,R);"value"in P&&(I[R]=c[R],delete P.value,delete P.writable),Object.defineProperty(C,R,P)}),I})=>[l,Wa,S0,t,e,n,r,i,s,o,a],[Fj]=Uj();function qT(t={}){return Fj(t)}function Bj(t,e,n){const r=Wa.get(t);($v?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");let i;const s=[],o=r[3];let a=!1;const c=o(h=>{if(s.push(h),n){e(s.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,c()}}function UP(t,e){const n=Wa.get(t);($v?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");const[r,i,s]=n;return s(r,i(),e)}var zj={ZSS_LANG_DEV:"false",ZSS_STATS_DEV:"false",ZSS_SHOW_CODE:"false",ZSS_BRANCH_NAME:"main",ZSS_BRANCH_VERSION:"0.0.4",ZSS_COMMIT_HASH:"60928f32c5a040095ea1f619ee2c92712e1adecb",ZSS_COMMIT_MESSAGE:"ci: version bump to v0.0.4",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{use:FP}=Bd,{useSyncExternalStore:Hj}=aj,Vj=(t,e)=>{const n=K.useRef();K.useEffect(()=>{n.current=Dj(t,e,!0)}),K.useDebugValue(n.current)},Gj=new WeakMap;function h_(t,e){const n=e==null?void 0:e.sync,r=K.useRef(),i=K.useRef();let s=!0;const o=Hj(K.useCallback(c=>{const h=Bj(t,c,n);return c(),h},[t,n]),()=>{const c=UP(t,FP);try{if(!s&&r.current&&i.current&&!z3(r.current,c,i.current,new WeakMap))return r.current}catch{}return c},()=>UP(t,FP));s=!1;const a=new WeakMap;K.useEffect(()=>{r.current=o,i.current=a}),(zj?"production":void 0)!=="production"&&Vj(o,a);const l=K.useMemo(()=>new WeakMap,[]);return B3(o,a,l,Gj)}let xS=!1;const Ts=qT({state:{player:"",layers:[],layout:[],layoutreset:!1,layoutfocus:""}}),SS=WT("gadgetclient",["ready","second"],t=>{switch(t.target){case"ready":t.player&&Ts.state.player===""&&(Ts.state.player=t.player,SS.emit("vm:login",void 0,Ts.state.player));break;case"second":Ts.state.player&&SS.emit("vm:doot",void 0,Ts.state.player);break;case"reset":t.player===Ts.state.player&&(xS=!1,Ts.state=t.data);break;case"patch":if(t.player===Ts.state.player&&!xS)try{f_(Ts.state,t.data,!0)}catch(e){e instanceof XT&&(xS=!0,SS.reply(t,"desync",void 0,Ts.state.player))}break}});function Wj(){return Ts.state}const BP=1,zP=2,ES=4,wS=8,Ap=32,oa=64,Oi=128,d_=31,Dw=63,Tc=127,Xj=2147483647,vl=Math.floor,ev=Math.abs,H3=(t,e)=>tt>e?t:e,V3=t=>t!==0?t<0:1/t<0,G3=Number.MAX_SAFE_INTEGER,jj=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&vl(t)===t),Hf=()=>new Set,MS=t=>t[t.length-1],$j=(t,e)=>{for(let n=0;nt.toLowerCase(),qj=/^\s*/g,Zj=t=>t.replace(qj,""),Jj=/([A-Z])/g,HP=(t,e)=>Zj(t.replace(Jj,n=>`${e}${Kj(n)}`)),Qj=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let i=0;iCp.encode(t),t$=Cp?e$:Qj;let kd=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});kd&&kd.decode(new Uint8Array).length===1&&(kd=null);const _l=t=>new Error(t),So=()=>{throw _l("Method unimplemented")},To=()=>{throw _l("Unexpected case")};class em{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const cl=()=>new em,n$=t=>{let e=t.cpos;for(let n=0;n{const e=new Uint8Array(n$(t));let n=0;for(let r=0;r{const n=t.cbuf.length;n-t.cpos{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},Uw=cr,Rt=(t,e)=>{for(;e>Tc;)cr(t,Oi|Tc&e),e=vl(e/128);cr(t,Tc&e)},ZT=(t,e)=>{const n=V3(e);for(n&&(e=-e),cr(t,(e>Dw?Oi:0)|(n?oa:0)|Dw&e),e=vl(e/64);e>0;)cr(t,(e>Tc?Oi:0)|Tc&e),e=vl(e/128)},Fw=new Uint8Array(3e4),i$=Fw.length/3,s$=(t,e)=>{if(e.length{const n=unescape(encodeURIComponent(e)),r=n.length;Rt(t,r);for(let i=0;i{const n=t.cbuf.length,r=t.cpos,i=H3(n-r,e.length),s=e.length-i;t.cbuf.set(e.subarray(0,i),r),t.cpos+=i,s>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(Yc(n*2,s)),t.cbuf.set(e.subarray(i)),t.cpos=s)},Nr=(t,e)=>{Rt(t,e.byteLength),p_(t,e)},JT=(t,e)=>{r$(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},a$=(t,e)=>JT(t,4).setFloat32(0,e,!1),l$=(t,e)=>JT(t,8).setFloat64(0,e,!1),c$=(t,e)=>JT(t,8).setBigInt64(0,e,!1),VP=new DataView(new ArrayBuffer(4)),u$=t=>(VP.setFloat32(0,t),VP.getFloat32(0)===t),Rp=(t,e)=>{switch(typeof e){case"string":cr(t,119),_f(t,e);break;case"number":jj(e)&&ev(e)<=Xj?(cr(t,125),ZT(t,e)):u$(e)?(cr(t,124),a$(t,e)):(cr(t,123),l$(t,e));break;case"bigint":cr(t,122),c$(t,e);break;case"object":if(e===null)cr(t,126);else if(Yj(e)){cr(t,117),Rt(t,e.length);for(let n=0;n0&&Rt(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const WP=t=>{t.count>0&&(ZT(t.encoder,t.count===1?t.s:-t.s),t.count>1&&Rt(t.encoder,t.count-2))};class tv{constructor(){this.encoder=new em,this.s=0,this.count=0}write(e){this.s===e?this.count++:(WP(this),this.count=1,this.s=e)}toUint8Array(){return WP(this),Os(this.encoder)}}const XP=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);ZT(t.encoder,e),t.count>1&&Rt(t.encoder,t.count-2)}};class TS{constructor(){this.encoder=new em,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(XP(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return XP(this),Os(this.encoder)}}class f${constructor(){this.sarr=[],this.s="",this.lensE=new tv}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new em;return this.sarr.push(this.s),this.s="",_f(e,this.sarr.join("")),p_(e,this.lensE.toUint8Array()),Os(e)}}const W3=_l("Unexpected end of array"),X3=_l("Integer out of Range");class m_{constructor(e){this.arr=e,this.pos=0}}const Kc=t=>new m_(t),h$=t=>t.pos!==t.arr.length,d$=(t,e)=>{const n=new Uint8Array(t.arr.buffer,t.pos+t.arr.byteOffset,e);return t.pos+=e,n},Wr=t=>d$(t,bt(t)),Vf=t=>t.arr[t.pos++],bt=t=>{let e=0,n=1;const r=t.arr.length;for(;t.posG3)throw X3}throw W3},QT=t=>{let e=t.arr[t.pos++],n=e&Dw,r=64;const i=(e&oa)>0?-1:1;if(!(e&Oi))return i*n;const s=t.arr.length;for(;t.posG3)throw X3}throw W3},p$=t=>{let e=bt(t);if(e===0)return"";{let n=String.fromCodePoint(Vf(t));if(--e<100)for(;e--;)n+=String.fromCodePoint(Vf(t));else for(;e>0;){const r=e<1e4?e:1e4,i=t.arr.subarray(t.pos,t.pos+r);t.pos+=r,n+=String.fromCodePoint.apply(null,i),e-=r}return decodeURIComponent(escape(n))}},m$=t=>kd.decode(Wr(t)),xf=kd?m$:p$,eA=(t,e)=>{const n=new DataView(t.arr.buffer,t.arr.byteOffset+t.pos,e);return t.pos+=e,n},g$=t=>eA(t,4).getFloat32(0,!1),v$=t=>eA(t,8).getFloat64(0,!1),y$=t=>eA(t,8).getBigInt64(0,!1),_$=[t=>{},t=>null,QT,g$,v$,y$,t=>!1,t=>!0,xf,t=>{const e=bt(t),n={};for(let r=0;r{const e=bt(t),n=[];for(let r=0;r_$[127-Vf(t)](t);class jP extends m_{constructor(e,n){super(e),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),h$(this)?this.count=bt(this)+1:this.count=-1),this.count--,this.s}}class nv extends m_{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=QT(this);const e=V3(this.s);this.count=1,e&&(this.s=-this.s,this.count=bt(this)+2)}return this.count--,this.s}}class AS extends m_{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const e=QT(this),n=e&1;this.diff=vl(e/2),this.count=1,n&&(this.count=bt(this)+2)}return this.s+=this.diff,this.count--,this.s}}class x${constructor(e){this.decoder=new nv(e),this.str=xf(this.decoder),this.spos=0}read(){const e=this.spos+this.decoder.read(),n=this.str.slice(this.spos,e);return this.spos=e,n}}const Bs=()=>new Map,Bw=t=>{const e=Bs();return t.forEach((n,r)=>{e.set(r,n)}),e},Ll=(t,e,n)=>{let r=t.get(e);return r===void 0&&t.set(e,r=n()),r},S$=(t,e)=>{const n=[];for(const[r,i]of t)n.push(e(i,r));return n},E$=(t,e)=>{for(const[n,r]of t)if(e(r,n))return!0;return!1};class w${constructor(){this._observers=Bs()}on(e,n){return Ll(this._observers,e,Hf).add(n),n}once(e,n){const r=(...i)=>{this.off(e,r),n(...i)};this.on(e,r)}off(e,n){const r=this._observers.get(e);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(e))}emit(e,n){return yl((this._observers.get(e)||Bs()).values()).forEach(r=>r(...n))}destroy(){this._observers=Bs()}}const M$=crypto.getRandomValues.bind(crypto),j3=()=>M$(new Uint32Array(1))[0],T$="10000000-1000-4000-8000"+-1e11,A$=()=>T$.replace(/[018]/g,t=>(t^j3()&15>>t/4).toString(16)),$P=t=>new Promise(t);Promise.all.bind(Promise);const YP=t=>t===void 0?null:t;class C${constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}}let $3=new C$,R$=!0;try{typeof localStorage<"u"&&localStorage&&($3=localStorage,R$=!1)}catch{}const b$=$3,P$=Object.assign,I$=Object.keys,L$=(t,e)=>{for(const n in t)e(t[n],n)},KP=t=>I$(t).length,N$=t=>{for(const e in t)return!1;return!0},O$=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},k$=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),D$=(t,e)=>t===e||KP(t)===KP(e)&&O$(t,(n,r)=>(n!==void 0||k$(e,r))&&e[r]===n),tA=(t,e,n=0)=>{try{for(;nt,F$=(t,e)=>e.includes(t);var Y3={};const Pp=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";let ao;const B$=()=>{if(ao===void 0)if(Pp){ao=Bs();const t=process.argv;let e=null;for(let n=0;n{if(t.length!==0){const[e,n]=t.split("=");ao.set(`--${HP(e,"-")}`,n),ao.set(`-${HP(e,"-")}`,n)}})):ao=Bs();return ao},zw=t=>B$().has(t),Hw=t=>YP(Pp?Y3[t.toUpperCase().replaceAll("-","_")]:b$.getItem(t)),z$=t=>zw("--"+t)||Hw(t)!==null;z$("production");const qP=Pp&&F$(Y3.FORCE_COLOR,["true","1","2"]),H$=!zw("no-colors")&&(!Pp||process.stdout.isTTY||qP)&&(!Pp||zw("color")||qP||Hw("COLORTERM")!==null||(Hw("TERM")||"").includes("color")),V$=t=>new Uint8Array(t),G$=t=>{const e=V$(t.byteLength);return e.set(t),e};class W${constructor(e,n){this.left=e,this.right=n}}const Zo=(t,e)=>new W$(t,e);typeof DOMParser<"u"&&new DOMParser;const X$=t=>S$(t,(e,n)=>`${n}:${e};`).join(""),ya=Symbol,K3=ya(),q3=ya(),j$=ya(),$$=ya(),Y$=ya(),Z3=ya(),K$=ya(),J3=ya(),q$=ya(),Z$=t=>{var r;t.length===1&&((r=t[0])==null?void 0:r.constructor)===Function&&(t=t[0]());const e=[];let n=0;for(;n{var o;t.length===1&&((o=t[0])==null?void 0:o.constructor)===Function&&(t=t[0]());const e=[],n=[],r=Bs();let i=[],s=0;for(;s0||c.length>0?(e.push("%c"+a),n.push(c)):e.push(a)}else break}}for(s>0&&(i=n,i.unshift(e.join("")));s{console.log(...eY(t)),nY.forEach(e=>e.print(t))},nY=Hf(),Q3=t=>({[Symbol.iterator](){return this},next:t}),rY=(t,e)=>Q3(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),CS=(t,e)=>Q3(()=>{const{done:n,value:r}=t.next();return{done:n,value:n?void 0:e(r)}});class nA{constructor(e,n){this.clock=e,this.len=n}}class tm{constructor(){this.clients=new Map}}const e4=(t,e,n)=>e.clients.forEach((r,i)=>{const s=t.doc.store.clients.get(i);for(let o=0;o{let n=0,r=t.length-1;for(;n<=r;){const i=vl((n+r)/2),s=t[i],o=s.clock;if(o<=e){if(e{const n=t.clients.get(e.client);return n!==void 0&&iY(n,e.clock)!==null},rA=t=>{t.clients.forEach(e=>{e.sort((i,s)=>i.clock-s.clock);let n,r;for(n=1,r=1;n=s.clock?i.len=Yc(i.len,s.clock+s.len-i.clock):(r{const e=new tm;for(let n=0;n{if(!e.clients.has(i)){const s=r.slice();for(let o=n+1;o{Ll(t.clients,e,()=>[]).push(new nA(n,r))},oY=()=>new tm,aY=t=>{const e=oY();return t.clients.forEach((n,r)=>{const i=[];for(let s=0;s0&&e.clients.set(r,i)}),e},uh=(t,e)=>{Rt(t.restEncoder,e.clients.size),yl(e.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{t.resetDsCurVal(),Rt(t.restEncoder,n);const i=r.length;Rt(t.restEncoder,i);for(let s=0;s{const e=new tm,n=bt(t.restDecoder);for(let r=0;r0){const o=Ll(e.clients,i,()=>[]);for(let a=0;a{const r=new tm,i=bt(t.restDecoder);for(let s=0;s0){const s=new kc;return Rt(s.restEncoder,0),uh(s,r),s.toUint8Array()}return null},n4=j3;class fh extends w${constructor({guid:e=A$(),collectionid:n=null,gc:r=!0,gcFilter:i=()=>!0,meta:s=null,autoLoad:o=!1,shouldLoad:a=!0}={}){super(),this.gc=r,this.gcFilter=i,this.clientID=n4(),this.guid=e,this.collectionid=n,this.share=new Map,this.store=new f4,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=a,this.autoLoad=o,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=$P(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});const l=()=>$P(c=>{const h=d=>{(d===void 0||d===!0)&&(this.off("sync",h),c())};this.on("sync",h)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const e=this._item;e!==null&&!this.shouldLoad&&nn(e.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(yl(this.subdocs).map(e=>e.guid))}transact(e,n=null){return nn(this,e,n)}get(e,n=Er){const r=Ll(this.share,e,()=>{const s=new n;return s._integrate(this,null),s}),i=r.constructor;if(n!==Er&&i!==n)if(i===Er){const s=new n;s._map=r._map,r._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=s}),s._start=r._start;for(let o=s._start;o!==null;o=o.right)o.parent=s;return s._length=r._length,this.share.set(e,s),s._integrate(this,null),s}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return r}getArray(e=""){return this.get(e,Ef)}getText(e=""){return this.get(e,Dc)}getMap(e=""){return this.get(e,Wf)}getXmlElement(e=""){return this.get(e,Xf)}getXmlFragment(e=""){return this.get(e,Uc)}toJSON(){const e={};return this.share.forEach((n,r)=>{e[r]=n.toJSON()}),e}destroy(){yl(this.subdocs).forEach(n=>n.destroy());const e=this._item;if(e!==null){this._item=null;const n=e.content;n.doc=new fh({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=e,nn(e.parent.doc,r=>{const i=n.doc;e.deleted||r.subdocsAdded.add(i),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class r4{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return bt(this.restDecoder)}readDsLen(){return bt(this.restDecoder)}}class i4 extends r4{readLeftID(){return Ot(bt(this.restDecoder),bt(this.restDecoder))}readRightID(){return Ot(bt(this.restDecoder),bt(this.restDecoder))}readClient(){return bt(this.restDecoder)}readInfo(){return Vf(this.restDecoder)}readString(){return xf(this.restDecoder)}readParentInfo(){return bt(this.restDecoder)===1}readTypeRef(){return bt(this.restDecoder)}readLen(){return bt(this.restDecoder)}readAny(){return bp(this.restDecoder)}readBuf(){return G$(Wr(this.restDecoder))}readJSON(){return JSON.parse(xf(this.restDecoder))}readKey(){return xf(this.restDecoder)}}class lY{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=bt(this.restDecoder),this.dsCurrVal}readDsLen(){const e=bt(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class Gf extends lY{constructor(e){super(e),this.keys=[],bt(e),this.keyClockDecoder=new AS(Wr(e)),this.clientDecoder=new nv(Wr(e)),this.leftClockDecoder=new AS(Wr(e)),this.rightClockDecoder=new AS(Wr(e)),this.infoDecoder=new jP(Wr(e),Vf),this.stringDecoder=new x$(Wr(e)),this.parentInfoDecoder=new jP(Wr(e),Vf),this.typeRefDecoder=new nv(Wr(e)),this.lenDecoder=new nv(Wr(e))}readLeftID(){return new Sf(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Sf(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return bp(this.restDecoder)}readBuf(){return Wr(this.restDecoder)}readJSON(){return bp(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e{r=Yc(r,e[0].id.clock);const i=Ao(e,r);Rt(t.restEncoder,e.length-i),t.writeClient(n),Rt(t.restEncoder,r);const s=e[i];s.write(t,r-s.id.clock);for(let o=i+1;o{const r=new Map;n.forEach((i,s)=>{hr(e,s)>i&&r.set(s,i)}),g_(e).forEach((i,s)=>{n.has(s)||r.set(s,0)}),Rt(t.restEncoder,r.size),yl(r.entries()).sort((i,s)=>s[0]-i[0]).forEach(([i,s])=>{cY(t,e.clients.get(i),i,s)})},uY=(t,e)=>{const n=Bs(),r=bt(t.restDecoder);for(let i=0;i{const r=[];let i=yl(n.keys()).sort((m,y)=>m-y);if(i.length===0)return null;const s=()=>{if(i.length===0)return null;let m=n.get(i[i.length-1]);for(;m.refs.length===m.i;)if(i.pop(),i.length>0)m=n.get(i[i.length-1]);else return null;return m};let o=s();if(o===null)return null;const a=new f4,l=new Map,c=(m,y)=>{const S=l.get(m);(S==null||S>y)&&l.set(m,y)};let h=o.refs[o.i++];const d=new Map,p=()=>{for(const m of r){const y=m.id.client,S=n.get(y);S?(S.i--,a.clients.set(y,S.refs.slice(S.i)),n.delete(y),S.i=0,S.refs=[]):a.clients.set(y,[m]),i=i.filter(E=>E!==y)}r.length=0};for(;;){if(h.constructor!==is){const y=Ll(d,h.id.client,()=>hr(e,h.id.client))-h.id.clock;if(y<0)r.push(h),c(h.id.client,h.id.clock-1),p();else{const S=h.getMissing(t,e);if(S!==null){r.push(h);const E=n.get(S)||{refs:[],i:0};if(E.refs.length===E.i)c(S,hr(e,S)),p();else{h=E.refs[E.i++];continue}}else(y===0||y0)h=r.pop();else if(o!==null&&o.i0){const m=new kc;return sA(m,a,new Map),Rt(m.restEncoder,0),{missing:l,update:m.toUint8Array()}}return null},hY=(t,e)=>sA(t,e.doc.store,e.beforeState),dY=(t,e,n,r=new Gf(t))=>nn(e,i=>{i.local=!1;let s=!1;const o=i.doc,a=o.store,l=uY(r,o),c=fY(i,a,l),h=a.pendingStructs;if(h){for(const[p,m]of h.missing)if(mm)&&h.missing.set(p,m)}h.update=Kv([h.update,c.update])}}else a.pendingStructs=c;const d=ZP(r,i,a);if(a.pendingDs){const p=new Gf(Kc(a.pendingDs));bt(p.restDecoder);const m=ZP(p,i,a);d&&m?a.pendingDs=Kv([d,m]):a.pendingDs=d||m}else a.pendingDs=d;if(s){const p=a.pendingStructs.update;a.pendingStructs=null,a4(i.doc,p)}},n,!1),a4=(t,e,n,r=Gf)=>{const i=Kc(e);dY(i,t,n,new r(i))},pY=(t,e,n)=>a4(t,e,n,i4),mY=(t,e,n=new Map)=>{sA(t,e.store,n),uh(t,aY(e.store))},gY=(t,e=new Uint8Array([0]),n=new kc)=>{const r=l4(e);mY(n,t,r);const i=[n.toUint8Array()];if(t.store.pendingDs&&i.push(t.store.pendingDs),t.store.pendingStructs&&i.push(LY(t.store.pendingStructs.update,e)),i.length>1){if(n.constructor===nm)return PY(i.map((s,o)=>o===0?s:OY(s)));if(n.constructor===kc)return Kv(i)}return i[0]},vY=(t,e)=>gY(t,e,new nm),yY=t=>{const e=new Map,n=bt(t.restDecoder);for(let r=0;ryY(new r4(Kc(t))),c4=(t,e)=>(Rt(t.restEncoder,e.size),yl(e.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{Rt(t.restEncoder,n),Rt(t.restEncoder,r)}),t),_Y=(t,e)=>c4(t,g_(e.store)),xY=(t,e=new o4)=>(t instanceof Map?c4(e,t):_Y(e,t),e.toUint8Array()),SY=t=>xY(t,new s4);class EY{constructor(){this.l=[]}}const JP=()=>new EY,QP=(t,e)=>t.l.push(e),eI=(t,e)=>{const n=t.l,r=n.length;t.l=n.filter(i=>e!==i),r===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},u4=(t,e,n)=>tA(t.l,[e,n]);class Sf{constructor(e,n){this.client=e,this.clock=n}}const E0=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,Ot=(t,e)=>new Sf(t,e),wY=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw To()},Vu=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!t4(e.ds,t.id),Vw=(t,e)=>{const n=Ll(t.meta,Vw,Hf),r=t.doc.store;n.has(e)||(e.sv.forEach((i,s)=>{i{}),n.add(e))};class f4{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const g_=t=>{const e=new Map;return t.clients.forEach((n,r)=>{const i=n[n.length-1];e.set(r,i.id.clock+i.length)}),e},hr=(t,e)=>{const n=t.clients.get(e);if(n===void 0)return 0;const r=n[n.length-1];return r.id.clock+r.length},h4=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{const r=n[n.length-1];if(r.id.clock+r.length!==e.id.clock)throw To()}n.push(e)},Ao=(t,e)=>{let n=0,r=t.length-1,i=t[r],s=i.id.clock;if(s===e)return r;let o=vl(e/(s+i.length-1)*r);for(;n<=r;){if(i=t[o],s=i.id.clock,s<=e){if(e{const n=t.clients.get(e.client);return n[Ao(n,e.clock)]},RS=MY,Gw=(t,e,n)=>{const r=Ao(e,n),i=e[r];return i.id.clock{const n=t.doc.store.clients.get(e.client);return n[Gw(t,n,e.clock)]},tI=(t,e,n)=>{const r=e.clients.get(n.client),i=Ao(r,n.clock),s=r[i];return n.clock!==s.id.clock+s.length-1&&s.constructor!==rs&&r.splice(i+1,0,ty(t,s,n.clock-s.id.clock+1)),s},TY=(t,e,n)=>{const r=t.clients.get(e.id.client);r[Ao(r,e.id.clock)]=n},d4=(t,e,n,r,i)=>{if(r===0)return;const s=n+r;let o=Gw(t,e,n),a;do a=e[o++],se.deleteSet.clients.size===0&&!E$(e.afterState,(n,r)=>e.beforeState.get(r)!==n)?!1:(rA(e.deleteSet),hY(t,e),uh(t,e.deleteSet),!0),rI=(t,e,n)=>{const r=e._item;(r===null||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)&&Ll(t.changed,e,Hf).add(n)},rv=(t,e)=>{let n=t[e],r=t[e-1],i=e;for(;i>0;n=r,r=t[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof qn&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}const s=e-i;return s&&t.splice(e+1-s,s),s},CY=(t,e,n)=>{for(const[r,i]of t.clients.entries()){const s=e.clients.get(r);for(let o=i.length-1;o>=0;o--){const a=i[o],l=a.clock+a.len;for(let c=Ao(s,a.clock),h=s[c];c{t.clients.forEach((n,r)=>{const i=e.clients.get(r);for(let s=n.length-1;s>=0;s--){const o=n[s],a=H3(i.length-1,1+Ao(i,o.clock+o.len-1));for(let l=a,c=i[l];l>0&&c.id.clock>=o.clock;c=i[l])l-=1+rv(i,l)}})},p4=(t,e)=>{if(ea.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(n,l)})),a.push(()=>{n.changedParentTypes.forEach((l,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(l=l.filter(h=>h.target._item===null||!h.target._item.deleted),l.forEach(h=>{h.currentTarget=c,h._path=null}),l.sort((h,d)=>h.path.length-d.path.length),u4(c._dEH,l,n))})}),a.push(()=>r.emit("afterTransaction",[n,r])),tA(a,[]),n._needFormattingCleanup&&YY(n)}finally{r.gc&&CY(s,i,r.gcFilter),RY(s,i),n.afterState.forEach((h,d)=>{const p=n.beforeState.get(d)||0;if(p!==h){const m=i.clients.get(d),y=Yc(Ao(m,p),1);for(let S=m.length-1;S>=y;)S-=1+rv(m,S)}});for(let h=o.length-1;h>=0;h--){const{client:d,clock:p}=o[h].id,m=i.clients.get(d),y=Ao(m,p);y+11||y>0&&rv(m,y)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(tY(J3,K3,"[yjs] ",q3,Z3,"Changed the client-id because another client seems to be using it."),r.clientID=n4()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const h=new nm;nI(h,n)&&r.emit("update",[h.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const h=new kc;nI(h,n)&&r.emit("updateV2",[h.toUint8Array(),n.origin,r,n])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=n;(a.size>0||c.size>0||l.size>0)&&(a.forEach(h=>{h.clientID=r.clientID,h.collectionid==null&&(h.collectionid=r.collectionid),r.subdocs.add(h)}),c.forEach(h=>r.subdocs.delete(h)),r.emit("subdocs",[{loaded:l,added:a,removed:c},r,n]),c.forEach(h=>h.destroy())),t.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t])):p4(t,e+1)}}},nn=(t,e,n=null,r=!0)=>{const i=t._transactionCleanups;let s=!1,o=null;t._transaction===null&&(s=!0,t._transaction=new AY(t,n,r),i.push(t._transaction),i.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{o=e(t._transaction)}finally{if(s){const a=t._transaction===i[0];t._transaction=null,a&&p4(i,0)}}return o};function*bY(t){const e=bt(t.restDecoder);for(let n=0;nKv(t,i4,nm),IY=(t,e)=>{if(t.constructor===rs){const{client:n,clock:r}=t.id;return new rs(Ot(n,r+e),t.length-e)}else if(t.constructor===is){const{client:n,clock:r}=t.id;return new is(Ot(n,r+e),t.length-e)}else{const n=t,{client:r,clock:i}=n.id;return new qn(Ot(r,i+e),null,Ot(r,i+e-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(e))}},Kv=(t,e=Gf,n=kc)=>{if(t.length===1)return t[0];const r=t.map(h=>new e(Kc(h)));let i=r.map(h=>new oA(h,!0)),s=null;const o=new n,a=new aA(o);for(;i=i.filter(p=>p.curr!==null),i.sort((p,m)=>{if(p.curr.id.client===m.curr.id.client){const y=p.curr.id.clock-m.curr.id.clock;return y===0?p.curr.constructor===m.curr.constructor?0:p.curr.constructor===is?1:-1:y}else return m.curr.id.client-p.curr.id.client}),i.length!==0;){const h=i[0],d=h.curr.id.client;if(s!==null){let p=h.curr,m=!1;for(;p!==null&&p.id.clock+p.length<=s.struct.id.clock+s.struct.length&&p.id.client>=s.struct.id.client;)p=h.next(),m=!0;if(p===null||p.id.client!==d||m&&p.id.clock>s.struct.id.clock+s.struct.length)continue;if(d!==s.struct.id.client)Ya(a,s.struct,s.offset),s={struct:p,offset:0},h.next();else if(s.struct.id.clock+s.struct.length0&&(s.struct.constructor===is?s.struct.length-=y:p=IY(p,y)),s.struct.mergeWith(p)||(Ya(a,s.struct,s.offset),s={struct:p,offset:0},h.next())}}else s={struct:h.curr,offset:0},h.next();for(let p=h.curr;p!==null&&p.id.client===d&&p.id.clock===s.struct.id.clock+s.struct.length&&p.constructor!==is;p=h.next())Ya(a,s.struct,s.offset),s={struct:p,offset:0}}s!==null&&(Ya(a,s.struct,s.offset),s=null),lA(a);const l=r.map(h=>iA(h)),c=sY(l);return uh(o,c),o.toUint8Array()},LY=(t,e,n=Gf,r=kc)=>{const i=l4(e),s=new r,o=new aA(s),a=new n(Kc(t)),l=new oA(a,!1);for(;l.curr;){const h=l.curr,d=h.id.client,p=i.get(d)||0;if(l.curr.constructor===is){l.next();continue}if(h.id.clock+h.length>p)for(Ya(o,h,Yc(p-h.id.clock,0)),l.next();l.curr&&l.curr.id.client===d;)Ya(o,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===d&&l.curr.id.clock+l.curr.length<=p;)l.next()}lA(o);const c=iA(a);return uh(s,c),s.toUint8Array()},m4=t=>{t.written>0&&(t.clientStructs.push({written:t.written,restEncoder:Os(t.encoder.restEncoder)}),t.encoder.restEncoder=cl(),t.written=0)},Ya=(t,e,n)=>{t.written>0&&t.currClient!==e.id.client&&m4(t),t.written===0&&(t.currClient=e.id.client,t.encoder.writeClient(e.id.client),Rt(t.encoder.restEncoder,e.id.clock+n)),e.write(t.encoder,n),t.written++},lA=t=>{m4(t);const e=t.encoder.restEncoder;Rt(e,t.clientStructs.length);for(let n=0;n{const i=new n(Kc(t)),s=new oA(i,!1),o=new r,a=new aA(o);for(let c=s.curr;c!==null;c=s.next())Ya(a,e(c),0);lA(a);const l=iA(i);return uh(o,l),o.toUint8Array()},OY=t=>NY(t,U$,Gf,nm),iI="You must not compute changes after the event-handler fired.";class v_{constructor(e,n){this.target=e,this.currentTarget=e,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=kY(this.currentTarget,this.target))}deletes(e){return t4(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw _l(iI);const e=new Map,n=this.target;this.transaction.changed.get(n).forEach(i=>{if(i!==null){const s=n._map.get(i);let o,a;if(this.adds(s)){let l=s.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(s))if(l!==null&&this.deletes(l))o="delete",a=MS(l.content.getContent());else return;else l!==null&&this.deletes(l)?(o="update",a=MS(l.content.getContent())):(o="add",a=void 0)}else if(this.deletes(s))o="delete",a=MS(s.content.getContent());else return;e.set(i,{action:o,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw _l(iI);const n=this.target,r=Hf(),i=Hf(),s=[];if(e={added:r,deleted:i,delta:s,keys:this.keys},this.transaction.changed.get(n).has(null)){let a=null;const l=()=>{a&&s.push(a)};for(let c=n._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((a===null||a.delete===void 0)&&(l(),a={delete:0}),a.delete+=c.length,i.add(c)):this.adds(c)?((a===null||a.insert===void 0)&&(l(),a={insert:[]}),a.insert=a.insert.concat(c.content.getContent()),r.add(c)):((a===null||a.retain===void 0)&&(l(),a={retain:0}),a.retain+=c.length);a!==null&&a.retain===void 0&&l()}this._changes=e}return e}}const kY=(t,e)=>{const n=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let r=0,i=e._item.parent._start;for(;i!==e._item&&i!==null;)i.deleted||r++,i=i.right;n.unshift(r)}e=e._item.parent}return n},g4=80;let cA=0;class DY{constructor(e,n){e.marker=!0,this.p=e,this.index=n,this.timestamp=cA++}}const UY=t=>{t.timestamp=cA++},v4=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=cA++},FY=(t,e,n)=>{if(t.length>=g4){const r=t.reduce((i,s)=>i.timestamp{if(t._start===null||e===0||t._searchMarker===null)return null;const n=t._searchMarker.length===0?null:t._searchMarker.reduce((s,o)=>ev(e-s.index)e;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&ev(n.index-i){for(let r=t.length-1;r>=0;r--){const i=t[r];if(n>0){let s=i.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(i.index-=s.length);if(s===null||s.marker===!0){t.splice(r,1);continue}i.p=s,s.marker=!0}(e0&&e===i.index)&&(i.index=Yc(e,i.index+n))}},__=(t,e,n)=>{const r=t,i=e.changedParentTypes;for(;Ll(i,t,()=>[]).push(n),t._item!==null;)t=t._item.parent;u4(r._eH,n,e)};class Er{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=JP(),this._dEH=JP(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,n){this.doc=e,this._item=n}_copy(){throw So()}clone(){throw So()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,n){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){QP(this._eH,e)}observeDeep(e){QP(this._dEH,e)}unobserve(e){eI(this._eH,e)}unobserveDeep(e){eI(this._dEH,e)}toJSON(){}}const y4=(t,e,n)=>{e<0&&(e=t._length+e),n<0&&(n=t._length+n);let r=n-e;const i=[];let s=t._start;for(;s!==null&&r>0;){if(s.countable&&!s.deleted){const o=s.content.getContent();if(o.length<=e)e-=o.length;else{for(let a=e;a0;a++)i.push(o[a]),r--;e=0}}s=s.right}return i},_4=t=>{const e=[];let n=t._start;for(;n!==null;){if(n.countable&&!n.deleted){const r=n.content.getContent();for(let i=0;i{let n=0,r=t._start;for(;r!==null;){if(r.countable&&!r.deleted){const i=r.content.getContent();for(let s=0;s{const n=[];return Lp(t,(r,i)=>{n.push(e(r,i,t))}),n},BY=t=>{let e=t._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};n=e.content.getContent(),r=0,e=e.right}const i=n[r++];return n.length<=r&&(n=null),{done:!1,value:i}}}},S4=(t,e)=>{const n=y_(t,e);let r=t._start;for(n!==null&&(r=n.p,e-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(e{let i=n;const s=t.doc,o=s.clientID,a=s.store,l=n===null?e._start:n.right;let c=[];const h=()=>{c.length>0&&(i=new qn(Ot(o,hr(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new Fc(c)),i.integrate(t,0),c=[])};r.forEach(d=>{if(d===null)c.push(d);else switch(d.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(d);break;default:switch(h(),d.constructor){case Uint8Array:case ArrayBuffer:i=new qn(Ot(o,hr(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new rm(new Uint8Array(d))),i.integrate(t,0);break;case fh:i=new qn(Ot(o,hr(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new im(d)),i.integrate(t,0);break;default:if(d instanceof Er)i=new qn(Ot(o,hr(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new _a(d)),i.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),h()},E4=()=>_l("Length exceeded!"),w4=(t,e,n,r)=>{if(n>e._length)throw E4();if(n===0)return e._searchMarker&&Ip(e._searchMarker,n,r.length),qv(t,e,null,r);const i=n,s=y_(e,n);let o=e._start;for(s!==null&&(o=s.p,n-=s.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n{let i=(e._searchMarker||[]).reduce((s,o)=>o.index>s.index?o:s,{index:0,p:e._start}).p;if(i)for(;i.right;)i=i.right;return qv(t,e,i,n)},M4=(t,e,n,r)=>{if(r===0)return;const i=n,s=r,o=y_(e,n);let a=e._start;for(o!==null&&(a=o.p,n-=o.index);a!==null&&n>0;a=a.right)!a.deleted&&a.countable&&(n0&&a!==null;)a.deleted||(r0)throw E4();e._searchMarker&&Ip(e._searchMarker,i,-s+r)},Zv=(t,e,n)=>{const r=e._map.get(n);r!==void 0&&r.delete(t)},uA=(t,e,n,r)=>{const i=e._map.get(n)||null,s=t.doc,o=s.clientID;let a;if(r==null)a=new Fc([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:a=new Fc([r]);break;case Uint8Array:a=new rm(r);break;case fh:a=new im(r);break;default:if(r instanceof Er)a=new _a(r);else throw new Error("Unexpected content type")}new qn(Ot(o,hr(s.store,o)),i,i&&i.lastId,null,null,e,n,a).integrate(t,0)},fA=(t,e)=>{const n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},T4=t=>{const e={};return t._map.forEach((n,r)=>{n.deleted||(e[r]=n.content.getContent()[n.length-1])}),e},A4=(t,e)=>{const n=t._map.get(e);return n!==void 0&&!n.deleted},HY=(t,e)=>{const n={};return t._map.forEach((r,i)=>{let s=r;for(;s!==null&&(!e.sv.has(s.id.client)||s.id.clock>=(e.sv.get(s.id.client)||0));)s=s.left;s!==null&&Vu(s,e)&&(n[i]=s.content.getContent()[s.length-1])}),n},w0=t=>rY(t.entries(),e=>!e[1].deleted);class VY extends v_{constructor(e,n){super(e,n),this._transaction=n}}class Ef extends Er{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const n=new Ef;return n.push(e),n}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Ef}clone(){const e=new Ef;return e.insert(0,this.toArray().map(n=>n instanceof Er?n.clone():n)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}_callObserver(e,n){super._callObserver(e,n),__(this,e,new VY(this,e))}insert(e,n){this.doc!==null?nn(this.doc,r=>{w4(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}push(e){this.doc!==null?nn(this.doc,n=>{zY(n,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,n=1){this.doc!==null?nn(this.doc,r=>{M4(r,this,e,n)}):this._prelimContent.splice(e,n)}get(e){return S4(this,e)}toArray(){return _4(this)}slice(e=0,n=this.length){return y4(this,e,n)}toJSON(){return this.map(e=>e instanceof Er?e.toJSON():e)}map(e){return x4(this,e)}forEach(e){Lp(this,e)}[Symbol.iterator](){return BY(this)}_write(e){e.writeTypeRef(hK)}}const GY=t=>new Ef;class WY extends v_{constructor(e,n,r){super(e,n),this.keysChanged=r}}class Wf extends Er{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,n){super._integrate(e,n),this._prelimContent.forEach((r,i)=>{this.set(i,r)}),this._prelimContent=null}_copy(){return new Wf}clone(){const e=new Wf;return this.forEach((n,r)=>{e.set(r,n instanceof Er?n.clone():n)}),e}_callObserver(e,n){__(this,e,new WY(this,e,n))}toJSON(){const e={};return this._map.forEach((n,r)=>{if(!n.deleted){const i=n.content.getContent()[n.length-1];e[r]=i instanceof Er?i.toJSON():i}}),e}get size(){return[...w0(this._map)].length}keys(){return CS(w0(this._map),e=>e[0])}values(){return CS(w0(this._map),e=>e[1].content.getContent()[e[1].length-1])}entries(){return CS(w0(this._map),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this._map.forEach((n,r)=>{n.deleted||e(n.content.getContent()[n.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?nn(this.doc,n=>{Zv(n,this,e)}):this._prelimContent.delete(e)}set(e,n){return this.doc!==null?nn(this.doc,r=>{uA(r,this,e,n)}):this._prelimContent.set(e,n),n}get(e){return fA(this,e)}has(e){return A4(this,e)}clear(){this.doc!==null?nn(this.doc,e=>{this.forEach(function(n,r,i){Zv(e,i,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(dK)}}const XY=t=>new Wf,Za=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&D$(t,e);class Ww{constructor(e,n,r,i){this.left=e,this.right=n,this.index=r,this.currentAttributes=i}forward(){switch(this.right===null&&To(),this.right.content.constructor){case Qn:this.right.deleted||hh(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const sI=(t,e,n)=>{for(;e.right!==null&&n>0;){switch(e.right.content.constructor){case Qn:e.right.deleted||hh(e.currentAttributes,e.right.content);break;default:e.right.deleted||(n{const i=new Map,s=r?y_(e,n):null;if(s){const o=new Ww(s.p.left,s.p,s.index,i);return sI(t,o,n-s.index)}else{const o=new Ww(null,e._start,0,i);return sI(t,o,n)}},C4=(t,e,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===Qn&&Za(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const i=t.doc,s=i.clientID;r.forEach((o,a)=>{const l=n.left,c=n.right,h=new qn(Ot(s,hr(i.store,s)),l,l&&l.lastId,c,c&&c.id,e,null,new Qn(a,o));h.integrate(t,0),n.right=h,n.forward()})},hh=(t,e)=>{const{key:n,value:r}=e;r===null?t.delete(n):t.set(n,r)},R4=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===Qn&&Za(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},b4=(t,e,n,r)=>{const i=t.doc,s=i.clientID,o=new Map;for(const a in r){const l=r[a],c=n.currentAttributes.get(a)??null;if(!Za(c,l)){o.set(a,c);const{left:h,right:d}=n;n.right=new qn(Ot(s,hr(i.store,s)),h,h&&h.lastId,d,d&&d.id,e,null,new Qn(a,l)),n.right.integrate(t,0),n.forward()}}return o},bS=(t,e,n,r,i)=>{n.currentAttributes.forEach((p,m)=>{i[m]===void 0&&(i[m]=null)});const s=t.doc,o=s.clientID;R4(n,i);const a=b4(t,e,n,i),l=r.constructor===String?new Co(r):r instanceof Er?new _a(r):new qc(r);let{left:c,right:h,index:d}=n;e._searchMarker&&Ip(e._searchMarker,n.index,l.getLength()),h=new qn(Ot(o,hr(s.store,o)),c,c&&c.lastId,h,h&&h.id,e,null,l),h.integrate(t,0),n.right=h,n.index=d,n.forward(),C4(t,e,n,a)},oI=(t,e,n,r,i)=>{const s=t.doc,o=s.clientID;R4(n,i);const a=b4(t,e,n,i);e:for(;n.right!==null&&(r>0||a.size>0&&(n.right.deleted||n.right.content.constructor===Qn));){if(!n.right.deleted)switch(n.right.content.constructor){case Qn:{const{key:l,value:c}=n.right.content,h=i[l];if(h!==void 0){if(Za(h,c))a.delete(l);else{if(r===0)break e;a.set(l,c)}n.right.delete(t)}else n.currentAttributes.set(l,c);break}default:r0){let l="";for(;r>0;r--)l+=` `;n.right=new qn(Ot(o,hr(s.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new Co(l)),n.right.integrate(t,0),n.forward()}C4(t,e,n,a)},P4=(t,e,n,r,i)=>{let s=e;const o=Bs();for(;s&&(!s.countable||s.deleted);){if(!s.deleted&&s.content.constructor===Qn){const c=s.content;o.set(c.key,c)}s=s.right}let a=0,l=!1;for(;e!==s;){if(n===e&&(l=!0),!e.deleted){const c=e.content;switch(c.constructor){case Qn:{const{key:h,value:d}=c,p=r.get(h)??null;(o.get(h)!==c||p===d)&&(e.delete(t),a++,!l&&(i.get(h)??null)===d&&p!==d&&(p===null?i.delete(h):i.set(h,p))),!l&&!e.deleted&&hh(i,c);break}}}e=e.right}return a},jY=(t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const n=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===Qn){const r=e.content.key;n.has(r)?e.delete(t):n.add(r)}e=e.left}},$Y=t=>{let e=0;return nn(t.doc,n=>{let r=t._start,i=t._start,s=Bs();const o=Bw(s);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case Qn:hh(o,i.content);break;default:e+=P4(n,r,i,s,o),s=Bw(o),r=i;break}i=i.right}}),e},YY=t=>{const e=new Set,n=t.doc;for(const[r,i]of t.afterState.entries()){const s=t.beforeState.get(r)||0;i!==s&&d4(t,n.store.clients.get(r),s,i,o=>{!o.deleted&&o.content.constructor===Qn&&o.constructor!==rs&&e.add(o.parent)})}nn(n,r=>{e4(t,t.deleteSet,i=>{if(i instanceof rs||!i.parent._hasFormatting||e.has(i.parent))return;const s=i.parent;i.content.constructor===Qn?e.add(s):jY(r,i)});for(const i of e)$Y(i)})},aI=(t,e,n)=>{const r=n,i=Bw(e.currentAttributes),s=e.right;for(;n>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case _a:case qc:case Co:n{i===null?this.childListChanged=!0:this.keysChanged.add(i)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,n=[];nn(e,r=>{const i=new Map,s=new Map;let o=this.target._start,a=null;const l={};let c="",h=0,d=0;const p=()=>{if(a!==null){let m=null;switch(a){case"delete":d>0&&(m={delete:d}),d=0;break;case"insert":(typeof c=="object"||c.length>0)&&(m={insert:c},i.size>0&&(m.attributes={},i.forEach((y,S)=>{y!==null&&(m.attributes[S]=y)}))),c="";break;case"retain":h>0&&(m={retain:h},N$(l)||(m.attributes=P$({},l))),h=0;break}m&&n.push(m),a=null}};for(;o!==null;){switch(o.content.constructor){case _a:case qc:this.adds(o)?this.deletes(o)||(p(),a="insert",c=o.content.getContent()[0],p()):this.deletes(o)?(a!=="delete"&&(p(),a="delete"),d+=1):o.deleted||(a!=="retain"&&(p(),a="retain"),h+=1);break;case Co:this.adds(o)?this.deletes(o)||(a!=="insert"&&(p(),a="insert"),c+=o.content.str):this.deletes(o)?(a!=="delete"&&(p(),a="delete"),d+=o.length):o.deleted||(a!=="retain"&&(p(),a="retain"),h+=o.length);break;case Qn:{const{key:m,value:y}=o.content;if(this.adds(o)){if(!this.deletes(o)){const S=i.get(m)??null;Za(S,y)?y!==null&&o.delete(r):(a==="retain"&&p(),Za(y,s.get(m)??null)?delete l[m]:l[m]=y)}}else if(this.deletes(o)){s.set(m,y);const S=i.get(m)??null;Za(S,y)||(a==="retain"&&p(),l[m]=S)}else if(!o.deleted){s.set(m,y);const S=l[m];S!==void 0&&(Za(S,y)?S!==null&&o.delete(r):(a==="retain"&&p(),y===null?delete l[m]:l[m]=y))}o.deleted||(a==="insert"&&p(),hh(i,o.content));break}}o=o.right}for(p();n.length>0;){const m=n[n.length-1];if(m.retain!==void 0&&m.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class Dc extends Er{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this._length}_integrate(e,n){super._integrate(e,n);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new Dc}clone(){const e=new Dc;return e.applyDelta(this.toDelta()),e}_callObserver(e,n){super._callObserver(e,n);const r=new KY(this,e,n);__(this,e,r),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){let e="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===Co&&(e+=n.content.str),n=n.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:n=!0}={}){this.doc!==null?nn(this.doc,r=>{const i=new Ww(null,this._start,0,new Map);for(let s=0;s0)&&bS(r,this,i,a,o.attributes||{})}else o.retain!==void 0?oI(r,this,i,o.retain,o.attributes||{}):o.delete!==void 0&&aI(r,i,o.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,n,r){const i=[],s=new Map,o=this.doc;let a="",l=this._start;function c(){if(a.length>0){const d={};let p=!1;s.forEach((y,S)=>{p=!0,d[S]=y});const m={insert:a};p&&(m.attributes=d),i.push(m),a=""}}const h=()=>{for(;l!==null;){if(Vu(l,e)||n!==void 0&&Vu(l,n))switch(l.content.constructor){case Co:{const d=s.get("ychange");e!==void 0&&!Vu(l,e)?(d===void 0||d.user!==l.id.client||d.type!=="removed")&&(c(),s.set("ychange",r?r("removed",l.id):{type:"removed"})):n!==void 0&&!Vu(l,n)?(d===void 0||d.user!==l.id.client||d.type!=="added")&&(c(),s.set("ychange",r?r("added",l.id):{type:"added"})):d!==void 0&&(c(),s.delete("ychange")),a+=l.content.str;break}case _a:case qc:{c();const d={insert:l.content.getContent()[0]};if(s.size>0){const p={};d.attributes=p,s.forEach((m,y)=>{p[y]=m})}i.push(d);break}case Qn:Vu(l,e)&&(c(),hh(s,l.content));break}l=l.right}c()};return e||n?nn(o,d=>{e&&Vw(d,e),n&&Vw(d,n),h()},"cleanup"):h(),i}insert(e,n,r){if(n.length<=0)return;const i=this.doc;i!==null?nn(i,s=>{const o=M0(s,this,e,!r);r||(r={},o.currentAttributes.forEach((a,l)=>{r[l]=a})),bS(s,this,o,n,r)}):this._pending.push(()=>this.insert(e,n,r))}insertEmbed(e,n,r){const i=this.doc;i!==null?nn(i,s=>{const o=M0(s,this,e,!r);bS(s,this,o,n,r||{})}):this._pending.push(()=>this.insertEmbed(e,n,r||{}))}delete(e,n){if(n===0)return;const r=this.doc;r!==null?nn(r,i=>{aI(i,M0(i,this,e,!0),n)}):this._pending.push(()=>this.delete(e,n))}format(e,n,r){if(n===0)return;const i=this.doc;i!==null?nn(i,s=>{const o=M0(s,this,e,!1);o.right!==null&&oI(s,this,o,n,r)}):this._pending.push(()=>this.format(e,n,r))}removeAttribute(e){this.doc!==null?nn(this.doc,n=>{Zv(n,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,n){this.doc!==null?nn(this.doc,r=>{uA(r,this,e,n)}):this._pending.push(()=>this.setAttribute(e,n))}getAttribute(e){return fA(this,e)}getAttributes(){return T4(this)}_write(e){e.writeTypeRef(pK)}}const qY=t=>new Dc;class PS{constructor(e,n=()=>!0){this._filter=n,this._root=e,this._currentNode=e._start,this._firstCall=!0}[Symbol.iterator](){return this}next(){let e=this._currentNode,n=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(n)))do if(n=e.content.type,!e.deleted&&(n.constructor===Xf||n.constructor===Uc)&&n._start!==null)e=n._start;else for(;e!==null;)if(e.right!==null){e=e.right;break}else e.parent===this._root?e=null:e=e.parent._item;while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class Uc extends Er{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Uc}clone(){const e=new Uc;return e.insert(0,this.toArray().map(n=>n instanceof Er?n.clone():n)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new PS(this,e)}querySelector(e){e=e.toUpperCase();const r=new PS(this,i=>i.nodeName&&i.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),yl(new PS(this,n=>n.nodeName&&n.nodeName.toUpperCase()===e))}_callObserver(e,n){__(this,e,new QY(this,n,e))}toString(){return x4(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,n={},r){const i=e.createDocumentFragment();return r!==void 0&&r._createAssociation(i,this),Lp(this,s=>{i.insertBefore(s.toDOM(e,n,r),null)}),i}insert(e,n){this.doc!==null?nn(this.doc,r=>{w4(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}insertAfter(e,n){if(this.doc!==null)nn(this.doc,r=>{const i=e&&e instanceof Er?e._item:e;qv(r,this,i,n)});else{const r=this._prelimContent,i=e===null?0:r.findIndex(s=>s===e)+1;if(i===0&&e!==null)throw _l("Reference item not found");r.splice(i,0,...n)}}delete(e,n=1){this.doc!==null?nn(this.doc,r=>{M4(r,this,e,n)}):this._prelimContent.splice(e,n)}toArray(){return _4(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return S4(this,e)}slice(e=0,n=this.length){return y4(this,e,n)}forEach(e){Lp(this,e)}_write(e){e.writeTypeRef(gK)}}const ZY=t=>new Uc;class Xf extends Uc{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,n){super._integrate(e,n),this._prelimAttrs.forEach((r,i)=>{this.setAttribute(i,r)}),this._prelimAttrs=null}_copy(){return new Xf(this.nodeName)}clone(){const e=new Xf(this.nodeName),n=this.getAttributes();return L$(n,(r,i)=>{typeof r=="string"&&e.setAttribute(i,r)}),e.insert(0,this.toArray().map(r=>r instanceof Er?r.clone():r)),e}toString(){const e=this.getAttributes(),n=[],r=[];for(const a in e)r.push(a);r.sort();const i=r.length;for(let a=0;a0?" "+n.join(" "):"";return`<${s}${o}>${super.toString()}`}removeAttribute(e){this.doc!==null?nn(this.doc,n=>{Zv(n,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,n){this.doc!==null?nn(this.doc,r=>{uA(r,this,e,n)}):this._prelimAttrs.set(e,n)}getAttribute(e){return fA(this,e)}hasAttribute(e){return A4(this,e)}getAttributes(e){return e?HY(this,e):T4(this)}toDOM(e=document,n={},r){const i=e.createElement(this.nodeName),s=this.getAttributes();for(const o in s){const a=s[o];typeof a=="string"&&i.setAttribute(o,a)}return Lp(this,o=>{i.appendChild(o.toDOM(e,n,r))}),r!==void 0&&r._createAssociation(i,this),i}_write(e){e.writeTypeRef(mK),e.writeKey(this.nodeName)}}const JY=t=>new Xf(t.readKey());class QY extends v_{constructor(e,n,r){super(e,r),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(i=>{i===null?this.childListChanged=!0:this.attributesChanged.add(i)})}}class Jv extends Wf{constructor(e){super(),this.hookName=e}_copy(){return new Jv(this.hookName)}clone(){const e=new Jv(this.hookName);return this.forEach((n,r)=>{e.set(r,n)}),e}toDOM(e=document,n={},r){const i=n[this.hookName];let s;return i!==void 0?s=i.createDom(this):s=document.createElement(this.hookName),s.setAttribute("data-yjs-hook",this.hookName),r!==void 0&&r._createAssociation(s,this),s}_write(e){e.writeTypeRef(vK),e.writeKey(this.hookName)}}const eK=t=>new Jv(t.readKey());class Qv extends Dc{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new Qv}clone(){const e=new Qv;return e.applyDelta(this.toDelta()),e}toDOM(e=document,n,r){const i=e.createTextNode(this.toString());return r!==void 0&&r._createAssociation(i,this),i}toString(){return this.toDelta().map(e=>{const n=[];for(const i in e.attributes){const s=[];for(const o in e.attributes[i])s.push({key:o,value:e.attributes[i][o]});s.sort((o,a)=>o.keyi.nodeName=0;i--)r+=``;return r}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(yK)}}const tK=t=>new Qv;class hA{constructor(e,n){this.id=e,this.length=n}get deleted(){throw So()}mergeWith(e){return!1}write(e,n,r){throw So()}integrate(e,n){throw So()}}const nK=0;class rs extends hA{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){n>0&&(this.id.clock+=n,this.length-=n),h4(e.doc.store,this)}write(e,n){e.writeInfo(nK),e.writeLen(this.length-n)}getMissing(e,n){return null}}class rm{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new rm(this.content)}splice(e){throw So()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeBuf(this.content)}getRef(){return 3}}const rK=t=>new rm(t.readBuf());class Np{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Np(this.len)}splice(e){const n=new Np(this.len-e);return this.len=e,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,n){Yv(e.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(e){}gc(e){}write(e,n){e.writeLen(this.len-n)}getRef(){return 1}}const iK=t=>new Np(t.readLen()),I4=(t,e)=>new fh({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class im{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const n={};this.opts=n,e.gc||(n.gc=!1),e.autoLoad&&(n.autoLoad=!0),e.meta!==null&&(n.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new im(I4(this.doc.guid,this.opts))}splice(e){throw So()}mergeWith(e){return!1}integrate(e,n){this.doc._item=n,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,n){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}const sK=t=>new im(I4(t.readString(),t.readAny()));class qc{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new qc(this.embed)}splice(e){throw So()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeJSON(this.embed)}getRef(){return 5}}const oK=t=>new qc(t.readJSON());class Qn{constructor(e,n){this.key=e,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Qn(this.key,this.value)}splice(e){throw So()}mergeWith(e){return!1}integrate(e,n){const r=n.parent;r._searchMarker=null,r._hasFormatting=!0}delete(e){}gc(e){}write(e,n){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}const aK=t=>new Qn(t.readKey(),t.readJSON());class ey{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new ey(this.arr)}splice(e){const n=new ey(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const r=this.arr.length;e.writeLen(r-n);for(let i=n;i{const e=t.readLen(),n=[];for(let r=0;r{const e=t.readLen(),n=[];for(let r=0;r=55296&&r<=56319&&(this.str=this.str.slice(0,e-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const uK=t=>new Co(t.readString()),fK=[GY,XY,qY,JY,ZY,eK,tK],hK=0,dK=1,pK=2,mK=3,gK=4,vK=5,yK=6;class _a{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new _a(this.type._copy())}splice(e){throw So()}mergeWith(e){return!1}integrate(e,n){this.type._integrate(e.doc,n)}delete(e){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e),n=n.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e)}),e.changed.delete(this.type)}gc(e){let n=this.type._start;for(;n!==null;)n.gc(e,!0),n=n.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(e,!0),r=r.left}),this.type._map=new Map}write(e,n){this.type._write(e)}getRef(){return 7}}const _K=t=>new _a(fK[t.readTypeRef()](t)),ty=(t,e,n)=>{const{client:r,clock:i}=e.id,s=new qn(Ot(r,i+n),e,Ot(r,i+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));return e.deleted&&s.markDeleted(),e.keep&&(s.keep=!0),e.redone!==null&&(s.redone=Ot(e.redone.client,e.redone.clock+n)),e.right=s,s.right!==null&&(s.right.left=s),t._mergeStructs.push(s),s.parentSub!==null&&s.right===null&&s.parent._map.set(s.parentSub,s),e.length=n,s};class qn extends hA{constructor(e,n,r,i,s,o,a,l){super(e,l.getLength()),this.origin=r,this.left=n,this.right=i,this.rightOrigin=s,this.parent=o,this.parentSub=a,this.redone=null,this.content=l,this.info=this.content.isCountable()?zP:0}set marker(e){(this.info&wS)>0!==e&&(this.info^=wS)}get marker(){return(this.info&wS)>0}get keep(){return(this.info&BP)>0}set keep(e){this.keep!==e&&(this.info^=BP)}get countable(){return(this.info&zP)>0}get deleted(){return(this.info&ES)>0}set deleted(e){this.deleted!==e&&(this.info^=ES)}markDeleted(){this.info|=ES}getMissing(e,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=hr(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=hr(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Sf&&this.id.client!==this.parent.client&&this.parent.clock>=hr(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=tI(e,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=xl(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===rs||this.right&&this.right.constructor===rs)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===qn&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===qn&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===Sf){const r=RS(n,this.parent);r.constructor===rs?this.parent=null:this.parent=r.content.type}return null}integrate(e,n){if(n>0&&(this.id.clock+=n,this.left=tI(e,e.doc.store,Ot(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,i;if(r!==null)i=r.right;else if(this.parentSub!==null)for(i=this.parent._map.get(this.parentSub)||null;i!==null&&i.left!==null;)i=i.left;else i=this.parent._start;const s=new Set,o=new Set;for(;i!==null&&i!==this.right;){if(o.add(i),s.add(i),E0(this.origin,i.origin)){if(i.id.client{r.p===e&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),Yv(e.deleteSet,this.id.client,this.id.clock,this.length),rI(e,n,this.parentSub),this.content.delete(e)}}gc(e,n){if(!this.deleted)throw To();this.content.gc(e),n?TY(e,this,new rs(this.id,this.length)):this.content=new Np(this.length)}write(e,n){const r=n>0?Ot(this.id.client,this.id.clock+n-1):this.origin,i=this.rightOrigin,s=this.parentSub,o=this.content.getRef()&d_|(r===null?0:Oi)|(i===null?0:oa)|(s===null?0:Ap);if(e.writeInfo(o),r!==null&&e.writeLeftID(r),i!==null&&e.writeRightID(i),r===null&&i===null){const a=this.parent;if(a._item!==void 0){const l=a._item;if(l===null){const c=wY(a);e.writeParentInfo(!0),e.writeString(c)}else e.writeParentInfo(!1),e.writeLeftID(l.id)}else a.constructor===String?(e.writeParentInfo(!0),e.writeString(a)):a.constructor===Sf?(e.writeParentInfo(!1),e.writeLeftID(a)):To();s!==null&&e.writeString(s)}this.content.write(e,n)}}const L4=(t,e)=>xK[e&d_](t),xK=[()=>{To()},iK,lK,rK,uK,oK,aK,_K,cK,sK,()=>{To()}],SK=10;class is extends hA{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){To()}write(e,n){e.writeInfo(SK),Rt(e.restEncoder,this.length-n)}getMissing(e,n){return null}}const N4=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},O4="__ $YJS$ __";N4[O4]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");N4[O4]=!0;const dA=0,k4=1,D4=2,EK=(t,e)=>{Rt(t,dA);const n=SY(e);Nr(t,n)},U4=(t,e,n)=>{Rt(t,k4),Nr(t,vY(e,n))},wK=(t,e,n)=>U4(e,n,Wr(t)),F4=(t,e,n)=>{try{pY(e,Wr(t),n)}catch(r){console.error("Caught error while handling a Yjs update",r)}},MK=(t,e)=>{Rt(t,D4),Nr(t,e)},TK=F4,AK=(t,e,n,r)=>{const i=bt(t);switch(i){case dA:wK(t,e,n);break;case k4:F4(t,n,r);break;case D4:TK(t,n,r);break;default:throw new Error("Unknown message type")}return i},uf={},lI={},aa={},lc={},Rs=WT("shared",["second"],t=>{switch(t.target){case"second":Object.keys(aa).forEach(e=>{const n=lc[e];n===void 0?Rs.emit("shared:join",e):n<10?lc[e]=n+1:delete lc[e]}),Object.keys(lI).forEach(e=>{Rs.emit("shared:active",e)});break;case"join":{const e=t.data,n=uf[e];if(n&&lI[e]){Rs.reply(t,"joinack",e);const r=cl();EK(r,n),Rs.reply(t,"sync",iv(e,r));const i=cl();U4(i,n),Rs.reply(t,"sync",iv(e,i))}break}case"joinack":{const e=t.data;uf[e]&&aa[e]&&(lc[e]=0);break}case"active":{const e=t.data;uf[e]&&aa[e]&&(lc[e]=0);break}case"sync":{const[e,n,r]=t.data,i=uf[n];if(i&&e!==Rs.id()){const s=Kc(r),o=cl();if(AK(s,o,i,Rs)===dA){const l=iv(n,o);Rs.emit("shared:sync",l)}}break}}});function CK(t){let e=uf[t];if(e)return e;uf[t]=e=new fh({guid:t});function n(r){const i=cl();MK(i,r),Rs.emit("shared:sync",iv(t,i))}return e.on("update",n),e.on("destroy",()=>{e==null||e.off("update",n)}),e}function pA(t){return CK(t).getMap()}function iv(t,e){const n=Os(e);return[Rs.id()??"",t,n]}function B4(t,e){const n=t.get(e);return n!=null&&n.toJSON?n.toJSON():n}function RK(t,e,n){typeof n=="string"?t.set(e,new Dc(n)):t.set(e,n)}function z4(t){aa[t]=(aa[t]??0)+1,aa[t]===1&&(delete lc[t],Rs.emit("shared:join",t))}function H4(t){const e=aa[t]??0;e<=1?(delete aa[t],delete lc[t]):aa[t]=e-1}function bK(t,e,n){const r=pA(t),i=B4(r,e);(i===void 0||n!==i)&&RK(r,e,n)}function PK(t,e,n){const r=pA(t);function i(){n(B4(r,e))}function s(o){o.keysChanged.has(e)&&i()}return i(),r.observe(s),()=>{r.unobserve(s)}}function IK(t,e,n){const r=pA(t);let i=r.get(e);function s(){n(i)}function o(l){l.keysChanged.has(e)&&i===void 0&&a(),i&&r.unobserve(o)}function a(){i=r.get(e),i?(i.observeDeep(s),s()):r.observe(o)}return a(),()=>{i?i.unobserveDeep(s):r.unobserve(o)}}function LK(t,e,n){z4(t);const r=PK(t,e,n);return()=>{r(),H4(t)}}function NK(t,e,n){z4(t);const r=IK(t,e,n);return()=>{r(),H4(t)}}const V4=new gj,OK=mj(t=>V4.postMessage(t));V4.addEventListener("message",t=>{OK(t.data)});/** * postprocessing v6.35.3 build Sat Mar 30 2024 diff --git a/assets/instance-DdM-nTie.js b/assets/instance-Cr_eYlJb.js similarity index 99% rename from assets/instance-DdM-nTie.js rename to assets/instance-Cr_eYlJb.js index 2098cd8aa..f99421bc8 100644 --- a/assets/instance-DdM-nTie.js +++ b/assets/instance-Cr_eYlJb.js @@ -7,7 +7,7 @@ var WI=Object.defineProperty;var KI=(Pt,Be,_n)=>Be in Pt?WI(Pt,Be,{enumerable:!0 * https://github.com/Starcounter-Jack/JSON-Patch * (c) 2017-2021 Joachim Wester * MIT license - */var lo=new WeakMap,mg=function(){function t(e){this.observers=new Map,this.obj=e}return t}(),Eg=function(){function t(e,n){this.callback=e,this.observer=n}return t}();function _g(t){return lo.get(t)}function yg(t,e){return t.observers.get(e)}function Tg(t,e){t.observers.delete(e.callback)}function Sg(t,e){e.unobserve()}function Ag(t,e){var n=[],r,s=_g(t);if(!s)s=new mg(t),lo.set(t,s);else{var i=yg(s,e);r=i&&i.observer}if(r)return r;if(r={},s.value=Ce(t),e){r.callback=e,r.next=null;var o=function(){uo(r)},a=function(){clearTimeout(r.next),r.next=setTimeout(o)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return r.patches=n,r.object=t,r.unobserve=function(){uo(r),clearTimeout(r.next),Tg(s,r),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},s.observers.set(e,new Eg(e,r)),r}function uo(t,e){e===void 0&&(e=!1);var n=lo.get(t.object);ho(n.value,t.object,t.patches,"",e),t.patches.length&&co(n.value,t.patches);var r=t.patches;return r.length>0&&(t.patches=[],t.callback&&t.callback(r)),r}function ho(t,e,n,r,s){if(e!==t){typeof e.toJSON=="function"&&(e=e.toJSON());for(var i=io(e),o=io(t),a=!1,c=o.length-1;c>=0;c--){var l=o[c],u=t[l];if(so(e,l)&&!(e[l]===void 0&&u!==void 0&&Array.isArray(e)===!1)){var f=e[l];typeof u=="object"&&u!=null&&typeof f=="object"&&f!=null&&Array.isArray(u)===Array.isArray(f)?ho(u,f,n,r+"/"+yn(l),s):u!==f&&(s&&n.push({op:"test",path:r+"/"+yn(l),value:Ce(u)}),n.push({op:"replace",path:r+"/"+yn(l),value:Ce(f)}))}else Array.isArray(t)===Array.isArray(e)?(s&&n.push({op:"test",path:r+"/"+yn(l),value:Ce(u)}),n.push({op:"remove",path:r+"/"+yn(l)}),a=!0):(s&&n.push({op:"test",path:r,value:t}),n.push({op:"replace",path:r,value:e}))}if(!(!a&&i.length==o.length))for(var c=0;ct&&(go.has(t)?go.get(t):$c(t)===Object.prototype||$c(t)===Array.prototype),bg=t=>Cg(t)&&t[Lg]||null,Bc=(t,e=!0)=>{go.set(t,e)};var Gc={ZSS_LANG_DEV:"false",ZSS_STATS_DEV:"false",ZSS_SHOW_CODE:"false",ZSS_BRANCH_NAME:"main",ZSS_BRANCH_VERSION:"0.0.3",ZSS_COMMIT_HASH:"295766cd0a025452e00ff642b55a1495810fec25",ZSS_COMMIT_MESSAGE:"ci: version bump to v0.0.3",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const mo=t=>typeof t=="object"&&t!==null,Yn=new WeakMap,Or=new WeakSet,kg=(t=Object.is,e=(l,u)=>new Proxy(l,u),n=l=>mo(l)&&!Or.has(l)&&(Array.isArray(l)||!(Symbol.iterator in l))&&!(l instanceof WeakMap)&&!(l instanceof WeakSet)&&!(l instanceof Error)&&!(l instanceof Number)&&!(l instanceof Date)&&!(l instanceof String)&&!(l instanceof RegExp)&&!(l instanceof ArrayBuffer),r=l=>{switch(l.status){case"fulfilled":return l.value;case"rejected":throw l.reason;default:throw l}},s=new WeakMap,i=(l,u,f=r)=>{const d=s.get(l);if((d==null?void 0:d[0])===u)return d[1];const h=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return Bc(h,!0),s.set(l,[u,h]),Reflect.ownKeys(l).forEach(p=>{if(Object.getOwnPropertyDescriptor(h,p))return;const g=Reflect.get(l,p),{enumerable:A}=Reflect.getOwnPropertyDescriptor(l,p),S={value:g,enumerable:A,configurable:!0};if(Or.has(g))Bc(g,!1);else if(g instanceof Promise)delete S.value,S.get=()=>f(g);else if(Yn.has(g)){const[y,w]=Yn.get(g);S.value=i(y,w(),f)}Object.defineProperty(h,p,S)}),Object.preventExtensions(h)},o=new WeakMap,a=[1,1],c=l=>{if(!mo(l))throw new Error("object required");const u=o.get(l);if(u)return u;let f=a[0];const d=new Set,h=(R,I=++a[0])=>{f!==I&&(f=I,d.forEach(k=>k(R,I)))};let p=a[1];const g=(R=++a[1])=>(p!==R&&!d.size&&(p=R,S.forEach(([I])=>{const k=I[1](R);k>f&&(f=k)})),f),A=R=>(I,k)=>{const ue=[...I];ue[1]=[R,...ue[1]],h(ue,k)},S=new Map,y=(R,I)=>{if((Gc?"production":void 0)!=="production"&&S.has(R))throw new Error("prop listener already exists");if(d.size){const k=I[3](A(R));S.set(R,[I,k])}else S.set(R,[I])},w=R=>{var I;const k=S.get(R);k&&(S.delete(R),(I=k[1])==null||I.call(k))},E=R=>(d.add(R),d.size===1&&S.forEach(([k,ue],te)=>{if((Gc?"production":void 0)!=="production"&&ue)throw new Error("remove already exists");const Ie=k[3](A(te));S.set(te,[k,Ie])}),()=>{d.delete(R),d.size===0&&S.forEach(([k,ue],te)=>{ue&&(ue(),S.set(te,[k]))})}),T=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),_=e(T,{deleteProperty(R,I){const k=Reflect.get(R,I);w(I);const ue=Reflect.deleteProperty(R,I);return ue&&h(["delete",[I],k]),ue},set(R,I,k,ue){const te=Reflect.has(R,I),Ie=Reflect.get(R,I,ue);if(te&&(t(Ie,k)||o.has(k)&&t(Ie,o.get(k))))return!0;w(I),mo(k)&&(k=bg(k)||k);let ve=k;if(k instanceof Promise)k.then($e=>{k.status="fulfilled",k.value=$e,h(["resolve",[I],$e])}).catch($e=>{k.status="rejected",k.reason=$e,h(["reject",[I],$e])});else{!Yn.has(k)&&n(k)&&(ve=c(k));const $e=!Or.has(ve)&&Yn.get(ve);$e&&y(I,$e)}return Reflect.set(R,I,ve,ue),h(["set",[I],k,Ie]),!0}});o.set(l,_);const v=[T,g,i,E];return Yn.set(_,v),Reflect.ownKeys(l).forEach(R=>{const I=Object.getOwnPropertyDescriptor(l,R);"value"in I&&(_[R]=l[R],delete I.value,delete I.writable),Object.defineProperty(T,R,I)}),_})=>[c,Yn,Or,t,e,n,r,s,i,o,a],[Mg]=kg();function xg(t={}){return Mg(t)}function Wc(t){return Or.add(t),t}var Kc={exports:{}},W={};/** + */var lo=new WeakMap,mg=function(){function t(e){this.observers=new Map,this.obj=e}return t}(),Eg=function(){function t(e,n){this.callback=e,this.observer=n}return t}();function _g(t){return lo.get(t)}function yg(t,e){return t.observers.get(e)}function Tg(t,e){t.observers.delete(e.callback)}function Sg(t,e){e.unobserve()}function Ag(t,e){var n=[],r,s=_g(t);if(!s)s=new mg(t),lo.set(t,s);else{var i=yg(s,e);r=i&&i.observer}if(r)return r;if(r={},s.value=Ce(t),e){r.callback=e,r.next=null;var o=function(){uo(r)},a=function(){clearTimeout(r.next),r.next=setTimeout(o)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return r.patches=n,r.object=t,r.unobserve=function(){uo(r),clearTimeout(r.next),Tg(s,r),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},s.observers.set(e,new Eg(e,r)),r}function uo(t,e){e===void 0&&(e=!1);var n=lo.get(t.object);ho(n.value,t.object,t.patches,"",e),t.patches.length&&co(n.value,t.patches);var r=t.patches;return r.length>0&&(t.patches=[],t.callback&&t.callback(r)),r}function ho(t,e,n,r,s){if(e!==t){typeof e.toJSON=="function"&&(e=e.toJSON());for(var i=io(e),o=io(t),a=!1,c=o.length-1;c>=0;c--){var l=o[c],u=t[l];if(so(e,l)&&!(e[l]===void 0&&u!==void 0&&Array.isArray(e)===!1)){var f=e[l];typeof u=="object"&&u!=null&&typeof f=="object"&&f!=null&&Array.isArray(u)===Array.isArray(f)?ho(u,f,n,r+"/"+yn(l),s):u!==f&&(s&&n.push({op:"test",path:r+"/"+yn(l),value:Ce(u)}),n.push({op:"replace",path:r+"/"+yn(l),value:Ce(f)}))}else Array.isArray(t)===Array.isArray(e)?(s&&n.push({op:"test",path:r+"/"+yn(l),value:Ce(u)}),n.push({op:"remove",path:r+"/"+yn(l)}),a=!0):(s&&n.push({op:"test",path:r,value:t}),n.push({op:"replace",path:r,value:e}))}if(!(!a&&i.length==o.length))for(var c=0;ct&&(go.has(t)?go.get(t):$c(t)===Object.prototype||$c(t)===Array.prototype),bg=t=>Cg(t)&&t[Lg]||null,Bc=(t,e=!0)=>{go.set(t,e)};var Gc={ZSS_LANG_DEV:"false",ZSS_STATS_DEV:"false",ZSS_SHOW_CODE:"false",ZSS_BRANCH_NAME:"main",ZSS_BRANCH_VERSION:"0.0.4",ZSS_COMMIT_HASH:"60928f32c5a040095ea1f619ee2c92712e1adecb",ZSS_COMMIT_MESSAGE:"ci: version bump to v0.0.4",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const mo=t=>typeof t=="object"&&t!==null,Yn=new WeakMap,Or=new WeakSet,kg=(t=Object.is,e=(l,u)=>new Proxy(l,u),n=l=>mo(l)&&!Or.has(l)&&(Array.isArray(l)||!(Symbol.iterator in l))&&!(l instanceof WeakMap)&&!(l instanceof WeakSet)&&!(l instanceof Error)&&!(l instanceof Number)&&!(l instanceof Date)&&!(l instanceof String)&&!(l instanceof RegExp)&&!(l instanceof ArrayBuffer),r=l=>{switch(l.status){case"fulfilled":return l.value;case"rejected":throw l.reason;default:throw l}},s=new WeakMap,i=(l,u,f=r)=>{const d=s.get(l);if((d==null?void 0:d[0])===u)return d[1];const h=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l));return Bc(h,!0),s.set(l,[u,h]),Reflect.ownKeys(l).forEach(p=>{if(Object.getOwnPropertyDescriptor(h,p))return;const g=Reflect.get(l,p),{enumerable:A}=Reflect.getOwnPropertyDescriptor(l,p),S={value:g,enumerable:A,configurable:!0};if(Or.has(g))Bc(g,!1);else if(g instanceof Promise)delete S.value,S.get=()=>f(g);else if(Yn.has(g)){const[y,w]=Yn.get(g);S.value=i(y,w(),f)}Object.defineProperty(h,p,S)}),Object.preventExtensions(h)},o=new WeakMap,a=[1,1],c=l=>{if(!mo(l))throw new Error("object required");const u=o.get(l);if(u)return u;let f=a[0];const d=new Set,h=(R,I=++a[0])=>{f!==I&&(f=I,d.forEach(k=>k(R,I)))};let p=a[1];const g=(R=++a[1])=>(p!==R&&!d.size&&(p=R,S.forEach(([I])=>{const k=I[1](R);k>f&&(f=k)})),f),A=R=>(I,k)=>{const ue=[...I];ue[1]=[R,...ue[1]],h(ue,k)},S=new Map,y=(R,I)=>{if((Gc?"production":void 0)!=="production"&&S.has(R))throw new Error("prop listener already exists");if(d.size){const k=I[3](A(R));S.set(R,[I,k])}else S.set(R,[I])},w=R=>{var I;const k=S.get(R);k&&(S.delete(R),(I=k[1])==null||I.call(k))},E=R=>(d.add(R),d.size===1&&S.forEach(([k,ue],te)=>{if((Gc?"production":void 0)!=="production"&&ue)throw new Error("remove already exists");const Ie=k[3](A(te));S.set(te,[k,Ie])}),()=>{d.delete(R),d.size===0&&S.forEach(([k,ue],te)=>{ue&&(ue(),S.set(te,[k]))})}),T=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),_=e(T,{deleteProperty(R,I){const k=Reflect.get(R,I);w(I);const ue=Reflect.deleteProperty(R,I);return ue&&h(["delete",[I],k]),ue},set(R,I,k,ue){const te=Reflect.has(R,I),Ie=Reflect.get(R,I,ue);if(te&&(t(Ie,k)||o.has(k)&&t(Ie,o.get(k))))return!0;w(I),mo(k)&&(k=bg(k)||k);let ve=k;if(k instanceof Promise)k.then($e=>{k.status="fulfilled",k.value=$e,h(["resolve",[I],$e])}).catch($e=>{k.status="rejected",k.reason=$e,h(["reject",[I],$e])});else{!Yn.has(k)&&n(k)&&(ve=c(k));const $e=!Or.has(ve)&&Yn.get(ve);$e&&y(I,$e)}return Reflect.set(R,I,ve,ue),h(["set",[I],k,Ie]),!0}});o.set(l,_);const v=[T,g,i,E];return Yn.set(_,v),Reflect.ownKeys(l).forEach(R=>{const I=Object.getOwnPropertyDescriptor(l,R);"value"in I&&(_[R]=l[R],delete I.value,delete I.writable),Object.defineProperty(T,R,I)}),_})=>[c,Yn,Or,t,e,n,r,s,i,o,a],[Mg]=kg();function xg(t={}){return Mg(t)}function Wc(t){return Or.add(t),t}var Kc={exports:{}},W={};/** * @license React * react.production.min.js * diff --git a/index.html b/index.html index c41425c6a..96f94afb1 100644 --- a/index.html +++ b/index.html @@ -3,11 +3,11 @@ - ZZS - main:0.0.3:295766cd0a025452e00ff642b55a1495810fec25 + ZZS - main:0.0.4:60928f32c5a040095ea1f619ee2c92712e1adecb - +