pneuma-skills 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{EditorPanel-B2BEFeeL.js → EditorPanel-JzFuk3WG.js} +1 -1
- package/dist/assets/{TerminalPanel-BrgYO1B8.js → TerminalPanel-xx5i__-P.js} +1 -1
- package/dist/assets/{index-02wP0M7m.js → index-J1QIN1v7.js} +2 -2
- package/dist/assets/{pneuma-mode-CmSXfDwj.js → pneuma-mode-C4v13scm.js} +1 -1
- package/dist/assets/{pneuma-mode-BIw7BkAp.js → pneuma-mode-_Ng_oSnc.js} +4 -4
- package/dist/index.html +1 -1
- package/modes/slide/components/SlidePreview.tsx +6 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as H,j as L,u as Fp}from"./index-
|
|
1
|
+
import{r as H,j as L,u as Fp}from"./index-J1QIN1v7.js";function $o(){return $o=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},$o.apply(null,arguments)}function Hp(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}let vo=[],TO=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?TO:vo).push(t=t+n[e])})();function Kp(n){if(n<768)return!1;for(let e=0,t=vo.length;;){let i=e+t>>1;if(n<vo[i])t=i;else if(n>=TO[i])e=i+1;else return!0;if(e==t)return!1}}function _a(n){return n>=127462&&n<=127487}const Wa=8205;function Jp(n,e,t=!0,i=!0){return(t?CO:em)(n,e,i)}function CO(n,e,t){if(e==n.length)return e;e&&XO(n.charCodeAt(e))&&ZO(n.charCodeAt(e-1))&&e--;let i=Cs(n,e);for(e+=Va(i);e<n.length;){let r=Cs(n,e);if(i==Wa||r==Wa||t&&Kp(r))e+=Va(r),i=r;else if(_a(r)){let s=0,o=e-2;for(;o>=0&&_a(Cs(n,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function em(n,e,t){for(;e>0;){let i=CO(n,e-2,t);if(i<e)return i;e--}return 0}function Cs(n,e){let t=n.charCodeAt(e);if(!ZO(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return XO(i)?(t-55296<<10)+(i-56320)+65536:t}function XO(n){return n>=56320&&n<57344}function ZO(n){return n>=55296&&n<56320}function Va(n){return n<65536?1:2}class I{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=Ci(this,e,t);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),at.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Ci(this,e,t);let i=[];return this.decompose(e,t,i,0),at.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new nn(this),s=new nn(e);for(let o=t,l=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(e=1){return new nn(this,e)}iterRange(e,t=this.length){return new RO(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new AO(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?I.empty:e.length<=32?new oe(e):at.from(oe.split(e,[]))}}class oe extends I{constructor(e,t=tm(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((t?i:l)>=e)return new im(r,l,i,o);r=l+1,i++}}decompose(e,t,i,r){let s=e<=0&&t>=this.length?this:new oe(La(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=i.pop(),l=Sr(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new oe(l,o.length+s.length));else{let a=l.length>>1;i.push(new oe(l.slice(0,a)),new oe(l.slice(a)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof oe))return super.replace(e,t,i);[e,t]=Ci(this,e,t);let r=Sr(this.text,Sr(i.text,La(this.text,0,e)),t),s=this.length+i.length-(t-e);return r.length<=32?new oe(r,s):at.from(oe.split(r,[]),s)}sliceString(e,t=this.length,i=`
|
|
2
2
|
`){[e,t]=Ci(this,e,t);let r="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let l=this.text[o],a=s+l.length;s>e&&o&&(r+=i),e<a&&t>s&&(r+=l.slice(Math.max(0,e-s),t-s)),s=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(t.push(new oe(i,r)),i=[],r=-1);return r>-1&&t.push(new oe(i,r)),t}}class at extends I{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,r);r=l+1,i=a+1}}decompose(e,t,i,r){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let l=this.children[s],a=o+l.length;if(e<=a&&t>=o){let h=r&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if([e,t]=Ci(this,e,t),i.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let o=this.children[r],l=s+o.length;if(e>=s&&t<=l){let a=o.replace(e-s,t-s,i),h=this.lines-o.lines+a.lines;if(a.lines<h>>4&&a.lines>h>>6){let c=this.children.slice();return c[r]=a,new at(c,this.length-(t-e)+i.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
|
3
3
|
`){[e,t]=Ci(this,e,t);let r="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let l=this.children[s],a=o+l.length;o>e&&s&&(r+=i),e<a&&t>o&&(r+=l.sliceString(e-o,t-o,i)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof at))return 0;let i=0,[r,s,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==l)return i;let a=this.children[r],h=e.children[s];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let u of e)i+=u.lines;if(i<32){let u=[];for(let d of e)d.flatten(u);return new oe(u,t)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,l=[],a=0,h=-1,c=[];function O(u){let d;if(u.lines>s&&u instanceof at)for(let m of u.children)O(m);else u.lines>o&&(a>o||!a)?(f(),l.push(u)):u instanceof oe&&a&&(d=c[c.length-1])instanceof oe&&u.lines+d.lines<=32?(a+=u.lines,h+=u.length+1,c[c.length-1]=new oe(d.text.concat(u.text),d.length+1+u.length)):(a+u.lines>r&&f(),a+=u.lines,h+=u.length+1,c.push(u))}function f(){a!=0&&(l.push(c.length==1?c[0]:at.from(c,h)),h=-1,a=c.length=0)}for(let u of e)O(u);return f(),l.length==1?l[0]:new at(l,t)}}I.empty=new oe([""],0);function tm(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Sr(n,e,t=0,i=1e9){for(let r=0,s=0,o=!0;s<n.length&&r<=i;s++){let l=n[s],a=r+l.length;a>=t&&(a>i&&(l=l.slice(0,i-r)),r<t&&(l=l.slice(t-r)),o?(e[e.length-1]+=l,o=!1):e.push(l)),r=a+1}return e}function La(n,e,t){return Sr(n,[""],e,t)}class nn{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof oe?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],o=s>>1,l=r instanceof oe?r.text.length:r.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
4
4
|
`,this;e--}else if(r instanceof oe){let a=r.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof oe?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class RO{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new nn(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=i?r:t<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class AO{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=function(){return this.iter()},nn.prototype[Symbol.iterator]=RO.prototype[Symbol.iterator]=AO.prototype[Symbol.iterator]=function(){return this});let im=class{constructor(e,t,i,r){this.from=e,this.to=t,this.number=i,this.text=r}get length(){return this.to-this.from}};function Ci(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function pe(n,e,t=!0,i=!0){return Jp(n,e,t,i)}function nm(n){return n>=56320&&n<57344}function rm(n){return n>=55296&&n<56320}function Xe(n,e){let t=n.charCodeAt(e);if(!rm(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return nm(i)?(t-55296<<10)+(i-56320)+65536:t}function Rl(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function ht(n){return n<65536?1:2}const To=/\r\n?|\n/;var Se=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(Se||(Se={}));class pt{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,r=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(i,r,s),r+=s):r+=o,i+=s}}iterChangedRanges(e,t=!1){Co(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],r=this.sections[t++];r<0?e.push(i,r):e.push(r,i)}return new pt(e)}composeDesc(e){return this.empty?e:e.empty?this:qO(this,e)}mapDesc(e,t=!1){return e.empty?this:Xo(this,e,t)}mapPos(e,t=-1,i=Se.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],h=r+l;if(a<0){if(h>e)return s+(e-r);s+=l}else{if(i!=Se.Simple&&h>=e&&(i==Se.TrackDel&&r<e&&h>e||i==Se.TrackBefore&&r<e||i==Se.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!l)return e==r||t<0?s:s+a;s+=a}r=h}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let i=0,r=0;i<this.sections.length&&r<=t;){let s=this.sections[i++],o=this.sections[i++],l=r+s;if(o>=0&&r<=t&&l>=e)return r<e&&l>t?"cover":!0;r=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new pt(e)}static create(e){return new pt(e)}}class Oe extends pt{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Co(this,(t,i,r,s,o)=>e=e.replace(r,r+(i-t),o),!1),e}mapDesc(e,t=!1){return Xo(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let r=0,s=0;r<t.length;r+=2){let o=t[r],l=t[r+1];if(l>=0){t[r]=l,t[r+1]=o;let a=r>>1;for(;i.length<a;)i.push(I.empty);i.push(o?e.slice(s,s+o):I.empty)}s+=o}return new Oe(t,i)}compose(e){return this.empty?e:e.empty?this:qO(this,e,!0)}map(e,t=!1){return e.empty?this:Xo(this,e,t,!0)}iterChanges(e,t=!1){Co(this,e,t)}get desc(){return pt.create(this.sections)}filter(e){let t=[],i=[],r=[],s=new fn(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&s.len==0;){if(s.done)break e;let c=Math.min(s.len,a-l);Pe(r,c,-1);let O=s.ins==-1?-1:s.off==0?s.ins:0;Pe(t,c,O),O>0&&Mt(i,t,s.text),s.forward(c),l+=c}let h=e[o++];for(;l<h;){if(s.done)break e;let c=Math.min(s.len,h-l);Pe(t,c,-1),Pe(r,c,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(c),l+=c}}return{changes:new Oe(t,i),filtered:pt.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],r=this.sections[t+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let r=[],s=[],o=0,l=null;function a(c=!1){if(!c&&!r.length)return;o<t&&Pe(r,t-o,-1);let O=new Oe(r,s);l=l?l.compose(O.map(l)):O,r=[],s=[],o=0}function h(c){if(Array.isArray(c))for(let O of c)h(O);else if(c instanceof Oe){if(c.length!=t)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${t})`);a(),l=l?l.compose(c.map(l)):c}else{let{from:O,to:f=O,insert:u}=c;if(O>f||O<0||f>t)throw new RangeError(`Invalid change range ${O} to ${f} (in doc of length ${t})`);let d=u?typeof u=="string"?I.of(u.split(i||To)):u:I.empty,m=d.length;if(O==f&&m==0)return;O<o&&a(),O>o&&Pe(r,O-o,-1),Pe(r,f-O,m),Mt(s,r,d),o=f}}return h(e),a(!l),l}static empty(e){return new Oe(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;i.length<r;)i.push(I.empty);i[r]=I.of(s.slice(1)),t.push(s[0],i[r].length)}}}return new Oe(t,i)}static createSet(e,t){return new Oe(e,t)}}function Pe(n,e,t,i=!1){if(e==0&&t<=0)return;let r=n.length-2;r>=0&&t<=0&&t==n[r+1]?n[r]+=e:r>=0&&e==0&&n[r]==0?n[r+1]+=t:i?(n[r]+=e,n[r+1]+=t):n.push(e,t)}function Mt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<i;)n.push(I.empty);n.push(t)}}function Co(n,e,t){let i=n.inserted;for(let r=0,s=0,o=0;o<n.sections.length;){let l=n.sections[o++],a=n.sections[o++];if(a<0)r+=l,s+=l;else{let h=r,c=s,O=I.empty;for(;h+=l,c+=a,a&&i&&(O=O.append(i[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(r,h,s,c,O),r=h,s=c}}}function Xo(n,e,t,i=!1){let r=[],s=i?[]:null,o=new fn(n),l=new fn(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);Pe(r,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!t))){let h=l.len;for(Pe(r,l.ins,-1);h;){let c=Math.min(o.len,h);o.ins>=0&&a<o.i&&o.len<=c&&(Pe(r,0,o.ins),s&&Mt(s,r,o.text),a=o.i),o.forward(c),h-=c}l.next()}else if(o.ins>=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let O=Math.min(c,l.len);h+=O,c-=O,l.forward(O)}else if(l.ins==0&&l.len<c)c-=l.len,l.next();else break;Pe(r,h,a<o.i?o.ins:0),s&&a<o.i&&Mt(s,r,o.text),a=o.i,o.forward(o.len-c)}else{if(o.done&&l.done)return s?Oe.createSet(r,s):pt.create(r);throw new Error("Mismatched change set lengths")}}}function qO(n,e,t=!1){let i=[],r=t?[]:null,s=new fn(n),o=new fn(e);for(let l=!1;;){if(s.done&&o.done)return r?Oe.createSet(i,r):pt.create(i);if(s.ins==0)Pe(i,s.len,0,l),s.next();else if(o.len==0&&!o.done)Pe(i,0,o.ins,l),r&&Mt(r,i,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,o.len),h=i.length;if(s.ins==-1){let c=o.ins==-1?-1:o.off?0:o.ins;Pe(i,a,c,l),r&&c&&Mt(r,i,o.text)}else o.ins==-1?(Pe(i,s.off?0:s.len,a,l),r&&Mt(r,i,s.textBit(a))):(Pe(i,s.off?0:s.len,o.off?0:o.ins,l),r&&!o.off&&Mt(r,i,o.text));l=(s.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>h),s.forward2(a),o.forward(a)}}}}class fn{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?I.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?I.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ii{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new ii(i,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return y.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return y.range(this.anchor,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return y.range(e.anchor,e.head)}static create(e,t,i){return new ii(e,t,i)}}class y{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:y.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new y([this.main],0)}addRange(e,t=!0){return y.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,y.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new y(e.ranges.map(t=>ii.fromJSON(t)),e.main)}static single(e,t=e){return new y([y.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=i:s.from<i)return y.normalized(e.slice(),t);i=s.to}return new y(e,t)}static cursor(e,t=0,i,r){return ii.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i))|(r??16777215)<<6)}static range(e,t,i,r){let s=(i??16777215)<<6|(r==null?7:Math.min(6,r));return t<e?ii.create(t,e,48|s):ii.create(e,t,(t>e?8:0)|s)}static normalized(e,t=0){let i=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(i);for(let r=1;r<e.length;r++){let s=e[r],o=e[r-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,a=Math.max(s.to,o.to);r<=t&&t--,e.splice(--r,2,s.anchor>s.head?y.range(a,l):y.range(l,a))}}return new y(e,t)}}function zO(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Al=0;class C{constructor(e,t,i,r,s){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=r,this.id=Al++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new C(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:ql),!!e.static,e.enables)}of(e){return new br([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new br(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new br(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function ql(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class br{constructor(e,t,i,r){this.dependencies=e,this.facet=t,this.type=i,this.value=r,this.id=Al++}dynamicSlot(e){var t;let i=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let O of this.dependencies)O=="doc"?a=!0:O=="selection"?h=!0:(((t=e[O.id])!==null&&t!==void 0?t:1)&1)==0&&c.push(e[O.id]);return{create(O){return O.values[o]=i(O),1},update(O,f){if(a&&f.docChanged||h&&(f.docChanged||f.selection)||Zo(O,c)){let u=i(O);if(l?!Ya(u,O.values[o],r):!r(u,O.values[o]))return O.values[o]=u,1}return 0},reconfigure:(O,f)=>{let u,d=f.config.address[s];if(d!=null){let m=qr(f,d);if(this.dependencies.every(g=>g instanceof C?f.facet(g)===O.facet(g):g instanceof ye?f.field(g,!1)==O.field(g,!1):!0)||(l?Ya(u=i(O),m,r):r(u=i(O),m)))return O.values[o]=m,0}else u=i(O);return O.values[o]=u,1}}}}function Ya(n,e,t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!t(n[i],e[i]))return!1;return!0}function Zo(n,e){let t=!1;for(let i of e)rn(n,i)&1&&(t=!0);return t}function sm(n,e,t){let i=t.map(a=>n[a.id]),r=t.map(a=>a.type),s=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;c<i.length;c++){let O=qr(a,i[c]);if(r[c]==2)for(let f of O)h.push(f);else h.push(O)}return e.combine(h)}return{create(a){for(let h of i)rn(a,h);return a.values[o]=l(a),1},update(a,h){if(!Zo(a,s))return 0;let c=l(a);return e.compare(c,a.values[o])?0:(a.values[o]=c,1)},reconfigure(a,h){let c=Zo(a,i),O=h.config.facets[e.id],f=h.facet(e);if(O&&!c&&ql(t,O))return a.values[o]=f,0;let u=l(a);return e.compare(u,f)?(a.values[o]=f,0):(a.values[o]=u,1)}}}const Gn=C.define({static:!0});class ye{constructor(e,t,i,r,s){this.id=e,this.createF=t,this.updateF=i,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let t=new ye(Al++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Gn).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,r)=>{let s=i.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[t]=o,1)},reconfigure:(i,r)=>{let s=i.facet(Gn),o=r.facet(Gn),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[t]=l.create(i),1):r.config.address[this.id]!=null?(i.values[t]=r.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,Gn.of({field:this,create:e})]}get extension(){return this}}const Jt={lowest:4,low:3,default:2,high:1,highest:0};function ji(n){return e=>new MO(e,n)}const Zt={highest:ji(Jt.highest),high:ji(Jt.high),default:ji(Jt.default),low:ji(Jt.low),lowest:ji(Jt.lowest)};class MO{constructor(e,t){this.inner=e,this.prec=t}}class fs{of(e){return new Ro(this,e)}reconfigure(e){return fs.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Ro{constructor(e,t){this.compartment=e,this.inner=t}}class Ar{constructor(e,t,i,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let r=[],s=Object.create(null),o=new Map;for(let f of om(e,t,o))f instanceof ye?r.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],h=[];for(let f of r)l[f.id]=h.length<<1,h.push(u=>f.slot(u));let c=i==null?void 0:i.config.facets;for(let f in s){let u=s[f],d=u[0].facet,m=c&&c[f]||[];if(u.every(g=>g.type==0))if(l[d.id]=a.length<<1|1,ql(m,u))a.push(i.facet(d));else{let g=d.combine(u.map(Q=>Q.value));a.push(i&&d.compare(g,i.facet(d))?i.facet(d):g)}else{for(let g of u)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=h.length<<1,h.push(Q=>g.dynamicSlot(Q)));l[d.id]=h.length<<1,h.push(g=>sm(g,d,u))}}let O=h.map(f=>f(l));return new Ar(e,o,O,l,a,s)}}function om(n,e,t){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof Ro&&t.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let h of o)s(h,l);else if(o instanceof Ro){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),s(h,l)}else if(o instanceof MO)s(o.inner,o.prec);else if(o instanceof ye)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof br)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,Jt.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,l)}}return s(n,Jt.default),i.reduce((o,l)=>o.concat(l))}function rn(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let r=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|r}function qr(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const EO=C.define(),Ao=C.define({combine:n=>n.some(e=>e),static:!0}),_O=C.define({combine:n=>n.length?n[0]:void 0,static:!0}),WO=C.define(),VO=C.define(),LO=C.define(),YO=C.define({combine:n=>n.length?n[0]:!1});class gt{constructor(e,t){this.type=e,this.value=t}static define(){return new lm}}class lm{of(e){return new gt(this,e)}}class am{constructor(e){this.map=e}of(e){return new z(this,e)}}class z{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new z(this.type,t)}is(e){return this.type==e}static define(e={}){return new am(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(t);s&&i.push(s)}return i}}z.reconfigure=z.define();z.appendConfig=z.define();class ae{constructor(e,t,i,r,s,o){this.startState=e,this.changes=t,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&zO(i,t.newLength),s.some(l=>l.type==ae.time)||(this.annotations=s.concat(ae.time.of(Date.now())))}static create(e,t,i,r,s,o){return new ae(e,t,i,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ae.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}ae.time=gt.define();ae.userEvent=gt.define();ae.addToHistory=gt.define();ae.remote=gt.define();function hm(n,e){let t=[];for(let i=0,r=0;;){let s,o;if(i<n.length&&(r==e.length||e[r]>=n[i]))s=n[i++],o=n[i++];else if(r<e.length)s=e[r++],o=e[r++];else return t;!t.length||t[t.length-1]<s?t.push(s,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function jO(n,e,t){var i;let r,s,o;return t?(r=e.changes,s=Oe.empty(e.changes.length),o=n.changes.compose(e.changes)):(r=e.changes.map(n.changes),s=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(s):(i=n.selection)===null||i===void 0?void 0:i.map(r),effects:z.mapEffects(n.effects,r).concat(z.mapEffects(e.effects,s)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function qo(n,e,t){let i=e.selection,r=bi(e.annotations);return e.userEvent&&(r=r.concat(ae.userEvent.of(e.userEvent))),{changes:e.changes instanceof Oe?e.changes:Oe.of(e.changes||[],t,n.facet(_O)),selection:i&&(i instanceof y?i:y.single(i.anchor,i.head)),effects:bi(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function DO(n,e,t){let i=qo(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let o=!!e[s].sequential;i=jO(i,qo(n,e[s],o?i.changes.newLength:n.doc.length),o)}let r=ae.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return Om(t?cm(r):r)}function cm(n){let e=n.startState,t=!0;for(let r of e.facet(WO)){let s=r(n);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:hm(t,s))}if(t!==!0){let r,s;if(t===!1)s=n.changes.invertedDesc,r=Oe.empty(e.doc.length);else{let o=n.changes.filter(t);r=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}n=ae.create(e,r,n.selection&&n.selection.map(s),z.mapEffects(n.effects,s),n.annotations,n.scrollIntoView)}let i=e.facet(VO);for(let r=i.length-1;r>=0;r--){let s=i[r](n);s instanceof ae?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof ae?n=s[0]:n=DO(e,bi(s),!1)}return n}function Om(n){let e=n.startState,t=e.facet(LO),i=n;for(let r=t.length-1;r>=0;r--){let s=t[r](n);s&&Object.keys(s).length&&(i=jO(i,qo(e,s,n.changes.newLength),!0))}return i==n?n:ae.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const fm=[];function bi(n){return n==null?fm:Array.isArray(n)?n:[n]}var ne=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(ne||(ne={}));const um=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let zo;try{zo=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function dm(n){if(zo)return zo.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||um.test(t)))return!0}return!1}function pm(n){return e=>{if(!/\S/.test(e))return ne.Space;if(dm(e))return ne.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return ne.Word;return ne.Other}}class D{constructor(e,t,i,r,s,o){this.config=e,this.doc=t,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)rn(this,l<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return rn(this,i),qr(this,i)}update(...e){return DO(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:r}=t;for(let l of e.effects)l.is(fs.reconfigure)?(t&&(r=new Map,t.compartments.forEach((a,h)=>r.set(h,a)),t=null),r.set(l.value.compartment,l.value.extension)):l.is(z.reconfigure)?(t=null,i=l.value):l.is(z.appendConfig)&&(t=null,i=bi(i).concat(l.value));let s;t?s=e.startState.values.slice():(t=Ar.resolve(i,r,this),s=new D(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=e.startState.facet(Ao)?e.newSelection:e.newSelection.asSingle();new D(t,e.newDoc,o,s,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:y.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),r=this.changes(i.changes),s=[i.range],o=bi(i.effects);for(let l=1;l<t.ranges.length;l++){let a=e(t.ranges[l]),h=this.changes(a.changes),c=h.map(r);for(let f=0;f<l;f++)s[f]=s[f].map(c);let O=r.mapDesc(h,!0);s.push(a.range.map(O)),r=r.compose(c),o=z.mapEffects(o,c).concat(z.mapEffects(bi(a.effects),O))}return{changes:r,selection:y.create(s,t.mainIndex),effects:o}}changes(e=[]){return e instanceof Oe?e:Oe.of(e,this.doc.length,this.facet(D.lineSeparator))}toText(e){return I.of(e.split(this.facet(D.lineSeparator)||To))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(rn(this,t),qr(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof ye&&this.config.address[r.id]!=null&&(t[i]=r.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(e,s)){let o=i[s],l=e[s];r.push(o.init(a=>o.spec.fromJSON(l,a)))}}return D.create({doc:e.doc,selection:y.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Ar.resolve(e.extensions||[],new Map),i=e.doc instanceof I?e.doc:I.of((e.doc||"").split(t.staticFacet(D.lineSeparator)||To)),r=e.selection?e.selection instanceof y?e.selection:y.single(e.selection.anchor,e.selection.head):y.single(0);return zO(r,i.length),t.staticFacet(Ao)||(r=r.asSingle()),new D(t,i,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(D.tabSize)}get lineBreak(){return this.facet(D.lineSeparator)||`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pneuma-mode-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pneuma-mode-C4v13scm.js","assets/manifest-D0B-XRFy.js","assets/pneuma-mode-_Ng_oSnc.js","assets/manifest-DGD2_XYa.js","assets/TerminalPanel-xx5i__-P.js","assets/TerminalPanel-6GBZ9nXN.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
var Cp=n=>{throw TypeError(n)};var Ep=(n,l,a)=>l.has(n)||Cp("Cannot "+a);var Ua=(n,l,a)=>(Ep(n,l,"read from private field"),a?a.call(n):l.get(n)),Tp=(n,l,a)=>l.has(n)?Cp("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,a),zp=(n,l,a,u)=>(Ep(n,l,"write to private field"),u?u.call(n,a):l.set(n,a),a);(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))u(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const f of o.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&u(f)}).observe(document,{childList:!0,subtree:!0});function a(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function u(s){if(s.ep)return;s.ep=!0;const o=a(s);fetch(s.href,o)}})();function ef(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var sc={exports:{}},Ha={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -92,4 +92,4 @@ Error generating stack: `+r.message+`
|
|
|
92
92
|
`+n}const f={type:"user_message",content:s};a!=null&&a.length&&(f.images=a),ir(f)}function Ig(n,l,a){de.getState().removePermission(n),ir({type:"permission_response",request_id:n,behavior:l,updated_input:a})}function XE(){ir({type:"interrupt"})}function QE(){const n=de(l=>l.pendingPermissions);return n.size===0?null:b.jsx("div",{className:"space-y-2 p-3",children:Array.from(n.values()).map(l=>b.jsxs("div",{className:"bg-amber-900/40 border border-amber-700/50 rounded-lg p-3",children:[b.jsxs("div",{className:"text-sm font-medium text-amber-200 mb-1",children:["Permission Request: ",l.tool_name]}),l.description&&b.jsx("div",{className:"text-xs text-amber-300/80 mb-2",children:l.description}),b.jsx("div",{className:"text-xs text-neutral-400 mb-2 font-mono max-h-32 overflow-y-auto bg-neutral-900/50 rounded p-2",children:JSON.stringify(l.input,null,2)}),b.jsxs("div",{className:"flex gap-2",children:[b.jsx("button",{onClick:()=>Ig(l.request_id,"allow"),className:"px-3 py-1 text-xs bg-green-700 hover:bg-green-600 text-white rounded transition-colors",children:"Allow"}),b.jsx("button",{onClick:()=>Ig(l.request_id,"deny"),className:"px-3 py-1 text-xs bg-red-700 hover:bg-red-600 text-white rounded transition-colors",children:"Deny"})]})]},l.request_id))})}const _y=[{id:"claude-opus-4-6",label:"Opus",icon:"O"},{id:"claude-sonnet-4-6",label:"Sonnet",icon:"S"},{id:"claude-haiku-4-5-20251001",label:"Haiku",icon:"H"}],Kc=_y[0];function FE(n){return n?n.toLowerCase().includes("opus")?{label:"Opus",icon:"O"}:n.toLowerCase().includes("sonnet")?{label:"Sonnet",icon:"S"}:n.toLowerCase().includes("haiku")?{label:"Haiku",icon:"H"}:{label:n.split("-").slice(0,2).join("-"),icon:"?"}:Kc}function ZE(){const n=de(o=>{var f;return((f=o.session)==null?void 0:f.model)??""}),[l,a]=le.useState(!1),u=le.useRef(null);le.useEffect(()=>{if(!l)return;const o=f=>{u.current&&!u.current.contains(f.target)&&a(!1)};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[l]);const s=FE(n);return b.jsxs("div",{ref:u,className:"relative",children:[b.jsxs("button",{onClick:()=>a(o=>!o),className:"flex items-center gap-1.5 px-2 py-1 text-xs text-neutral-400 hover:text-neutral-200 bg-neutral-800 hover:bg-neutral-700 rounded transition-colors",title:n||Kc.id,children:[b.jsx("span",{className:"w-4 h-4 rounded bg-neutral-700 flex items-center justify-center text-[10px] font-bold text-neutral-300",children:s.icon}),b.jsx("span",{children:s.label}),b.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3 h-3",children:b.jsx("path",{d:"M4 10l4-4 4 4"})})]}),l&&b.jsx("div",{className:"absolute bottom-full left-0 mb-1 bg-neutral-800 border border-neutral-700 rounded-md shadow-lg overflow-hidden z-50",children:_y.map(o=>{const f=n?n.toLowerCase().includes(o.label.toLowerCase()):o.id===Kc.id;return b.jsxs("button",{onClick:()=>{YE(o.id),a(!1)},className:`w-full flex items-center gap-2 px-3 py-1.5 text-xs text-left whitespace-nowrap transition-colors ${f?"bg-neutral-700 text-neutral-100":"text-neutral-400 hover:bg-neutral-750 hover:text-neutral-200"}`,children:[b.jsx("span",{className:"w-4 h-4 rounded bg-neutral-600 flex items-center justify-center text-[10px] font-bold text-neutral-200 shrink-0",children:o.icon}),b.jsx("span",{children:o.label})]},o.id)})})]})}function IE({items:n,selectedIndex:l,onSelect:a}){const u=le.useRef(null);return le.useEffect(()=>{var o;const s=(o=u.current)==null?void 0:o.children[l];s==null||s.scrollIntoView({block:"nearest"})},[l]),n.length===0?null:b.jsx("div",{ref:u,className:"absolute bottom-full left-0 mb-1 w-64 max-h-48 overflow-y-auto bg-neutral-800 border border-neutral-700 rounded-md shadow-lg z-50",children:n.map((s,o)=>b.jsxs("button",{onMouseDown:f=>{f.preventDefault(),a(s)},className:`w-full flex items-center gap-2 px-3 py-1.5 text-xs text-left transition-colors ${o===l?"bg-neutral-700 text-neutral-100":"text-neutral-400 hover:bg-neutral-750 hover:text-neutral-200"}`,children:[b.jsx("span",{className:"w-4 h-4 flex items-center justify-center text-neutral-500 shrink-0",children:s.kind==="skill"?b.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3 h-3",children:b.jsx("path",{d:"M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25z"})}):b.jsx("span",{className:"text-[11px] font-bold",children:"/"})}),b.jsxs("span",{className:"truncate",children:["/",s.name]})]},s.name))})}const Jg=[];function JE(n){const a={heading:`h${n.level||1}`,paragraph:"paragraph",list:"list",code:"code block",blockquote:"blockquote",image:"image",table:"table","text-range":"text"}[n.type]||n.type,u=n.content.length>60?n.content.slice(0,57)+"...":n.content;return`${a}: "${u}"`}let KE=0;function PE(n){return new Promise(l=>{if(!n.type.startsWith("image/")){l(null);return}const a=new FileReader;a.onload=()=>{const u=a.result,s=u.split(",")[1];l({id:`img-${Date.now()}-${++KE}`,media_type:n.type,data:s,preview:u})},a.onerror=()=>l(null),a.readAsDataURL(n)})}function $E(){const[n,l]=le.useState(""),[a,u]=le.useState([]),[s,o]=le.useState(!1),[f,h]=le.useState(""),[m,p]=le.useState(0),y=le.useRef(null),g=le.useRef(null),S=de(D=>D.cliConnected),v=de(D=>D.turnInProgress),C=de(D=>D.selection),j=de(D=>D.setSelection),M=de(D=>{var P;return((P=D.session)==null?void 0:P.slash_commands)??Jg}),A=de(D=>{var P;return((P=D.session)==null?void 0:P.skills)??Jg}),L=v,O=le.useMemo(()=>{const D=new Set(A);return M.map(P=>({name:P,kind:D.has(P)?"skill":"command"}))},[M,A]),Q=le.useMemo(()=>{if(!f)return O;const D=f.toLowerCase(),P=O.filter(ue=>ue.name.toLowerCase().includes(D));return P.sort((ue,E)=>{const z=ue.name.toLowerCase(),V=E.name.toLowerCase(),w=z===D;if(w!==(V===D))return w?-1:1;const he=z.startsWith(D),fe=V.startsWith(D);return he!==fe?he?-1:1:0}),P},[O,f]);le.useEffect(()=>{p(0)},[f]);const Z=le.useCallback(()=>{const D=n.trim();if(!D&&a.length===0)return;const P=a.length>0?a.map(ue=>({media_type:ue.media_type,data:ue.data})):void 0;VE(D,C,P),l(""),u([]),j(null),o(!1),y.current&&(y.current.style.height="auto"),de.getState().setTurnInProgress(!0)},[n,a,C,j]),B=D=>{if(s&&Q.length>0){if(D.key==="ArrowDown"){D.preventDefault(),p(P=>(P+1)%Q.length);return}if(D.key==="ArrowUp"){D.preventDefault(),p(P=>(P-1+Q.length)%Q.length);return}if(D.key==="Enter"||D.key==="Tab"){D.preventDefault(),W(Q[m]);return}if(D.key==="Escape"){D.preventDefault(),o(!1);return}}D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),Z())},W=D=>{var E;const P=n.lastIndexOf("/"),ue=P>0?n.slice(0,P):"";l(`${ue}/${D.name} `),o(!1),(E=y.current)==null||E.focus()},re=D=>{l(D);const P=D.lastIndexOf("/");if(P>=0&&(P===0||D[P-1]===" "||D[P-1]===`
|
|
93
93
|
`)){const ue=D.slice(P+1);ue.includes(" ")||ue.includes(`
|
|
94
94
|
`)?o(!1):(o(!0),h(ue))}else o(!1)},pe=()=>{const D=y.current;D&&(D.style.height="auto",D.style.height=`${Math.min(D.scrollHeight,200)}px`)},q=le.useCallback(async D=>{const P=Array.from(D),E=(await Promise.all(P.map(PE))).filter(z=>z!==null);E.length>0&&u(z=>[...z,...E])},[]),K=D=>{u(P=>P.filter(ue=>ue.id!==D))},$=le.useCallback(D=>{var E;const P=(E=D.clipboardData)==null?void 0:E.items;if(!P)return;const ue=[];for(const z of P)if(z.type.startsWith("image/")){const V=z.getAsFile();V&&ue.push(V)}ue.length>0&&(D.preventDefault(),q(ue))},[q]),ce=D=>{D.preventDefault(),D.dataTransfer.dropEffect="copy"},ie=le.useCallback(D=>{var ue;D.preventDefault();const P=(ue=D.dataTransfer)==null?void 0:ue.files;P!=null&&P.length&&q(P)},[q]),ee=()=>{var D;(D=g.current)==null||D.click()},R=D=>{var P;(P=D.target.files)!=null&&P.length&&(q(D.target.files),D.target.value="")};return b.jsxs("div",{className:"p-3 border-t border-neutral-800",children:[C&&b.jsx("div",{className:"flex items-center gap-2 mb-2 px-1",children:b.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-md bg-cc-primary/15 text-cc-primary text-xs max-w-full overflow-hidden",children:[b.jsx(WE,{}),b.jsx("span",{className:"truncate",children:JE(C)}),b.jsxs("span",{className:"shrink-0 text-cc-muted mx-0.5",children:["in ",C.file]}),b.jsx("button",{onClick:()=>j(null),className:"shrink-0 ml-0.5 hover:text-cc-fg transition-colors cursor-pointer",title:"Clear selection",children:b.jsx(Kg,{})})]})}),a.length>0&&b.jsx("div",{className:"flex items-center gap-2 mb-2 px-1 overflow-x-auto",children:a.map(D=>b.jsxs("div",{className:"relative shrink-0 group",children:[b.jsx("img",{src:D.preview,alt:"",className:"w-14 h-14 rounded-md object-cover border border-neutral-700"}),b.jsx("button",{onClick:()=>K(D.id),className:"absolute top-0.5 right-0.5 w-4 h-4 bg-neutral-700/80 hover:bg-red-600 rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",title:"Remove",children:b.jsx(Kg,{})})]},D.id))}),b.jsxs("div",{className:"relative",onDragOver:ce,onDrop:ie,children:[s&&Q.length>0&&b.jsx(IE,{items:Q,selectedIndex:m,onSelect:W}),b.jsx("textarea",{ref:y,value:n,onChange:D=>re(D.target.value),onKeyDown:B,onInput:pe,onPaste:$,placeholder:S?L?"Claude is working...":C?"Tell Claude what to change...":"Send a message... (paste images, type / for commands)":"Waiting for CLI connection...",disabled:!S||L,rows:1,className:"w-full bg-neutral-800 text-neutral-100 rounded-lg px-3 py-2 text-sm resize-none placeholder-neutral-500 focus:outline-none focus:ring-1 focus:ring-neutral-600 disabled:opacity-50"})]}),b.jsxs("div",{className:"flex items-center justify-between mt-2",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(ZE,{}),b.jsxs("button",{onClick:ee,className:"flex items-center gap-1 px-2 py-1 text-xs text-neutral-500 hover:text-neutral-300 bg-neutral-800 hover:bg-neutral-700 rounded transition-colors",title:"Attach image",children:[b.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5",children:b.jsx("path",{d:"M8 2a.75.75 0 01.75.75v4.5h4.5a.75.75 0 010 1.5h-4.5v4.5a.75.75 0 01-1.5 0v-4.5h-4.5a.75.75 0 010-1.5h4.5v-4.5A.75.75 0 018 2z"})}),b.jsx("span",{children:"Image"})]}),b.jsx("input",{ref:g,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:R})]}),b.jsx("div",{children:L?b.jsx("button",{onClick:XE,className:"px-4 py-1.5 bg-red-700 hover:bg-red-600 text-white text-xs rounded-lg transition-colors",children:"Stop"}):b.jsx("button",{onClick:Z,disabled:!n.trim()&&a.length===0||!S,className:"px-4 py-1.5 bg-blue-600 hover:bg-blue-500 text-white text-xs rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Send"})})]})]})}function WE(){return b.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3 h-3 shrink-0",children:b.jsx("path",{d:"M9.828 1.282a.75.75 0 011.06 0l3.83 3.83a.75.75 0 010 1.06l-3.17 3.17a.75.75 0 01-.254.166l-1.97.738.738-1.97a.75.75 0 01.166-.254l3.17-3.17-2.77-2.77-3.17 3.17a.75.75 0 01-.254.166l-1.97.738.738-1.97a.75.75 0 01.166-.254l3.17-3.17a.75.75 0 010-1.06zM1.5 14.5l4-4"})})}function Kg(){return b.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"w-3 h-3",children:b.jsx("path",{d:"M4 4l8 8M12 4l-8 8",strokeLinecap:"round"})})}function eT(){const n=de(o=>o.messages),l=de(o=>o.streaming),a=de(o=>o.activity),u=de(o=>o.cliConnected),s=le.useRef(null);return le.useEffect(()=>{var o;(o=s.current)==null||o.scrollIntoView({behavior:"smooth"})},[n.length,l,a]),b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3",children:[n.length===0&&!l&&!a&&b.jsx("div",{className:"text-cc-muted text-sm text-center mt-8",children:u?"Send a message to start editing":"Connecting to Claude..."}),n.map(o=>b.jsx(gE,{message:o},o.id)),l?b.jsx(NE,{}):a?b.jsx(ME,{}):null,b.jsx("div",{ref:s})]}),b.jsx(QE,{}),b.jsx($E,{})]})}class tT{diff(l,a,u={}){let s;typeof u=="function"?(s=u,u={}):"callback"in u&&(s=u.callback);const o=this.castInput(l,u),f=this.castInput(a,u),h=this.removeEmpty(this.tokenize(o,u)),m=this.removeEmpty(this.tokenize(f,u));return this.diffWithOptionsObj(h,m,u,s)}diffWithOptionsObj(l,a,u,s){var o;const f=L=>{if(L=this.postProcess(L,u),s){setTimeout(function(){s(L)},0);return}else return L},h=a.length,m=l.length;let p=1,y=h+m;u.maxEditLength!=null&&(y=Math.min(y,u.maxEditLength));const g=(o=u.timeout)!==null&&o!==void 0?o:1/0,S=Date.now()+g,v=[{oldPos:-1,lastComponent:void 0}];let C=this.extractCommon(v[0],a,l,0,u);if(v[0].oldPos+1>=m&&C+1>=h)return f(this.buildValues(v[0].lastComponent,a,l));let j=-1/0,M=1/0;const A=()=>{for(let L=Math.max(j,-p);L<=Math.min(M,p);L+=2){let O;const Q=v[L-1],Z=v[L+1];Q&&(v[L-1]=void 0);let B=!1;if(Z){const re=Z.oldPos-L;B=Z&&0<=re&&re<h}const W=Q&&Q.oldPos+1<m;if(!B&&!W){v[L]=void 0;continue}if(!W||B&&Q.oldPos<Z.oldPos?O=this.addToPath(Z,!0,!1,0,u):O=this.addToPath(Q,!1,!0,1,u),C=this.extractCommon(O,a,l,L,u),O.oldPos+1>=m&&C+1>=h)return f(this.buildValues(O.lastComponent,a,l))||!0;v[L]=O,O.oldPos+1>=m&&(M=Math.min(M,L-1)),C+1>=h&&(j=Math.max(j,L+1))}p++};if(s)(function L(){setTimeout(function(){if(p>y||Date.now()>S)return s(void 0);A()||L()},0)})();else for(;p<=y&&Date.now()<=S;){const L=A();if(L)return L}}addToPath(l,a,u,s,o){const f=l.lastComponent;return f&&!o.oneChangePerToken&&f.added===a&&f.removed===u?{oldPos:l.oldPos+s,lastComponent:{count:f.count+1,added:a,removed:u,previousComponent:f.previousComponent}}:{oldPos:l.oldPos+s,lastComponent:{count:1,added:a,removed:u,previousComponent:f}}}extractCommon(l,a,u,s,o){const f=a.length,h=u.length;let m=l.oldPos,p=m-s,y=0;for(;p+1<f&&m+1<h&&this.equals(u[m+1],a[p+1],o);)p++,m++,y++,o.oneChangePerToken&&(l.lastComponent={count:1,previousComponent:l.lastComponent,added:!1,removed:!1});return y&&!o.oneChangePerToken&&(l.lastComponent={count:y,previousComponent:l.lastComponent,added:!1,removed:!1}),l.oldPos=m,p}equals(l,a,u){return u.comparator?u.comparator(l,a):l===a||!!u.ignoreCase&&l.toLowerCase()===a.toLowerCase()}removeEmpty(l){const a=[];for(let u=0;u<l.length;u++)l[u]&&a.push(l[u]);return a}castInput(l,a){return l}tokenize(l,a){return Array.from(l)}join(l){return l.join("")}postProcess(l,a){return l}get useLongestToken(){return!1}buildValues(l,a,u){const s=[];let o;for(;l;)s.push(l),o=l.previousComponent,delete l.previousComponent,l=o;s.reverse();const f=s.length;let h=0,m=0,p=0;for(;h<f;h++){const y=s[h];if(y.removed)y.value=this.join(u.slice(p,p+y.count)),p+=y.count;else{if(!y.added&&this.useLongestToken){let g=a.slice(m,m+y.count);g=g.map(function(S,v){const C=u[p+v];return C.length>S.length?C:S}),y.value=this.join(g)}else y.value=this.join(a.slice(m,m+y.count));m+=y.count,y.added||(p+=y.count)}}return s}}function Pg(n,l){let a;for(a=0;a<n.length&&a<l.length;a++)if(n[a]!=l[a])return n.slice(0,a);return n.slice(0,a)}function $g(n,l){let a;if(!n||!l||n[n.length-1]!=l[l.length-1])return"";for(a=0;a<n.length&&a<l.length;a++)if(n[n.length-(a+1)]!=l[l.length-(a+1)])return n.slice(-a);return n.slice(-a)}function Pc(n,l,a){if(n.slice(0,l.length)!=l)throw Error(`string ${JSON.stringify(n)} doesn't start with prefix ${JSON.stringify(l)}; this is a bug`);return a+n.slice(l.length)}function $c(n,l,a){if(!l)return n+a;if(n.slice(-l.length)!=l)throw Error(`string ${JSON.stringify(n)} doesn't end with suffix ${JSON.stringify(l)}; this is a bug`);return n.slice(0,-l.length)+a}function Qa(n,l){return Pc(n,l,"")}function Du(n,l){return $c(n,l,"")}function Wg(n,l){return l.slice(0,nT(n,l))}function nT(n,l){let a=0;n.length>l.length&&(a=n.length-l.length);let u=l.length;n.length<l.length&&(u=n.length);const s=Array(u);let o=0;s[0]=0;for(let f=1;f<u;f++){for(l[f]==l[o]?s[f]=s[o]:s[f]=o;o>0&&l[f]!=l[o];)o=s[o];l[f]==l[o]&&o++}o=0;for(let f=a;f<n.length;f++){for(;o>0&&n[f]!=l[o];)o=s[o];n[f]==l[o]&&o++}return o}function Fa(n){let l;for(l=n.length-1;l>=0&&n[l].match(/\s/);l--);return n.substring(l+1)}function pl(n){const l=n.match(/^\s*/);return l?l[0]:""}const e0="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",lT=new RegExp(`[${e0}]+|\\s+|[^${e0}]`,"ug");class iT extends tT{equals(l,a,u){return u.ignoreCase&&(l=l.toLowerCase(),a=a.toLowerCase()),l.trim()===a.trim()}tokenize(l,a={}){let u;if(a.intlSegmenter){const f=a.intlSegmenter;if(f.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');u=[];for(const h of Array.from(f.segment(l))){const m=h.segment;u.length&&/\s/.test(u[u.length-1])&&/\s/.test(m)?u[u.length-1]+=m:u.push(m)}}else u=l.match(lT)||[];const s=[];let o=null;return u.forEach(f=>{/\s/.test(f)?o==null?s.push(f):s.push(s.pop()+f):o!=null&&/\s/.test(o)?s[s.length-1]==o?s.push(s.pop()+f):s.push(o+f):s.push(f),o=f}),s}join(l){return l.map((a,u)=>u==0?a:a.replace(/^\s+/,"")).join("")}postProcess(l,a){if(!l||a.oneChangePerToken)return l;let u=null,s=null,o=null;return l.forEach(f=>{f.added?s=f:f.removed?o=f:((s||o)&&t0(u,o,s,f),u=f,s=null,o=null)}),(s||o)&&t0(u,o,s,null),l}}const aT=new iT;function rT(n,l,a){return aT.diff(n,l,a)}function t0(n,l,a,u){if(l&&a){const s=pl(l.value),o=Fa(l.value),f=pl(a.value),h=Fa(a.value);if(n){const m=Pg(s,f);n.value=$c(n.value,f,m),l.value=Qa(l.value,m),a.value=Qa(a.value,m)}if(u){const m=$g(o,h);u.value=Pc(u.value,h,m),l.value=Du(l.value,m),a.value=Du(a.value,m)}}else if(a){if(n){const s=pl(a.value);a.value=a.value.substring(s.length)}if(u){const s=pl(u.value);u.value=u.value.substring(s.length)}}else if(n&&u){const s=pl(u.value),o=pl(l.value),f=Fa(l.value),h=Pg(s,o);l.value=Qa(l.value,h);const m=$g(Qa(s,h),f);l.value=Du(l.value,m),u.value=Pc(u.value,s,m),n.value=$c(n.value,s,s.slice(0,s.length-m.length))}else if(u){const s=pl(u.value),o=Fa(l.value),f=Wg(o,s);l.value=Du(l.value,f)}else if(n){const s=Fa(n.value),o=pl(l.value),f=Wg(s,o);l.value=Qa(l.value,f)}}function uT(n){const l=[];let a=0,u=0;for(const s of n.split(`
|
|
95
|
-
`)){if(s.startsWith("diff ")||s.startsWith("index ")||s.startsWith("---")||s.startsWith("+++"))continue;const o=s.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@(.*)?$/);if(o){a=parseInt(o[1],10),u=parseInt(o[2],10),l.push({type:"hunk-header",content:s});continue}s.startsWith("+")?l.push({type:"add",content:s.slice(1),newNum:u++}):s.startsWith("-")?l.push({type:"del",content:s.slice(1),oldNum:a++}):s.startsWith(" ")&&l.push({type:"context",content:s.slice(1),oldNum:a++,newNum:u++})}for(let s=0;s<l.length-1;s++)if(l[s].type==="del"&&l[s+1].type==="add"){const o=rT(l[s].content,l[s+1].content);l[s].wordHighlights=o.map(({value:f,added:h,removed:m})=>({value:f,added:h,removed:m})),l[s+1].wordHighlights=o.map(({value:f,added:h,removed:m})=>({value:f,added:h,removed:m}))}return l}function sT({line:n}){return n.wordHighlights?b.jsx("span",{children:n.wordHighlights.map((l,a)=>n.type==="del"?l.added?null:b.jsx("span",{className:l.removed?"bg-red-800/60 rounded-sm":"",children:l.value},a):n.type==="add"?l.removed?null:b.jsx("span",{className:l.added?"bg-green-800/60 rounded-sm":"",children:l.value},a):b.jsx("span",{children:l.value},a))}):b.jsx("span",{children:n.content||" "})}function oT({diff:n}){const l=le.useMemo(()=>uT(n),[n]);return n.trim()?n.includes("Binary files")&&n.includes("differ")?b.jsx("div",{className:"flex items-center justify-center h-full text-neutral-500 text-sm",children:"Binary file — diff not available"}):b.jsx("div",{className:"overflow-auto h-full font-mono text-xs leading-5",children:l.map((a,u)=>{if(a.type==="hunk-header")return b.jsx("div",{className:"px-3 py-1 bg-blue-900/20 text-blue-400 border-y border-neutral-800 select-none",children:a.content},u);const s=a.type==="add"?"bg-green-950/40":a.type==="del"?"bg-red-950/40":"",o=a.type==="add"?"text-green-300":a.type==="del"?"text-red-300":"text-neutral-400";return b.jsxs("div",{className:`flex ${s} hover:brightness-125`,children:[b.jsx("span",{className:"w-12 shrink-0 text-right pr-2 text-neutral-600 select-none border-r border-neutral-800",children:a.oldNum??""}),b.jsx("span",{className:"w-12 shrink-0 text-right pr-2 text-neutral-600 select-none border-r border-neutral-800",children:a.newNum??""}),b.jsx("span",{className:"w-5 shrink-0 text-center select-none text-neutral-600",children:a.type==="add"?"+":a.type==="del"?"-":" "}),b.jsx("span",{className:`flex-1 pr-4 whitespace-pre ${o}`,children:b.jsx(sT,{line:a})})]},u)})}):b.jsx("div",{className:"flex items-center justify-center h-full text-neutral-600 text-sm",children:"No changes"})}function n0(){return""}function cT(n){const l={A:"bg-green-700 text-green-100",M:"bg-amber-700 text-amber-100",D:"bg-red-700 text-red-100"};return b.jsx("span",{className:`text-[10px] font-bold px-1 rounded ${l[n]||"bg-neutral-700 text-neutral-300"}`,children:n})}function fT(){const n=de(g=>g.changedFilesTick),l=de(g=>g.diffBase),a=de(g=>g.setDiffBase),[u,s]=le.useState([]),[o,f]=le.useState(null),[h,m]=le.useState(""),[p,y]=le.useState(!1);return le.useEffect(()=>{const g=n0();fetch(`${g}/api/git/changed-files?base=${l}`).then(S=>S.json()).then(S=>{const v=S.files||[];s(v),v.length>0&&(!o||!v.some(C=>C.path===o))?f(v[0].path):v.length===0&&f(null)}).catch(()=>s([]))},[n,l]),le.useEffect(()=>{if(!o){m("");return}y(!0);const g=n0();fetch(`${g}/api/git/diff?path=${encodeURIComponent(o)}&base=${l}`).then(S=>S.json()).then(S=>m(S.diff||"")).catch(()=>m("")).finally(()=>y(!1))},[o,l,n]),b.jsxs("div",{className:"flex h-full",children:[b.jsxs("div",{className:"w-56 shrink-0 border-r border-neutral-800 flex flex-col",children:[b.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-neutral-800",children:[b.jsxs("span",{className:"text-xs font-medium text-neutral-400",children:["Changed Files (",u.length,")"]}),b.jsx("button",{onClick:()=>a(l==="last-commit"?"default-branch":"last-commit"),className:"text-[10px] px-1.5 py-0.5 rounded bg-neutral-800 text-neutral-400 hover:text-neutral-200",title:`Diff base: ${l}`,children:l==="last-commit"?"HEAD":"branch"})]}),b.jsx("div",{className:"flex-1 overflow-auto",children:u.length===0?b.jsx("div",{className:"px-3 py-8 text-center text-neutral-600 text-xs",children:"No changes"}):u.map(g=>b.jsxs("button",{onClick:()=>f(g.path),className:`w-full text-left px-3 py-1.5 flex items-center gap-2 text-xs hover:bg-neutral-800/50 ${o===g.path?"bg-neutral-800 text-neutral-100":"text-neutral-400"}`,children:[cT(g.status),b.jsx("span",{className:"truncate",children:g.path})]},g.path))})]}),b.jsx("div",{className:"flex-1 min-w-0",children:p?b.jsx("div",{className:"flex items-center justify-center h-full text-neutral-600 text-sm",children:"Loading..."}):o?b.jsx(oT,{diff:h}):b.jsx("div",{className:"flex items-center justify-center h-full text-neutral-600 text-sm",children:"Select a file to view diff"})})]})}function dT(){return""}function hT(n){const l=Math.floor(n/1e3);if(l<60)return`${l}s`;const a=Math.floor(l/60);return a<60?`${a}m ${l%60}s`:`${Math.floor(a/60)}h ${a%60}m`}function l0({proc:n,onKill:l}){const[a,u]=le.useState(Date.now()-n.startedAt);le.useEffect(()=>{if(n.status!=="running")return;const o=setInterval(()=>u(Date.now()-n.startedAt),1e3);return()=>clearInterval(o)},[n.status,n.startedAt]);const s={running:"text-amber-400",completed:"text-green-400",failed:"text-red-400",stopped:"text-neutral-500"};return b.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 hover:bg-neutral-800/30 text-xs",children:[b.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${n.status==="running"?"bg-amber-400 animate-pulse":n.status==="completed"?"bg-green-400":n.status==="failed"?"bg-red-400":"bg-neutral-600"}`}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("div",{className:"text-neutral-200 truncate",children:n.description||n.command}),b.jsx("div",{className:"text-neutral-500 truncate font-mono",children:n.command})]}),b.jsx("span",{className:`shrink-0 ${s[n.status]||"text-neutral-500"}`,children:n.status==="running"?hT(a):n.status}),n.status==="running"&&b.jsx("button",{onClick:l,className:"shrink-0 text-red-400 hover:text-red-300 px-1",children:"Kill"})]})}function mT({proc:n,onKill:l}){return b.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 hover:bg-neutral-800/30 text-xs",children:[b.jsx("span",{className:"w-2 h-2 rounded-full bg-green-400 shrink-0"}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("div",{className:"text-neutral-200 truncate",children:n.command}),b.jsx("div",{className:"text-neutral-500 truncate font-mono",children:n.fullCommand}),n.cwd&&b.jsx("div",{className:"text-neutral-600 truncate",children:n.cwd})]}),b.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[n.ports.map(a=>b.jsxs("a",{href:`http://localhost:${a}`,target:"_blank",rel:"noopener",className:"text-blue-400 hover:text-blue-300",children:[":",a]},a)),b.jsxs("span",{className:"text-neutral-600",children:["PID ",n.pid]}),b.jsx("button",{onClick:l,className:"text-red-400 hover:text-red-300 px-1",children:"Kill"})]})]})}function pT(){const n=de(g=>g.sessionProcesses),[l,a]=le.useState([]),[u,s]=le.useState(!1),o=dT(),f=()=>{s(!0),fetch(`${o}/api/processes/system`).then(g=>g.json()).then(g=>a(g.processes||[])).catch(()=>{}).finally(()=>s(!1))};le.useEffect(()=>{f();const g=setInterval(f,15e3);return()=>clearInterval(g)},[]);const h=g=>{fetch(`${o}/api/processes/${encodeURIComponent(g)}/kill`,{method:"POST"}).catch(()=>{}),setTimeout(()=>{de.getState().updateProcess(g,{status:"stopped",completedAt:Date.now()})},3e3)},m=g=>{fetch(`${o}/api/processes/system/${g}/kill`,{method:"POST"}).catch(()=>{}),setTimeout(()=>a(S=>S.filter(v=>v.pid!==g)),1e3)},p=n.filter(g=>g.status==="running"),y=n.filter(g=>g.status!=="running");return b.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[n.length>0&&b.jsxs("div",{className:"border-b border-neutral-800",children:[b.jsxs("div",{className:"px-3 py-2 text-xs font-medium text-neutral-400",children:["Background Jobs (",n.length,")"]}),p.map(g=>b.jsx(l0,{proc:g,onKill:()=>h(g.taskId)},g.taskId)),y.map(g=>b.jsx(l0,{proc:g,onKill:()=>{}},g.taskId))]}),b.jsxs("div",{children:[b.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[b.jsxs("span",{className:"text-xs font-medium text-neutral-400",children:["Dev Servers (",l.length,")"]}),b.jsx("button",{onClick:f,disabled:u,className:"text-[10px] px-1.5 py-0.5 rounded bg-neutral-800 text-neutral-400 hover:text-neutral-200",children:u?"Scanning...":"Scan"})]}),l.length===0?b.jsx("div",{className:"px-3 py-6 text-center text-neutral-600 text-xs",children:u?"Scanning for dev servers...":"No dev servers found"}):l.map(g=>b.jsx(mT,{proc:g,onKill:()=>m(g.pid)},g.pid))]})]})}function gT(){return""}function yT(){const n=de(l=>l.session);return n?b.jsxs("section",{className:"space-y-2",children:[b.jsx("h3",{className:"text-xs font-semibold text-neutral-400 uppercase tracking-wider",children:"Session"}),b.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1.5 text-xs",children:[b.jsx("span",{className:"text-neutral-500",children:"Model"}),b.jsx("span",{className:"text-neutral-200 truncate",children:n.model||"—"}),b.jsx("span",{className:"text-neutral-500",children:"Version"}),b.jsx("span",{className:"text-neutral-200 truncate",children:n.claude_code_version||"—"}),b.jsx("span",{className:"text-neutral-500",children:"Working dir"}),b.jsx("span",{className:"text-neutral-200 truncate",title:n.cwd,children:n.cwd||"—"}),b.jsx("span",{className:"text-neutral-500",children:"Cost"}),b.jsxs("span",{className:"text-neutral-200",children:["$",n.total_cost_usd.toFixed(4)]}),b.jsx("span",{className:"text-neutral-500",children:"Turns"}),b.jsx("span",{className:"text-neutral-200",children:n.num_turns}),b.jsx("span",{className:"text-neutral-500",children:"Lines"}),b.jsxs("span",{className:"text-neutral-200",children:[b.jsxs("span",{className:"text-green-400",children:["+",n.total_lines_added]})," / ",b.jsxs("span",{className:"text-red-400",children:["-",n.total_lines_removed]})]})]})]}):null}function xT({status:n}){switch(n){case"completed":return b.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5 text-green-400 shrink-0",children:b.jsx("path",{fillRule:"evenodd",d:"M8 16A8 8 0 108 0a8 8 0 000 16zm3.78-9.72a.75.75 0 00-1.06-1.06L7 8.94 5.28 7.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.06 0l4.25-4.25z",clipRule:"evenodd"})});case"in_progress":return b.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",className:"w-3.5 h-3.5 text-blue-400 shrink-0 animate-spin",children:b.jsx("circle",{cx:"8",cy:"8",r:"6",strokeWidth:"1.5",strokeDasharray:"28 10"})});default:return b.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",className:"w-3.5 h-3.5 text-neutral-500 shrink-0",children:b.jsx("circle",{cx:"8",cy:"8",r:"6",strokeWidth:"1.5"})})}}function bT(){const n=de(a=>a.tasks),l=n.filter(a=>a.status==="completed").length;return b.jsxs("section",{className:"space-y-2",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("h3",{className:"text-xs font-semibold text-neutral-400 uppercase tracking-wider",children:"Tasks"}),n.length>0&&b.jsxs("span",{className:"text-[10px] text-neutral-500 bg-neutral-800 px-1.5 py-0.5 rounded-full",children:[l,"/",n.length]})]}),n.length===0?b.jsx("p",{className:"text-xs text-neutral-600",children:"No tasks yet"}):b.jsx("ul",{className:"space-y-1.5",children:n.map(a=>b.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[b.jsx("div",{className:"mt-0.5",children:b.jsx(xT,{status:a.status})}),b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsx("span",{className:a.status==="completed"?"text-neutral-500 line-through":"text-neutral-200",children:a.status==="in_progress"&&a.activeForm?b.jsx("span",{className:"italic",children:a.activeForm}):a.subject}),a.blockedBy&&a.blockedBy.length>0&&a.status!=="completed"&&b.jsx("span",{className:"ml-1.5 text-[10px] text-amber-500",children:"blocked"})]})]},a.id))})]})}function vT(n){switch(n){case"connected":return"bg-green-400";case"connecting":return"bg-amber-400";case"error":case"disconnected":return"bg-red-400";default:return"bg-neutral-500"}}function ST(){const n=de(l=>{var a;return(a=l.session)==null?void 0:a.mcp_servers});return n!=null&&n.length?b.jsxs("section",{className:"space-y-2",children:[b.jsx("h3",{className:"text-xs font-semibold text-neutral-400 uppercase tracking-wider",children:"MCP Servers"}),b.jsx("ul",{className:"space-y-1",children:n.map(l=>b.jsxs("li",{className:"flex items-center gap-2 text-xs",children:[b.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${vT(l.status)}`}),b.jsx("span",{className:"text-neutral-200 truncate",children:l.name}),b.jsx("span",{className:"text-neutral-600 ml-auto shrink-0",children:l.status})]},l.name))})]}):null}function kT(){const n=de(o=>{var f;return(f=o.session)==null?void 0:f.tools}),[l,a]=le.useState(!1);if(!(n!=null&&n.length))return null;const u=l?n:n.slice(0,8),s=n.length>8;return b.jsxs("section",{className:"space-y-2",children:[b.jsxs("button",{onClick:()=>a(o=>!o),className:"flex items-center gap-1 text-xs font-semibold text-neutral-400 uppercase tracking-wider hover:text-neutral-300 transition-colors",children:[b.jsxs("span",{children:["Tools (",n.length,")"]}),b.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:`w-3 h-3 transition-transform ${l?"rotate-90":""}`,children:b.jsx("path",{d:"M6 4l4 4-4 4"})})]}),b.jsx("ul",{className:"space-y-0.5",children:u.map(o=>b.jsx("li",{className:"text-xs text-neutral-400 truncate pl-1",children:o},o))}),s&&!l&&b.jsxs("button",{onClick:()=>a(!0),className:"text-xs text-neutral-600 hover:text-neutral-400 transition-colors",children:["+",n.length-8," more..."]})]})}function wT(){const n=de(u=>u.gitAvailable),[l,a]=le.useState(null);return le.useEffect(()=>{n!==!1&&fetch(`${gT()}/api/git/info`).then(u=>u.json()).then(a).catch(()=>{})},[n]),l!=null&&l.branch?b.jsxs("section",{className:"space-y-2",children:[b.jsx("h3",{className:"text-xs font-semibold text-neutral-400 uppercase tracking-wider",children:"Git"}),b.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[b.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5 text-neutral-500 shrink-0",children:b.jsx("path",{d:"M11.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122V6A2.5 2.5 0 0110 8.5H6a1 1 0 00-1 1v1.128a2.251 2.251 0 11-1.5 0V5.372a2.25 2.25 0 111.5 0v1.836A2.492 2.492 0 016 7h4a1 1 0 001-1v-.628A2.25 2.25 0 019.5 3.25zM4.25 12a.75.75 0 100 1.5.75.75 0 000-1.5zM3.5 3.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0z"})}),b.jsx("span",{className:"text-neutral-200 font-mono",children:l.branch}),(l.ahead>0||l.behind>0)&&b.jsxs("span",{className:"text-neutral-500",children:[l.ahead>0&&b.jsxs("span",{className:"text-green-400",children:["↑",l.ahead]}),l.ahead>0&&l.behind>0&&" ",l.behind>0&&b.jsxs("span",{className:"text-red-400",children:["↓",l.behind]})]})]})]}):null}function CT(){return de(l=>l.session)?b.jsxs("div",{className:"flex flex-col h-full overflow-y-auto p-4 space-y-5",children:[b.jsx(yT,{}),b.jsx("div",{className:"border-t border-neutral-800"}),b.jsx(bT,{}),b.jsx("div",{className:"border-t border-neutral-800"}),b.jsx(ST,{}),b.jsx("div",{className:"border-t border-neutral-800"}),b.jsx(kT,{}),b.jsx("div",{className:"border-t border-neutral-800"}),b.jsx(wT,{})]}):b.jsx("div",{className:"flex items-center justify-center h-full text-neutral-600 text-sm",children:"No active session"})}const i0={doc:{type:"builtin",manifestLoader:()=>Li(()=>import("./manifest-D0B-XRFy.js"),[]).then(n=>n.default),definitionLoader:()=>Li(()=>import("./pneuma-mode-CmSXfDwj.js"),__vite__mapDeps([0,1])).then(n=>n.default)},slide:{type:"builtin",manifestLoader:()=>Li(()=>import("./manifest-DGD2_XYa.js"),[]).then(n=>n.default),definitionLoader:()=>Li(()=>import("./pneuma-mode-BIw7BkAp.js"),__vite__mapDeps([2,3])).then(n=>n.default)}};async function ET(n){const l=TT(n);return await zT(l),AT(l)}function TT(n){const l=i0[n];if(!l){const a=Object.keys(i0).join(", ");throw new Error(`Unknown mode: "${n}". Available: ${a}`)}return l}async function zT(n){n.type}async function AT(n){if(n.type==="builtin")return n.definitionLoader();throw new Error("Non-builtin mode loading not yet implemented")}const jT=le.lazy(()=>Li(()=>import("./EditorPanel-B2BEFeeL.js"),[])),NT=le.lazy(()=>Li(()=>import("./TerminalPanel-BrgYO1B8.js"),__vite__mapDeps([4,5])));function Wc(){return b.jsx("div",{className:"flex items-center justify-center h-full text-neutral-600 text-sm",children:"Loading..."})}function _T(){const n=de(u=>u.activeTab),[l,a]=le.useState(!1);return le.useEffect(()=>{n==="terminal"&&a(!0)},[n]),b.jsxs("div",{className:"flex flex-col h-full",children:[n==="chat"&&b.jsx(eT,{}),n==="editor"&&b.jsx(le.Suspense,{fallback:b.jsx(Wc,{}),children:b.jsx(jT,{})}),n==="diff"&&b.jsx(fT,{}),l&&b.jsx(le.Suspense,{fallback:n==="terminal"?b.jsx(Wc,{}):null,children:b.jsx("div",{className:n==="terminal"?"flex flex-col h-full":"hidden",children:b.jsx(NT,{})})}),n==="processes"&&b.jsx(pT,{}),n==="context"&&b.jsx(CT,{})]})}function DT(){const n=de(h=>h.files),l=de(h=>h.selection),a=de(h=>h.setSelection),u=de(h=>h.previewMode),s=de(h=>h.imageTick),o=de(h=>h.initParams),f=de(h=>h.setActiveFile);return{files:n.map(h=>({path:h.path,content:h.content})),selection:l?{type:l.type,content:l.content,level:l.level}:null,onSelect:h=>{var p;if(!h){a(null);return}const m=h.file||((p=n[0])==null?void 0:p.path)||"";a({type:h.type,content:h.content,level:h.level,file:m})},mode:u,imageVersion:s,initParams:o,onActiveFileChange:f}}function Mu(){return""}function MT(){const n=de(a=>{var u;return(u=a.modeViewer)==null?void 0:u.PreviewComponent});le.useEffect(()=>{const a=new URLSearchParams(location.search),u=a.get("session"),s=a.get("mode")||"doc";ET(s).then(o=>{de.getState().setModeViewer(o.viewer)}).catch(o=>{console.error(`[app] Failed to load mode "${s}":`,o)}),u?Lu(u):fetch(`${Mu()}/api/session`).then(o=>o.json()).then(o=>{Lu(o.sessionId||"default")}).catch(()=>Lu("default")),fetch(`${Mu()}/api/files`).then(o=>o.json()).then(o=>{var f;(f=o.files)!=null&&f.length&&de.getState().setFiles(o.files)}).catch(()=>{}),fetch(`${Mu()}/api/config`).then(o=>o.json()).then(o=>{o.initParams&&de.getState().setInitParams(o.initParams)}).catch(()=>{}),fetch(`${Mu()}/api/git/available`).then(o=>o.json()).then(o=>de.getState().setGitAvailable(o.available)).catch(()=>de.getState().setGitAvailable(!1))},[]);const l=DT();return b.jsxs("div",{className:"flex flex-col h-screen bg-neutral-950 text-neutral-100",children:[b.jsx(Qb,{}),b.jsxs(x0,{orientation:"horizontal",className:"flex-1",children:[b.jsx(Bc,{defaultSize:55,minSize:30,children:n?b.jsx(n,{...l}):b.jsx(Wc,{})}),b.jsx(b0,{className:"w-1 bg-neutral-800 hover:bg-neutral-700 transition-colors"}),b.jsx(Bc,{defaultSize:45,minSize:25,children:b.jsx(_T,{})})]})]})}tb.createRoot(document.getElementById("root")).render(b.jsx(le.StrictMode,{children:b.jsx(MT,{})}));export{ty as M,Cu as R,LT as a,Fb as b,sv as c,ff as d,z0 as e,iv as f,Hu as g,uv as h,Ey as i,b as j,$1 as k,Uc as n,RT as o,BT as p,le as r,cf as s,de as u,kf as v};
|
|
95
|
+
`)){if(s.startsWith("diff ")||s.startsWith("index ")||s.startsWith("---")||s.startsWith("+++"))continue;const o=s.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@(.*)?$/);if(o){a=parseInt(o[1],10),u=parseInt(o[2],10),l.push({type:"hunk-header",content:s});continue}s.startsWith("+")?l.push({type:"add",content:s.slice(1),newNum:u++}):s.startsWith("-")?l.push({type:"del",content:s.slice(1),oldNum:a++}):s.startsWith(" ")&&l.push({type:"context",content:s.slice(1),oldNum:a++,newNum:u++})}for(let s=0;s<l.length-1;s++)if(l[s].type==="del"&&l[s+1].type==="add"){const o=rT(l[s].content,l[s+1].content);l[s].wordHighlights=o.map(({value:f,added:h,removed:m})=>({value:f,added:h,removed:m})),l[s+1].wordHighlights=o.map(({value:f,added:h,removed:m})=>({value:f,added:h,removed:m}))}return l}function sT({line:n}){return n.wordHighlights?b.jsx("span",{children:n.wordHighlights.map((l,a)=>n.type==="del"?l.added?null:b.jsx("span",{className:l.removed?"bg-red-800/60 rounded-sm":"",children:l.value},a):n.type==="add"?l.removed?null:b.jsx("span",{className:l.added?"bg-green-800/60 rounded-sm":"",children:l.value},a):b.jsx("span",{children:l.value},a))}):b.jsx("span",{children:n.content||" "})}function oT({diff:n}){const l=le.useMemo(()=>uT(n),[n]);return n.trim()?n.includes("Binary files")&&n.includes("differ")?b.jsx("div",{className:"flex items-center justify-center h-full text-neutral-500 text-sm",children:"Binary file — diff not available"}):b.jsx("div",{className:"overflow-auto h-full font-mono text-xs leading-5",children:l.map((a,u)=>{if(a.type==="hunk-header")return b.jsx("div",{className:"px-3 py-1 bg-blue-900/20 text-blue-400 border-y border-neutral-800 select-none",children:a.content},u);const s=a.type==="add"?"bg-green-950/40":a.type==="del"?"bg-red-950/40":"",o=a.type==="add"?"text-green-300":a.type==="del"?"text-red-300":"text-neutral-400";return b.jsxs("div",{className:`flex ${s} hover:brightness-125`,children:[b.jsx("span",{className:"w-12 shrink-0 text-right pr-2 text-neutral-600 select-none border-r border-neutral-800",children:a.oldNum??""}),b.jsx("span",{className:"w-12 shrink-0 text-right pr-2 text-neutral-600 select-none border-r border-neutral-800",children:a.newNum??""}),b.jsx("span",{className:"w-5 shrink-0 text-center select-none text-neutral-600",children:a.type==="add"?"+":a.type==="del"?"-":" "}),b.jsx("span",{className:`flex-1 pr-4 whitespace-pre ${o}`,children:b.jsx(sT,{line:a})})]},u)})}):b.jsx("div",{className:"flex items-center justify-center h-full text-neutral-600 text-sm",children:"No changes"})}function n0(){return""}function cT(n){const l={A:"bg-green-700 text-green-100",M:"bg-amber-700 text-amber-100",D:"bg-red-700 text-red-100"};return b.jsx("span",{className:`text-[10px] font-bold px-1 rounded ${l[n]||"bg-neutral-700 text-neutral-300"}`,children:n})}function fT(){const n=de(g=>g.changedFilesTick),l=de(g=>g.diffBase),a=de(g=>g.setDiffBase),[u,s]=le.useState([]),[o,f]=le.useState(null),[h,m]=le.useState(""),[p,y]=le.useState(!1);return le.useEffect(()=>{const g=n0();fetch(`${g}/api/git/changed-files?base=${l}`).then(S=>S.json()).then(S=>{const v=S.files||[];s(v),v.length>0&&(!o||!v.some(C=>C.path===o))?f(v[0].path):v.length===0&&f(null)}).catch(()=>s([]))},[n,l]),le.useEffect(()=>{if(!o){m("");return}y(!0);const g=n0();fetch(`${g}/api/git/diff?path=${encodeURIComponent(o)}&base=${l}`).then(S=>S.json()).then(S=>m(S.diff||"")).catch(()=>m("")).finally(()=>y(!1))},[o,l,n]),b.jsxs("div",{className:"flex h-full",children:[b.jsxs("div",{className:"w-56 shrink-0 border-r border-neutral-800 flex flex-col",children:[b.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-neutral-800",children:[b.jsxs("span",{className:"text-xs font-medium text-neutral-400",children:["Changed Files (",u.length,")"]}),b.jsx("button",{onClick:()=>a(l==="last-commit"?"default-branch":"last-commit"),className:"text-[10px] px-1.5 py-0.5 rounded bg-neutral-800 text-neutral-400 hover:text-neutral-200",title:`Diff base: ${l}`,children:l==="last-commit"?"HEAD":"branch"})]}),b.jsx("div",{className:"flex-1 overflow-auto",children:u.length===0?b.jsx("div",{className:"px-3 py-8 text-center text-neutral-600 text-xs",children:"No changes"}):u.map(g=>b.jsxs("button",{onClick:()=>f(g.path),className:`w-full text-left px-3 py-1.5 flex items-center gap-2 text-xs hover:bg-neutral-800/50 ${o===g.path?"bg-neutral-800 text-neutral-100":"text-neutral-400"}`,children:[cT(g.status),b.jsx("span",{className:"truncate",children:g.path})]},g.path))})]}),b.jsx("div",{className:"flex-1 min-w-0",children:p?b.jsx("div",{className:"flex items-center justify-center h-full text-neutral-600 text-sm",children:"Loading..."}):o?b.jsx(oT,{diff:h}):b.jsx("div",{className:"flex items-center justify-center h-full text-neutral-600 text-sm",children:"Select a file to view diff"})})]})}function dT(){return""}function hT(n){const l=Math.floor(n/1e3);if(l<60)return`${l}s`;const a=Math.floor(l/60);return a<60?`${a}m ${l%60}s`:`${Math.floor(a/60)}h ${a%60}m`}function l0({proc:n,onKill:l}){const[a,u]=le.useState(Date.now()-n.startedAt);le.useEffect(()=>{if(n.status!=="running")return;const o=setInterval(()=>u(Date.now()-n.startedAt),1e3);return()=>clearInterval(o)},[n.status,n.startedAt]);const s={running:"text-amber-400",completed:"text-green-400",failed:"text-red-400",stopped:"text-neutral-500"};return b.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 hover:bg-neutral-800/30 text-xs",children:[b.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${n.status==="running"?"bg-amber-400 animate-pulse":n.status==="completed"?"bg-green-400":n.status==="failed"?"bg-red-400":"bg-neutral-600"}`}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("div",{className:"text-neutral-200 truncate",children:n.description||n.command}),b.jsx("div",{className:"text-neutral-500 truncate font-mono",children:n.command})]}),b.jsx("span",{className:`shrink-0 ${s[n.status]||"text-neutral-500"}`,children:n.status==="running"?hT(a):n.status}),n.status==="running"&&b.jsx("button",{onClick:l,className:"shrink-0 text-red-400 hover:text-red-300 px-1",children:"Kill"})]})}function mT({proc:n,onKill:l}){return b.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 hover:bg-neutral-800/30 text-xs",children:[b.jsx("span",{className:"w-2 h-2 rounded-full bg-green-400 shrink-0"}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("div",{className:"text-neutral-200 truncate",children:n.command}),b.jsx("div",{className:"text-neutral-500 truncate font-mono",children:n.fullCommand}),n.cwd&&b.jsx("div",{className:"text-neutral-600 truncate",children:n.cwd})]}),b.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[n.ports.map(a=>b.jsxs("a",{href:`http://localhost:${a}`,target:"_blank",rel:"noopener",className:"text-blue-400 hover:text-blue-300",children:[":",a]},a)),b.jsxs("span",{className:"text-neutral-600",children:["PID ",n.pid]}),b.jsx("button",{onClick:l,className:"text-red-400 hover:text-red-300 px-1",children:"Kill"})]})]})}function pT(){const n=de(g=>g.sessionProcesses),[l,a]=le.useState([]),[u,s]=le.useState(!1),o=dT(),f=()=>{s(!0),fetch(`${o}/api/processes/system`).then(g=>g.json()).then(g=>a(g.processes||[])).catch(()=>{}).finally(()=>s(!1))};le.useEffect(()=>{f();const g=setInterval(f,15e3);return()=>clearInterval(g)},[]);const h=g=>{fetch(`${o}/api/processes/${encodeURIComponent(g)}/kill`,{method:"POST"}).catch(()=>{}),setTimeout(()=>{de.getState().updateProcess(g,{status:"stopped",completedAt:Date.now()})},3e3)},m=g=>{fetch(`${o}/api/processes/system/${g}/kill`,{method:"POST"}).catch(()=>{}),setTimeout(()=>a(S=>S.filter(v=>v.pid!==g)),1e3)},p=n.filter(g=>g.status==="running"),y=n.filter(g=>g.status!=="running");return b.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[n.length>0&&b.jsxs("div",{className:"border-b border-neutral-800",children:[b.jsxs("div",{className:"px-3 py-2 text-xs font-medium text-neutral-400",children:["Background Jobs (",n.length,")"]}),p.map(g=>b.jsx(l0,{proc:g,onKill:()=>h(g.taskId)},g.taskId)),y.map(g=>b.jsx(l0,{proc:g,onKill:()=>{}},g.taskId))]}),b.jsxs("div",{children:[b.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[b.jsxs("span",{className:"text-xs font-medium text-neutral-400",children:["Dev Servers (",l.length,")"]}),b.jsx("button",{onClick:f,disabled:u,className:"text-[10px] px-1.5 py-0.5 rounded bg-neutral-800 text-neutral-400 hover:text-neutral-200",children:u?"Scanning...":"Scan"})]}),l.length===0?b.jsx("div",{className:"px-3 py-6 text-center text-neutral-600 text-xs",children:u?"Scanning for dev servers...":"No dev servers found"}):l.map(g=>b.jsx(mT,{proc:g,onKill:()=>m(g.pid)},g.pid))]})]})}function gT(){return""}function yT(){const n=de(l=>l.session);return n?b.jsxs("section",{className:"space-y-2",children:[b.jsx("h3",{className:"text-xs font-semibold text-neutral-400 uppercase tracking-wider",children:"Session"}),b.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1.5 text-xs",children:[b.jsx("span",{className:"text-neutral-500",children:"Model"}),b.jsx("span",{className:"text-neutral-200 truncate",children:n.model||"—"}),b.jsx("span",{className:"text-neutral-500",children:"Version"}),b.jsx("span",{className:"text-neutral-200 truncate",children:n.claude_code_version||"—"}),b.jsx("span",{className:"text-neutral-500",children:"Working dir"}),b.jsx("span",{className:"text-neutral-200 truncate",title:n.cwd,children:n.cwd||"—"}),b.jsx("span",{className:"text-neutral-500",children:"Cost"}),b.jsxs("span",{className:"text-neutral-200",children:["$",n.total_cost_usd.toFixed(4)]}),b.jsx("span",{className:"text-neutral-500",children:"Turns"}),b.jsx("span",{className:"text-neutral-200",children:n.num_turns}),b.jsx("span",{className:"text-neutral-500",children:"Lines"}),b.jsxs("span",{className:"text-neutral-200",children:[b.jsxs("span",{className:"text-green-400",children:["+",n.total_lines_added]})," / ",b.jsxs("span",{className:"text-red-400",children:["-",n.total_lines_removed]})]})]})]}):null}function xT({status:n}){switch(n){case"completed":return b.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5 text-green-400 shrink-0",children:b.jsx("path",{fillRule:"evenodd",d:"M8 16A8 8 0 108 0a8 8 0 000 16zm3.78-9.72a.75.75 0 00-1.06-1.06L7 8.94 5.28 7.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.06 0l4.25-4.25z",clipRule:"evenodd"})});case"in_progress":return b.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",className:"w-3.5 h-3.5 text-blue-400 shrink-0 animate-spin",children:b.jsx("circle",{cx:"8",cy:"8",r:"6",strokeWidth:"1.5",strokeDasharray:"28 10"})});default:return b.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",className:"w-3.5 h-3.5 text-neutral-500 shrink-0",children:b.jsx("circle",{cx:"8",cy:"8",r:"6",strokeWidth:"1.5"})})}}function bT(){const n=de(a=>a.tasks),l=n.filter(a=>a.status==="completed").length;return b.jsxs("section",{className:"space-y-2",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("h3",{className:"text-xs font-semibold text-neutral-400 uppercase tracking-wider",children:"Tasks"}),n.length>0&&b.jsxs("span",{className:"text-[10px] text-neutral-500 bg-neutral-800 px-1.5 py-0.5 rounded-full",children:[l,"/",n.length]})]}),n.length===0?b.jsx("p",{className:"text-xs text-neutral-600",children:"No tasks yet"}):b.jsx("ul",{className:"space-y-1.5",children:n.map(a=>b.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[b.jsx("div",{className:"mt-0.5",children:b.jsx(xT,{status:a.status})}),b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsx("span",{className:a.status==="completed"?"text-neutral-500 line-through":"text-neutral-200",children:a.status==="in_progress"&&a.activeForm?b.jsx("span",{className:"italic",children:a.activeForm}):a.subject}),a.blockedBy&&a.blockedBy.length>0&&a.status!=="completed"&&b.jsx("span",{className:"ml-1.5 text-[10px] text-amber-500",children:"blocked"})]})]},a.id))})]})}function vT(n){switch(n){case"connected":return"bg-green-400";case"connecting":return"bg-amber-400";case"error":case"disconnected":return"bg-red-400";default:return"bg-neutral-500"}}function ST(){const n=de(l=>{var a;return(a=l.session)==null?void 0:a.mcp_servers});return n!=null&&n.length?b.jsxs("section",{className:"space-y-2",children:[b.jsx("h3",{className:"text-xs font-semibold text-neutral-400 uppercase tracking-wider",children:"MCP Servers"}),b.jsx("ul",{className:"space-y-1",children:n.map(l=>b.jsxs("li",{className:"flex items-center gap-2 text-xs",children:[b.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${vT(l.status)}`}),b.jsx("span",{className:"text-neutral-200 truncate",children:l.name}),b.jsx("span",{className:"text-neutral-600 ml-auto shrink-0",children:l.status})]},l.name))})]}):null}function kT(){const n=de(o=>{var f;return(f=o.session)==null?void 0:f.tools}),[l,a]=le.useState(!1);if(!(n!=null&&n.length))return null;const u=l?n:n.slice(0,8),s=n.length>8;return b.jsxs("section",{className:"space-y-2",children:[b.jsxs("button",{onClick:()=>a(o=>!o),className:"flex items-center gap-1 text-xs font-semibold text-neutral-400 uppercase tracking-wider hover:text-neutral-300 transition-colors",children:[b.jsxs("span",{children:["Tools (",n.length,")"]}),b.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:`w-3 h-3 transition-transform ${l?"rotate-90":""}`,children:b.jsx("path",{d:"M6 4l4 4-4 4"})})]}),b.jsx("ul",{className:"space-y-0.5",children:u.map(o=>b.jsx("li",{className:"text-xs text-neutral-400 truncate pl-1",children:o},o))}),s&&!l&&b.jsxs("button",{onClick:()=>a(!0),className:"text-xs text-neutral-600 hover:text-neutral-400 transition-colors",children:["+",n.length-8," more..."]})]})}function wT(){const n=de(u=>u.gitAvailable),[l,a]=le.useState(null);return le.useEffect(()=>{n!==!1&&fetch(`${gT()}/api/git/info`).then(u=>u.json()).then(a).catch(()=>{})},[n]),l!=null&&l.branch?b.jsxs("section",{className:"space-y-2",children:[b.jsx("h3",{className:"text-xs font-semibold text-neutral-400 uppercase tracking-wider",children:"Git"}),b.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[b.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5 text-neutral-500 shrink-0",children:b.jsx("path",{d:"M11.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122V6A2.5 2.5 0 0110 8.5H6a1 1 0 00-1 1v1.128a2.251 2.251 0 11-1.5 0V5.372a2.25 2.25 0 111.5 0v1.836A2.492 2.492 0 016 7h4a1 1 0 001-1v-.628A2.25 2.25 0 019.5 3.25zM4.25 12a.75.75 0 100 1.5.75.75 0 000-1.5zM3.5 3.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0z"})}),b.jsx("span",{className:"text-neutral-200 font-mono",children:l.branch}),(l.ahead>0||l.behind>0)&&b.jsxs("span",{className:"text-neutral-500",children:[l.ahead>0&&b.jsxs("span",{className:"text-green-400",children:["↑",l.ahead]}),l.ahead>0&&l.behind>0&&" ",l.behind>0&&b.jsxs("span",{className:"text-red-400",children:["↓",l.behind]})]})]})]}):null}function CT(){return de(l=>l.session)?b.jsxs("div",{className:"flex flex-col h-full overflow-y-auto p-4 space-y-5",children:[b.jsx(yT,{}),b.jsx("div",{className:"border-t border-neutral-800"}),b.jsx(bT,{}),b.jsx("div",{className:"border-t border-neutral-800"}),b.jsx(ST,{}),b.jsx("div",{className:"border-t border-neutral-800"}),b.jsx(kT,{}),b.jsx("div",{className:"border-t border-neutral-800"}),b.jsx(wT,{})]}):b.jsx("div",{className:"flex items-center justify-center h-full text-neutral-600 text-sm",children:"No active session"})}const i0={doc:{type:"builtin",manifestLoader:()=>Li(()=>import("./manifest-D0B-XRFy.js"),[]).then(n=>n.default),definitionLoader:()=>Li(()=>import("./pneuma-mode-C4v13scm.js"),__vite__mapDeps([0,1])).then(n=>n.default)},slide:{type:"builtin",manifestLoader:()=>Li(()=>import("./manifest-DGD2_XYa.js"),[]).then(n=>n.default),definitionLoader:()=>Li(()=>import("./pneuma-mode-_Ng_oSnc.js"),__vite__mapDeps([2,3])).then(n=>n.default)}};async function ET(n){const l=TT(n);return await zT(l),AT(l)}function TT(n){const l=i0[n];if(!l){const a=Object.keys(i0).join(", ");throw new Error(`Unknown mode: "${n}". Available: ${a}`)}return l}async function zT(n){n.type}async function AT(n){if(n.type==="builtin")return n.definitionLoader();throw new Error("Non-builtin mode loading not yet implemented")}const jT=le.lazy(()=>Li(()=>import("./EditorPanel-JzFuk3WG.js"),[])),NT=le.lazy(()=>Li(()=>import("./TerminalPanel-xx5i__-P.js"),__vite__mapDeps([4,5])));function Wc(){return b.jsx("div",{className:"flex items-center justify-center h-full text-neutral-600 text-sm",children:"Loading..."})}function _T(){const n=de(u=>u.activeTab),[l,a]=le.useState(!1);return le.useEffect(()=>{n==="terminal"&&a(!0)},[n]),b.jsxs("div",{className:"flex flex-col h-full",children:[n==="chat"&&b.jsx(eT,{}),n==="editor"&&b.jsx(le.Suspense,{fallback:b.jsx(Wc,{}),children:b.jsx(jT,{})}),n==="diff"&&b.jsx(fT,{}),l&&b.jsx(le.Suspense,{fallback:n==="terminal"?b.jsx(Wc,{}):null,children:b.jsx("div",{className:n==="terminal"?"flex flex-col h-full":"hidden",children:b.jsx(NT,{})})}),n==="processes"&&b.jsx(pT,{}),n==="context"&&b.jsx(CT,{})]})}function DT(){const n=de(h=>h.files),l=de(h=>h.selection),a=de(h=>h.setSelection),u=de(h=>h.previewMode),s=de(h=>h.imageTick),o=de(h=>h.initParams),f=de(h=>h.setActiveFile);return{files:n.map(h=>({path:h.path,content:h.content})),selection:l?{type:l.type,content:l.content,level:l.level}:null,onSelect:h=>{var p;if(!h){a(null);return}const m=h.file||((p=n[0])==null?void 0:p.path)||"";a({type:h.type,content:h.content,level:h.level,file:m})},mode:u,imageVersion:s,initParams:o,onActiveFileChange:f}}function Mu(){return""}function MT(){const n=de(a=>{var u;return(u=a.modeViewer)==null?void 0:u.PreviewComponent});le.useEffect(()=>{const a=new URLSearchParams(location.search),u=a.get("session"),s=a.get("mode")||"doc";ET(s).then(o=>{de.getState().setModeViewer(o.viewer)}).catch(o=>{console.error(`[app] Failed to load mode "${s}":`,o)}),u?Lu(u):fetch(`${Mu()}/api/session`).then(o=>o.json()).then(o=>{Lu(o.sessionId||"default")}).catch(()=>Lu("default")),fetch(`${Mu()}/api/files`).then(o=>o.json()).then(o=>{var f;(f=o.files)!=null&&f.length&&de.getState().setFiles(o.files)}).catch(()=>{}),fetch(`${Mu()}/api/config`).then(o=>o.json()).then(o=>{o.initParams&&de.getState().setInitParams(o.initParams)}).catch(()=>{}),fetch(`${Mu()}/api/git/available`).then(o=>o.json()).then(o=>de.getState().setGitAvailable(o.available)).catch(()=>de.getState().setGitAvailable(!1))},[]);const l=DT();return b.jsxs("div",{className:"flex flex-col h-screen bg-neutral-950 text-neutral-100",children:[b.jsx(Qb,{}),b.jsxs(x0,{orientation:"horizontal",className:"flex-1",children:[b.jsx(Bc,{defaultSize:60,minSize:30,children:n?b.jsx(n,{...l}):b.jsx(Wc,{})}),b.jsx(b0,{className:"w-1 bg-neutral-800 hover:bg-neutral-700 transition-colors"}),b.jsx(Bc,{defaultSize:40,minSize:25,children:b.jsx(_T,{})})]})]})}tb.createRoot(document.getElementById("root")).render(b.jsx(le.StrictMode,{children:b.jsx(MT,{})}));export{ty as M,Cu as R,LT as a,Fb as b,sv as c,ff as d,z0 as e,iv as f,Hu as g,uv as h,Ey as i,b as j,$1 as k,Uc as n,RT as o,BT as p,le as r,cf as s,de as u,kf as v};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as He,p as je,a as We,n as Qe,h as pe,s as Ee,o as De,b as zt,c as $t,d as K,v as Jt,e as Et,g as Ge,u as Zt,r as B,j as h,M as eu,i as tu}from"./index-
|
|
1
|
+
import{f as He,p as je,a as We,n as Qe,h as pe,s as Ee,o as De,b as zt,c as $t,d as K,v as Jt,e as Et,g as Ge,u as Zt,r as B,j as h,M as eu,i as tu}from"./index-J1QIN1v7.js";import uu from"./manifest-D0B-XRFy.js";const qe={}.hasOwnProperty;function ht(e,t){const u=t||{};function s(c,...o){let l=s.invalid;const b=s.handlers;if(c&&qe.call(c,e)){const m=String(c[e]);l=qe.call(b,m)?b[m]:s.unknown}if(l)return l.call(this,c,...o)}return s.handlers=u.handlers||{},s.invalid=u.invalid,s.unknown=u.unknown,s}const Xe=/[#.]/g;function au(e,t){const u=e||"",s={};let c=0,o,l;for(;c<u.length;){Xe.lastIndex=c;const b=Xe.exec(u),m=u.slice(c,b?b.index:u.length);m&&(o?o==="#"?s.id=m:Array.isArray(s.className)?s.className.push(m):s.className=[m]:l=m,c+=m.length),b&&(o=b[0],c++)}return{type:"element",tagName:l||t||"div",properties:s,children:[]}}function ft(e,t,u){const s=u?iu(u):void 0;function c(o,l,...b){let m;if(o==null){m={type:"root",children:[]};const _=l;b.unshift(_)}else{m=au(o,t);const _=m.tagName.toLowerCase(),C=s?s.get(_):void 0;if(m.tagName=C||_,su(l))b.unshift(l);else for(const[R,z]of Object.entries(l))ru(e,m.properties,R,z)}for(const _ of b)xe(m.children,_);return m.type==="element"&&m.tagName==="template"&&(m.content={type:"root",children:m.children},m.children=[]),m}return c}function su(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,u=Object.keys(e);for(const s of u){const c=t[s];if(c&&typeof c=="object"){if(!Array.isArray(c))return!0;const o=c;for(const l of o)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function ru(e,t,u,s){const c=He(e,u);let o;if(s!=null){if(typeof s=="number"){if(Number.isNaN(s))return;o=s}else typeof s=="boolean"?o=s:typeof s=="string"?c.spaceSeparated?o=je(s):c.commaSeparated?o=We(s):c.commaOrSpaceSeparated?o=je(We(s).join(" ")):o=Ke(c,c.property,s):Array.isArray(s)?o=[...s]:o=c.property==="style"?nu(s):String(s);if(Array.isArray(o)){const l=[];for(const b of o)l.push(Ke(c,c.property,b));o=l}c.property==="className"&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[c.property]=o}}function xe(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const u of t)xe(e,u);else if(typeof t=="object"&&"type"in t)t.type==="root"?xe(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Ke(e,t,u){if(typeof u=="string"){if(e.number&&u&&!Number.isNaN(Number(u)))return Number(u);if((e.boolean||e.overloadedBoolean)&&(u===""||Qe(u)===Qe(t)))return!0}return u}function nu(e){const t=[];for(const[u,s]of Object.entries(e))t.push([u,s].join(": "));return t.join("; ")}function iu(e){const t=new Map;for(const u of e)t.set(u.toLowerCase(),u);return t}const cu=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],ou=ft(pe,"div"),du=ft(Ee,"g",cu);function lu(e){const t=String(e),u=[];return{toOffset:c,toPoint:s};function s(o){if(typeof o=="number"&&o>-1&&o<=t.length){let l=0;for(;;){let b=u[l];if(b===void 0){const m=Ve(t,u[l-1]);b=m===-1?t.length+1:m+1,u[l]=b}if(b>o)return{line:l+1,column:o-(l>0?u[l-1]:0)+1,offset:o};l++}}}function c(o){if(o&&typeof o.line=="number"&&typeof o.column=="number"&&!Number.isNaN(o.line)&&!Number.isNaN(o.column)){for(;u.length<o.line;){const b=u[u.length-1],m=Ve(t,b),_=m===-1?t.length+1:m+1;if(b===_)break;u.push(_)}const l=(o.line>1?u[o.line-2]:0)+o.column-1;if(l<u[o.line-1])return l}}}function Ve(e,t){const u=e.indexOf("\r",t),s=e.indexOf(`
|
|
2
2
|
`,t);return s===-1?u:u===-1||u+1===s?s:u<s?u:s}const q={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Tt={}.hasOwnProperty,Eu=Object.prototype;function hu(e,t){const u=t||{};return ye({file:u.file||void 0,location:!1,schema:u.space==="svg"?Ee:pe,verbose:u.verbose||!1},e)}function ye(e,t){let u;switch(t.nodeName){case"#comment":{const s=t;return u={type:"comment",value:s.data},be(e,s,u),u}case"#document":case"#document-fragment":{const s=t,c="mode"in s?s.mode==="quirks"||s.mode==="limited-quirks":!1;if(u={type:"root",children:mt(e,t.childNodes),data:{quirksMode:c}},e.file&&e.location){const o=String(e.file),l=lu(o),b=l.toPoint(0),m=l.toPoint(o.length);u.position={start:b,end:m}}return u}case"#documentType":{const s=t;return u={type:"doctype"},be(e,s,u),u}case"#text":{const s=t;return u={type:"text",value:s.value},be(e,s,u),u}default:return u=fu(e,t),u}}function mt(e,t){let u=-1;const s=[];for(;++u<t.length;){const c=ye(e,t[u]);s.push(c)}return s}function fu(e,t){const u=e.schema;e.schema=t.namespaceURI===q.svg?Ee:pe;let s=-1;const c={};for(;++s<t.attrs.length;){const b=t.attrs[s],m=(b.prefix?b.prefix+":":"")+b.name;Tt.call(Eu,m)||(c[m]=b.value)}const l=(e.schema.space==="svg"?du:ou)(t.tagName,c,mt(e,t.childNodes));if(be(e,t,l),l.tagName==="template"){const b=t,m=b.sourceCodeLocation,_=m&&m.startTag&&$(m.startTag),C=m&&m.endTag&&$(m.endTag),R=ye(e,b.content);_&&C&&e.file&&(R.position={start:_.end,end:C.start}),l.content=R}return e.schema=u,l}function be(e,t,u){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const s=Tu(e,u,t.sourceCodeLocation);s&&(e.location=!0,u.position=s)}}function Tu(e,t,u){const s=$(u);if(t.type==="element"){const c=t.children[t.children.length-1];if(s&&!u.endTag&&c&&c.position&&c.position.end&&(s.end=Object.assign({},c.position.end)),e.verbose){const o={};let l;if(u.attrs)for(l in u.attrs)Tt.call(u.attrs,l)&&(o[He(e.schema,l).property]=$(u.attrs[l]));De(u.startTag);const b=$(u.startTag),m=u.endTag?$(u.endTag):void 0,_={opening:b};m&&(_.closing=m),_.properties=o,t.data={position:_}}}return s}function $(e){const t=ze({line:e.startLine,column:e.startCol,offset:e.startOffset}),u=ze({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||u?{start:t,end:u}:void 0}function ze(e){return e.line&&e.column?e:void 0}const mu={},bu={}.hasOwnProperty,bt=ht("type",{handlers:{root:Au,element:gu,text:pu,comment:Cu,doctype:Iu}});function _u(e,t){const s=(t||mu).space;return bt(e,s==="svg"?Ee:pe)}function Au(e,t){const u={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return u.childNodes=Ue(e.children,u,t),Z(e,u),u}function Nu(e,t){const u={nodeName:"#document-fragment",childNodes:[]};return u.childNodes=Ue(e.children,u,t),Z(e,u),u}function Iu(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Z(e,t),t}function pu(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Z(e,t),t}function Cu(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Z(e,t),t}function gu(e,t){const u=t;let s=u;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&u.space==="html"&&(s=Ee);const c=[];let o;if(e.properties){for(o in e.properties)if(o!=="children"&&bu.call(e.properties,o)){const m=Ou(s,o,e.properties[o]);m&&c.push(m)}}const l=s.space,b={nodeName:e.tagName,tagName:e.tagName,attrs:c,namespaceURI:q[l],childNodes:[],parentNode:null};return b.childNodes=Ue(e.children,b,s),Z(e,b),e.tagName==="template"&&e.content&&(b.content=Nu(e.content,s)),b}function Ou(e,t,u){const s=He(e,t);if(u===!1||u===null||u===void 0||typeof u=="number"&&Number.isNaN(u)||!u&&s.boolean)return;Array.isArray(u)&&(u=s.commaSeparated?zt(u):$t(u));const c={name:s.attribute,value:u===!0?"":String(u)};if(s.space&&s.space!=="html"&&s.space!=="svg"){const o=c.name.indexOf(":");o<0?c.prefix="":(c.name=c.name.slice(o+1),c.prefix=s.attribute.slice(0,o)),c.namespace=q[s.space]}return c}function Ue(e,t,u){let s=-1;const c=[];if(e)for(;++s<e.length;){const o=bt(e[s],u);o.parentNode=t,c.push(o)}return c}function Z(e,t){const u=e.position;u&&u.start&&u.end&&(De(typeof u.start.offset=="number"),De(typeof u.end.offset=="number"),t.sourceCodeLocation={startLine:u.start.line,startCol:u.start.column,startOffset:u.start.offset,endLine:u.end.line,endCol:u.end.column,endOffset:u.end.offset})}const Su=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Lu=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),p="�";var r;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(r||(r={}));const M={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function _t(e){return e>=55296&&e<=57343}function Ru(e){return e>=56320&&e<=57343}function Du(e,t){return(e-55296)*1024+9216+t}function At(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Nt(e){return e>=64976&&e<=65007||Lu.has(e)}var E;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(E||(E={}));const xu=65536;class Pu{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=xu,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,u){const{line:s,col:c,offset:o}=this,l=c+u,b=o+u;return{code:t,startLine:s,endLine:s,startCol:l,endCol:l,startOffset:b,endOffset:b}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const u=this.html.charCodeAt(this.pos+1);if(Ru(u))return this.pos++,this._addGap(),Du(t,u)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,r.EOF;return this._err(E.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,u){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=u}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,u){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(u)return this.html.startsWith(t,this.pos);for(let s=0;s<t.length;s++)if((this.html.charCodeAt(this.pos+s)|32)!==t.charCodeAt(s))return!1;return!0}peek(t){const u=this.pos+t;if(u>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,r.EOF;const s=this.html.charCodeAt(u);return s===r.CARRIAGE_RETURN?r.LINE_FEED:s}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,r.EOF;let t=this.html.charCodeAt(this.pos);return t===r.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,r.LINE_FEED):t===r.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,_t(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===r.LINE_FEED||t===r.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){At(t)?this._err(E.controlCharacterInInputStream):Nt(t)&&this._err(E.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var N;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(N||(N={}));function It(e,t){for(let u=e.attrs.length-1;u>=0;u--)if(e.attrs[u].name===t)return e.attrs[u].value;return null}const Mu=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),ku=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function Bu(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=ku.get(e))!==null&&t!==void 0?t:e}var L;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(L||(L={}));const Hu=32;var G;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(G||(G={}));function Pe(e){return e>=L.ZERO&&e<=L.NINE}function yu(e){return e>=L.UPPER_A&&e<=L.UPPER_F||e>=L.LOWER_A&&e<=L.LOWER_F}function Uu(e){return e>=L.UPPER_A&&e<=L.UPPER_Z||e>=L.LOWER_A&&e<=L.LOWER_Z||Pe(e)}function Fu(e){return e===L.EQUALS||Uu(e)}var S;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(S||(S={}));var Y;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Y||(Y={}));class wu{constructor(t,u,s){this.decodeTree=t,this.emitCodePoint=u,this.errors=s,this.state=S.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Y.Strict}startEntity(t){this.decodeMode=t,this.state=S.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,u){switch(this.state){case S.EntityStart:return t.charCodeAt(u)===L.NUM?(this.state=S.NumericStart,this.consumed+=1,this.stateNumericStart(t,u+1)):(this.state=S.NamedEntity,this.stateNamedEntity(t,u));case S.NumericStart:return this.stateNumericStart(t,u);case S.NumericDecimal:return this.stateNumericDecimal(t,u);case S.NumericHex:return this.stateNumericHex(t,u);case S.NamedEntity:return this.stateNamedEntity(t,u)}}stateNumericStart(t,u){return u>=t.length?-1:(t.charCodeAt(u)|Hu)===L.LOWER_X?(this.state=S.NumericHex,this.consumed+=1,this.stateNumericHex(t,u+1)):(this.state=S.NumericDecimal,this.stateNumericDecimal(t,u))}addToNumericResult(t,u,s,c){if(u!==s){const o=s-u;this.result=this.result*Math.pow(c,o)+Number.parseInt(t.substr(u,o),c),this.consumed+=o}}stateNumericHex(t,u){const s=u;for(;u<t.length;){const c=t.charCodeAt(u);if(Pe(c)||yu(c))u+=1;else return this.addToNumericResult(t,s,u,16),this.emitNumericEntity(c,3)}return this.addToNumericResult(t,s,u,16),-1}stateNumericDecimal(t,u){const s=u;for(;u<t.length;){const c=t.charCodeAt(u);if(Pe(c))u+=1;else return this.addToNumericResult(t,s,u,10),this.emitNumericEntity(c,2)}return this.addToNumericResult(t,s,u,10),-1}emitNumericEntity(t,u){var s;if(this.consumed<=u)return(s=this.errors)===null||s===void 0||s.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===L.SEMI)this.consumed+=1;else if(this.decodeMode===Y.Strict)return 0;return this.emitCodePoint(Bu(this.result),this.consumed),this.errors&&(t!==L.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,u){const{decodeTree:s}=this;let c=s[this.treeIndex],o=(c&G.VALUE_LENGTH)>>14;for(;u<t.length;u++,this.excess++){const l=t.charCodeAt(u);if(this.treeIndex=vu(s,c,this.treeIndex+Math.max(1,o),l),this.treeIndex<0)return this.result===0||this.decodeMode===Y.Attribute&&(o===0||Fu(l))?0:this.emitNotTerminatedNamedEntity();if(c=s[this.treeIndex],o=(c&G.VALUE_LENGTH)>>14,o!==0){if(l===L.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Y.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:u,decodeTree:s}=this,c=(s[u]&G.VALUE_LENGTH)>>14;return this.emitNamedEntityData(u,c,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,u,s){const{decodeTree:c}=this;return this.emitCodePoint(u===1?c[t]&~G.VALUE_LENGTH:c[t+1],s),u===3&&this.emitCodePoint(c[t+2],s),s}end(){var t;switch(this.state){case S.NamedEntity:return this.result!==0&&(this.decodeMode!==Y.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case S.NumericDecimal:return this.emitNumericEntity(0,2);case S.NumericHex:return this.emitNumericEntity(0,3);case S.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case S.EntityStart:return 0}}}function vu(e,t,u,s){const c=(t&G.BRANCH_LENGTH)>>7,o=t&G.JUMP_TABLE;if(c===0)return o!==0&&s===o?u:-1;if(o){const m=s-o;return m<0||m>=c?-1:e[u+m]-1}let l=u,b=l+c-1;for(;l<=b;){const m=l+b>>>1,_=e[m];if(_<s)l=m+1;else if(_>s)b=m-1;else return e[m+c]}return-1}var f;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(f||(f={}));var X;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(X||(X={}));var y;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(y||(y={}));var d;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(d||(d={}));var a;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(a||(a={}));const Yu=new Map([[d.A,a.A],[d.ADDRESS,a.ADDRESS],[d.ANNOTATION_XML,a.ANNOTATION_XML],[d.APPLET,a.APPLET],[d.AREA,a.AREA],[d.ARTICLE,a.ARTICLE],[d.ASIDE,a.ASIDE],[d.B,a.B],[d.BASE,a.BASE],[d.BASEFONT,a.BASEFONT],[d.BGSOUND,a.BGSOUND],[d.BIG,a.BIG],[d.BLOCKQUOTE,a.BLOCKQUOTE],[d.BODY,a.BODY],[d.BR,a.BR],[d.BUTTON,a.BUTTON],[d.CAPTION,a.CAPTION],[d.CENTER,a.CENTER],[d.CODE,a.CODE],[d.COL,a.COL],[d.COLGROUP,a.COLGROUP],[d.DD,a.DD],[d.DESC,a.DESC],[d.DETAILS,a.DETAILS],[d.DIALOG,a.DIALOG],[d.DIR,a.DIR],[d.DIV,a.DIV],[d.DL,a.DL],[d.DT,a.DT],[d.EM,a.EM],[d.EMBED,a.EMBED],[d.FIELDSET,a.FIELDSET],[d.FIGCAPTION,a.FIGCAPTION],[d.FIGURE,a.FIGURE],[d.FONT,a.FONT],[d.FOOTER,a.FOOTER],[d.FOREIGN_OBJECT,a.FOREIGN_OBJECT],[d.FORM,a.FORM],[d.FRAME,a.FRAME],[d.FRAMESET,a.FRAMESET],[d.H1,a.H1],[d.H2,a.H2],[d.H3,a.H3],[d.H4,a.H4],[d.H5,a.H5],[d.H6,a.H6],[d.HEAD,a.HEAD],[d.HEADER,a.HEADER],[d.HGROUP,a.HGROUP],[d.HR,a.HR],[d.HTML,a.HTML],[d.I,a.I],[d.IMG,a.IMG],[d.IMAGE,a.IMAGE],[d.INPUT,a.INPUT],[d.IFRAME,a.IFRAME],[d.KEYGEN,a.KEYGEN],[d.LABEL,a.LABEL],[d.LI,a.LI],[d.LINK,a.LINK],[d.LISTING,a.LISTING],[d.MAIN,a.MAIN],[d.MALIGNMARK,a.MALIGNMARK],[d.MARQUEE,a.MARQUEE],[d.MATH,a.MATH],[d.MENU,a.MENU],[d.META,a.META],[d.MGLYPH,a.MGLYPH],[d.MI,a.MI],[d.MO,a.MO],[d.MN,a.MN],[d.MS,a.MS],[d.MTEXT,a.MTEXT],[d.NAV,a.NAV],[d.NOBR,a.NOBR],[d.NOFRAMES,a.NOFRAMES],[d.NOEMBED,a.NOEMBED],[d.NOSCRIPT,a.NOSCRIPT],[d.OBJECT,a.OBJECT],[d.OL,a.OL],[d.OPTGROUP,a.OPTGROUP],[d.OPTION,a.OPTION],[d.P,a.P],[d.PARAM,a.PARAM],[d.PLAINTEXT,a.PLAINTEXT],[d.PRE,a.PRE],[d.RB,a.RB],[d.RP,a.RP],[d.RT,a.RT],[d.RTC,a.RTC],[d.RUBY,a.RUBY],[d.S,a.S],[d.SCRIPT,a.SCRIPT],[d.SEARCH,a.SEARCH],[d.SECTION,a.SECTION],[d.SELECT,a.SELECT],[d.SOURCE,a.SOURCE],[d.SMALL,a.SMALL],[d.SPAN,a.SPAN],[d.STRIKE,a.STRIKE],[d.STRONG,a.STRONG],[d.STYLE,a.STYLE],[d.SUB,a.SUB],[d.SUMMARY,a.SUMMARY],[d.SUP,a.SUP],[d.TABLE,a.TABLE],[d.TBODY,a.TBODY],[d.TEMPLATE,a.TEMPLATE],[d.TEXTAREA,a.TEXTAREA],[d.TFOOT,a.TFOOT],[d.TD,a.TD],[d.TH,a.TH],[d.THEAD,a.THEAD],[d.TITLE,a.TITLE],[d.TR,a.TR],[d.TRACK,a.TRACK],[d.TT,a.TT],[d.U,a.U],[d.UL,a.UL],[d.SVG,a.SVG],[d.VAR,a.VAR],[d.WBR,a.WBR],[d.XMP,a.XMP]]);function ee(e){var t;return(t=Yu.get(e))!==null&&t!==void 0?t:a.UNKNOWN}const T=a,ju={[f.HTML]:new Set([T.ADDRESS,T.APPLET,T.AREA,T.ARTICLE,T.ASIDE,T.BASE,T.BASEFONT,T.BGSOUND,T.BLOCKQUOTE,T.BODY,T.BR,T.BUTTON,T.CAPTION,T.CENTER,T.COL,T.COLGROUP,T.DD,T.DETAILS,T.DIR,T.DIV,T.DL,T.DT,T.EMBED,T.FIELDSET,T.FIGCAPTION,T.FIGURE,T.FOOTER,T.FORM,T.FRAME,T.FRAMESET,T.H1,T.H2,T.H3,T.H4,T.H5,T.H6,T.HEAD,T.HEADER,T.HGROUP,T.HR,T.HTML,T.IFRAME,T.IMG,T.INPUT,T.LI,T.LINK,T.LISTING,T.MAIN,T.MARQUEE,T.MENU,T.META,T.NAV,T.NOEMBED,T.NOFRAMES,T.NOSCRIPT,T.OBJECT,T.OL,T.P,T.PARAM,T.PLAINTEXT,T.PRE,T.SCRIPT,T.SECTION,T.SELECT,T.SOURCE,T.STYLE,T.SUMMARY,T.TABLE,T.TBODY,T.TD,T.TEMPLATE,T.TEXTAREA,T.TFOOT,T.TH,T.THEAD,T.TITLE,T.TR,T.TRACK,T.UL,T.WBR,T.XMP]),[f.MATHML]:new Set([T.MI,T.MO,T.MN,T.MS,T.MTEXT,T.ANNOTATION_XML]),[f.SVG]:new Set([T.TITLE,T.FOREIGN_OBJECT,T.DESC]),[f.XLINK]:new Set,[f.XML]:new Set,[f.XMLNS]:new Set},Me=new Set([T.H1,T.H2,T.H3,T.H4,T.H5,T.H6]);d.STYLE,d.SCRIPT,d.XMP,d.IFRAME,d.NOEMBED,d.NOFRAMES,d.PLAINTEXT;var n;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(n||(n={}));const g={DATA:n.DATA,RCDATA:n.RCDATA,RAWTEXT:n.RAWTEXT,SCRIPT_DATA:n.SCRIPT_DATA,PLAINTEXT:n.PLAINTEXT,CDATA_SECTION:n.CDATA_SECTION};function Wu(e){return e>=r.DIGIT_0&&e<=r.DIGIT_9}function re(e){return e>=r.LATIN_CAPITAL_A&&e<=r.LATIN_CAPITAL_Z}function Qu(e){return e>=r.LATIN_SMALL_A&&e<=r.LATIN_SMALL_Z}function W(e){return Qu(e)||re(e)}function $e(e){return W(e)||Wu(e)}function Te(e){return e+32}function pt(e){return e===r.SPACE||e===r.LINE_FEED||e===r.TABULATION||e===r.FORM_FEED}function Je(e){return pt(e)||e===r.SOLIDUS||e===r.GREATER_THAN_SIGN}function Gu(e){return e===r.NULL?E.nullCharacterReference:e>1114111?E.characterReferenceOutsideUnicodeRange:_t(e)?E.surrogateCharacterReference:Nt(e)?E.noncharacterCharacterReference:At(e)||e===r.CARRIAGE_RETURN?E.controlCharacterReference:null}class qu{constructor(t,u){this.options=t,this.handler=u,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=n.DATA,this.returnState=n.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Pu(u),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new wu(Mu,(s,c)=>{this.preprocessor.pos=this.entityStartPos+c-1,this._flushCodePointConsumedAsCharacterReference(s)},u.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(E.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:s=>{this._err(E.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+s)},validateNumericCharacterReference:s=>{const c=Gu(s);c&&this._err(c,1)}}:void 0)}_err(t,u=0){var s,c;(c=(s=this.handler).onParseError)===null||c===void 0||c.call(s,this.preprocessor.getError(t,u))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,u,s){this.active=!0,this.preprocessor.write(t,u),this._runParsingLoop(),this.paused||s==null||s()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let u=0;u<t;u++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,u){return this.preprocessor.startsWith(t,u)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:N.START_TAG,tagName:"",tagID:a.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:N.END_TAG,tagName:"",tagID:a.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:N.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:N.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,u){this.currentCharacterToken={type:t,chars:u,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,u;const s=this.currentToken;if(It(s,this.currentAttr.name)===null){if(s.attrs.push(this.currentAttr),s.location&&this.currentLocation){const c=(t=(u=s.location).attrs)!==null&&t!==void 0?t:u.attrs=Object.create(null);c[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(E.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=ee(t.tagName),t.type===N.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(E.endTagWithAttributes),t.selfClosing&&this._err(E.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case N.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case N.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case N.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:N.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,u){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=u;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,u)}_emitCodePoint(t){const u=pt(t)?N.WHITESPACE_CHARACTER:t===r.NULL?N.NULL_CHARACTER:N.CHARACTER;this._appendCharToCurrentCharacterToken(u,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(N.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=n.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Y.Attribute:Y.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===n.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===n.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===n.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case n.DATA:{this._stateData(t);break}case n.RCDATA:{this._stateRcdata(t);break}case n.RAWTEXT:{this._stateRawtext(t);break}case n.SCRIPT_DATA:{this._stateScriptData(t);break}case n.PLAINTEXT:{this._statePlaintext(t);break}case n.TAG_OPEN:{this._stateTagOpen(t);break}case n.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case n.TAG_NAME:{this._stateTagName(t);break}case n.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case n.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case n.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case n.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case n.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case n.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case n.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case n.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case n.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case n.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case n.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case n.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case n.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case n.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case n.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case n.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case n.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case n.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case n.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case n.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case n.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case n.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case n.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case n.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case n.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case n.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case n.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case n.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case n.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case n.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case n.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case n.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case n.BOGUS_COMMENT:{this._stateBogusComment(t);break}case n.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case n.COMMENT_START:{this._stateCommentStart(t);break}case n.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case n.COMMENT:{this._stateComment(t);break}case n.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case n.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case n.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case n.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case n.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case n.COMMENT_END:{this._stateCommentEnd(t);break}case n.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case n.DOCTYPE:{this._stateDoctype(t);break}case n.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case n.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case n.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case n.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case n.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case n.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case n.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case n.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case n.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case n.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case n.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case n.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case n.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case n.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case n.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case n.CDATA_SECTION:{this._stateCdataSection(t);break}case n.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case n.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case n.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case n.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case r.LESS_THAN_SIGN:{this.state=n.TAG_OPEN;break}case r.AMPERSAND:{this._startCharacterReference();break}case r.NULL:{this._err(E.unexpectedNullCharacter),this._emitCodePoint(t);break}case r.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case r.AMPERSAND:{this._startCharacterReference();break}case r.LESS_THAN_SIGN:{this.state=n.RCDATA_LESS_THAN_SIGN;break}case r.NULL:{this._err(E.unexpectedNullCharacter),this._emitChars(p);break}case r.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case r.LESS_THAN_SIGN:{this.state=n.RAWTEXT_LESS_THAN_SIGN;break}case r.NULL:{this._err(E.unexpectedNullCharacter),this._emitChars(p);break}case r.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case r.LESS_THAN_SIGN:{this.state=n.SCRIPT_DATA_LESS_THAN_SIGN;break}case r.NULL:{this._err(E.unexpectedNullCharacter),this._emitChars(p);break}case r.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case r.NULL:{this._err(E.unexpectedNullCharacter),this._emitChars(p);break}case r.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(W(t))this._createStartTagToken(),this.state=n.TAG_NAME,this._stateTagName(t);else switch(t){case r.EXCLAMATION_MARK:{this.state=n.MARKUP_DECLARATION_OPEN;break}case r.SOLIDUS:{this.state=n.END_TAG_OPEN;break}case r.QUESTION_MARK:{this._err(E.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=n.BOGUS_COMMENT,this._stateBogusComment(t);break}case r.EOF:{this._err(E.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(E.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=n.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(W(t))this._createEndTagToken(),this.state=n.TAG_NAME,this._stateTagName(t);else switch(t){case r.GREATER_THAN_SIGN:{this._err(E.missingEndTagName),this.state=n.DATA;break}case r.EOF:{this._err(E.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(E.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=n.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const u=this.currentToken;switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:{this.state=n.BEFORE_ATTRIBUTE_NAME;break}case r.SOLIDUS:{this.state=n.SELF_CLOSING_START_TAG;break}case r.GREATER_THAN_SIGN:{this.state=n.DATA,this.emitCurrentTagToken();break}case r.NULL:{this._err(E.unexpectedNullCharacter),u.tagName+=p;break}case r.EOF:{this._err(E.eofInTag),this._emitEOFToken();break}default:u.tagName+=String.fromCodePoint(re(t)?Te(t):t)}}_stateRcdataLessThanSign(t){t===r.SOLIDUS?this.state=n.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=n.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){W(t)?(this.state=n.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=n.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const u=this.currentToken;switch(u.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=n.BEFORE_ATTRIBUTE_NAME,!1;case r.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=n.SELF_CLOSING_START_TAG,!1;case r.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=n.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=n.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===r.SOLIDUS?this.state=n.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=n.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){W(t)?(this.state=n.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=n.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=n.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case r.SOLIDUS:{this.state=n.SCRIPT_DATA_END_TAG_OPEN;break}case r.EXCLAMATION_MARK:{this.state=n.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=n.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){W(t)?(this.state=n.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=n.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=n.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===r.HYPHEN_MINUS?(this.state=n.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=n.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===r.HYPHEN_MINUS?(this.state=n.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=n.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case r.HYPHEN_MINUS:{this.state=n.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case r.LESS_THAN_SIGN:{this.state=n.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case r.NULL:{this._err(E.unexpectedNullCharacter),this._emitChars(p);break}case r.EOF:{this._err(E.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case r.HYPHEN_MINUS:{this.state=n.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case r.LESS_THAN_SIGN:{this.state=n.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case r.NULL:{this._err(E.unexpectedNullCharacter),this.state=n.SCRIPT_DATA_ESCAPED,this._emitChars(p);break}case r.EOF:{this._err(E.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=n.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case r.HYPHEN_MINUS:{this._emitChars("-");break}case r.LESS_THAN_SIGN:{this.state=n.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case r.GREATER_THAN_SIGN:{this.state=n.SCRIPT_DATA,this._emitChars(">");break}case r.NULL:{this._err(E.unexpectedNullCharacter),this.state=n.SCRIPT_DATA_ESCAPED,this._emitChars(p);break}case r.EOF:{this._err(E.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=n.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===r.SOLIDUS?this.state=n.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:W(t)?(this._emitChars("<"),this.state=n.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=n.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){W(t)?(this.state=n.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=n.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=n.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(M.SCRIPT,!1)&&Je(this.preprocessor.peek(M.SCRIPT.length))){this._emitCodePoint(t);for(let u=0;u<M.SCRIPT.length;u++)this._emitCodePoint(this._consume());this.state=n.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=n.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case r.HYPHEN_MINUS:{this.state=n.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case r.LESS_THAN_SIGN:{this.state=n.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case r.NULL:{this._err(E.unexpectedNullCharacter),this._emitChars(p);break}case r.EOF:{this._err(E.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case r.HYPHEN_MINUS:{this.state=n.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case r.LESS_THAN_SIGN:{this.state=n.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case r.NULL:{this._err(E.unexpectedNullCharacter),this.state=n.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(p);break}case r.EOF:{this._err(E.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=n.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case r.HYPHEN_MINUS:{this._emitChars("-");break}case r.LESS_THAN_SIGN:{this.state=n.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case r.GREATER_THAN_SIGN:{this.state=n.SCRIPT_DATA,this._emitChars(">");break}case r.NULL:{this._err(E.unexpectedNullCharacter),this.state=n.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(p);break}case r.EOF:{this._err(E.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=n.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===r.SOLIDUS?(this.state=n.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=n.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(M.SCRIPT,!1)&&Je(this.preprocessor.peek(M.SCRIPT.length))){this._emitCodePoint(t);for(let u=0;u<M.SCRIPT.length;u++)this._emitCodePoint(this._consume());this.state=n.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=n.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:break;case r.SOLIDUS:case r.GREATER_THAN_SIGN:case r.EOF:{this.state=n.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case r.EQUALS_SIGN:{this._err(E.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=n.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=n.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:case r.SOLIDUS:case r.GREATER_THAN_SIGN:case r.EOF:{this._leaveAttrName(),this.state=n.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case r.EQUALS_SIGN:{this._leaveAttrName(),this.state=n.BEFORE_ATTRIBUTE_VALUE;break}case r.QUOTATION_MARK:case r.APOSTROPHE:case r.LESS_THAN_SIGN:{this._err(E.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case r.NULL:{this._err(E.unexpectedNullCharacter),this.currentAttr.name+=p;break}default:this.currentAttr.name+=String.fromCodePoint(re(t)?Te(t):t)}}_stateAfterAttributeName(t){switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:break;case r.SOLIDUS:{this.state=n.SELF_CLOSING_START_TAG;break}case r.EQUALS_SIGN:{this.state=n.BEFORE_ATTRIBUTE_VALUE;break}case r.GREATER_THAN_SIGN:{this.state=n.DATA,this.emitCurrentTagToken();break}case r.EOF:{this._err(E.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=n.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:break;case r.QUOTATION_MARK:{this.state=n.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case r.APOSTROPHE:{this.state=n.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case r.GREATER_THAN_SIGN:{this._err(E.missingAttributeValue),this.state=n.DATA,this.emitCurrentTagToken();break}default:this.state=n.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case r.QUOTATION_MARK:{this.state=n.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case r.AMPERSAND:{this._startCharacterReference();break}case r.NULL:{this._err(E.unexpectedNullCharacter),this.currentAttr.value+=p;break}case r.EOF:{this._err(E.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case r.APOSTROPHE:{this.state=n.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case r.AMPERSAND:{this._startCharacterReference();break}case r.NULL:{this._err(E.unexpectedNullCharacter),this.currentAttr.value+=p;break}case r.EOF:{this._err(E.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:{this._leaveAttrValue(),this.state=n.BEFORE_ATTRIBUTE_NAME;break}case r.AMPERSAND:{this._startCharacterReference();break}case r.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=n.DATA,this.emitCurrentTagToken();break}case r.NULL:{this._err(E.unexpectedNullCharacter),this.currentAttr.value+=p;break}case r.QUOTATION_MARK:case r.APOSTROPHE:case r.LESS_THAN_SIGN:case r.EQUALS_SIGN:case r.GRAVE_ACCENT:{this._err(E.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case r.EOF:{this._err(E.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:{this._leaveAttrValue(),this.state=n.BEFORE_ATTRIBUTE_NAME;break}case r.SOLIDUS:{this._leaveAttrValue(),this.state=n.SELF_CLOSING_START_TAG;break}case r.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=n.DATA,this.emitCurrentTagToken();break}case r.EOF:{this._err(E.eofInTag),this._emitEOFToken();break}default:this._err(E.missingWhitespaceBetweenAttributes),this.state=n.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case r.GREATER_THAN_SIGN:{const u=this.currentToken;u.selfClosing=!0,this.state=n.DATA,this.emitCurrentTagToken();break}case r.EOF:{this._err(E.eofInTag),this._emitEOFToken();break}default:this._err(E.unexpectedSolidusInTag),this.state=n.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const u=this.currentToken;switch(t){case r.GREATER_THAN_SIGN:{this.state=n.DATA,this.emitCurrentComment(u);break}case r.EOF:{this.emitCurrentComment(u),this._emitEOFToken();break}case r.NULL:{this._err(E.unexpectedNullCharacter),u.data+=p;break}default:u.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(M.DASH_DASH,!0)?(this._createCommentToken(M.DASH_DASH.length+1),this.state=n.COMMENT_START):this._consumeSequenceIfMatch(M.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(M.DOCTYPE.length+1),this.state=n.DOCTYPE):this._consumeSequenceIfMatch(M.CDATA_START,!0)?this.inForeignNode?this.state=n.CDATA_SECTION:(this._err(E.cdataInHtmlContent),this._createCommentToken(M.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=n.BOGUS_COMMENT):this._ensureHibernation()||(this._err(E.incorrectlyOpenedComment),this._createCommentToken(2),this.state=n.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case r.HYPHEN_MINUS:{this.state=n.COMMENT_START_DASH;break}case r.GREATER_THAN_SIGN:{this._err(E.abruptClosingOfEmptyComment),this.state=n.DATA;const u=this.currentToken;this.emitCurrentComment(u);break}default:this.state=n.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const u=this.currentToken;switch(t){case r.HYPHEN_MINUS:{this.state=n.COMMENT_END;break}case r.GREATER_THAN_SIGN:{this._err(E.abruptClosingOfEmptyComment),this.state=n.DATA,this.emitCurrentComment(u);break}case r.EOF:{this._err(E.eofInComment),this.emitCurrentComment(u),this._emitEOFToken();break}default:u.data+="-",this.state=n.COMMENT,this._stateComment(t)}}_stateComment(t){const u=this.currentToken;switch(t){case r.HYPHEN_MINUS:{this.state=n.COMMENT_END_DASH;break}case r.LESS_THAN_SIGN:{u.data+="<",this.state=n.COMMENT_LESS_THAN_SIGN;break}case r.NULL:{this._err(E.unexpectedNullCharacter),u.data+=p;break}case r.EOF:{this._err(E.eofInComment),this.emitCurrentComment(u),this._emitEOFToken();break}default:u.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const u=this.currentToken;switch(t){case r.EXCLAMATION_MARK:{u.data+="!",this.state=n.COMMENT_LESS_THAN_SIGN_BANG;break}case r.LESS_THAN_SIGN:{u.data+="<";break}default:this.state=n.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===r.HYPHEN_MINUS?this.state=n.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=n.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===r.HYPHEN_MINUS?this.state=n.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=n.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==r.GREATER_THAN_SIGN&&t!==r.EOF&&this._err(E.nestedComment),this.state=n.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const u=this.currentToken;switch(t){case r.HYPHEN_MINUS:{this.state=n.COMMENT_END;break}case r.EOF:{this._err(E.eofInComment),this.emitCurrentComment(u),this._emitEOFToken();break}default:u.data+="-",this.state=n.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const u=this.currentToken;switch(t){case r.GREATER_THAN_SIGN:{this.state=n.DATA,this.emitCurrentComment(u);break}case r.EXCLAMATION_MARK:{this.state=n.COMMENT_END_BANG;break}case r.HYPHEN_MINUS:{u.data+="-";break}case r.EOF:{this._err(E.eofInComment),this.emitCurrentComment(u),this._emitEOFToken();break}default:u.data+="--",this.state=n.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const u=this.currentToken;switch(t){case r.HYPHEN_MINUS:{u.data+="--!",this.state=n.COMMENT_END_DASH;break}case r.GREATER_THAN_SIGN:{this._err(E.incorrectlyClosedComment),this.state=n.DATA,this.emitCurrentComment(u);break}case r.EOF:{this._err(E.eofInComment),this.emitCurrentComment(u),this._emitEOFToken();break}default:u.data+="--!",this.state=n.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:{this.state=n.BEFORE_DOCTYPE_NAME;break}case r.GREATER_THAN_SIGN:{this.state=n.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case r.EOF:{this._err(E.eofInDoctype),this._createDoctypeToken(null);const u=this.currentToken;u.forceQuirks=!0,this.emitCurrentDoctype(u),this._emitEOFToken();break}default:this._err(E.missingWhitespaceBeforeDoctypeName),this.state=n.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(re(t))this._createDoctypeToken(String.fromCharCode(Te(t))),this.state=n.DOCTYPE_NAME;else switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:break;case r.NULL:{this._err(E.unexpectedNullCharacter),this._createDoctypeToken(p),this.state=n.DOCTYPE_NAME;break}case r.GREATER_THAN_SIGN:{this._err(E.missingDoctypeName),this._createDoctypeToken(null);const u=this.currentToken;u.forceQuirks=!0,this.emitCurrentDoctype(u),this.state=n.DATA;break}case r.EOF:{this._err(E.eofInDoctype),this._createDoctypeToken(null);const u=this.currentToken;u.forceQuirks=!0,this.emitCurrentDoctype(u),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=n.DOCTYPE_NAME}}_stateDoctypeName(t){const u=this.currentToken;switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:{this.state=n.AFTER_DOCTYPE_NAME;break}case r.GREATER_THAN_SIGN:{this.state=n.DATA,this.emitCurrentDoctype(u);break}case r.NULL:{this._err(E.unexpectedNullCharacter),u.name+=p;break}case r.EOF:{this._err(E.eofInDoctype),u.forceQuirks=!0,this.emitCurrentDoctype(u),this._emitEOFToken();break}default:u.name+=String.fromCodePoint(re(t)?Te(t):t)}}_stateAfterDoctypeName(t){const u=this.currentToken;switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:break;case r.GREATER_THAN_SIGN:{this.state=n.DATA,this.emitCurrentDoctype(u);break}case r.EOF:{this._err(E.eofInDoctype),u.forceQuirks=!0,this.emitCurrentDoctype(u),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(M.PUBLIC,!1)?this.state=n.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(M.SYSTEM,!1)?this.state=n.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(E.invalidCharacterSequenceAfterDoctypeName),u.forceQuirks=!0,this.state=n.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const u=this.currentToken;switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:{this.state=n.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case r.QUOTATION_MARK:{this._err(E.missingWhitespaceAfterDoctypePublicKeyword),u.publicId="",this.state=n.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case r.APOSTROPHE:{this._err(E.missingWhitespaceAfterDoctypePublicKeyword),u.publicId="",this.state=n.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case r.GREATER_THAN_SIGN:{this._err(E.missingDoctypePublicIdentifier),u.forceQuirks=!0,this.state=n.DATA,this.emitCurrentDoctype(u);break}case r.EOF:{this._err(E.eofInDoctype),u.forceQuirks=!0,this.emitCurrentDoctype(u),this._emitEOFToken();break}default:this._err(E.missingQuoteBeforeDoctypePublicIdentifier),u.forceQuirks=!0,this.state=n.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const u=this.currentToken;switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:break;case r.QUOTATION_MARK:{u.publicId="",this.state=n.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case r.APOSTROPHE:{u.publicId="",this.state=n.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case r.GREATER_THAN_SIGN:{this._err(E.missingDoctypePublicIdentifier),u.forceQuirks=!0,this.state=n.DATA,this.emitCurrentDoctype(u);break}case r.EOF:{this._err(E.eofInDoctype),u.forceQuirks=!0,this.emitCurrentDoctype(u),this._emitEOFToken();break}default:this._err(E.missingQuoteBeforeDoctypePublicIdentifier),u.forceQuirks=!0,this.state=n.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const u=this.currentToken;switch(t){case r.QUOTATION_MARK:{this.state=n.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case r.NULL:{this._err(E.unexpectedNullCharacter),u.publicId+=p;break}case r.GREATER_THAN_SIGN:{this._err(E.abruptDoctypePublicIdentifier),u.forceQuirks=!0,this.emitCurrentDoctype(u),this.state=n.DATA;break}case r.EOF:{this._err(E.eofInDoctype),u.forceQuirks=!0,this.emitCurrentDoctype(u),this._emitEOFToken();break}default:u.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const u=this.currentToken;switch(t){case r.APOSTROPHE:{this.state=n.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case r.NULL:{this._err(E.unexpectedNullCharacter),u.publicId+=p;break}case r.GREATER_THAN_SIGN:{this._err(E.abruptDoctypePublicIdentifier),u.forceQuirks=!0,this.emitCurrentDoctype(u),this.state=n.DATA;break}case r.EOF:{this._err(E.eofInDoctype),u.forceQuirks=!0,this.emitCurrentDoctype(u),this._emitEOFToken();break}default:u.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const u=this.currentToken;switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:{this.state=n.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case r.GREATER_THAN_SIGN:{this.state=n.DATA,this.emitCurrentDoctype(u);break}case r.QUOTATION_MARK:{this._err(E.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),u.systemId="",this.state=n.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case r.APOSTROPHE:{this._err(E.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),u.systemId="",this.state=n.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case r.EOF:{this._err(E.eofInDoctype),u.forceQuirks=!0,this.emitCurrentDoctype(u),this._emitEOFToken();break}default:this._err(E.missingQuoteBeforeDoctypeSystemIdentifier),u.forceQuirks=!0,this.state=n.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const u=this.currentToken;switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:break;case r.GREATER_THAN_SIGN:{this.emitCurrentDoctype(u),this.state=n.DATA;break}case r.QUOTATION_MARK:{u.systemId="",this.state=n.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case r.APOSTROPHE:{u.systemId="",this.state=n.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case r.EOF:{this._err(E.eofInDoctype),u.forceQuirks=!0,this.emitCurrentDoctype(u),this._emitEOFToken();break}default:this._err(E.missingQuoteBeforeDoctypeSystemIdentifier),u.forceQuirks=!0,this.state=n.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const u=this.currentToken;switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:{this.state=n.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case r.QUOTATION_MARK:{this._err(E.missingWhitespaceAfterDoctypeSystemKeyword),u.systemId="",this.state=n.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case r.APOSTROPHE:{this._err(E.missingWhitespaceAfterDoctypeSystemKeyword),u.systemId="",this.state=n.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case r.GREATER_THAN_SIGN:{this._err(E.missingDoctypeSystemIdentifier),u.forceQuirks=!0,this.state=n.DATA,this.emitCurrentDoctype(u);break}case r.EOF:{this._err(E.eofInDoctype),u.forceQuirks=!0,this.emitCurrentDoctype(u),this._emitEOFToken();break}default:this._err(E.missingQuoteBeforeDoctypeSystemIdentifier),u.forceQuirks=!0,this.state=n.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const u=this.currentToken;switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:break;case r.QUOTATION_MARK:{u.systemId="",this.state=n.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case r.APOSTROPHE:{u.systemId="",this.state=n.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case r.GREATER_THAN_SIGN:{this._err(E.missingDoctypeSystemIdentifier),u.forceQuirks=!0,this.state=n.DATA,this.emitCurrentDoctype(u);break}case r.EOF:{this._err(E.eofInDoctype),u.forceQuirks=!0,this.emitCurrentDoctype(u),this._emitEOFToken();break}default:this._err(E.missingQuoteBeforeDoctypeSystemIdentifier),u.forceQuirks=!0,this.state=n.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const u=this.currentToken;switch(t){case r.QUOTATION_MARK:{this.state=n.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case r.NULL:{this._err(E.unexpectedNullCharacter),u.systemId+=p;break}case r.GREATER_THAN_SIGN:{this._err(E.abruptDoctypeSystemIdentifier),u.forceQuirks=!0,this.emitCurrentDoctype(u),this.state=n.DATA;break}case r.EOF:{this._err(E.eofInDoctype),u.forceQuirks=!0,this.emitCurrentDoctype(u),this._emitEOFToken();break}default:u.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const u=this.currentToken;switch(t){case r.APOSTROPHE:{this.state=n.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case r.NULL:{this._err(E.unexpectedNullCharacter),u.systemId+=p;break}case r.GREATER_THAN_SIGN:{this._err(E.abruptDoctypeSystemIdentifier),u.forceQuirks=!0,this.emitCurrentDoctype(u),this.state=n.DATA;break}case r.EOF:{this._err(E.eofInDoctype),u.forceQuirks=!0,this.emitCurrentDoctype(u),this._emitEOFToken();break}default:u.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const u=this.currentToken;switch(t){case r.SPACE:case r.LINE_FEED:case r.TABULATION:case r.FORM_FEED:break;case r.GREATER_THAN_SIGN:{this.emitCurrentDoctype(u),this.state=n.DATA;break}case r.EOF:{this._err(E.eofInDoctype),u.forceQuirks=!0,this.emitCurrentDoctype(u),this._emitEOFToken();break}default:this._err(E.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=n.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const u=this.currentToken;switch(t){case r.GREATER_THAN_SIGN:{this.emitCurrentDoctype(u),this.state=n.DATA;break}case r.NULL:{this._err(E.unexpectedNullCharacter);break}case r.EOF:{this.emitCurrentDoctype(u),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case r.RIGHT_SQUARE_BRACKET:{this.state=n.CDATA_SECTION_BRACKET;break}case r.EOF:{this._err(E.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===r.RIGHT_SQUARE_BRACKET?this.state=n.CDATA_SECTION_END:(this._emitChars("]"),this.state=n.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case r.GREATER_THAN_SIGN:{this.state=n.DATA;break}case r.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=n.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(r.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&$e(this.preprocessor.peek(1))?n.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){$e(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===r.SEMICOLON&&this._err(E.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const Ct=new Set([a.DD,a.DT,a.LI,a.OPTGROUP,a.OPTION,a.P,a.RB,a.RP,a.RT,a.RTC]),Ze=new Set([...Ct,a.CAPTION,a.COLGROUP,a.TBODY,a.TD,a.TFOOT,a.TH,a.THEAD,a.TR]),Ae=new Set([a.APPLET,a.CAPTION,a.HTML,a.MARQUEE,a.OBJECT,a.TABLE,a.TD,a.TEMPLATE,a.TH]),Xu=new Set([...Ae,a.OL,a.UL]),Ku=new Set([...Ae,a.BUTTON]),et=new Set([a.ANNOTATION_XML,a.MI,a.MN,a.MO,a.MS,a.MTEXT]),tt=new Set([a.DESC,a.FOREIGN_OBJECT,a.TITLE]),Vu=new Set([a.TR,a.TEMPLATE,a.HTML]),zu=new Set([a.TBODY,a.TFOOT,a.THEAD,a.TEMPLATE,a.HTML]),$u=new Set([a.TABLE,a.TEMPLATE,a.HTML]),Ju=new Set([a.TD,a.TH]);class Zu{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,u,s){this.treeAdapter=u,this.handler=s,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=a.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===a.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===f.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,u){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=u,this.currentTagId=u,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,u,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,u){const s=this._indexOf(t);this.items[s]=u,s===this.stackTop&&(this.current=u)}insertAfter(t,u,s){const c=this._indexOf(t)+1;this.items.splice(c,0,u),this.tagIDs.splice(c,0,s),this.stackTop++,c===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,c===this.stackTop)}popUntilTagNamePopped(t){let u=this.stackTop+1;do u=this.tagIDs.lastIndexOf(t,u-1);while(u>0&&this.treeAdapter.getNamespaceURI(this.items[u])!==f.HTML);this.shortenToLength(Math.max(u,0))}shortenToLength(t){for(;this.stackTop>=t;){const u=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(u,this.stackTop<t)}}popUntilElementPopped(t){const u=this._indexOf(t);this.shortenToLength(Math.max(u,0))}popUntilPopped(t,u){const s=this._indexOfTagNames(t,u);this.shortenToLength(Math.max(s,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Me,f.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Ju,f.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,u){for(let s=this.stackTop;s>=0;s--)if(t.has(this.tagIDs[s])&&this.treeAdapter.getNamespaceURI(this.items[s])===u)return s;return-1}clearBackTo(t,u){const s=this._indexOfTagNames(t,u);this.shortenToLength(s+1)}clearBackToTableContext(){this.clearBackTo($u,f.HTML)}clearBackToTableBodyContext(){this.clearBackTo(zu,f.HTML)}clearBackToTableRowContext(){this.clearBackTo(Vu,f.HTML)}remove(t){const u=this._indexOf(t);u>=0&&(u===this.stackTop?this.pop():(this.items.splice(u,1),this.tagIDs.splice(u,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===a.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const u=this._indexOf(t)-1;return u>=0?this.items[u]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===a.HTML}hasInDynamicScope(t,u){for(let s=this.stackTop;s>=0;s--){const c=this.tagIDs[s];switch(this.treeAdapter.getNamespaceURI(this.items[s])){case f.HTML:{if(c===t)return!0;if(u.has(c))return!1;break}case f.SVG:{if(tt.has(c))return!1;break}case f.MATHML:{if(et.has(c))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Ae)}hasInListItemScope(t){return this.hasInDynamicScope(t,Xu)}hasInButtonScope(t){return this.hasInDynamicScope(t,Ku)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const u=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case f.HTML:{if(Me.has(u))return!0;if(Ae.has(u))return!1;break}case f.SVG:{if(tt.has(u))return!1;break}case f.MATHML:{if(et.has(u))return!1;break}}}return!0}hasInTableScope(t){for(let u=this.stackTop;u>=0;u--)if(this.treeAdapter.getNamespaceURI(this.items[u])===f.HTML)switch(this.tagIDs[u]){case t:return!0;case a.TABLE:case a.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===f.HTML)switch(this.tagIDs[t]){case a.TBODY:case a.THEAD:case a.TFOOT:return!0;case a.TABLE:case a.HTML:return!1}return!0}hasInSelectScope(t){for(let u=this.stackTop;u>=0;u--)if(this.treeAdapter.getNamespaceURI(this.items[u])===f.HTML)switch(this.tagIDs[u]){case t:return!0;case a.OPTION:case a.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Ct.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Ze.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Ze.has(this.currentTagId);)this.pop()}}const Le=3;var v;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(v||(v={}));const ut={type:v.Marker};class ea{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,u){const s=[],c=u.length,o=this.treeAdapter.getTagName(t),l=this.treeAdapter.getNamespaceURI(t);for(let b=0;b<this.entries.length;b++){const m=this.entries[b];if(m.type===v.Marker)break;const{element:_}=m;if(this.treeAdapter.getTagName(_)===o&&this.treeAdapter.getNamespaceURI(_)===l){const C=this.treeAdapter.getAttrList(_);C.length===c&&s.push({idx:b,attrs:C})}}return s}_ensureNoahArkCondition(t){if(this.entries.length<Le)return;const u=this.treeAdapter.getAttrList(t),s=this._getNoahArkConditionCandidates(t,u);if(s.length<Le)return;const c=new Map(u.map(l=>[l.name,l.value]));let o=0;for(let l=0;l<s.length;l++){const b=s[l];b.attrs.every(m=>c.get(m.name)===m.value)&&(o+=1,o>=Le&&this.entries.splice(b.idx,1))}}insertMarker(){this.entries.unshift(ut)}pushElement(t,u){this._ensureNoahArkCondition(t),this.entries.unshift({type:v.Element,element:t,token:u})}insertElementAfterBookmark(t,u){const s=this.entries.indexOf(this.bookmark);this.entries.splice(s,0,{type:v.Element,element:t,token:u})}removeEntry(t){const u=this.entries.indexOf(t);u!==-1&&this.entries.splice(u,1)}clearToLastMarker(){const t=this.entries.indexOf(ut);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const u=this.entries.find(s=>s.type===v.Marker||this.treeAdapter.getTagName(s.element)===t);return u&&u.type===v.Element?u:null}getElementEntry(t){return this.entries.find(u=>u.type===v.Element&&u.element===t)}}const Q={createDocument(){return{nodeName:"#document",mode:y.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,u){return{nodeName:e,tagName:e,attrs:u,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,u){const s=e.childNodes.indexOf(u);e.childNodes.splice(s,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,u,s){const c=e.childNodes.find(o=>o.nodeName==="#documentType");if(c)c.name=t,c.publicId=u,c.systemId=s;else{const o={nodeName:"#documentType",name:t,publicId:u,systemId:s,parentNode:null};Q.appendChild(e,o)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const u=e.childNodes[e.childNodes.length-1];if(Q.isTextNode(u)){u.value+=t;return}}Q.appendChild(e,Q.createTextNode(t))},insertTextBefore(e,t,u){const s=e.childNodes[e.childNodes.indexOf(u)-1];s&&Q.isTextNode(s)?s.value+=t:Q.insertBefore(e,Q.createTextNode(t),u)},adoptAttributes(e,t){const u=new Set(e.attrs.map(s=>s.name));for(let s=0;s<t.length;s++)u.has(t[s].name)||e.attrs.push(t[s])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},gt="html",ta="about:legacy-compat",ua="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Ot=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],aa=[...Ot,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],sa=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),St=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],ra=[...St,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function at(e,t){return t.some(u=>e.startsWith(u))}function na(e){return e.name===gt&&e.publicId===null&&(e.systemId===null||e.systemId===ta)}function ia(e){if(e.name!==gt)return y.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===ua)return y.QUIRKS;let{publicId:u}=e;if(u!==null){if(u=u.toLowerCase(),sa.has(u))return y.QUIRKS;let s=t===null?aa:Ot;if(at(u,s))return y.QUIRKS;if(s=t===null?St:ra,at(u,s))return y.LIMITED_QUIRKS}return y.NO_QUIRKS}const st={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},ca="definitionurl",oa="definitionURL",da=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),la=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:f.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:f.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:f.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:f.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:f.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:f.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:f.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:f.XML}],["xml:space",{prefix:"xml",name:"space",namespace:f.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:f.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:f.XMLNS}]]),Ea=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),ha=new Set([a.B,a.BIG,a.BLOCKQUOTE,a.BODY,a.BR,a.CENTER,a.CODE,a.DD,a.DIV,a.DL,a.DT,a.EM,a.EMBED,a.H1,a.H2,a.H3,a.H4,a.H5,a.H6,a.HEAD,a.HR,a.I,a.IMG,a.LI,a.LISTING,a.MENU,a.META,a.NOBR,a.OL,a.P,a.PRE,a.RUBY,a.S,a.SMALL,a.SPAN,a.STRONG,a.STRIKE,a.SUB,a.SUP,a.TABLE,a.TT,a.U,a.UL,a.VAR]);function fa(e){const t=e.tagID;return t===a.FONT&&e.attrs.some(({name:s})=>s===X.COLOR||s===X.SIZE||s===X.FACE)||ha.has(t)}function Lt(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===ca){e.attrs[t].name=oa;break}}function Rt(e){for(let t=0;t<e.attrs.length;t++){const u=da.get(e.attrs[t].name);u!=null&&(e.attrs[t].name=u)}}function Fe(e){for(let t=0;t<e.attrs.length;t++){const u=la.get(e.attrs[t].name);u&&(e.attrs[t].prefix=u.prefix,e.attrs[t].name=u.name,e.attrs[t].namespace=u.namespace)}}function Ta(e){const t=Ea.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=ee(e.tagName))}function ma(e,t){return t===f.MATHML&&(e===a.MI||e===a.MO||e===a.MN||e===a.MS||e===a.MTEXT)}function ba(e,t,u){if(t===f.MATHML&&e===a.ANNOTATION_XML){for(let s=0;s<u.length;s++)if(u[s].name===X.ENCODING){const c=u[s].value.toLowerCase();return c===st.TEXT_HTML||c===st.APPLICATION_XML}}return t===f.SVG&&(e===a.FOREIGN_OBJECT||e===a.DESC||e===a.TITLE)}function _a(e,t,u,s){return(!s||s===f.HTML)&&ba(e,t,u)||(!s||s===f.MATHML)&&ma(e,t)}const Aa="hidden",Na=8,Ia=3;var i;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(i||(i={}));const pa={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Dt=new Set([a.TABLE,a.TBODY,a.TFOOT,a.THEAD,a.TR]),rt={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Q,onParseError:null};class nt{constructor(t,u,s=null,c=null){this.fragmentContext=s,this.scriptHandler=c,this.currentToken=null,this.stopped=!1,this.insertionMode=i.INITIAL,this.originalInsertionMode=i.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...rt,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=u??this.treeAdapter.createDocument(),this.tokenizer=new qu(this.options,this),this.activeFormattingElements=new ea(this.treeAdapter),this.fragmentContextID=s?ee(this.treeAdapter.getTagName(s)):a.UNKNOWN,this._setContextModes(s??this.document,this.fragmentContextID),this.openElements=new Zu(this.document,this.treeAdapter,this)}static parse(t,u){const s=new this(u);return s.tokenizer.write(t,!0),s.document}static getFragmentParser(t,u){const s={...rt,...u};t??(t=s.treeAdapter.createElement(d.TEMPLATE,f.HTML,[]));const c=s.treeAdapter.createElement("documentmock",f.HTML,[]),o=new this(s,c,t);return o.fragmentContextID===a.TEMPLATE&&o.tmplInsertionModeStack.unshift(i.IN_TEMPLATE),o._initTokenizerForFragmentParsing(),o._insertFakeRootElement(),o._resetInsertionMode(),o._findFormInFragmentContext(),o}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),u=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,u),u}_err(t,u,s){var c;if(!this.onParseError)return;const o=(c=t.location)!==null&&c!==void 0?c:pa,l={code:u,startLine:o.startLine,startCol:o.startCol,startOffset:o.startOffset,endLine:s?o.startLine:o.endLine,endCol:s?o.startCol:o.endCol,endOffset:s?o.startOffset:o.endOffset};this.onParseError(l)}onItemPush(t,u,s){var c,o;(o=(c=this.treeAdapter).onItemPush)===null||o===void 0||o.call(c,t),s&&this.openElements.stackTop>0&&this._setContextModes(t,u)}onItemPop(t,u){var s,c;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(c=(s=this.treeAdapter).onItemPop)===null||c===void 0||c.call(s,t,this.openElements.current),u){let o,l;this.openElements.stackTop===0&&this.fragmentContext?(o=this.fragmentContext,l=this.fragmentContextID):{current:o,currentTagId:l}=this.openElements,this._setContextModes(o,l)}}_setContextModes(t,u){const s=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===f.HTML;this.currentNotInHTML=!s,this.tokenizer.inForeignNode=!s&&t!==void 0&&u!==void 0&&!this._isIntegrationPoint(u,t)}_switchToTextParsing(t,u){this._insertElement(t,f.HTML),this.tokenizer.state=u,this.originalInsertionMode=this.insertionMode,this.insertionMode=i.TEXT}switchToPlaintextParsing(){this.insertionMode=i.TEXT,this.originalInsertionMode=i.IN_BODY,this.tokenizer.state=g.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===d.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==f.HTML))switch(this.fragmentContextID){case a.TITLE:case a.TEXTAREA:{this.tokenizer.state=g.RCDATA;break}case a.STYLE:case a.XMP:case a.IFRAME:case a.NOEMBED:case a.NOFRAMES:case a.NOSCRIPT:{this.tokenizer.state=g.RAWTEXT;break}case a.SCRIPT:{this.tokenizer.state=g.SCRIPT_DATA;break}case a.PLAINTEXT:{this.tokenizer.state=g.PLAINTEXT;break}}}_setDocumentType(t){const u=t.name||"",s=t.publicId||"",c=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,u,s,c),t.location){const l=this.treeAdapter.getChildNodes(this.document).find(b=>this.treeAdapter.isDocumentTypeNode(b));l&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}}_attachElementToTree(t,u){if(this.options.sourceCodeLocationInfo){const s=u&&{...u,startTag:u};this.treeAdapter.setNodeSourceCodeLocation(t,s)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const s=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(s??this.document,t)}}_appendElement(t,u){const s=this.treeAdapter.createElement(t.tagName,u,t.attrs);this._attachElementToTree(s,t.location)}_insertElement(t,u){const s=this.treeAdapter.createElement(t.tagName,u,t.attrs);this._attachElementToTree(s,t.location),this.openElements.push(s,t.tagID)}_insertFakeElement(t,u){const s=this.treeAdapter.createElement(t,f.HTML,[]);this._attachElementToTree(s,null),this.openElements.push(s,u)}_insertTemplate(t){const u=this.treeAdapter.createElement(t.tagName,f.HTML,t.attrs),s=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(u,s),this._attachElementToTree(u,t.location),this.openElements.push(u,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(d.HTML,f.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,a.HTML)}_appendCommentNode(t,u){const s=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(u,s),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}_insertCharacters(t){let u,s;if(this._shouldFosterParentOnInsertion()?({parent:u,beforeElement:s}=this._findFosterParentingLocation(),s?this.treeAdapter.insertTextBefore(u,t.chars,s):this.treeAdapter.insertText(u,t.chars)):(u=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(u,t.chars)),!t.location)return;const c=this.treeAdapter.getChildNodes(u),o=s?c.lastIndexOf(s):c.length,l=c[o-1];if(this.treeAdapter.getNodeSourceCodeLocation(l)){const{endLine:m,endCol:_,endOffset:C}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:m,endCol:_,endOffset:C})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}_adoptNodes(t,u){for(let s=this.treeAdapter.getFirstChild(t);s;s=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(s),this.treeAdapter.appendChild(u,s)}_setEndLocation(t,u){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&u.location){const s=u.location,c=this.treeAdapter.getTagName(t),o=u.type===N.END_TAG&&c===u.tagName?{endTag:{...s},endLine:s.endLine,endCol:s.endCol,endOffset:s.endOffset}:{endLine:s.startLine,endCol:s.startCol,endOffset:s.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,o)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let u,s;return this.openElements.stackTop===0&&this.fragmentContext?(u=this.fragmentContext,s=this.fragmentContextID):{current:u,currentTagId:s}=this.openElements,t.tagID===a.SVG&&this.treeAdapter.getTagName(u)===d.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(u)===f.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===a.MGLYPH||t.tagID===a.MALIGNMARK)&&s!==void 0&&!this._isIntegrationPoint(s,u,f.HTML)}_processToken(t){switch(t.type){case N.CHARACTER:{this.onCharacter(t);break}case N.NULL_CHARACTER:{this.onNullCharacter(t);break}case N.COMMENT:{this.onComment(t);break}case N.DOCTYPE:{this.onDoctype(t);break}case N.START_TAG:{this._processStartTag(t);break}case N.END_TAG:{this.onEndTag(t);break}case N.EOF:{this.onEof(t);break}case N.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,u,s){const c=this.treeAdapter.getNamespaceURI(u),o=this.treeAdapter.getAttrList(u);return _a(t,c,o,s)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const u=this.activeFormattingElements.entries.findIndex(c=>c.type===v.Marker||this.openElements.contains(c.element)),s=u===-1?t-1:u-1;for(let c=s;c>=0;c--){const o=this.activeFormattingElements.entries[c];this._insertElement(o.token,this.treeAdapter.getNamespaceURI(o.element)),o.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=i.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(a.P),this.openElements.popUntilTagNamePopped(a.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case a.TR:{this.insertionMode=i.IN_ROW;return}case a.TBODY:case a.THEAD:case a.TFOOT:{this.insertionMode=i.IN_TABLE_BODY;return}case a.CAPTION:{this.insertionMode=i.IN_CAPTION;return}case a.COLGROUP:{this.insertionMode=i.IN_COLUMN_GROUP;return}case a.TABLE:{this.insertionMode=i.IN_TABLE;return}case a.BODY:{this.insertionMode=i.IN_BODY;return}case a.FRAMESET:{this.insertionMode=i.IN_FRAMESET;return}case a.SELECT:{this._resetInsertionModeForSelect(t);return}case a.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case a.HTML:{this.insertionMode=this.headElement?i.AFTER_HEAD:i.BEFORE_HEAD;return}case a.TD:case a.TH:{if(t>0){this.insertionMode=i.IN_CELL;return}break}case a.HEAD:{if(t>0){this.insertionMode=i.IN_HEAD;return}break}}this.insertionMode=i.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let u=t-1;u>0;u--){const s=this.openElements.tagIDs[u];if(s===a.TEMPLATE)break;if(s===a.TABLE){this.insertionMode=i.IN_SELECT_IN_TABLE;return}}this.insertionMode=i.IN_SELECT}_isElementCausesFosterParenting(t){return Dt.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const u=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case a.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(u)===f.HTML)return{parent:this.treeAdapter.getTemplateContent(u),beforeElement:null};break}case a.TABLE:{const s=this.treeAdapter.getParentNode(u);return s?{parent:s,beforeElement:u}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const u=this._findFosterParentingLocation();u.beforeElement?this.treeAdapter.insertBefore(u.parent,t,u.beforeElement):this.treeAdapter.appendChild(u.parent,t)}_isSpecialElement(t,u){const s=this.treeAdapter.getNamespaceURI(t);return ju[s].has(u)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Js(this,t);return}switch(this.insertionMode){case i.INITIAL:{ae(this,t);break}case i.BEFORE_HTML:{ne(this,t);break}case i.BEFORE_HEAD:{ie(this,t);break}case i.IN_HEAD:{ce(this,t);break}case i.IN_HEAD_NO_SCRIPT:{oe(this,t);break}case i.AFTER_HEAD:{de(this,t);break}case i.IN_BODY:case i.IN_CAPTION:case i.IN_CELL:case i.IN_TEMPLATE:{Pt(this,t);break}case i.TEXT:case i.IN_SELECT:case i.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case i.IN_TABLE:case i.IN_TABLE_BODY:case i.IN_ROW:{Re(this,t);break}case i.IN_TABLE_TEXT:{Ut(this,t);break}case i.IN_COLUMN_GROUP:{Ne(this,t);break}case i.AFTER_BODY:{Ie(this,t);break}case i.AFTER_AFTER_BODY:{_e(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){$s(this,t);return}switch(this.insertionMode){case i.INITIAL:{ae(this,t);break}case i.BEFORE_HTML:{ne(this,t);break}case i.BEFORE_HEAD:{ie(this,t);break}case i.IN_HEAD:{ce(this,t);break}case i.IN_HEAD_NO_SCRIPT:{oe(this,t);break}case i.AFTER_HEAD:{de(this,t);break}case i.TEXT:{this._insertCharacters(t);break}case i.IN_TABLE:case i.IN_TABLE_BODY:case i.IN_ROW:{Re(this,t);break}case i.IN_COLUMN_GROUP:{Ne(this,t);break}case i.AFTER_BODY:{Ie(this,t);break}case i.AFTER_AFTER_BODY:{_e(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){ke(this,t);return}switch(this.insertionMode){case i.INITIAL:case i.BEFORE_HTML:case i.BEFORE_HEAD:case i.IN_HEAD:case i.IN_HEAD_NO_SCRIPT:case i.AFTER_HEAD:case i.IN_BODY:case i.IN_TABLE:case i.IN_CAPTION:case i.IN_COLUMN_GROUP:case i.IN_TABLE_BODY:case i.IN_ROW:case i.IN_CELL:case i.IN_SELECT:case i.IN_SELECT_IN_TABLE:case i.IN_TEMPLATE:case i.IN_FRAMESET:case i.AFTER_FRAMESET:{ke(this,t);break}case i.IN_TABLE_TEXT:{se(this,t);break}case i.AFTER_BODY:{Da(this,t);break}case i.AFTER_AFTER_BODY:case i.AFTER_AFTER_FRAMESET:{xa(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case i.INITIAL:{Pa(this,t);break}case i.BEFORE_HEAD:case i.IN_HEAD:case i.IN_HEAD_NO_SCRIPT:case i.AFTER_HEAD:{this._err(t,E.misplacedDoctype);break}case i.IN_TABLE_TEXT:{se(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,E.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Zs(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case i.INITIAL:{ae(this,t);break}case i.BEFORE_HTML:{Ma(this,t);break}case i.BEFORE_HEAD:{Ba(this,t);break}case i.IN_HEAD:{U(this,t);break}case i.IN_HEAD_NO_SCRIPT:{Ua(this,t);break}case i.AFTER_HEAD:{wa(this,t);break}case i.IN_BODY:{x(this,t);break}case i.IN_TABLE:{J(this,t);break}case i.IN_TABLE_TEXT:{se(this,t);break}case i.IN_CAPTION:{Hs(this,t);break}case i.IN_COLUMN_GROUP:{Ye(this,t);break}case i.IN_TABLE_BODY:{Oe(this,t);break}case i.IN_ROW:{Se(this,t);break}case i.IN_CELL:{Fs(this,t);break}case i.IN_SELECT:{vt(this,t);break}case i.IN_SELECT_IN_TABLE:{vs(this,t);break}case i.IN_TEMPLATE:{js(this,t);break}case i.AFTER_BODY:{Qs(this,t);break}case i.IN_FRAMESET:{Gs(this,t);break}case i.AFTER_FRAMESET:{Xs(this,t);break}case i.AFTER_AFTER_BODY:{Vs(this,t);break}case i.AFTER_AFTER_FRAMESET:{zs(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?er(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case i.INITIAL:{ae(this,t);break}case i.BEFORE_HTML:{ka(this,t);break}case i.BEFORE_HEAD:{Ha(this,t);break}case i.IN_HEAD:{ya(this,t);break}case i.IN_HEAD_NO_SCRIPT:{Fa(this,t);break}case i.AFTER_HEAD:{va(this,t);break}case i.IN_BODY:{ge(this,t);break}case i.TEXT:{Os(this,t);break}case i.IN_TABLE:{le(this,t);break}case i.IN_TABLE_TEXT:{se(this,t);break}case i.IN_CAPTION:{ys(this,t);break}case i.IN_COLUMN_GROUP:{Us(this,t);break}case i.IN_TABLE_BODY:{Be(this,t);break}case i.IN_ROW:{wt(this,t);break}case i.IN_CELL:{ws(this,t);break}case i.IN_SELECT:{Yt(this,t);break}case i.IN_SELECT_IN_TABLE:{Ys(this,t);break}case i.IN_TEMPLATE:{Ws(this,t);break}case i.AFTER_BODY:{Wt(this,t);break}case i.IN_FRAMESET:{qs(this,t);break}case i.AFTER_FRAMESET:{Ks(this,t);break}case i.AFTER_AFTER_BODY:{_e(this,t);break}}}onEof(t){switch(this.insertionMode){case i.INITIAL:{ae(this,t);break}case i.BEFORE_HTML:{ne(this,t);break}case i.BEFORE_HEAD:{ie(this,t);break}case i.IN_HEAD:{ce(this,t);break}case i.IN_HEAD_NO_SCRIPT:{oe(this,t);break}case i.AFTER_HEAD:{de(this,t);break}case i.IN_BODY:case i.IN_TABLE:case i.IN_CAPTION:case i.IN_COLUMN_GROUP:case i.IN_TABLE_BODY:case i.IN_ROW:case i.IN_CELL:case i.IN_SELECT:case i.IN_SELECT_IN_TABLE:{Ht(this,t);break}case i.TEXT:{Ss(this,t);break}case i.IN_TABLE_TEXT:{se(this,t);break}case i.IN_TEMPLATE:{jt(this,t);break}case i.AFTER_BODY:case i.IN_FRAMESET:case i.AFTER_FRAMESET:case i.AFTER_AFTER_BODY:case i.AFTER_AFTER_FRAMESET:{ve(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===r.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case i.IN_HEAD:case i.IN_HEAD_NO_SCRIPT:case i.AFTER_HEAD:case i.TEXT:case i.IN_COLUMN_GROUP:case i.IN_SELECT:case i.IN_SELECT_IN_TABLE:case i.IN_FRAMESET:case i.AFTER_FRAMESET:{this._insertCharacters(t);break}case i.IN_BODY:case i.IN_CAPTION:case i.IN_CELL:case i.IN_TEMPLATE:case i.AFTER_BODY:case i.AFTER_AFTER_BODY:case i.AFTER_AFTER_FRAMESET:{xt(this,t);break}case i.IN_TABLE:case i.IN_TABLE_BODY:case i.IN_ROW:{Re(this,t);break}case i.IN_TABLE_TEXT:{yt(this,t);break}}}}function Ca(e,t){let u=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return u?e.openElements.contains(u.element)?e.openElements.hasInScope(t.tagID)||(u=null):(e.activeFormattingElements.removeEntry(u),u=null):Bt(e,t),u}function ga(e,t){let u=null,s=e.openElements.stackTop;for(;s>=0;s--){const c=e.openElements.items[s];if(c===t.element)break;e._isSpecialElement(c,e.openElements.tagIDs[s])&&(u=c)}return u||(e.openElements.shortenToLength(Math.max(s,0)),e.activeFormattingElements.removeEntry(t)),u}function Oa(e,t,u){let s=t,c=e.openElements.getCommonAncestor(t);for(let o=0,l=c;l!==u;o++,l=c){c=e.openElements.getCommonAncestor(l);const b=e.activeFormattingElements.getElementEntry(l),m=b&&o>=Ia;!b||m?(m&&e.activeFormattingElements.removeEntry(b),e.openElements.remove(l)):(l=Sa(e,b),s===t&&(e.activeFormattingElements.bookmark=b),e.treeAdapter.detachNode(s),e.treeAdapter.appendChild(l,s),s=l)}return s}function Sa(e,t){const u=e.treeAdapter.getNamespaceURI(t.element),s=e.treeAdapter.createElement(t.token.tagName,u,t.token.attrs);return e.openElements.replace(t.element,s),t.element=s,s}function La(e,t,u){const s=e.treeAdapter.getTagName(t),c=ee(s);if(e._isElementCausesFosterParenting(c))e._fosterParentElement(u);else{const o=e.treeAdapter.getNamespaceURI(t);c===a.TEMPLATE&&o===f.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,u)}}function Ra(e,t,u){const s=e.treeAdapter.getNamespaceURI(u.element),{token:c}=u,o=e.treeAdapter.createElement(c.tagName,s,c.attrs);e._adoptNodes(t,o),e.treeAdapter.appendChild(t,o),e.activeFormattingElements.insertElementAfterBookmark(o,c),e.activeFormattingElements.removeEntry(u),e.openElements.remove(u.element),e.openElements.insertAfter(t,o,c.tagID)}function we(e,t){for(let u=0;u<Na;u++){const s=Ca(e,t);if(!s)break;const c=ga(e,s);if(!c)break;e.activeFormattingElements.bookmark=s;const o=Oa(e,c,s.element),l=e.openElements.getCommonAncestor(s.element);e.treeAdapter.detachNode(o),l&&La(e,l,o),Ra(e,c,s)}}function ke(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Da(e,t){e._appendCommentNode(t,e.openElements.items[0])}function xa(e,t){e._appendCommentNode(t,e.document)}function ve(e,t){if(e.stopped=!0,t.location){const u=e.fragmentContext?0:2;for(let s=e.openElements.stackTop;s>=u;s--)e._setEndLocation(e.openElements.items[s],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const s=e.openElements.items[0],c=e.treeAdapter.getNodeSourceCodeLocation(s);if(c&&!c.endTag&&(e._setEndLocation(s,t),e.openElements.stackTop>=1)){const o=e.openElements.items[1],l=e.treeAdapter.getNodeSourceCodeLocation(o);l&&!l.endTag&&e._setEndLocation(o,t)}}}}function Pa(e,t){e._setDocumentType(t);const u=t.forceQuirks?y.QUIRKS:ia(t);na(t)||e._err(t,E.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,u),e.insertionMode=i.BEFORE_HTML}function ae(e,t){e._err(t,E.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,y.QUIRKS),e.insertionMode=i.BEFORE_HTML,e._processToken(t)}function Ma(e,t){t.tagID===a.HTML?(e._insertElement(t,f.HTML),e.insertionMode=i.BEFORE_HEAD):ne(e,t)}function ka(e,t){const u=t.tagID;(u===a.HTML||u===a.HEAD||u===a.BODY||u===a.BR)&&ne(e,t)}function ne(e,t){e._insertFakeRootElement(),e.insertionMode=i.BEFORE_HEAD,e._processToken(t)}function Ba(e,t){switch(t.tagID){case a.HTML:{x(e,t);break}case a.HEAD:{e._insertElement(t,f.HTML),e.headElement=e.openElements.current,e.insertionMode=i.IN_HEAD;break}default:ie(e,t)}}function Ha(e,t){const u=t.tagID;u===a.HEAD||u===a.BODY||u===a.HTML||u===a.BR?ie(e,t):e._err(t,E.endTagWithoutMatchingOpenElement)}function ie(e,t){e._insertFakeElement(d.HEAD,a.HEAD),e.headElement=e.openElements.current,e.insertionMode=i.IN_HEAD,e._processToken(t)}function U(e,t){switch(t.tagID){case a.HTML:{x(e,t);break}case a.BASE:case a.BASEFONT:case a.BGSOUND:case a.LINK:case a.META:{e._appendElement(t,f.HTML),t.ackSelfClosing=!0;break}case a.TITLE:{e._switchToTextParsing(t,g.RCDATA);break}case a.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,g.RAWTEXT):(e._insertElement(t,f.HTML),e.insertionMode=i.IN_HEAD_NO_SCRIPT);break}case a.NOFRAMES:case a.STYLE:{e._switchToTextParsing(t,g.RAWTEXT);break}case a.SCRIPT:{e._switchToTextParsing(t,g.SCRIPT_DATA);break}case a.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=i.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(i.IN_TEMPLATE);break}case a.HEAD:{e._err(t,E.misplacedStartTagForHeadElement);break}default:ce(e,t)}}function ya(e,t){switch(t.tagID){case a.HEAD:{e.openElements.pop(),e.insertionMode=i.AFTER_HEAD;break}case a.BODY:case a.BR:case a.HTML:{ce(e,t);break}case a.TEMPLATE:{V(e,t);break}default:e._err(t,E.endTagWithoutMatchingOpenElement)}}function V(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==a.TEMPLATE&&e._err(t,E.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(a.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,E.endTagWithoutMatchingOpenElement)}function ce(e,t){e.openElements.pop(),e.insertionMode=i.AFTER_HEAD,e._processToken(t)}function Ua(e,t){switch(t.tagID){case a.HTML:{x(e,t);break}case a.BASEFONT:case a.BGSOUND:case a.HEAD:case a.LINK:case a.META:case a.NOFRAMES:case a.STYLE:{U(e,t);break}case a.NOSCRIPT:{e._err(t,E.nestedNoscriptInHead);break}default:oe(e,t)}}function Fa(e,t){switch(t.tagID){case a.NOSCRIPT:{e.openElements.pop(),e.insertionMode=i.IN_HEAD;break}case a.BR:{oe(e,t);break}default:e._err(t,E.endTagWithoutMatchingOpenElement)}}function oe(e,t){const u=t.type===N.EOF?E.openElementsLeftAfterEof:E.disallowedContentInNoscriptInHead;e._err(t,u),e.openElements.pop(),e.insertionMode=i.IN_HEAD,e._processToken(t)}function wa(e,t){switch(t.tagID){case a.HTML:{x(e,t);break}case a.BODY:{e._insertElement(t,f.HTML),e.framesetOk=!1,e.insertionMode=i.IN_BODY;break}case a.FRAMESET:{e._insertElement(t,f.HTML),e.insertionMode=i.IN_FRAMESET;break}case a.BASE:case a.BASEFONT:case a.BGSOUND:case a.LINK:case a.META:case a.NOFRAMES:case a.SCRIPT:case a.STYLE:case a.TEMPLATE:case a.TITLE:{e._err(t,E.abandonedHeadElementChild),e.openElements.push(e.headElement,a.HEAD),U(e,t),e.openElements.remove(e.headElement);break}case a.HEAD:{e._err(t,E.misplacedStartTagForHeadElement);break}default:de(e,t)}}function va(e,t){switch(t.tagID){case a.BODY:case a.HTML:case a.BR:{de(e,t);break}case a.TEMPLATE:{V(e,t);break}default:e._err(t,E.endTagWithoutMatchingOpenElement)}}function de(e,t){e._insertFakeElement(d.BODY,a.BODY),e.insertionMode=i.IN_BODY,Ce(e,t)}function Ce(e,t){switch(t.type){case N.CHARACTER:{Pt(e,t);break}case N.WHITESPACE_CHARACTER:{xt(e,t);break}case N.COMMENT:{ke(e,t);break}case N.START_TAG:{x(e,t);break}case N.END_TAG:{ge(e,t);break}case N.EOF:{Ht(e,t);break}}}function xt(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Pt(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Ya(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function ja(e,t){const u=e.openElements.tryPeekProperlyNestedBodyElement();u&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(u,t.attrs))}function Wa(e,t){const u=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&u&&(e.treeAdapter.detachNode(u),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,f.HTML),e.insertionMode=i.IN_FRAMESET)}function Qa(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,f.HTML)}function Ga(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Me.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,f.HTML)}function qa(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,f.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Xa(e,t){const u=e.openElements.tmplCount>0;(!e.formElement||u)&&(e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,f.HTML),u||(e.formElement=e.openElements.current))}function Ka(e,t){e.framesetOk=!1;const u=t.tagID;for(let s=e.openElements.stackTop;s>=0;s--){const c=e.openElements.tagIDs[s];if(u===a.LI&&c===a.LI||(u===a.DD||u===a.DT)&&(c===a.DD||c===a.DT)){e.openElements.generateImpliedEndTagsWithExclusion(c),e.openElements.popUntilTagNamePopped(c);break}if(c!==a.ADDRESS&&c!==a.DIV&&c!==a.P&&e._isSpecialElement(e.openElements.items[s],c))break}e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,f.HTML)}function Va(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,f.HTML),e.tokenizer.state=g.PLAINTEXT}function za(e,t){e.openElements.hasInScope(a.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,f.HTML),e.framesetOk=!1}function $a(e,t){const u=e.activeFormattingElements.getElementEntryInScopeWithTagName(d.A);u&&(we(e,t),e.openElements.remove(u.element),e.activeFormattingElements.removeEntry(u)),e._reconstructActiveFormattingElements(),e._insertElement(t,f.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Ja(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,f.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Za(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(a.NOBR)&&(we(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,f.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function es(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,f.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function ts(e,t){e.treeAdapter.getDocumentMode(e.document)!==y.QUIRKS&&e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._insertElement(t,f.HTML),e.framesetOk=!1,e.insertionMode=i.IN_TABLE}function Mt(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,f.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function kt(e){const t=It(e,X.TYPE);return t!=null&&t.toLowerCase()===Aa}function us(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,f.HTML),kt(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function as(e,t){e._appendElement(t,f.HTML),t.ackSelfClosing=!0}function ss(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._appendElement(t,f.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function rs(e,t){t.tagName=d.IMG,t.tagID=a.IMG,Mt(e,t)}function ns(e,t){e._insertElement(t,f.HTML),e.skipNextNewLine=!0,e.tokenizer.state=g.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=i.TEXT}function is(e,t){e.openElements.hasInButtonScope(a.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,g.RAWTEXT)}function cs(e,t){e.framesetOk=!1,e._switchToTextParsing(t,g.RAWTEXT)}function it(e,t){e._switchToTextParsing(t,g.RAWTEXT)}function os(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,f.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===i.IN_TABLE||e.insertionMode===i.IN_CAPTION||e.insertionMode===i.IN_TABLE_BODY||e.insertionMode===i.IN_ROW||e.insertionMode===i.IN_CELL?i.IN_SELECT_IN_TABLE:i.IN_SELECT}function ds(e,t){e.openElements.currentTagId===a.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,f.HTML)}function ls(e,t){e.openElements.hasInScope(a.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,f.HTML)}function Es(e,t){e.openElements.hasInScope(a.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(a.RTC),e._insertElement(t,f.HTML)}function hs(e,t){e._reconstructActiveFormattingElements(),Lt(t),Fe(t),t.selfClosing?e._appendElement(t,f.MATHML):e._insertElement(t,f.MATHML),t.ackSelfClosing=!0}function fs(e,t){e._reconstructActiveFormattingElements(),Rt(t),Fe(t),t.selfClosing?e._appendElement(t,f.SVG):e._insertElement(t,f.SVG),t.ackSelfClosing=!0}function ct(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,f.HTML)}function x(e,t){switch(t.tagID){case a.I:case a.S:case a.B:case a.U:case a.EM:case a.TT:case a.BIG:case a.CODE:case a.FONT:case a.SMALL:case a.STRIKE:case a.STRONG:{Ja(e,t);break}case a.A:{$a(e,t);break}case a.H1:case a.H2:case a.H3:case a.H4:case a.H5:case a.H6:{Ga(e,t);break}case a.P:case a.DL:case a.OL:case a.UL:case a.DIV:case a.DIR:case a.NAV:case a.MAIN:case a.MENU:case a.ASIDE:case a.CENTER:case a.FIGURE:case a.FOOTER:case a.HEADER:case a.HGROUP:case a.DIALOG:case a.DETAILS:case a.ADDRESS:case a.ARTICLE:case a.SEARCH:case a.SECTION:case a.SUMMARY:case a.FIELDSET:case a.BLOCKQUOTE:case a.FIGCAPTION:{Qa(e,t);break}case a.LI:case a.DD:case a.DT:{Ka(e,t);break}case a.BR:case a.IMG:case a.WBR:case a.AREA:case a.EMBED:case a.KEYGEN:{Mt(e,t);break}case a.HR:{ss(e,t);break}case a.RB:case a.RTC:{ls(e,t);break}case a.RT:case a.RP:{Es(e,t);break}case a.PRE:case a.LISTING:{qa(e,t);break}case a.XMP:{is(e,t);break}case a.SVG:{fs(e,t);break}case a.HTML:{Ya(e,t);break}case a.BASE:case a.LINK:case a.META:case a.STYLE:case a.TITLE:case a.SCRIPT:case a.BGSOUND:case a.BASEFONT:case a.TEMPLATE:{U(e,t);break}case a.BODY:{ja(e,t);break}case a.FORM:{Xa(e,t);break}case a.NOBR:{Za(e,t);break}case a.MATH:{hs(e,t);break}case a.TABLE:{ts(e,t);break}case a.INPUT:{us(e,t);break}case a.PARAM:case a.TRACK:case a.SOURCE:{as(e,t);break}case a.IMAGE:{rs(e,t);break}case a.BUTTON:{za(e,t);break}case a.APPLET:case a.OBJECT:case a.MARQUEE:{es(e,t);break}case a.IFRAME:{cs(e,t);break}case a.SELECT:{os(e,t);break}case a.OPTION:case a.OPTGROUP:{ds(e,t);break}case a.NOEMBED:case a.NOFRAMES:{it(e,t);break}case a.FRAMESET:{Wa(e,t);break}case a.TEXTAREA:{ns(e,t);break}case a.NOSCRIPT:{e.options.scriptingEnabled?it(e,t):ct(e,t);break}case a.PLAINTEXT:{Va(e,t);break}case a.COL:case a.TH:case a.TD:case a.TR:case a.HEAD:case a.FRAME:case a.TBODY:case a.TFOOT:case a.THEAD:case a.CAPTION:case a.COLGROUP:break;default:ct(e,t)}}function Ts(e,t){if(e.openElements.hasInScope(a.BODY)&&(e.insertionMode=i.AFTER_BODY,e.options.sourceCodeLocationInfo)){const u=e.openElements.tryPeekProperlyNestedBodyElement();u&&e._setEndLocation(u,t)}}function ms(e,t){e.openElements.hasInScope(a.BODY)&&(e.insertionMode=i.AFTER_BODY,Wt(e,t))}function bs(e,t){const u=t.tagID;e.openElements.hasInScope(u)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(u))}function _s(e){const t=e.openElements.tmplCount>0,{formElement:u}=e;t||(e.formElement=null),(u||t)&&e.openElements.hasInScope(a.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(a.FORM):u&&e.openElements.remove(u))}function As(e){e.openElements.hasInButtonScope(a.P)||e._insertFakeElement(d.P,a.P),e._closePElement()}function Ns(e){e.openElements.hasInListItemScope(a.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(a.LI),e.openElements.popUntilTagNamePopped(a.LI))}function Is(e,t){const u=t.tagID;e.openElements.hasInScope(u)&&(e.openElements.generateImpliedEndTagsWithExclusion(u),e.openElements.popUntilTagNamePopped(u))}function ps(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Cs(e,t){const u=t.tagID;e.openElements.hasInScope(u)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(u),e.activeFormattingElements.clearToLastMarker())}function gs(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(d.BR,a.BR),e.openElements.pop(),e.framesetOk=!1}function Bt(e,t){const u=t.tagName,s=t.tagID;for(let c=e.openElements.stackTop;c>0;c--){const o=e.openElements.items[c],l=e.openElements.tagIDs[c];if(s===l&&(s!==a.UNKNOWN||e.treeAdapter.getTagName(o)===u)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.stackTop>=c&&e.openElements.shortenToLength(c);break}if(e._isSpecialElement(o,l))break}}function ge(e,t){switch(t.tagID){case a.A:case a.B:case a.I:case a.S:case a.U:case a.EM:case a.TT:case a.BIG:case a.CODE:case a.FONT:case a.NOBR:case a.SMALL:case a.STRIKE:case a.STRONG:{we(e,t);break}case a.P:{As(e);break}case a.DL:case a.UL:case a.OL:case a.DIR:case a.DIV:case a.NAV:case a.PRE:case a.MAIN:case a.MENU:case a.ASIDE:case a.BUTTON:case a.CENTER:case a.FIGURE:case a.FOOTER:case a.HEADER:case a.HGROUP:case a.DIALOG:case a.ADDRESS:case a.ARTICLE:case a.DETAILS:case a.SEARCH:case a.SECTION:case a.SUMMARY:case a.LISTING:case a.FIELDSET:case a.BLOCKQUOTE:case a.FIGCAPTION:{bs(e,t);break}case a.LI:{Ns(e);break}case a.DD:case a.DT:{Is(e,t);break}case a.H1:case a.H2:case a.H3:case a.H4:case a.H5:case a.H6:{ps(e);break}case a.BR:{gs(e);break}case a.BODY:{Ts(e,t);break}case a.HTML:{ms(e,t);break}case a.FORM:{_s(e);break}case a.APPLET:case a.OBJECT:case a.MARQUEE:{Cs(e,t);break}case a.TEMPLATE:{V(e,t);break}default:Bt(e,t)}}function Ht(e,t){e.tmplInsertionModeStack.length>0?jt(e,t):ve(e,t)}function Os(e,t){var u;t.tagID===a.SCRIPT&&((u=e.scriptHandler)===null||u===void 0||u.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Ss(e,t){e._err(t,E.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Re(e,t){if(e.openElements.currentTagId!==void 0&&Dt.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=i.IN_TABLE_TEXT,t.type){case N.CHARACTER:{Ut(e,t);break}case N.WHITESPACE_CHARACTER:{yt(e,t);break}}else he(e,t)}function Ls(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,f.HTML),e.insertionMode=i.IN_CAPTION}function Rs(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,f.HTML),e.insertionMode=i.IN_COLUMN_GROUP}function Ds(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(d.COLGROUP,a.COLGROUP),e.insertionMode=i.IN_COLUMN_GROUP,Ye(e,t)}function xs(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,f.HTML),e.insertionMode=i.IN_TABLE_BODY}function Ps(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(d.TBODY,a.TBODY),e.insertionMode=i.IN_TABLE_BODY,Oe(e,t)}function Ms(e,t){e.openElements.hasInTableScope(a.TABLE)&&(e.openElements.popUntilTagNamePopped(a.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function ks(e,t){kt(t)?e._appendElement(t,f.HTML):he(e,t),t.ackSelfClosing=!0}function Bs(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,f.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function J(e,t){switch(t.tagID){case a.TD:case a.TH:case a.TR:{Ps(e,t);break}case a.STYLE:case a.SCRIPT:case a.TEMPLATE:{U(e,t);break}case a.COL:{Ds(e,t);break}case a.FORM:{Bs(e,t);break}case a.TABLE:{Ms(e,t);break}case a.TBODY:case a.TFOOT:case a.THEAD:{xs(e,t);break}case a.INPUT:{ks(e,t);break}case a.CAPTION:{Ls(e,t);break}case a.COLGROUP:{Rs(e,t);break}default:he(e,t)}}function le(e,t){switch(t.tagID){case a.TABLE:{e.openElements.hasInTableScope(a.TABLE)&&(e.openElements.popUntilTagNamePopped(a.TABLE),e._resetInsertionMode());break}case a.TEMPLATE:{V(e,t);break}case a.BODY:case a.CAPTION:case a.COL:case a.COLGROUP:case a.HTML:case a.TBODY:case a.TD:case a.TFOOT:case a.TH:case a.THEAD:case a.TR:break;default:he(e,t)}}function he(e,t){const u=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Ce(e,t),e.fosterParentingEnabled=u}function yt(e,t){e.pendingCharacterTokens.push(t)}function Ut(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function se(e,t){let u=0;if(e.hasNonWhitespacePendingCharacterToken)for(;u<e.pendingCharacterTokens.length;u++)he(e,e.pendingCharacterTokens[u]);else for(;u<e.pendingCharacterTokens.length;u++)e._insertCharacters(e.pendingCharacterTokens[u]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const Ft=new Set([a.CAPTION,a.COL,a.COLGROUP,a.TBODY,a.TD,a.TFOOT,a.TH,a.THEAD,a.TR]);function Hs(e,t){const u=t.tagID;Ft.has(u)?e.openElements.hasInTableScope(a.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=i.IN_TABLE,J(e,t)):x(e,t)}function ys(e,t){const u=t.tagID;switch(u){case a.CAPTION:case a.TABLE:{e.openElements.hasInTableScope(a.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=i.IN_TABLE,u===a.TABLE&&le(e,t));break}case a.BODY:case a.COL:case a.COLGROUP:case a.HTML:case a.TBODY:case a.TD:case a.TFOOT:case a.TH:case a.THEAD:case a.TR:break;default:ge(e,t)}}function Ye(e,t){switch(t.tagID){case a.HTML:{x(e,t);break}case a.COL:{e._appendElement(t,f.HTML),t.ackSelfClosing=!0;break}case a.TEMPLATE:{U(e,t);break}default:Ne(e,t)}}function Us(e,t){switch(t.tagID){case a.COLGROUP:{e.openElements.currentTagId===a.COLGROUP&&(e.openElements.pop(),e.insertionMode=i.IN_TABLE);break}case a.TEMPLATE:{V(e,t);break}case a.COL:break;default:Ne(e,t)}}function Ne(e,t){e.openElements.currentTagId===a.COLGROUP&&(e.openElements.pop(),e.insertionMode=i.IN_TABLE,e._processToken(t))}function Oe(e,t){switch(t.tagID){case a.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,f.HTML),e.insertionMode=i.IN_ROW;break}case a.TH:case a.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(d.TR,a.TR),e.insertionMode=i.IN_ROW,Se(e,t);break}case a.CAPTION:case a.COL:case a.COLGROUP:case a.TBODY:case a.TFOOT:case a.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=i.IN_TABLE,J(e,t));break}default:J(e,t)}}function Be(e,t){const u=t.tagID;switch(t.tagID){case a.TBODY:case a.TFOOT:case a.THEAD:{e.openElements.hasInTableScope(u)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=i.IN_TABLE);break}case a.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=i.IN_TABLE,le(e,t));break}case a.BODY:case a.CAPTION:case a.COL:case a.COLGROUP:case a.HTML:case a.TD:case a.TH:case a.TR:break;default:le(e,t)}}function Se(e,t){switch(t.tagID){case a.TH:case a.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,f.HTML),e.insertionMode=i.IN_CELL,e.activeFormattingElements.insertMarker();break}case a.CAPTION:case a.COL:case a.COLGROUP:case a.TBODY:case a.TFOOT:case a.THEAD:case a.TR:{e.openElements.hasInTableScope(a.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=i.IN_TABLE_BODY,Oe(e,t));break}default:J(e,t)}}function wt(e,t){switch(t.tagID){case a.TR:{e.openElements.hasInTableScope(a.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=i.IN_TABLE_BODY);break}case a.TABLE:{e.openElements.hasInTableScope(a.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=i.IN_TABLE_BODY,Be(e,t));break}case a.TBODY:case a.TFOOT:case a.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(a.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=i.IN_TABLE_BODY,Be(e,t));break}case a.BODY:case a.CAPTION:case a.COL:case a.COLGROUP:case a.HTML:case a.TD:case a.TH:break;default:le(e,t)}}function Fs(e,t){const u=t.tagID;Ft.has(u)?(e.openElements.hasInTableScope(a.TD)||e.openElements.hasInTableScope(a.TH))&&(e._closeTableCell(),Se(e,t)):x(e,t)}function ws(e,t){const u=t.tagID;switch(u){case a.TD:case a.TH:{e.openElements.hasInTableScope(u)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(u),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=i.IN_ROW);break}case a.TABLE:case a.TBODY:case a.TFOOT:case a.THEAD:case a.TR:{e.openElements.hasInTableScope(u)&&(e._closeTableCell(),wt(e,t));break}case a.BODY:case a.CAPTION:case a.COL:case a.COLGROUP:case a.HTML:break;default:ge(e,t)}}function vt(e,t){switch(t.tagID){case a.HTML:{x(e,t);break}case a.OPTION:{e.openElements.currentTagId===a.OPTION&&e.openElements.pop(),e._insertElement(t,f.HTML);break}case a.OPTGROUP:{e.openElements.currentTagId===a.OPTION&&e.openElements.pop(),e.openElements.currentTagId===a.OPTGROUP&&e.openElements.pop(),e._insertElement(t,f.HTML);break}case a.HR:{e.openElements.currentTagId===a.OPTION&&e.openElements.pop(),e.openElements.currentTagId===a.OPTGROUP&&e.openElements.pop(),e._appendElement(t,f.HTML),t.ackSelfClosing=!0;break}case a.INPUT:case a.KEYGEN:case a.TEXTAREA:case a.SELECT:{e.openElements.hasInSelectScope(a.SELECT)&&(e.openElements.popUntilTagNamePopped(a.SELECT),e._resetInsertionMode(),t.tagID!==a.SELECT&&e._processStartTag(t));break}case a.SCRIPT:case a.TEMPLATE:{U(e,t);break}}}function Yt(e,t){switch(t.tagID){case a.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===a.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===a.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===a.OPTGROUP&&e.openElements.pop();break}case a.OPTION:{e.openElements.currentTagId===a.OPTION&&e.openElements.pop();break}case a.SELECT:{e.openElements.hasInSelectScope(a.SELECT)&&(e.openElements.popUntilTagNamePopped(a.SELECT),e._resetInsertionMode());break}case a.TEMPLATE:{V(e,t);break}}}function vs(e,t){const u=t.tagID;u===a.CAPTION||u===a.TABLE||u===a.TBODY||u===a.TFOOT||u===a.THEAD||u===a.TR||u===a.TD||u===a.TH?(e.openElements.popUntilTagNamePopped(a.SELECT),e._resetInsertionMode(),e._processStartTag(t)):vt(e,t)}function Ys(e,t){const u=t.tagID;u===a.CAPTION||u===a.TABLE||u===a.TBODY||u===a.TFOOT||u===a.THEAD||u===a.TR||u===a.TD||u===a.TH?e.openElements.hasInTableScope(u)&&(e.openElements.popUntilTagNamePopped(a.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Yt(e,t)}function js(e,t){switch(t.tagID){case a.BASE:case a.BASEFONT:case a.BGSOUND:case a.LINK:case a.META:case a.NOFRAMES:case a.SCRIPT:case a.STYLE:case a.TEMPLATE:case a.TITLE:{U(e,t);break}case a.CAPTION:case a.COLGROUP:case a.TBODY:case a.TFOOT:case a.THEAD:{e.tmplInsertionModeStack[0]=i.IN_TABLE,e.insertionMode=i.IN_TABLE,J(e,t);break}case a.COL:{e.tmplInsertionModeStack[0]=i.IN_COLUMN_GROUP,e.insertionMode=i.IN_COLUMN_GROUP,Ye(e,t);break}case a.TR:{e.tmplInsertionModeStack[0]=i.IN_TABLE_BODY,e.insertionMode=i.IN_TABLE_BODY,Oe(e,t);break}case a.TD:case a.TH:{e.tmplInsertionModeStack[0]=i.IN_ROW,e.insertionMode=i.IN_ROW,Se(e,t);break}default:e.tmplInsertionModeStack[0]=i.IN_BODY,e.insertionMode=i.IN_BODY,x(e,t)}}function Ws(e,t){t.tagID===a.TEMPLATE&&V(e,t)}function jt(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(a.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):ve(e,t)}function Qs(e,t){t.tagID===a.HTML?x(e,t):Ie(e,t)}function Wt(e,t){var u;if(t.tagID===a.HTML){if(e.fragmentContext||(e.insertionMode=i.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===a.HTML){e._setEndLocation(e.openElements.items[0],t);const s=e.openElements.items[1];s&&!(!((u=e.treeAdapter.getNodeSourceCodeLocation(s))===null||u===void 0)&&u.endTag)&&e._setEndLocation(s,t)}}else Ie(e,t)}function Ie(e,t){e.insertionMode=i.IN_BODY,Ce(e,t)}function Gs(e,t){switch(t.tagID){case a.HTML:{x(e,t);break}case a.FRAMESET:{e._insertElement(t,f.HTML);break}case a.FRAME:{e._appendElement(t,f.HTML),t.ackSelfClosing=!0;break}case a.NOFRAMES:{U(e,t);break}}}function qs(e,t){t.tagID===a.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==a.FRAMESET&&(e.insertionMode=i.AFTER_FRAMESET))}function Xs(e,t){switch(t.tagID){case a.HTML:{x(e,t);break}case a.NOFRAMES:{U(e,t);break}}}function Ks(e,t){t.tagID===a.HTML&&(e.insertionMode=i.AFTER_AFTER_FRAMESET)}function Vs(e,t){t.tagID===a.HTML?x(e,t):_e(e,t)}function _e(e,t){e.insertionMode=i.IN_BODY,Ce(e,t)}function zs(e,t){switch(t.tagID){case a.HTML:{x(e,t);break}case a.NOFRAMES:{U(e,t);break}}}function $s(e,t){t.chars=p,e._insertCharacters(t)}function Js(e,t){e._insertCharacters(t),e.framesetOk=!1}function Qt(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==f.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Zs(e,t){if(fa(t))Qt(e),e._startTagOutsideForeignContent(t);else{const u=e._getAdjustedCurrentElement(),s=e.treeAdapter.getNamespaceURI(u);s===f.MATHML?Lt(t):s===f.SVG&&(Ta(t),Rt(t)),Fe(t),t.selfClosing?e._appendElement(t,s):e._insertElement(t,s),t.ackSelfClosing=!0}}function er(e,t){if(t.tagID===a.P||t.tagID===a.BR){Qt(e),e._endTagOutsideForeignContent(t);return}for(let u=e.openElements.stackTop;u>0;u--){const s=e.openElements.items[u];if(e.treeAdapter.getNamespaceURI(s)===f.HTML){e._endTagOutsideForeignContent(t);break}const c=e.treeAdapter.getTagName(s);if(c.toLowerCase()===t.tagName){t.tagName=c,e.openElements.shortenToLength(u);break}}}d.AREA,d.BASE,d.BASEFONT,d.BGSOUND,d.BR,d.COL,d.EMBED,d.FRAME,d.HR,d.IMG,d.INPUT,d.KEYGEN,d.LINK,d.META,d.PARAM,d.SOURCE,d.TRACK,d.WBR;const tr=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,ur=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),ot={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Gt(e,t){const u=Er(e),s=ht("type",{handlers:{root:ar,element:sr,text:rr,comment:Xt,doctype:nr,raw:cr},unknown:or}),c={parser:u?new nt(ot):nt.getFragmentParser(void 0,ot),handle(b){s(b,c)},stitches:!1,options:t||{}};s(e,c),te(c,K());const o=u?c.parser.document:c.parser.getFragment(),l=hu(o,{file:c.options.file});return c.stitches&&Jt(l,"comment",function(b,m,_){const C=b;if(C.value.stitch&&_&&m!==void 0){const R=_.children;return R[m]=C.value.stitch,m}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function qt(e,t){let u=-1;if(e)for(;++u<e.length;)t.handle(e[u])}function ar(e,t){qt(e.children,t)}function sr(e,t){dr(e,t),qt(e.children,t),lr(e,t)}function rr(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const u={type:N.CHARACTER,chars:e.value,location:fe(e)};te(t,K(e)),t.parser.currentToken=u,t.parser._processToken(t.parser.currentToken)}function nr(e,t){const u={type:N.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:fe(e)};te(t,K(e)),t.parser.currentToken=u,t.parser._processToken(t.parser.currentToken)}function ir(e,t){t.stitches=!0;const u=hr(e);if("children"in e&&"children"in u){const s=Gt({type:"root",children:e.children},t.options);u.children=s.children}Xt({type:"comment",value:{stitch:u}},t)}function Xt(e,t){const u=e.value,s={type:N.COMMENT,data:u,location:fe(e)};te(t,K(e)),t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken)}function cr(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,Kt(t,K(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(tr,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const u=t.parser.tokenizer._consume();t.parser.tokenizer._callState(u)}}function or(e,t){const u=e;if(t.options.passThrough&&t.options.passThrough.includes(u.type))ir(u,t);else{let s="";throw ur.has(u.type)&&(s=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+u.type+"` node"+s)}}function te(e,t){Kt(e,t);const u=e.parser.tokenizer.currentCharacterToken;u&&u.location&&(u.location.endLine=e.parser.tokenizer.preprocessor.line,u.location.endCol=e.parser.tokenizer.preprocessor.col+1,u.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=u,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=g.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function Kt(e,t){if(t&&t.offset!==void 0){const u={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=u}}function dr(e,t){const u=e.tagName.toLowerCase();if(t.parser.tokenizer.state===g.PLAINTEXT)return;te(t,K(e));const s=t.parser.openElements.current;let c="namespaceURI"in s?s.namespaceURI:q.html;c===q.html&&u==="svg"&&(c=q.svg);const o=_u({...e,children:[]},{space:c===q.svg?"svg":"html"}),l={type:N.START_TAG,tagName:u,tagID:ee(u),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in o?o.attrs:[],location:fe(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=u}function lr(e,t){const u=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Su.includes(u)||t.parser.tokenizer.state===g.PLAINTEXT)return;te(t,Et(e));const s={type:N.END_TAG,tagName:u,tagID:ee(u),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:fe(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),u===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===g.RCDATA||t.parser.tokenizer.state===g.RAWTEXT||t.parser.tokenizer.state===g.SCRIPT_DATA)&&(t.parser.tokenizer.state=g.DATA)}function Er(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function fe(e){const t=K(e)||{line:void 0,column:void 0,offset:void 0},u=Et(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:u.line,endCol:u.column,endOffset:u.offset}}function hr(e){return"children"in e?Ge({...e,children:[]}):Ge(e)}function fr(e){return function(t,u){return Gt(t,{...e,file:u})}}function Vt(e,t,u){if(!e)return"";if(/^(https?:|data:)/.test(e))return e;let s;if(e.startsWith("/content/"))s=e;else if(e.startsWith("/"))s=`/content${e}`;else{const c=t.includes("/")?t.replace(/\/[^/]+$/,""):"";s=`/content/${c?`${c}/${e}`:e}`}return u&&(s+=`?v=${u}`),s}function Tr(e,t){const u=(s,c,o)=>({children:l,node:b,...m})=>{const _={"data-selectable":"","data-type":c};switch(o&&(_["data-level"]=o),s){case"h1":return h.jsx("h1",{..._,...m,children:l});case"h2":return h.jsx("h2",{..._,...m,children:l});case"h3":return h.jsx("h3",{..._,...m,children:l});case"h4":return h.jsx("h4",{..._,...m,children:l});case"h5":return h.jsx("h5",{..._,...m,children:l});case"h6":return h.jsx("h6",{..._,...m,children:l});case"p":return h.jsx("p",{..._,...m,children:l});case"ul":return h.jsx("ul",{..._,...m,children:l});case"ol":return h.jsx("ol",{..._,...m,children:l});case"pre":return h.jsx("pre",{..._,...m,children:l});case"blockquote":return h.jsx("blockquote",{..._,...m,children:l});case"table":return h.jsx("table",{..._,...m,children:l});default:return h.jsx("div",{..._,...m,children:l})}};return{h1:u("h1","heading",1),h2:u("h2","heading",2),h3:u("h3","heading",3),h4:u("h4","heading",4),h5:u("h5","heading",5),h6:u("h6","heading",6),p:u("p","paragraph"),ul:u("ul","list"),ol:u("ol","list"),pre:u("pre","code"),blockquote:u("blockquote","blockquote"),table:u("table","table"),img:({src:s,alt:c,node:o,...l})=>{const b=Vt(s,e,t);return h.jsx("span",{className:"inline-block max-w-full","data-selectable":"","data-type":"image","data-src":s||"",children:h.jsx("img",{src:b,alt:c||"",className:"max-w-full rounded",...l})})}}}function mr(e,t){return{img:({src:u,alt:s,node:c,...o})=>h.jsx("img",{src:Vt(u,e,t),alt:s||"",className:"max-w-full rounded",...o})}}async function dt(e,t){try{return(await fetch("/api/files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,content:t})})).ok}catch{return!1}}function br({files:e,selection:t,onSelect:u,mode:s,imageVersion:c}){const o=Zt(A=>A.setPreviewMode),l=B.useRef(null),b=B.useRef(null),[m,_]=B.useState(()=>localStorage.getItem("pneuma-preview-theme")||"dark"),C=()=>{const A=m==="dark"?"light":"dark";_(A),localStorage.setItem("pneuma-preview-theme",A)},R=s==="select";B.useEffect(()=>{const A=l.current;if(!A||(b.current&&(b.current.classList.remove("element-selected"),b.current=null),!t))return;const I=A.querySelector(`[data-file="${t.file}"]`);if(!I)return;const O=`[data-selectable][data-type="${t.type}"]${t.level?`[data-level="${t.level}"]`:""}`,j=I.querySelectorAll(O);for(const H of j){let F=!1;if(t.type==="image")F=H.dataset.src===t.content;else{const w=(H.textContent||"").trim().slice(0,200);F=w===t.content||w.startsWith(t.content.slice(0,50))}if(F){H.classList.add("element-selected"),b.current=H,H.scrollIntoView({behavior:"smooth",block:"center"});break}}},[t,e]),B.useEffect(()=>{const A=I=>{I.key==="Escape"&&R&&(t?u(null):o("view"))};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[R,t,u,o]);const z=B.useCallback(A=>{var ue;if(!R)return;const I=A.target.closest("[data-selectable]");if(!I){b.current&&(b.current.classList.remove("element-selected"),b.current=null),u(null);return}const O=I.closest("[data-file]"),j=(O==null?void 0:O.dataset.file)||"",H=I.dataset.type||"paragraph",F=I.dataset.level?Number(I.dataset.level):void 0,w=H==="image"?I.dataset.src||((ue=I.querySelector("img"))==null?void 0:ue.getAttribute("alt"))||"image":(I.textContent||"").trim().slice(0,200);b.current&&b.current.classList.remove("element-selected"),I.classList.add("element-selected"),b.current=I,u({file:j,type:H,content:w,level:F})},[R,u]),D=B.useCallback(()=>{var F,w,ue;if(!R)return;const A=window.getSelection();if(!A||!A.toString().trim())return;const I=A.toString().trim();if(I.length<2)return;const O=A.anchorNode,j=((F=O==null?void 0:O.closest)==null?void 0:F.call(O,"[data-file]"))||((w=O==null?void 0:O.parentElement)==null?void 0:w.closest("[data-file]")),H=((ue=j==null?void 0:j.dataset)==null?void 0:ue.file)||"";b.current&&(b.current.classList.remove("element-selected"),b.current=null),u({file:H,type:"text-range",content:I.slice(0,300)})},[R,u]),P=m==="dark";return e.length===0?h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsx(lt,{theme:m,onToggleTheme:C,previewMode:s,onSetPreviewMode:o}),h.jsx("div",{className:"flex items-center justify-center flex-1 text-neutral-500",children:"No markdown files in workspace"})]}):h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsx(lt,{theme:m,onToggleTheme:C,previewMode:s,onSetPreviewMode:o}),s==="edit"?h.jsx("div",{className:`flex-1 overflow-y-auto transition-colors duration-200 ${P?"bg-[#1a1a18]":"bg-white"}`,children:e.map(A=>h.jsx(_r,{file:A,isDark:P},A.path))}):h.jsx("div",{ref:l,onClick:z,onMouseUp:D,className:`flex-1 overflow-y-auto p-6 transition-colors duration-200 ${P?"bg-[#1a1a18] text-[#e8e6df]":"bg-white text-[#1f1f1e]"} ${R?"select-mode":""}`,children:e.map(A=>h.jsxs("div",{className:"mb-8","data-file":A.path,children:[h.jsx("div",{className:`text-xs mb-2 font-mono ${P?"text-neutral-500":"text-neutral-400"}`,children:A.path}),h.jsx("div",{className:`prose max-w-none ${P?"prose-invert prose-neutral":"prose-neutral"}`,children:h.jsx(eu,{remarkPlugins:[tu],rehypePlugins:[fr],components:R?Tr(A.path,c):mr(A.path,c),children:A.content})})]},A.path))})]})}function _r({file:e,isDark:t}){var z;const[u,s]=B.useState(!1),c=B.useRef(null),o=B.useRef(null),l=B.useRef(e.content);B.useEffect(()=>{const D=c.current;D&&e.content!==l.current&&(D.value=e.content,l.current=e.content)},[e.content]);const b=B.useCallback(D=>{o.current&&clearTimeout(o.current),o.current=setTimeout(async()=>{s(!0),await dt(e.path,D),l.current=D,s(!1)},800)},[e.path]);B.useEffect(()=>()=>{o.current&&c.current&&(clearTimeout(o.current),dt(e.path,c.current.value))},[e.path]);const m=()=>{const D=c.current;D&&b(D.value)},_=(D,P="")=>{const A=c.current;if(!A)return;A.focus();const I=A.selectionStart,O=A.selectionEnd,H=A.value.slice(I,O)||"text",F=`${D}${H}${P}`;A.setSelectionRange(I,O),document.execCommand("insertText",!1,F);const w=I+D.length;A.setSelectionRange(w,w+H.length),b(A.value)},C=D=>{const P=c.current;if(!P)return;P.focus();const A=P.selectionStart,I=P.value.lastIndexOf(`
|
|
3
3
|
`,A-1)+1;P.setSelectionRange(I,I),document.execCommand("insertText",!1,D);const O=A+D.length;P.setSelectionRange(O,O),b(P.value)},R=(((z=c.current)==null?void 0:z.value)||e.content).split(`
|
|
4
4
|
`).length;return h.jsxs("div",{className:"border-b border-cc-border/30 last:border-b-0",children:[h.jsxs("div",{className:`flex items-center justify-between px-4 py-1.5 ${t?"bg-cc-card/50":"bg-neutral-50"}`,children:[h.jsx("span",{className:`text-xs font-mono ${t?"text-neutral-500":"text-neutral-400"}`,children:e.path}),h.jsx("span",{className:`text-[10px] ${u?"text-cc-warning":"text-cc-muted/50"}`,children:u?"saving...":"auto-save"})]}),h.jsxs("div",{className:`flex items-center gap-0.5 px-3 py-1 border-b ${t?"border-cc-border/30 bg-cc-card/30":"border-neutral-200 bg-neutral-50/50"}`,children:[h.jsx(k,{title:"Bold (⌘B)",onClick:()=>_("**","**"),children:h.jsx(gr,{})}),h.jsx(k,{title:"Italic (⌘I)",onClick:()=>_("*","*"),children:h.jsx(Or,{})}),h.jsx(k,{title:"Strikethrough",onClick:()=>_("~~","~~"),children:h.jsx(Sr,{})}),h.jsx(me,{isDark:t}),h.jsx(k,{title:"Heading 1",onClick:()=>C("# "),children:h.jsx("span",{className:"text-[10px] font-bold",children:"H1"})}),h.jsx(k,{title:"Heading 2",onClick:()=>C("## "),children:h.jsx("span",{className:"text-[10px] font-bold",children:"H2"})}),h.jsx(k,{title:"Heading 3",onClick:()=>C("### "),children:h.jsx("span",{className:"text-[10px] font-bold",children:"H3"})}),h.jsx(me,{isDark:t}),h.jsx(k,{title:"Inline code",onClick:()=>_("`","`"),children:h.jsx(Lr,{})}),h.jsx(k,{title:"Code block",onClick:()=>_("```\n","\n```"),children:h.jsx(Rr,{})}),h.jsx(me,{isDark:t}),h.jsx(k,{title:"Bullet list",onClick:()=>C("- "),children:h.jsx(Dr,{})}),h.jsx(k,{title:"Numbered list",onClick:()=>C("1. "),children:h.jsx(xr,{})}),h.jsx(k,{title:"Blockquote",onClick:()=>C("> "),children:h.jsx(Pr,{})}),h.jsx(me,{isDark:t}),h.jsx(k,{title:"Link",onClick:()=>_("[","](url)"),children:h.jsx(Mr,{})}),h.jsx(k,{title:"Image",onClick:()=>_(""),children:h.jsx(kr,{})}),h.jsx(k,{title:"Horizontal rule",onClick:()=>C(`---
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{k as kn,r as i,R as
|
|
1
|
+
import{k as kn,r as i,R as G,u as Mn,j as d}from"./index-J1QIN1v7.js";import In from"./manifest-DGD2_XYa.js";var Pe=kn();function Tn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const ot=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ie(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function wt(e){return"nodeType"in e}function _(e){var t,n;return e?Ie(e)?e:wt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function yt(e){const{Document:t}=_(e);return e instanceof t}function Ye(e){return Ie(e)?!1:e instanceof _(e).HTMLElement}function Zt(e){return e instanceof _(e).SVGElement}function Te(e){return e?Ie(e)?e.document:wt(e)?yt(e)?e:Ye(e)||Zt(e)?e.ownerDocument:document:document:document}const de=ot?i.useLayoutEffect:i.useEffect;function Ct(e){const t=i.useRef(e);return de(()=>{t.current=e}),i.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function On(){const e=i.useRef(null),t=i.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=i.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ue(e,t){t===void 0&&(t=[e]);const n=i.useRef(e);return de(()=>{n.current!==e&&(n.current=e)},t),n}function He(e,t){const n=i.useRef();return i.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function et(e){const t=Ct(e),n=i.useRef(null),r=i.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function gt(e){const t=i.useRef();return i.useEffect(()=>{t.current=e},[e]),t.current}let at={};function Ge(e,t){return i.useMemo(()=>{if(t)return t;const n=at[e]==null?0:at[e]+1;return at[e]=n,e+"-"+n},[e,t])}function Qt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,l)=>{const c=Object.entries(l);for(const[a,u]of c){const f=s[a];f!=null&&(s[a]=f+e*u)}return s},{...t})}}const Me=Qt(1),tt=Qt(-1);function Ln(e){return"clientX"in e&&"clientY"in e}function St(e){if(!e)return!1;const{KeyboardEvent:t}=_(e.target);return t&&e instanceof t}function An(e){if(!e)return!1;const{TouchEvent:t}=_(e.target);return t&&e instanceof t}function vt(e){if(An(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Ln(e)?{x:e.clientX,y:e.clientY}:null}const Ve=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ve.Translate.toString(e),Ve.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Lt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function $n(e){return e.matches(Lt)?e:e.querySelector(Lt)}const zn={display:"none"};function Pn(e){let{id:t,value:n}=e;return G.createElement("div",{id:t,style:zn},n)}function Bn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return G.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Fn(){const[e,t]=i.useState("");return{announce:i.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const en=i.createContext(null);function Wn(e){const t=i.useContext(en);i.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Un(){const[e]=i.useState(()=>new Set),t=i.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[i.useCallback(r=>{let{type:o,event:s}=r;e.forEach(l=>{var c;return(c=l[o])==null?void 0:c.call(l,s)})},[e]),t]}const Vn={draggable:`
|
|
2
2
|
To pick up a draggable item, press the space bar.
|
|
3
3
|
While dragging, use the arrow keys to move the item.
|
|
4
4
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
|
-
`},Xn={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Yn(e){let{announcements:t=Xn,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Vn}=e;const{announce:s,announcement:l}=Fn(),c=Ge("DndLiveRegion"),[a,u]=i.useState(!1);if(i.useEffect(()=>{u(!0)},[]),Wn(i.useMemo(()=>({onDragStart(h){let{active:p}=h;s(t.onDragStart({active:p}))},onDragMove(h){let{active:p,over:g}=h;t.onDragMove&&s(t.onDragMove({active:p,over:g}))},onDragOver(h){let{active:p,over:g}=h;s(t.onDragOver({active:p,over:g}))},onDragEnd(h){let{active:p,over:g}=h;s(t.onDragEnd({active:p,over:g}))},onDragCancel(h){let{active:p,over:g}=h;s(t.onDragCancel({active:p,over:g}))}}),[s,t])),!a)return null;const f=H.createElement(H.Fragment,null,H.createElement(Pn,{id:r,value:o.draggable}),H.createElement(Bn,{id:c,announcement:l}));return n?Pe.createPortal(f,n):f}var A;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(A||(A={}));function nt(){}function Hn(e,t){return i.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Gn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ie=Object.freeze({x:0,y:0});function _n(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function qn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Jn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Kn(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function At(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const $t=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=At(t,t.left,t.top),s=[];for(const l of r){const{id:c}=l,a=n.get(c);if(a){const u=_n(At(a),o);s.push({id:c,data:{droppableContainer:l,value:u}})}}return s.sort(qn)};function Zn(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),l=o-r,c=s-n;if(r<o&&n<s){const a=t.width*t.height,u=e.width*e.height,f=l*c,h=f/(a+u-f);return Number(h.toFixed(4))}return 0}const Qn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:l}=s,c=n.get(l);if(c){const a=Zn(c,t);a>0&&o.push({id:l,data:{droppableContainer:s,value:a}})}}return o.sort(Jn)};function er(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function tn(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ie}function tr(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((l,c)=>({...l,top:l.top+e*c.y,bottom:l.bottom+e*c.y,left:l.left+e*c.x,right:l.right+e*c.x}),{...n})}}const nr=tr(1);function rr(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function or(e,t,n){const r=rr(t);if(!r)return e;const{scaleX:o,scaleY:s,x:l,y:c}=r,a=e.left-l-(1-o)*parseFloat(n),u=e.top-c-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?e.width/o:e.width,h=s?e.height/s:e.height;return{width:f,height:h,top:u,right:a+f,bottom:u+h,left:a}}const sr={ignoreTransform:!1};function Te(e,t){t===void 0&&(t=sr);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=G(e).getComputedStyle(e);u&&(n=or(n,u,f))}const{top:r,left:o,width:s,height:l,bottom:c,right:a}=n;return{top:r,left:o,width:s,height:l,bottom:c,right:a}}function zt(e){return Te(e,{ignoreTransform:!0})}function ir(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function lr(e,t){return t===void 0&&(t=G(e).getComputedStyle(e)),t.position==="fixed"}function cr(e,t){t===void 0&&(t=G(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function Dt(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(yt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Ye(o)||Zt(o)||n.includes(o))return n;const s=G(e).getComputedStyle(o);return o!==e&&cr(o,s)&&n.push(o),lr(o,s)?n:r(o.parentNode)}return e?r(e):n}function nn(e){const[t]=Dt(e,1);return t??null}function ut(e){return!ot||!e?null:Me(e)?e:wt(e)?yt(e)||e===Ie(e).scrollingElement?window:Ye(e)?e:null:null}function rn(e){return Me(e)?e.scrollX:e.scrollLeft}function on(e){return Me(e)?e.scrollY:e.scrollTop}function pt(e){return{x:rn(e),y:on(e)}}var P;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(P||(P={}));function sn(e){return!ot||!e?!1:e===document.scrollingElement}function ln(e){const t={x:0,y:0},n=sn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,c=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:l,isRight:c,maxScroll:r,minScroll:t}}const ar={x:.2,y:.2};function ur(e,t,n,r,o){let{top:s,left:l,right:c,bottom:a}=n;r===void 0&&(r=10),o===void 0&&(o=ar);const{isTop:u,isBottom:f,isLeft:h,isRight:p}=ln(e),g={x:0,y:0},m={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!u&&s<=t.top+v.height?(g.y=P.Backward,m.y=r*Math.abs((t.top+v.height-s)/v.height)):!f&&a>=t.bottom-v.height&&(g.y=P.Forward,m.y=r*Math.abs((t.bottom-v.height-a)/v.height)),!p&&c>=t.right-v.width?(g.x=P.Forward,m.x=r*Math.abs((t.right-v.width-c)/v.width)):!h&&l<=t.left+v.width&&(g.x=P.Backward,m.x=r*Math.abs((t.left+v.width-l)/v.width)),{direction:g,speed:m}}function dr(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:l}=window;return{top:0,left:0,right:s,bottom:l,width:s,height:l}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function cn(e){return e.reduce((t,n)=>ke(t,pt(n)),ie)}function fr(e){return e.reduce((t,n)=>t+rn(n),0)}function hr(e){return e.reduce((t,n)=>t+on(n),0)}function gr(e,t){if(t===void 0&&(t=Te),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);nn(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const vr=[["x",["left","right"],fr],["y",["top","bottom"],hr]];class Rt{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Dt(n),o=cn(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,l,c]of vr)for(const a of l)Object.defineProperty(this,a,{get:()=>{const u=c(r),f=o[s]-u;return this.rect[a]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Be{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function pr(e){const{EventTarget:t}=G(e);return e instanceof t?e:Ie(e)}function dt(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var se;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(se||(se={}));function Pt(e){e.preventDefault()}function br(e){e.stopPropagation()}var T;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(T||(T={}));const an={start:[T.Space,T.Enter],cancel:[T.Esc],end:[T.Space,T.Enter,T.Tab]},mr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case T.Right:return{...n,x:n.x+25};case T.Left:return{...n,x:n.x-25};case T.Down:return{...n,y:n.y+25};case T.Up:return{...n,y:n.y-25}}};class un{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Be(Ie(n)),this.windowListeners=new Be(G(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(se.Resize,this.handleCancel),this.windowListeners.add(se.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(se.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&gr(r),n(ie)}handleKeyDown(t){if(St(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=an,coordinateGetter:l=mr,scrollBehavior:c="smooth"}=o,{code:a}=t;if(s.end.includes(a)){this.handleEnd(t);return}if(s.cancel.includes(a)){this.handleCancel(t);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:ie;this.referenceCoordinates||(this.referenceCoordinates=f);const h=l(t,{active:n,context:r.current,currentCoordinates:f});if(h){const p=tt(h,f),g={x:0,y:0},{scrollableAncestors:m}=r.current;for(const v of m){const b=t.code,{isTop:y,isRight:D,isLeft:w,isBottom:C,maxScroll:E,minScroll:N}=ln(v),j=dr(v),R={x:Math.min(b===T.Right?j.right-j.width/2:j.right,Math.max(b===T.Right?j.left:j.left+j.width/2,h.x)),y:Math.min(b===T.Down?j.bottom-j.height/2:j.bottom,Math.max(b===T.Down?j.top:j.top+j.height/2,h.y))},k=b===T.Right&&!D||b===T.Left&&!w,I=b===T.Down&&!C||b===T.Up&&!y;if(k&&R.x!==h.x){const x=v.scrollLeft+p.x,$=b===T.Right&&x<=E.x||b===T.Left&&x>=N.x;if($&&!p.y){v.scrollTo({left:x,behavior:c});return}$?g.x=v.scrollLeft-x:g.x=b===T.Right?v.scrollLeft-E.x:v.scrollLeft-N.x,g.x&&v.scrollBy({left:-g.x,behavior:c});break}else if(I&&R.y!==h.y){const x=v.scrollTop+p.y,$=b===T.Down&&x<=E.y||b===T.Up&&x>=N.y;if($&&!p.x){v.scrollTo({top:x,behavior:c});return}$?g.y=v.scrollTop-x:g.y=b===T.Down?v.scrollTop-E.y:v.scrollTop-N.y,g.y&&v.scrollBy({top:-g.y,behavior:c});break}}this.handleMove(t,ke(tt(h,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}un.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=an,onActivation:o}=t,{active:s}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const c=s.activatorNode.current;return c&&e.target!==c?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Bt(e){return!!(e&&"distance"in e)}function Ft(e){return!!(e&&"delay"in e)}class Et{constructor(t,n,r){var o;r===void 0&&(r=pr(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:l}=s;this.props=t,this.events=n,this.document=Ie(l),this.documentListeners=new Be(this.document),this.listeners=new Be(r),this.windowListeners=new Be(G(l)),this.initialCoordinates=(o=vt(s))!=null?o:ie,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(se.Resize,this.handleCancel),this.windowListeners.add(se.DragStart,Pt),this.windowListeners.add(se.VisibilityChange,this.handleCancel),this.windowListeners.add(se.ContextMenu,Pt),this.documentListeners.add(se.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ft(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Bt(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(se.Click,br,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(se.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:l,options:{activationConstraint:c}}=s;if(!o)return;const a=(n=vt(t))!=null?n:ie,u=tt(o,a);if(!r&&c){if(Bt(c)){if(c.tolerance!=null&&dt(u,c.tolerance))return this.handleCancel();if(dt(u,c.distance))return this.handleStart()}if(Ft(c)&&dt(u,c.tolerance))return this.handleCancel();this.handlePending(c,u);return}t.cancelable&&t.preventDefault(),l(a)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===T.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const xr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Nt extends Et{constructor(t){const{event:n}=t,r=Ie(n.target);super(t,xr,r)}}Nt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const wr={move:{name:"mousemove"},end:{name:"mouseup"}};var bt;(function(e){e[e.RightClick=2]="RightClick"})(bt||(bt={}));class yr extends Et{constructor(t){super(t,wr,Ie(t.event.target))}}yr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===bt.RightClick?!1:(r==null||r({event:n}),!0)}}];const ft={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Cr extends Et{constructor(t){super(t,ft)}static setup(){return window.addEventListener(ft.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ft.move.name,t)};function t(){}}}Cr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var Fe;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Fe||(Fe={}));var rt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(rt||(rt={}));function Sr(e){let{acceleration:t,activator:n=Fe.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:l=5,order:c=rt.TreeOrder,pointerCoordinates:a,scrollableAncestors:u,scrollableAncestorRects:f,delta:h,threshold:p}=e;const g=Rr({delta:h,disabled:!s}),[m,v]=On(),b=i.useRef({x:0,y:0}),y=i.useRef({x:0,y:0}),D=i.useMemo(()=>{switch(n){case Fe.Pointer:return a?{top:a.y,bottom:a.y,left:a.x,right:a.x}:null;case Fe.DraggableRect:return o}},[n,o,a]),w=i.useRef(null),C=i.useCallback(()=>{const N=w.current;if(!N)return;const j=b.current.x*y.current.x,R=b.current.y*y.current.y;N.scrollBy(j,R)},[]),E=i.useMemo(()=>c===rt.TreeOrder?[...u].reverse():u,[c,u]);i.useEffect(()=>{if(!s||!u.length||!D){v();return}for(const N of E){if((r==null?void 0:r(N))===!1)continue;const j=u.indexOf(N),R=f[j];if(!R)continue;const{direction:k,speed:I}=ur(N,R,D,t,p);for(const x of["x","y"])g[x][k[x]]||(I[x]=0,k[x]=0);if(I.x>0||I.y>0){v(),w.current=N,m(C,l),b.current=I,y.current=k;return}}b.current={x:0,y:0},y.current={x:0,y:0},v()},[t,C,r,v,s,l,JSON.stringify(D),JSON.stringify(g),m,u,E,f,JSON.stringify(p)])}const Dr={x:{[P.Backward]:!1,[P.Forward]:!1},y:{[P.Backward]:!1,[P.Forward]:!1}};function Rr(e){let{delta:t,disabled:n}=e;const r=gt(t);return He(o=>{if(n||!r||!o)return Dr;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[P.Backward]:o.x[P.Backward]||s.x===-1,[P.Forward]:o.x[P.Forward]||s.x===1},y:{[P.Backward]:o.y[P.Backward]||s.y===-1,[P.Forward]:o.y[P.Forward]||s.y===1}}},[n,t,r])}function Er(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return He(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function Nr(e,t){return i.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...s]},[]),[e,t])}var Xe;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Xe||(Xe={}));var mt;(function(e){e.Optimized="optimized"})(mt||(mt={}));const Wt=new Map;function jr(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,l]=i.useState(null),{frequency:c,measure:a,strategy:u}=o,f=i.useRef(e),h=b(),p=Ue(h),g=i.useCallback(function(y){y===void 0&&(y=[]),!p.current&&l(D=>D===null?y:D.concat(y.filter(w=>!D.includes(w))))},[p]),m=i.useRef(null),v=He(y=>{if(h&&!n)return Wt;if(!y||y===Wt||f.current!==e||s!=null){const D=new Map;for(let w of e){if(!w)continue;if(s&&s.length>0&&!s.includes(w.id)&&w.rect.current){D.set(w.id,w.rect.current);continue}const C=w.node.current,E=C?new Rt(a(C),C):null;w.rect.current=E,E&&D.set(w.id,E)}return D}return y},[e,s,n,h,a]);return i.useEffect(()=>{f.current=e},[e]),i.useEffect(()=>{h||g()},[n,h]),i.useEffect(()=>{s&&s.length>0&&l(null)},[JSON.stringify(s)]),i.useEffect(()=>{h||typeof c!="number"||m.current!==null||(m.current=setTimeout(()=>{g(),m.current=null},c))},[c,h,g,...r]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:s!=null};function b(){switch(u){case Xe.Always:return!1;case Xe.BeforeDragging:return n;default:return!n}}}function dn(e,t){return He(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function kr(e,t){return dn(e,t)}function Mr(e){let{callback:t,disabled:n}=e;const r=Ct(t),o=i.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return i.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function st(e){let{callback:t,disabled:n}=e;const r=Ct(t),o=i.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return i.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Ir(e){return new Rt(Te(e),e)}function Ut(e,t,n){t===void 0&&(t=Ir);const[r,o]=i.useState(null);function s(){o(a=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=a??n)!=null?u:null}const f=t(e);return JSON.stringify(a)===JSON.stringify(f)?a:f})}const l=Mr({callback(a){if(e)for(const u of a){const{type:f,target:h}=u;if(f==="childList"&&h instanceof HTMLElement&&h.contains(e)){s();break}}}}),c=st({callback:s});return ue(()=>{s(),e?(c==null||c.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(c==null||c.disconnect(),l==null||l.disconnect())},[e]),r}function Tr(e){const t=dn(e);return tn(e,t)}const Vt=[];function Or(e){const t=i.useRef(e),n=He(r=>e?r&&r!==Vt&&e&&t.current&&e.parentNode===t.current.parentNode?r:Dt(e):Vt,[e]);return i.useEffect(()=>{t.current=e},[e]),n}function Lr(e){const[t,n]=i.useState(null),r=i.useRef(e),o=i.useCallback(s=>{const l=ut(s.target);l&&n(c=>c?(c.set(l,pt(l)),new Map(c)):null)},[]);return i.useEffect(()=>{const s=r.current;if(e!==s){l(s);const c=e.map(a=>{const u=ut(a);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,pt(u)]):null}).filter(a=>a!=null);n(c.length?new Map(c):null),r.current=e}return()=>{l(e),l(s)};function l(c){c.forEach(a=>{const u=ut(a);u==null||u.removeEventListener("scroll",o)})}},[o,e]),i.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,l)=>ke(s,l),ie):cn(e):ie,[e,t])}function Xt(e,t){t===void 0&&(t=[]);const n=i.useRef(null);return i.useEffect(()=>{n.current=null},t),i.useEffect(()=>{const r=e!==ie;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?tt(e,n.current):ie}function Ar(e){i.useEffect(()=>{if(!ot)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function $r(e,t){return i.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=l=>{s(l,t)},n},{}),[e,t])}function fn(e){return i.useMemo(()=>e?ir(e):null,[e])}const Yt=[];function zr(e,t){t===void 0&&(t=Te);const[n]=e,r=fn(n?G(n):null),[o,s]=i.useState(Yt);function l(){s(()=>e.length?e.map(a=>sn(a)?r:new Rt(t(a),a)):Yt)}const c=st({callback:l});return ue(()=>{c==null||c.disconnect(),l(),e.forEach(a=>c==null?void 0:c.observe(a))},[e]),o}function Pr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ye(t)?t:e}function Br(e){let{measure:t}=e;const[n,r]=i.useState(null),o=i.useCallback(u=>{for(const{target:f}of u)if(Ye(f)){r(h=>{const p=t(f);return h?{...h,width:p.width,height:p.height}:p});break}},[t]),s=st({callback:o}),l=i.useCallback(u=>{const f=Pr(u);s==null||s.disconnect(),f&&(s==null||s.observe(f)),r(f?t(f):null)},[t,s]),[c,a]=et(l);return i.useMemo(()=>({nodeRef:c,rect:n,setRef:a}),[n,c,a])}const Fr=[{sensor:Nt,options:{}},{sensor:un,options:{}}],Wr={current:{}},Qe={draggable:{measure:zt},droppable:{measure:zt,strategy:Xe.WhileDragging,frequency:mt.Optimized},dragOverlay:{measure:Te}};class We extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Ur={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new We,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:nt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Qe,measureDroppableContainers:nt,windowRect:null,measuringScheduled:!1},Vr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:nt,draggableNodes:new Map,over:null,measureDroppableContainers:nt},it=i.createContext(Vr),hn=i.createContext(Ur);function Xr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new We}}}function Yr(e,t){switch(t.type){case A.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case A.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case A.DragEnd:case A.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case A.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new We(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case A.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const l=new We(e.droppable.containers);return l.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:l}}}case A.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new We(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Hr(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=i.useContext(it),s=gt(r),l=gt(n==null?void 0:n.id);return i.useEffect(()=>{if(!t&&!r&&s&&l!=null){if(!St(s)||document.activeElement===s.target)return;const c=o.get(l);if(!c)return;const{activatorNode:a,node:u}=c;if(!a.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[a.current,u.current]){if(!f)continue;const h=$n(f);if(h){h.focus();break}}})}},[r,t,o,l,s]),null}function Gr(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function _r(e){return i.useMemo(()=>({draggable:{...Qe.draggable,...e==null?void 0:e.draggable},droppable:{...Qe.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Qe.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function qr(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=i.useRef(!1),{x:l,y:c}=typeof o=="boolean"?{x:o,y:o}:o;ue(()=>{if(!l&&!c||!t){s.current=!1;return}if(s.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const f=n(u),h=tn(f,r);if(l||(h.x=0),c||(h.y=0),s.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const p=nn(u);p&&p.scrollBy({top:h.y,left:h.x})}},[t,l,c,r,n])}const gn=i.createContext({...ie,scaleX:1,scaleY:1});var Ce;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ce||(Ce={}));const Ht=i.memo(function(t){var n,r,o,s;let{id:l,accessibility:c,autoScroll:a=!0,children:u,sensors:f=Fr,collisionDetection:h=Qn,measuring:p,modifiers:g,...m}=t;const v=i.useReducer(Yr,void 0,Xr),[b,y]=v,[D,w]=Un(),[C,E]=i.useState(Ce.Uninitialized),N=C===Ce.Initialized,{draggable:{active:j,nodes:R,translate:k},droppable:{containers:I}}=b,x=j!=null?R.get(j):null,$=i.useRef({initial:null,translated:null}),X=i.useMemo(()=>{var V;return j!=null?{id:j,data:(V=x==null?void 0:x.data)!=null?V:Wr,rect:$}:null},[j,x]),Y=i.useRef(null),[de,pe]=i.useState(null),[B,Re]=i.useState(null),Z=Ue(m,Object.values(m)),z=Ge("DndDescribedBy",l),be=i.useMemo(()=>I.getEnabled(),[I]),W=_r(p),{droppableRects:Q,measureDroppableContainers:L,measuringScheduled:fe}=jr(be,{dragging:N,dependencies:[k.x,k.y],config:W.droppable}),U=Er(R,j),he=i.useMemo(()=>B?vt(B):null,[B]),_=jn(),ee=kr(U,W.draggable.measure);qr({activeNode:j!=null?R.get(j):null,config:_.layoutShiftCompensation,initialRect:ee,measure:W.draggable.measure});const M=Ut(U,W.draggable.measure,ee),Se=Ut(U?U.parentElement:null),te=i.useRef({activatorEvent:null,active:null,activeNode:U,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),le=I.getNodeFor((n=te.current.over)==null?void 0:n.id),ne=Br({measure:W.dragOverlay.measure}),S=(r=ne.nodeRef.current)!=null?r:U,O=N?(o=ne.rect)!=null?o:M:null,re=!!(ne.nodeRef.current&&ne.rect),De=Tr(re?null:M),Oe=fn(S?G(S):null),ge=Or(N?le??U:null),_e=zr(ge),qe=Gr(g,{transform:{x:k.x-De.x,y:k.y-De.y,scaleX:1,scaleY:1},activatorEvent:B,active:X,activeNodeRect:M,containerNodeRect:Se,draggingNodeRect:O,over:te.current.over,overlayNodeRect:ne.rect,scrollableAncestors:ge,scrollableAncestorRects:_e,windowRect:Oe}),jt=he?ke(he,k):null,kt=Lr(ge),yn=Xt(kt),Cn=Xt(kt,[M]),Ee=ke(qe,yn),Ne=O?nr(O,qe):null,Le=X&&Ne?h({active:X,collisionRect:Ne,droppableRects:Q,droppableContainers:be,pointerCoordinates:jt}):null,Mt=Kn(Le,"id"),[me,It]=i.useState(null),Sn=re?qe:ke(qe,Cn),Dn=er(Sn,(s=me==null?void 0:me.rect)!=null?s:null,M),lt=i.useRef(null),Tt=i.useCallback((V,q)=>{let{sensor:J,options:xe}=q;if(Y.current==null)return;const oe=R.get(Y.current);if(!oe)return;const K=V.nativeEvent,ce=new J({active:Y.current,activeNode:oe,event:K,options:xe,context:te,onAbort(F){if(!R.get(F))return;const{onDragAbort:ae}=Z.current,ve={id:F};ae==null||ae(ve),D({type:"onDragAbort",event:ve})},onPending(F,we,ae,ve){if(!R.get(F))return;const{onDragPending:$e}=Z.current,ye={id:F,constraint:we,initialCoordinates:ae,offset:ve};$e==null||$e(ye),D({type:"onDragPending",event:ye})},onStart(F){const we=Y.current;if(we==null)return;const ae=R.get(we);if(!ae)return;const{onDragStart:ve}=Z.current,Ae={activatorEvent:K,active:{id:we,data:ae.data,rect:$}};Pe.unstable_batchedUpdates(()=>{ve==null||ve(Ae),E(Ce.Initializing),y({type:A.DragStart,initialCoordinates:F,active:we}),D({type:"onDragStart",event:Ae}),pe(lt.current),Re(K)})},onMove(F){y({type:A.DragMove,coordinates:F})},onEnd:je(A.DragEnd),onCancel:je(A.DragCancel)});lt.current=ce;function je(F){return async function(){const{active:ae,collisions:ve,over:Ae,scrollAdjustedTranslate:$e}=te.current;let ye=null;if(ae&&$e){const{cancelDrop:ze}=Z.current;ye={activatorEvent:K,active:ae,collisions:ve,delta:$e,over:Ae},F===A.DragEnd&&typeof ze=="function"&&await Promise.resolve(ze(ye))&&(F=A.DragCancel)}Y.current=null,Pe.unstable_batchedUpdates(()=>{y({type:F}),E(Ce.Uninitialized),It(null),pe(null),Re(null),lt.current=null;const ze=F===A.DragEnd?"onDragEnd":"onDragCancel";if(ye){const ct=Z.current[ze];ct==null||ct(ye),D({type:ze,event:ye})}})}}},[R]),Rn=i.useCallback((V,q)=>(J,xe)=>{const oe=J.nativeEvent,K=R.get(xe);if(Y.current!==null||!K||oe.dndKit||oe.defaultPrevented)return;const ce={active:K};V(J,q.options,ce)===!0&&(oe.dndKit={capturedBy:q.sensor},Y.current=xe,Tt(J,q))},[R,Tt]),Ot=Nr(f,Rn);Ar(f),ue(()=>{M&&C===Ce.Initializing&&E(Ce.Initialized)},[M,C]),i.useEffect(()=>{const{onDragMove:V}=Z.current,{active:q,activatorEvent:J,collisions:xe,over:oe}=te.current;if(!q||!J)return;const K={active:q,activatorEvent:J,collisions:xe,delta:{x:Ee.x,y:Ee.y},over:oe};Pe.unstable_batchedUpdates(()=>{V==null||V(K),D({type:"onDragMove",event:K})})},[Ee.x,Ee.y]),i.useEffect(()=>{const{active:V,activatorEvent:q,collisions:J,droppableContainers:xe,scrollAdjustedTranslate:oe}=te.current;if(!V||Y.current==null||!q||!oe)return;const{onDragOver:K}=Z.current,ce=xe.get(Mt),je=ce&&ce.rect.current?{id:ce.id,rect:ce.rect.current,data:ce.data,disabled:ce.disabled}:null,F={active:V,activatorEvent:q,collisions:J,delta:{x:oe.x,y:oe.y},over:je};Pe.unstable_batchedUpdates(()=>{It(je),K==null||K(F),D({type:"onDragOver",event:F})})},[Mt]),ue(()=>{te.current={activatorEvent:B,active:X,activeNode:U,collisionRect:Ne,collisions:Le,droppableRects:Q,draggableNodes:R,draggingNode:S,draggingNodeRect:O,droppableContainers:I,over:me,scrollableAncestors:ge,scrollAdjustedTranslate:Ee},$.current={initial:O,translated:Ne}},[X,U,Le,Ne,R,S,O,Q,I,me,ge,Ee]),Sr({..._,delta:k,draggingRect:Ne,pointerCoordinates:jt,scrollableAncestors:ge,scrollableAncestorRects:_e});const En=i.useMemo(()=>({active:X,activeNode:U,activeNodeRect:M,activatorEvent:B,collisions:Le,containerNodeRect:Se,dragOverlay:ne,draggableNodes:R,droppableContainers:I,droppableRects:Q,over:me,measureDroppableContainers:L,scrollableAncestors:ge,scrollableAncestorRects:_e,measuringConfiguration:W,measuringScheduled:fe,windowRect:Oe}),[X,U,M,B,Le,Se,ne,R,I,Q,me,L,ge,_e,W,fe,Oe]),Nn=i.useMemo(()=>({activatorEvent:B,activators:Ot,active:X,activeNodeRect:M,ariaDescribedById:{draggable:z},dispatch:y,draggableNodes:R,over:me,measureDroppableContainers:L}),[B,Ot,X,M,y,z,R,me,L]);return H.createElement(en.Provider,{value:w},H.createElement(it.Provider,{value:Nn},H.createElement(hn.Provider,{value:En},H.createElement(gn.Provider,{value:Dn},u)),H.createElement(Hr,{disabled:(c==null?void 0:c.restoreFocus)===!1})),H.createElement(Yn,{...c,hiddenTextDescribedById:z}));function jn(){const V=(de==null?void 0:de.autoScrollEnabled)===!1,q=typeof a=="object"?a.enabled===!1:a===!1,J=N&&!V&&!q;return typeof a=="object"?{...a,enabled:J}:{enabled:J}}}),Jr=i.createContext(null),Gt="button",Kr="Draggable";function Zr(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=Ge(Kr),{activators:l,activatorEvent:c,active:a,activeNodeRect:u,ariaDescribedById:f,draggableNodes:h,over:p}=i.useContext(it),{role:g=Gt,roleDescription:m="draggable",tabIndex:v=0}=o??{},b=(a==null?void 0:a.id)===t,y=i.useContext(b?gn:Jr),[D,w]=et(),[C,E]=et(),N=$r(l,t),j=Ue(n);ue(()=>(h.set(t,{id:t,key:s,node:D,activatorNode:C,data:j}),()=>{const k=h.get(t);k&&k.key===s&&h.delete(t)}),[h,t]);const R=i.useMemo(()=>({role:g,tabIndex:v,"aria-disabled":r,"aria-pressed":b&&g===Gt?!0:void 0,"aria-roledescription":m,"aria-describedby":f.draggable}),[r,g,v,b,m,f.draggable]);return{active:a,activatorEvent:c,activeNodeRect:u,attributes:R,isDragging:b,listeners:r?void 0:N,node:D,over:p,setNodeRef:w,setActivatorNodeRef:E,transform:y}}function Qr(){return i.useContext(hn)}const eo="Droppable",to={timeout:25};function no(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=Ge(eo),{active:l,dispatch:c,over:a,measureDroppableContainers:u}=i.useContext(it),f=i.useRef({disabled:n}),h=i.useRef(!1),p=i.useRef(null),g=i.useRef(null),{disabled:m,updateMeasurementsFor:v,timeout:b}={...to,...o},y=Ue(v??r),D=i.useCallback(()=>{if(!h.current){h.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(y.current)?y.current:[y.current]),g.current=null},b)},[b]),w=st({callback:D,disabled:m||!l}),C=i.useCallback((R,k)=>{w&&(k&&(w.unobserve(k),h.current=!1),R&&w.observe(R))},[w]),[E,N]=et(C),j=Ue(t);return i.useEffect(()=>{!w||!E.current||(w.disconnect(),h.current=!1,w.observe(E.current))},[E,w]),i.useEffect(()=>(c({type:A.RegisterDroppable,element:{id:r,key:s,disabled:n,node:E,rect:p,data:j}}),()=>c({type:A.UnregisterDroppable,key:s,id:r})),[r]),i.useEffect(()=>{n!==f.current.disabled&&(c({type:A.SetDroppableDisabled,id:r,key:s,disabled:n}),f.current.disabled=n)},[r,s,n,c]),{active:l,rect:p,isOver:(a==null?void 0:a.id)===r,node:E,over:a,setNodeRef:N}}function vn(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function ro(e,t){return e.reduce((n,r,o)=>{const s=t.get(r);return s&&(n[o]=s),n},Array(e.length))}function Je(e){return e!==null&&e>=0}function oo(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function so(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Ke={scaleX:1,scaleY:1},io=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:s,index:l}=e;const c=(t=n[o])!=null?t:r;if(!c)return null;const a=lo(n,l,o);if(l===o){const u=n[s];return u?{x:o<s?u.left+u.width-(c.left+c.width):u.left-c.left,y:0,...Ke}:null}return l>o&&l<=s?{x:-c.width-a,y:0,...Ke}:l<o&&l>=s?{x:c.width+a,y:0,...Ke}:{x:0,y:0,...Ke}};function lo(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return!r||!o&&!s?0:n<t?o?r.left-(o.left+o.width):s.left-(r.left+r.width):s?s.left-(r.left+r.width):r.left-(o.left+o.width)}const pn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=vn(t,r,n),l=t[o],c=s[o];return!c||!l?null:{x:c.left-l.left,y:c.top-l.top,scaleX:c.width/l.width,scaleY:c.height/l.height}},Ze={scaleX:1,scaleY:1},co=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:l}=e;const c=(t=s[n])!=null?t:r;if(!c)return null;if(o===n){const u=s[l];return u?{x:0,y:n<l?u.top+u.height-(c.top+c.height):u.top-c.top,...Ze}:null}const a=ao(s,o,n);return o>n&&o<=l?{x:0,y:-c.height-a,...Ze}:o<n&&o>=l?{x:0,y:c.height+a,...Ze}:{x:0,y:0,...Ze}};function ao(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return r?n<t?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const bn="Sortable",mn=H.createContext({activeIndex:-1,containerId:bn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:pn,disabled:{draggable:!1,droppable:!1}});function _t(e){let{children:t,id:n,items:r,strategy:o=pn,disabled:s=!1}=e;const{active:l,dragOverlay:c,droppableRects:a,over:u,measureDroppableContainers:f}=Qr(),h=Ge(bn,n),p=c.rect!==null,g=i.useMemo(()=>r.map(N=>typeof N=="object"&&"id"in N?N.id:N),[r]),m=l!=null,v=l?g.indexOf(l.id):-1,b=u?g.indexOf(u.id):-1,y=i.useRef(g),D=!oo(g,y.current),w=b!==-1&&v===-1||D,C=so(s);ue(()=>{D&&m&&f(g)},[D,g,m,f]),i.useEffect(()=>{y.current=g},[g]);const E=i.useMemo(()=>({activeIndex:v,containerId:h,disabled:C,disableTransforms:w,items:g,overIndex:b,useDragOverlay:p,sortedRects:ro(g,a),strategy:o}),[v,h,C.draggable,C.droppable,w,g,b,a,p,o]);return H.createElement(mn.Provider,{value:E},t)}const uo=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return vn(n,r,o).indexOf(t)},fo=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:l,previousItems:c,previousContainerId:a,transition:u}=e;return!u||!r||c!==s&&o===l?!1:n?!0:l!==o&&t===a},ho={duration:200,easing:"ease"},xn="transform",go=Ve.Transition.toString({property:xn,duration:0,easing:"linear"}),vo={roleDescription:"sortable"};function po(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,l]=i.useState(null),c=i.useRef(n);return ue(()=>{if(!t&&n!==c.current&&r.current){const a=o.current;if(a){const u=Te(r.current,{ignoreTransform:!0}),f={x:a.left-u.left,y:a.top-u.top,scaleX:a.width/u.width,scaleY:a.height/u.height};(f.x||f.y)&&l(f)}}n!==c.current&&(c.current=n)},[t,n,r,o]),i.useEffect(()=>{s&&l(null)},[s]),s}function bo(e){let{animateLayoutChanges:t=fo,attributes:n,disabled:r,data:o,getNewIndex:s=uo,id:l,strategy:c,resizeObserverConfig:a,transition:u=ho}=e;const{items:f,containerId:h,activeIndex:p,disabled:g,disableTransforms:m,sortedRects:v,overIndex:b,useDragOverlay:y,strategy:D}=i.useContext(mn),w=mo(r,g),C=f.indexOf(l),E=i.useMemo(()=>({sortable:{containerId:h,index:C,items:f},...o}),[h,o,C,f]),N=i.useMemo(()=>f.slice(f.indexOf(l)),[f,l]),{rect:j,node:R,isOver:k,setNodeRef:I}=no({id:l,data:E,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:N,...a}}),{active:x,activatorEvent:$,activeNodeRect:X,attributes:Y,setNodeRef:de,listeners:pe,isDragging:B,over:Re,setActivatorNodeRef:Z,transform:z}=Zr({id:l,data:E,attributes:{...vo,...n},disabled:w.draggable}),be=Tn(I,de),W=!!x,Q=W&&!m&&Je(p)&&Je(b),L=!y&&B,fe=L&&Q?z:null,he=Q?fe??(c??D)({rects:v,activeNodeRect:X,activeIndex:p,overIndex:b,index:C}):null,_=Je(p)&&Je(b)?s({id:l,items:f,activeIndex:p,overIndex:b}):C,ee=x==null?void 0:x.id,M=i.useRef({activeId:ee,items:f,newIndex:_,containerId:h}),Se=f!==M.current.items,te=t({active:x,containerId:h,isDragging:B,isSorting:W,id:l,index:C,items:f,newIndex:M.current.newIndex,previousItems:M.current.items,previousContainerId:M.current.containerId,transition:u,wasDragging:M.current.activeId!=null}),le=po({disabled:!te,index:C,node:R,rect:j});return i.useEffect(()=>{W&&M.current.newIndex!==_&&(M.current.newIndex=_),h!==M.current.containerId&&(M.current.containerId=h),f!==M.current.items&&(M.current.items=f)},[W,_,h,f]),i.useEffect(()=>{if(ee===M.current.activeId)return;if(ee!=null&&M.current.activeId==null){M.current.activeId=ee;return}const S=setTimeout(()=>{M.current.activeId=ee},50);return()=>clearTimeout(S)},[ee]),{active:x,activeIndex:p,attributes:Y,data:E,rect:j,index:C,newIndex:_,items:f,isOver:k,isSorting:W,isDragging:B,listeners:pe,node:R,overIndex:b,over:Re,setNodeRef:be,setActivatorNodeRef:Z,setDroppableNodeRef:I,setDraggableNodeRef:de,transform:le??he,transition:ne()};function ne(){if(le||Se&&M.current.newIndex===C)return go;if(!(L&&!St($)||!u)&&(W||te))return Ve.Transition.toString({...u,property:xn})}}function mo(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}T.Down,T.Right,T.Up,T.Left;function xo(e){const t=e.find(n=>n.path==="manifest.json"||n.path.endsWith("/manifest.json"));if(!t)return null;try{return JSON.parse(t.content)}catch{return null}}function wo(e){const t=e.find(n=>n.path==="theme.css"||n.path.endsWith("/theme.css"));return(t==null?void 0:t.content)||""}function qt(e,t){const n=e.find(r=>r.path===t||r.path.endsWith(`/${t}`));return(n==null?void 0:n.content)||""}function Jt(e,t,n){return`<!DOCTYPE html>
|
|
5
|
+
`},Xn={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Yn(e){let{announcements:t=Xn,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Vn}=e;const{announce:s,announcement:l}=Fn(),c=Ge("DndLiveRegion"),[a,u]=i.useState(!1);if(i.useEffect(()=>{u(!0)},[]),Wn(i.useMemo(()=>({onDragStart(h){let{active:p}=h;s(t.onDragStart({active:p}))},onDragMove(h){let{active:p,over:g}=h;t.onDragMove&&s(t.onDragMove({active:p,over:g}))},onDragOver(h){let{active:p,over:g}=h;s(t.onDragOver({active:p,over:g}))},onDragEnd(h){let{active:p,over:g}=h;s(t.onDragEnd({active:p,over:g}))},onDragCancel(h){let{active:p,over:g}=h;s(t.onDragCancel({active:p,over:g}))}}),[s,t])),!a)return null;const f=G.createElement(G.Fragment,null,G.createElement(Pn,{id:r,value:o.draggable}),G.createElement(Bn,{id:c,announcement:l}));return n?Pe.createPortal(f,n):f}var A;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(A||(A={}));function nt(){}function Hn(e,t){return i.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Gn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ie=Object.freeze({x:0,y:0});function _n(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function qn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Jn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Kn(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function At(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const $t=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=At(t,t.left,t.top),s=[];for(const l of r){const{id:c}=l,a=n.get(c);if(a){const u=_n(At(a),o);s.push({id:c,data:{droppableContainer:l,value:u}})}}return s.sort(qn)};function Zn(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),l=o-r,c=s-n;if(r<o&&n<s){const a=t.width*t.height,u=e.width*e.height,f=l*c,h=f/(a+u-f);return Number(h.toFixed(4))}return 0}const Qn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:l}=s,c=n.get(l);if(c){const a=Zn(c,t);a>0&&o.push({id:l,data:{droppableContainer:s,value:a}})}}return o.sort(Jn)};function er(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function tn(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ie}function tr(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((l,c)=>({...l,top:l.top+e*c.y,bottom:l.bottom+e*c.y,left:l.left+e*c.x,right:l.right+e*c.x}),{...n})}}const nr=tr(1);function rr(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function or(e,t,n){const r=rr(t);if(!r)return e;const{scaleX:o,scaleY:s,x:l,y:c}=r,a=e.left-l-(1-o)*parseFloat(n),u=e.top-c-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?e.width/o:e.width,h=s?e.height/s:e.height;return{width:f,height:h,top:u,right:a+f,bottom:u+h,left:a}}const sr={ignoreTransform:!1};function Oe(e,t){t===void 0&&(t=sr);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=_(e).getComputedStyle(e);u&&(n=or(n,u,f))}const{top:r,left:o,width:s,height:l,bottom:c,right:a}=n;return{top:r,left:o,width:s,height:l,bottom:c,right:a}}function zt(e){return Oe(e,{ignoreTransform:!0})}function ir(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function lr(e,t){return t===void 0&&(t=_(e).getComputedStyle(e)),t.position==="fixed"}function cr(e,t){t===void 0&&(t=_(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function Dt(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(yt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Ye(o)||Zt(o)||n.includes(o))return n;const s=_(e).getComputedStyle(o);return o!==e&&cr(o,s)&&n.push(o),lr(o,s)?n:r(o.parentNode)}return e?r(e):n}function nn(e){const[t]=Dt(e,1);return t??null}function ut(e){return!ot||!e?null:Ie(e)?e:wt(e)?yt(e)||e===Te(e).scrollingElement?window:Ye(e)?e:null:null}function rn(e){return Ie(e)?e.scrollX:e.scrollLeft}function on(e){return Ie(e)?e.scrollY:e.scrollTop}function pt(e){return{x:rn(e),y:on(e)}}var P;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(P||(P={}));function sn(e){return!ot||!e?!1:e===document.scrollingElement}function ln(e){const t={x:0,y:0},n=sn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,c=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:l,isRight:c,maxScroll:r,minScroll:t}}const ar={x:.2,y:.2};function ur(e,t,n,r,o){let{top:s,left:l,right:c,bottom:a}=n;r===void 0&&(r=10),o===void 0&&(o=ar);const{isTop:u,isBottom:f,isLeft:h,isRight:p}=ln(e),g={x:0,y:0},m={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!u&&s<=t.top+v.height?(g.y=P.Backward,m.y=r*Math.abs((t.top+v.height-s)/v.height)):!f&&a>=t.bottom-v.height&&(g.y=P.Forward,m.y=r*Math.abs((t.bottom-v.height-a)/v.height)),!p&&c>=t.right-v.width?(g.x=P.Forward,m.x=r*Math.abs((t.right-v.width-c)/v.width)):!h&&l<=t.left+v.width&&(g.x=P.Backward,m.x=r*Math.abs((t.left+v.width-l)/v.width)),{direction:g,speed:m}}function dr(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:l}=window;return{top:0,left:0,right:s,bottom:l,width:s,height:l}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function cn(e){return e.reduce((t,n)=>Me(t,pt(n)),ie)}function fr(e){return e.reduce((t,n)=>t+rn(n),0)}function hr(e){return e.reduce((t,n)=>t+on(n),0)}function gr(e,t){if(t===void 0&&(t=Oe),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);nn(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const vr=[["x",["left","right"],fr],["y",["top","bottom"],hr]];class Rt{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Dt(n),o=cn(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,l,c]of vr)for(const a of l)Object.defineProperty(this,a,{get:()=>{const u=c(r),f=o[s]-u;return this.rect[a]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Be{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function pr(e){const{EventTarget:t}=_(e);return e instanceof t?e:Te(e)}function dt(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var se;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(se||(se={}));function Pt(e){e.preventDefault()}function br(e){e.stopPropagation()}var T;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(T||(T={}));const an={start:[T.Space,T.Enter],cancel:[T.Esc],end:[T.Space,T.Enter,T.Tab]},mr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case T.Right:return{...n,x:n.x+25};case T.Left:return{...n,x:n.x-25};case T.Down:return{...n,y:n.y+25};case T.Up:return{...n,y:n.y-25}}};class un{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Be(Te(n)),this.windowListeners=new Be(_(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(se.Resize,this.handleCancel),this.windowListeners.add(se.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(se.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&gr(r),n(ie)}handleKeyDown(t){if(St(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=an,coordinateGetter:l=mr,scrollBehavior:c="smooth"}=o,{code:a}=t;if(s.end.includes(a)){this.handleEnd(t);return}if(s.cancel.includes(a)){this.handleCancel(t);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:ie;this.referenceCoordinates||(this.referenceCoordinates=f);const h=l(t,{active:n,context:r.current,currentCoordinates:f});if(h){const p=tt(h,f),g={x:0,y:0},{scrollableAncestors:m}=r.current;for(const v of m){const b=t.code,{isTop:y,isRight:D,isLeft:w,isBottom:C,maxScroll:E,minScroll:N}=ln(v),j=dr(v),R={x:Math.min(b===T.Right?j.right-j.width/2:j.right,Math.max(b===T.Right?j.left:j.left+j.width/2,h.x)),y:Math.min(b===T.Down?j.bottom-j.height/2:j.bottom,Math.max(b===T.Down?j.top:j.top+j.height/2,h.y))},k=b===T.Right&&!D||b===T.Left&&!w,I=b===T.Down&&!C||b===T.Up&&!y;if(k&&R.x!==h.x){const x=v.scrollLeft+p.x,$=b===T.Right&&x<=E.x||b===T.Left&&x>=N.x;if($&&!p.y){v.scrollTo({left:x,behavior:c});return}$?g.x=v.scrollLeft-x:g.x=b===T.Right?v.scrollLeft-E.x:v.scrollLeft-N.x,g.x&&v.scrollBy({left:-g.x,behavior:c});break}else if(I&&R.y!==h.y){const x=v.scrollTop+p.y,$=b===T.Down&&x<=E.y||b===T.Up&&x>=N.y;if($&&!p.x){v.scrollTo({top:x,behavior:c});return}$?g.y=v.scrollTop-x:g.y=b===T.Down?v.scrollTop-E.y:v.scrollTop-N.y,g.y&&v.scrollBy({top:-g.y,behavior:c});break}}this.handleMove(t,Me(tt(h,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}un.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=an,onActivation:o}=t,{active:s}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const c=s.activatorNode.current;return c&&e.target!==c?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Bt(e){return!!(e&&"distance"in e)}function Ft(e){return!!(e&&"delay"in e)}class Et{constructor(t,n,r){var o;r===void 0&&(r=pr(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:l}=s;this.props=t,this.events=n,this.document=Te(l),this.documentListeners=new Be(this.document),this.listeners=new Be(r),this.windowListeners=new Be(_(l)),this.initialCoordinates=(o=vt(s))!=null?o:ie,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(se.Resize,this.handleCancel),this.windowListeners.add(se.DragStart,Pt),this.windowListeners.add(se.VisibilityChange,this.handleCancel),this.windowListeners.add(se.ContextMenu,Pt),this.documentListeners.add(se.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ft(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Bt(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(se.Click,br,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(se.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:l,options:{activationConstraint:c}}=s;if(!o)return;const a=(n=vt(t))!=null?n:ie,u=tt(o,a);if(!r&&c){if(Bt(c)){if(c.tolerance!=null&&dt(u,c.tolerance))return this.handleCancel();if(dt(u,c.distance))return this.handleStart()}if(Ft(c)&&dt(u,c.tolerance))return this.handleCancel();this.handlePending(c,u);return}t.cancelable&&t.preventDefault(),l(a)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===T.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const xr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Nt extends Et{constructor(t){const{event:n}=t,r=Te(n.target);super(t,xr,r)}}Nt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const wr={move:{name:"mousemove"},end:{name:"mouseup"}};var bt;(function(e){e[e.RightClick=2]="RightClick"})(bt||(bt={}));class yr extends Et{constructor(t){super(t,wr,Te(t.event.target))}}yr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===bt.RightClick?!1:(r==null||r({event:n}),!0)}}];const ft={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Cr extends Et{constructor(t){super(t,ft)}static setup(){return window.addEventListener(ft.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ft.move.name,t)};function t(){}}}Cr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var Fe;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Fe||(Fe={}));var rt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(rt||(rt={}));function Sr(e){let{acceleration:t,activator:n=Fe.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:l=5,order:c=rt.TreeOrder,pointerCoordinates:a,scrollableAncestors:u,scrollableAncestorRects:f,delta:h,threshold:p}=e;const g=Rr({delta:h,disabled:!s}),[m,v]=On(),b=i.useRef({x:0,y:0}),y=i.useRef({x:0,y:0}),D=i.useMemo(()=>{switch(n){case Fe.Pointer:return a?{top:a.y,bottom:a.y,left:a.x,right:a.x}:null;case Fe.DraggableRect:return o}},[n,o,a]),w=i.useRef(null),C=i.useCallback(()=>{const N=w.current;if(!N)return;const j=b.current.x*y.current.x,R=b.current.y*y.current.y;N.scrollBy(j,R)},[]),E=i.useMemo(()=>c===rt.TreeOrder?[...u].reverse():u,[c,u]);i.useEffect(()=>{if(!s||!u.length||!D){v();return}for(const N of E){if((r==null?void 0:r(N))===!1)continue;const j=u.indexOf(N),R=f[j];if(!R)continue;const{direction:k,speed:I}=ur(N,R,D,t,p);for(const x of["x","y"])g[x][k[x]]||(I[x]=0,k[x]=0);if(I.x>0||I.y>0){v(),w.current=N,m(C,l),b.current=I,y.current=k;return}}b.current={x:0,y:0},y.current={x:0,y:0},v()},[t,C,r,v,s,l,JSON.stringify(D),JSON.stringify(g),m,u,E,f,JSON.stringify(p)])}const Dr={x:{[P.Backward]:!1,[P.Forward]:!1},y:{[P.Backward]:!1,[P.Forward]:!1}};function Rr(e){let{delta:t,disabled:n}=e;const r=gt(t);return He(o=>{if(n||!r||!o)return Dr;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[P.Backward]:o.x[P.Backward]||s.x===-1,[P.Forward]:o.x[P.Forward]||s.x===1},y:{[P.Backward]:o.y[P.Backward]||s.y===-1,[P.Forward]:o.y[P.Forward]||s.y===1}}},[n,t,r])}function Er(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return He(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function Nr(e,t){return i.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...s]},[]),[e,t])}var Xe;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Xe||(Xe={}));var mt;(function(e){e.Optimized="optimized"})(mt||(mt={}));const Wt=new Map;function jr(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,l]=i.useState(null),{frequency:c,measure:a,strategy:u}=o,f=i.useRef(e),h=b(),p=Ue(h),g=i.useCallback(function(y){y===void 0&&(y=[]),!p.current&&l(D=>D===null?y:D.concat(y.filter(w=>!D.includes(w))))},[p]),m=i.useRef(null),v=He(y=>{if(h&&!n)return Wt;if(!y||y===Wt||f.current!==e||s!=null){const D=new Map;for(let w of e){if(!w)continue;if(s&&s.length>0&&!s.includes(w.id)&&w.rect.current){D.set(w.id,w.rect.current);continue}const C=w.node.current,E=C?new Rt(a(C),C):null;w.rect.current=E,E&&D.set(w.id,E)}return D}return y},[e,s,n,h,a]);return i.useEffect(()=>{f.current=e},[e]),i.useEffect(()=>{h||g()},[n,h]),i.useEffect(()=>{s&&s.length>0&&l(null)},[JSON.stringify(s)]),i.useEffect(()=>{h||typeof c!="number"||m.current!==null||(m.current=setTimeout(()=>{g(),m.current=null},c))},[c,h,g,...r]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:s!=null};function b(){switch(u){case Xe.Always:return!1;case Xe.BeforeDragging:return n;default:return!n}}}function dn(e,t){return He(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function kr(e,t){return dn(e,t)}function Mr(e){let{callback:t,disabled:n}=e;const r=Ct(t),o=i.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return i.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function st(e){let{callback:t,disabled:n}=e;const r=Ct(t),o=i.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return i.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Ir(e){return new Rt(Oe(e),e)}function Ut(e,t,n){t===void 0&&(t=Ir);const[r,o]=i.useState(null);function s(){o(a=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=a??n)!=null?u:null}const f=t(e);return JSON.stringify(a)===JSON.stringify(f)?a:f})}const l=Mr({callback(a){if(e)for(const u of a){const{type:f,target:h}=u;if(f==="childList"&&h instanceof HTMLElement&&h.contains(e)){s();break}}}}),c=st({callback:s});return de(()=>{s(),e?(c==null||c.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(c==null||c.disconnect(),l==null||l.disconnect())},[e]),r}function Tr(e){const t=dn(e);return tn(e,t)}const Vt=[];function Or(e){const t=i.useRef(e),n=He(r=>e?r&&r!==Vt&&e&&t.current&&e.parentNode===t.current.parentNode?r:Dt(e):Vt,[e]);return i.useEffect(()=>{t.current=e},[e]),n}function Lr(e){const[t,n]=i.useState(null),r=i.useRef(e),o=i.useCallback(s=>{const l=ut(s.target);l&&n(c=>c?(c.set(l,pt(l)),new Map(c)):null)},[]);return i.useEffect(()=>{const s=r.current;if(e!==s){l(s);const c=e.map(a=>{const u=ut(a);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,pt(u)]):null}).filter(a=>a!=null);n(c.length?new Map(c):null),r.current=e}return()=>{l(e),l(s)};function l(c){c.forEach(a=>{const u=ut(a);u==null||u.removeEventListener("scroll",o)})}},[o,e]),i.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,l)=>Me(s,l),ie):cn(e):ie,[e,t])}function Xt(e,t){t===void 0&&(t=[]);const n=i.useRef(null);return i.useEffect(()=>{n.current=null},t),i.useEffect(()=>{const r=e!==ie;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?tt(e,n.current):ie}function Ar(e){i.useEffect(()=>{if(!ot)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function $r(e,t){return i.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=l=>{s(l,t)},n},{}),[e,t])}function fn(e){return i.useMemo(()=>e?ir(e):null,[e])}const Yt=[];function zr(e,t){t===void 0&&(t=Oe);const[n]=e,r=fn(n?_(n):null),[o,s]=i.useState(Yt);function l(){s(()=>e.length?e.map(a=>sn(a)?r:new Rt(t(a),a)):Yt)}const c=st({callback:l});return de(()=>{c==null||c.disconnect(),l(),e.forEach(a=>c==null?void 0:c.observe(a))},[e]),o}function Pr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ye(t)?t:e}function Br(e){let{measure:t}=e;const[n,r]=i.useState(null),o=i.useCallback(u=>{for(const{target:f}of u)if(Ye(f)){r(h=>{const p=t(f);return h?{...h,width:p.width,height:p.height}:p});break}},[t]),s=st({callback:o}),l=i.useCallback(u=>{const f=Pr(u);s==null||s.disconnect(),f&&(s==null||s.observe(f)),r(f?t(f):null)},[t,s]),[c,a]=et(l);return i.useMemo(()=>({nodeRef:c,rect:n,setRef:a}),[n,c,a])}const Fr=[{sensor:Nt,options:{}},{sensor:un,options:{}}],Wr={current:{}},Qe={draggable:{measure:zt},droppable:{measure:zt,strategy:Xe.WhileDragging,frequency:mt.Optimized},dragOverlay:{measure:Oe}};class We extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Ur={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new We,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:nt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Qe,measureDroppableContainers:nt,windowRect:null,measuringScheduled:!1},Vr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:nt,draggableNodes:new Map,over:null,measureDroppableContainers:nt},it=i.createContext(Vr),hn=i.createContext(Ur);function Xr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new We}}}function Yr(e,t){switch(t.type){case A.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case A.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case A.DragEnd:case A.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case A.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new We(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case A.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const l=new We(e.droppable.containers);return l.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:l}}}case A.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new We(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Hr(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=i.useContext(it),s=gt(r),l=gt(n==null?void 0:n.id);return i.useEffect(()=>{if(!t&&!r&&s&&l!=null){if(!St(s)||document.activeElement===s.target)return;const c=o.get(l);if(!c)return;const{activatorNode:a,node:u}=c;if(!a.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[a.current,u.current]){if(!f)continue;const h=$n(f);if(h){h.focus();break}}})}},[r,t,o,l,s]),null}function Gr(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function _r(e){return i.useMemo(()=>({draggable:{...Qe.draggable,...e==null?void 0:e.draggable},droppable:{...Qe.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Qe.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function qr(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=i.useRef(!1),{x:l,y:c}=typeof o=="boolean"?{x:o,y:o}:o;de(()=>{if(!l&&!c||!t){s.current=!1;return}if(s.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const f=n(u),h=tn(f,r);if(l||(h.x=0),c||(h.y=0),s.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const p=nn(u);p&&p.scrollBy({top:h.y,left:h.x})}},[t,l,c,r,n])}const gn=i.createContext({...ie,scaleX:1,scaleY:1});var De;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(De||(De={}));const Ht=i.memo(function(t){var n,r,o,s;let{id:l,accessibility:c,autoScroll:a=!0,children:u,sensors:f=Fr,collisionDetection:h=Qn,measuring:p,modifiers:g,...m}=t;const v=i.useReducer(Yr,void 0,Xr),[b,y]=v,[D,w]=Un(),[C,E]=i.useState(De.Uninitialized),N=C===De.Initialized,{draggable:{active:j,nodes:R,translate:k},droppable:{containers:I}}=b,x=j!=null?R.get(j):null,$=i.useRef({initial:null,translated:null}),X=i.useMemo(()=>{var V;return j!=null?{id:j,data:(V=x==null?void 0:x.data)!=null?V:Wr,rect:$}:null},[j,x]),H=i.useRef(null),[fe,be]=i.useState(null),[B,Ee]=i.useState(null),Q=Ue(m,Object.values(m)),z=Ge("DndDescribedBy",l),me=i.useMemo(()=>I.getEnabled(),[I]),W=_r(p),{droppableRects:ee,measureDroppableContainers:L,measuringScheduled:he}=jr(me,{dragging:N,dependencies:[k.x,k.y],config:W.droppable}),U=Er(R,j),ge=i.useMemo(()=>B?vt(B):null,[B]),q=jn(),te=kr(U,W.draggable.measure);qr({activeNode:j!=null?R.get(j):null,config:q.layoutShiftCompensation,initialRect:te,measure:W.draggable.measure});const M=Ut(U,W.draggable.measure,te),Re=Ut(U?U.parentElement:null),ne=i.useRef({activatorEvent:null,active:null,activeNode:U,collisionRect:null,collisions:null,droppableRects:ee,draggableNodes:R,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),le=I.getNodeFor((n=ne.current.over)==null?void 0:n.id),re=Br({measure:W.dragOverlay.measure}),S=(r=re.nodeRef.current)!=null?r:U,O=N?(o=re.rect)!=null?o:M:null,Y=!!(re.nodeRef.current&&re.rect),ce=Tr(Y?null:M),xe=fn(S?_(S):null),ve=Or(N?le??U:null),_e=zr(ve),qe=Gr(g,{transform:{x:k.x-ce.x,y:k.y-ce.y,scaleX:1,scaleY:1},activatorEvent:B,active:X,activeNodeRect:M,containerNodeRect:Re,draggingNodeRect:O,over:ne.current.over,overlayNodeRect:re.rect,scrollableAncestors:ve,scrollableAncestorRects:_e,windowRect:xe}),jt=ge?Me(ge,k):null,kt=Lr(ve),yn=Xt(kt),Cn=Xt(kt,[M]),Ne=Me(qe,yn),je=O?nr(O,qe):null,Le=X&&je?h({active:X,collisionRect:je,droppableRects:ee,droppableContainers:me,pointerCoordinates:jt}):null,Mt=Kn(Le,"id"),[we,It]=i.useState(null),Sn=Y?qe:Me(qe,Cn),Dn=er(Sn,(s=we==null?void 0:we.rect)!=null?s:null,M),lt=i.useRef(null),Tt=i.useCallback((V,J)=>{let{sensor:K,options:ye}=J;if(H.current==null)return;const oe=R.get(H.current);if(!oe)return;const Z=V.nativeEvent,ae=new K({active:H.current,activeNode:oe,event:Z,options:ye,context:ne,onAbort(F){if(!R.get(F))return;const{onDragAbort:ue}=Q.current,pe={id:F};ue==null||ue(pe),D({type:"onDragAbort",event:pe})},onPending(F,Ce,ue,pe){if(!R.get(F))return;const{onDragPending:$e}=Q.current,Se={id:F,constraint:Ce,initialCoordinates:ue,offset:pe};$e==null||$e(Se),D({type:"onDragPending",event:Se})},onStart(F){const Ce=H.current;if(Ce==null)return;const ue=R.get(Ce);if(!ue)return;const{onDragStart:pe}=Q.current,Ae={activatorEvent:Z,active:{id:Ce,data:ue.data,rect:$}};Pe.unstable_batchedUpdates(()=>{pe==null||pe(Ae),E(De.Initializing),y({type:A.DragStart,initialCoordinates:F,active:Ce}),D({type:"onDragStart",event:Ae}),be(lt.current),Ee(Z)})},onMove(F){y({type:A.DragMove,coordinates:F})},onEnd:ke(A.DragEnd),onCancel:ke(A.DragCancel)});lt.current=ae;function ke(F){return async function(){const{active:ue,collisions:pe,over:Ae,scrollAdjustedTranslate:$e}=ne.current;let Se=null;if(ue&&$e){const{cancelDrop:ze}=Q.current;Se={activatorEvent:Z,active:ue,collisions:pe,delta:$e,over:Ae},F===A.DragEnd&&typeof ze=="function"&&await Promise.resolve(ze(Se))&&(F=A.DragCancel)}H.current=null,Pe.unstable_batchedUpdates(()=>{y({type:F}),E(De.Uninitialized),It(null),be(null),Ee(null),lt.current=null;const ze=F===A.DragEnd?"onDragEnd":"onDragCancel";if(Se){const ct=Q.current[ze];ct==null||ct(Se),D({type:ze,event:Se})}})}}},[R]),Rn=i.useCallback((V,J)=>(K,ye)=>{const oe=K.nativeEvent,Z=R.get(ye);if(H.current!==null||!Z||oe.dndKit||oe.defaultPrevented)return;const ae={active:Z};V(K,J.options,ae)===!0&&(oe.dndKit={capturedBy:J.sensor},H.current=ye,Tt(K,J))},[R,Tt]),Ot=Nr(f,Rn);Ar(f),de(()=>{M&&C===De.Initializing&&E(De.Initialized)},[M,C]),i.useEffect(()=>{const{onDragMove:V}=Q.current,{active:J,activatorEvent:K,collisions:ye,over:oe}=ne.current;if(!J||!K)return;const Z={active:J,activatorEvent:K,collisions:ye,delta:{x:Ne.x,y:Ne.y},over:oe};Pe.unstable_batchedUpdates(()=>{V==null||V(Z),D({type:"onDragMove",event:Z})})},[Ne.x,Ne.y]),i.useEffect(()=>{const{active:V,activatorEvent:J,collisions:K,droppableContainers:ye,scrollAdjustedTranslate:oe}=ne.current;if(!V||H.current==null||!J||!oe)return;const{onDragOver:Z}=Q.current,ae=ye.get(Mt),ke=ae&&ae.rect.current?{id:ae.id,rect:ae.rect.current,data:ae.data,disabled:ae.disabled}:null,F={active:V,activatorEvent:J,collisions:K,delta:{x:oe.x,y:oe.y},over:ke};Pe.unstable_batchedUpdates(()=>{It(ke),Z==null||Z(F),D({type:"onDragOver",event:F})})},[Mt]),de(()=>{ne.current={activatorEvent:B,active:X,activeNode:U,collisionRect:je,collisions:Le,droppableRects:ee,draggableNodes:R,draggingNode:S,draggingNodeRect:O,droppableContainers:I,over:we,scrollableAncestors:ve,scrollAdjustedTranslate:Ne},$.current={initial:O,translated:je}},[X,U,Le,je,R,S,O,ee,I,we,ve,Ne]),Sr({...q,delta:k,draggingRect:je,pointerCoordinates:jt,scrollableAncestors:ve,scrollableAncestorRects:_e});const En=i.useMemo(()=>({active:X,activeNode:U,activeNodeRect:M,activatorEvent:B,collisions:Le,containerNodeRect:Re,dragOverlay:re,draggableNodes:R,droppableContainers:I,droppableRects:ee,over:we,measureDroppableContainers:L,scrollableAncestors:ve,scrollableAncestorRects:_e,measuringConfiguration:W,measuringScheduled:he,windowRect:xe}),[X,U,M,B,Le,Re,re,R,I,ee,we,L,ve,_e,W,he,xe]),Nn=i.useMemo(()=>({activatorEvent:B,activators:Ot,active:X,activeNodeRect:M,ariaDescribedById:{draggable:z},dispatch:y,draggableNodes:R,over:we,measureDroppableContainers:L}),[B,Ot,X,M,y,z,R,we,L]);return G.createElement(en.Provider,{value:w},G.createElement(it.Provider,{value:Nn},G.createElement(hn.Provider,{value:En},G.createElement(gn.Provider,{value:Dn},u)),G.createElement(Hr,{disabled:(c==null?void 0:c.restoreFocus)===!1})),G.createElement(Yn,{...c,hiddenTextDescribedById:z}));function jn(){const V=(fe==null?void 0:fe.autoScrollEnabled)===!1,J=typeof a=="object"?a.enabled===!1:a===!1,K=N&&!V&&!J;return typeof a=="object"?{...a,enabled:K}:{enabled:K}}}),Jr=i.createContext(null),Gt="button",Kr="Draggable";function Zr(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=Ge(Kr),{activators:l,activatorEvent:c,active:a,activeNodeRect:u,ariaDescribedById:f,draggableNodes:h,over:p}=i.useContext(it),{role:g=Gt,roleDescription:m="draggable",tabIndex:v=0}=o??{},b=(a==null?void 0:a.id)===t,y=i.useContext(b?gn:Jr),[D,w]=et(),[C,E]=et(),N=$r(l,t),j=Ue(n);de(()=>(h.set(t,{id:t,key:s,node:D,activatorNode:C,data:j}),()=>{const k=h.get(t);k&&k.key===s&&h.delete(t)}),[h,t]);const R=i.useMemo(()=>({role:g,tabIndex:v,"aria-disabled":r,"aria-pressed":b&&g===Gt?!0:void 0,"aria-roledescription":m,"aria-describedby":f.draggable}),[r,g,v,b,m,f.draggable]);return{active:a,activatorEvent:c,activeNodeRect:u,attributes:R,isDragging:b,listeners:r?void 0:N,node:D,over:p,setNodeRef:w,setActivatorNodeRef:E,transform:y}}function Qr(){return i.useContext(hn)}const eo="Droppable",to={timeout:25};function no(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=Ge(eo),{active:l,dispatch:c,over:a,measureDroppableContainers:u}=i.useContext(it),f=i.useRef({disabled:n}),h=i.useRef(!1),p=i.useRef(null),g=i.useRef(null),{disabled:m,updateMeasurementsFor:v,timeout:b}={...to,...o},y=Ue(v??r),D=i.useCallback(()=>{if(!h.current){h.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(y.current)?y.current:[y.current]),g.current=null},b)},[b]),w=st({callback:D,disabled:m||!l}),C=i.useCallback((R,k)=>{w&&(k&&(w.unobserve(k),h.current=!1),R&&w.observe(R))},[w]),[E,N]=et(C),j=Ue(t);return i.useEffect(()=>{!w||!E.current||(w.disconnect(),h.current=!1,w.observe(E.current))},[E,w]),i.useEffect(()=>(c({type:A.RegisterDroppable,element:{id:r,key:s,disabled:n,node:E,rect:p,data:j}}),()=>c({type:A.UnregisterDroppable,key:s,id:r})),[r]),i.useEffect(()=>{n!==f.current.disabled&&(c({type:A.SetDroppableDisabled,id:r,key:s,disabled:n}),f.current.disabled=n)},[r,s,n,c]),{active:l,rect:p,isOver:(a==null?void 0:a.id)===r,node:E,over:a,setNodeRef:N}}function vn(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function ro(e,t){return e.reduce((n,r,o)=>{const s=t.get(r);return s&&(n[o]=s),n},Array(e.length))}function Je(e){return e!==null&&e>=0}function oo(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function so(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Ke={scaleX:1,scaleY:1},io=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:s,index:l}=e;const c=(t=n[o])!=null?t:r;if(!c)return null;const a=lo(n,l,o);if(l===o){const u=n[s];return u?{x:o<s?u.left+u.width-(c.left+c.width):u.left-c.left,y:0,...Ke}:null}return l>o&&l<=s?{x:-c.width-a,y:0,...Ke}:l<o&&l>=s?{x:c.width+a,y:0,...Ke}:{x:0,y:0,...Ke}};function lo(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return!r||!o&&!s?0:n<t?o?r.left-(o.left+o.width):s.left-(r.left+r.width):s?s.left-(r.left+r.width):r.left-(o.left+o.width)}const pn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=vn(t,r,n),l=t[o],c=s[o];return!c||!l?null:{x:c.left-l.left,y:c.top-l.top,scaleX:c.width/l.width,scaleY:c.height/l.height}},Ze={scaleX:1,scaleY:1},co=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:l}=e;const c=(t=s[n])!=null?t:r;if(!c)return null;if(o===n){const u=s[l];return u?{x:0,y:n<l?u.top+u.height-(c.top+c.height):u.top-c.top,...Ze}:null}const a=ao(s,o,n);return o>n&&o<=l?{x:0,y:-c.height-a,...Ze}:o<n&&o>=l?{x:0,y:c.height+a,...Ze}:{x:0,y:0,...Ze}};function ao(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return r?n<t?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const bn="Sortable",mn=G.createContext({activeIndex:-1,containerId:bn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:pn,disabled:{draggable:!1,droppable:!1}});function _t(e){let{children:t,id:n,items:r,strategy:o=pn,disabled:s=!1}=e;const{active:l,dragOverlay:c,droppableRects:a,over:u,measureDroppableContainers:f}=Qr(),h=Ge(bn,n),p=c.rect!==null,g=i.useMemo(()=>r.map(N=>typeof N=="object"&&"id"in N?N.id:N),[r]),m=l!=null,v=l?g.indexOf(l.id):-1,b=u?g.indexOf(u.id):-1,y=i.useRef(g),D=!oo(g,y.current),w=b!==-1&&v===-1||D,C=so(s);de(()=>{D&&m&&f(g)},[D,g,m,f]),i.useEffect(()=>{y.current=g},[g]);const E=i.useMemo(()=>({activeIndex:v,containerId:h,disabled:C,disableTransforms:w,items:g,overIndex:b,useDragOverlay:p,sortedRects:ro(g,a),strategy:o}),[v,h,C.draggable,C.droppable,w,g,b,a,p,o]);return G.createElement(mn.Provider,{value:E},t)}const uo=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return vn(n,r,o).indexOf(t)},fo=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:l,previousItems:c,previousContainerId:a,transition:u}=e;return!u||!r||c!==s&&o===l?!1:n?!0:l!==o&&t===a},ho={duration:200,easing:"ease"},xn="transform",go=Ve.Transition.toString({property:xn,duration:0,easing:"linear"}),vo={roleDescription:"sortable"};function po(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,l]=i.useState(null),c=i.useRef(n);return de(()=>{if(!t&&n!==c.current&&r.current){const a=o.current;if(a){const u=Oe(r.current,{ignoreTransform:!0}),f={x:a.left-u.left,y:a.top-u.top,scaleX:a.width/u.width,scaleY:a.height/u.height};(f.x||f.y)&&l(f)}}n!==c.current&&(c.current=n)},[t,n,r,o]),i.useEffect(()=>{s&&l(null)},[s]),s}function bo(e){let{animateLayoutChanges:t=fo,attributes:n,disabled:r,data:o,getNewIndex:s=uo,id:l,strategy:c,resizeObserverConfig:a,transition:u=ho}=e;const{items:f,containerId:h,activeIndex:p,disabled:g,disableTransforms:m,sortedRects:v,overIndex:b,useDragOverlay:y,strategy:D}=i.useContext(mn),w=mo(r,g),C=f.indexOf(l),E=i.useMemo(()=>({sortable:{containerId:h,index:C,items:f},...o}),[h,o,C,f]),N=i.useMemo(()=>f.slice(f.indexOf(l)),[f,l]),{rect:j,node:R,isOver:k,setNodeRef:I}=no({id:l,data:E,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:N,...a}}),{active:x,activatorEvent:$,activeNodeRect:X,attributes:H,setNodeRef:fe,listeners:be,isDragging:B,over:Ee,setActivatorNodeRef:Q,transform:z}=Zr({id:l,data:E,attributes:{...vo,...n},disabled:w.draggable}),me=Tn(I,fe),W=!!x,ee=W&&!m&&Je(p)&&Je(b),L=!y&&B,he=L&&ee?z:null,ge=ee?he??(c??D)({rects:v,activeNodeRect:X,activeIndex:p,overIndex:b,index:C}):null,q=Je(p)&&Je(b)?s({id:l,items:f,activeIndex:p,overIndex:b}):C,te=x==null?void 0:x.id,M=i.useRef({activeId:te,items:f,newIndex:q,containerId:h}),Re=f!==M.current.items,ne=t({active:x,containerId:h,isDragging:B,isSorting:W,id:l,index:C,items:f,newIndex:M.current.newIndex,previousItems:M.current.items,previousContainerId:M.current.containerId,transition:u,wasDragging:M.current.activeId!=null}),le=po({disabled:!ne,index:C,node:R,rect:j});return i.useEffect(()=>{W&&M.current.newIndex!==q&&(M.current.newIndex=q),h!==M.current.containerId&&(M.current.containerId=h),f!==M.current.items&&(M.current.items=f)},[W,q,h,f]),i.useEffect(()=>{if(te===M.current.activeId)return;if(te!=null&&M.current.activeId==null){M.current.activeId=te;return}const S=setTimeout(()=>{M.current.activeId=te},50);return()=>clearTimeout(S)},[te]),{active:x,activeIndex:p,attributes:H,data:E,rect:j,index:C,newIndex:q,items:f,isOver:k,isSorting:W,isDragging:B,listeners:be,node:R,overIndex:b,over:Ee,setNodeRef:me,setActivatorNodeRef:Q,setDroppableNodeRef:I,setDraggableNodeRef:fe,transform:le??ge,transition:re()};function re(){if(le||Re&&M.current.newIndex===C)return go;if(!(L&&!St($)||!u)&&(W||ne))return Ve.Transition.toString({...u,property:xn})}}function mo(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}T.Down,T.Right,T.Up,T.Left;function xo(e){const t=e.find(n=>n.path==="manifest.json"||n.path.endsWith("/manifest.json"));if(!t)return null;try{return JSON.parse(t.content)}catch{return null}}function wo(e){const t=e.find(n=>n.path==="theme.css"||n.path.endsWith("/theme.css"));return(t==null?void 0:t.content)||""}function qt(e,t){const n=e.find(r=>r.path===t||r.path.endsWith(`/${t}`));return(n==null?void 0:n.content)||""}function Jt(e,t,n){return`<!DOCTYPE html>
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
8
|
<meta charset="utf-8">
|
|
@@ -102,6 +102,6 @@ html, body {
|
|
|
102
102
|
<body>
|
|
103
103
|
${e}
|
|
104
104
|
</body>
|
|
105
|
-
</html>`}const wn="pneuma-slide-nav-position";function Co(){try{const e=localStorage.getItem(wn);if(e==="left"||e==="bottom"||e==="hidden")return e}catch{}return"
|
|
106
|
-
`})}).catch(()=>{})},[C,k,a]);i.useEffect(()=>{a>=I&&I>0&&u(I-1)},[I,a]);const Z=((ne=k[a])==null?void 0:ne.file)||null;i.useEffect(()=>{l==null||l(Z)},[Z,l]);const z=k[a],be=z?qt(e,z.file):"",W=i.useMemo(()=>Jt(be,E,N),[be,E,N]),Q=i.useMemo(()=>k.map(S=>yo(qt(e,S.file),E)),[e,k,E]),L=i.useCallback(S=>{S>=0&&S<I&&(u(S),n(null))},[I,n]),fe=i.useCallback(()=>L(a-1),[a,L]),U=i.useCallback(()=>L(a+1),[a,L]);if(i.useEffect(()=>{const S=O=>{O.key==="ArrowLeft"?(O.preventDefault(),L(a-1)):O.key==="ArrowRight"?(O.preventDefault(),L(a+1)):O.key==="Escape"&&N&&(t?n(null):c("view"))};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[a,L,N,t,n,c]),i.useEffect(()=>{const S=O=>{var De;if(((De=O.data)==null?void 0:De.type)!=="pneuma:select")return;const re=O.data.selection;if(!re){n(null);return}n({type:re.type,content:re.content,level:re.level,file:z==null?void 0:z.file})};return window.addEventListener("message",S),()=>window.removeEventListener("message",S)},[n,z]),!C||I===0)return d.jsxs("div",{className:"flex flex-col h-full",children:[d.jsx(ht,{previewMode:r,onSetPreviewMode:c,slideIndex:0,slideCount:0,onPrev:fe,onNext:U,onGoToSlide:L,navPosition:f,onCycleNav:$,onToggleFullscreen:X,isGridView:m,onToggleGridView:Y,zoomLevel:b,onZoomIn:de,onZoomOut:pe,onZoomFit:B}),d.jsx("div",{className:"flex items-center justify-center flex-1 text-neutral-500",children:C?"No slides in manifest.json":"No manifest.json found in workspace"})]});const he=(s==null?void 0:s.slideWidth)||1280,_=(s==null?void 0:s.slideHeight)||720,ee=f!=="hidden"?d.jsx(Ro,{slides:k,activeIndex:a,onSelect:L,onReorder:Re,thumbnailSrcdocs:Q,position:f,virtualWidth:he,virtualHeight:_}):null,M=b/100,Se=he*M,te=_*M,le=d.jsx("div",{className:"flex-1 flex items-center justify-center bg-neutral-900 min-w-0 min-h-0 overflow-auto",children:d.jsx("div",{className:"shrink-0",style:{width:Se,height:te},children:d.jsx("div",{className:"bg-black rounded-lg overflow-hidden shadow-2xl origin-top-left",style:{width:he,height:_,transform:`scale(${M})`},children:d.jsx("iframe",{ref:D,srcDoc:W,title:(z==null?void 0:z.title)||"Slide",className:"w-full h-full border-0",sandbox:"allow-scripts"},`${a}-${o}`)})})});return m?d.jsxs("div",{ref:w,className:"flex flex-col h-full",children:[d.jsx(ht,{previewMode:r,onSetPreviewMode:c,slideIndex:a,slideCount:I,onPrev:fe,onNext:U,onGoToSlide:L,navPosition:f,onCycleNav:$,onToggleFullscreen:X,isGridView:m,onToggleGridView:Y,zoomLevel:b,onZoomIn:de,onZoomOut:pe,onZoomFit:B}),d.jsx("div",{className:"flex-1 overflow-auto bg-neutral-900 p-4",children:d.jsx("div",{className:"grid gap-4",style:{gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))"},children:k.map((S,O)=>d.jsxs("button",{onClick:()=>{L(O),v(!1)},className:`flex flex-col gap-2 p-2 rounded-lg transition-colors cursor-pointer text-left ${O===a?"bg-cc-primary/10 ring-2 ring-cc-primary":"hover:bg-cc-hover"}`,children:[d.jsx(xt,{srcdoc:Q[O],isActive:O===a,width:280,height:157.5,virtualWidth:he,virtualHeight:_}),d.jsxs("span",{className:`text-xs px-1 truncate ${O===a?"text-cc-primary":"text-cc-muted"}`,children:[String(O+1).padStart(2,"0")," ",S.title]})]},S.file))})})]}):p?d.jsxs("div",{ref:w,className:"flex flex-col h-full bg-black",children:[d.jsx("div",{className:"flex-1 flex items-center justify-center",children:d.jsx("iframe",{srcDoc:Jt(be,E,!1),title:(z==null?void 0:z.title)||"Slide",className:"w-full h-full border-0",sandbox:"allow-scripts"})}),d.jsxs("div",{className:"absolute bottom-4 right-4 text-white/40 text-sm font-mono pointer-events-none",children:[a+1," / ",I]})]}):d.jsxs("div",{ref:w,className:"flex flex-col h-full",children:[d.jsx(ht,{previewMode:r,onSetPreviewMode:c,slideIndex:a,slideCount:I,onPrev:fe,onNext:U,onGoToSlide:L,navPosition:f,onCycleNav:$,onToggleFullscreen:X,isGridView:m,onToggleGridView:Y,zoomLevel:b,onZoomIn:de,onZoomOut:pe,onZoomFit:B}),f==="left"?d.jsxs("div",{className:"flex flex-1 min-h-0",children:[ee,le]}):f==="bottom"?d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[le,ee]}):d.jsx("div",{className:"flex flex-1 min-h-0",children:le})]})}function Ro({slides:e,activeIndex:t,onSelect:n,onReorder:r,thumbnailSrcdocs:o,position:s,virtualWidth:l,virtualHeight:c}){const a=i.useRef(null),u=Gn(Hn(Nt,{activationConstraint:{distance:5}})),f=i.useMemo(()=>e.map(g=>g.file),[e]),h=i.useCallback(g=>{const{active:m,over:v}=g;if(v&&m.id!==v.id){const b=f.indexOf(m.id),y=f.indexOf(v.id);b!==-1&&y!==-1&&r(b,y)}},[f,r]);i.useEffect(()=>{var g;(g=a.current)==null||g.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[t]);const p=s==="bottom"?io:co;return s==="bottom"?d.jsx("div",{className:"shrink-0 border-t border-cc-border bg-cc-bg",children:d.jsx(Ht,{sensors:u,collisionDetection:$t,onDragEnd:h,children:d.jsx(_t,{items:f,strategy:p,children:d.jsx("div",{className:"flex overflow-x-auto p-2 gap-2",children:e.map((g,m)=>d.jsx(Kt,{id:g.file,ref:m===t?a:void 0,index:m,title:g.title,isActive:m===t,srcdoc:o[m],onClick:()=>n(m),layout:"horizontal",virtualWidth:l,virtualHeight:c},g.file))})})})}):d.jsx("div",{className:"w-52 shrink-0 border-r border-cc-border bg-cc-bg overflow-y-auto",children:d.jsx(Ht,{sensors:u,collisionDetection:$t,onDragEnd:h,children:d.jsx(_t,{items:f,strategy:p,children:d.jsx("div",{className:"p-2 flex flex-col gap-2",children:e.map((g,m)=>d.jsx(Kt,{id:g.file,ref:m===t?a:void 0,index:m,title:g.title,isActive:m===t,srcdoc:o[m],onClick:()=>n(m),layout:"vertical",virtualWidth:l,virtualHeight:c},g.file))})})})})}const Kt=i.forwardRef(function({id:t,index:n,title:r,isActive:o,srcdoc:s,onClick:l,layout:c,virtualWidth:a,virtualHeight:u},f){const{attributes:h,listeners:p,setNodeRef:g,transform:m,transition:v,isDragging:b}=bo({id:t}),y={transform:Ve.Transform.toString(m),transition:v,zIndex:b?10:void 0},D=i.useCallback(w=>{g(w),typeof f=="function"?f(w):f&&(f.current=w)},[g,f]);return c==="horizontal"?d.jsxs("div",{ref:D,style:y,...h,...p,onClick:l,className:`shrink-0 flex flex-col items-center gap-1 cursor-pointer group ${o?"":"opacity-60 hover:opacity-100"} ${b?"opacity-70 scale-105 shadow-lg":""}`,children:[d.jsx(xt,{srcdoc:s,isActive:o,width:144,height:81,virtualWidth:a,virtualHeight:u}),d.jsxs("span",{className:`text-[10px] max-w-[144px] truncate ${o?"text-cc-primary":"text-cc-muted group-hover:text-cc-fg"}`,children:[String(n+1).padStart(2,"0")," ",r]})]}):d.jsxs("div",{ref:D,style:y,...h,...p,onClick:l,className:`w-full flex flex-col gap-1 cursor-pointer group ${o?"":"opacity-60 hover:opacity-100"} ${b?"opacity-70 scale-105 shadow-lg":""}`,children:[d.jsx(xt,{srcdoc:s,isActive:o,virtualWidth:a,virtualHeight:u}),d.jsxs("div",{className:"flex items-baseline gap-1.5 px-0.5",children:[d.jsx("span",{className:`text-[10px] font-mono shrink-0 ${o?"text-cc-primary":"text-cc-muted/60"}`,children:String(n+1).padStart(2,"0")}),d.jsx("span",{className:`text-xs truncate ${o?"text-cc-primary":"text-cc-muted group-hover:text-cc-fg"}`,children:r})]})]})});function xt({srcdoc:e,isActive:t,width:n,height:r,virtualWidth:o,virtualHeight:s}){const l=o||1280,c=s||720,a=n??192,u=r??108,f=a/l;return d.jsx("div",{className:`relative rounded overflow-hidden border-2 transition-colors ${t?"border-cc-primary shadow-[0_0_0_1px_rgba(217,119,87,0.3)]":"border-transparent hover:border-cc-border"}`,style:{width:a,height:u},children:d.jsx("iframe",{srcDoc:e,tabIndex:-1,className:"pointer-events-none border-0 origin-top-left",style:{width:l,height:c,transform:`scale(${f})`},sandbox:"","aria-hidden":"true"})})}function ht({previewMode:e,onSetPreviewMode:t,slideIndex:n,slideCount:r,onPrev:o,onNext:s,onGoToSlide:l,navPosition:c,onCycleNav:a,onToggleFullscreen:u,isGridView:f,onToggleGridView:h,zoomLevel:p,onZoomIn:g,onZoomOut:m,onZoomFit:v}){const[b,y]=i.useState(!1),[D,w]=i.useState(""),C=i.useRef(null),E=i.useCallback(()=>{r<=0||(w(String(n+1)),y(!0))},[r,n]);i.useEffect(()=>{var x,$;b&&((x=C.current)==null||x.focus(),($=C.current)==null||$.select())},[b]);const N=i.useCallback(()=>{const x=parseInt(D,10);!isNaN(x)&&x>=1&&x<=r&&l(x-1),y(!1)},[D,r,l]),j=i.useCallback(()=>{y(!1)},[]),R=[{value:"view",label:"View",icon:d.jsx(Eo,{})},{value:"select",label:"Select",icon:d.jsx(No,{})}],k=i.useCallback(()=>{window.open("/export/slides","_blank")},[]),I=c==="left"?"Navigator: sidebar (click to switch)":c==="bottom"?"Navigator: bottom (click to hide)":"Navigator: hidden (click to show)";return d.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-cc-border bg-cc-card/50 shrink-0",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("button",{onClick:a,className:"flex items-center justify-center w-7 h-7 rounded text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer",title:I,children:d.jsx(Ao,{position:c})}),d.jsx("div",{className:"w-px h-4 bg-cc-border mx-0.5"}),d.jsx("button",{onClick:o,disabled:n<=0,className:"flex items-center justify-center w-7 h-7 rounded text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",title:"Previous slide (←)",children:d.jsx(jo,{})}),b?d.jsxs("div",{className:"flex items-center gap-0.5",children:[d.jsx("input",{ref:C,type:"text",value:D,onChange:x=>w(x.target.value),onKeyDown:x=>{x.key==="Enter"?N():x.key==="Escape"&&j(),x.stopPropagation()},onBlur:N,className:"w-8 text-xs text-cc-fg font-mono tabular-nums text-center bg-cc-bg border border-cc-border rounded px-0.5 py-0 outline-none focus:border-cc-primary"}),d.jsxs("span",{className:"text-xs text-cc-muted font-mono",children:["/",r]})]}):d.jsx("button",{onClick:E,className:"text-xs text-cc-muted font-mono tabular-nums min-w-[4ch] text-center hover:text-cc-fg cursor-pointer",title:"Click to jump to slide",children:r>0?`${n+1}/${r}`:"—"}),d.jsx("button",{onClick:s,disabled:n>=r-1,className:"flex items-center justify-center w-7 h-7 rounded text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",title:"Next slide (→)",children:d.jsx(ko,{})})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{onClick:m,disabled:p<=30,className:"flex items-center justify-center w-6 h-6 rounded text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",title:"Zoom out",children:d.jsx(Mo,{})}),d.jsxs("button",{onClick:v,className:"text-[10px] text-cc-muted hover:text-cc-fg font-mono tabular-nums min-w-[3.5ch] text-center cursor-pointer",title:"Reset zoom to fit",children:[p,"%"]}),d.jsx("button",{onClick:g,disabled:p>=200,className:"flex items-center justify-center w-6 h-6 rounded text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",title:"Zoom in",children:d.jsx(Io,{})})]}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("div",{className:"flex items-center bg-cc-bg/60 rounded-md p-0.5",children:R.map(x=>d.jsxs("button",{onClick:()=>t(x.value),className:`flex items-center gap-1 px-2 py-1 rounded text-xs transition-colors cursor-pointer ${e===x.value?"bg-cc-primary/20 text-cc-primary":"text-cc-muted hover:text-cc-fg"}`,title:x.value==="view"?"Read-only view":"Select elements (Esc to exit)",children:[x.icon,d.jsx("span",{children:x.label})]},x.value))}),d.jsx("div",{className:"w-px h-4 bg-cc-border"}),d.jsx("button",{onClick:h,className:`flex items-center justify-center w-7 h-7 rounded transition-colors cursor-pointer ${f?"bg-cc-primary/20 text-cc-primary":"text-cc-muted hover:text-cc-fg hover:bg-cc-hover"}`,title:"Grid overview",children:d.jsx(To,{})}),d.jsx("button",{onClick:u,className:"flex items-center justify-center w-7 h-7 rounded text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer",title:"Fullscreen",children:d.jsx(Lo,{})}),d.jsx("button",{onClick:k,className:"flex items-center justify-center w-7 h-7 rounded text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer",title:"Export slides (open printable page)",children:d.jsx(Oo,{})})]})]})}function Eo(){return d.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:[d.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5z"}),d.jsx("circle",{cx:"8",cy:"8",r:"2"})]})}function No(){return d.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:d.jsx("path",{d:"M3 2l4 12 2-5 5-2L3 2z",strokeLinejoin:"round"})})}function jo(){return d.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"w-3.5 h-3.5",children:d.jsx("path",{d:"M10 3L5 8l5 5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ko(){return d.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"w-3.5 h-3.5",children:d.jsx("path",{d:"M6 3l5 5-5 5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Mo(){return d.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"w-3 h-3",children:d.jsx("path",{d:"M3 8h10",strokeLinecap:"round"})})}function Io(){return d.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"w-3 h-3",children:d.jsx("path",{d:"M8 3v10M3 8h10",strokeLinecap:"round"})})}function To(){return d.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:[d.jsx("rect",{x:"1.5",y:"2",width:"5",height:"5",rx:"0.5"}),d.jsx("rect",{x:"9.5",y:"2",width:"5",height:"5",rx:"0.5"}),d.jsx("rect",{x:"1.5",y:"9",width:"5",height:"5",rx:"0.5"}),d.jsx("rect",{x:"9.5",y:"9",width:"5",height:"5",rx:"0.5"})]})}function Oo(){return d.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:[d.jsx("path",{d:"M8 2v8M5 7l3 3 3-3",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M2 11v2a1 1 0 001 1h10a1 1 0 001-1v-2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Lo(){return d.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:d.jsx("path",{d:"M2 6V3a1 1 0 011-1h3M10 2h3a1 1 0 011 1v3M14 10v3a1 1 0 01-1 1h-3M6 14H3a1 1 0 01-1-1v-3",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ao({position:e}){return e==="left"?d.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:[d.jsx("rect",{x:"1",y:"2",width:"14",height:"12",rx:"1.5"}),d.jsx("line",{x1:"6",y1:"2",x2:"6",y2:"14"})]}):e==="bottom"?d.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:[d.jsx("rect",{x:"1",y:"2",width:"14",height:"12",rx:"1.5"}),d.jsx("line",{x1:"1",y1:"10",x2:"15",y2:"10"})]}):d.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:[d.jsx("rect",{x:"1",y:"2",width:"14",height:"12",rx:"1.5"}),d.jsx("path",{d:"M5.5 5.5l5 5M10.5 5.5l-5 5",strokeLinecap:"round"})]})}const Po={manifest:In,viewer:{PreviewComponent:Do,extractContext(e,t){const n=[],r=o=>{var l;const s=t.find(c=>c.path==="manifest.json"||c.path.endsWith("/manifest.json"));if(!s)return"";try{const a=(l=JSON.parse(s.content).slides)==null?void 0:l.find(u=>u.file===o);return(a==null?void 0:a.title)||""}catch{return""}};if(e!=null&&e.file){const o=r(e.file),s=o?`${e.file} "${o}"`:e.file;n.push(`[Context: slide, viewing: ${s}]`)}if(e&&e.type!=="viewing"&&e.content){const o=e.level?`${e.type} (level ${e.level})`:e.type;n.push(`[User selected: ${o} "${e.content}"]`)}return n.join(`
|
|
105
|
+
</html>`}const wn="pneuma-slide-nav-position";function Co(){try{const e=localStorage.getItem(wn);if(e==="left"||e==="bottom"||e==="hidden")return e}catch{}return"bottom"}function So(e){try{localStorage.setItem(wn,e)}catch{}}function Do({files:e,selection:t,onSelect:n,mode:r,imageVersion:o,initParams:s,onActiveFileChange:l}){var re;const c=Mn(S=>S.setPreviewMode),[a,u]=i.useState(0),[f,h]=i.useState(Co),[p,g]=i.useState(!1),[m,v]=i.useState(!1),[b,y]=i.useState(100),D=i.useRef(null),w=i.useRef(null),C=i.useMemo(()=>xo(e),[e]),E=i.useMemo(()=>wo(e),[e]),N=r==="select",[j,R]=i.useState([]);i.useEffect(()=>{R((C==null?void 0:C.slides)||[])},[C]);const k=j,I=k.length,x=i.useCallback(S=>{h(S),So(S)},[]),$=i.useCallback(()=>{x(f==="left"?"bottom":f==="bottom"?"hidden":"left")},[f,x]),X=i.useCallback(()=>{w.current&&(document.fullscreenElement?document.exitFullscreen():w.current.requestFullscreen())},[]);i.useEffect(()=>{const S=()=>g(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",S),()=>document.removeEventListener("fullscreenchange",S)},[]);const H=i.useCallback(()=>v(S=>!S),[]),fe=i.useCallback(()=>y(S=>Math.min(200,S+10)),[]),be=i.useCallback(()=>y(S=>Math.max(30,S-10)),[]),B=i.useCallback(()=>y(100),[]),Ee=i.useCallback((S,O)=>{if(!C)return;const Y=[...k],[ce]=Y.splice(S,1);Y.splice(O,0,ce),R(Y),a===S?u(O):a>S&&a<=O?u(a-1):a<S&&a>=O&&u(a+1);const xe={...C,slides:Y};fetch("/api/files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:"manifest.json",content:JSON.stringify(xe,null,2)+`
|
|
106
|
+
`})}).catch(()=>{})},[C,k,a]);i.useEffect(()=>{a>=I&&I>0&&u(I-1)},[I,a]);const Q=((re=k[a])==null?void 0:re.file)||null;i.useEffect(()=>{l==null||l(Q)},[Q,l]);const z=k[a],me=z?qt(e,z.file):"",W=i.useMemo(()=>Jt(me,E,N),[me,E,N]),ee=i.useMemo(()=>k.map(S=>yo(qt(e,S.file),E)),[e,k,E]),L=i.useCallback(S=>{S>=0&&S<I&&(u(S),n(null))},[I,n]),he=i.useCallback(()=>L(a-1),[a,L]),U=i.useCallback(()=>L(a+1),[a,L]);if(i.useEffect(()=>{const S=O=>{var ce,xe;const Y=(ce=O.target)==null?void 0:ce.tagName;Y==="INPUT"||Y==="TEXTAREA"||(xe=O.target)!=null&&xe.isContentEditable||(O.key==="ArrowLeft"?(O.preventDefault(),L(a-1)):O.key==="ArrowRight"?(O.preventDefault(),L(a+1)):O.key==="Escape"&&N&&(t?n(null):c("view")))};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[a,L,N,t,n,c]),i.useEffect(()=>{const S=O=>{var ce;if(((ce=O.data)==null?void 0:ce.type)!=="pneuma:select")return;const Y=O.data.selection;if(!Y){n(null);return}n({type:Y.type,content:Y.content,level:Y.level,file:z==null?void 0:z.file})};return window.addEventListener("message",S),()=>window.removeEventListener("message",S)},[n,z]),!C||I===0)return d.jsxs("div",{className:"flex flex-col h-full",children:[d.jsx(ht,{previewMode:r,onSetPreviewMode:c,slideIndex:0,slideCount:0,onPrev:he,onNext:U,onGoToSlide:L,navPosition:f,onCycleNav:$,onToggleFullscreen:X,isGridView:m,onToggleGridView:H,zoomLevel:b,onZoomIn:fe,onZoomOut:be,onZoomFit:B}),d.jsx("div",{className:"flex items-center justify-center flex-1 text-neutral-500",children:C?"No slides in manifest.json":"No manifest.json found in workspace"})]});const ge=(s==null?void 0:s.slideWidth)||1280,q=(s==null?void 0:s.slideHeight)||720,te=f!=="hidden"?d.jsx(Ro,{slides:k,activeIndex:a,onSelect:L,onReorder:Ee,thumbnailSrcdocs:ee,position:f,virtualWidth:ge,virtualHeight:q}):null,M=b/100,Re=ge*M,ne=q*M,le=d.jsx("div",{className:"flex-1 flex items-center justify-center bg-neutral-900 min-w-0 min-h-0 overflow-auto",children:d.jsx("div",{className:"shrink-0",style:{width:Re,height:ne},children:d.jsx("div",{className:"bg-black rounded-lg overflow-hidden shadow-2xl origin-top-left",style:{width:ge,height:q,transform:`scale(${M})`},children:d.jsx("iframe",{ref:D,srcDoc:W,title:(z==null?void 0:z.title)||"Slide",className:"w-full h-full border-0",sandbox:"allow-scripts"},`${a}-${o}`)})})});return m?d.jsxs("div",{ref:w,className:"flex flex-col h-full",children:[d.jsx(ht,{previewMode:r,onSetPreviewMode:c,slideIndex:a,slideCount:I,onPrev:he,onNext:U,onGoToSlide:L,navPosition:f,onCycleNav:$,onToggleFullscreen:X,isGridView:m,onToggleGridView:H,zoomLevel:b,onZoomIn:fe,onZoomOut:be,onZoomFit:B}),d.jsx("div",{className:"flex-1 overflow-auto bg-neutral-900 p-4",children:d.jsx("div",{className:"grid gap-4",style:{gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))"},children:k.map((S,O)=>d.jsxs("button",{onClick:()=>{L(O),v(!1)},className:`flex flex-col gap-2 p-2 rounded-lg transition-colors cursor-pointer text-left ${O===a?"bg-cc-primary/10 ring-2 ring-cc-primary":"hover:bg-cc-hover"}`,children:[d.jsx(xt,{srcdoc:ee[O],isActive:O===a,width:280,height:157.5,virtualWidth:ge,virtualHeight:q}),d.jsxs("span",{className:`text-xs px-1 truncate ${O===a?"text-cc-primary":"text-cc-muted"}`,children:[String(O+1).padStart(2,"0")," ",S.title]})]},S.file))})})]}):p?d.jsxs("div",{ref:w,className:"flex flex-col h-full bg-black",children:[d.jsx("div",{className:"flex-1 flex items-center justify-center",children:d.jsx("iframe",{srcDoc:Jt(me,E,!1),title:(z==null?void 0:z.title)||"Slide",className:"w-full h-full border-0",sandbox:"allow-scripts"})}),d.jsxs("div",{className:"absolute bottom-4 right-4 text-white/40 text-sm font-mono pointer-events-none",children:[a+1," / ",I]})]}):d.jsxs("div",{ref:w,className:"flex flex-col h-full",children:[d.jsx(ht,{previewMode:r,onSetPreviewMode:c,slideIndex:a,slideCount:I,onPrev:he,onNext:U,onGoToSlide:L,navPosition:f,onCycleNav:$,onToggleFullscreen:X,isGridView:m,onToggleGridView:H,zoomLevel:b,onZoomIn:fe,onZoomOut:be,onZoomFit:B}),f==="left"?d.jsxs("div",{className:"flex flex-1 min-h-0",children:[te,le]}):f==="bottom"?d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[le,te]}):d.jsx("div",{className:"flex flex-1 min-h-0",children:le})]})}function Ro({slides:e,activeIndex:t,onSelect:n,onReorder:r,thumbnailSrcdocs:o,position:s,virtualWidth:l,virtualHeight:c}){const a=i.useRef(null),u=Gn(Hn(Nt,{activationConstraint:{distance:5}})),f=i.useMemo(()=>e.map(g=>g.file),[e]),h=i.useCallback(g=>{const{active:m,over:v}=g;if(v&&m.id!==v.id){const b=f.indexOf(m.id),y=f.indexOf(v.id);b!==-1&&y!==-1&&r(b,y)}},[f,r]);i.useEffect(()=>{var g;(g=a.current)==null||g.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[t]);const p=s==="bottom"?io:co;return s==="bottom"?d.jsx("div",{className:"shrink-0 border-t border-cc-border bg-cc-bg",children:d.jsx(Ht,{sensors:u,collisionDetection:$t,onDragEnd:h,children:d.jsx(_t,{items:f,strategy:p,children:d.jsx("div",{className:"flex overflow-x-auto p-2 gap-2",children:e.map((g,m)=>d.jsx(Kt,{id:g.file,ref:m===t?a:void 0,index:m,title:g.title,isActive:m===t,srcdoc:o[m],onClick:()=>n(m),layout:"horizontal",virtualWidth:l,virtualHeight:c},g.file))})})})}):d.jsx("div",{className:"w-52 shrink-0 border-r border-cc-border bg-cc-bg overflow-y-auto",children:d.jsx(Ht,{sensors:u,collisionDetection:$t,onDragEnd:h,children:d.jsx(_t,{items:f,strategy:p,children:d.jsx("div",{className:"p-2 flex flex-col gap-2",children:e.map((g,m)=>d.jsx(Kt,{id:g.file,ref:m===t?a:void 0,index:m,title:g.title,isActive:m===t,srcdoc:o[m],onClick:()=>n(m),layout:"vertical",virtualWidth:l,virtualHeight:c},g.file))})})})})}const Kt=i.forwardRef(function({id:t,index:n,title:r,isActive:o,srcdoc:s,onClick:l,layout:c,virtualWidth:a,virtualHeight:u},f){const{attributes:h,listeners:p,setNodeRef:g,transform:m,transition:v,isDragging:b}=bo({id:t}),y={transform:Ve.Transform.toString(m),transition:v,zIndex:b?10:void 0},D=i.useCallback(w=>{g(w),typeof f=="function"?f(w):f&&(f.current=w)},[g,f]);return c==="horizontal"?d.jsxs("div",{ref:D,style:y,...h,...p,onClick:l,className:`shrink-0 flex flex-col items-center gap-1 cursor-pointer group ${o?"":"opacity-60 hover:opacity-100"} ${b?"opacity-70 scale-105 shadow-lg":""}`,children:[d.jsx(xt,{srcdoc:s,isActive:o,width:144,height:81,virtualWidth:a,virtualHeight:u}),d.jsxs("span",{className:`text-[10px] max-w-[144px] truncate ${o?"text-cc-primary":"text-cc-muted group-hover:text-cc-fg"}`,children:[String(n+1).padStart(2,"0")," ",r]})]}):d.jsxs("div",{ref:D,style:y,...h,...p,onClick:l,className:`w-full flex flex-col gap-1 cursor-pointer group ${o?"":"opacity-60 hover:opacity-100"} ${b?"opacity-70 scale-105 shadow-lg":""}`,children:[d.jsx(xt,{srcdoc:s,isActive:o,virtualWidth:a,virtualHeight:u}),d.jsxs("div",{className:"flex items-baseline gap-1.5 px-0.5",children:[d.jsx("span",{className:`text-[10px] font-mono shrink-0 ${o?"text-cc-primary":"text-cc-muted/60"}`,children:String(n+1).padStart(2,"0")}),d.jsx("span",{className:`text-xs truncate ${o?"text-cc-primary":"text-cc-muted group-hover:text-cc-fg"}`,children:r})]})]})});function xt({srcdoc:e,isActive:t,width:n,height:r,virtualWidth:o,virtualHeight:s}){const l=o||1280,c=s||720,a=n??192,u=r??108,f=a/l;return d.jsx("div",{className:`relative rounded overflow-hidden border-2 transition-colors ${t?"border-cc-primary shadow-[0_0_0_1px_rgba(217,119,87,0.3)]":"border-transparent hover:border-cc-border"}`,style:{width:a,height:u},children:d.jsx("iframe",{srcDoc:e,tabIndex:-1,className:"pointer-events-none border-0 origin-top-left",style:{width:l,height:c,transform:`scale(${f})`},sandbox:"","aria-hidden":"true"})})}function ht({previewMode:e,onSetPreviewMode:t,slideIndex:n,slideCount:r,onPrev:o,onNext:s,onGoToSlide:l,navPosition:c,onCycleNav:a,onToggleFullscreen:u,isGridView:f,onToggleGridView:h,zoomLevel:p,onZoomIn:g,onZoomOut:m,onZoomFit:v}){const[b,y]=i.useState(!1),[D,w]=i.useState(""),C=i.useRef(null),E=i.useCallback(()=>{r<=0||(w(String(n+1)),y(!0))},[r,n]);i.useEffect(()=>{var x,$;b&&((x=C.current)==null||x.focus(),($=C.current)==null||$.select())},[b]);const N=i.useCallback(()=>{const x=parseInt(D,10);!isNaN(x)&&x>=1&&x<=r&&l(x-1),y(!1)},[D,r,l]),j=i.useCallback(()=>{y(!1)},[]),R=[{value:"view",label:"View",icon:d.jsx(Eo,{})},{value:"select",label:"Select",icon:d.jsx(No,{})}],k=i.useCallback(()=>{window.open("/export/slides","_blank")},[]),I=c==="left"?"Navigator: sidebar (click to switch)":c==="bottom"?"Navigator: bottom (click to hide)":"Navigator: hidden (click to show)";return d.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-cc-border bg-cc-card/50 shrink-0",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("button",{onClick:a,className:"flex items-center justify-center w-7 h-7 rounded text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer",title:I,children:d.jsx(Ao,{position:c})}),d.jsx("div",{className:"w-px h-4 bg-cc-border mx-0.5"}),d.jsx("button",{onClick:o,disabled:n<=0,className:"flex items-center justify-center w-7 h-7 rounded text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",title:"Previous slide (←)",children:d.jsx(jo,{})}),b?d.jsxs("div",{className:"flex items-center gap-0.5",children:[d.jsx("input",{ref:C,type:"text",value:D,onChange:x=>w(x.target.value),onKeyDown:x=>{x.key==="Enter"?N():x.key==="Escape"&&j(),x.stopPropagation()},onBlur:N,className:"w-8 text-xs text-cc-fg font-mono tabular-nums text-center bg-cc-bg border border-cc-border rounded px-0.5 py-0 outline-none focus:border-cc-primary"}),d.jsxs("span",{className:"text-xs text-cc-muted font-mono",children:["/",r]})]}):d.jsx("button",{onClick:E,className:"text-xs text-cc-muted font-mono tabular-nums min-w-[4ch] text-center hover:text-cc-fg cursor-pointer",title:"Click to jump to slide",children:r>0?`${n+1}/${r}`:"—"}),d.jsx("button",{onClick:s,disabled:n>=r-1,className:"flex items-center justify-center w-7 h-7 rounded text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",title:"Next slide (→)",children:d.jsx(ko,{})})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{onClick:m,disabled:p<=30,className:"flex items-center justify-center w-6 h-6 rounded text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",title:"Zoom out",children:d.jsx(Mo,{})}),d.jsxs("button",{onClick:v,className:"text-[10px] text-cc-muted hover:text-cc-fg font-mono tabular-nums min-w-[3.5ch] text-center cursor-pointer",title:"Reset zoom to fit",children:[p,"%"]}),d.jsx("button",{onClick:g,disabled:p>=200,className:"flex items-center justify-center w-6 h-6 rounded text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",title:"Zoom in",children:d.jsx(Io,{})})]}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("div",{className:"flex items-center bg-cc-bg/60 rounded-md p-0.5",children:R.map(x=>d.jsxs("button",{onClick:()=>t(x.value),className:`flex items-center gap-1 px-2 py-1 rounded text-xs transition-colors cursor-pointer ${e===x.value?"bg-cc-primary/20 text-cc-primary":"text-cc-muted hover:text-cc-fg"}`,title:x.value==="view"?"Read-only view":"Select elements (Esc to exit)",children:[x.icon,d.jsx("span",{children:x.label})]},x.value))}),d.jsx("div",{className:"w-px h-4 bg-cc-border"}),d.jsx("button",{onClick:h,className:`flex items-center justify-center w-7 h-7 rounded transition-colors cursor-pointer ${f?"bg-cc-primary/20 text-cc-primary":"text-cc-muted hover:text-cc-fg hover:bg-cc-hover"}`,title:"Grid overview",children:d.jsx(To,{})}),d.jsx("button",{onClick:u,className:"flex items-center justify-center w-7 h-7 rounded text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer",title:"Fullscreen",children:d.jsx(Lo,{})}),d.jsx("button",{onClick:k,className:"flex items-center justify-center w-7 h-7 rounded text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer",title:"Export slides (open printable page)",children:d.jsx(Oo,{})})]})]})}function Eo(){return d.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:[d.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5z"}),d.jsx("circle",{cx:"8",cy:"8",r:"2"})]})}function No(){return d.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:d.jsx("path",{d:"M3 2l4 12 2-5 5-2L3 2z",strokeLinejoin:"round"})})}function jo(){return d.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"w-3.5 h-3.5",children:d.jsx("path",{d:"M10 3L5 8l5 5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ko(){return d.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"w-3.5 h-3.5",children:d.jsx("path",{d:"M6 3l5 5-5 5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Mo(){return d.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"w-3 h-3",children:d.jsx("path",{d:"M3 8h10",strokeLinecap:"round"})})}function Io(){return d.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"w-3 h-3",children:d.jsx("path",{d:"M8 3v10M3 8h10",strokeLinecap:"round"})})}function To(){return d.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:[d.jsx("rect",{x:"1.5",y:"2",width:"5",height:"5",rx:"0.5"}),d.jsx("rect",{x:"9.5",y:"2",width:"5",height:"5",rx:"0.5"}),d.jsx("rect",{x:"1.5",y:"9",width:"5",height:"5",rx:"0.5"}),d.jsx("rect",{x:"9.5",y:"9",width:"5",height:"5",rx:"0.5"})]})}function Oo(){return d.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:[d.jsx("path",{d:"M8 2v8M5 7l3 3 3-3",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M2 11v2a1 1 0 001 1h10a1 1 0 001-1v-2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Lo(){return d.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:d.jsx("path",{d:"M2 6V3a1 1 0 011-1h3M10 2h3a1 1 0 011 1v3M14 10v3a1 1 0 01-1 1h-3M6 14H3a1 1 0 01-1-1v-3",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ao({position:e}){return e==="left"?d.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:[d.jsx("rect",{x:"1",y:"2",width:"14",height:"12",rx:"1.5"}),d.jsx("line",{x1:"6",y1:"2",x2:"6",y2:"14"})]}):e==="bottom"?d.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:[d.jsx("rect",{x:"1",y:"2",width:"14",height:"12",rx:"1.5"}),d.jsx("line",{x1:"1",y1:"10",x2:"15",y2:"10"})]}):d.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:[d.jsx("rect",{x:"1",y:"2",width:"14",height:"12",rx:"1.5"}),d.jsx("path",{d:"M5.5 5.5l5 5M10.5 5.5l-5 5",strokeLinecap:"round"})]})}const Po={manifest:In,viewer:{PreviewComponent:Do,extractContext(e,t){const n=[],r=o=>{var l;const s=t.find(c=>c.path==="manifest.json"||c.path.endsWith("/manifest.json"));if(!s)return"";try{const a=(l=JSON.parse(s.content).slides)==null?void 0:l.find(u=>u.file===o);return(a==null?void 0:a.title)||""}catch{return""}};if(e!=null&&e.file){const o=r(e.file),s=o?`${e.file} "${o}"`:e.file;n.push(`[Context: slide, viewing: ${s}]`)}if(e&&e.type!=="viewing"&&e.content){const o=e.level?`${e.type} (level ${e.level})`:e.type;n.push(`[User selected: ${o} "${e.content}"]`)}return n.join(`
|
|
107
107
|
`)},updateStrategy:"full-reload"}};export{Po as default};
|
package/dist/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Pneuma Skills</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-J1QIN1v7.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-DF_mi9_1.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body class="bg-neutral-950 text-neutral-100">
|
|
@@ -202,7 +202,7 @@ function loadNavPosition(): NavigatorPosition {
|
|
|
202
202
|
const v = localStorage.getItem(NAV_STORAGE_KEY);
|
|
203
203
|
if (v === "left" || v === "bottom" || v === "hidden") return v;
|
|
204
204
|
} catch {}
|
|
205
|
-
return "
|
|
205
|
+
return "bottom";
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
function saveNavPosition(pos: NavigatorPosition) {
|
|
@@ -367,9 +367,13 @@ export default function SlidePreview({
|
|
|
367
367
|
[activeSlideIndex, goToSlide],
|
|
368
368
|
);
|
|
369
369
|
|
|
370
|
-
// Keyboard navigation
|
|
370
|
+
// Keyboard navigation (skip when focus is inside editable elements)
|
|
371
371
|
useEffect(() => {
|
|
372
372
|
const handleKeyDown = (e: KeyboardEvent) => {
|
|
373
|
+
const tag = (e.target as HTMLElement)?.tagName;
|
|
374
|
+
if (tag === "INPUT" || tag === "TEXTAREA" || (e.target as HTMLElement)?.isContentEditable) {
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
373
377
|
if (e.key === "ArrowLeft") {
|
|
374
378
|
e.preventDefault();
|
|
375
379
|
goToSlide(activeSlideIndex - 1);
|